libqalculate-2.8.2/0000755000175000017500000000000013401033233011156 500000000000000libqalculate-2.8.2/missing0000755000175000017500000001533613350174156012522 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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 General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libqalculate-2.8.2/ltmain.sh0000644000175000017500000120671413401033077012737 00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2018-07-24.06 # libtool (GNU libtool) 2.4.6.42-b88ce # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6.42-b88ce package_revision=2.4.6.42 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2018-07-24.06; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2018 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 3 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) case $func_quote_portable_result in *[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2018 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 3 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2018-07-24.06; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6.42-b88ce' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6.42-b88ce automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $func_quote_arg_result" func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_arg_result" func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_arg pretty "$arg" arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty "$var_value" relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done func_quote eval cd "`pwd`" func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty,unquoted "$var_value" relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. func_quote eval cd "`pwd`" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote_arg pretty,unquoted "$relink_command" relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: libqalculate-2.8.2/config.h.in0000644000175000017500000000640613401033112013123 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* The package name for gettext */ #undef GETTEXT_PACKAGE /* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYCURRENT /* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Use icu */ #undef HAVE_ICU /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Use libcurl */ #undef HAVE_LIBCURL /* Define if the text port uses readline */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_MPFR_H /* Define to 1 if you have the `pipe2' function. */ #undef HAVE_PIPE2 /* Define if pthreads are present. */ #undef HAVE_PTHREADS /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_HISTORY_H /* Define to 1 if you have the header file. */ #undef HAVE_READLINE_READLINE_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if `int_n_cs_precedes' is a member of `struct lconv'. */ #undef HAVE_STRUCT_LCONV_INT_N_CS_PRECEDES /* Define to 1 if `int_p_cs_precedes' is a member of `struct lconv'. */ #undef HAVE_STRUCT_LCONV_INT_P_CS_PRECEDES /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UNORDERED_MAP /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* The directory in which qalculate's locale data will be stored */ #undef PACKAGE_LOCALE_DIR /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION libqalculate-2.8.2/ABOUT-NLS0000644000175000017500000026747413141107436012361 000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this 'ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU 'gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU 'gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. 1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU 'gettext'. Other packages have their own ways to internationalization, predating GNU 'gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU 'gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: ./configure --disable-nls will _totally_ disable translation of messages. When you already have GNU 'gettext' installed on your system and run configure without an option for your new package, 'configure' will probably detect the previously built and installed 'libintl' library and will decide to use it. If not, you may have to to use the '--with-libintl-prefix' option to tell 'configure' where to look for it. Internationalized packages usually have many 'po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at 'configure' time by using the '--disable-nls' switch, all available translations are installed together with the package. However, the environment variable 'LINGUAS' may be set, prior to configuration, to limit the installed set. 'LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the 'LANG' environment variable to the appropriate 'LL_CC' combination. If you happen to have the 'LC_ALL' or some other 'LC_xxx' environment variables set, you should unset them before setting 'LANG', otherwise the setting of 'LANG' will not have the desired effect. Here 'LL' is an ISO 639 two-letter language code, and 'CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute 'setenv LANG de_DE' (in 'csh'), 'export LANG; LANG=de_DE' (in 'sh') or 'export LANG=de_DE' (in 'bash'). This can be done from your '.login' or '.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, 'de_AT' is used for Austria, and 'pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of 'LL_CC', with 'LL' denoting the language and 'CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as 'LL' or 'LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command 'locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called 'LANGUAGE'. GNU 'gettext' gives preference to 'LANGUAGE' over 'LANG' for the purpose of message handling, but you still need to have 'LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set 'LANGUAGE' to 'sv:de' while leaving 'LANG' to 'sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from 'no' to 'nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under 'nb' and some older ones under 'no', it's recommended for Norwegian users to set 'LANGUAGE' to 'nb:no' so that both newer and older translations are used. In the 'LANGUAGE' environment variable, but not in the 'LANG' environment variable, 'LL_CC' combinations can be abbreviated as 'LL' to denote the language's main dialect. For example, 'de' is equivalent to 'de_DE' (German as spoken in Germany), and 'pt' to 'pt_PT' (Portuguese as spoken in Portugal) in this context. 1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, 'http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has '-request' appended. For example, speakers of Swedish can send a message to 'sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to 'coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.4 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of Jun 2014. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am an ar as ast az be bg bn bn_IN bs ca crh cs +---------------------------------------------------+ a2ps | [] [] [] | aegis | | anubis | | aspell | [] [] [] | bash | [] [] [] | bfd | | binutils | [] | bison | | bison-runtime | [] | buzztrax | [] | ccd2cue | | ccide | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | [] | datamash | | denemo | [] [] | dfarc | [] | dialog | [] [] [] | dico | | diffutils | [] | dink | [] | direvent | | doodle | [] | dos2unix | | dos2unix-man | | e2fsprogs | [] [] | enscript | [] | exif | [] | fetchmail | [] [] | findutils | [] | flex | [] | freedink | [] [] | fusionforge | | gas | | gawk | [] | gcal | [] | gcc | | gdbm | | gettext-examples | [] [] [] [] [] | gettext-runtime | [] [] [] | gettext-tools | [] [] | gjay | | glunarclock | [] [] [] | gnubiff | [] | gnubik | [] | gnucash | () () [] | gnuchess | | gnulib | [] | gnunet | | gnunet-gtk | | gold | | gphoto2 | [] | gprof | [] | gramadoir | | grep | [] [] [] | grub | [] | gsasl | | gss | | gst-plugins-bad | [] [] | gst-plugins-base | [] [] [] | gst-plugins-good | [] [] [] | gst-plugins-ugly | [] [] [] | gstreamer | [] [] [] [] | gtick | [] | gtkam | [] [] | gtkspell | [] [] [] [] [] | guix | | guix-packages | | gutenprint | [] | hello | [] | help2man | | help2man-texi | | hylafax | | idutils | | iso_15924 | [] | iso_3166 | [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | iso_639_5 | | jwhois | | kbd | [] | klavaro | [] [] [] [] [] | ld | [] | leafpad | [] [] [] [] | libc | [] [] [] | libexif | () | libextractor | | libgnutls | [] | libgphoto2 | [] | libgphoto2_port | [] | libgsasl | | libiconv | [] [] | libidn | [] | liferea | [] [] [] [] | lilypond | [] [] | lordsawar | [] | lprng | | lynx | [] [] | m4 | [] | mailfromd | | mailutils | | make | [] | man-db | [] [] | man-db-manpages | | midi-instruments | [] [] [] | minicom | [] | mkisofs | [] | myserver | [] | nano | [] [] [] | opcodes | | parted | [] | pies | | pnmixer | | popt | [] | procps-ng | | procps-ng-man | | psmisc | [] | pspp | [] | pushover | [] | pwdutils | | pyspread | | radius | [] | recode | [] [] [] | recutils | | rpm | | rush | | sarg | | sed | [] [] [] [] | sharutils | [] | shishi | | skribilo | | solfege | [] [] | solfege-manual | | spotmachine | | sudo | [] [] | sudoers | [] [] | sysstat | [] | tar | [] [] [] | texinfo | [] [] | texinfo_document | [] [] | tigervnc | [] | tin | | tin-man | | tracgoogleappsa... | | trader | | util-linux | [] | ve | | vice | | vmm | | vorbis-tools | [] | wastesedge | | wcd | | wcd-man | | wdiff | [] [] | wget | [] | wyslij-po | | xboard | | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ af am an ar as ast az be bg bn bn_IN bs ca crh cs 4 0 2 5 3 11 0 8 25 3 3 1 55 4 74 da de el en en_GB en_ZA eo es et eu fa fi fr +--------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] [] | aegis | [] [] [] [] | anubis | [] [] [] [] [] | aspell | [] [] [] [] [] [] [] | bash | [] [] [] | bfd | [] [] [] [] | binutils | [] [] [] | bison | [] [] [] [] [] [] [] [] | bison-runtime | [] [] [] [] [] [] [] [] | buzztrax | [] [] [] [] | ccd2cue | [] [] [] [] | ccide | [] [] [] [] [] [] | cflow | [] [] [] [] [] | clisp | [] [] [] [] [] | coreutils | [] [] [] [] [] | cpio | [] [] [] [] [] | cppi | [] [] [] [] [] | cpplib | [] [] [] [] [] [] | cryptsetup | [] [] [] [] [] | datamash | [] [] [] [] | denemo | [] | dfarc | [] [] [] [] [] [] | dialog | [] [] [] [] [] [] [] [] [] | dico | [] [] [] [] | diffutils | [] [] [] [] [] [] | dink | [] [] [] [] [] [] | direvent | [] [] [] [] | doodle | [] [] [] [] | dos2unix | [] [] [] [] [] | dos2unix-man | [] [] [] | e2fsprogs | [] [] [] [] [] | enscript | [] [] [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] () [] [] [] [] [] | findutils | [] [] [] [] [] [] [] [] | flex | [] [] [] [] [] [] | freedink | [] [] [] [] [] [] [] [] | fusionforge | [] [] [] | gas | [] [] [] | gawk | [] [] [] [] [] | gcal | [] [] [] [] | gcc | [] | gdbm | [] [] [] [] [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] | gjay | [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | () [] [] () | gnubik | [] [] [] [] [] | gnucash | [] () () () () () () | gnuchess | [] [] [] [] | gnulib | [] [] [] [] [] [] [] | gnunet | [] | gnunet-gtk | [] | gold | [] [] [] | gphoto2 | [] () [] [] | gprof | [] [] [] [] [] [] | gramadoir | [] [] [] [] [] | grep | [] [] [] [] [] [] [] | grub | [] [] [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] [] [] | gstreamer | [] [] [] [] [] [] [] | gtick | [] () [] [] [] | gtkam | [] () [] [] [] [] | gtkspell | [] [] [] [] [] [] [] [] | guix | [] [] | guix-packages | | gutenprint | [] [] [] [] | hello | [] [] [] [] [] [] [] [] | help2man | [] [] [] [] [] [] [] | help2man-texi | [] [] [] | hylafax | [] [] | idutils | [] [] [] [] [] | iso_15924 | [] () [] [] () [] () | iso_3166 | [] () [] [] [] [] () [] () | iso_3166_2 | [] () () () | iso_4217 | [] () [] [] [] () [] () | iso_639 | [] () [] [] () [] () | iso_639_3 | () () () | iso_639_5 | () () () | jwhois | [] [] [] [] [] | kbd | [] [] [] [] [] [] | klavaro | [] [] [] [] [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] [] | libc | [] [] [] [] [] | libexif | [] [] () [] [] | libextractor | [] | libgnutls | [] [] [] [] | libgphoto2 | [] () [] | libgphoto2_port | [] () [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] [] [] | libidn | [] [] [] [] [] | liferea | [] () [] [] [] [] [] | lilypond | [] [] [] [] [] [] | lordsawar | [] [] | lprng | | lynx | [] [] [] [] [] [] | m4 | [] [] [] [] [] [] | mailfromd | [] | mailutils | [] [] [] [] | make | [] [] [] [] [] | man-db | [] [] [] [] | man-db-manpages | [] [] | midi-instruments | [] [] [] [] [] [] [] [] [] | minicom | [] [] [] [] [] | mkisofs | [] [] [] | myserver | [] [] [] [] | nano | [] [] [] [] [] [] [] | opcodes | [] [] [] [] [] | parted | [] [] [] | pies | [] | pnmixer | [] [] | popt | [] [] [] [] [] [] | procps-ng | [] [] | procps-ng-man | [] [] | psmisc | [] [] [] [] [] [] [] | pspp | [] [] [] | pushover | () [] [] [] | pwdutils | [] [] [] | pyspread | [] [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] | recutils | [] [] [] [] | rpm | [] [] [] [] [] | rush | [] [] [] | sarg | [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] [] [] | skribilo | [] [] [] | solfege | [] [] [] [] [] [] [] [] | solfege-manual | [] [] [] [] [] | spotmachine | [] [] [] [] [] | sudo | [] [] [] [] [] [] | sudoers | [] [] [] [] [] [] | sysstat | [] [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] [] [] [] | texinfo_document | [] [] [] [] | tigervnc | [] [] [] [] [] [] | tin | [] [] [] [] | tin-man | [] | tracgoogleappsa... | [] [] [] [] [] | trader | [] [] [] [] [] [] | util-linux | [] [] [] [] | ve | [] [] [] [] [] | vice | () () () | vmm | [] [] | vorbis-tools | [] [] [] [] | wastesedge | [] | wcd | [] [] [] [] | wcd-man | [] | wdiff | [] [] [] [] [] [] [] | wget | [] [] [] [] [] [] | wyslij-po | [] [] [] [] | xboard | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] [] | +--------------------------------------------------+ da de el en en_GB en_ZA eo es et eu fa fi fr 119 131 32 1 6 0 94 95 22 13 4 102 139 ga gd gl gu he hi hr hu hy ia id is it ja ka kk +-------------------------------------------------+ a2ps | [] [] [] [] | aegis | [] | anubis | [] [] [] [] | aspell | [] [] [] [] [] | bash | [] [] [] [] | bfd | [] [] | binutils | [] [] [] | bison | [] | bison-runtime | [] [] [] [] [] [] [] [] | buzztrax | | ccd2cue | [] | ccide | [] [] | cflow | [] [] [] | clisp | | coreutils | [] [] | cpio | [] [] [] [] [] [] | cppi | [] [] [] [] [] | cpplib | [] [] | cryptsetup | [] | datamash | | denemo | [] | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] | dink | [] | direvent | [] | doodle | [] [] | dos2unix | [] [] | dos2unix-man | | e2fsprogs | [] [] | enscript | [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] | findutils | [] [] [] [] [] [] [] | flex | [] | freedink | [] [] [] [] | fusionforge | | gas | [] | gawk | [] () [] | gcal | | gcc | | gdbm | | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] | gettext-tools | [] [] [] | gjay | [] | glunarclock | [] [] [] [] [] [] | gnubiff | [] [] () | gnubik | [] [] [] | gnucash | () () () () () | gnuchess | | gnulib | [] [] [] [] [] | gnunet | | gnunet-gtk | | gold | [] [] | gphoto2 | [] [] [] [] | gprof | [] [] [] [] | gramadoir | [] [] [] | grep | [] [] [] [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] | gst-plugins-base | [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | guix | | guix-packages | | gutenprint | [] [] [] | hello | [] [] [] [] [] | help2man | [] [] [] | help2man-texi | | hylafax | [] | idutils | [] [] | iso_15924 | [] [] [] [] [] [] | iso_3166 | [] [] [] [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] | iso_4217 | [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | iso_639_5 | | jwhois | [] [] [] [] | kbd | [] [] [] | klavaro | [] [] [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] () | libc | [] [] [] [] [] | libexif | [] | libextractor | | libgnutls | [] | libgphoto2 | [] [] | libgphoto2_port | [] [] | libgsasl | [] [] [] [] | libiconv | [] [] [] [] [] [] [] | libidn | [] [] [] [] | liferea | [] [] [] [] [] | lilypond | [] | lordsawar | | lprng | [] | lynx | [] [] [] [] | m4 | [] [] [] [] [] | mailfromd | | mailutils | | make | [] [] [] [] | man-db | [] [] | man-db-manpages | [] [] | midi-instruments | [] [] [] [] [] [] [] [] [] | minicom | [] [] [] | mkisofs | [] [] | myserver | [] | nano | [] [] [] [] [] [] | opcodes | [] [] [] | parted | [] [] [] [] [] | pies | | pnmixer | [] [] | popt | [] [] [] [] [] [] [] [] [] [] | procps-ng | | procps-ng-man | | psmisc | [] [] [] [] | pspp | [] [] | pushover | [] | pwdutils | [] | pyspread | | radius | [] | recode | [] [] [] [] [] [] [] | recutils | | rpm | [] | rush | [] | sarg | | sed | [] [] [] [] [] [] [] | sharutils | | shishi | | skribilo | [] | solfege | [] [] | solfege-manual | | spotmachine | | sudo | [] [] [] [] | sudoers | [] [] [] | sysstat | [] [] [] [] | tar | [] [] [] [] [] [] | texinfo | [] [] [] | texinfo_document | [] [] [] | tigervnc | | tin | | tin-man | | tracgoogleappsa... | [] [] [] [] | trader | [] [] | util-linux | [] | ve | [] | vice | () () | vmm | | vorbis-tools | [] [] | wastesedge | [] | wcd | | wcd-man | | wdiff | [] [] [] | wget | [] [] [] [] | wyslij-po | [] [] [] | xboard | | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ ga gd gl gu he hi hr hu hy ia id is it ja ka kk 35 2 47 4 8 2 60 71 2 6 81 11 87 57 0 3 kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl +--------------------------------------------------+ a2ps | [] [] | aegis | [] | anubis | [] [] [] | aspell | [] [] | bash | [] [] | bfd | | binutils | | bison | [] | bison-runtime | [] [] [] [] [] [] | buzztrax | | ccd2cue | | ccide | [] [] | cflow | [] | clisp | [] | coreutils | [] [] | cpio | [] | cppi | | cpplib | [] | cryptsetup | [] | datamash | [] [] | denemo | | dfarc | [] [] | dialog | [] [] [] [] [] [] | dico | | diffutils | [] [] [] | dink | [] | direvent | [] | doodle | [] | dos2unix | [] [] | dos2unix-man | [] | e2fsprogs | [] | enscript | [] | exif | [] [] [] | fetchmail | [] | findutils | [] [] | flex | [] | freedink | [] [] | fusionforge | | gas | | gawk | [] | gcal | | gcc | | gdbm | | gettext-examples | [] [] [] [] [] [] | gettext-runtime | [] [] [] | gettext-tools | [] | gjay | | glunarclock | [] [] | gnubiff | [] | gnubik | [] [] | gnucash | () () () () () () () [] | gnuchess | [] [] | gnulib | [] | gnunet | | gnunet-gtk | | gold | | gphoto2 | [] | gprof | [] [] | gramadoir | [] | grep | [] [] | grub | [] [] [] | gsasl | [] | gss | | gst-plugins-bad | [] [] [] | gst-plugins-base | [] [] [] | gst-plugins-good | [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | [] [] [] | gtick | [] | gtkam | [] [] | gtkspell | [] [] [] [] [] [] [] | guix | | guix-packages | | gutenprint | [] | hello | [] [] [] | help2man | [] | help2man-texi | | hylafax | [] | idutils | [] | iso_15924 | () [] [] | iso_3166 | [] [] [] () [] [] [] [] [] [] | iso_3166_2 | () [] | iso_4217 | () [] [] [] | iso_639 | [] [] () [] [] [] [] | iso_639_3 | [] () [] | iso_639_5 | () | jwhois | [] [] | kbd | [] | klavaro | [] [] | ld | | leafpad | [] [] [] [] [] | libc | [] [] | libexif | [] | libextractor | [] | libgnutls | [] [] | libgphoto2 | [] | libgphoto2_port | [] | libgsasl | [] | libiconv | [] [] | libidn | [] | liferea | [] [] [] | lilypond | [] | lordsawar | | lprng | | lynx | [] | m4 | [] | mailfromd | | mailutils | | make | [] [] | man-db | [] | man-db-manpages | [] | midi-instruments | [] [] [] [] [] [] [] | minicom | [] | mkisofs | [] | myserver | | nano | [] [] [] | opcodes | [] | parted | [] [] | pies | | pnmixer | [] | popt | [] [] [] [] [] | procps-ng | | procps-ng-man | | psmisc | [] | pspp | [] [] | pushover | | pwdutils | [] | pyspread | | radius | [] | recode | [] [] | recutils | [] | rpm | [] | rush | [] | sarg | | sed | [] [] | sharutils | [] | shishi | | skribilo | | solfege | [] [] | solfege-manual | [] | spotmachine | [] | sudo | [] [] [] | sudoers | [] [] [] | sysstat | [] [] | tar | [] [] [] | texinfo | [] | texinfo_document | [] | tigervnc | [] | tin | | tin-man | | tracgoogleappsa... | [] [] [] | trader | [] | util-linux | [] | ve | [] | vice | [] | vmm | [] | vorbis-tools | [] | wastesedge | [] | wcd | [] | wcd-man | [] | wdiff | [] | wget | [] [] | wyslij-po | [] | xboard | [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +--------------------------------------------------+ kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl 5 15 4 6 0 13 23 3 3 3 4 11 2 42 1 125 nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +------------------------------------------------+ a2ps | [] [] [] [] [] [] [] | aegis | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] [] [] | bash | [] [] [] [] [] [] | bfd | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] [] | buzztrax | [] | ccd2cue | [] [] | ccide | [] [] [] | cflow | [] [] [] | clisp | [] | coreutils | [] [] [] [] | cpio | [] [] [] | cppi | [] [] [] | cpplib | [] [] [] | cryptsetup | [] [] [] | datamash | [] [] | denemo | | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] | dico | [] | diffutils | [] [] [] | dink | | direvent | [] [] [] | doodle | [] [] | dos2unix | [] [] [] [] | dos2unix-man | [] [] | e2fsprogs | [] | enscript | [] [] [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] [] [] [] | fusionforge | | gas | | gawk | [] | gcal | | gcc | | gdbm | [] [] [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] [] | gjay | [] | glunarclock | [] [] [] [] [] [] | gnubiff | [] | gnubik | [] [] [] [] | gnucash | () () () () () [] | gnuchess | [] [] | gnulib | [] [] [] [] [] | gnunet | | gnunet-gtk | | gold | | gphoto2 | [] [] [] [] [] | gprof | [] [] [] [] | gramadoir | [] [] | grep | [] [] [] [] [] [] | grub | [] [] [] [] [] | gsasl | [] [] [] | gss | [] [] [] [] | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] [] | gstreamer | [] [] [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] | guix | | guix-packages | | gutenprint | [] [] | hello | [] [] [] [] [] [] | help2man | [] [] [] [] | help2man-texi | [] | hylafax | | idutils | [] [] [] | iso_15924 | [] () [] [] [] [] | iso_3166 | [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] () [] | iso_4217 | [] [] () [] [] [] [] [] | iso_639 | [] [] [] () [] [] [] [] [] [] | iso_639_3 | [] () | iso_639_5 | () [] | jwhois | [] [] [] [] | kbd | [] [] | klavaro | [] [] [] [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] | libc | [] [] [] | libexif | [] () [] | libextractor | [] | libgnutls | [] | libgphoto2 | [] | libgphoto2_port | [] [] [] [] [] | libgsasl | [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] [] | liferea | [] [] [] [] () [] [] | lilypond | | lordsawar | | lprng | [] | lynx | [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | midi-instruments | [] [] [] [] [] [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | [] [] | nano | [] [] [] [] [] [] | opcodes | | parted | [] [] [] [] [] [] | pies | [] | pnmixer | [] | popt | [] [] [] [] [] [] | procps-ng | [] | procps-ng-man | [] | psmisc | [] [] [] [] | pspp | [] [] | pushover | | pwdutils | [] | pyspread | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | recutils | [] [] | rpm | [] | rush | [] [] [] | sarg | [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] | shishi | [] [] | skribilo | [] | solfege | [] [] [] | solfege-manual | [] [] | spotmachine | [] [] | sudo | [] [] [] [] [] [] | sudoers | [] [] [] [] | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] | texinfo | [] [] [] | texinfo_document | [] [] | tigervnc | [] [] [] | tin | [] | tin-man | | tracgoogleappsa... | [] [] [] [] | trader | [] [] | util-linux | [] [] | ve | [] [] [] | vice | | vmm | | vorbis-tools | [] [] [] | wastesedge | | wcd | | wcd-man | | wdiff | [] [] [] [] [] | wget | [] [] [] [] [] | wyslij-po | [] [] [] [] | xboard | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] | +------------------------------------------------+ nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 7 3 6 114 1 12 88 32 82 3 40 45 7 101 sv sw ta te tg th tr uk ur vi wa wo zh_CN +----------------------------------------------+ a2ps | [] [] [] [] [] | aegis | [] | anubis | [] [] [] [] | aspell | [] [] [] [] [] | bash | [] [] [] [] | bfd | [] [] [] | binutils | [] [] [] | bison | [] [] [] [] | bison-runtime | [] [] [] [] [] [] | buzztrax | [] [] [] | ccd2cue | [] [] [] | ccide | [] [] [] [] | cflow | [] [] [] [] | clisp | | coreutils | [] [] [] | cpio | [] [] [] [] [] | cppi | [] [] [] [] | cpplib | [] [] [] [] [] | cryptsetup | [] [] [] | datamash | [] [] [] | denemo | [] | dfarc | [] [] | dialog | [] [] [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] | dink | [] | direvent | [] [] | doodle | [] [] | dos2unix | [] [] [] [] | dos2unix-man | [] [] [] | e2fsprogs | [] [] [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] | freedink | [] [] [] | fusionforge | | gas | [] | gawk | [] [] [] | gcal | [] [] [] | gcc | [] | gdbm | [] [] | gettext-examples | [] [] [] [] [] | gettext-runtime | [] [] [] [] [] | gettext-tools | [] [] [] [] [] | gjay | [] [] [] | glunarclock | [] [] [] [] | gnubiff | [] [] | gnubik | [] [] [] [] | gnucash | () () () () [] | gnuchess | [] [] [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gold | [] [] | gphoto2 | [] [] [] [] | gprof | [] [] [] [] | gramadoir | [] [] [] | grep | [] [] [] [] [] | grub | [] [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] | guix | | guix-packages | | gutenprint | [] [] [] [] | hello | [] [] [] [] [] [] | help2man | [] [] [] | help2man-texi | [] | hylafax | [] | idutils | [] [] [] | iso_15924 | [] () [] [] () [] | iso_3166 | [] [] () [] [] () [] [] | iso_3166_2 | () [] [] () [] | iso_4217 | [] () [] [] () [] | iso_639 | [] [] [] () [] [] () [] [] | iso_639_3 | [] () [] [] () | iso_639_5 | () [] () | jwhois | [] [] [] [] | kbd | [] [] [] [] | klavaro | [] [] [] [] [] [] | ld | [] [] [] [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] [] | libexif | [] [] () | libextractor | [] [] | libgnutls | [] [] [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] [] | libgsasl | [] [] [] [] | libiconv | [] [] [] [] [] | libidn | () [] [] [] | liferea | [] [] [] [] [] | lilypond | [] | lordsawar | | lprng | [] | lynx | [] [] [] [] | m4 | [] [] [] | mailfromd | [] [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] | midi-instruments | [] [] [] [] [] [] | minicom | [] [] | mkisofs | [] [] [] | myserver | [] | nano | [] [] [] [] | opcodes | [] [] [] | parted | [] [] [] [] [] | pies | [] [] | pnmixer | [] [] [] | popt | [] [] [] [] [] [] [] | procps-ng | [] [] | procps-ng-man | [] | psmisc | [] [] [] [] | pspp | [] [] [] | pushover | [] | pwdutils | [] [] | pyspread | [] | radius | [] [] | recode | [] [] [] [] | recutils | [] [] [] | rpm | [] [] [] [] | rush | [] [] | sarg | | sed | [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] [] | skribilo | [] [] | solfege | [] [] [] [] | solfege-manual | [] | spotmachine | [] [] [] | sudo | [] [] [] [] [] | sudoers | [] [] [] [] | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] | texinfo | [] [] [] | texinfo_document | [] | tigervnc | [] [] [] | tin | [] | tin-man | | tracgoogleappsa... | [] [] [] [] [] | trader | [] | util-linux | [] [] [] [] | ve | [] [] [] [] | vice | () () | vmm | | vorbis-tools | [] [] | wastesedge | | wcd | [] [] [] | wcd-man | [] | wdiff | [] [] [] [] | wget | [] [] [] | wyslij-po | [] [] | xboard | [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] | +----------------------------------------------+ sv sw ta te tg th tr uk ur vi wa wo zh_CN 106 1 4 3 0 13 51 115 1 125 7 1 100 zh_HK zh_TW +-------------+ a2ps | | 30 aegis | | 9 anubis | | 19 aspell | | 29 bash | [] | 23 bfd | | 11 binutils | | 12 bison | [] | 18 bison-runtime | [] | 38 buzztrax | | 9 ccd2cue | | 10 ccide | | 17 cflow | | 16 clisp | | 10 coreutils | | 18 cpio | | 20 cppi | | 17 cpplib | [] | 19 cryptsetup | | 14 datamash | | 11 denemo | | 5 dfarc | | 17 dialog | [] | 42 dico | | 6 diffutils | | 22 dink | | 10 direvent | | 11 doodle | | 12 dos2unix | [] | 18 dos2unix-man | | 9 e2fsprogs | | 15 enscript | | 21 exif | | 27 fetchmail | | 19 findutils | | 29 flex | [] | 19 freedink | | 24 fusionforge | | 3 gas | | 5 gawk | | 13 gcal | | 8 gcc | | 2 gdbm | | 10 gettext-examples | [] [] | 40 gettext-runtime | [] [] | 35 gettext-tools | [] | 24 gjay | | 9 glunarclock | [] | 27 gnubiff | | 9 gnubik | | 19 gnucash | () | 6 gnuchess | | 11 gnulib | | 23 gnunet | | 1 gnunet-gtk | | 1 gold | | 7 gphoto2 | [] | 19 gprof | | 21 gramadoir | | 14 grep | [] | 31 grub | | 21 gsasl | [] | 19 gss | | 17 gst-plugins-bad | | 21 gst-plugins-base | | 27 gst-plugins-good | | 32 gst-plugins-ugly | | 34 gstreamer | [] | 32 gtick | | 19 gtkam | | 24 gtkspell | [] [] | 48 guix | | 2 guix-packages | | 0 gutenprint | | 15 hello | [] | 30 help2man | | 18 help2man-texi | | 5 hylafax | | 5 idutils | | 14 iso_15924 | [] | 23 iso_3166 | [] [] | 58 iso_3166_2 | | 9 iso_4217 | [] [] | 28 iso_639 | [] [] | 46 iso_639_3 | | 10 iso_639_5 | | 2 jwhois | [] | 20 kbd | | 17 klavaro | | 30 ld | [] | 15 leafpad | [] | 39 libc | [] | 24 libexif | | 10 libextractor | | 5 libgnutls | | 13 libgphoto2 | | 10 libgphoto2_port | [] | 19 libgsasl | | 18 libiconv | [] | 29 libidn | | 17 liferea | | 29 lilypond | | 11 lordsawar | | 3 lprng | | 3 lynx | | 19 m4 | [] | 22 mailfromd | | 4 mailutils | | 6 make | | 19 man-db | | 15 man-db-manpages | | 10 midi-instruments | [] | 43 minicom | [] | 17 mkisofs | | 13 myserver | | 9 nano | [] | 30 opcodes | | 12 parted | [] | 23 pies | | 4 pnmixer | | 9 popt | [] | 36 procps-ng | | 5 procps-ng-man | | 4 psmisc | [] | 22 pspp | | 13 pushover | | 6 pwdutils | | 8 pyspread | | 6 radius | | 9 recode | | 31 recutils | | 10 rpm | [] | 13 rush | | 10 sarg | | 4 sed | [] | 35 sharutils | | 13 shishi | | 7 skribilo | | 7 solfege | | 21 solfege-manual | | 9 spotmachine | | 11 sudo | | 26 sudoers | | 22 sysstat | | 23 tar | [] | 30 texinfo | | 17 texinfo_document | | 13 tigervnc | | 14 tin | [] | 7 tin-man | | 1 tracgoogleappsa... | [] | 22 trader | | 12 util-linux | | 13 ve | | 14 vice | | 1 vmm | | 3 vorbis-tools | | 13 wastesedge | | 3 wcd | | 8 wcd-man | | 3 wdiff | [] | 23 wget | | 21 wyslij-po | | 14 xboard | | 10 xdg-user-dirs | [] [] | 68 xkeyboard-config | [] | 28 +-------------+ 89 teams zh_HK zh_TW 166 domains 7 42 2809 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If Jun 2014 seems to be old, you may fetch a more recent copy of this 'ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at 'http://translationproject.org/extra/matrix.html'. 1.5 Using 'gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU 'gettext' in your package. Of course you have to respect the GNU Lesser General Public License which covers the use of the GNU 'gettext' library. This means in particular that even non-free programs can use 'libintl' as a shared library, whereas only free software can use 'libintl' as a static library or use modified versions of 'libintl'. Once the sources are changed appropriately and the setup can handle the use of 'gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact 'coordinator@translationproject.org' to make the '.pot' files available to the translation teams. libqalculate-2.8.2/INSTALL0000644000175000017500000002202412705146643012147 00000000000000Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. libqalculate-2.8.2/po/0000755000175000017500000000000013401033232011573 500000000000000libqalculate-2.8.2/po/nl.po0000644000175000017500000026763513370501720012516 00000000000000# translation of libqalculate.po to # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # # Hanna Knutsson , 2003. # Rinse de Vries , 2006. # Jaap Woldringh , 2006, 2007. msgid "" msgstr "" "Project-Id-Version: libqalculate\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-11-07 07:18+0100\n" "PO-Revision-Date: 2007-05-18 16:19+0200\n" "Last-Translator: Jaap Woldringh \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../src/qalc.cc:119 ../src/qalc.cc:186 ../src/qalc.cc:3106 #: ../libqalculate/util.cc:178 msgid "yes" msgstr "ja" #: ../src/qalc.cc:120 ../src/qalc.cc:188 ../src/qalc.cc:3106 #: ../libqalculate/util.cc:179 msgid "no" msgstr "nee" #: ../src/qalc.cc:121 ../libqalculate/util.cc:186 msgid "true" msgstr "waar" #: ../src/qalc.cc:122 ../libqalculate/util.cc:187 msgid "false" msgstr "onwaar" #: ../src/qalc.cc:123 ../src/qalc.cc:653 ../src/qalc.cc:926 ../src/qalc.cc:958 #: ../src/qalc.cc:2560 ../src/qalc.cc:2583 ../src/qalc.cc:2628 #: ../src/qalc.cc:3105 ../src/qalc.cc:3210 ../src/qalc.cc:3231 #: ../src/qalc.cc:3263 ../libqalculate/util.cc:194 msgid "on" msgstr "aan" #: ../src/qalc.cc:124 ../src/qalc.cc:631 ../src/qalc.cc:652 ../src/qalc.cc:835 #: ../src/qalc.cc:899 ../src/qalc.cc:911 ../src/qalc.cc:924 ../src/qalc.cc:956 #: ../src/qalc.cc:2559 ../src/qalc.cc:2564 ../src/qalc.cc:2571 #: ../src/qalc.cc:2581 ../src/qalc.cc:2608 ../src/qalc.cc:2615 #: ../src/qalc.cc:2627 ../src/qalc.cc:2652 ../src/qalc.cc:3105 #: ../src/qalc.cc:3208 ../src/qalc.cc:3214 ../src/qalc.cc:3218 #: ../src/qalc.cc:3231 ../src/qalc.cc:3237 ../src/qalc.cc:3244 #: ../src/qalc.cc:3261 ../src/qalc.cc:3288 ../libqalculate/util.cc:195 msgid "off" msgstr "uit" #: ../src/qalc.cc:193 msgid "Please answer yes or no" msgstr "Antwoord alstublieft met ja of nee" #: ../src/qalc.cc:200 ../src/qalc.cc:590 ../src/qalc.cc:1274 #: ../src/qalc.cc:2474 ../src/qalc.cc:3051 ../src/qalc.cc:3126 #: ../src/qalc.cc:3332 msgid "unknown" msgstr "onbekend" #: ../src/qalc.cc:206 ../src/qalc.cc:584 ../src/qalc.cc:1268 #: ../src/qalc.cc:2468 ../src/qalc.cc:3045 ../src/qalc.cc:3140 #: ../src/qalc.cc:3346 msgid "real" msgstr "reëel" #: ../src/qalc.cc:208 ../src/qalc.cc:586 ../src/qalc.cc:1270 #: ../src/qalc.cc:2470 ../src/qalc.cc:3047 ../src/qalc.cc:3138 #: ../src/qalc.cc:3344 ../libqalculate/Function.cc:1636 msgid "number" msgstr "getal" #: ../src/qalc.cc:210 ../src/qalc.cc:583 ../src/qalc.cc:1267 #: ../src/qalc.cc:2467 ../src/qalc.cc:3044 ../src/qalc.cc:3142 #: ../src/qalc.cc:3348 msgid "rational" msgstr "rationaal" #: ../src/qalc.cc:212 ../src/qalc.cc:582 ../src/qalc.cc:1266 #: ../src/qalc.cc:2466 ../src/qalc.cc:3043 ../src/qalc.cc:3144 #: ../src/qalc.cc:3350 ../libqalculate/Function.cc:1797 msgid "integer" msgstr "geheel" #: ../src/qalc.cc:214 ../src/qalc.cc:577 ../src/qalc.cc:1261 #: ../src/qalc.cc:2461 ../src/qalc.cc:3038 ../src/qalc.cc:3128 #: ../src/qalc.cc:3334 msgid "non-zero" msgstr "ongelijk nul" #: ../src/qalc.cc:216 ../src/qalc.cc:573 ../src/qalc.cc:1257 #: ../src/qalc.cc:2457 ../src/qalc.cc:3034 ../src/qalc.cc:3130 #: ../src/qalc.cc:3336 msgid "positive" msgstr "positief" #: ../src/qalc.cc:218 ../src/qalc.cc:576 ../src/qalc.cc:1260 #: ../src/qalc.cc:2460 ../src/qalc.cc:3037 ../src/qalc.cc:3136 #: ../src/qalc.cc:3342 msgid "non-negative" msgstr "niet-negatief" #: ../src/qalc.cc:220 ../src/qalc.cc:575 ../src/qalc.cc:1259 #: ../src/qalc.cc:2459 ../src/qalc.cc:3036 ../src/qalc.cc:3132 #: ../src/qalc.cc:3338 msgid "negative" msgstr "negatief" #: ../src/qalc.cc:222 ../src/qalc.cc:574 ../src/qalc.cc:1258 #: ../src/qalc.cc:2458 ../src/qalc.cc:3035 ../src/qalc.cc:3134 #: ../src/qalc.cc:3340 msgid "non-positive" msgstr "niet-positief" #: ../src/qalc.cc:225 msgid "Unrecognized assumption." msgstr "Onbekende aanname." #: ../src/qalc.cc:463 ../libqalculate/Calculator.cc:10482 #, fuzzy, c-format msgid "It has been %s day(s) since the exchange rates last were updated." msgstr "" "Het is al meer dan een week geleden dat de wisselkoersen werden ververst." #: ../src/qalc.cc:468 msgid "Do you wish to update the exchange rates now?" msgstr "" #: ../src/qalc.cc:482 ../src/qalc.cc:483 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "Druk op Enter om verder te gaan." #: ../src/qalc.cc:496 ../src/qalc.cc:497 ../src/qalc.cc:498 ../src/qalc.cc:499 #: ../src/qalc.cc:500 ../src/qalc.cc:501 ../src/qalc.cc:670 ../src/qalc.cc:673 #: ../src/qalc.cc:806 ../src/qalc.cc:817 ../src/qalc.cc:826 ../src/qalc.cc:2061 #: ../src/qalc.cc:2196 msgid "Illegal value" msgstr "waarde niet toegestaan" #. qalc command #: ../src/qalc.cc:524 ../src/qalc.cc:771 ../src/qalc.cc:2039 #: ../src/qalc.cc:2409 ../src/qalc.cc:2415 ../src/qalc.cc:2535 #: ../src/qalc.cc:2670 ../src/qalc.cc:2704 ../src/qalc.cc:3184 #: ../src/qalc.cc:3301 ../src/qalc.cc:3454 ../src/qalc.cc:4229 #: ../src/qalc.cc:4240 ../libqalculate/Calculator.cc:2503 #: ../libqalculate/Calculator.cc:2507 msgid "base" msgstr "grondtal" #: ../src/qalc.cc:524 ../src/qalc.cc:526 ../src/qalc.cc:2636 #: ../src/qalc.cc:3273 msgid "input base" msgstr "Voer grondtal in" #: ../src/qalc.cc:524 msgid "output base" msgstr "Voer grondtal uit" #: ../src/qalc.cc:527 ../src/qalc.cc:2290 ../src/qalc.cc:2537 #: ../src/qalc.cc:2638 ../src/qalc.cc:3196 ../src/qalc.cc:3281 #: ../src/qalc.cc:4148 ../libqalculate/Calculator.cc:2472 msgid "roman" msgstr "Romeins" #: ../src/qalc.cc:528 ../src/qalc.cc:2300 ../src/qalc.cc:2539 #: ../src/qalc.cc:3194 ../src/qalc.cc:4164 ../libqalculate/Calculator.cc:2478 msgid "time" msgstr "tijd" #: ../src/qalc.cc:529 ../src/qalc.cc:2270 ../src/qalc.cc:4116 #: ../libqalculate/Calculator.cc:2460 msgid "hexadecimal" msgstr "hexadecimaal" #: ../src/qalc.cc:530 ../src/qalc.cc:2285 ../src/qalc.cc:4140 #: ../libqalculate/Calculator.cc:2469 #, fuzzy msgid "duodecimal" msgstr "decimaal" #: ../src/qalc.cc:531 ../src/qalc.cc:2275 ../src/qalc.cc:4124 #: ../libqalculate/Calculator.cc:2463 msgid "binary" msgstr "binair" #: ../src/qalc.cc:532 ../src/qalc.cc:2280 ../src/qalc.cc:4132 #: ../libqalculate/Calculator.cc:2466 msgid "octal" msgstr "octaal" #: ../src/qalc.cc:533 msgid "decimal" msgstr "decimaal" #: ../src/qalc.cc:534 ../src/qalc.cc:2295 ../src/qalc.cc:2538 #: ../src/qalc.cc:4156 ../libqalculate/Calculator.cc:2475 msgid "sexagesimal" msgstr "sexagesimaal" #: ../src/qalc.cc:551 ../src/qalc.cc:614 ../src/qalc.cc:2543 #: ../src/qalc.cc:3201 msgid "base display" msgstr "tonen van grondtal" #: ../src/qalc.cc:555 msgid "Illegal base." msgstr "Grondtal niet toegestaan." #: ../src/qalc.cc:563 ../src/qalc.cc:591 ../src/qalc.cc:2475 #: ../src/qalc.cc:3123 msgid "assumptions" msgstr "aannames" #: ../src/qalc.cc:585 ../src/qalc.cc:1269 ../src/qalc.cc:2469 #: ../src/qalc.cc:3046 msgid "complex" msgstr "complex" #: ../src/qalc.cc:587 ../src/qalc.cc:1271 ../src/qalc.cc:2471 #: ../src/qalc.cc:3048 msgid "non-matrix" msgstr "niet-matrix" #: ../src/qalc.cc:594 ../src/qalc.cc:2661 ../src/qalc.cc:3293 msgid "all prefixes" msgstr "alle voorvoegsels" #: ../src/qalc.cc:595 ../src/qalc.cc:2501 ../src/qalc.cc:3162 msgid "complex numbers" msgstr "complexe getallen" #: ../src/qalc.cc:596 ../src/qalc.cc:2519 ../src/qalc.cc:3174 msgid "excessive parentheses" msgstr "te veel haakjes" #: ../src/qalc.cc:597 ../src/qalc.cc:2502 ../src/qalc.cc:2758 #: ../src/qalc.cc:2763 ../src/qalc.cc:3163 msgid "functions" msgstr "functies" #: ../src/qalc.cc:598 ../src/qalc.cc:2503 ../src/qalc.cc:3164 msgid "infinite numbers" msgstr "oneindige getallen" #: ../src/qalc.cc:599 ../src/qalc.cc:2527 ../src/qalc.cc:3176 msgid "show negative exponents" msgstr "toon negatieve exponenten" #: ../src/qalc.cc:600 ../src/qalc.cc:2453 ../src/qalc.cc:3120 msgid "assume nonzero denominators" msgstr "neem noemers aan ongelijk nul" #: ../src/qalc.cc:601 ../src/qalc.cc:2454 ../src/qalc.cc:3121 msgid "warn nonzero denominators" msgstr "waarschuwen noemers ongelijk nul" #: ../src/qalc.cc:602 ../src/qalc.cc:2677 ../src/qalc.cc:3312 msgid "prefixes" msgstr "voorvoegsels" #: ../src/qalc.cc:603 ../src/qalc.cc:2675 ../src/qalc.cc:3310 msgid "denominator prefixes" msgstr "voorvoegsels voor noemers" #: ../src/qalc.cc:604 ../src/qalc.cc:2676 ../src/qalc.cc:3311 msgid "place units separately" msgstr "eenheden apart plaatsen" #: ../src/qalc.cc:605 ../src/qalc.cc:2500 ../src/qalc.cc:3161 msgid "calculate variables" msgstr "variabelen berekenen" #: ../src/qalc.cc:606 ../src/qalc.cc:2499 ../src/qalc.cc:3160 msgid "calculate functions" msgstr "functies berekenen" #: ../src/qalc.cc:607 ../src/qalc.cc:2678 ../src/qalc.cc:3313 msgid "sync units" msgstr "sync eenheden" #: ../src/qalc.cc:608 ../src/qalc.cc:2619 ../src/qalc.cc:3250 msgid "round to even" msgstr "afronden naar even" #: ../src/qalc.cc:609 ../src/qalc.cc:2657 ../src/qalc.cc:3289 msgid "rpn syntax" msgstr "rpn-notatie" #. qalc command #: ../src/qalc.cc:610 ../src/qalc.cc:2042 ../src/qalc.cc:2689 #: ../src/qalc.cc:2726 ../src/qalc.cc:3324 ../src/qalc.cc:3404 msgid "rpn" msgstr "rpn" #: ../src/qalc.cc:611 ../src/qalc.cc:2528 ../src/qalc.cc:3177 msgid "short multiplication" msgstr "korte vermenigvuldiging" #: ../src/qalc.cc:612 ../src/qalc.cc:2602 ../src/qalc.cc:3233 msgid "lowercase e" msgstr "kleine letter e" #: ../src/qalc.cc:613 ../src/qalc.cc:2603 ../src/qalc.cc:3234 msgid "lowercase numbers" msgstr "onderkast getallen" #: ../src/qalc.cc:616 ../src/qalc.cc:632 ../src/qalc.cc:686 ../src/qalc.cc:767 #: ../src/qalc.cc:790 ../src/qalc.cc:2448 ../src/qalc.cc:2484 #: ../src/qalc.cc:2545 ../src/qalc.cc:2666 ../src/qalc.cc:3119 #: ../src/qalc.cc:3151 ../src/qalc.cc:3201 ../src/qalc.cc:3297 msgid "none" msgstr "geen" #: ../src/qalc.cc:617 ../src/qalc.cc:2546 ../src/qalc.cc:3201 msgid "normal" msgstr "normaal" #: ../src/qalc.cc:618 ../src/qalc.cc:2547 ../src/qalc.cc:3201 msgid "alternative" msgstr "alternatief" #: ../src/qalc.cc:623 ../src/qalc.cc:639 ../src/qalc.cc:659 ../src/qalc.cc:691 #: ../src/qalc.cc:707 ../src/qalc.cc:731 ../src/qalc.cc:745 ../src/qalc.cc:759 #: ../src/qalc.cc:781 ../src/qalc.cc:797 ../src/qalc.cc:846 ../src/qalc.cc:852 #: ../src/qalc.cc:876 ../src/qalc.cc:933 ../src/qalc.cc:949 ../src/qalc.cc:963 msgid "Illegal value." msgstr "Waarde niet toegestaan." #: ../src/qalc.cc:628 ../src/qalc.cc:2621 ../src/qalc.cc:3252 msgid "two's complement" msgstr "" #: ../src/qalc.cc:629 ../src/qalc.cc:2562 ../src/qalc.cc:3214 msgid "digit grouping" msgstr "" #: ../src/qalc.cc:633 ../src/qalc.cc:2565 ../src/qalc.cc:3214 msgid "standard" msgstr "" #: ../src/qalc.cc:634 ../src/qalc.cc:654 ../src/qalc.cc:2558 #: ../src/qalc.cc:2566 ../src/qalc.cc:2626 ../src/qalc.cc:3206 #: ../src/qalc.cc:3214 ../src/qalc.cc:3259 msgid "locale" msgstr "" #: ../src/qalc.cc:644 ../src/qalc.cc:2530 ../src/qalc.cc:3179 msgid "spell out logical" msgstr "logische bewerking voluit spellen" #: ../src/qalc.cc:645 ../src/qalc.cc:2634 ../src/qalc.cc:3271 msgid "ignore dot" msgstr "" #: ../src/qalc.cc:646 ../src/qalc.cc:2631 ../src/qalc.cc:3268 msgid "ignore comma" msgstr "" #: ../src/qalc.cc:650 ../src/qalc.cc:2557 ../src/qalc.cc:2625 #: ../src/qalc.cc:3203 ../src/qalc.cc:3256 #, fuzzy msgid "decimal comma" msgstr "decimaal" #: ../src/qalc.cc:669 ../src/qalc.cc:2642 ../src/qalc.cc:3286 msgid "limit implicit multiplication" msgstr "impliciet vermenigvuldigen beperken" #: ../src/qalc.cc:671 ../src/qalc.cc:2529 ../src/qalc.cc:3178 msgid "spacious" msgstr "ruimtelijk" #: ../src/qalc.cc:672 ../src/qalc.cc:2531 ../src/qalc.cc:3180 msgid "unicode" msgstr "unicode" #: ../src/qalc.cc:675 ../src/qalc.cc:2504 ../src/qalc.cc:2760 #: ../src/qalc.cc:2765 ../src/qalc.cc:3165 msgid "units" msgstr "eenheden" #: ../src/qalc.cc:676 ../src/qalc.cc:2505 ../src/qalc.cc:3166 msgid "unknowns" msgstr "onbekenden" #: ../src/qalc.cc:677 ../src/qalc.cc:2506 ../src/qalc.cc:2759 #: ../src/qalc.cc:2764 ../src/qalc.cc:3167 msgid "variables" msgstr "variabelen" #: ../src/qalc.cc:678 ../src/qalc.cc:2511 ../src/qalc.cc:3172 msgid "abbreviations" msgstr "afkortingen" #: ../src/qalc.cc:679 ../src/qalc.cc:2620 ../src/qalc.cc:3251 msgid "show ending zeroes" msgstr "afsluitende nullen tonen" #: ../src/qalc.cc:680 ../src/qalc.cc:2618 ../src/qalc.cc:3249 #, fuzzy msgid "repeating decimals" msgstr "min decimalen" #: ../src/qalc.cc:681 ../src/qalc.cc:2479 ../src/qalc.cc:3151 msgid "angle unit" msgstr "hoekeenheid" #: ../src/qalc.cc:683 ../src/qalc.cc:2481 ../src/qalc.cc:2482 msgid "rad" msgstr "rad" #: ../src/qalc.cc:683 ../src/qalc.cc:3151 msgid "radians" msgstr "radialen" #: ../src/qalc.cc:684 msgid "deg" msgstr "deg" #: ../src/qalc.cc:684 ../src/qalc.cc:3151 msgid "degrees" msgstr "graden" #: ../src/qalc.cc:685 ../src/qalc.cc:2483 msgid "gra" msgstr "gra" #: ../src/qalc.cc:685 ../src/qalc.cc:3151 msgid "gradians" msgstr "grads (100 grads in rechte hoek)" #: ../src/qalc.cc:698 ../src/qalc.cc:2643 ../src/qalc.cc:3287 #: ../src/qalc.cc:3511 #, fuzzy msgid "parsing mode" msgstr "exp modus" #: ../src/qalc.cc:700 ../src/qalc.cc:859 ../src/qalc.cc:2589 #: ../src/qalc.cc:2645 ../src/qalc.cc:3232 ../src/qalc.cc:3287 #: ../src/qalc.cc:3519 #, fuzzy msgid "adaptive" msgstr "alternatief" #: ../src/qalc.cc:701 ../src/qalc.cc:2646 ../src/qalc.cc:3287 #: ../src/qalc.cc:3516 msgid "implicit first" msgstr "" #: ../src/qalc.cc:702 ../src/qalc.cc:2647 ../src/qalc.cc:3287 #: ../src/qalc.cc:3513 #, fuzzy msgid "conventional" msgstr "optioneel" #: ../src/qalc.cc:712 ../src/qalc.cc:1433 ../src/qalc.cc:2679 #: ../src/qalc.cc:3314 msgid "update exchange rates" msgstr "" #: ../src/qalc.cc:713 ../src/qalc.cc:2682 ../src/qalc.cc:3316 msgid "never" msgstr "" #: ../src/qalc.cc:715 ../src/qalc.cc:2681 ../src/qalc.cc:3315 #, fuzzy msgid "ask" msgstr "antw" #: ../src/qalc.cc:722 ../src/qalc.cc:2520 ../src/qalc.cc:3175 msgid "multiplication sign" msgstr "vermenigvuldigingsteken" #: ../src/qalc.cc:736 ../src/qalc.cc:2512 ../src/qalc.cc:3173 msgid "division sign" msgstr "teken voor delen" #: ../src/qalc.cc:750 ../src/qalc.cc:2487 ../src/qalc.cc:3152 msgid "approximation" msgstr "benadering" #. qalc command #: ../src/qalc.cc:752 ../src/qalc.cc:803 ../src/qalc.cc:925 ../src/qalc.cc:2246 #: ../src/qalc.cc:2489 ../src/qalc.cc:2582 ../src/qalc.cc:2706 #: ../src/qalc.cc:3152 ../src/qalc.cc:3231 ../src/qalc.cc:3458 msgid "exact" msgstr "exact" #: ../src/qalc.cc:753 ../src/qalc.cc:2490 ../src/qalc.cc:3152 msgid "try exact" msgstr "exact proberen" #. qalc command #: ../src/qalc.cc:754 ../src/qalc.cc:1282 ../src/qalc.cc:2252 #: ../src/qalc.cc:2491 ../src/qalc.cc:2702 ../src/qalc.cc:2965 #: ../src/qalc.cc:2975 ../src/qalc.cc:3065 ../src/qalc.cc:3152 #: ../src/qalc.cc:3462 msgid "approximate" msgstr "benaderd" #: ../src/qalc.cc:764 ../src/qalc.cc:2662 ../src/qalc.cc:3294 msgid "autoconversion" msgstr "autoconversie" #: ../src/qalc.cc:768 ../src/qalc.cc:2403 msgid "best" msgstr "best" #: ../src/qalc.cc:769 ../src/qalc.cc:2671 ../src/qalc.cc:3303 #, fuzzy msgid "optimalsi" msgstr "optioneel" #: ../src/qalc.cc:770 ../src/qalc.cc:2403 ../src/qalc.cc:2669 #: ../src/qalc.cc:3299 ../src/qalc.cc:4218 ../libqalculate/Calculator.cc:2499 #, fuzzy msgid "optimal" msgstr "optioneel" #: ../src/qalc.cc:772 ../src/qalc.cc:2665 ../src/qalc.cc:3305 #: ../src/qalc.cc:4248 ../libqalculate/Calculator.cc:2510 msgid "mixed" msgstr "" #: ../src/qalc.cc:787 ../src/qalc.cc:2674 ../src/qalc.cc:3309 #, fuzzy msgid "currency conversion" msgstr "autoconversie" #: ../src/qalc.cc:788 ../src/qalc.cc:2446 ../src/qalc.cc:3119 msgid "algebra mode" msgstr "algebraïsche modus" #. qalc command #: ../src/qalc.cc:791 ../src/qalc.cc:2434 ../src/qalc.cc:2450 #: ../src/qalc.cc:2721 ../src/qalc.cc:3097 ../src/qalc.cc:3119 msgid "simplify" msgstr "vereenvoudigen" #: ../src/qalc.cc:792 ../src/qalc.cc:2449 ../src/qalc.cc:3119 msgid "factorize" msgstr "ontbinden in factoren" #: ../src/qalc.cc:814 ../src/qalc.cc:2691 ../src/qalc.cc:2719 #: ../src/qalc.cc:3326 msgid "save mode" msgstr "modus opslaan" #: ../src/qalc.cc:823 ../src/qalc.cc:2690 ../src/qalc.cc:2718 #: ../src/qalc.cc:3325 msgid "save definitions" msgstr "definities opslaan" #: ../src/qalc.cc:832 ../src/qalc.cc:2569 ../src/qalc.cc:3215 #, fuzzy msgid "scientific notation" msgstr "wetenschappelijk" #: ../src/qalc.cc:836 ../src/qalc.cc:2572 ../src/qalc.cc:3220 msgid "auto" msgstr "auto" #: ../src/qalc.cc:837 ../src/qalc.cc:2573 ../src/qalc.cc:3224 msgid "pure" msgstr "zuiver" #: ../src/qalc.cc:838 ../src/qalc.cc:2574 ../src/qalc.cc:3226 msgid "scientific" msgstr "wetenschappelijk" #: ../src/qalc.cc:839 ../src/qalc.cc:2575 ../src/qalc.cc:3222 msgid "engineering" msgstr "technisch" #: ../src/qalc.cc:848 ../src/qalc.cc:2495 ../src/qalc.cc:3154 msgid "precision" msgstr "nauwkeurigheid" #: ../src/qalc.cc:857 ../src/qalc.cc:2587 ../src/qalc.cc:3232 #, fuzzy msgid "interval display" msgstr "tonen van grondtal" #: ../src/qalc.cc:860 ../src/qalc.cc:2592 ../src/qalc.cc:3232 #, fuzzy msgid "significant" msgstr "wetenschappelijk" #: ../src/qalc.cc:861 ../src/qalc.cc:2593 ../src/qalc.cc:3232 #, fuzzy msgid "interval" msgstr "geheel" #: ../src/qalc.cc:862 ../src/qalc.cc:2594 ../src/qalc.cc:3232 #, fuzzy msgid "plusminus" msgstr "minus" #: ../src/qalc.cc:863 ../src/qalc.cc:2595 ../src/qalc.cc:3232 msgid "midpoint" msgstr "" #: ../src/qalc.cc:864 ../src/qalc.cc:2597 ../src/qalc.cc:3232 msgid "upper" msgstr "" #: ../src/qalc.cc:865 ../src/qalc.cc:2596 ../src/qalc.cc:3232 #, fuzzy msgid "lower" msgstr "kleine letter e" #: ../src/qalc.cc:883 ../src/qalc.cc:2494 ../src/qalc.cc:3153 msgid "interval arithmetic" msgstr "" #: ../src/qalc.cc:890 ../src/qalc.cc:2507 ../src/qalc.cc:3168 #, fuzzy msgid "variable units" msgstr "variabelen" #: ../src/qalc.cc:897 ../src/qalc.cc:2604 ../src/qalc.cc:3235 msgid "max decimals" msgstr "max decimalen" #: ../src/qalc.cc:909 ../src/qalc.cc:2611 ../src/qalc.cc:3242 msgid "min decimals" msgstr "min decimalen" #: ../src/qalc.cc:922 ../src/qalc.cc:2579 ../src/qalc.cc:3231 msgid "fractions" msgstr "breuken" #: ../src/qalc.cc:927 ../src/qalc.cc:2584 ../src/qalc.cc:3231 msgid "combined" msgstr "gecombineerd" #: ../src/qalc.cc:928 ../src/qalc.cc:2583 ../src/qalc.cc:3231 msgid "long" msgstr "" #: ../src/qalc.cc:940 ../src/qalc.cc:2550 ../src/qalc.cc:3202 #, fuzzy msgid "complex form" msgstr "complex" #: ../src/qalc.cc:942 ../src/qalc.cc:2309 ../src/qalc.cc:2552 #: ../src/qalc.cc:3202 ../src/qalc.cc:4194 msgid "rectangular" msgstr "" #: ../src/qalc.cc:942 ../src/qalc.cc:2309 ../src/qalc.cc:4194 msgid "cartesian" msgstr "" #: ../src/qalc.cc:943 ../src/qalc.cc:2318 ../src/qalc.cc:2553 #: ../src/qalc.cc:3202 ../src/qalc.cc:4202 #, fuzzy msgid "exponential" msgstr "optioneel" #: ../src/qalc.cc:944 ../src/qalc.cc:2327 ../src/qalc.cc:2554 #: ../src/qalc.cc:3202 ../src/qalc.cc:4210 msgid "polar" msgstr "" #: ../src/qalc.cc:954 ../src/qalc.cc:2650 ../src/qalc.cc:3288 msgid "read precision" msgstr "nauwkeurigheid lezen" #: ../src/qalc.cc:957 ../src/qalc.cc:2653 ../src/qalc.cc:3288 msgid "always" msgstr "altijd" #: ../src/qalc.cc:958 ../src/qalc.cc:2654 ../src/qalc.cc:3288 msgid "when decimals" msgstr "wanneer decimalen" #: ../src/qalc.cc:980 msgid "Unrecognized option." msgstr "Onbekende optie." #: ../src/qalc.cc:1097 msgid "Calendar" msgstr "" #: ../src/qalc.cc:1097 msgid "Day" msgstr "" #: ../src/qalc.cc:1097 msgid "Month" msgstr "" #: ../src/qalc.cc:1097 msgid "Year" msgstr "" #: ../src/qalc.cc:1098 ../libqalculate/Calculator.cc:2533 msgid "failed" msgstr "" #: ../src/qalc.cc:1099 ../libqalculate/Calculator.cc:2534 msgid "Gregorian:" msgstr "" #: ../src/qalc.cc:1100 ../libqalculate/Calculator.cc:2535 msgid "Hebrew:" msgstr "" #: ../src/qalc.cc:1101 ../libqalculate/Calculator.cc:2536 msgid "Islamic:" msgstr "" #: ../src/qalc.cc:1102 ../libqalculate/Calculator.cc:2537 msgid "Persian:" msgstr "" #: ../src/qalc.cc:1103 ../libqalculate/Calculator.cc:2538 msgid "Indian national:" msgstr "" #: ../src/qalc.cc:1104 ../libqalculate/Calculator.cc:2539 msgid "Chinese:" msgstr "" #: ../src/qalc.cc:1109 ../libqalculate/Calculator.cc:2543 msgid "Julian:" msgstr "" #: ../src/qalc.cc:1110 ../libqalculate/Calculator.cc:2544 msgid "Revised julian:" msgstr "" #: ../src/qalc.cc:1111 ../libqalculate/Calculator.cc:2545 #, fuzzy msgid "Coptic:" msgstr "optioneel" #: ../src/qalc.cc:1112 ../libqalculate/Calculator.cc:2546 msgid "Ethiopian:" msgstr "" #: ../src/qalc.cc:1205 ../src/qalc.cc:1206 ../src/qalc.cc:1323 #: ../src/qalc.cc:1324 ../src/qalc.cc:1391 ../src/qalc.cc:1392 #, fuzzy msgid "" "For more information about a specific function, variable or unit, please use " "the info command (in interactive mode)." msgstr "" "Type info NAAM voor info over een functie, variabele of eenheid (bv.: info " "sin)." #: ../src/qalc.cc:1218 msgid "Variables:" msgstr "Variabele:" #: ../src/qalc.cc:1220 msgid "Name" msgstr "Naam" #: ../src/qalc.cc:1221 ../src/qalc.cc:3057 msgid "Value" msgstr "Waarde" #: ../src/qalc.cc:1245 ../src/qalc.cc:3022 ../libqalculate/Function.cc:2002 msgid "matrix" msgstr "matrix" #: ../src/qalc.cc:1247 ../src/qalc.cc:3024 ../libqalculate/Function.cc:1941 msgid "vector" msgstr "vector" #: ../src/qalc.cc:1276 ../src/qalc.cc:3053 msgid "default assumptions" msgstr "standaard aannames" #: ../src/qalc.cc:1297 msgid "Functions:" msgstr "Functie:" #: ../src/qalc.cc:1311 msgid "Units:" msgstr "Eenheid:" #: ../src/qalc.cc:1318 msgid "No local variables, functions or units have been defined." msgstr "" #: ../src/qalc.cc:1426 msgid "usage: qalc [options] [expression]" msgstr "gebruik: qalc [opties] [expressie]" #: ../src/qalc.cc:1428 msgid "where options are:" msgstr "waarin opties zijn:" #: ../src/qalc.cc:1429 ../src/qalc.cc:2704 msgid "BASE" msgstr "GRONDTAL" #: ../src/qalc.cc:1430 msgid "set the result number base" msgstr "" #: ../src/qalc.cc:1435 msgid "FILE" msgstr "BESTAND" #: ../src/qalc.cc:1436 msgid "executes commands from a file first" msgstr "voert eerst opdrachten uit vanuit een bestand" #: ../src/qalc.cc:1438 msgid "start in interactive mode" msgstr "" #: ../src/qalc.cc:1439 ../src/qalc.cc:1441 ../src/qalc.cc:1443 #: ../src/qalc.cc:1445 msgid "SEARCH TERM" msgstr "" #: ../src/qalc.cc:1440 #, fuzzy msgid "" "displays a list of all user-defined or matching variables, functions and " "units." msgstr "\"%s\" is geen geldige variabele/functie/eenheid." #: ../src/qalc.cc:1442 #, fuzzy msgid "displays a list of all or matching functions." msgstr "Voorbeeld: info sin." #: ../src/qalc.cc:1444 #, fuzzy msgid "displays a list of all or matching units." msgstr "Voorbeeld: info sin." #: ../src/qalc.cc:1446 #, fuzzy msgid "displays a list of all or matching variables." msgstr "\"%s\" is geen geldige variabele/functie/eenheid." #: ../src/qalc.cc:1447 msgid "MILLISECONDS" msgstr "" #: ../src/qalc.cc:1448 msgid "" "terminate calculation and display of result after specified amount of time" msgstr "" #: ../src/qalc.cc:1450 msgid "do not load any functions, units, or variables from file" msgstr "lees geen functies, eenheden of variabelen in uit bestand" #: ../src/qalc.cc:1452 msgid "do not load any global currencies from file" msgstr "lees geen globale munteenheden in uit bestand" #: ../src/qalc.cc:1454 msgid "do not load any global data sets from file" msgstr "lees geen globale gegevensverzamelingen in uit bestand" #: ../src/qalc.cc:1456 msgid "do not load any global functions from file" msgstr "lees geen globale functies in uit bestand" #: ../src/qalc.cc:1458 msgid "do not load any global units from file" msgstr "lees geen globale eenheden in uit bestand" #: ../src/qalc.cc:1460 msgid "do not load any global variables from file" msgstr "lees geen globale variabelen in uit bestand" #: ../src/qalc.cc:1461 ../src/qalc.cc:2720 msgid "OPTION" msgstr "OPTIE" #: ../src/qalc.cc:1461 ../src/qalc.cc:2720 msgid "VALUE" msgstr "WAARDE" #: ../src/qalc.cc:1462 msgid "as set command in interactive program session (ex. -set \"base 16\")" msgstr "" "als set-opdracht bij interactief programmeren (vb. -set \"base 16\" (stel " "grondtal talstelsel op 16))" #: ../src/qalc.cc:1464 msgid "reduces output to just the result of the input expression" msgstr "" "reduceert de uitvoer tot alleen het antwoord op de ingevoerde expressie" #: ../src/qalc.cc:1466 msgid "turn on/off unicode support" msgstr "ondersteuning unicode aan/uit" #: ../src/qalc.cc:1468 msgid "show application version and exit" msgstr "" #: ../src/qalc.cc:1470 #, fuzzy msgid "" "The program will start in interactive mode if no expression and no file is " "specified (or interactive mode is explicitly selected)." msgstr "" "Het programma start op in interactieve modus indien geen expressie is " "opgegeven." #: ../src/qalc.cc:1546 msgid "No option and value specified for set command." msgstr "Voor set-opdracht zijn geen optie en waarde opgegeven." #: ../src/qalc.cc:1554 msgid "No file specified." msgstr "Geen bestand opgegeven." #: ../src/qalc.cc:1613 msgid "ans" msgstr "antw" #: ../src/qalc.cc:1614 ../src/qalc.cc:1617 ../src/qalc.cc:1618 #: ../src/qalc.cc:1619 ../src/qalc.cc:1620 ../src/qalc.cc:1852 #: ../libqalculate/Calculator.cc:8938 ../libqalculate/Calculator.cc:8954 msgid "Temporary" msgstr "Tijdelijk" #: ../src/qalc.cc:1614 msgid "Last Answer" msgstr "Laatste antwoord" #: ../src/qalc.cc:1615 msgid "answer" msgstr "antwoord" #: ../src/qalc.cc:1617 msgid "Answer 2" msgstr "Antwoord 2" #: ../src/qalc.cc:1618 msgid "Answer 3" msgstr "Antwoord 3" #: ../src/qalc.cc:1619 msgid "Answer 4" msgstr "Antwoord 4" #: ../src/qalc.cc:1620 msgid "Answer 5" msgstr "Antwoord 5" #: ../src/qalc.cc:1631 msgid "Failed to load global definitions!" msgstr "Inlezen van globale definities is mislukt!" #: ../src/qalc.cc:1656 #, c-format msgid "Could not open \"%s\".\n" msgstr "Kon \"%s\" niet openen.\n" #: ../src/qalc.cc:1696 ../src/qalc.cc:1748 ../src/qalc.cc:3541 #, c-format msgid "Illegal character, '%c', in expression." msgstr "Ongeldig teken '%c', in expressie." #. The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. #: ../src/qalc.cc:1814 ../src/qalc.cc:2720 ../src/qalc.cc:3101 msgid "set" msgstr "set" #. qalc command #: ../src/qalc.cc:1818 ../src/qalc.cc:2717 ../src/qalc.cc:3355 msgid "save" msgstr "opslaan" #: ../src/qalc.cc:1818 ../src/qalc.cc:2717 ../src/qalc.cc:3355 msgid "store" msgstr "bewaren" #. qalc command #: ../src/qalc.cc:1821 ../src/qalc.cc:2437 ../src/qalc.cc:2715 #: ../src/qalc.cc:3381 msgid "mode" msgstr "modus" #: ../src/qalc.cc:1823 msgid "mode saved" msgstr "modus opgeslagen" #: ../src/qalc.cc:1825 msgid "definitions" msgstr "definities" #: ../src/qalc.cc:1827 msgid "definitions saved" msgstr "definities opgeslagen" #: ../src/qalc.cc:1874 ../src/qalc.cc:1876 ../src/qalc.cc:1934 #: ../src/qalc.cc:1936 ../src/qalc.cc:1991 ../src/qalc.cc:1993 #, c-format msgid "Illegal name. Save as %s instead (default: no)?" msgstr "Ongeldige naam. In plaats daarvan als %s opslaan (standaard is nee)?" #: ../src/qalc.cc:1883 ../src/qalc.cc:1943 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "Er bestaat al een eenheid of variabele met deze naam.\n" "Wilt u die overschrijven (standaard is nee)?" #. qalc command #: ../src/qalc.cc:1906 ../src/qalc.cc:2723 ../src/qalc.cc:3362 #: ../libqalculate/Function.cc:2064 msgid "variable" msgstr "variabele" #. qalc command #: ../src/qalc.cc:1963 ../src/qalc.cc:2713 ../src/qalc.cc:3368 #: ../libqalculate/Function.cc:2036 msgid "function" msgstr "functie" #: ../src/qalc.cc:2000 #, fuzzy msgid "" "An function with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "Er bestaat al een eenheid of variabele met deze naam.\n" "Wilt u die overschrijven (standaard is nee)?" #. qalc command #: ../src/qalc.cc:2020 ../src/qalc.cc:2705 ../src/qalc.cc:3375 msgid "delete" msgstr "" #: ../src/qalc.cc:2031 #, fuzzy msgid "No user-defined variable or function with the specified name exist." msgstr "Er bestaat geen functie, variabele of eenheid met de opgegeven naam." #. qalc command #: ../src/qalc.cc:2035 ../src/qalc.cc:2703 ../src/qalc.cc:3328 msgid "assume" msgstr "aannemen" #: ../src/qalc.cc:2045 msgid "syntax" msgstr "notatie" #. qalc command #: ../src/qalc.cc:2052 ../src/qalc.cc:2087 ../src/qalc.cc:2727 #: ../src/qalc.cc:3420 msgid "stack" msgstr "stapelgeheugen (stack)" #. qalc command #: ../src/qalc.cc:2072 ../src/qalc.cc:2708 ../src/qalc.cc:3400 msgid "exrates" msgstr "wisselkoersen" #: ../src/qalc.cc:2089 ../src/qalc.cc:2105 ../src/qalc.cc:2114 #: ../src/qalc.cc:2147 ../src/qalc.cc:2176 ../src/qalc.cc:2185 #: ../src/qalc.cc:2202 ../src/qalc.cc:2209 ../src/qalc.cc:2227 #: ../src/qalc.cc:2234 msgid "The RPN stack is empty." msgstr "Het RPN-stapelgeheugen is leeg." #. qalc command #: ../src/qalc.cc:2103 ../src/qalc.cc:2112 ../src/qalc.cc:2733 #: ../src/qalc.cc:3424 msgid "swap" msgstr "" #: ../src/qalc.cc:2107 ../src/qalc.cc:2116 ../src/qalc.cc:2149 #: ../src/qalc.cc:2178 ../src/qalc.cc:2187 #, fuzzy msgid "The RPN stack only contains one value." msgstr "Het RPN-stapelgeheugen is leeg." #: ../src/qalc.cc:2135 ../src/qalc.cc:2168 ../src/qalc.cc:2216 #: ../src/qalc.cc:2240 msgid "The specified RPN stack index does not exist." msgstr "" #. qalc command #: ../src/qalc.cc:2145 ../src/qalc.cc:2730 ../src/qalc.cc:3446 msgid "move" msgstr "" #. qalc command #: ../src/qalc.cc:2174 ../src/qalc.cc:2183 ../src/qalc.cc:2732 #: ../src/qalc.cc:3442 msgid "rotate" msgstr "" #: ../src/qalc.cc:2191 msgid "up" msgstr "" #: ../src/qalc.cc:2193 msgid "down" msgstr "" #. qalc command #: ../src/qalc.cc:2200 ../src/qalc.cc:2207 ../src/qalc.cc:2729 #: ../src/qalc.cc:3434 msgid "copy" msgstr "" #. qalc command #: ../src/qalc.cc:2222 ../src/qalc.cc:2728 ../src/qalc.cc:3410 msgid "clear stack" msgstr "stapelgeheugen leeg maken" #. qalc command #: ../src/qalc.cc:2225 ../src/qalc.cc:2232 ../src/qalc.cc:2731 #: ../src/qalc.cc:3414 msgid "pop" msgstr "" #. qalc command #: ../src/qalc.cc:2258 ../src/qalc.cc:2722 ../src/qalc.cc:3466 msgid "convert" msgstr "converteren" #: ../src/qalc.cc:2258 ../src/qalc.cc:2722 ../src/qalc.cc:3466 #: ../src/qalc.cc:3503 ../libqalculate/Calculator.cc:1241 #: ../libqalculate/Calculator.cc:2623 ../libqalculate/Calculator.cc:2638 #: ../libqalculate/Calculator.cc:2639 msgid "to" msgstr "naar" #: ../src/qalc.cc:2336 ../src/qalc.cc:4188 ../libqalculate/Calculator.cc:2493 #, fuzzy msgid "bases" msgstr "grondtal" #: ../src/qalc.cc:2380 ../src/qalc.cc:4191 ../libqalculate/Calculator.cc:2496 msgid "calendars" msgstr "" #: ../src/qalc.cc:2390 ../src/qalc.cc:4179 ../libqalculate/Calculator.cc:2484 #, fuzzy msgid "fraction" msgstr "breuken" #: ../src/qalc.cc:2399 ../src/qalc.cc:4182 ../libqalculate/Calculator.cc:2487 #, fuzzy msgid "factors" msgstr "factor" #. qalc command #: ../src/qalc.cc:2401 ../src/qalc.cc:2431 ../src/qalc.cc:2716 #: ../src/qalc.cc:3093 ../src/qalc.cc:4185 ../libqalculate/Calculator.cc:2490 #, fuzzy msgid "partial fraction" msgstr "breuken" #. qalc command #: ../src/qalc.cc:2428 ../src/qalc.cc:2711 ../src/qalc.cc:3089 msgid "factor" msgstr "factor" #: ../src/qalc.cc:2442 ../src/qalc.cc:3117 #, fuzzy msgid "Algebraic Mode" msgstr "algebraïsche modus" #: ../src/qalc.cc:2477 ../src/qalc.cc:3149 #, fuzzy msgid "Calculation" msgstr "aan het rekenen..." #: ../src/qalc.cc:2497 ../src/qalc.cc:3158 msgid "Enabled Objects" msgstr "" #: ../src/qalc.cc:2509 ../src/qalc.cc:3170 msgid "Generic Display Options" msgstr "" #: ../src/qalc.cc:2533 ../src/qalc.cc:3182 #, fuzzy msgid "Numerical Display" msgstr "tonen van grondtal" #: ../src/qalc.cc:2623 ../src/qalc.cc:3254 #, fuzzy msgid "Parsing" msgstr "exp modus" #: ../src/qalc.cc:2659 ../src/qalc.cc:3291 #, fuzzy msgid "Units" msgstr "Eenheid:" #: ../src/qalc.cc:2687 ../src/qalc.cc:3322 msgid "Other" msgstr "" #. qalc command #: ../src/qalc.cc:2694 ../src/qalc.cc:3085 msgid "help" msgstr "help" #: ../src/qalc.cc:2697 #, fuzzy msgid "Enter a mathematical expression or a command and press enter." msgstr "Voer een wiskundige expressie of opdracht in." #: ../src/qalc.cc:2698 msgid "Complete functions, units and variables with the tabulator key." msgstr "" "Invoer namen functies, eenheden en variabelen met de tabtoets voltooien." #: ../src/qalc.cc:2700 msgid "Available commands are:" msgstr "Beschikbare opdrachten zijn:" #: ../src/qalc.cc:2703 msgid "ASSUMPTIONS" msgstr "AANNAMES" #: ../src/qalc.cc:2705 ../src/qalc.cc:2713 ../src/qalc.cc:2717 #: ../src/qalc.cc:2723 msgid "NAME" msgstr "NAAM" #: ../src/qalc.cc:2712 ../src/qalc.cc:2744 ../src/qalc.cc:3385 msgid "find" msgstr "" #. qalc command #: ../src/qalc.cc:2712 ../src/qalc.cc:2742 ../src/qalc.cc:2744 #: ../src/qalc.cc:3385 msgid "list" msgstr "" #: ../src/qalc.cc:2713 ../src/qalc.cc:2723 msgid "EXPRESSION" msgstr "" #. qalc command #: ../src/qalc.cc:2714 ../src/qalc.cc:2770 ../src/qalc.cc:3394 #: ../libqalculate/Calculator.cc:9598 ../libqalculate/DataSet.cc:355 #: ../libqalculate/DataSet.cc:382 ../libqalculate/DataSet.cc:1012 msgid "info" msgstr "info" #: ../src/qalc.cc:2717 msgid "CATEGORY" msgstr "CATEGORIE" #: ../src/qalc.cc:2717 msgid "TITLE" msgstr "TITEL" #: ../src/qalc.cc:2722 msgid "UNIT or \"TO\" COMMAND" msgstr "" #. qalc command #: ../src/qalc.cc:2724 ../src/qalc.cc:3507 ../src/qalc.cc:3528 msgid "quit" msgstr "afsluiten" #: ../src/qalc.cc:2724 ../src/qalc.cc:3507 ../src/qalc.cc:3528 msgid "exit" msgstr "verlaten" #: ../src/qalc.cc:2725 msgid "Commands for RPN mode:" msgstr "" #: ../src/qalc.cc:2726 msgid "STATE" msgstr "" #: ../src/qalc.cc:2729 ../src/qalc.cc:2731 msgid "INDEX" msgstr "" #: ../src/qalc.cc:2730 ../src/qalc.cc:2733 msgid "INDEX 1" msgstr "" #: ../src/qalc.cc:2730 ../src/qalc.cc:2733 msgid "INDEX 2" msgstr "" #: ../src/qalc.cc:2732 msgid "DIRECTION" msgstr "" #: ../src/qalc.cc:2735 msgid "Type help COMMAND for more information (example: help save)." msgstr "Type help OPDRACHT voor meer hulp (bv.: help save)." #: ../src/qalc.cc:2736 msgid "" "Type info NAME for information about a function, variable or unit (example: " "info sin)." msgstr "" "Type info NAAM voor info over een functie, variabele of eenheid (bv.: info " "sin)." #: ../src/qalc.cc:2737 msgid "" "When a line begins with '/', the following text is always interpreted as a " "command." msgstr "" #: ../src/qalc.cc:2739 msgid "" "For more information about mathematical expression, different options, and a " "complete list of functions, variables and units, see the relevant sections " "in the manual of the graphical user interface (available at http://qalculate." "github.io/manual/index.html)." msgstr "" #: ../src/qalc.cc:2757 ../src/qalc.cc:2762 #, fuzzy msgid "currencies" msgstr "Valuta" #: ../src/qalc.cc:2778 msgid "No function, variable or unit with specified name exist." msgstr "Er bestaat geen functie, variabele of eenheid met de opgegeven naam." #: ../src/qalc.cc:2788 msgid "Function" msgstr "Functie" #: ../src/qalc.cc:2815 ../libqalculate/Function.cc:201 msgid "argument" msgstr "argument" #: ../src/qalc.cc:2839 #, c-format msgid "" "Retrieves data from the %s data set for a given object and property. If " "\"info\" is typed as property, all properties of the object will be listed." msgstr "" "Haalt gegevens op van een gegeven object en eigenschap uit de " "gegevensverzameling %s. Indien als eigenschap \"info\" wordt ingetypt krijgt " "u een lijst van alle eigenschappen van het object." #: ../src/qalc.cc:2848 msgid "Example:" msgstr "bv.:" #: ../src/qalc.cc:2857 msgid "Arguments" msgstr "Argumenten" #. optional argument, in description #: ../src/qalc.cc:2874 msgid "optional" msgstr "optioneel" #. argument default, in description #: ../src/qalc.cc:2878 msgid "default: " msgstr "standaard: " #: ../src/qalc.cc:2889 msgid "Requirement" msgstr "Vereiste" #: ../src/qalc.cc:2897 msgid "Properties" msgstr "Eigenschappen" #: ../src/qalc.cc:2912 msgid "key" msgstr "sleutelwaarde" #: ../src/qalc.cc:2930 ../src/qalc.cc:2933 ../src/qalc.cc:3072 msgid "Unit" msgstr "Eenheid" #: ../src/qalc.cc:2936 ../src/qalc.cc:3004 msgid "Names" msgstr "Namen" #: ../src/qalc.cc:2954 msgid "Base Unit" msgstr "Basiseenheid" #: ../src/qalc.cc:2961 msgid "Relation" msgstr "Relatie" #: ../src/qalc.cc:2971 msgid "Inverse Relation" msgstr "Inverse relatie" #: ../src/qalc.cc:2983 msgid "Base Units" msgstr "Basiseenheden" #: ../src/qalc.cc:2998 ../src/qalc.cc:3001 msgid "Variable" msgstr "Variabele" #: ../src/qalc.cc:3016 msgid "a previous result" msgstr "een vorig antwoord" #: ../src/qalc.cc:3061 msgid "Uncertainty" msgstr "" #: ../src/qalc.cc:3091 msgid "Factorizes the current result." msgstr "Het huidige antwoord wordt in factoren ontbonden." #: ../src/qalc.cc:3095 msgid "Applies partial fraction decomposition to the current result." msgstr "" #: ../src/qalc.cc:3099 msgid "Simplifies the current result." msgstr "Het huidige antwoord wordt vereenvoudigd." #: ../src/qalc.cc:3112 msgid "Sets the value of an option." msgstr "Stelt de waarde in van een optie." #: ../src/qalc.cc:3113 msgid "Example: set base 16." msgstr "Voorbeeld: set base 16 (stel grondtal talstelsel in op 16)." #: ../src/qalc.cc:3115 #, fuzzy msgid "" "Available options and accepted values are (the current value is marked with " "'*'):" msgstr "Beschikbare opties en geaccepteerde waarden zijn:" #: ../src/qalc.cc:3119 msgid "" "Determines if the expression is simplified or factorized after calculation." msgstr "" #: ../src/qalc.cc:3120 msgid "Determines if unknown values will be assumed non-zero (x/x=1)." msgstr "" #: ../src/qalc.cc:3121 msgid "Display a message after a value has been assumed non-zero." msgstr "" #: ../src/qalc.cc:3124 #, fuzzy msgid "Default assumptions for unknown variables." msgstr "Staandaard aannames instellen voor onbekende variabelen." #: ../src/qalc.cc:3152 msgid "" "How approximate variables and calculations are handled. In exact mode " "approximate values will not be calculated." msgstr "" #: ../src/qalc.cc:3153 msgid "" "If activated, interval arithmetic determines the final precision of " "calculations. Avoids wrong results after loss of significance. Especially " "recommended with physical constants and/or 'read precision'." msgstr "" #: ../src/qalc.cc:3155 msgid "" "Specifies the default number of significant digits displayed and determines " "the precision used for approximate calculations." msgstr "" #: ../src/qalc.cc:3166 #, fuzzy msgid "Interprete undefined symbols in expressions as unknown variables." msgstr "Staandaard aannames instellen voor onbekende variabelen." #: ../src/qalc.cc:3168 msgid "" "If activated physical constants include units (e.g. c = 299 792 458 m∕s)." msgstr "" #: ../src/qalc.cc:3172 #, fuzzy msgid "Use abbreviated names for units and variables." msgstr "Staandaard aannames instellen voor onbekende variabelen." #: ../src/qalc.cc:3176 msgid "Use negative exponents instead of division in result (x/y = xy^-1)." msgstr "" #: ../src/qalc.cc:3178 msgid "Add extra space around operators." msgstr "" #: ../src/qalc.cc:3180 msgid "Display Unicode characters." msgstr "" #: ../src/qalc.cc:3184 ../src/qalc.cc:3273 msgid "bin" msgstr "bin" #: ../src/qalc.cc:3186 ../src/qalc.cc:3275 msgid "oct" msgstr "oct" #: ../src/qalc.cc:3188 ../src/qalc.cc:3277 msgid "dec" msgstr "dec" #: ../src/qalc.cc:3190 ../src/qalc.cc:3279 msgid "hex" msgstr "hex" #: ../src/qalc.cc:3192 msgid "sexa" msgstr "" #: ../src/qalc.cc:3204 ../src/qalc.cc:3257 msgid "Determines the default decimal separator." msgstr "" #: ../src/qalc.cc:3216 msgid "Determines how scientific notation are used (e.g. 5 543 000 = 5.543E6)." msgstr "" #: ../src/qalc.cc:3231 msgid "" "Determines how rational numbers are displayed (e.g. 5/4 = 1 + 1/4 = 1.25). " "'long' removes limits on the size of the numerator and denonimator." msgstr "" #: ../src/qalc.cc:3233 msgid "Use lowercase e for E-notation (5e2 = 5 * 10^2)." msgstr "" #: ../src/qalc.cc:3234 msgid "Use lowercase letters for number bases > 10." msgstr "" #: ../src/qalc.cc:3249 msgid "" "If activated, 1/6 is displayed as '0.1 666...', otherwise as '0.166667'." msgstr "" #: ../src/qalc.cc:3250 msgid "" "Determines whether halfway numbers are rounded upwards or towards the " "nearest even integer." msgstr "" #: ../src/qalc.cc:3251 msgid "If actived, zeroes are kept at the end of approximate numbers." msgstr "" #: ../src/qalc.cc:3252 msgid "" "Enables two's complement representation for display of negative binary " "numbers." msgstr "" #: ../src/qalc.cc:3268 msgid "Allows use of ',' as thousands separator." msgstr "" #: ../src/qalc.cc:3271 msgid "Allows use of '.' as thousands separator." msgstr "" #: ../src/qalc.cc:3287 #, fuzzy msgid "See 'help parsing mode'." msgstr "exp modus" #: ../src/qalc.cc:3288 msgid "" "If activated, numbers be interpreted as approximate with precision equal to " "the number of significant digits. Most useful in combination with 'interval " "arithmetic' (3.20 = 3.20+/-0.0005)." msgstr "" #: ../src/qalc.cc:3293 msgid "Enables automatic use of hecto, deca, deci, and centi." msgstr "" #: ../src/qalc.cc:3295 msgid "" "Controls automatic unit conversion of the result. 'optimalsi' always " "converts non-SI units, while 'optimal' only converts to more optimal unit " "expressions, with less units and exponents." msgstr "" #: ../src/qalc.cc:3309 msgid "" "Enables automatic conversion to the local currency when optimal unit " "conversion is enabled." msgstr "" #: ../src/qalc.cc:3310 msgid "" "Enables automatic use of prefixes in the denominator of unit expressions." msgstr "" #: ../src/qalc.cc:3311 msgid "" "If activated, units are separated from variables at the end of the result." msgstr "" #: ../src/qalc.cc:3312 msgid "Enables automatic use of prefixes in the result." msgstr "" #: ../src/qalc.cc:3317 msgid "days" msgstr "" #: ../src/qalc.cc:3324 #, fuzzy msgid "Activates the Reverse Polish Notation stack." msgstr "(De)activeert de RPN-modus (omgekeerde Poolse notatie)." #: ../src/qalc.cc:3325 #, fuzzy msgid "Save functions, units, and variables on exit." msgstr "een geldige naam voor een functie, eenheid of variabele" #: ../src/qalc.cc:3326 msgid "Save settings on exit." msgstr "" #: ../src/qalc.cc:3330 msgid "Set default assumptions for unknown variables." msgstr "Staandaard aannames instellen voor onbekende variabelen." #: ../src/qalc.cc:3357 msgid "" "Saves the current result in a variable with the specified name. You may " "optionally also provide a category (default \"Temporary\") and a title." msgstr "" "Slaat het huidige antwoord op in een variabele met de opgegeven naam. " "Optioneel kunt u ook een categorie (standaard \"Tijdelijk\") en een titel " "opgeven." #: ../src/qalc.cc:3358 msgid "" "If name equals \"mode\" or \"definitions\", the current mode and " "definitions, respectively, will be saved." msgstr "" "Indien de naam \"modus\" is of \"definities\", worden de huidige modus of " "definities opgeslagen." #: ../src/qalc.cc:3360 msgid "Example: store var1." msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:3364 #, fuzzy msgid "Create a variables with the specified name and expression." msgstr "Er bestaat geen functie, variabele of eenheid met de opgegeven naam." #: ../src/qalc.cc:3366 #, fuzzy msgid "Example: variable var1 pi / 2." msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:3370 #, fuzzy msgid "Creates a function with the specified name and expression." msgstr "Er bestaat geen functie, variabele of eenheid met de opgegeven naam." #: ../src/qalc.cc:3371 msgid "Use '\\x', '\\y', '\\z', '\\a', etc. for arguments in the expression." msgstr "" #: ../src/qalc.cc:3373 #, fuzzy msgid "Example: function func1 5*\\x." msgstr "Voorbeeld: info sin." #: ../src/qalc.cc:3377 #, fuzzy msgid "Removes the user-defined variable or function with the specified name." msgstr "Er bestaat geen functie, variabele of eenheid met de opgegeven naam." #: ../src/qalc.cc:3379 #, fuzzy msgid "Example: delete var1." msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:3383 msgid "Displays the current mode." msgstr "Toont de huidige modus." #: ../src/qalc.cc:3387 #, fuzzy msgid "Displays a list of variables, functions and units." msgstr "\"%s\" is geen geldige variabele/functie/eenheid." #: ../src/qalc.cc:3388 msgid "" "Enter with argument 'currencies', 'functions', 'variables' or 'units' to " "show a list of all currencies, functions, variables or units. Enter a search " "term to find matching variables, functions, and/or units. If command is " "called with no argument all user-definied objects are listed." msgstr "" #: ../src/qalc.cc:3390 #, fuzzy msgid "Example: list functions." msgstr "Voorbeeld: info sin." #: ../src/qalc.cc:3391 #, fuzzy msgid "Example: find dinar." msgstr "Voorbeeld: info sin." #: ../src/qalc.cc:3392 #, fuzzy msgid "Example: find variables planck." msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:3396 msgid "Displays information about a function, variable or unit." msgstr "Toont informatie over een functie, variabele of eenheid." #: ../src/qalc.cc:3398 msgid "Example: info sin." msgstr "Voorbeeld: info sin." #: ../src/qalc.cc:3402 msgid "Downloads current exchange rates from the Internet." msgstr "Haalt de huidige wisselkoersen op van het internet." #: ../src/qalc.cc:3406 #, fuzzy msgid "(De)activates the Reverse Polish Notation stack and syntax." msgstr "(De)activeert de RPN-modus (omgekeerde Poolse notatie)." #: ../src/qalc.cc:3408 msgid "" "\"syntax\" activates only the RPN syntax and \"stack\" enables the RPN stack." msgstr "" #: ../src/qalc.cc:3412 #, fuzzy msgid "Clears the entire RPN stack." msgstr "Maakt het RPN-stapelgeheugen leeg." #: ../src/qalc.cc:3416 #, fuzzy msgid "Removes the top of the RPN stack or the value at the specified index." msgstr "Er bestaat geen functie, variabele of eenheid met de opgegeven naam." #: ../src/qalc.cc:3418 ../src/qalc.cc:3430 ../src/qalc.cc:3440 #: ../src/qalc.cc:3450 msgid "" "Index 1 is the top of stack and negative index values counts from the bottom " "of the stack." msgstr "" #: ../src/qalc.cc:3422 msgid "Displays the RPN stack." msgstr "Toont het RPN-stapelgeheugen." #: ../src/qalc.cc:3426 msgid "Swaps position of values on the RPN stack." msgstr "" #: ../src/qalc.cc:3428 msgid "" "If no index is specified, the values on the top of the stack (index 1 and " "index 2) will be swapped and if only one index is specified, the value at " "this index will be swapped with the top value." msgstr "" #: ../src/qalc.cc:3432 #, fuzzy msgid "Example: swap 2 4" msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:3436 msgid "Duplicates a value on the RPN stack to the top of the stack." msgstr "" #: ../src/qalc.cc:3438 msgid "If no index is specified, the top of the stack is duplicated." msgstr "" #: ../src/qalc.cc:3444 msgid "Rotates the RPN stack up (default) or down." msgstr "" #: ../src/qalc.cc:3448 msgid "Changes the position of a value on the RPN stack." msgstr "" #: ../src/qalc.cc:3452 #, fuzzy msgid "Example: move 2 4" msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:3456 #, fuzzy msgid "Sets the result number base (equivalent to set base)." msgstr "" "Stelt het grondtal in voor het antwoord (gelijkwaardig aan instellen " "grondtal talstelsel)." #: ../src/qalc.cc:3460 msgid "Equivalent to set approximation exact." msgstr "Gelijkwaardig aan benadering instellen op exact." #: ../src/qalc.cc:3464 msgid "Equivalent to set approximation try exact." msgstr "Gelijkwaardig aan benadering instellen op exact proberen." #: ../src/qalc.cc:3469 #, fuzzy msgid "Converts units or changes number base in current result." msgstr "Converteert de eenheden in het huidige antwoord." #: ../src/qalc.cc:3471 #, fuzzy msgid "Possible values:" msgstr "Mogelijke eenheden zijn:" #: ../src/qalc.cc:3473 msgid "- a unit (e.g. meter)" msgstr "- een eenheid (voorbeeld meter)" #: ../src/qalc.cc:3474 msgid "prepend with ? to request the optimal prefix" msgstr "" #: ../src/qalc.cc:3475 msgid "prepend with + or - to force/disable use of mixed units" msgstr "" #: ../src/qalc.cc:3476 msgid "- a unit expression (e.g. km/h)" msgstr "- een uitdrukking voor een eenheid (voorbeeld km/h)" #: ../src/qalc.cc:3477 msgid "- a physical constant (e.g. c)" msgstr "" #: ../src/qalc.cc:3478 #, fuzzy msgid "- base (convert to base units)" msgstr "basis (omzetten naar basiseenheden)" #: ../src/qalc.cc:3479 #, fuzzy msgid "- optimal (convert to optimal unit)" msgstr "basis (omzetten naar basiseenheden)" #: ../src/qalc.cc:3480 msgid "- mixed (convert to mixed units, e.g. hours + minutes)" msgstr "" #: ../src/qalc.cc:3482 msgid "- bin / binary (show as binary number)" msgstr "" #: ../src/qalc.cc:3483 msgid "- oct / octal (show as octal number)" msgstr "" #: ../src/qalc.cc:3484 msgid "- duo / duodecimal (show as duodecimal number)" msgstr "" #: ../src/qalc.cc:3485 msgid "- hex / hexadecimal (show as hexadecimal number)" msgstr "" #: ../src/qalc.cc:3486 msgid "- sex / sexagesimal (show as sexagesimal number)" msgstr "" #: ../src/qalc.cc:3487 #, fuzzy msgid "- roman (show as roman numerals)" msgstr "Fout in Romeins cijfers: \"%s\"." #: ../src/qalc.cc:3488 msgid "- time (show in time format)" msgstr "" #: ../src/qalc.cc:3489 msgid "- bases (show as binary, octal, decimal and hexadecimal number)" msgstr "" #: ../src/qalc.cc:3491 msgid "- rectangular / cartesian (show complex numbers in rectangular form)" msgstr "" #: ../src/qalc.cc:3492 msgid "- exponential (show complex numbers in exponential form)" msgstr "" #: ../src/qalc.cc:3493 msgid "- polar (show complex numbers in polar form)" msgstr "" #: ../src/qalc.cc:3495 msgid "- fraction (show result in combined fractional format)" msgstr "" #: ../src/qalc.cc:3496 #, fuzzy msgid "- factors (factorize result)" msgstr "Het huidige antwoord wordt in factoren ontbonden." #: ../src/qalc.cc:3498 msgid "- utc (show UTC date)" msgstr "" #: ../src/qalc.cc:3499 msgid "- calendars" msgstr "" #: ../src/qalc.cc:3501 #, fuzzy msgid "Example: to ?g" msgstr "Voorbeeld: store var1 (bewaar var1)." #: ../src/qalc.cc:3504 msgid "" "This command can also be typed directly at the end of the mathematical " "expression." msgstr "" #: ../src/qalc.cc:3509 msgid "Terminates this program." msgstr "Sluit het programma af." #: ../src/qalc.cc:3514 msgid "" "Implicit multiplication does not differ from explicit multiplication " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." msgstr "" #: ../src/qalc.cc:3517 msgid "" "Implicit multiplication is parsed before explicit multiplication " "(\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." msgstr "" #: ../src/qalc.cc:3520 msgid "" "The default adaptive mode works as the \"implicit first\" mode, unless " "spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the " "adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/" "(5*(m/s)) = 1 s\")." msgstr "" #: ../src/qalc.cc:3522 msgid "" "Function arguments without parentheses are an exception, where implicit " "multiplication in front of variables and units is parsed first regardless of " "mode (\"sqrt 2x = sqrt(2x)\")." msgstr "" #: ../src/qalc.cc:3536 #, fuzzy msgid "Unknown command." msgstr "Onbekend Romeins cijfer: %c." #: ../src/qalc.cc:3585 msgid "error" msgstr "fout" #: ../src/qalc.cc:3587 msgid "warning" msgstr "waarschuwing" #: ../src/qalc.cc:3663 ../src/qalc.cc:3701 ../src/qalc.cc:3997 #: ../src/qalc.cc:4401 ../libqalculate/Calculator.cc:10016 #: ../libqalculate/MathStructure.cc:713 #, c-format msgid "aborted" msgstr "afgebroken" #: ../src/qalc.cc:3713 msgid "RPN Register Moved" msgstr "RPN-register is verplaatst" #: ../src/qalc.cc:3769 msgid "Processing (press Enter to abort)" msgstr "Aan het verwerken (afbreken met Enter)" #: ../src/qalc.cc:3856 ../src/qalc.cc:4549 msgid "approx." msgstr "benad." #: ../src/qalc.cc:4014 msgid "Factorizing (press Enter to abort)" msgstr "Aan het ontbinden in factoren (afbreken met Enter)" #: ../src/qalc.cc:4018 msgid "Expanding partial fractions…" msgstr "" #: ../src/qalc.cc:4022 msgid "Simplifying (press Enter to abort)" msgstr "Aan het vereenvoudigen (afbreken met Enter)" #: ../src/qalc.cc:4026 ../src/qalc.cc:4415 msgid "Calculating (press Enter to abort)" msgstr "Aan het berekenen (afbreken met Enter)" #: ../src/qalc.cc:4500 msgid "RPN Operation" msgstr "RPN-berwerking" #: ../src/qalc.cc:4969 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "Kon de voorkeurinstellingen niet schrijven naar\n" "%s" #: ../src/qalc.cc:5056 msgid "Couldn't write definitions" msgstr "Kon definities niet schrijven" #: ../libqalculate/BuiltinFunctions.cc:68 #, c-format msgid "Too many elements (%s) for the dimensions (%sx%s) of the matrix." msgstr "Te veel elementen (%s) voor de dimensies (%sx%s) van de matrix." #: ../libqalculate/BuiltinFunctions.cc:131 #: ../libqalculate/BuiltinFunctions.cc:193 #, c-format msgid "Row %s does not exist in matrix." msgstr "Rij %s bestaat niet in matrix." #: ../libqalculate/BuiltinFunctions.cc:144 #: ../libqalculate/BuiltinFunctions.cc:189 #, c-format msgid "Column %s does not exist in matrix." msgstr "Kolom %s bestaat niet in matrix." #: ../libqalculate/BuiltinFunctions.cc:204 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "Argument 3, %s, wordt genegeerd voor vectoren." #: ../libqalculate/BuiltinFunctions.cc:208 #: ../libqalculate/BuiltinFunctions.cc:229 #, c-format msgid "Element %s does not exist in vector." msgstr "Element %s bestaat niet in vector." #: ../libqalculate/BuiltinFunctions.cc:370 #: ../libqalculate/BuiltinFunctions.cc:374 #: ../libqalculate/BuiltinFunctions.cc:406 #: ../libqalculate/BuiltinFunctions.cc:410 #, c-format msgid "%s() requires that all matrices/vectors have the same dimensions." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4274 #: ../libqalculate/BuiltinFunctions.cc:4317 #, c-format msgid "Unsolvable comparison in %s()." msgstr "Vergelijken lukt niet in %s()." #: ../libqalculate/BuiltinFunctions.cc:4400 #: ../libqalculate/BuiltinFunctions.cc:4434 msgid "gregorian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4401 msgid "milankovic" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4402 msgid "julian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4403 msgid "islamic" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4404 msgid "hebrew" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4405 msgid "egyptian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4406 msgid "persian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4407 #, fuzzy msgid "coptic" msgstr "optioneel" #: ../libqalculate/BuiltinFunctions.cc:4408 msgid "ethiopian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4409 #, fuzzy msgid "indian" msgstr "radialen" #: ../libqalculate/BuiltinFunctions.cc:4410 msgid "chinese" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4895 msgid "" "The number of requested elements in generate vector function must be a " "positive integer." msgstr "" "Het aantal gevraagde elementen in de gegenereerde vectorfunctie moet een " "positief geheel getal zijn." #: ../libqalculate/BuiltinFunctions.cc:5211 #: ../libqalculate/BuiltinFunctions.cc:5215 #, c-format msgid "Too few elements (%s) in vector (%s required)" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:5264 #: ../libqalculate/BuiltinFunctions.cc:5281 msgid "Comparison failed." msgstr "Vergelijken is mislukt." #: ../libqalculate/BuiltinFunctions.cc:5269 #: ../libqalculate/BuiltinFunctions.cc:5299 msgid "No matching item found." msgstr "Geen overeenkomst gevonden." #: ../libqalculate/BuiltinFunctions.cc:5397 #, c-format msgid "Object %s does not exist." msgstr "Object %s bestaat niet." #: ../libqalculate/BuiltinFunctions.cc:5415 #, fuzzy, c-format msgid "Invalid variable name (%s)." msgstr "een geldige naam voor een variabele" #: ../libqalculate/BuiltinFunctions.cc:5432 msgid "" "A global unit or variable was deactivated. It will be restored after the new " "variable has been removed." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:5447 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "Register %s bestaat niet. Nul wordt geretourneerd." #: ../libqalculate/BuiltinFunctions.cc:5796 #: ../libqalculate/MathStructure.cc:203 ../libqalculate/MathStructure.cc:235 #: ../libqalculate/MathStructure.cc:276 #, c-format msgid "To avoid division by zero, the following must be true: %s." msgstr "Om delen door nul te voorkomen moet het volgende waar zijn: %s." #: ../libqalculate/BuiltinFunctions.cc:5852 #: ../libqalculate/BuiltinFunctions.cc:5879 #: ../libqalculate/BuiltinFunctions.cc:5899 #: ../libqalculate/BuiltinFunctions.cc:5940 #: ../libqalculate/BuiltinFunctions.cc:6035 #: ../libqalculate/BuiltinFunctions.cc:6125 #, fuzzy msgid "Unable to integrate the expression." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:5950 #: ../libqalculate/BuiltinFunctions.cc:5987 #, fuzzy msgid "Unable to integrate the expression exact." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:6073 #: ../libqalculate/BuiltinFunctions.cc:6116 msgid "Definite integral was approximated with unknown precision." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:6097 msgid "Definite integral was approximated." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:6339 msgid "" "No equality or inequality to solve. The entered expression to solve is not " "correct (ex. \"x + 5 = 3\" is correct)" msgstr "" "Geen op te lossen vergelijking of ongelijkheid. De ingevoerde op te lossen " "expressie is onjuist (bv. \"x + 5 = 3\" is juist)" #: ../libqalculate/BuiltinFunctions.cc:6386 #, c-format msgid "The comparison is true for all %s (with current assumptions)." msgstr "Het vergelijken geeft waar voor alle %s (met huidige aannames)." #: ../libqalculate/BuiltinFunctions.cc:6390 msgid "No possible solution was found (with current assumptions)." msgstr "Geen oplossing gevonden (met huidige aannames)." #: ../libqalculate/BuiltinFunctions.cc:6394 #, c-format msgid "Was unable to completely isolate %s." msgstr "Kon %s niet volledig isoleren." #: ../libqalculate/BuiltinFunctions.cc:6398 #: ../libqalculate/BuiltinFunctions.cc:6566 #: ../libqalculate/BuiltinFunctions.cc:6661 #, c-format msgid "The comparison is true for all %s if %s." msgstr "Het vergelijken geeft waar voor alle %s indien %s." #: ../libqalculate/BuiltinFunctions.cc:6402 #, c-format msgid "Was unable to isolate %s." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:6525 #: ../libqalculate/BuiltinFunctions.cc:6552 #: ../libqalculate/BuiltinFunctions.cc:6635 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed sign was " "therefor temporarily set as unknown." msgstr "" "Kon %s niet isoleren met de huidige aannames. Het aangenomen teken werd " "daarom tijdelijk als onbekend beschouwd." #: ../libqalculate/BuiltinFunctions.cc:6528 #: ../libqalculate/BuiltinFunctions.cc:6555 #: ../libqalculate/BuiltinFunctions.cc:6638 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed type and " "sign was therefor temporarily set as unknown." msgstr "" "Kon %s niet isoleren met de huidige aannames. Het aangenomen type en teken " "werd daarom tijdelijk als onbekend beschouwd." #: ../libqalculate/BuiltinFunctions.cc:6561 #: ../libqalculate/BuiltinFunctions.cc:6646 #, c-format msgid "The solution requires that %s." msgstr "De oplossing vereist dat %s." #: ../libqalculate/BuiltinFunctions.cc:6654 #, c-format msgid "Solution %s requires that %s." msgstr "De oplossing %s vereist dat %s." #: ../libqalculate/BuiltinFunctions.cc:6726 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "so that each equation at least contains the corresponding variable (if " "automatic reordering failed)." msgstr "" "Kan %s niet isoleren.\n" "\n" "Mogelijk moet u de vergelijkingen en variabelen in een juiste volgorde " "plaatsen zodat elke vergelijking tenminste de ermee overeenkomende variabele " "bevat (indien het automatisch op volgorde zetten niet is gelukt)." #: ../libqalculate/BuiltinFunctions.cc:6728 #: ../libqalculate/BuiltinFunctions.cc:6742 #: ../libqalculate/BuiltinFunctions.cc:6751 #, c-format msgid "Unable to isolate %s." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:6735 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "Ongelijkheden zijn niet toegestaan in %s()." #: ../libqalculate/BuiltinFunctions.cc:7078 #: ../libqalculate/BuiltinFunctions.cc:7083 msgid "No differential equation found." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:7087 #: ../libqalculate/BuiltinFunctions.cc:7116 #: ../libqalculate/BuiltinFunctions.cc:7122 msgid "Unable to solve differential equation." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:7148 #, fuzzy msgid "Unable to find limit." msgstr "Kon %s niet isoleren." #: ../libqalculate/BuiltinFunctions.cc:7195 #: ../libqalculate/BuiltinFunctions.cc:7209 msgid "Matrix" msgstr "Matrix" #: ../libqalculate/BuiltinFunctions.cc:7220 #: ../libqalculate/BuiltinFunctions.cc:7273 msgid "Vector" msgstr "Vector" #: ../libqalculate/BuiltinFunctions.cc:7235 #: ../libqalculate/BuiltinFunctions.cc:7284 ../libqalculate/Calculator.cc:10566 msgid "Unable to generate plot data with current min, max and step size." msgstr "" "Het is onmogelijk plotgegevens te genereren met de huidige min, max en " "stapgrootte." #: ../libqalculate/BuiltinFunctions.cc:7237 #: ../libqalculate/BuiltinFunctions.cc:7286 msgid "Sampling rate must be a positive integer." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:7246 #: ../libqalculate/BuiltinFunctions.cc:7295 ../libqalculate/Calculator.cc:10533 msgid "Unable to generate plot data with current min, max and sampling rate." msgstr "" "Het is onmogelijk plotgegevens te genereren met de huidige min, max en " "bemonsteringsnelheid." #: ../libqalculate/Calculator.cc:390 msgid "per" msgstr "per" #: ../libqalculate/Calculator.cc:392 msgid "times" msgstr "keer" #: ../libqalculate/Calculator.cc:394 msgid "plus" msgstr "plus" #: ../libqalculate/Calculator.cc:396 msgid "minus" msgstr "minus" #: ../libqalculate/Calculator.cc:398 ../libqalculate/MathStructure.cc:18761 #: ../libqalculate/Function.cc:1223 ../libqalculate/Function.cc:1231 #: ../libqalculate/Function.cc:1660 ../libqalculate/Function.cc:1822 #: ../libqalculate/Function.cc:1830 msgid "and" msgstr "and" #: ../libqalculate/Calculator.cc:402 ../libqalculate/DataSet.cc:1046 #: ../libqalculate/DataSet.cc:1109 ../libqalculate/MathStructure.cc:18776 #: ../libqalculate/Function.cc:2161 ../libqalculate/Function.cc:2177 msgid "or" msgstr "or" #: ../libqalculate/Calculator.cc:449 ../libqalculate/Calculator.cc:1240 #: ../libqalculate/Calculator.cc:2622 ../libqalculate/Calculator.cc:2629 #: ../libqalculate/Calculator.cc:2630 msgid " to " msgstr " naar " #: ../libqalculate/Calculator.cc:535 msgid "Gradians unit is missing. Creating one for this session." msgstr "" "Eenheid grad (100 grads in rechte hoek) ontbreekt. Voor deze sessie wordt er " "een aangemaakt." #: ../libqalculate/Calculator.cc:536 ../libqalculate/Calculator.cc:544 #: ../libqalculate/Calculator.cc:552 msgid "Angle/Plane Angle" msgstr "Hoek/hoek in het platte vlak" #: ../libqalculate/Calculator.cc:543 msgid "Radians unit is missing. Creating one for this session." msgstr "Eenheid radiaal ontbreekt. Voor deze sessie wordt er een aangemaakt." #: ../libqalculate/Calculator.cc:551 msgid "Degrees unit is missing. Creating one for this session." msgstr "Eenheid graad ontbreekt. Voor deze sessie wordt er een aangemaakt." #: ../libqalculate/Calculator.cc:1631 ../libqalculate/Calculator.cc:1632 #: ../libqalculate/Calculator.cc:10080 ../libqalculate/Calculator.cc:10217 #: ../libqalculate/Calculator.cc:10275 msgid "Currency" msgstr "Valuta" #: ../libqalculate/Calculator.cc:1818 msgid "" "The calculation has been forcibly terminated. Please restart the application " "and report this as a bug." msgstr "" #: ../libqalculate/Calculator.cc:2094 ../libqalculate/Calculator.cc:2219 msgid "Stack is empty. Filling remaining function arguments with zeroes." msgstr "" #: ../libqalculate/Calculator.cc:2573 msgid "calculating..." msgstr "aan het rekenen..." #: ../libqalculate/Calculator.cc:4191 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or " "the variable will be lost." msgstr "" "De naam \"%s\" is niet meer toegestaan. Verander alstublieft de naam \"%s\" " "omdat anders deze variabele verloren gaat." #: ../libqalculate/Calculator.cc:4209 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the function will be lost." msgstr "" "De naam \"%s\" is niet meer toegestaan. Verander alstublieft de naam \"%s\" " "omdat anders deze functie verloren gaat." #: ../libqalculate/Calculator.cc:4226 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the unit will be lost." msgstr "" "De naam \"%s\" is niet meer toegestaan. Verander alstublieft de naam \"%s\" " "omdat anders deze eenheid verloren gaat." #: ../libqalculate/Calculator.cc:5589 ../libqalculate/Calculator.cc:6546 #: ../libqalculate/Calculator.cc:6553 ../libqalculate/Calculator.cc:6574 #: ../libqalculate/Calculator.cc:6595 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "Verkeerd geplaatste bewerking(en) \"%s\" genegeerd" #: ../libqalculate/Calculator.cc:5630 ../libqalculate/Calculator.cc:6614 #, c-format msgid "Misplaced '%c' ignored" msgstr "Verkeerd geplaatste '%c' genegeerd" #: ../libqalculate/Calculator.cc:5662 ../libqalculate/Function.cc:1381 #: ../libqalculate/Function.cc:1412 #, c-format msgid "Internal id %s does not exist." msgstr "Interne id %s bestaat niet." #: ../libqalculate/Calculator.cc:5680 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\" is geen geldige variabele/functie/eenheid." #: ../libqalculate/Calculator.cc:5695 #, c-format msgid "" "Trailing characters \"%s\" (not a valid variable/function/unit) in number " "\"%s\" was ignored." msgstr "" "Afsluitende karakters \"%s\" (geen geldige variabele/functie/eenheid) in " "getal \"%s\" werden genegeerd." #: ../libqalculate/Calculator.cc:6153 msgid "RPN syntax error. Values left at the end of the RPN expression." msgstr "" "RPN-fout. Er zijn nog waarden overgebleven na de verwerking van de RPN-" "opdracht." #: ../libqalculate/Calculator.cc:6156 msgid "Unused stack values." msgstr "Ongebruikte waarden op de stack (stapelregister)." #: ../libqalculate/Calculator.cc:6195 ../libqalculate/Calculator.cc:6263 #, fuzzy, c-format msgid "RPN syntax error. Operator '%c' not supported." msgstr "RPN-syntaxisfout. Stack (stapelregister) is leeg." #: ../libqalculate/Calculator.cc:6223 msgid "RPN syntax error. Stack is empty." msgstr "RPN-syntaxisfout. Stack (stapelregister) is leeg." #: ../libqalculate/Calculator.cc:6225 msgid "RPN syntax error. Operator ignored as there where only one stack value." msgstr "" "RPN-syntaxisfout. Bewerking genegeerd omdat er slechts één waarde is op de " "stack (stapelregister)." #: ../libqalculate/Calculator.cc:6855 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "Naam \"%s\" wordt al gebruikt.. Wordt vervangen door \"%s\"." #: ../libqalculate/Calculator.cc:7541 ../libqalculate/DataSet.cc:529 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "Bestand niet gedefinieerd als definitiebestand voor Qalculate!: %s." #: ../libqalculate/Calculator.cc:9581 ../libqalculate/DataSet.cc:353 msgid "Object" msgstr "Object" #: ../libqalculate/Calculator.cc:9590 ../libqalculate/DataSet.cc:354 msgid "Property" msgstr "Eigenschap" #: ../libqalculate/Calculator.cc:9889 msgid "column" msgstr "kolom" #: ../libqalculate/Calculator.cc:9892 msgid "Column " msgstr "Kolom " #: ../libqalculate/Calculator.cc:9968 ../libqalculate/Calculator.cc:10015 msgid "timed out" msgstr "tijd is verlopen" #: ../libqalculate/Calculator.cc:10387 ../libqalculate/Calculator.cc:10388 #: ../libqalculate/Calculator.cc:10392 ../libqalculate/Calculator.cc:10395 #: ../libqalculate/Calculator.cc:10427 ../libqalculate/Calculator.cc:10428 #: ../libqalculate/Calculator.cc:10431 ../libqalculate/Calculator.cc:10450 #: ../libqalculate/Calculator.cc:10451 ../libqalculate/Calculator.cc:10454 #, c-format msgid "Failed to download exchange rates from %s: %s." msgstr "Het ophalen van wisselkoersen van %s is niet gelukt: %s." #: ../libqalculate/Calculator.cc:10529 ../libqalculate/Calculator.cc:10562 #: ../libqalculate/Calculator.cc:10595 ../libqalculate/Calculator.cc:10934 msgid "It took too long to generate the plot data." msgstr "" #: ../libqalculate/Calculator.cc:10629 msgid "No extension in file name. Saving as PNG image." msgstr "" "Geen extensie opgegeven voor bestandsnaam. Wordt opgeslagen als PNG-" "afbeelding." #: ../libqalculate/Calculator.cc:10648 msgid "Unknown extension in file name. Saving as PNG image." msgstr "" "Onbekende extensie in bestandsnaam. Wordt opgeslagen als PNG-afbeelding." #: ../libqalculate/Calculator.cc:10865 #, c-format msgid "Could not create temporary file %s" msgstr "Kon tijdelijk bestand %s niet aanmaken" #: ../libqalculate/Calculator.cc:10981 msgid "" "Failed to invoke gnuplot. Make sure that you have gnuplot installed in your " "path." msgstr "" "Gnuplot aanroepen mislukt. Controleer uw path of gnuplot daarin is te vinden." #: ../libqalculate/DataSet.cc:379 #, c-format msgid "Object %s not available in data set." msgstr "Object %s niet beschikbaar in gegevensverzameling." #: ../libqalculate/DataSet.cc:389 #, c-format msgid "Property %s not available in data set." msgstr "Eigenschap %s niet beschikbaar in gegevensverzameling." #: ../libqalculate/DataSet.cc:394 #, c-format msgid "Property %s not defined for object %s." msgstr "Eigenschap %s niet gedefinieerd voor object %s." #: ../libqalculate/DataSet.cc:507 ../libqalculate/DataSet.cc:515 #, c-format msgid "Unable to load data objects in %s." msgstr "Kon gegevensobjecten in %s niet inlezen." #: ../libqalculate/DataSet.cc:1016 msgid "data property" msgstr "eigenschap gegevens" #: ../libqalculate/DataSet.cc:1018 msgid "name of a data property" msgstr "naam van een eigenschap van gegevens" #: ../libqalculate/DataSet.cc:1026 ../libqalculate/DataSet.cc:1042 msgid "no properties available" msgstr "geen eigenschappen beschikbaar" #: ../libqalculate/DataSet.cc:1076 #, c-format msgid "" "Data set \"%s\" has no object key that supports the provided argument type." msgstr "" "Gegevensverzameling \"%s\" heeft geen objectsleutel die het opgegeven " "argumenttype ondersteunt." #: ../libqalculate/DataSet.cc:1081 msgid "data object" msgstr "gegevensobject" #: ../libqalculate/DataSet.cc:1083 msgid "an object from" msgstr "een object van" #: ../libqalculate/DataSet.cc:1112 msgid "use" msgstr "gebruik" #: ../libqalculate/MathStructure.cc:174 #, fuzzy, c-format msgid "Required assumption: %s." msgstr "Onbekende aanname." #: ../libqalculate/MathStructure.cc:3792 ../libqalculate/MathStructure.cc:3813 #, c-format msgid "" "The second matrix must have as many rows (was %s) as the first has columns " "(was %s) for matrix multiplication." msgstr "" "Voor het vermenigvuldigen van twee matrices moet het aantal rijen van de " "tweede (was %s) even groot zijn als het aantal kolommen van de eerste (was " "%s)." #: ../libqalculate/MathStructure.cc:8265 ../libqalculate/MathStructure.cc:8306 #: ../libqalculate/MathStructure.cc:8339 ../libqalculate/MathStructure.cc:8406 #: ../libqalculate/MathStructure.cc:8434 ../libqalculate/MathStructure.cc:8453 #: ../libqalculate/MathStructure.cc:8472 ../libqalculate/MathStructure.cc:8491 #: ../libqalculate/MathStructure.cc:8600 ../libqalculate/MathStructure.cc:14408 #: ../libqalculate/MathStructure.cc:14684 msgid "This is a bug. Please report it." msgstr "Dit is een bug (programmafout). Meld deze alstublieft." #: ../libqalculate/MathStructure.cc:10980 #: ../libqalculate/MathStructure.cc:10985 #, c-format msgid "Limit for %s determined graphically." msgstr "" #: ../libqalculate/MathStructure.cc:11792 msgid "Interval potentially calculated wide." msgstr "" #: ../libqalculate/MathStructure.cc:16085 msgid "" "Because of time constraints only a limited number of combinations of terms " "were tried during factorization. Repeat factorization to try other random " "combinations." msgstr "" #: ../libqalculate/MathStructure.cc:18860 msgid "undefined" msgstr "ongedefinieerd" #: ../libqalculate/MathStructure.cc:18901 #, c-format msgid "Unsolvable comparison at element %s when trying to rank vector." msgstr "" "Vergelijken lukt niet bij element %s bij berekenen van rangvolgorde vector." #: ../libqalculate/MathStructure.cc:18951 #, c-format msgid "Unsolvable comparison at element %s when trying to sort vector." msgstr "Vergelijken lukt niet bij element %s bij sorteren vector." #: ../libqalculate/MathStructure.cc:19376 msgid "The determinant can only be calculated for square matrices." msgstr "De determinant kan alleen voor een vierkante matrix worden berekend." #: ../libqalculate/MathStructure.cc:19439 msgid "The permanent can only be calculated for square matrices." msgstr "De permanent kan alleen voor een vierkante matrix worden berekend." #: ../libqalculate/MathStructure.cc:19528 msgid "Inverse of singular matrix." msgstr "Inverse van singuliere matrix." #: ../libqalculate/MathStructure.cc:19875 msgid "" "Calculations involving conversion of units without proportional linear " "relationship (e.g. with multiple temperature units), might give unexpected " "results and is not recommended." msgstr "" #: ../libqalculate/MathStructure.cc:20745 #: ../libqalculate/MathStructure.cc:20788 msgid "Too many data points" msgstr "" #: ../libqalculate/MathStructure.cc:20752 msgid "" "The selected min and max do not result in a positive, finite number of data " "points" msgstr "" #: ../libqalculate/MathStructure.cc:20785 msgid "" "The selected min, max and step size do not result in a positive, finite " "number of data points" msgstr "" #: ../libqalculate/MathStructure.cc:27312 #: ../libqalculate/MathStructure.cc:27488 #: ../libqalculate/MathStructure.cc:28117 #: ../libqalculate/MathStructure.cc:28625 #: ../libqalculate/MathStructure.cc:28682 #: ../libqalculate/MathStructure.cc:28724 #: ../libqalculate/MathStructure.cc:28737 #: ../libqalculate/MathStructure.cc:28787 #: ../libqalculate/MathStructure.cc:28906 #: ../libqalculate/MathStructure.cc:29041 #, c-format msgid "Interval arithmetic was disabled during calculation of %s." msgstr "" #: ../libqalculate/MathStructure.cc:29040 #, c-format msgid "Not all complex roots were calculated for %s." msgstr "" #: ../libqalculate/MathStructure.cc:30450 #, c-format msgid "Only one or two of the roots where calculated for %s." msgstr "" #: ../libqalculate/Function.cc:165 #, c-format msgid "%s() requires that %s" msgstr "%s() vereist dat %s" #: ../libqalculate/Function.cc:320 ../libqalculate/Function.cc:379 #: ../libqalculate/Function.cc:439 #, c-format msgid "" "Additional arguments for function %s() was ignored. Function can only use %s " "argument(s)." msgstr "" "Overtollige argumenten voor functie %s() werden genegeerd. Functie heeft " "slechts %s argument(en) nodig." #: ../libqalculate/Function.cc:460 #, c-format msgid "You need at least %s argument(s) (%s) in function %s()." msgstr "Er is/zijn minstens %s argument(en) (%s) nodig in functie %s()." #: ../libqalculate/Function.cc:462 #, c-format msgid "You need at least %s argument(s) in function %s()." msgstr "Er is/zijn minstens %s argument(en) nodig in functie %s()." #: ../libqalculate/Function.cc:1213 msgid "a free value" msgstr "een vrije waarde" #: ../libqalculate/Function.cc:1218 msgid "that is nonzero" msgstr "die ongelijk nul is" #: ../libqalculate/Function.cc:1226 msgid "that is rational (polynomial)" msgstr "die rationaal is (polynoom)" #: ../libqalculate/Function.cc:1234 msgid "that fulfills the condition:" msgstr "die aan de conditie voldoet:" #: ../libqalculate/Function.cc:1237 msgid "Argument" msgstr "Argument" #: ../libqalculate/Function.cc:1301 #, c-format msgid "Argument %s in %s() must be %s." msgstr "Argument %s in %s() moet zijn: %s." #: ../libqalculate/Function.cc:1303 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "Argument %s, %s, in %s() moet zijn: %s." #: ../libqalculate/Function.cc:1641 msgid "a rational number" msgstr "een rationaal getal" #: ../libqalculate/Function.cc:1643 msgid "a number" msgstr "een getal" #: ../libqalculate/Function.cc:1645 msgid "a real number" msgstr "een reëel getal" #: ../libqalculate/Function.cc:1650 ../libqalculate/Function.cc:1803 #: ../libqalculate/Function.cc:1808 msgid ">=" msgstr ">=" #: ../libqalculate/Function.cc:1652 msgid ">" msgstr ">" #: ../libqalculate/Function.cc:1664 ../libqalculate/Function.cc:1825 #: ../libqalculate/Function.cc:1832 msgid "<=" msgstr "<=" #: ../libqalculate/Function.cc:1666 msgid "<" msgstr "<" #: ../libqalculate/Function.cc:1800 msgid "an integer" msgstr "een geheel getal" #: ../libqalculate/Function.cc:1857 msgid "symbol" msgstr "symbool" #: ../libqalculate/Function.cc:1858 msgid "an unknown variable/symbol" msgstr "een onbekend(e) variabele/symbool" #: ../libqalculate/Function.cc:1871 msgid "text" msgstr "tekst" #: ../libqalculate/Function.cc:1872 msgid "a text string" msgstr "een tekenrij" #: ../libqalculate/Function.cc:1894 msgid "date" msgstr "datum" #: ../libqalculate/Function.cc:1895 msgid "a date" msgstr "een datum" #: ../libqalculate/Function.cc:1944 msgid "a vector with " msgstr "een vector met " #: ../libqalculate/Function.cc:1956 msgid "a vector" msgstr "een vector" #: ../libqalculate/Function.cc:2005 msgid "a square matrix" msgstr "een vierkante matrix" #: ../libqalculate/Function.cc:2007 msgid "a matrix" msgstr "een matrix" #: ../libqalculate/Function.cc:2022 msgid "object" msgstr "object" #: ../libqalculate/Function.cc:2023 msgid "a valid function, unit or variable name" msgstr "een geldige naam voor een functie, eenheid of variabele" #: ../libqalculate/Function.cc:2037 msgid "a valid function name" msgstr "een geldige functienaam" #: ../libqalculate/Function.cc:2050 msgid "unit" msgstr "eenheid" #: ../libqalculate/Function.cc:2051 msgid "a valid unit name" msgstr "een geldige naam voor een eenheid" #: ../libqalculate/Function.cc:2065 msgid "a valid variable name" msgstr "een geldige naam voor een variabele" #: ../libqalculate/Function.cc:2078 msgid "file" msgstr "bestand" #: ../libqalculate/Function.cc:2079 msgid "a valid file name" msgstr "een geldige bestandsnaam" #: ../libqalculate/Function.cc:2092 msgid "boolean" msgstr "Booleaanse waarde" #: ../libqalculate/Function.cc:2093 msgid "a boolean (0 or 1)" msgstr "een Booleaanse waarde (0 of 1)" #: ../libqalculate/Function.cc:2103 msgid "angle" msgstr "hoek" #: ../libqalculate/Function.cc:2104 msgid "an angle or a number (using the default angle unit)" msgstr "een hoek of een getal (in standaard hoekeenheid)" #: ../libqalculate/Number.cc:235 ../libqalculate/Number.cc:6709 msgid "" "Cannot display numbers greater than 9999 or less than -9999 as roman " "numerals." msgstr "" "Kan getallen groter dan 9999 of kleiner dan -9999 niet weergeven als " "Romeinse getallen." #: ../libqalculate/Number.cc:348 msgid "" "Assuming the unusual practice of letting a last capital I mean 2 in a roman " "numeral." msgstr "" "Een laatste hoofdletter I in een Romeins getal betekent hier 2, hoewel dit " "ongebruikelijk is." #: ../libqalculate/Number.cc:426 #, c-format msgid "Error in roman numerals: %s." msgstr "Fout in Romeins cijfers: \"%s\"." #: ../libqalculate/Number.cc:461 #, c-format msgid "Unknown roman numeral: %c." msgstr "Onbekend Romeins cijfer: %c." #: ../libqalculate/Number.cc:519 #, c-format msgid "" "Errors in roman numerals: \"%s\". Interpreted as %s, which should be written " "as %s." msgstr "" "Fout in Romeinse cijfers: \"%s\". Geïnterpreteerd als %s, wat als %s zou " "moeten worden geschreven." #: ../libqalculate/Number.cc:601 #, fuzzy msgid "Too large exponent." msgstr "toon negatieve exponenten" #: ../libqalculate/Number.cc:630 msgid "':' in decimal number ignored (decimal point detected)." msgstr "':' in decimaal getal genegeerd (decimale komma gevonden)." #: ../libqalculate/Number.cc:660 #, c-format msgid "Character '%c' was ignored in the number \"%s\" with base %s." msgstr "Karakter '%c' werd genegeerd in het getal \"%s\" met grondtal %s." #: ../libqalculate/Number.cc:1649 ../libqalculate/Number.cc:1771 msgid "Floating point underflow" msgstr "" #: ../libqalculate/Number.cc:1650 ../libqalculate/Number.cc:1772 msgid "Floating point overflow" msgstr "" #: ../libqalculate/Number.cc:1651 ../libqalculate/Number.cc:1773 msgid "Floating point division by zero exception" msgstr "" #: ../libqalculate/Number.cc:1652 ../libqalculate/Number.cc:1776 msgid "Floating point not a number exception" msgstr "" #: ../libqalculate/Number.cc:1653 ../libqalculate/Number.cc:1774 msgid "Floating point range exception" msgstr "" #: ../libqalculate/Number.cc:3222 msgid "Division by zero." msgstr "Deling door nul." #. 0^0 #: ../libqalculate/Number.cc:3228 msgid "0^0 might be considered undefined" msgstr "0^0 kan als ongedefinieerd worden beschouwd" #: ../libqalculate/Number.cc:3235 msgid "The result of 0^i is possibly undefined" msgstr "" #: ../libqalculate/Number.cc:3284 ../libqalculate/Number.cc:4985 #: ../libqalculate/Number.cc:5096 ../libqalculate/Number.cc:5425 #: ../libqalculate/Number.cc:5433 ../libqalculate/Number.cc:5466 #: ../libqalculate/Number.cc:5563 ../libqalculate/Number.cc:5712 #: ../libqalculate/Number.cc:5824 msgid "Interval calculated wide." msgstr "" #: ../libqalculate/Number.cc:4542 msgid "Cannot handle an argument (s) that large for Riemann Zeta." msgstr "Argument (s) is te groot voor de berekening van Riemann Zeta." #: ../libqalculate/Number.cc:4617 ../libqalculate/Number.cc:4715 #: ../libqalculate/Number.cc:4746 ../libqalculate/Number.cc:4777 #: ../libqalculate/Number.cc:6169 #, c-format msgid "%s() lacks proper support interval arithmetic." msgstr "" #: ../libqalculate/Number.cc:6706 #, fuzzy msgid "Can only display rational numbers as roman numerals." msgstr "" "Kan getallen groter dan 9999 of kleiner dan -9999 niet weergeven als " "Romeinse getallen." #: ../libqalculate/Number.cc:7095 ../libqalculate/Number.cc:7103 msgid "infinity" msgstr "oneindigheid" #: ../libqalculate/QalculateDateTime.cc:25 msgid "January" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "February" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "March" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "April" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "May" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "June" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "July" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "August" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "September" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "October" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "November" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "December" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Thout" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paopi" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Hathor" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Koiak" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Tobi" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Meshir" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paremhat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Parmouti" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Pashons" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paoni" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Epip" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Mesori" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Pi Kogi Enavot" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Mäskäräm" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "ṬəqÉ™mt" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ḫədar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "TaḫśaÅ›" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ṭərr" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Yäkatit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Mägabit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Miyazya" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "GÉ™nbo" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Säne" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ḥamle" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Nähase" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 #, fuzzy msgid "á¹–agume" msgstr "argument" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Muḥarram" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "á¹¢afar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rabī‘ al-awwal" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rabī‘ ath-thÄnÄ«" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "JumÄdá al-Å«lá" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "JumÄdá al-Äkhirah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rajab" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Sha‘bÄn" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Ramaá¸Än" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "ShawwÄl" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "DhÅ« al-Qa‘dah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "DhÅ« al-Ḥijjah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Farvardin" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Ordibehesht" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Khordad" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Tir" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Mordad" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Shahrivar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Mehr" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Aban" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Azar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 #, fuzzy msgid "Dey" msgstr "sleutelwaarde" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Bahman" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Esfand" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Chaitra" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "VaishÄkha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "JyÄ“shtha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Ä€shÄdha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "ShrÄvana" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Bhaadra" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Ä€shwin" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "KÄrtika" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Agrahayana" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Pausha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "MÄgha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Phalguna" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Wood" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Fire" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Earth" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Metal" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Water" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Ox" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Tiger" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rabbit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Dragon" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Snake" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Horse" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Goat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Monkey" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rooster" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Dog" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Pig" msgstr "" #: ../libqalculate/QalculateDateTime.cc:345 msgid "now" msgstr "nu" #: ../libqalculate/QalculateDateTime.cc:349 msgid "today" msgstr "vandaag" #: ../libqalculate/QalculateDateTime.cc:353 msgid "tomorrow" msgstr "" #: ../libqalculate/QalculateDateTime.cc:358 msgid "yesterday" msgstr "" #: ../libqalculate/QalculateDateTime.cc:2599 msgid "leap month" msgstr "" #: ../libqalculate/Unit.cc:908 msgid "Error(s) in unitexpression." msgstr "Fout(en) in de eenheidexpressie." #: ../libqalculate/Variable.cc:456 #, c-format msgid "Recursive variable: %s = %s" msgstr "" #: ../libqalculate/util.cc:175 msgid "Yes" msgstr "Ja" #: ../libqalculate/util.cc:176 msgid "No" msgstr "Nee" #: ../libqalculate/util.cc:183 msgid "True" msgstr "Waar" #: ../libqalculate/util.cc:184 msgid "False" msgstr "Onwaar" #: ../libqalculate/util.cc:191 msgid "On" msgstr "Aan" #: ../libqalculate/util.cc:192 msgid "Off" msgstr "Uit" #~ msgid "exp mode" #~ msgstr "exp modus" #~ msgid "" #~ "Argument for %s() must be a real number greater than or equal to -1/e." #~ msgstr "" #~ "Argument voor %s() moet een reëel getal zijn groter dan of gelijk aan -1/" #~ "e." #~ msgid "negatve" #~ msgstr "negatief" #~ msgid "sex" #~ msgstr "sex" #~ msgid "dot as separator" #~ msgstr "punt als scheidingsteken" #, fuzzy #~ msgid "comma as separator" #~ msgstr "punt als scheidingsteken" #~ msgid "Error in date format for function %s()." #~ msgstr "Fout in het datumformaat voor functie %s()." #~ msgid "" #~ "Both the lower and upper limit must be set to get the definite integral." #~ msgstr "" #~ "Voor de bepaalde integraal moeten zowel de onder- als de bovengrens " #~ "worden opgegeven." #~ msgid "indicate infinite series" #~ msgstr "oneindige reeksen aangeven" #~ msgid "Can only handle Riemann Zeta with an integer argument (s) >= 1" #~ msgstr "Voor Riemann-Zeta is een geheel argument (s) >= 1 nodig" #~ msgid "" #~ "Series %s contains non-numerical data (\"%s\" first of %s) which can not " #~ "be properly plotted." #~ msgstr "" #~ "Rij %s bevat niet-numerieke gegevens (\"%s\" eerste van %s) die niet goed " #~ "kunnen worden geplot." #~ msgid "" #~ "Series %s contains non-real data (\"%s\" first of %s) which can not be " #~ "properly plotted." #~ msgstr "" #~ "Rij %s bevat niet-reële gegevens (\"%s\" eerste van %s) die niet goed " #~ "kunnen worden geplot." #~ msgid "Failed to download exchange rates from ECB: %s" #~ msgstr "Het ophalen van wisselkoersen van ECB is niet gelukt: %s" #, fuzzy #~ msgid "Failed to download exchange rates from mycurrency.net: %s" #~ msgstr "Het ophalen van wisselkoersen van ECB is niet gelukt: %s" #~ msgid "%s() does at the moment only support integers and fractions of two." #~ msgstr "" #~ "%s() ondersteunt momenteel alleen gehele getallen en breuken van twee." #, fuzzy #~ msgid "An global unit or variable with the same name already exists." #~ msgstr "" #~ "Er bestaat al een eenheid of variabele met deze naam.\n" #~ "Wilt u die overschrijven (standaard is nee)?" #~ msgid "" #~ "You need the download exchange rates to be able to convert between " #~ "different currencies.\n" #~ "You can later get current exchange rates with the \"exrates\" command.\n" #~ "Do you want to fetch exchange rates now from the Internet (default: yes)?" #~ msgstr "" #~ "Om tussen de verschillende valuta te kunnen converteren moeten " #~ "wisselkoersen worden opgehaald van het internet.\n" #~ "Later kunt u recente wisselkoersen verkrijgen met de opdracht " #~ "\"wisselkoersen\".\n" #~ "Wilt u nu wisselkoersen ophalen van het internet (standaard is ja)?" #~ msgid "WGET ARGUMENTS" #~ msgstr "ARGUMENTEN WGET" #~ msgid "The timestamp value for the date %s is too large or small for %s()." #~ msgstr "" #~ "\"Timestamp\"-waarde voor de datum %s is te groot of te klein voor %s()." #, fuzzy #~ msgid "Temperature" #~ msgstr "Tijdelijk" #~ msgid "ON/OFF" #~ msgstr "AAN/UIT" #~ msgid "UNIT" #~ msgstr "EENHEID" #~ msgid "best (convert best unit)" #~ msgstr "beste (omzetten naar beste eenheid)" #~ msgid "Example: convert best." #~ msgstr "Voorbeeld: convert best (converteer naar beste)." #~ msgid "Decimal point in sexagesimal number treated as ':'." #~ msgstr "Decimale komma in sexagesimaal getal behandeld als ':'." libqalculate-2.8.2/po/sv.po0000644000175000017500000031431013372527311012522 00000000000000# translation of sv.po to Swedish # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # Hanna Knutsson , 2003. # msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-11-07 07:18+0100\n" "PO-Revision-Date: 2006-05-04 12:29+0200\n" "Last-Translator: Hanna Knutsson \n" "Language-Team: Swedish\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../src/qalc.cc:119 ../src/qalc.cc:186 ../src/qalc.cc:3106 #: ../libqalculate/util.cc:178 msgid "yes" msgstr "ja" #: ../src/qalc.cc:120 ../src/qalc.cc:188 ../src/qalc.cc:3106 #: ../libqalculate/util.cc:179 msgid "no" msgstr "nej" #: ../src/qalc.cc:121 ../libqalculate/util.cc:186 msgid "true" msgstr "sant" #: ../src/qalc.cc:122 ../libqalculate/util.cc:187 msgid "false" msgstr "falskt" #: ../src/qalc.cc:123 ../src/qalc.cc:653 ../src/qalc.cc:926 ../src/qalc.cc:958 #: ../src/qalc.cc:2560 ../src/qalc.cc:2583 ../src/qalc.cc:2628 #: ../src/qalc.cc:3105 ../src/qalc.cc:3210 ../src/qalc.cc:3231 #: ../src/qalc.cc:3263 ../libqalculate/util.cc:194 msgid "on" msgstr "pÃ¥" #: ../src/qalc.cc:124 ../src/qalc.cc:631 ../src/qalc.cc:652 ../src/qalc.cc:835 #: ../src/qalc.cc:899 ../src/qalc.cc:911 ../src/qalc.cc:924 ../src/qalc.cc:956 #: ../src/qalc.cc:2559 ../src/qalc.cc:2564 ../src/qalc.cc:2571 #: ../src/qalc.cc:2581 ../src/qalc.cc:2608 ../src/qalc.cc:2615 #: ../src/qalc.cc:2627 ../src/qalc.cc:2652 ../src/qalc.cc:3105 #: ../src/qalc.cc:3208 ../src/qalc.cc:3214 ../src/qalc.cc:3218 #: ../src/qalc.cc:3231 ../src/qalc.cc:3237 ../src/qalc.cc:3244 #: ../src/qalc.cc:3261 ../src/qalc.cc:3288 ../libqalculate/util.cc:195 msgid "off" msgstr "av" #: ../src/qalc.cc:193 msgid "Please answer yes or no" msgstr "Vänligen svara ja eller nej" #: ../src/qalc.cc:200 ../src/qalc.cc:590 ../src/qalc.cc:1274 #: ../src/qalc.cc:2474 ../src/qalc.cc:3051 ../src/qalc.cc:3126 #: ../src/qalc.cc:3332 msgid "unknown" msgstr "okänd" #: ../src/qalc.cc:206 ../src/qalc.cc:584 ../src/qalc.cc:1268 #: ../src/qalc.cc:2468 ../src/qalc.cc:3045 ../src/qalc.cc:3140 #: ../src/qalc.cc:3346 msgid "real" msgstr "reell" #: ../src/qalc.cc:208 ../src/qalc.cc:586 ../src/qalc.cc:1270 #: ../src/qalc.cc:2470 ../src/qalc.cc:3047 ../src/qalc.cc:3138 #: ../src/qalc.cc:3344 ../libqalculate/Function.cc:1636 msgid "number" msgstr "nummer" #: ../src/qalc.cc:210 ../src/qalc.cc:583 ../src/qalc.cc:1267 #: ../src/qalc.cc:2467 ../src/qalc.cc:3044 ../src/qalc.cc:3142 #: ../src/qalc.cc:3348 msgid "rational" msgstr "rationell" #: ../src/qalc.cc:212 ../src/qalc.cc:582 ../src/qalc.cc:1266 #: ../src/qalc.cc:2466 ../src/qalc.cc:3043 ../src/qalc.cc:3144 #: ../src/qalc.cc:3350 ../libqalculate/Function.cc:1797 msgid "integer" msgstr "heltal" #: ../src/qalc.cc:214 ../src/qalc.cc:577 ../src/qalc.cc:1261 #: ../src/qalc.cc:2461 ../src/qalc.cc:3038 ../src/qalc.cc:3128 #: ../src/qalc.cc:3334 msgid "non-zero" msgstr "ej noll" #: ../src/qalc.cc:216 ../src/qalc.cc:573 ../src/qalc.cc:1257 #: ../src/qalc.cc:2457 ../src/qalc.cc:3034 ../src/qalc.cc:3130 #: ../src/qalc.cc:3336 msgid "positive" msgstr "positiv" #: ../src/qalc.cc:218 ../src/qalc.cc:576 ../src/qalc.cc:1260 #: ../src/qalc.cc:2460 ../src/qalc.cc:3037 ../src/qalc.cc:3136 #: ../src/qalc.cc:3342 msgid "non-negative" msgstr "ej negativ" #: ../src/qalc.cc:220 ../src/qalc.cc:575 ../src/qalc.cc:1259 #: ../src/qalc.cc:2459 ../src/qalc.cc:3036 ../src/qalc.cc:3132 #: ../src/qalc.cc:3338 msgid "negative" msgstr "negativ" #: ../src/qalc.cc:222 ../src/qalc.cc:574 ../src/qalc.cc:1258 #: ../src/qalc.cc:2458 ../src/qalc.cc:3035 ../src/qalc.cc:3134 #: ../src/qalc.cc:3340 msgid "non-positive" msgstr "ej positiv" #: ../src/qalc.cc:225 msgid "Unrecognized assumption." msgstr "Okänt antagande." #: ../src/qalc.cc:463 ../libqalculate/Calculator.cc:10482 #, c-format msgid "It has been %s day(s) since the exchange rates last were updated." msgstr "Det var %s dag(ar) sedan växelkurserna senast updaterades." #: ../src/qalc.cc:468 msgid "Do you wish to update the exchange rates now?" msgstr "Vill du uppdatera växelkurserna nu?" #: ../src/qalc.cc:482 ../src/qalc.cc:483 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "Tryck Enter för att fortsätta." #: ../src/qalc.cc:496 ../src/qalc.cc:497 ../src/qalc.cc:498 ../src/qalc.cc:499 #: ../src/qalc.cc:500 ../src/qalc.cc:501 ../src/qalc.cc:670 ../src/qalc.cc:673 #: ../src/qalc.cc:806 ../src/qalc.cc:817 ../src/qalc.cc:826 ../src/qalc.cc:2061 #: ../src/qalc.cc:2196 msgid "Illegal value" msgstr "OtillÃ¥tet värde" #. qalc command #: ../src/qalc.cc:524 ../src/qalc.cc:771 ../src/qalc.cc:2039 #: ../src/qalc.cc:2409 ../src/qalc.cc:2415 ../src/qalc.cc:2535 #: ../src/qalc.cc:2670 ../src/qalc.cc:2704 ../src/qalc.cc:3184 #: ../src/qalc.cc:3301 ../src/qalc.cc:3454 ../src/qalc.cc:4229 #: ../src/qalc.cc:4240 ../libqalculate/Calculator.cc:2503 #: ../libqalculate/Calculator.cc:2507 msgid "base" msgstr "bas" #: ../src/qalc.cc:524 ../src/qalc.cc:526 ../src/qalc.cc:2636 #: ../src/qalc.cc:3273 msgid "input base" msgstr "indatabas" #: ../src/qalc.cc:524 msgid "output base" msgstr "utdatabas" #: ../src/qalc.cc:527 ../src/qalc.cc:2290 ../src/qalc.cc:2537 #: ../src/qalc.cc:2638 ../src/qalc.cc:3196 ../src/qalc.cc:3281 #: ../src/qalc.cc:4148 ../libqalculate/Calculator.cc:2472 msgid "roman" msgstr "romersk" #: ../src/qalc.cc:528 ../src/qalc.cc:2300 ../src/qalc.cc:2539 #: ../src/qalc.cc:3194 ../src/qalc.cc:4164 ../libqalculate/Calculator.cc:2478 msgid "time" msgstr "tid" #: ../src/qalc.cc:529 ../src/qalc.cc:2270 ../src/qalc.cc:4116 #: ../libqalculate/Calculator.cc:2460 msgid "hexadecimal" msgstr "hexadecimal" #: ../src/qalc.cc:530 ../src/qalc.cc:2285 ../src/qalc.cc:4140 #: ../libqalculate/Calculator.cc:2469 msgid "duodecimal" msgstr "duodecimal" #: ../src/qalc.cc:531 ../src/qalc.cc:2275 ../src/qalc.cc:4124 #: ../libqalculate/Calculator.cc:2463 msgid "binary" msgstr "binär" #: ../src/qalc.cc:532 ../src/qalc.cc:2280 ../src/qalc.cc:4132 #: ../libqalculate/Calculator.cc:2466 msgid "octal" msgstr "oktal" #: ../src/qalc.cc:533 msgid "decimal" msgstr "decimal" #: ../src/qalc.cc:534 ../src/qalc.cc:2295 ../src/qalc.cc:2538 #: ../src/qalc.cc:4156 ../libqalculate/Calculator.cc:2475 msgid "sexagesimal" msgstr "sexagesimal" #: ../src/qalc.cc:551 ../src/qalc.cc:614 ../src/qalc.cc:2543 #: ../src/qalc.cc:3201 msgid "base display" msgstr "basvisning" #: ../src/qalc.cc:555 msgid "Illegal base." msgstr "OtillÃ¥ten bas." #: ../src/qalc.cc:563 ../src/qalc.cc:591 ../src/qalc.cc:2475 #: ../src/qalc.cc:3123 msgid "assumptions" msgstr "antaganden" #: ../src/qalc.cc:585 ../src/qalc.cc:1269 ../src/qalc.cc:2469 #: ../src/qalc.cc:3046 msgid "complex" msgstr "komplex" #: ../src/qalc.cc:587 ../src/qalc.cc:1271 ../src/qalc.cc:2471 #: ../src/qalc.cc:3048 msgid "non-matrix" msgstr "ej matris" #: ../src/qalc.cc:594 ../src/qalc.cc:2661 ../src/qalc.cc:3293 msgid "all prefixes" msgstr "alla prefix" #: ../src/qalc.cc:595 ../src/qalc.cc:2501 ../src/qalc.cc:3162 msgid "complex numbers" msgstr "komplexa tal" #: ../src/qalc.cc:596 ../src/qalc.cc:2519 ../src/qalc.cc:3174 msgid "excessive parentheses" msgstr "överdrivna parenteser" #: ../src/qalc.cc:597 ../src/qalc.cc:2502 ../src/qalc.cc:2758 #: ../src/qalc.cc:2763 ../src/qalc.cc:3163 msgid "functions" msgstr "funktioner" #: ../src/qalc.cc:598 ../src/qalc.cc:2503 ../src/qalc.cc:3164 msgid "infinite numbers" msgstr "oändliga tal" #: ../src/qalc.cc:599 ../src/qalc.cc:2527 ../src/qalc.cc:3176 msgid "show negative exponents" msgstr "visa negativa exponenter" #: ../src/qalc.cc:600 ../src/qalc.cc:2453 ../src/qalc.cc:3120 msgid "assume nonzero denominators" msgstr "antag nämnare ej noll" #: ../src/qalc.cc:601 ../src/qalc.cc:2454 ../src/qalc.cc:3121 msgid "warn nonzero denominators" msgstr "varna nämnare ej noll" #: ../src/qalc.cc:602 ../src/qalc.cc:2677 ../src/qalc.cc:3312 msgid "prefixes" msgstr "prefix" #: ../src/qalc.cc:603 ../src/qalc.cc:2675 ../src/qalc.cc:3310 msgid "denominator prefixes" msgstr "nämnarprefix" #: ../src/qalc.cc:604 ../src/qalc.cc:2676 ../src/qalc.cc:3311 msgid "place units separately" msgstr "placera enheter separat" #: ../src/qalc.cc:605 ../src/qalc.cc:2500 ../src/qalc.cc:3161 msgid "calculate variables" msgstr "beräkna variabler" #: ../src/qalc.cc:606 ../src/qalc.cc:2499 ../src/qalc.cc:3160 msgid "calculate functions" msgstr "beräkna funktioner" #: ../src/qalc.cc:607 ../src/qalc.cc:2678 ../src/qalc.cc:3313 msgid "sync units" msgstr "synkronisera enheter" #: ../src/qalc.cc:608 ../src/qalc.cc:2619 ../src/qalc.cc:3250 msgid "round to even" msgstr "avrunda till jämnt" #: ../src/qalc.cc:609 ../src/qalc.cc:2657 ../src/qalc.cc:3289 msgid "rpn syntax" msgstr "rpnsyntax" #. qalc command #: ../src/qalc.cc:610 ../src/qalc.cc:2042 ../src/qalc.cc:2689 #: ../src/qalc.cc:2726 ../src/qalc.cc:3324 ../src/qalc.cc:3404 msgid "rpn" msgstr "rpn" #: ../src/qalc.cc:611 ../src/qalc.cc:2528 ../src/qalc.cc:3177 msgid "short multiplication" msgstr "kort multiplikation" #: ../src/qalc.cc:612 ../src/qalc.cc:2602 ../src/qalc.cc:3233 msgid "lowercase e" msgstr "litet e" #: ../src/qalc.cc:613 ../src/qalc.cc:2603 ../src/qalc.cc:3234 msgid "lowercase numbers" msgstr "smÃ¥ nummer" #: ../src/qalc.cc:616 ../src/qalc.cc:632 ../src/qalc.cc:686 ../src/qalc.cc:767 #: ../src/qalc.cc:790 ../src/qalc.cc:2448 ../src/qalc.cc:2484 #: ../src/qalc.cc:2545 ../src/qalc.cc:2666 ../src/qalc.cc:3119 #: ../src/qalc.cc:3151 ../src/qalc.cc:3201 ../src/qalc.cc:3297 msgid "none" msgstr "ingen" #: ../src/qalc.cc:617 ../src/qalc.cc:2546 ../src/qalc.cc:3201 msgid "normal" msgstr "normal" #: ../src/qalc.cc:618 ../src/qalc.cc:2547 ../src/qalc.cc:3201 msgid "alternative" msgstr "alternativ" #: ../src/qalc.cc:623 ../src/qalc.cc:639 ../src/qalc.cc:659 ../src/qalc.cc:691 #: ../src/qalc.cc:707 ../src/qalc.cc:731 ../src/qalc.cc:745 ../src/qalc.cc:759 #: ../src/qalc.cc:781 ../src/qalc.cc:797 ../src/qalc.cc:846 ../src/qalc.cc:852 #: ../src/qalc.cc:876 ../src/qalc.cc:933 ../src/qalc.cc:949 ../src/qalc.cc:963 msgid "Illegal value." msgstr "OtillÃ¥tet värde." #: ../src/qalc.cc:628 ../src/qalc.cc:2621 ../src/qalc.cc:3252 msgid "two's complement" msgstr "tvÃ¥komplement" #: ../src/qalc.cc:629 ../src/qalc.cc:2562 ../src/qalc.cc:3214 msgid "digit grouping" msgstr "siffergruppering" #: ../src/qalc.cc:633 ../src/qalc.cc:2565 ../src/qalc.cc:3214 msgid "standard" msgstr "standard" #: ../src/qalc.cc:634 ../src/qalc.cc:654 ../src/qalc.cc:2558 #: ../src/qalc.cc:2566 ../src/qalc.cc:2626 ../src/qalc.cc:3206 #: ../src/qalc.cc:3214 ../src/qalc.cc:3259 msgid "locale" msgstr "locale" #: ../src/qalc.cc:644 ../src/qalc.cc:2530 ../src/qalc.cc:3179 msgid "spell out logical" msgstr "skriv ut logiska" #: ../src/qalc.cc:645 ../src/qalc.cc:2634 ../src/qalc.cc:3271 msgid "ignore dot" msgstr "ignorera punkt" #: ../src/qalc.cc:646 ../src/qalc.cc:2631 ../src/qalc.cc:3268 msgid "ignore comma" msgstr "ignorera komma" #: ../src/qalc.cc:650 ../src/qalc.cc:2557 ../src/qalc.cc:2625 #: ../src/qalc.cc:3203 ../src/qalc.cc:3256 msgid "decimal comma" msgstr "decimalkomma" #: ../src/qalc.cc:669 ../src/qalc.cc:2642 ../src/qalc.cc:3286 msgid "limit implicit multiplication" msgstr "begränsa implicit multiplikation" #: ../src/qalc.cc:671 ../src/qalc.cc:2529 ../src/qalc.cc:3178 msgid "spacious" msgstr "rymlig" #: ../src/qalc.cc:672 ../src/qalc.cc:2531 ../src/qalc.cc:3180 msgid "unicode" msgstr "unicode" #: ../src/qalc.cc:675 ../src/qalc.cc:2504 ../src/qalc.cc:2760 #: ../src/qalc.cc:2765 ../src/qalc.cc:3165 msgid "units" msgstr "enheter" #: ../src/qalc.cc:676 ../src/qalc.cc:2505 ../src/qalc.cc:3166 msgid "unknowns" msgstr "okända" #: ../src/qalc.cc:677 ../src/qalc.cc:2506 ../src/qalc.cc:2759 #: ../src/qalc.cc:2764 ../src/qalc.cc:3167 msgid "variables" msgstr "variabler" #: ../src/qalc.cc:678 ../src/qalc.cc:2511 ../src/qalc.cc:3172 msgid "abbreviations" msgstr "förkortningar" #: ../src/qalc.cc:679 ../src/qalc.cc:2620 ../src/qalc.cc:3251 msgid "show ending zeroes" msgstr "visa avslutande nollor" #: ../src/qalc.cc:680 ../src/qalc.cc:2618 ../src/qalc.cc:3249 msgid "repeating decimals" msgstr "upprepande decimaler" #: ../src/qalc.cc:681 ../src/qalc.cc:2479 ../src/qalc.cc:3151 msgid "angle unit" msgstr "vinkelenhet" #: ../src/qalc.cc:683 ../src/qalc.cc:2481 ../src/qalc.cc:2482 msgid "rad" msgstr "rad" #: ../src/qalc.cc:683 ../src/qalc.cc:3151 msgid "radians" msgstr "radianer" #: ../src/qalc.cc:684 msgid "deg" msgstr "deg" #: ../src/qalc.cc:684 ../src/qalc.cc:3151 msgid "degrees" msgstr "grader" #: ../src/qalc.cc:685 ../src/qalc.cc:2483 msgid "gra" msgstr "gra" #: ../src/qalc.cc:685 ../src/qalc.cc:3151 msgid "gradians" msgstr "gradienter" #: ../src/qalc.cc:698 ../src/qalc.cc:2643 ../src/qalc.cc:3287 #: ../src/qalc.cc:3511 msgid "parsing mode" msgstr "tolkningsläge" #: ../src/qalc.cc:700 ../src/qalc.cc:859 ../src/qalc.cc:2589 #: ../src/qalc.cc:2645 ../src/qalc.cc:3232 ../src/qalc.cc:3287 #: ../src/qalc.cc:3519 msgid "adaptive" msgstr "anpassad" #: ../src/qalc.cc:701 ../src/qalc.cc:2646 ../src/qalc.cc:3287 #: ../src/qalc.cc:3516 msgid "implicit first" msgstr "implicit först" #: ../src/qalc.cc:702 ../src/qalc.cc:2647 ../src/qalc.cc:3287 #: ../src/qalc.cc:3513 msgid "conventional" msgstr "konventionell" #: ../src/qalc.cc:712 ../src/qalc.cc:1433 ../src/qalc.cc:2679 #: ../src/qalc.cc:3314 msgid "update exchange rates" msgstr "updatering av växelkurser" #: ../src/qalc.cc:713 ../src/qalc.cc:2682 ../src/qalc.cc:3316 msgid "never" msgstr "aldrig" #: ../src/qalc.cc:715 ../src/qalc.cc:2681 ../src/qalc.cc:3315 msgid "ask" msgstr "frÃ¥ga" #: ../src/qalc.cc:722 ../src/qalc.cc:2520 ../src/qalc.cc:3175 msgid "multiplication sign" msgstr "multiplikationstecken" #: ../src/qalc.cc:736 ../src/qalc.cc:2512 ../src/qalc.cc:3173 msgid "division sign" msgstr "divisionstecken" #: ../src/qalc.cc:750 ../src/qalc.cc:2487 ../src/qalc.cc:3152 msgid "approximation" msgstr "approximering" #. qalc command #: ../src/qalc.cc:752 ../src/qalc.cc:803 ../src/qalc.cc:925 ../src/qalc.cc:2246 #: ../src/qalc.cc:2489 ../src/qalc.cc:2582 ../src/qalc.cc:2706 #: ../src/qalc.cc:3152 ../src/qalc.cc:3231 ../src/qalc.cc:3458 msgid "exact" msgstr "exakt" #: ../src/qalc.cc:753 ../src/qalc.cc:2490 ../src/qalc.cc:3152 msgid "try exact" msgstr "försök exakt" #. qalc command #: ../src/qalc.cc:754 ../src/qalc.cc:1282 ../src/qalc.cc:2252 #: ../src/qalc.cc:2491 ../src/qalc.cc:2702 ../src/qalc.cc:2965 #: ../src/qalc.cc:2975 ../src/qalc.cc:3065 ../src/qalc.cc:3152 #: ../src/qalc.cc:3462 msgid "approximate" msgstr "approximerat" #: ../src/qalc.cc:764 ../src/qalc.cc:2662 ../src/qalc.cc:3294 msgid "autoconversion" msgstr "autoomvandling" #: ../src/qalc.cc:768 ../src/qalc.cc:2403 msgid "best" msgstr "bästa" #: ../src/qalc.cc:769 ../src/qalc.cc:2671 ../src/qalc.cc:3303 msgid "optimalsi" msgstr "optimalsi" #: ../src/qalc.cc:770 ../src/qalc.cc:2403 ../src/qalc.cc:2669 #: ../src/qalc.cc:3299 ../src/qalc.cc:4218 ../libqalculate/Calculator.cc:2499 msgid "optimal" msgstr "optimal" #: ../src/qalc.cc:772 ../src/qalc.cc:2665 ../src/qalc.cc:3305 #: ../src/qalc.cc:4248 ../libqalculate/Calculator.cc:2510 msgid "mixed" msgstr "blandade" #: ../src/qalc.cc:787 ../src/qalc.cc:2674 ../src/qalc.cc:3309 msgid "currency conversion" msgstr "valutaomvandling" #: ../src/qalc.cc:788 ../src/qalc.cc:2446 ../src/qalc.cc:3119 msgid "algebra mode" msgstr "algebraiskt läge" #. qalc command #: ../src/qalc.cc:791 ../src/qalc.cc:2434 ../src/qalc.cc:2450 #: ../src/qalc.cc:2721 ../src/qalc.cc:3097 ../src/qalc.cc:3119 msgid "simplify" msgstr "förenkla" #: ../src/qalc.cc:792 ../src/qalc.cc:2449 ../src/qalc.cc:3119 msgid "factorize" msgstr "faktorisera" #: ../src/qalc.cc:814 ../src/qalc.cc:2691 ../src/qalc.cc:2719 #: ../src/qalc.cc:3326 msgid "save mode" msgstr "spara läge" #: ../src/qalc.cc:823 ../src/qalc.cc:2690 ../src/qalc.cc:2718 #: ../src/qalc.cc:3325 msgid "save definitions" msgstr "spara definitioner" #: ../src/qalc.cc:832 ../src/qalc.cc:2569 ../src/qalc.cc:3215 msgid "scientific notation" msgstr "grundpotensform" #: ../src/qalc.cc:836 ../src/qalc.cc:2572 ../src/qalc.cc:3220 msgid "auto" msgstr "auto" #: ../src/qalc.cc:837 ../src/qalc.cc:2573 ../src/qalc.cc:3224 msgid "pure" msgstr "ren" #: ../src/qalc.cc:838 ../src/qalc.cc:2574 ../src/qalc.cc:3226 msgid "scientific" msgstr "vetenskaplig" #: ../src/qalc.cc:839 ../src/qalc.cc:2575 ../src/qalc.cc:3222 msgid "engineering" msgstr "teknisk" #: ../src/qalc.cc:848 ../src/qalc.cc:2495 ../src/qalc.cc:3154 msgid "precision" msgstr "precision" #: ../src/qalc.cc:857 ../src/qalc.cc:2587 ../src/qalc.cc:3232 msgid "interval display" msgstr "intervallvisning" #: ../src/qalc.cc:860 ../src/qalc.cc:2592 ../src/qalc.cc:3232 msgid "significant" msgstr "signifikant" #: ../src/qalc.cc:861 ../src/qalc.cc:2593 ../src/qalc.cc:3232 msgid "interval" msgstr "intervall" #: ../src/qalc.cc:862 ../src/qalc.cc:2594 ../src/qalc.cc:3232 msgid "plusminus" msgstr "plusminus" #: ../src/qalc.cc:863 ../src/qalc.cc:2595 ../src/qalc.cc:3232 msgid "midpoint" msgstr "mittpunkt" #: ../src/qalc.cc:864 ../src/qalc.cc:2597 ../src/qalc.cc:3232 msgid "upper" msgstr "övre" #: ../src/qalc.cc:865 ../src/qalc.cc:2596 ../src/qalc.cc:3232 msgid "lower" msgstr "undre" #: ../src/qalc.cc:883 ../src/qalc.cc:2494 ../src/qalc.cc:3153 msgid "interval arithmetic" msgstr "intervallaritmetik" #: ../src/qalc.cc:890 ../src/qalc.cc:2507 ../src/qalc.cc:3168 msgid "variable units" msgstr "variabelenheter" #: ../src/qalc.cc:897 ../src/qalc.cc:2604 ../src/qalc.cc:3235 msgid "max decimals" msgstr "max decimaler" #: ../src/qalc.cc:909 ../src/qalc.cc:2611 ../src/qalc.cc:3242 msgid "min decimals" msgstr "min decimaler" #: ../src/qalc.cc:922 ../src/qalc.cc:2579 ../src/qalc.cc:3231 msgid "fractions" msgstr "brÃ¥ktal" #: ../src/qalc.cc:927 ../src/qalc.cc:2584 ../src/qalc.cc:3231 msgid "combined" msgstr "kombinerad" #: ../src/qalc.cc:928 ../src/qalc.cc:2583 ../src/qalc.cc:3231 msgid "long" msgstr "lÃ¥ng" #: ../src/qalc.cc:940 ../src/qalc.cc:2550 ../src/qalc.cc:3202 msgid "complex form" msgstr "komplex form" #: ../src/qalc.cc:942 ../src/qalc.cc:2309 ../src/qalc.cc:2552 #: ../src/qalc.cc:3202 ../src/qalc.cc:4194 msgid "rectangular" msgstr "rektangulär" #: ../src/qalc.cc:942 ../src/qalc.cc:2309 ../src/qalc.cc:4194 msgid "cartesian" msgstr "kertisik" #: ../src/qalc.cc:943 ../src/qalc.cc:2318 ../src/qalc.cc:2553 #: ../src/qalc.cc:3202 ../src/qalc.cc:4202 msgid "exponential" msgstr "exponentiell" #: ../src/qalc.cc:944 ../src/qalc.cc:2327 ../src/qalc.cc:2554 #: ../src/qalc.cc:3202 ../src/qalc.cc:4210 msgid "polar" msgstr "polär" #: ../src/qalc.cc:954 ../src/qalc.cc:2650 ../src/qalc.cc:3288 msgid "read precision" msgstr "läs precision" #: ../src/qalc.cc:957 ../src/qalc.cc:2653 ../src/qalc.cc:3288 msgid "always" msgstr "alltid" #: ../src/qalc.cc:958 ../src/qalc.cc:2654 ../src/qalc.cc:3288 msgid "when decimals" msgstr "när decimaler" #: ../src/qalc.cc:980 msgid "Unrecognized option." msgstr "Okänd inställning." #: ../src/qalc.cc:1097 msgid "Calendar" msgstr "Kalender" #: ../src/qalc.cc:1097 msgid "Day" msgstr "Dag" #: ../src/qalc.cc:1097 msgid "Month" msgstr "MÃ¥nad" #: ../src/qalc.cc:1097 msgid "Year" msgstr "Ã…r" #: ../src/qalc.cc:1098 ../libqalculate/Calculator.cc:2533 msgid "failed" msgstr "misslyckades" #: ../src/qalc.cc:1099 ../libqalculate/Calculator.cc:2534 msgid "Gregorian:" msgstr "Gregoriansk:" #: ../src/qalc.cc:1100 ../libqalculate/Calculator.cc:2535 msgid "Hebrew:" msgstr "Hebreisk:" #: ../src/qalc.cc:1101 ../libqalculate/Calculator.cc:2536 msgid "Islamic:" msgstr "Muslimsk:" #: ../src/qalc.cc:1102 ../libqalculate/Calculator.cc:2537 msgid "Persian:" msgstr "Persisk:" #: ../src/qalc.cc:1103 ../libqalculate/Calculator.cc:2538 msgid "Indian national:" msgstr "Indisk (nationell):" #: ../src/qalc.cc:1104 ../libqalculate/Calculator.cc:2539 msgid "Chinese:" msgstr "Kinesisk:" #: ../src/qalc.cc:1109 ../libqalculate/Calculator.cc:2543 msgid "Julian:" msgstr "Juliansk:" #: ../src/qalc.cc:1110 ../libqalculate/Calculator.cc:2544 msgid "Revised julian:" msgstr "Reviderad juliansk:" #: ../src/qalc.cc:1111 ../libqalculate/Calculator.cc:2545 msgid "Coptic:" msgstr "Koptisk:" #: ../src/qalc.cc:1112 ../libqalculate/Calculator.cc:2546 msgid "Ethiopian:" msgstr "Etiopisk:" #: ../src/qalc.cc:1205 ../src/qalc.cc:1206 ../src/qalc.cc:1323 #: ../src/qalc.cc:1324 ../src/qalc.cc:1391 ../src/qalc.cc:1392 msgid "" "For more information about a specific function, variable or unit, please use " "the info command (in interactive mode)." msgstr "" "För mer information om en specifik funktion, variabel eller enhet, vänligen " "använd info-kommandot (i interaktivt läge)." #: ../src/qalc.cc:1218 msgid "Variables:" msgstr "Variabler:" #: ../src/qalc.cc:1220 msgid "Name" msgstr "Namn" #: ../src/qalc.cc:1221 ../src/qalc.cc:3057 msgid "Value" msgstr "Värde" #: ../src/qalc.cc:1245 ../src/qalc.cc:3022 ../libqalculate/Function.cc:2002 msgid "matrix" msgstr "matris" #: ../src/qalc.cc:1247 ../src/qalc.cc:3024 ../libqalculate/Function.cc:1941 msgid "vector" msgstr "vektor" #: ../src/qalc.cc:1276 ../src/qalc.cc:3053 msgid "default assumptions" msgstr "förvalda antaganden" #: ../src/qalc.cc:1297 msgid "Functions:" msgstr "Funktioner:" #: ../src/qalc.cc:1311 msgid "Units:" msgstr "Enheter:" #: ../src/qalc.cc:1318 msgid "No local variables, functions or units have been defined." msgstr "Inga lokala variabler, funktioner eller enheter har definierats." #: ../src/qalc.cc:1426 msgid "usage: qalc [options] [expression]" msgstr "användning: qalc [alternative] [uttryck]" #: ../src/qalc.cc:1428 msgid "where options are:" msgstr "där alternativen är:" #: ../src/qalc.cc:1429 ../src/qalc.cc:2704 msgid "BASE" msgstr "BAS" #: ../src/qalc.cc:1430 msgid "set the result number base" msgstr "ange talbas för resultat" #: ../src/qalc.cc:1435 msgid "FILE" msgstr "FIL" #: ../src/qalc.cc:1436 msgid "executes commands from a file first" msgstr "utför kommandon frÃ¥n en fil först" #: ../src/qalc.cc:1438 msgid "start in interactive mode" msgstr "starta i interaktivt läge" #: ../src/qalc.cc:1439 ../src/qalc.cc:1441 ../src/qalc.cc:1443 #: ../src/qalc.cc:1445 msgid "SEARCH TERM" msgstr "SÖKTERM" #: ../src/qalc.cc:1440 msgid "" "displays a list of all user-defined or matching variables, functions and " "units." msgstr "" "visar en lista över alla användardefinierade eller matchande variabler, " "funktioner och enheter." #: ../src/qalc.cc:1442 msgid "displays a list of all or matching functions." msgstr "visar en lista över alla eller matchande funktioner." #: ../src/qalc.cc:1444 msgid "displays a list of all or matching units." msgstr "visar en lista över alla eller matchande enheter." #: ../src/qalc.cc:1446 msgid "displays a list of all or matching variables." msgstr "visar en lista över alla eller matchande variabler." #: ../src/qalc.cc:1447 msgid "MILLISECONDS" msgstr "MILLISEKUNDER" #: ../src/qalc.cc:1448 msgid "" "terminate calculation and display of result after specified amount of time" msgstr "avbryt beräkning eller visning av resultat efter en specificerad tid" #: ../src/qalc.cc:1450 msgid "do not load any functions, units, or variables from file" msgstr "läs inte in nÃ¥gra funktioner, enheter, eller variabler frÃ¥n datafiler" #: ../src/qalc.cc:1452 msgid "do not load any global currencies from file" msgstr "läs inte in nÃ¥gra systemvida valutor" #: ../src/qalc.cc:1454 msgid "do not load any global data sets from file" msgstr "läs inte in nÃ¥gra systemvida dataset" #: ../src/qalc.cc:1456 msgid "do not load any global functions from file" msgstr "läs inte in nÃ¥gra systemvida funktioner" #: ../src/qalc.cc:1458 msgid "do not load any global units from file" msgstr "läs inte in nÃ¥gra systemvida enheter" #: ../src/qalc.cc:1460 msgid "do not load any global variables from file" msgstr "läs inte in nÃ¥gra systemvida variabler" #: ../src/qalc.cc:1461 ../src/qalc.cc:2720 msgid "OPTION" msgstr "INSTÄLLNING" #: ../src/qalc.cc:1461 ../src/qalc.cc:2720 msgid "VALUE" msgstr "VÄRDE" #: ../src/qalc.cc:1462 msgid "as set command in interactive program session (ex. -set \"base 16\")" msgstr "" "fungerar som set (sätt) kommandot i en interaktiv programsession (ex. -set " "\"bas 16\")" #: ../src/qalc.cc:1464 msgid "reduces output to just the result of the input expression" msgstr "begränsar utdata till enbart resultatet av angett uttryck" #: ../src/qalc.cc:1466 msgid "turn on/off unicode support" msgstr "aktivera/avaktivera unicode-stöd" #: ../src/qalc.cc:1468 msgid "show application version and exit" msgstr "visa programversion och avsluta" #: ../src/qalc.cc:1470 msgid "" "The program will start in interactive mode if no expression and no file is " "specified (or interactive mode is explicitly selected)." msgstr "" "Programmet startar i interaktivt läge om inget uttryck och ingen fil har " "angetts (eller om interaktivt läga explicit har valts)." #: ../src/qalc.cc:1546 msgid "No option and value specified for set command." msgstr "Ingen inställning och värde angett för set (sätt) kommandot." #: ../src/qalc.cc:1554 msgid "No file specified." msgstr "Ingen fil specificerad." #: ../src/qalc.cc:1613 msgid "ans" msgstr "ans" #: ../src/qalc.cc:1614 ../src/qalc.cc:1617 ../src/qalc.cc:1618 #: ../src/qalc.cc:1619 ../src/qalc.cc:1620 ../src/qalc.cc:1852 #: ../libqalculate/Calculator.cc:8938 ../libqalculate/Calculator.cc:8954 msgid "Temporary" msgstr "Temporära" #: ../src/qalc.cc:1614 msgid "Last Answer" msgstr "Senaste svaret" #: ../src/qalc.cc:1615 msgid "answer" msgstr "svar" #: ../src/qalc.cc:1617 msgid "Answer 2" msgstr "Svar 2" #: ../src/qalc.cc:1618 msgid "Answer 3" msgstr "Svar 3" #: ../src/qalc.cc:1619 msgid "Answer 4" msgstr "Svar 4" #: ../src/qalc.cc:1620 msgid "Answer 5" msgstr "Svar 5" #: ../src/qalc.cc:1631 msgid "Failed to load global definitions!" msgstr "Kunde inte inhämta systemvida definitioner!" #: ../src/qalc.cc:1656 #, c-format msgid "Could not open \"%s\".\n" msgstr "Kunde inte öppna \"%s\".\n" #: ../src/qalc.cc:1696 ../src/qalc.cc:1748 ../src/qalc.cc:3541 #, c-format msgid "Illegal character, '%c', in expression." msgstr "OtillÃ¥tet tecken, '%c', i uttryck." #. The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. #: ../src/qalc.cc:1814 ../src/qalc.cc:2720 ../src/qalc.cc:3101 msgid "set" msgstr "ange" #. qalc command #: ../src/qalc.cc:1818 ../src/qalc.cc:2717 ../src/qalc.cc:3355 msgid "save" msgstr "spara" #: ../src/qalc.cc:1818 ../src/qalc.cc:2717 ../src/qalc.cc:3355 msgid "store" msgstr "lagra" #. qalc command #: ../src/qalc.cc:1821 ../src/qalc.cc:2437 ../src/qalc.cc:2715 #: ../src/qalc.cc:3381 msgid "mode" msgstr "läge" #: ../src/qalc.cc:1823 msgid "mode saved" msgstr "läge sparades" #: ../src/qalc.cc:1825 msgid "definitions" msgstr "definitioner" #: ../src/qalc.cc:1827 msgid "definitions saved" msgstr "definitioner sparades" #: ../src/qalc.cc:1874 ../src/qalc.cc:1876 ../src/qalc.cc:1934 #: ../src/qalc.cc:1936 ../src/qalc.cc:1991 ../src/qalc.cc:1993 #, c-format msgid "Illegal name. Save as %s instead (default: no)?" msgstr "OtillÃ¥tet namn. Vill du spara som %s i stället (förvalt: nej)?" #: ../src/qalc.cc:1883 ../src/qalc.cc:1943 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "En enhet eller variabel med samma namn finns redan.\n" "Vill du ersätta den (förvalt: nej)?" #. qalc command #: ../src/qalc.cc:1906 ../src/qalc.cc:2723 ../src/qalc.cc:3362 #: ../libqalculate/Function.cc:2064 msgid "variable" msgstr "variabel" #. qalc command #: ../src/qalc.cc:1963 ../src/qalc.cc:2713 ../src/qalc.cc:3368 #: ../libqalculate/Function.cc:2036 msgid "function" msgstr "funktion" #: ../src/qalc.cc:2000 msgid "" "An function with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "En funktion med samma namn finns redan.\n" "Vill du ersätta den (förvalt: nej)?" #. qalc command #: ../src/qalc.cc:2020 ../src/qalc.cc:2705 ../src/qalc.cc:3375 msgid "delete" msgstr "frigör" #: ../src/qalc.cc:2031 msgid "No user-defined variable or function with the specified name exist." msgstr "" "Ingen användardefinierad variabel eller funktion med det angivna namnet " "existerar." #. qalc command #: ../src/qalc.cc:2035 ../src/qalc.cc:2703 ../src/qalc.cc:3328 msgid "assume" msgstr "antag" #: ../src/qalc.cc:2045 msgid "syntax" msgstr "syntax" #. qalc command #: ../src/qalc.cc:2052 ../src/qalc.cc:2087 ../src/qalc.cc:2727 #: ../src/qalc.cc:3420 msgid "stack" msgstr "stack" #. qalc command #: ../src/qalc.cc:2072 ../src/qalc.cc:2708 ../src/qalc.cc:3400 msgid "exrates" msgstr "växelkurser" #: ../src/qalc.cc:2089 ../src/qalc.cc:2105 ../src/qalc.cc:2114 #: ../src/qalc.cc:2147 ../src/qalc.cc:2176 ../src/qalc.cc:2185 #: ../src/qalc.cc:2202 ../src/qalc.cc:2209 ../src/qalc.cc:2227 #: ../src/qalc.cc:2234 msgid "The RPN stack is empty." msgstr "RPN-stacken är tom." #. qalc command #: ../src/qalc.cc:2103 ../src/qalc.cc:2112 ../src/qalc.cc:2733 #: ../src/qalc.cc:3424 msgid "swap" msgstr "swap" #: ../src/qalc.cc:2107 ../src/qalc.cc:2116 ../src/qalc.cc:2149 #: ../src/qalc.cc:2178 ../src/qalc.cc:2187 msgid "The RPN stack only contains one value." msgstr "RPN-stacken innehÃ¥ller endast ett värde." #: ../src/qalc.cc:2135 ../src/qalc.cc:2168 ../src/qalc.cc:2216 #: ../src/qalc.cc:2240 msgid "The specified RPN stack index does not exist." msgstr "Angivet index pÃ¥ RPN-stacken finns inte." #. qalc command #: ../src/qalc.cc:2145 ../src/qalc.cc:2730 ../src/qalc.cc:3446 msgid "move" msgstr "flytta" #. qalc command #: ../src/qalc.cc:2174 ../src/qalc.cc:2183 ../src/qalc.cc:2732 #: ../src/qalc.cc:3442 msgid "rotate" msgstr "rotera" #: ../src/qalc.cc:2191 msgid "up" msgstr "upp" #: ../src/qalc.cc:2193 msgid "down" msgstr "ner" #. qalc command #: ../src/qalc.cc:2200 ../src/qalc.cc:2207 ../src/qalc.cc:2729 #: ../src/qalc.cc:3434 msgid "copy" msgstr "kopiera" #. qalc command #: ../src/qalc.cc:2222 ../src/qalc.cc:2728 ../src/qalc.cc:3410 msgid "clear stack" msgstr "töm stacken" #. qalc command #: ../src/qalc.cc:2225 ../src/qalc.cc:2232 ../src/qalc.cc:2731 #: ../src/qalc.cc:3414 msgid "pop" msgstr "pop" #. qalc command #: ../src/qalc.cc:2258 ../src/qalc.cc:2722 ../src/qalc.cc:3466 msgid "convert" msgstr "omvandla" #: ../src/qalc.cc:2258 ../src/qalc.cc:2722 ../src/qalc.cc:3466 #: ../src/qalc.cc:3503 ../libqalculate/Calculator.cc:1241 #: ../libqalculate/Calculator.cc:2623 ../libqalculate/Calculator.cc:2638 #: ../libqalculate/Calculator.cc:2639 msgid "to" msgstr "till" #: ../src/qalc.cc:2336 ../src/qalc.cc:4188 ../libqalculate/Calculator.cc:2493 msgid "bases" msgstr "baser" #: ../src/qalc.cc:2380 ../src/qalc.cc:4191 ../libqalculate/Calculator.cc:2496 msgid "calendars" msgstr "kalendrar" #: ../src/qalc.cc:2390 ../src/qalc.cc:4179 ../libqalculate/Calculator.cc:2484 msgid "fraction" msgstr "brÃ¥ktal" #: ../src/qalc.cc:2399 ../src/qalc.cc:4182 ../libqalculate/Calculator.cc:2487 msgid "factors" msgstr "faktorer" #. qalc command #: ../src/qalc.cc:2401 ../src/qalc.cc:2431 ../src/qalc.cc:2716 #: ../src/qalc.cc:3093 ../src/qalc.cc:4185 ../libqalculate/Calculator.cc:2490 msgid "partial fraction" msgstr "partialbrÃ¥ktal" #. qalc command #: ../src/qalc.cc:2428 ../src/qalc.cc:2711 ../src/qalc.cc:3089 msgid "factor" msgstr "faktor" #: ../src/qalc.cc:2442 ../src/qalc.cc:3117 msgid "Algebraic Mode" msgstr "Algebraiskt läge" #: ../src/qalc.cc:2477 ../src/qalc.cc:3149 msgid "Calculation" msgstr "Beräkning" #: ../src/qalc.cc:2497 ../src/qalc.cc:3158 msgid "Enabled Objects" msgstr "Aktiverade objekt" #: ../src/qalc.cc:2509 ../src/qalc.cc:3170 msgid "Generic Display Options" msgstr "Generella visningsalternativ" #: ../src/qalc.cc:2533 ../src/qalc.cc:3182 msgid "Numerical Display" msgstr "Numerisk visning" #: ../src/qalc.cc:2623 ../src/qalc.cc:3254 msgid "Parsing" msgstr "Tolkning" #: ../src/qalc.cc:2659 ../src/qalc.cc:3291 msgid "Units" msgstr "Enheter" #: ../src/qalc.cc:2687 ../src/qalc.cc:3322 msgid "Other" msgstr "Övrigt" #. qalc command #: ../src/qalc.cc:2694 ../src/qalc.cc:3085 msgid "help" msgstr "hjälp" #: ../src/qalc.cc:2697 msgid "Enter a mathematical expression or a command and press enter." msgstr "Skriv in ett matematiskt uttryck eller ett kommando och tryck enter." #: ../src/qalc.cc:2698 msgid "Complete functions, units and variables with the tabulator key." msgstr "Avsluta funktions-, enhets- och variabelnamn med tabulatortangenten." #: ../src/qalc.cc:2700 msgid "Available commands are:" msgstr "Tillgängliga kommandon:" #: ../src/qalc.cc:2703 msgid "ASSUMPTIONS" msgstr "ANTAGANDEN" #: ../src/qalc.cc:2705 ../src/qalc.cc:2713 ../src/qalc.cc:2717 #: ../src/qalc.cc:2723 msgid "NAME" msgstr "NAMN" #: ../src/qalc.cc:2712 ../src/qalc.cc:2744 ../src/qalc.cc:3385 msgid "find" msgstr "hitta" #. qalc command #: ../src/qalc.cc:2712 ../src/qalc.cc:2742 ../src/qalc.cc:2744 #: ../src/qalc.cc:3385 msgid "list" msgstr "lista" #: ../src/qalc.cc:2713 ../src/qalc.cc:2723 msgid "EXPRESSION" msgstr "UTTRYCK" #. qalc command #: ../src/qalc.cc:2714 ../src/qalc.cc:2770 ../src/qalc.cc:3394 #: ../libqalculate/Calculator.cc:9598 ../libqalculate/DataSet.cc:355 #: ../libqalculate/DataSet.cc:382 ../libqalculate/DataSet.cc:1012 msgid "info" msgstr "info" #: ../src/qalc.cc:2717 msgid "CATEGORY" msgstr "KATEGORI" #: ../src/qalc.cc:2717 msgid "TITLE" msgstr "TITEL" #: ../src/qalc.cc:2722 msgid "UNIT or \"TO\" COMMAND" msgstr "ENHET eller \"TILL\"-KOMMANDO" #. qalc command #: ../src/qalc.cc:2724 ../src/qalc.cc:3507 ../src/qalc.cc:3528 msgid "quit" msgstr "avsluta" #: ../src/qalc.cc:2724 ../src/qalc.cc:3507 ../src/qalc.cc:3528 msgid "exit" msgstr "exit" #: ../src/qalc.cc:2725 msgid "Commands for RPN mode:" msgstr "Kommandon för RPN-läget:" #: ../src/qalc.cc:2726 msgid "STATE" msgstr "LÄGE" #: ../src/qalc.cc:2729 ../src/qalc.cc:2731 msgid "INDEX" msgstr "INDEX" #: ../src/qalc.cc:2730 ../src/qalc.cc:2733 msgid "INDEX 1" msgstr "INDEX 1" #: ../src/qalc.cc:2730 ../src/qalc.cc:2733 msgid "INDEX 2" msgstr "INDEX 2" #: ../src/qalc.cc:2732 msgid "DIRECTION" msgstr "RIKTNING" #: ../src/qalc.cc:2735 msgid "Type help COMMAND for more information (example: help save)." msgstr "Skriv in hjälp KOMMANDO för mer information (exemel: hjälp save)." #: ../src/qalc.cc:2736 msgid "" "Type info NAME for information about a function, variable or unit (example: " "info sin)." msgstr "" "Skriv info NAMN för information om en funktion, variabel eller enhet " "(exempel: info sin)." #: ../src/qalc.cc:2737 msgid "" "When a line begins with '/', the following text is always interpreted as a " "command." msgstr "" "När en rad inleds med '/', tolkas alltid efterföljande text som ett kommando." #: ../src/qalc.cc:2739 msgid "" "For more information about mathematical expression, different options, and a " "complete list of functions, variables and units, see the relevant sections " "in the manual of the graphical user interface (available at http://qalculate." "github.io/manual/index.html)." msgstr "" "För mer information om matematiska uttryck, olika alternativ, och en " "komplett förteckning över funktioner, variabler och enheter, se relevanta " "avsnitt i instruktionsboken för det grafiska användargränssnittet " "(tillgänglig pÃ¥ http://qalculate.github.io/manual/index.html)." #: ../src/qalc.cc:2757 ../src/qalc.cc:2762 msgid "currencies" msgstr "valutor" #: ../src/qalc.cc:2778 msgid "No function, variable or unit with specified name exist." msgstr "Ingen funktion, variabel eller enhet med det angivna namnet existerar." #: ../src/qalc.cc:2788 msgid "Function" msgstr "Funktion" #: ../src/qalc.cc:2815 ../libqalculate/Function.cc:201 msgid "argument" msgstr "parameter" #: ../src/qalc.cc:2839 #, c-format msgid "" "Retrieves data from the %s data set for a given object and property. If " "\"info\" is typed as property, all properties of the object will be listed." msgstr "" "Hämtar data frÃ¥n dataset %s för ett givet objekt och egenskap. Om \"info\" " "är angivet som egenskap, kommer alla objektets egenskaper att listas." #: ../src/qalc.cc:2848 msgid "Example:" msgstr "Exempel:" #: ../src/qalc.cc:2857 msgid "Arguments" msgstr "Parametrar" #. optional argument, in description #: ../src/qalc.cc:2874 msgid "optional" msgstr "frivillig" #. argument default, in description #: ../src/qalc.cc:2878 msgid "default: " msgstr "förval: " #: ../src/qalc.cc:2889 msgid "Requirement" msgstr "Krav" #: ../src/qalc.cc:2897 msgid "Properties" msgstr "Egenskaper" #: ../src/qalc.cc:2912 msgid "key" msgstr "nyckel" #: ../src/qalc.cc:2930 ../src/qalc.cc:2933 ../src/qalc.cc:3072 msgid "Unit" msgstr "Enhet" #: ../src/qalc.cc:2936 ../src/qalc.cc:3004 msgid "Names" msgstr "Namn" #: ../src/qalc.cc:2954 msgid "Base Unit" msgstr "Grundenhet" #: ../src/qalc.cc:2961 msgid "Relation" msgstr "Relation" #: ../src/qalc.cc:2971 msgid "Inverse Relation" msgstr "Omvänd relation" #: ../src/qalc.cc:2983 msgid "Base Units" msgstr "Grundenheter" #: ../src/qalc.cc:2998 ../src/qalc.cc:3001 msgid "Variable" msgstr "Variabel" #: ../src/qalc.cc:3016 msgid "a previous result" msgstr "ett föregÃ¥ende resultat" #: ../src/qalc.cc:3061 msgid "Uncertainty" msgstr "Osäkerhet" #: ../src/qalc.cc:3091 msgid "Factorizes the current result." msgstr "Faktoriserar nuvaranda resultat." #: ../src/qalc.cc:3095 msgid "Applies partial fraction decomposition to the current result." msgstr "Tillämpar partialbrÃ¥ksuppdelning pÃ¥ det nuvarande resultatet." #: ../src/qalc.cc:3099 msgid "Simplifies the current result." msgstr "Förenklar nuvaranda resultat." #: ../src/qalc.cc:3112 msgid "Sets the value of an option." msgstr "Anger värdet för en inställning." #: ../src/qalc.cc:3113 msgid "Example: set base 16." msgstr "Exempel: set bas 16." #: ../src/qalc.cc:3115 msgid "" "Available options and accepted values are (the current value is marked with " "'*'):" msgstr "" "Tillgängliga inställningar och accepterade värden (det nuvarande värdet är " "markerat med '*'):" #: ../src/qalc.cc:3119 msgid "" "Determines if the expression is simplified or factorized after calculation." msgstr "Avgör om uttryck ska förenklas eller faktoriseras efter beräkning." #: ../src/qalc.cc:3120 msgid "Determines if unknown values will be assumed non-zero (x/x=1)." msgstr "Avgör om ökända värden ska antas vara icke-noll (x/x=1)." #: ../src/qalc.cc:3121 msgid "Display a message after a value has been assumed non-zero." msgstr "Visa ett meddelande efter att ett har antagits vara icke-noll." #: ../src/qalc.cc:3124 msgid "Default assumptions for unknown variables." msgstr "Förvalda antaganden för okända variabler." #: ../src/qalc.cc:3152 msgid "" "How approximate variables and calculations are handled. In exact mode " "approximate values will not be calculated." msgstr "" "Hur approximerade beräkningar och variabler hanteras. I exakt läge beräknas " "ej approximerade värden." #: ../src/qalc.cc:3153 msgid "" "If activated, interval arithmetic determines the final precision of " "calculations. Avoids wrong results after loss of significance. Especially " "recommended with physical constants and/or 'read precision'." msgstr "" "Om aktiverat avgörs beräkningars slutgiltiga precision med hjälp av " "intervallaritmetik. Undviker felaktiga resultat efter signifikansförlust. " "Rekommenderas särskilt med fysiska konstanter och/eller 'läs precision'." #: ../src/qalc.cc:3155 msgid "" "Specifies the default number of significant digits displayed and determines " "the precision used for approximate calculations." msgstr "" "Anger det förvalda visade antalet signifikanta siffor och avgör vilken " "precision som används för approximerade beräkningar." #: ../src/qalc.cc:3166 msgid "Interprete undefined symbols in expressions as unknown variables." msgstr "Tolka odefinierade symboler i uttryck som okända variabler." #: ../src/qalc.cc:3168 msgid "" "If activated physical constants include units (e.g. c = 299 792 458 m∕s)." msgstr "" "Om aktiverat inkluderar fysiska konstanter enheter (t.ex. c = 299 792 458 " "m∕s)." #: ../src/qalc.cc:3172 msgid "Use abbreviated names for units and variables." msgstr "Använda förkortade namn pÃ¥ enheter och variabler." #: ../src/qalc.cc:3176 msgid "Use negative exponents instead of division in result (x/y = xy^-1)." msgstr "" "Använd negativa exponenter istället för division i result (x/y = xy^-1)." #: ../src/qalc.cc:3178 msgid "Add extra space around operators." msgstr "Lägg till extra blanksteg kring operatorer." #: ../src/qalc.cc:3180 msgid "Display Unicode characters." msgstr "Visa Unicode-tecken." #: ../src/qalc.cc:3184 ../src/qalc.cc:3273 msgid "bin" msgstr "bin" #: ../src/qalc.cc:3186 ../src/qalc.cc:3275 msgid "oct" msgstr "okt" #: ../src/qalc.cc:3188 ../src/qalc.cc:3277 msgid "dec" msgstr "dec" #: ../src/qalc.cc:3190 ../src/qalc.cc:3279 msgid "hex" msgstr "hex" #: ../src/qalc.cc:3192 msgid "sexa" msgstr "sexa" #: ../src/qalc.cc:3204 ../src/qalc.cc:3257 msgid "Determines the default decimal separator." msgstr "Anger förvald decimalavgränsare." #: ../src/qalc.cc:3216 msgid "Determines how scientific notation are used (e.g. 5 543 000 = 5.543E6)." msgstr "Avgör grundpotensform används (t.ex. 5 543 000 = 5,543E6)." #: ../src/qalc.cc:3231 msgid "" "Determines how rational numbers are displayed (e.g. 5/4 = 1 + 1/4 = 1.25). " "'long' removes limits on the size of the numerator and denonimator." msgstr "" "Avgör hur rationella tal visas (t.ex. 5/4 = 1 + 1/4 = 1.25). 'lÃ¥ng' " "avlägsnar begränsningar för storleken pÃ¥ täljare och nämnare." #: ../src/qalc.cc:3233 msgid "Use lowercase e for E-notation (5e2 = 5 * 10^2)." msgstr "Använda litet e för grundpotensform (5e2 = 5 * 10^2)." #: ../src/qalc.cc:3234 msgid "Use lowercase letters for number bases > 10." msgstr "Använd smÃ¥ bokstäver för talbaser > 10." #: ../src/qalc.cc:3249 msgid "" "If activated, 1/6 is displayed as '0.1 666...', otherwise as '0.166667'." msgstr "Om aktiverat visas 1/6 som '0.1 666...', annars som '0.166667'." #: ../src/qalc.cc:3250 msgid "" "Determines whether halfway numbers are rounded upwards or towards the " "nearest even integer." msgstr "" "Avgör om mitt-i-mellan tal ska avrundas uppÃ¥t eller mot närmaste jämna " "heltal." #: ../src/qalc.cc:3251 msgid "If actived, zeroes are kept at the end of approximate numbers." msgstr "Om aktiverat behÃ¥lls nollor i slutet av approximerade tal." #: ../src/qalc.cc:3252 msgid "" "Enables two's complement representation for display of negative binary " "numbers." msgstr "Aktiverar tvÃ¥komplementsform för visning av negative binära tal." #: ../src/qalc.cc:3268 msgid "Allows use of ',' as thousands separator." msgstr "TillÃ¥ter användning av ',' som tusentalsavgränsare." #: ../src/qalc.cc:3271 msgid "Allows use of '.' as thousands separator." msgstr "TillÃ¥ter användning av '.' som tusentalsavgränsare." #: ../src/qalc.cc:3287 msgid "See 'help parsing mode'." msgstr "Se 'hjälp tolkningsläge'." #: ../src/qalc.cc:3288 msgid "" "If activated, numbers be interpreted as approximate with precision equal to " "the number of significant digits. Most useful in combination with 'interval " "arithmetic' (3.20 = 3.20+/-0.0005)." msgstr "" "Om aktiverat kommer tal att tolkas som approximerade med en precision som är " "lika med antalet signifikanta siffror. Mest användbar i kombination med " "'intervallaritmetik' (3,20 = 3,20+/-0,0005)." #: ../src/qalc.cc:3293 msgid "Enables automatic use of hecto, deca, deci, and centi." msgstr "Aktiverar automatisk användning av hekto, deka, deci och centi." #: ../src/qalc.cc:3295 msgid "" "Controls automatic unit conversion of the result. 'optimalsi' always " "converts non-SI units, while 'optimal' only converts to more optimal unit " "expressions, with less units and exponents." msgstr "" "Styr automatisk enhetsomvandling i resultat. 'optimalsi' omvandlar alltid " "icke-SI-enheter, medans 'optimal' enbart omvandlar till mer optimala " "enhetsuttryck, med färre enheter och exponenter." #: ../src/qalc.cc:3309 msgid "" "Enables automatic conversion to the local currency when optimal unit " "conversion is enabled." msgstr "" "Aktiverar omvandling till den lokala valuta när optimal enhetsomvandling är " "aktiverad." #: ../src/qalc.cc:3310 msgid "" "Enables automatic use of prefixes in the denominator of unit expressions." msgstr "Aktiverar automatisk använding av prefix i täljare i enhetsuttryck." #: ../src/qalc.cc:3311 msgid "" "If activated, units are separated from variables at the end of the result." msgstr "" "Om aktiverat kommer enheter att separeras frÃ¥n variabler pÃ¥ slutet av " "resultat." #: ../src/qalc.cc:3312 msgid "Enables automatic use of prefixes in the result." msgstr "Aktiverar automatisk användning av prefix i resultat." #: ../src/qalc.cc:3317 msgid "days" msgstr "dagar" #: ../src/qalc.cc:3324 msgid "Activates the Reverse Polish Notation stack." msgstr "Aktiverar stacken för omvänd polsk notation." #: ../src/qalc.cc:3325 msgid "Save functions, units, and variables on exit." msgstr "Sparar enheter, funktioner och variabler vid avslut." #: ../src/qalc.cc:3326 msgid "Save settings on exit." msgstr "Sparar inställningar vid avslut." #: ../src/qalc.cc:3330 msgid "Set default assumptions for unknown variables." msgstr "Ange färvalda antaganden för okända variabler." #: ../src/qalc.cc:3357 msgid "" "Saves the current result in a variable with the specified name. You may " "optionally also provide a category (default \"Temporary\") and a title." msgstr "" "Sparar nuvarande resultat i en variabel med angivet namn. Du kan välja att " "ocksÃ¥ ange en kategori (förvald är \"Temporära\") och en titel." #: ../src/qalc.cc:3358 msgid "" "If name equals \"mode\" or \"definitions\", the current mode and " "definitions, respectively, will be saved." msgstr "" "Om angivet namn är \"läge\" eller \"definitioner\", sparas nuvarande läge " "respektive definitioner." #: ../src/qalc.cc:3360 msgid "Example: store var1." msgstr "Exempel: store var1." #: ../src/qalc.cc:3364 msgid "Create a variables with the specified name and expression." msgstr "Skapa en variabel med det angivna namnet och uttrycket." #: ../src/qalc.cc:3366 msgid "Example: variable var1 pi / 2." msgstr "Exempel: variabel var1 pi / 2." #: ../src/qalc.cc:3370 msgid "Creates a function with the specified name and expression." msgstr "Skapar en function med det angivna namnet och uttrycket." #: ../src/qalc.cc:3371 msgid "Use '\\x', '\\y', '\\z', '\\a', etc. for arguments in the expression." msgstr "Använd '\\x', '\\y', '\\z', '\\a', etc. för argument i uttrycket" #: ../src/qalc.cc:3373 msgid "Example: function func1 5*\\x." msgstr "Exempel: funktion func1 5*\\x." #: ../src/qalc.cc:3377 msgid "Removes the user-defined variable or function with the specified name." msgstr "" "Tar bort den användardefinierade variabeln eller funktionen med det angivna " "namnet." #: ../src/qalc.cc:3379 msgid "Example: delete var1." msgstr "Exempel: frigör var1." #: ../src/qalc.cc:3383 msgid "Displays the current mode." msgstr "Visar nuvarande läge." #: ../src/qalc.cc:3387 msgid "Displays a list of variables, functions and units." msgstr "Visar en lista över variabler, funktioner och enheter." #: ../src/qalc.cc:3388 msgid "" "Enter with argument 'currencies', 'functions', 'variables' or 'units' to " "show a list of all currencies, functions, variables or units. Enter a search " "term to find matching variables, functions, and/or units. If command is " "called with no argument all user-definied objects are listed." msgstr "" "Skriv med parameter 'enheter', 'funktioner', 'valutor' eller 'variabler' för " "att visa en list över alla funktioner, variabler eller enheter. Ange en " "sökterm för att hitta matchande variabler, funktioner, och/eller enheter. Om " "kommandot körs utan nÃ¥gra parametrar visas alla användardefinierade objekt." #: ../src/qalc.cc:3390 msgid "Example: list functions." msgstr "Exempel: lista funktioner." #: ../src/qalc.cc:3391 msgid "Example: find dinar." msgstr "Exempel: hitta dinar." #: ../src/qalc.cc:3392 msgid "Example: find variables planck." msgstr "Exempel: hitta variabler planck." #: ../src/qalc.cc:3396 msgid "Displays information about a function, variable or unit." msgstr "Visar information om en funktion, variabel eller enhet." #: ../src/qalc.cc:3398 msgid "Example: info sin." msgstr "Exempel: info sin." #: ../src/qalc.cc:3402 msgid "Downloads current exchange rates from the Internet." msgstr "Hämtar nuvarande växelkurser frÃ¥n internet." #: ../src/qalc.cc:3406 msgid "(De)activates the Reverse Polish Notation stack and syntax." msgstr "(Av)aktiverar stack och syntax för omvänd polsk notation." #: ../src/qalc.cc:3408 msgid "" "\"syntax\" activates only the RPN syntax and \"stack\" enables the RPN stack." msgstr "" "\"syntax\" aktiverar enbart RPN-syntaxen och \"stack\" aktiverar RPN-stacken." #: ../src/qalc.cc:3412 msgid "Clears the entire RPN stack." msgstr "Tömmer hela RPN-stacken." #: ../src/qalc.cc:3416 msgid "Removes the top of the RPN stack or the value at the specified index." msgstr "" "Avlägsnar det översta värdet pÃ¥ RPN-stacken eller värdet med angivet index." #: ../src/qalc.cc:3418 ../src/qalc.cc:3430 ../src/qalc.cc:3440 #: ../src/qalc.cc:3450 msgid "" "Index 1 is the top of stack and negative index values counts from the bottom " "of the stack." msgstr "" "Index 1 anger toppen pÃ¥ stacken och negativa indexvärden räknar frÃ¥n botten " "pÃ¥ stacken." #: ../src/qalc.cc:3422 msgid "Displays the RPN stack." msgstr "Visar RPN-stacken." #: ../src/qalc.cc:3426 msgid "Swaps position of values on the RPN stack." msgstr "Byter position pÃ¥ värden pÃ¥ RPN-stacken" #: ../src/qalc.cc:3428 msgid "" "If no index is specified, the values on the top of the stack (index 1 and " "index 2) will be swapped and if only one index is specified, the value at " "this index will be swapped with the top value." msgstr "" "Om inget index anges byter värdena överst pÃ¥ stacken (index 1 och index 2) " "plats och om enbart ett index anges, sÃ¥ byter värdet med angivet index plats " "med värdet överst pÃ¥ stacken." #: ../src/qalc.cc:3432 msgid "Example: swap 2 4" msgstr "Exempel: swap 2 4" #: ../src/qalc.cc:3436 msgid "Duplicates a value on the RPN stack to the top of the stack." msgstr "Kopierar ett värde pÃ¥ RPN-stacken och placerar det överst pÃ¥ stacken." #: ../src/qalc.cc:3438 msgid "If no index is specified, the top of the stack is duplicated." msgstr "Om inget index anges kopierar värdet överst pÃ¥ stacken." #: ../src/qalc.cc:3444 msgid "Rotates the RPN stack up (default) or down." msgstr "Roterar RPN-stacken upp (förvalt) eller ner." #: ../src/qalc.cc:3448 msgid "Changes the position of a value on the RPN stack." msgstr "Byter position pÃ¥ ett värdet pÃ¥ RPN-stacken." #: ../src/qalc.cc:3452 msgid "Example: move 2 4" msgstr "Exempel: flytta 2 4" #: ../src/qalc.cc:3456 msgid "Sets the result number base (equivalent to set base)." msgstr "Anger talbas för resultat (liktydigt med ange bas)." #: ../src/qalc.cc:3460 msgid "Equivalent to set approximation exact." msgstr "Liktydigt med ange approximation exakt." #: ../src/qalc.cc:3464 msgid "Equivalent to set approximation try exact." msgstr "Liktydigt med ange approximation försök exakt." #: ../src/qalc.cc:3469 msgid "Converts units or changes number base in current result." msgstr "Omvandlar enheter eller ändrar talbas i nuvarande resultat." #: ../src/qalc.cc:3471 msgid "Possible values:" msgstr "Möjliga värden:" #: ../src/qalc.cc:3473 msgid "- a unit (e.g. meter)" msgstr "- en enhet (t.ex. meter)" #: ../src/qalc.cc:3474 msgid "prepend with ? to request the optimal prefix" msgstr "inled med ? för att eftefrÃ¥ga optimalt prefix" #: ../src/qalc.cc:3475 msgid "prepend with + or - to force/disable use of mixed units" msgstr "" "inled med + eller - för att tvinga/avaktivera användning a blandade enheter" #: ../src/qalc.cc:3476 msgid "- a unit expression (e.g. km/h)" msgstr "- ett enhetsuttryck (t.ex. km/h)" #: ../src/qalc.cc:3477 msgid "- a physical constant (e.g. c)" msgstr "- en fysikalisk konstant (t.ex. c)" #: ../src/qalc.cc:3478 msgid "- base (convert to base units)" msgstr "- bas (omvandla till basenheter)" #: ../src/qalc.cc:3479 msgid "- optimal (convert to optimal unit)" msgstr "- optimal (omvandla till optimal enhet)" #: ../src/qalc.cc:3480 msgid "- mixed (convert to mixed units, e.g. hours + minutes)" msgstr "- blandade (omvandla till blandade enheter, t.ex. timmar + minuter)" #: ../src/qalc.cc:3482 msgid "- bin / binary (show as binary number)" msgstr "- bin / binär (visa som binärt tal)" #: ../src/qalc.cc:3483 msgid "- oct / octal (show as octal number)" msgstr "- oct / oktal (visa som oktalt tal)" #: ../src/qalc.cc:3484 msgid "- duo / duodecimal (show as duodecimal number)" msgstr "- duo / duodecimal (visa som duodecimalt tal)" #: ../src/qalc.cc:3485 msgid "- hex / hexadecimal (show as hexadecimal number)" msgstr "- hex / hexadecimal (visa som hexadecimalt tal)" #: ../src/qalc.cc:3486 msgid "- sex / sexagesimal (show as sexagesimal number)" msgstr "- sex / sexagesimal (visa som sexagecimalt tal)" #: ../src/qalc.cc:3487 msgid "- roman (show as roman numerals)" msgstr "- romersk (visa som romerska siffror)" #: ../src/qalc.cc:3488 msgid "- time (show in time format)" msgstr "- tid (visas i tidsformat)" #: ../src/qalc.cc:3489 msgid "- bases (show as binary, octal, decimal and hexadecimal number)" msgstr "- baser (visa som binärt, otkalt, decimalt och hexadecimalt tal)" #: ../src/qalc.cc:3491 msgid "- rectangular / cartesian (show complex numbers in rectangular form)" msgstr "- rektangulär / kartesisk (visa komplexa tal i rektangulär form)" #: ../src/qalc.cc:3492 msgid "- exponential (show complex numbers in exponential form)" msgstr "- exponentiell (visa komplexa tal i exponentiell form)" #: ../src/qalc.cc:3493 msgid "- polar (show complex numbers in polar form)" msgstr "- polär (visa komplexa tal i polär form)" #: ../src/qalc.cc:3495 msgid "- fraction (show result in combined fractional format)" msgstr "- brÃ¥ktal (visa resultatet som kombinerat brÃ¥ktal)" #: ../src/qalc.cc:3496 msgid "- factors (factorize result)" msgstr "- faktorer (faktoriserar resultatet)" #: ../src/qalc.cc:3498 msgid "- utc (show UTC date)" msgstr "- utc (visa UTC-datum)" #: ../src/qalc.cc:3499 msgid "- calendars" msgstr "- kalendrar" #: ../src/qalc.cc:3501 msgid "Example: to ?g" msgstr "Exempel: till ?g" #: ../src/qalc.cc:3504 msgid "" "This command can also be typed directly at the end of the mathematical " "expression." msgstr "" "Det här kommandot kan även skrivas direkt i slutet av det matematiska " "uttrycket." #: ../src/qalc.cc:3509 msgid "Terminates this program." msgstr "Avslutar det här programmet." #: ../src/qalc.cc:3514 msgid "" "Implicit multiplication does not differ from explicit multiplication " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." msgstr "" "Implicit multiplikation särskiljer sig inte frÃ¥n explicit multiplikation " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." #: ../src/qalc.cc:3517 msgid "" "Implicit multiplication is parsed before explicit multiplication " "(\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." msgstr "" "Implicit multiplikation tolkas före explicit multiplikation (\"12/2(1+2) = " "12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." #: ../src/qalc.cc:3520 msgid "" "The default adaptive mode works as the \"implicit first\" mode, unless " "spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the " "adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/" "(5*(m/s)) = 1 s\")." msgstr "" "Det förvalda adaptiva läget fungerar som \"implicit först\"-läget, sÃ¥vida " "inte blanksteg är funna (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). I " "adaptivt läge tolkas enhetsuttryck separat (\"5 m/5 m/s = (5*m)/(5*(m/s)) = " "1 s\")." #: ../src/qalc.cc:3522 msgid "" "Function arguments without parentheses are an exception, where implicit " "multiplication in front of variables and units is parsed first regardless of " "mode (\"sqrt 2x = sqrt(2x)\")." msgstr "" "Funktionsparametrar utan parenteser utgör ett undantag, där implicit " "multiplikation frmför variabler och enheter tolkas först oavsett läge " "(\"sqrt 2x = sqrt(2x)\")." #: ../src/qalc.cc:3536 msgid "Unknown command." msgstr "Okänt kommando." #: ../src/qalc.cc:3585 msgid "error" msgstr "fel" #: ../src/qalc.cc:3587 msgid "warning" msgstr "varning" #: ../src/qalc.cc:3663 ../src/qalc.cc:3701 ../src/qalc.cc:3997 #: ../src/qalc.cc:4401 ../libqalculate/Calculator.cc:10016 #: ../libqalculate/MathStructure.cc:713 #, c-format msgid "aborted" msgstr "avbruten" #: ../src/qalc.cc:3713 msgid "RPN Register Moved" msgstr "RPN-register flyttades" #: ../src/qalc.cc:3769 msgid "Processing (press Enter to abort)" msgstr "Behandlar (tryck Enter för att avbryta)" #: ../src/qalc.cc:3856 ../src/qalc.cc:4549 msgid "approx." msgstr "ca" #: ../src/qalc.cc:4014 msgid "Factorizing (press Enter to abort)" msgstr "Faktoriserar (tryck Enter för att avbryta)" #: ../src/qalc.cc:4018 msgid "Expanding partial fractions…" msgstr "Expandarer partialbrÃ¥k…" #: ../src/qalc.cc:4022 msgid "Simplifying (press Enter to abort)" msgstr "Förenklar (tryck Enter för att avbryta)" #: ../src/qalc.cc:4026 ../src/qalc.cc:4415 msgid "Calculating (press Enter to abort)" msgstr "Beräknar (tryck Enter för att avbryta)" #: ../src/qalc.cc:4500 msgid "RPN Operation" msgstr "RPN-operation" #: ../src/qalc.cc:4969 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "Kunde inte spara inställningar till\n" "%s" #: ../src/qalc.cc:5056 msgid "Couldn't write definitions" msgstr "Kunde inte spara definitioner" #: ../libqalculate/BuiltinFunctions.cc:68 #, c-format msgid "Too many elements (%s) for the dimensions (%sx%s) of the matrix." msgstr "För mÃ¥nga element (%s) för en %sx%s matris." #: ../libqalculate/BuiltinFunctions.cc:131 #: ../libqalculate/BuiltinFunctions.cc:193 #, c-format msgid "Row %s does not exist in matrix." msgstr "Rad %s finns inte i matrisen." #: ../libqalculate/BuiltinFunctions.cc:144 #: ../libqalculate/BuiltinFunctions.cc:189 #, c-format msgid "Column %s does not exist in matrix." msgstr "Kolumn %s finns inte i matrisen." #: ../libqalculate/BuiltinFunctions.cc:204 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "Parameter 3, %s, bortses frÃ¥n för vektorer." #: ../libqalculate/BuiltinFunctions.cc:208 #: ../libqalculate/BuiltinFunctions.cc:229 #, c-format msgid "Element %s does not exist in vector." msgstr "Element %s finns inte i vektorn." #: ../libqalculate/BuiltinFunctions.cc:370 #: ../libqalculate/BuiltinFunctions.cc:374 #: ../libqalculate/BuiltinFunctions.cc:406 #: ../libqalculate/BuiltinFunctions.cc:410 #, c-format msgid "%s() requires that all matrices/vectors have the same dimensions." msgstr "%s() kräver att alla matriser/vektorer har samma dimensioner." #: ../libqalculate/BuiltinFunctions.cc:4274 #: ../libqalculate/BuiltinFunctions.cc:4317 #, c-format msgid "Unsolvable comparison in %s()." msgstr "Olöslig jämförelse i %s()." #: ../libqalculate/BuiltinFunctions.cc:4400 #: ../libqalculate/BuiltinFunctions.cc:4434 msgid "gregorian" msgstr "gregoriansk" #: ../libqalculate/BuiltinFunctions.cc:4401 msgid "milankovic" msgstr "milankovic" #: ../libqalculate/BuiltinFunctions.cc:4402 msgid "julian" msgstr "juliansk" #: ../libqalculate/BuiltinFunctions.cc:4403 msgid "islamic" msgstr "muslimsk" #: ../libqalculate/BuiltinFunctions.cc:4404 msgid "hebrew" msgstr "hebreisk" #: ../libqalculate/BuiltinFunctions.cc:4405 msgid "egyptian" msgstr "egyptisk" #: ../libqalculate/BuiltinFunctions.cc:4406 msgid "persian" msgstr "persisk" #: ../libqalculate/BuiltinFunctions.cc:4407 msgid "coptic" msgstr "koptisk" #: ../libqalculate/BuiltinFunctions.cc:4408 msgid "ethiopian" msgstr "etiopisk" #: ../libqalculate/BuiltinFunctions.cc:4409 msgid "indian" msgstr "indisk" #: ../libqalculate/BuiltinFunctions.cc:4410 msgid "chinese" msgstr "kinesisk" #: ../libqalculate/BuiltinFunctions.cc:4895 msgid "" "The number of requested elements in generate vector function must be a " "positive integer." msgstr "" "Antalet efterfrÃ¥gade element i generera vektor-funktionen mÃ¥ste vara ett " "positivt heltal." #: ../libqalculate/BuiltinFunctions.cc:5211 #: ../libqalculate/BuiltinFunctions.cc:5215 #, c-format msgid "Too few elements (%s) in vector (%s required)" msgstr "För fÃ¥ element (%s) i vektor (%s krävs)" #: ../libqalculate/BuiltinFunctions.cc:5264 #: ../libqalculate/BuiltinFunctions.cc:5281 msgid "Comparison failed." msgstr "Jämförelse misslyckades." #: ../libqalculate/BuiltinFunctions.cc:5269 #: ../libqalculate/BuiltinFunctions.cc:5299 msgid "No matching item found." msgstr "Inga matchande poster funna." #: ../libqalculate/BuiltinFunctions.cc:5397 #, c-format msgid "Object %s does not exist." msgstr "Okjektet %s finns inte." #: ../libqalculate/BuiltinFunctions.cc:5415 #, c-format msgid "Invalid variable name (%s)." msgstr "Ogiltigt variabelnamn (%s)." #: ../libqalculate/BuiltinFunctions.cc:5432 msgid "" "A global unit or variable was deactivated. It will be restored after the new " "variable has been removed." msgstr "" "En systemvid enhet eller variabel har avaktiverats. Den Ã¥teraktiveras efter " "att den nya variabeln har tagits bort." #: ../libqalculate/BuiltinFunctions.cc:5447 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "RPN-registret %s finns inte. Returnerar noll." #: ../libqalculate/BuiltinFunctions.cc:5796 #: ../libqalculate/MathStructure.cc:203 ../libqalculate/MathStructure.cc:235 #: ../libqalculate/MathStructure.cc:276 #, c-format msgid "To avoid division by zero, the following must be true: %s." msgstr "För att undvika division med noll, krävs att följande är sant: %s." #: ../libqalculate/BuiltinFunctions.cc:5852 #: ../libqalculate/BuiltinFunctions.cc:5879 #: ../libqalculate/BuiltinFunctions.cc:5899 #: ../libqalculate/BuiltinFunctions.cc:5940 #: ../libqalculate/BuiltinFunctions.cc:6035 #: ../libqalculate/BuiltinFunctions.cc:6125 msgid "Unable to integrate the expression." msgstr "Kan inte integrera uttrycket." #: ../libqalculate/BuiltinFunctions.cc:5950 #: ../libqalculate/BuiltinFunctions.cc:5987 msgid "Unable to integrate the expression exact." msgstr "Kan inte integrera uttrycket exakt." #: ../libqalculate/BuiltinFunctions.cc:6073 #: ../libqalculate/BuiltinFunctions.cc:6116 msgid "Definite integral was approximated with unknown precision." msgstr "Definitiv integral approximerades med okänd precision." #: ../libqalculate/BuiltinFunctions.cc:6097 msgid "Definite integral was approximated." msgstr "Definitiv integral approximerades." #: ../libqalculate/BuiltinFunctions.cc:6339 msgid "" "No equality or inequality to solve. The entered expression to solve is not " "correct (ex. \"x + 5 = 3\" is correct)" msgstr "" "Ingen ekvation eller olikhet att lösa. Angett uttryck att lösa var inte " "korrekt (t ex \"x + 5 = 3\" är korrekt)" #: ../libqalculate/BuiltinFunctions.cc:6386 #, c-format msgid "The comparison is true for all %s (with current assumptions)." msgstr "Jämförelsen är sann för alla %s (med nuvarande antaganden)." #: ../libqalculate/BuiltinFunctions.cc:6390 msgid "No possible solution was found (with current assumptions)." msgstr "Ingen möjlig lösning funnen (med nuvarande antaganden)." #: ../libqalculate/BuiltinFunctions.cc:6394 #, c-format msgid "Was unable to completely isolate %s." msgstr "Kunde inte isolera %s fullständigt." #: ../libqalculate/BuiltinFunctions.cc:6398 #: ../libqalculate/BuiltinFunctions.cc:6566 #: ../libqalculate/BuiltinFunctions.cc:6661 #, c-format msgid "The comparison is true for all %s if %s." msgstr "Jämförelsen är sann för alla %s om %s." #: ../libqalculate/BuiltinFunctions.cc:6402 #, c-format msgid "Was unable to isolate %s." msgstr "Kunde inte isolera %s." #: ../libqalculate/BuiltinFunctions.cc:6525 #: ../libqalculate/BuiltinFunctions.cc:6552 #: ../libqalculate/BuiltinFunctions.cc:6635 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed sign was " "therefor temporarily set as unknown." msgstr "" "Kunde inte isolera %s med nuvarande antaganden. Antaget tecken sattes därför " "temporärt till okänt." #: ../libqalculate/BuiltinFunctions.cc:6528 #: ../libqalculate/BuiltinFunctions.cc:6555 #: ../libqalculate/BuiltinFunctions.cc:6638 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed type and " "sign was therefor temporarily set as unknown." msgstr "" "Kunde inte isolera %s med nuvarande antaganden. Antagen typ sattes därför " "temporärt till okänd." #: ../libqalculate/BuiltinFunctions.cc:6561 #: ../libqalculate/BuiltinFunctions.cc:6646 #, c-format msgid "The solution requires that %s." msgstr "Lösningen kräver att %s." #: ../libqalculate/BuiltinFunctions.cc:6654 #, c-format msgid "Solution %s requires that %s." msgstr "Lösning %s kräver att %s." #: ../libqalculate/BuiltinFunctions.cc:6726 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "so that each equation at least contains the corresponding variable (if " "automatic reordering failed)." msgstr "" "Kan inte isolera %s.\n" "\n" "Du behöver kanske placera ekvationerna och variablerna i lämplig ordning sÃ¥ " "att varje ekvation Ã¥tminstone innehÃ¥ller motsvarande variabel (om automatisk " "omsortering misslyckades)." #: ../libqalculate/BuiltinFunctions.cc:6728 #: ../libqalculate/BuiltinFunctions.cc:6742 #: ../libqalculate/BuiltinFunctions.cc:6751 #, c-format msgid "Unable to isolate %s." msgstr "Kan inte isolera %s." #: ../libqalculate/BuiltinFunctions.cc:6735 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "Olikheter är inte tillÃ¥tna i %s()." #: ../libqalculate/BuiltinFunctions.cc:7078 #: ../libqalculate/BuiltinFunctions.cc:7083 msgid "No differential equation found." msgstr "Ingen differentialekvation funnen." #: ../libqalculate/BuiltinFunctions.cc:7087 #: ../libqalculate/BuiltinFunctions.cc:7116 #: ../libqalculate/BuiltinFunctions.cc:7122 msgid "Unable to solve differential equation." msgstr "Kunde inte lösa differentialekvation." #: ../libqalculate/BuiltinFunctions.cc:7148 msgid "Unable to find limit." msgstr "Kan inte hitta gränsvärdet." #: ../libqalculate/BuiltinFunctions.cc:7195 #: ../libqalculate/BuiltinFunctions.cc:7209 msgid "Matrix" msgstr "Matris" #: ../libqalculate/BuiltinFunctions.cc:7220 #: ../libqalculate/BuiltinFunctions.cc:7273 msgid "Vector" msgstr "Vektor" #: ../libqalculate/BuiltinFunctions.cc:7235 #: ../libqalculate/BuiltinFunctions.cc:7284 ../libqalculate/Calculator.cc:10566 msgid "Unable to generate plot data with current min, max and step size." msgstr "Kunde inte generera diagramdata med angivet min, max och stegstorlek." #: ../libqalculate/BuiltinFunctions.cc:7237 #: ../libqalculate/BuiltinFunctions.cc:7286 msgid "Sampling rate must be a positive integer." msgstr "Frekvens mÃ¥ste vara ett positivt heltal." #: ../libqalculate/BuiltinFunctions.cc:7246 #: ../libqalculate/BuiltinFunctions.cc:7295 ../libqalculate/Calculator.cc:10533 msgid "Unable to generate plot data with current min, max and sampling rate." msgstr "Kunde inte generera diagramdata med angivet min, max och frekvens." #: ../libqalculate/Calculator.cc:390 msgid "per" msgstr "per" #: ../libqalculate/Calculator.cc:392 msgid "times" msgstr "gÃ¥nger" #: ../libqalculate/Calculator.cc:394 msgid "plus" msgstr "plus" #: ../libqalculate/Calculator.cc:396 msgid "minus" msgstr "minus" #: ../libqalculate/Calculator.cc:398 ../libqalculate/MathStructure.cc:18761 #: ../libqalculate/Function.cc:1223 ../libqalculate/Function.cc:1231 #: ../libqalculate/Function.cc:1660 ../libqalculate/Function.cc:1822 #: ../libqalculate/Function.cc:1830 msgid "and" msgstr "och" #: ../libqalculate/Calculator.cc:402 ../libqalculate/DataSet.cc:1046 #: ../libqalculate/DataSet.cc:1109 ../libqalculate/MathStructure.cc:18776 #: ../libqalculate/Function.cc:2161 ../libqalculate/Function.cc:2177 msgid "or" msgstr "eller" #: ../libqalculate/Calculator.cc:449 ../libqalculate/Calculator.cc:1240 #: ../libqalculate/Calculator.cc:2622 ../libqalculate/Calculator.cc:2629 #: ../libqalculate/Calculator.cc:2630 msgid " to " msgstr " till " #: ../libqalculate/Calculator.cc:535 msgid "Gradians unit is missing. Creating one for this session." msgstr "Gradientenheten saknas. Skapar en för nuvarande session." #: ../libqalculate/Calculator.cc:536 ../libqalculate/Calculator.cc:544 #: ../libqalculate/Calculator.cc:552 msgid "Angle/Plane Angle" msgstr "Vinkel/Planvinkel" #: ../libqalculate/Calculator.cc:543 msgid "Radians unit is missing. Creating one for this session." msgstr "Radianenheten saknas. Skapar en för nuvarande session." #: ../libqalculate/Calculator.cc:551 msgid "Degrees unit is missing. Creating one for this session." msgstr "Gradenheten saknas. Skapar en för nuvarande session." #: ../libqalculate/Calculator.cc:1631 ../libqalculate/Calculator.cc:1632 #: ../libqalculate/Calculator.cc:10080 ../libqalculate/Calculator.cc:10217 #: ../libqalculate/Calculator.cc:10275 msgid "Currency" msgstr "Valuta" #: ../libqalculate/Calculator.cc:1818 msgid "" "The calculation has been forcibly terminated. Please restart the application " "and report this as a bug." msgstr "" "Beräkningen har avslutats med tvÃ¥ng. Vänligen starta om programmet och " "rapportera detta som en bug." #: ../libqalculate/Calculator.cc:2094 ../libqalculate/Calculator.cc:2219 msgid "Stack is empty. Filling remaining function arguments with zeroes." msgstr "RPN-stacken är tom. Fyller Ã¥terstÃ¥ende funktionsparametrar med nollor." #: ../libqalculate/Calculator.cc:2573 msgid "calculating..." msgstr "beräknar..." #: ../libqalculate/Calculator.cc:4191 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or " "the variable will be lost." msgstr "" "\"%s\" tillÃ¥ts inte längre i namn. Vänligen ändra namnet pÃ¥ \"%s\". Annars " "kommer variabeln att gÃ¥ förlorad." #: ../libqalculate/Calculator.cc:4209 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the function will be lost." msgstr "" "\"%s\" tillÃ¥ts inte längre i namn. Vänligen ändra namnet pÃ¥ \"%s\". Annars " "kommer funktionen att gÃ¥ förlorad." #: ../libqalculate/Calculator.cc:4226 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the unit will be lost." msgstr "" "\"%s\" tillÃ¥ts inte längre i namn. Vänligen ändra namnet pÃ¥ \"%s\". Annars " "kommer enheten att gÃ¥ förlorad." #: ../libqalculate/Calculator.cc:5589 ../libqalculate/Calculator.cc:6546 #: ../libqalculate/Calculator.cc:6553 ../libqalculate/Calculator.cc:6574 #: ../libqalculate/Calculator.cc:6595 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "Malplacerad(e) \"%s\" ignorerades" #: ../libqalculate/Calculator.cc:5630 ../libqalculate/Calculator.cc:6614 #, c-format msgid "Misplaced '%c' ignored" msgstr "Malplacerat '%c' ignorerades" #: ../libqalculate/Calculator.cc:5662 ../libqalculate/Function.cc:1381 #: ../libqalculate/Function.cc:1412 #, c-format msgid "Internal id %s does not exist." msgstr "Internt id %s finns inte." #: ../libqalculate/Calculator.cc:5680 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\" motsvarar inte nÃ¥gon giltig variabel/funktion/enhet." #: ../libqalculate/Calculator.cc:5695 #, c-format msgid "" "Trailing characters \"%s\" (not a valid variable/function/unit) in number " "\"%s\" was ignored." msgstr "" "Överblivna tecken i uttrycket \"%s\" (inte nÃ¥gon giltig variabel/funktion/" "enhet) ignorerades i talet \"%s\"." #: ../libqalculate/Calculator.cc:6153 msgid "RPN syntax error. Values left at the end of the RPN expression." msgstr "RPN syntaxfel. Värden kvar i slutet av RPN uttryck." #: ../libqalculate/Calculator.cc:6156 msgid "Unused stack values." msgstr "Oanvända stackvärden." #: ../libqalculate/Calculator.cc:6195 ../libqalculate/Calculator.cc:6263 #, c-format msgid "RPN syntax error. Operator '%c' not supported." msgstr "RPN syntaxfel. Operator '%c' stöds ej." #: ../libqalculate/Calculator.cc:6223 msgid "RPN syntax error. Stack is empty." msgstr "RPN syntaxfel. Stacken är tom." #: ../libqalculate/Calculator.cc:6225 msgid "RPN syntax error. Operator ignored as there where only one stack value." msgstr "" "RPN syntaxfel. Operatorn ignorerades eftersom det enbart fanns ett " "stackvärde kvar." #: ../libqalculate/Calculator.cc:6855 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "Namnet \"%s\" är upptaget. Ändrar till \"%s\"." #: ../libqalculate/Calculator.cc:7541 ../libqalculate/DataSet.cc:529 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "Filen identifierades inte som en Qalculate! definitionsfil: %s." #: ../libqalculate/Calculator.cc:9581 ../libqalculate/DataSet.cc:353 msgid "Object" msgstr "Objekt" #: ../libqalculate/Calculator.cc:9590 ../libqalculate/DataSet.cc:354 msgid "Property" msgstr "Egenskap" #: ../libqalculate/Calculator.cc:9889 msgid "column" msgstr "kolumn" #: ../libqalculate/Calculator.cc:9892 msgid "Column " msgstr "Kolumn" #: ../libqalculate/Calculator.cc:9968 ../libqalculate/Calculator.cc:10015 msgid "timed out" msgstr "tiden rann ut" #: ../libqalculate/Calculator.cc:10387 ../libqalculate/Calculator.cc:10388 #: ../libqalculate/Calculator.cc:10392 ../libqalculate/Calculator.cc:10395 #: ../libqalculate/Calculator.cc:10427 ../libqalculate/Calculator.cc:10428 #: ../libqalculate/Calculator.cc:10431 ../libqalculate/Calculator.cc:10450 #: ../libqalculate/Calculator.cc:10451 ../libqalculate/Calculator.cc:10454 #, c-format msgid "Failed to download exchange rates from %s: %s." msgstr "Misslyckades med att ladda ner växelkurser frÃ¥n %s: %s." #: ../libqalculate/Calculator.cc:10529 ../libqalculate/Calculator.cc:10562 #: ../libqalculate/Calculator.cc:10595 ../libqalculate/Calculator.cc:10934 msgid "It took too long to generate the plot data." msgstr "Det tog för lÃ¥ng tid att generara data till diagrammet." #: ../libqalculate/Calculator.cc:10629 msgid "No extension in file name. Saving as PNG image." msgstr "Inget tillägg i filnamnet. Sparar som PNG-bild." #: ../libqalculate/Calculator.cc:10648 msgid "Unknown extension in file name. Saving as PNG image." msgstr "Okänt tillägg i filnamnet. Sparar som PNG-bild." #: ../libqalculate/Calculator.cc:10865 #, c-format msgid "Could not create temporary file %s" msgstr "Kunde inte skapa temporär fil %s" #: ../libqalculate/Calculator.cc:10981 msgid "" "Failed to invoke gnuplot. Make sure that you have gnuplot installed in your " "path." msgstr "" "Misslyckades med att aktivera gnuplot. Se till att du har gnuplot " "installerat i sökvägen för program." #: ../libqalculate/DataSet.cc:379 #, c-format msgid "Object %s not available in data set." msgstr "Okjektet %s finns inte i dataset." #: ../libqalculate/DataSet.cc:389 #, c-format msgid "Property %s not available in data set." msgstr "Egenskap %s är inte tillgänglig i dataset." #: ../libqalculate/DataSet.cc:394 #, c-format msgid "Property %s not defined for object %s." msgstr "Egenskap %s inte definierad för objekt %s." #: ../libqalculate/DataSet.cc:507 ../libqalculate/DataSet.cc:515 #, c-format msgid "Unable to load data objects in %s." msgstr "Kunde inhämte dataobjekt i %s." #: ../libqalculate/DataSet.cc:1016 msgid "data property" msgstr "dataegenskap" #: ../libqalculate/DataSet.cc:1018 msgid "name of a data property" msgstr "namn pÃ¥ dataegenskap" #: ../libqalculate/DataSet.cc:1026 ../libqalculate/DataSet.cc:1042 msgid "no properties available" msgstr "inga egenskaper tillgängliga" #: ../libqalculate/DataSet.cc:1076 #, c-format msgid "" "Data set \"%s\" has no object key that supports the provided argument type." msgstr "" "Dataset \"%s\" har ingen objektnyckel som stödjer tillhandahÃ¥llen argumenttyp" #: ../libqalculate/DataSet.cc:1081 msgid "data object" msgstr "dataobjekt" #: ../libqalculate/DataSet.cc:1083 msgid "an object from" msgstr "ett objekt frÃ¥n" #: ../libqalculate/DataSet.cc:1112 msgid "use" msgstr "använd" #: ../libqalculate/MathStructure.cc:174 #, c-format msgid "Required assumption: %s." msgstr "Nödvändigt antagande: %s." #: ../libqalculate/MathStructure.cc:3792 ../libqalculate/MathStructure.cc:3813 #, c-format msgid "" "The second matrix must have as many rows (was %s) as the first has columns " "(was %s) for matrix multiplication." msgstr "" "Den andra matrisen mÃ¥ste ha lika mÃ¥nga rader (var %s) som den första har " "kolumner (var %s) för matrismultiplikation." #: ../libqalculate/MathStructure.cc:8265 ../libqalculate/MathStructure.cc:8306 #: ../libqalculate/MathStructure.cc:8339 ../libqalculate/MathStructure.cc:8406 #: ../libqalculate/MathStructure.cc:8434 ../libqalculate/MathStructure.cc:8453 #: ../libqalculate/MathStructure.cc:8472 ../libqalculate/MathStructure.cc:8491 #: ../libqalculate/MathStructure.cc:8600 ../libqalculate/MathStructure.cc:14408 #: ../libqalculate/MathStructure.cc:14684 msgid "This is a bug. Please report it." msgstr "Detta är en bug. Var vänlig rapportera felet." #: ../libqalculate/MathStructure.cc:10980 #: ../libqalculate/MathStructure.cc:10985 #, c-format msgid "Limit for %s determined graphically." msgstr "Gränsvärde för %s bestämt grafiskt." #: ../libqalculate/MathStructure.cc:11792 msgid "Interval potentially calculated wide." msgstr "Intervall potentiellt beräknat brett." #: ../libqalculate/MathStructure.cc:16085 msgid "" "Because of time constraints only a limited number of combinations of terms " "were tried during factorization. Repeat factorization to try other random " "combinations." msgstr "" "PÃ¥ grund av tidsbegränsningar prövades enbart en begränsat antal " "kombinationer av termer under faktorisering. Uprepa faktoriseringen för att " "pröva andra slumpmässiga kombinationer." #: ../libqalculate/MathStructure.cc:18860 msgid "undefined" msgstr "odefinierad" #: ../libqalculate/MathStructure.cc:18901 #, c-format msgid "Unsolvable comparison at element %s when trying to rank vector." msgstr "Olöslig jämförelse vid element %s, vid rangordning av vektor." #: ../libqalculate/MathStructure.cc:18951 #, c-format msgid "Unsolvable comparison at element %s when trying to sort vector." msgstr "Olöslig jämförelse vid element %s, vid sortering av vektor." #: ../libqalculate/MathStructure.cc:19376 msgid "The determinant can only be calculated for square matrices." msgstr "Determinanten kan enbart beräknas för kvadratiska matriser." #: ../libqalculate/MathStructure.cc:19439 msgid "The permanent can only be calculated for square matrices." msgstr "Permanenten kan enbart beräknas för kvadratiska matriser." #: ../libqalculate/MathStructure.cc:19528 msgid "Inverse of singular matrix." msgstr "Invers av singulär matrs." #: ../libqalculate/MathStructure.cc:19875 msgid "" "Calculations involving conversion of units without proportional linear " "relationship (e.g. with multiple temperature units), might give unexpected " "results and is not recommended." msgstr "" "Beräkningar som involverar omvandling av enheter utan proportionella " "linjära förhÃ¥llanden (t.ex. med flera olika temperaturenheter), kan ge " "oförutsedda svar och rekommenderas ej." #: ../libqalculate/MathStructure.cc:20745 #: ../libqalculate/MathStructure.cc:20788 msgid "Too many data points" msgstr "För mÃ¥nga datapunkter" #: ../libqalculate/MathStructure.cc:20752 msgid "" "The selected min and max do not result in a positive, finite number of data " "points" msgstr "" "Valt min och max resulterar inte i ett positive, ändligt antal datapunkter" #: ../libqalculate/MathStructure.cc:20785 msgid "" "The selected min, max and step size do not result in a positive, finite " "number of data points" msgstr "" "Valt min, max och stegstorlek resulterar inte i ett positive, ändligt antal " "datapunkter" #: ../libqalculate/MathStructure.cc:27312 #: ../libqalculate/MathStructure.cc:27488 #: ../libqalculate/MathStructure.cc:28117 #: ../libqalculate/MathStructure.cc:28625 #: ../libqalculate/MathStructure.cc:28682 #: ../libqalculate/MathStructure.cc:28724 #: ../libqalculate/MathStructure.cc:28737 #: ../libqalculate/MathStructure.cc:28787 #: ../libqalculate/MathStructure.cc:28906 #: ../libqalculate/MathStructure.cc:29041 #, c-format msgid "Interval arithmetic was disabled during calculation of %s." msgstr "Intervallarithmetik inaktiverades under beräkning av %s." #: ../libqalculate/MathStructure.cc:29040 #, c-format msgid "Not all complex roots were calculated for %s." msgstr "Alla komplexa rötter beräknades ej för %s." #: ../libqalculate/MathStructure.cc:30450 #, c-format msgid "Only one or two of the roots where calculated for %s." msgstr "Enbart en eller tvÃ¥ av rötterna beräknades för %s." #: ../libqalculate/Function.cc:165 #, c-format msgid "%s() requires that %s" msgstr "%s() kräver att %s" #: ../libqalculate/Function.cc:320 ../libqalculate/Function.cc:379 #: ../libqalculate/Function.cc:439 #, c-format msgid "" "Additional arguments for function %s() was ignored. Function can only use %s " "argument(s)." msgstr "" "Övertaliga parametrar för funktionen %s() ignorerades. Funktionen kan inte " "använda fler än %s parametrar." #: ../libqalculate/Function.cc:460 #, c-format msgid "You need at least %s argument(s) (%s) in function %s()." msgstr "Det krävs minst %s parametrar (%s) i funktionen %s()." #: ../libqalculate/Function.cc:462 #, c-format msgid "You need at least %s argument(s) in function %s()." msgstr "Det krävs minst %s parametrar i funktionen %s()." #: ../libqalculate/Function.cc:1213 msgid "a free value" msgstr "ett valfritt värde" #: ../libqalculate/Function.cc:1218 msgid "that is nonzero" msgstr "som är icke-noll" #: ../libqalculate/Function.cc:1226 msgid "that is rational (polynomial)" msgstr "som är rationellt (polynom)" #: ../libqalculate/Function.cc:1234 msgid "that fulfills the condition:" msgstr "som uppfyller villkoret:" #: ../libqalculate/Function.cc:1237 msgid "Argument" msgstr "Parameter" #: ../libqalculate/Function.cc:1301 #, c-format msgid "Argument %s in %s() must be %s." msgstr "Parameter %s i %s() mÃ¥ste vara %s." #: ../libqalculate/Function.cc:1303 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "Parameter %s, %s, i %s() mÃ¥ste vara %s." #: ../libqalculate/Function.cc:1641 msgid "a rational number" msgstr "ett rationellt nummer" #: ../libqalculate/Function.cc:1643 msgid "a number" msgstr "ett nummer" #: ../libqalculate/Function.cc:1645 msgid "a real number" msgstr "ett reellt nummer" #: ../libqalculate/Function.cc:1650 ../libqalculate/Function.cc:1803 #: ../libqalculate/Function.cc:1808 msgid ">=" msgstr ">=" #: ../libqalculate/Function.cc:1652 msgid ">" msgstr ">" #: ../libqalculate/Function.cc:1664 ../libqalculate/Function.cc:1825 #: ../libqalculate/Function.cc:1832 msgid "<=" msgstr "<=" #: ../libqalculate/Function.cc:1666 msgid "<" msgstr "<" #: ../libqalculate/Function.cc:1800 msgid "an integer" msgstr "ett heltal" #: ../libqalculate/Function.cc:1857 msgid "symbol" msgstr "symbol" #: ../libqalculate/Function.cc:1858 msgid "an unknown variable/symbol" msgstr "en okänd variabel/symbol" #: ../libqalculate/Function.cc:1871 msgid "text" msgstr "text" #: ../libqalculate/Function.cc:1872 msgid "a text string" msgstr "en textsträng" #: ../libqalculate/Function.cc:1894 msgid "date" msgstr "datum" #: ../libqalculate/Function.cc:1895 msgid "a date" msgstr "ett datum" #: ../libqalculate/Function.cc:1944 msgid "a vector with " msgstr "en vektor med " #: ../libqalculate/Function.cc:1956 msgid "a vector" msgstr "en vektor" #: ../libqalculate/Function.cc:2005 msgid "a square matrix" msgstr "en kvadratisk matris" #: ../libqalculate/Function.cc:2007 msgid "a matrix" msgstr "en matris" #: ../libqalculate/Function.cc:2022 msgid "object" msgstr "objekt" #: ../libqalculate/Function.cc:2023 msgid "a valid function, unit or variable name" msgstr "ett giltigt funktions, enhets eller variabelnamn" #: ../libqalculate/Function.cc:2037 msgid "a valid function name" msgstr "ett giltigt funktionsnamn" #: ../libqalculate/Function.cc:2050 msgid "unit" msgstr "enhet" #: ../libqalculate/Function.cc:2051 msgid "a valid unit name" msgstr "ett giltigt enhetsnamn" #: ../libqalculate/Function.cc:2065 msgid "a valid variable name" msgstr "ett giltigt variabelnamn" #: ../libqalculate/Function.cc:2078 msgid "file" msgstr "fil" #: ../libqalculate/Function.cc:2079 msgid "a valid file name" msgstr "ett giltigt filnamn" #: ../libqalculate/Function.cc:2092 msgid "boolean" msgstr "boolskt värde" #: ../libqalculate/Function.cc:2093 msgid "a boolean (0 or 1)" msgstr "ett boolskt värde (0 eller 1)" #: ../libqalculate/Function.cc:2103 msgid "angle" msgstr "vinkel" #: ../libqalculate/Function.cc:2104 msgid "an angle or a number (using the default angle unit)" msgstr "en vinkel eller ett tal (som använder inställd vinkelenhet)" #: ../libqalculate/Number.cc:235 ../libqalculate/Number.cc:6709 msgid "" "Cannot display numbers greater than 9999 or less than -9999 as roman " "numerals." msgstr "" "Kan inte visa tal större än 9999 eller mindre än -9999 som romerska siffror." #: ../libqalculate/Number.cc:348 msgid "" "Assuming the unusual practice of letting a last capital I mean 2 in a roman " "numeral." msgstr "Antar att ett sista stort I avses betyda 2." #: ../libqalculate/Number.cc:426 #, c-format msgid "Error in roman numerals: %s." msgstr "Fel i romerska siffor: \"%s\"." #: ../libqalculate/Number.cc:461 #, c-format msgid "Unknown roman numeral: %c." msgstr "Okänd romersk siffra: %c." #: ../libqalculate/Number.cc:519 #, c-format msgid "" "Errors in roman numerals: \"%s\". Interpreted as %s, which should be written " "as %s." msgstr "" "Fel i romerska siffor: \"%s\". Tolkat som %s, vilket borde skrivits %s." #: ../libqalculate/Number.cc:601 msgid "Too large exponent." msgstr "För stor exponent." #: ../libqalculate/Number.cc:630 msgid "':' in decimal number ignored (decimal point detected)." msgstr "':' i decimalt tal ignorerades (decimalkomma upptäckt)." #: ../libqalculate/Number.cc:660 #, c-format msgid "Character '%c' was ignored in the number \"%s\" with base %s." msgstr "Tecken '%c' ignorerades i numret \"%s\" med bas %s" #: ../libqalculate/Number.cc:1649 ../libqalculate/Number.cc:1771 msgid "Floating point underflow" msgstr "Flyttalsbottning" #: ../libqalculate/Number.cc:1650 ../libqalculate/Number.cc:1772 msgid "Floating point overflow" msgstr "Flyttalsspill" #: ../libqalculate/Number.cc:1651 ../libqalculate/Number.cc:1773 msgid "Floating point division by zero exception" msgstr "Flyttalsundantag: division med noll" #: ../libqalculate/Number.cc:1652 ../libqalculate/Number.cc:1776 msgid "Floating point not a number exception" msgstr "Flyttalsundantag: inte ett tal" #: ../libqalculate/Number.cc:1653 ../libqalculate/Number.cc:1774 msgid "Floating point range exception" msgstr "FlyttalsomfÃ¥ngsundantag" #: ../libqalculate/Number.cc:3222 msgid "Division by zero." msgstr "Division med noll." #. 0^0 #: ../libqalculate/Number.cc:3228 msgid "0^0 might be considered undefined" msgstr "0^0 kan anses vara odefinierat" #: ../libqalculate/Number.cc:3235 msgid "The result of 0^i is possibly undefined" msgstr "Resulatatet av 0^i är möjligen odefinierat" #: ../libqalculate/Number.cc:3284 ../libqalculate/Number.cc:4985 #: ../libqalculate/Number.cc:5096 ../libqalculate/Number.cc:5425 #: ../libqalculate/Number.cc:5433 ../libqalculate/Number.cc:5466 #: ../libqalculate/Number.cc:5563 ../libqalculate/Number.cc:5712 #: ../libqalculate/Number.cc:5824 msgid "Interval calculated wide." msgstr "Intervall beräknat brett." #: ../libqalculate/Number.cc:4542 msgid "Cannot handle an argument (s) that large for Riemann Zeta." msgstr "" "Kan inte hantera ett sÃ¥ stort tal för parametern (s) till Riemann Zeta." #: ../libqalculate/Number.cc:4617 ../libqalculate/Number.cc:4715 #: ../libqalculate/Number.cc:4746 ../libqalculate/Number.cc:4777 #: ../libqalculate/Number.cc:6169 #, c-format msgid "%s() lacks proper support interval arithmetic." msgstr "%s() saknar adekvat stöd för intervallaritmetik." #: ../libqalculate/Number.cc:6706 msgid "Can only display rational numbers as roman numerals." msgstr "Kan enbert visa rationella tal som romerska siffror." #: ../libqalculate/Number.cc:7095 ../libqalculate/Number.cc:7103 msgid "infinity" msgstr "oändlighet" #: ../libqalculate/QalculateDateTime.cc:25 msgid "January" msgstr "Januari" #: ../libqalculate/QalculateDateTime.cc:25 msgid "February" msgstr "Februari" #: ../libqalculate/QalculateDateTime.cc:25 msgid "March" msgstr "Mars" #: ../libqalculate/QalculateDateTime.cc:25 msgid "April" msgstr "April" #: ../libqalculate/QalculateDateTime.cc:25 msgid "May" msgstr "Maj" #: ../libqalculate/QalculateDateTime.cc:25 msgid "June" msgstr "Juni" #: ../libqalculate/QalculateDateTime.cc:25 msgid "July" msgstr "Juli" #: ../libqalculate/QalculateDateTime.cc:25 msgid "August" msgstr "augusti" #: ../libqalculate/QalculateDateTime.cc:25 msgid "September" msgstr "September" #: ../libqalculate/QalculateDateTime.cc:25 msgid "October" msgstr "Oktober" #: ../libqalculate/QalculateDateTime.cc:25 msgid "November" msgstr "November" #: ../libqalculate/QalculateDateTime.cc:25 msgid "December" msgstr "December" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Thout" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paopi" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Hathor" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Koiak" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Tobi" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Meshir" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paremhat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Parmouti" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Pashons" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paoni" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Epip" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Mesori" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Pi Kogi Enavot" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Mäskäräm" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "ṬəqÉ™mt" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ḫədar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "TaḫśaÅ›" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ṭərr" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Yäkatit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Mägabit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Miyazya" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "GÉ™nbo" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Säne" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ḥamle" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Nähase" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "á¹–agume" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Muḥarram" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "á¹¢afar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rabī‘ al-awwal" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rabī‘ ath-thÄnÄ«" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "JumÄdá al-Å«lá" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "JumÄdá al-Äkhirah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rajab" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Sha‘bÄn" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Ramaá¸Än" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "ShawwÄl" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "DhÅ« al-Qa‘dah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "DhÅ« al-Ḥijjah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Farvardin" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Ordibehesht" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Khordad" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Tir" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Mordad" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Shahrivar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Mehr" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Aban" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Azar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Dey" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Bahman" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Esfand" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Chaitra" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "VaishÄkha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "JyÄ“shtha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Ä€shÄdha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "ShrÄvana" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Bhaadra" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Ä€shwin" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "KÄrtika" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Agrahayana" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Pausha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "MÄgha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Phalguna" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Wood" msgstr "Trä" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Fire" msgstr "Eld" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Earth" msgstr "Jord" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Metal" msgstr "Metall" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Water" msgstr "Vatten" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rat" msgstr "RÃ¥tta" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Ox" msgstr "Oxe" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Tiger" msgstr "Tiger" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rabbit" msgstr "Kanin" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Dragon" msgstr "Drake" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Snake" msgstr "Orm" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Horse" msgstr "Häst" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Goat" msgstr "FÃ¥r" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Monkey" msgstr "Apa" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rooster" msgstr "Tupp" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Dog" msgstr "Hund" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Pig" msgstr "Gris" #: ../libqalculate/QalculateDateTime.cc:345 msgid "now" msgstr "nu" #: ../libqalculate/QalculateDateTime.cc:349 msgid "today" msgstr "idag" #: ../libqalculate/QalculateDateTime.cc:353 msgid "tomorrow" msgstr "imorgon" #: ../libqalculate/QalculateDateTime.cc:358 msgid "yesterday" msgstr "igÃ¥r" #: ../libqalculate/QalculateDateTime.cc:2599 msgid "leap month" msgstr "skottmÃ¥nad" #: ../libqalculate/Unit.cc:908 msgid "Error(s) in unitexpression." msgstr "Fel i enhetsuttryck." #: ../libqalculate/Variable.cc:456 #, c-format msgid "Recursive variable: %s = %s" msgstr "Rekursiv variabel: %s = %s" #: ../libqalculate/util.cc:175 msgid "Yes" msgstr "Ja" #: ../libqalculate/util.cc:176 msgid "No" msgstr "Nej" #: ../libqalculate/util.cc:183 msgid "True" msgstr "Sant" #: ../libqalculate/util.cc:184 msgid "False" msgstr "Falskt" #: ../libqalculate/util.cc:191 msgid "On" msgstr "PÃ¥" #: ../libqalculate/util.cc:192 msgid "Off" msgstr "Av" #~ msgid "exp mode" #~ msgstr "exp-läge" #~ msgid "Some options have additional help text (e.g. help parsing mode)." #~ msgstr "" #~ "Visa alternativ har ytterliga hjälptext (t.ex. hjälp tolkningsläge)." #~ msgid "" #~ "Enable/disables abbreviation of unit, prefix, variable and function names " #~ "in results." #~ msgstr "" #~ "(Av)aktiverar förkortningar för enhets-, prefix-, variabel- och " #~ "funktionsnamn i resultat." #~ msgid "" #~ "Enable/disables use of interval arithmetic for approximate calculations." #~ msgstr "" #~ "(Av)aktiverar användning av intervallaritmetik för approximerade " #~ "beräkningar." #~ msgid "" #~ "Enable/disables the RPN stack (indepent of RPN syntax in expression)." #~ msgstr "(Av)aktiverar" #~ msgid "Enable/disables inclusion of units in physical constants." #~ msgstr "(Av)aktiverar" #~ msgid "No help available for %s." #~ msgstr "Ingen hjärp finns tillgänglig för %s." #~ msgid "The current value is marked with '*'." #~ msgstr "Det nuvarande värdet är markerat med '*'." #~ msgid "" #~ "Argument for %s() must be a real number greater than or equal to -1/e." #~ msgstr "" #~ "Parameter för %s() mÃ¥ste vara reellt tal större eller lika med -1/e." #~ msgid "Only real solutions were calculated for %s." #~ msgstr "Enbart reela lösningar beräknades för %s." #~ msgid "" #~ "Enables/disables use of interval arithmetic to determine the precision of " #~ "the result." #~ msgstr "" #~ "(Av)aktiverar användning av intervallaritmetik för att avgöra precisionen " #~ "i resultat." #~ msgid "negatve" #~ msgstr "negativ" #~ msgid "sex" #~ msgstr "sex" #, fuzzy #~ msgid "binary twos" #~ msgstr "binär" #~ msgid "Interval calculated wide" #~ msgstr "Intervall beräknat brett" #~ msgid "- a unit-like variable (e.g. c)" #~ msgstr "- en enhets-liknande variabel (t.ex. c)" #~ msgid "dot as separator" #~ msgstr "punkt som avgränsare" #~ msgid "comma as separator" #~ msgstr "komma som avgränsare" #~ msgid "Error in date format for function %s()." #~ msgstr "Felaktigt datumformat för %s()." #~ msgid "" #~ "Both the lower and upper limit must be set to get the definite integral." #~ msgstr "BÃ¥de nedre och övre gräns mÃ¥ste anges för definitiva integraler." #~ msgid "" #~ "The %s function is incomplete, unreliable and unstable. Use at your own " #~ "risk and avoid complex expressions." #~ msgstr "" #~ "Funktionen %s är ofullständig, inte tillförlitlig och instabil. Använd pÃ¥ " #~ "egen risk och undvik komplexa uttryck." #~ msgid "Can only handle Riemann Zeta with an integer argument (s) >= 1" #~ msgstr "Kan enbart hantera Riemann Zeta med en heltalsparameter (s) >= 1" #~ msgid "indicate infinite series" #~ msgstr "indikera oändliga talserier" #~ msgid "hybrid" #~ msgstr "hybrid" #~ msgid "" #~ "Series %s contains non-numerical data (\"%s\" first of %s) which can not " #~ "be properly plotted." #~ msgstr "" #~ "Dataserie %s innehÃ¥ller värden som inte är numeriska (\"%s\" först av %s) " #~ "och inte kan visas korrekt." #~ msgid "" #~ "Series %s contains non-real data (\"%s\" first of %s) which can not be " #~ "properly plotted." #~ msgstr "" #~ "Dataserie %s innehÃ¥ller värden som inte är reella (\"%s\" först av %s) " #~ "och inte kan visas korrekt." #~ msgid "Failed to download exchange rates from ECB: %s" #~ msgstr "Misslyckades med att ladda ner växelkurser frÃ¥n ECB." #, fuzzy #~ msgid "Failed to download exchange rates from mycurrency.net: %s" #~ msgstr "Misslyckades med att ladda ner växelkurser frÃ¥n ECB." #~ msgid "real roots" #~ msgstr "reella rötter" #~ msgid "%s() does at the moment only support integers and fractions of two." #~ msgstr "%s() har för närvarande enbart stöd för heltal och halvtal." #~ msgid "An global unit or variable with the same name already exists." #~ msgstr "En systemvid enhet eller variabel med samma namn finns redan." #~ msgid "" #~ "You need the download exchange rates to be able to convert between " #~ "different currencies.\n" #~ "You can later get current exchange rates with the \"exrates\" command.\n" #~ "Do you want to fetch exchange rates now from the Internet (default: yes)?" #~ msgstr "" #~ "Du behöver ladda ner växelkurser för att kunna omvandla mellan olika " #~ "valutor.\n" #~ "Du kan senare hämta nuvarande växelkurser med \"växelkurser\"-kommandot\n" #~ "Vill du hämta växelkurser frÃ¥n Internet nu (förvalt: ja)?" #~ msgid "WGET ARGUMENTS" #~ msgstr "WGET ARGUMENT" #~ msgid "The timestamp value for the date %s is too large or small for %s()." #~ msgstr "" #~ "\"Timestamp\"-värdet för datumet %s är för stort eller litet för %s()." #~ msgid "CLN Exception: %s" #~ msgstr "CLN Exception: %s" #~ msgid "Extreme exponentiation was not calculated." #~ msgstr "Extrem potens beräknades ej." #, fuzzy #~ msgid "combination" #~ msgstr "kombinerad" #~ msgid "Temperature" #~ msgstr "Temperatur" #~ msgid "" #~ "Cannot convert to unit expression that includes degrees Celsius or " #~ "Fahrenheit in addition to other units, prefixes or exponents." #~ msgstr "" #~ "Kan inte omvandla till enhetsuttryck som inkluderar grader Celsius eller " #~ "Fahrenheit utöver andra ehnheter, prefix eller exponenter." #~ msgid "Cannot convert the expression to degrees Celsius or Fahrenheit." #~ msgstr "Kan inte omandla uttrycket till grader Celsius eller Fahrenheit." #~ msgid "ON/OFF" #~ msgstr "AV/PÃ…" #~ msgid "no variables" #~ msgstr "inga variabler" #~ msgid "no functions" #~ msgstr "inga funktioner" #~ msgid "no units" #~ msgstr "inga enheter" #~ msgid "" #~ "For a list of predefined functions, variables and units, see the " #~ "appendixes of the manual of the graphical user interface (available at " #~ "http://qalculate.github.io/manual/index.html)." #~ msgstr "" #~ "För en förteckning över fördefinierade funktioner, variabler och enheter, " #~ "se appendixen i instruktionsboken för det grafiska användargränssnittet " #~ "(tillgänglig pÃ¥ http://qalculate.github.io/manual/index.html)." #~ msgid "" #~ "It has been more than one week since the exchange rates last were updated." #~ msgstr "Det var mer än en vecka sedan växelkurserna senast updaterades." #~ msgid "implicit" #~ msgstr "implicit" #~ msgid "UNIT" #~ msgstr "ENHET" #~ msgid "best (convert best unit)" #~ msgstr "bästa (omvandla till bästa enhet)" #~ msgid "Example: convert best." #~ msgstr "Exempel: convert bästa." #~ msgid "Decimal point in sexagesimal number treated as ':'." #~ msgstr "Decimalkomma i sexagesimala tal behandlas som ':'." #~ msgid "Switches RPN mode on/off." #~ msgstr "Sätter RPN-läget av/pÃ¥." #~ msgid "Only equals comparison is allowed in the equations in %s()." #~ msgstr "Enbart lika-med-jäförelser är tillÃ¥tna i ekvationer i %s()." #~ msgid "a symmetric matrix" #~ msgstr "en symmetrisk matris" #~ msgid "Integral point for Riemann's zeta must be an integer > 1." #~ msgstr "Integralpunkten för Riemanns zeta mÃ¥ste vara ett heltal > 1." #~ msgid "Integral point for Riemann's zeta is too large." #~ msgstr "Integralpunkten för Riemanns zeta är för stor." #~ msgid "" #~ "No comparison to solve. The reason might be:\n" #~ "\n" #~ "1. The entered expression to solve is not correct (ex. \"x + 5 = 3\" is " #~ "correct)\n" #~ "\n" #~ "2. The expression evaluates FALSE. There is no valid solution with the " #~ "current assumptions (ex. \"x = -5\" with x assumed positive).\n" #~ "\n" #~ "3. The expression evaluates TRUE (ex. \"2x = 2x\")" #~ msgstr "" #~ "Ingen jämförelse att lösa. Anledningen kan vara en av:\n" #~ "\n" #~ "1. Angivet uttryck att lösa är inte korrekt (ex. \"x + 5 = 3\" är " #~ "korrekt)\n" #~ "\n" #~ "2. Uttrycket evalueras som FALSKT. Det finns ingen giltig lösning med " #~ "nuvarande antaganden (ex. \"x = -5\" med x antaget positivt).\n" #~ "\n" #~ "3. Uttryckes evalueras som SANT (ex. \"2x = 2x\")" #~ msgid "Unknowns" #~ msgstr "Okända" libqalculate-2.8.2/po/Makevars0000644000175000017500000000642113141107770013224 00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = # This tells whether or not to prepend "GNU " prefix to the package # name that gets inserted into the header of the $(DOMAIN).pot file. # Possible values are "yes", "no", or empty. If it is empty, try to # detect it automatically by scanning the files in $(top_srcdir) for # "GNU packagename" string. PACKAGE_GNU = # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = no # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = # These options get passed to msginit. # If you want to disable line wrapping when writing PO files, add # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and # MSGINIT_OPTIONS. MSGINIT_OPTIONS = # This tells whether or not to regenerate a PO file when $(DOMAIN).pot # has changed. Possible values are "yes" and "no". Set this to no if # the POT file is checked in the repository and the version control # program ignores timestamps. PO_DEPENDS_ON_POT = yes # This tells whether or not to forcibly update $(DOMAIN).pot and # regenerate PO files on "make dist". Possible values are "yes" and # "no". Set this to no if the POT file and PO files are maintained # externally. DIST_DEPENDS_ON_UPDATE_PO = yes libqalculate-2.8.2/po/Makefile.in.in0000644000175000017500000001575613401033077014212 00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # Copyright (C) 2004-2008 Rodney Dawes # # This file may be copied and used freely without restrictions. It may # be used in projects which are not available under a GNU Public License, # but which still want to provide support for the GNU gettext functionality. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize # # - Modified by Rodney Dawes for use with intltool # # We have the following line for use by intltoolize: # INTLTOOL_MAKEFILE GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ datarootdir = @datarootdir@ libdir = @libdir@ localedir = @localedir@ subdir = po install_sh = @install_sh@ # Automake >= 1.8 provides @mkdir_p@. # Until it can be supposed, use the safe fallback: mkdir_p = $(install_sh) -d INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ MSGMERGE = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist GENPOT = INTLTOOL_EXTRACT="$(INTLTOOL_EXTRACT)" XGETTEXT="$(XGETTEXT)" srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi) USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi) USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) DISTFILES = Makefile.in.in POTFILES.in $(POFILES) EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS POTFILES = \ # This comment gets stripped out CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) .SUFFIXES: .SUFFIXES: .po .pox .gmo .mo .msg .cat AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ INTLTOOL_V_MSGFMT = $(INTLTOOL__v_MSGFMT_$(V)) INTLTOOL__v_MSGFMT_= $(INTLTOOL__v_MSGFMT_$(AM_DEFAULT_VERBOSITY)) INTLTOOL__v_MSGFMT_0 = @echo " MSGFMT" $@; .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $* $(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(INTLTOOL_V_MSGFMT)$(MSGFMT) -o $@ $< .po.gmo: $(INTLTOOL_V_MSGFMT)file=`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && gencat $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(GETTEXT_PACKAGE).pot: $(POTFILES) $(GENPOT) install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $$dir; \ if test -r $$lang.gmo; then \ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \ echo "installing $(srcdir)/$$lang.gmo as" \ "$$dir/$(GETTEXT_PACKAGE).mo"; \ fi; \ if test -r $$lang.gmo.m; then \ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ if test -r $(srcdir)/$$lang.gmo.m ; then \ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \ $$dir/$(GETTEXT_PACKAGE).mo.m; \ echo "installing $(srcdir)/$$lang.gmo.m as" \ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \ else \ true; \ fi; \ fi; \ done # Empty stubs to satisfy archaic automake needs dvi info ctags tags CTAGS TAGS ID: # Define this as empty until I found a useful application. install-exec installcheck: uninstall: linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \ done check: all $(GETTEXT_PACKAGE).pot rm -f missing notexist srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m if [ -r missing -o -r notexist ]; then \ exit 1; \ fi mostlyclean: rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp rm -f .intltool-merge-cache clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES stamp-it rm -f *.mo *.msg *.cat *.cat.m *.gmo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f Makefile.in.in distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ extra_dists="$(EXTRA_DISTFILES)"; \ for file in $$extra_dists; do \ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \ done; \ for file in $$dists; do \ test -f $$file || file="$(srcdir)/$$file"; \ ln $$file $(distdir) 2> /dev/null \ || cp -p $$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ echo "$$lang:"; \ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \ if $$result; then \ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.gmo failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done Makefile POTFILES: stamp-it @if test ! -f $@; then \ rm -f stamp-it; \ $(MAKE) stamp-it; \ fi stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libqalculate-2.8.2/po/ChangeLog0000644000175000017500000000072413141107436013301 000000000000002017-08-04 gettextize * Makefile.in.in: New file, from gettext-0.19.8.1. * boldquot.sed: New file, from gettext-0.19.8.1. * en@boldquot.header: New file, from gettext-0.19.8.1. * en@quot.header: New file, from gettext-0.19.8.1. * insert-header.sin: New file, from gettext-0.19.8.1. * quot.sed: New file, from gettext-0.19.8.1. * remove-potcdate.sin: New file, from gettext-0.19.8.1. * Rules-quot: New file, from gettext-0.19.8.1. libqalculate-2.8.2/po/fr.po0000644000175000017500000026546413370501717012520 00000000000000# translation of fr.po to Français # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Nicolas Laug , 2006. msgid "" msgstr "" "Project-Id-Version: fr\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-11-07 07:18+0100\n" "PO-Revision-Date: 2006-11-08 21:13-0500\n" "Last-Translator: Nicolas Laug \n" "Language-Team: Français \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #: ../src/qalc.cc:119 ../src/qalc.cc:186 ../src/qalc.cc:3106 #: ../libqalculate/util.cc:178 msgid "yes" msgstr "oui" #: ../src/qalc.cc:120 ../src/qalc.cc:188 ../src/qalc.cc:3106 #: ../libqalculate/util.cc:179 msgid "no" msgstr "non" #: ../src/qalc.cc:121 ../libqalculate/util.cc:186 msgid "true" msgstr "vrai" #: ../src/qalc.cc:122 ../libqalculate/util.cc:187 msgid "false" msgstr "faux" #: ../src/qalc.cc:123 ../src/qalc.cc:653 ../src/qalc.cc:926 ../src/qalc.cc:958 #: ../src/qalc.cc:2560 ../src/qalc.cc:2583 ../src/qalc.cc:2628 #: ../src/qalc.cc:3105 ../src/qalc.cc:3210 ../src/qalc.cc:3231 #: ../src/qalc.cc:3263 ../libqalculate/util.cc:194 msgid "on" msgstr "marche" #: ../src/qalc.cc:124 ../src/qalc.cc:631 ../src/qalc.cc:652 ../src/qalc.cc:835 #: ../src/qalc.cc:899 ../src/qalc.cc:911 ../src/qalc.cc:924 ../src/qalc.cc:956 #: ../src/qalc.cc:2559 ../src/qalc.cc:2564 ../src/qalc.cc:2571 #: ../src/qalc.cc:2581 ../src/qalc.cc:2608 ../src/qalc.cc:2615 #: ../src/qalc.cc:2627 ../src/qalc.cc:2652 ../src/qalc.cc:3105 #: ../src/qalc.cc:3208 ../src/qalc.cc:3214 ../src/qalc.cc:3218 #: ../src/qalc.cc:3231 ../src/qalc.cc:3237 ../src/qalc.cc:3244 #: ../src/qalc.cc:3261 ../src/qalc.cc:3288 ../libqalculate/util.cc:195 msgid "off" msgstr "arrêt" #: ../src/qalc.cc:193 msgid "Please answer yes or no" msgstr "Merci de répondre oui ou non" #: ../src/qalc.cc:200 ../src/qalc.cc:590 ../src/qalc.cc:1274 #: ../src/qalc.cc:2474 ../src/qalc.cc:3051 ../src/qalc.cc:3126 #: ../src/qalc.cc:3332 msgid "unknown" msgstr "inconnue" #: ../src/qalc.cc:206 ../src/qalc.cc:584 ../src/qalc.cc:1268 #: ../src/qalc.cc:2468 ../src/qalc.cc:3045 ../src/qalc.cc:3140 #: ../src/qalc.cc:3346 msgid "real" msgstr "réel" #: ../src/qalc.cc:208 ../src/qalc.cc:586 ../src/qalc.cc:1270 #: ../src/qalc.cc:2470 ../src/qalc.cc:3047 ../src/qalc.cc:3138 #: ../src/qalc.cc:3344 ../libqalculate/Function.cc:1636 msgid "number" msgstr "nombre" #: ../src/qalc.cc:210 ../src/qalc.cc:583 ../src/qalc.cc:1267 #: ../src/qalc.cc:2467 ../src/qalc.cc:3044 ../src/qalc.cc:3142 #: ../src/qalc.cc:3348 msgid "rational" msgstr "rationnel" #: ../src/qalc.cc:212 ../src/qalc.cc:582 ../src/qalc.cc:1266 #: ../src/qalc.cc:2466 ../src/qalc.cc:3043 ../src/qalc.cc:3144 #: ../src/qalc.cc:3350 ../libqalculate/Function.cc:1797 msgid "integer" msgstr "entier" #: ../src/qalc.cc:214 ../src/qalc.cc:577 ../src/qalc.cc:1261 #: ../src/qalc.cc:2461 ../src/qalc.cc:3038 ../src/qalc.cc:3128 #: ../src/qalc.cc:3334 msgid "non-zero" msgstr "non nul" #: ../src/qalc.cc:216 ../src/qalc.cc:573 ../src/qalc.cc:1257 #: ../src/qalc.cc:2457 ../src/qalc.cc:3034 ../src/qalc.cc:3130 #: ../src/qalc.cc:3336 msgid "positive" msgstr "strictement positif" #: ../src/qalc.cc:218 ../src/qalc.cc:576 ../src/qalc.cc:1260 #: ../src/qalc.cc:2460 ../src/qalc.cc:3037 ../src/qalc.cc:3136 #: ../src/qalc.cc:3342 msgid "non-negative" msgstr "positif" #: ../src/qalc.cc:220 ../src/qalc.cc:575 ../src/qalc.cc:1259 #: ../src/qalc.cc:2459 ../src/qalc.cc:3036 ../src/qalc.cc:3132 #: ../src/qalc.cc:3338 msgid "negative" msgstr "négatif" #: ../src/qalc.cc:222 ../src/qalc.cc:574 ../src/qalc.cc:1258 #: ../src/qalc.cc:2458 ../src/qalc.cc:3035 ../src/qalc.cc:3134 #: ../src/qalc.cc:3340 msgid "non-positive" msgstr "négatif" #: ../src/qalc.cc:225 msgid "Unrecognized assumption." msgstr "Hypothèse non reconnue" #: ../src/qalc.cc:463 ../libqalculate/Calculator.cc:10482 #, fuzzy, c-format msgid "It has been %s day(s) since the exchange rates last were updated." msgstr "La dernière mise à jour des taux d'échange date de plus d'une semaine." #: ../src/qalc.cc:468 msgid "Do you wish to update the exchange rates now?" msgstr "" #: ../src/qalc.cc:482 ../src/qalc.cc:483 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "Appuyez sur Entrée pour continuer" #: ../src/qalc.cc:496 ../src/qalc.cc:497 ../src/qalc.cc:498 ../src/qalc.cc:499 #: ../src/qalc.cc:500 ../src/qalc.cc:501 ../src/qalc.cc:670 ../src/qalc.cc:673 #: ../src/qalc.cc:806 ../src/qalc.cc:817 ../src/qalc.cc:826 ../src/qalc.cc:2061 #: ../src/qalc.cc:2196 msgid "Illegal value" msgstr "Valeur illégale" #. qalc command #: ../src/qalc.cc:524 ../src/qalc.cc:771 ../src/qalc.cc:2039 #: ../src/qalc.cc:2409 ../src/qalc.cc:2415 ../src/qalc.cc:2535 #: ../src/qalc.cc:2670 ../src/qalc.cc:2704 ../src/qalc.cc:3184 #: ../src/qalc.cc:3301 ../src/qalc.cc:3454 ../src/qalc.cc:4229 #: ../src/qalc.cc:4240 ../libqalculate/Calculator.cc:2503 #: ../libqalculate/Calculator.cc:2507 msgid "base" msgstr "" #: ../src/qalc.cc:524 ../src/qalc.cc:526 ../src/qalc.cc:2636 #: ../src/qalc.cc:3273 msgid "input base" msgstr "base de la saisie" #: ../src/qalc.cc:524 msgid "output base" msgstr "base de la sortie" #: ../src/qalc.cc:527 ../src/qalc.cc:2290 ../src/qalc.cc:2537 #: ../src/qalc.cc:2638 ../src/qalc.cc:3196 ../src/qalc.cc:3281 #: ../src/qalc.cc:4148 ../libqalculate/Calculator.cc:2472 msgid "roman" msgstr "" #: ../src/qalc.cc:528 ../src/qalc.cc:2300 ../src/qalc.cc:2539 #: ../src/qalc.cc:3194 ../src/qalc.cc:4164 ../libqalculate/Calculator.cc:2478 msgid "time" msgstr "temps" #: ../src/qalc.cc:529 ../src/qalc.cc:2270 ../src/qalc.cc:4116 #: ../libqalculate/Calculator.cc:2460 msgid "hexadecimal" msgstr "hexadécimal" #: ../src/qalc.cc:530 ../src/qalc.cc:2285 ../src/qalc.cc:4140 #: ../libqalculate/Calculator.cc:2469 #, fuzzy msgid "duodecimal" msgstr "décimal" #: ../src/qalc.cc:531 ../src/qalc.cc:2275 ../src/qalc.cc:4124 #: ../libqalculate/Calculator.cc:2463 msgid "binary" msgstr "binaire" #: ../src/qalc.cc:532 ../src/qalc.cc:2280 ../src/qalc.cc:4132 #: ../libqalculate/Calculator.cc:2466 msgid "octal" msgstr "" #: ../src/qalc.cc:533 msgid "decimal" msgstr "décimal" #: ../src/qalc.cc:534 ../src/qalc.cc:2295 ../src/qalc.cc:2538 #: ../src/qalc.cc:4156 ../libqalculate/Calculator.cc:2475 msgid "sexagesimal" msgstr "sexagésimal" #: ../src/qalc.cc:551 ../src/qalc.cc:614 ../src/qalc.cc:2543 #: ../src/qalc.cc:3201 msgid "base display" msgstr "affichage de la base" #: ../src/qalc.cc:555 msgid "Illegal base." msgstr "Base illégale." #: ../src/qalc.cc:563 ../src/qalc.cc:591 ../src/qalc.cc:2475 #: ../src/qalc.cc:3123 msgid "assumptions" msgstr "hypothèses" #: ../src/qalc.cc:585 ../src/qalc.cc:1269 ../src/qalc.cc:2469 #: ../src/qalc.cc:3046 msgid "complex" msgstr "complexe" #: ../src/qalc.cc:587 ../src/qalc.cc:1271 ../src/qalc.cc:2471 #: ../src/qalc.cc:3048 msgid "non-matrix" msgstr "non-matriciel" #: ../src/qalc.cc:594 ../src/qalc.cc:2661 ../src/qalc.cc:3293 msgid "all prefixes" msgstr "tous les préfixes" #: ../src/qalc.cc:595 ../src/qalc.cc:2501 ../src/qalc.cc:3162 msgid "complex numbers" msgstr "nombres complexes" #: ../src/qalc.cc:596 ../src/qalc.cc:2519 ../src/qalc.cc:3174 msgid "excessive parentheses" msgstr "parenthèses en excès" #: ../src/qalc.cc:597 ../src/qalc.cc:2502 ../src/qalc.cc:2758 #: ../src/qalc.cc:2763 ../src/qalc.cc:3163 msgid "functions" msgstr "fonctions" #: ../src/qalc.cc:598 ../src/qalc.cc:2503 ../src/qalc.cc:3164 msgid "infinite numbers" msgstr "nombres infinis" #: ../src/qalc.cc:599 ../src/qalc.cc:2527 ../src/qalc.cc:3176 msgid "show negative exponents" msgstr "afficher les exposants négatifs" #: ../src/qalc.cc:600 ../src/qalc.cc:2453 ../src/qalc.cc:3120 msgid "assume nonzero denominators" msgstr "supposer que les dénominateurs sont non nuls" #: ../src/qalc.cc:601 ../src/qalc.cc:2454 ../src/qalc.cc:3121 msgid "warn nonzero denominators" msgstr "avertir des dénominateurs non nuls" #: ../src/qalc.cc:602 ../src/qalc.cc:2677 ../src/qalc.cc:3312 msgid "prefixes" msgstr "préfixes" #: ../src/qalc.cc:603 ../src/qalc.cc:2675 ../src/qalc.cc:3310 msgid "denominator prefixes" msgstr "préfixes des dénominateurs" #: ../src/qalc.cc:604 ../src/qalc.cc:2676 ../src/qalc.cc:3311 msgid "place units separately" msgstr "placer les unités séparément" #: ../src/qalc.cc:605 ../src/qalc.cc:2500 ../src/qalc.cc:3161 msgid "calculate variables" msgstr "calculer les variables" #: ../src/qalc.cc:606 ../src/qalc.cc:2499 ../src/qalc.cc:3160 msgid "calculate functions" msgstr "calculer les fonctions" #: ../src/qalc.cc:607 ../src/qalc.cc:2678 ../src/qalc.cc:3313 msgid "sync units" msgstr "synchroniser les unités" #: ../src/qalc.cc:608 ../src/qalc.cc:2619 ../src/qalc.cc:3250 msgid "round to even" msgstr "arrondir au nombre inférieur" #: ../src/qalc.cc:609 ../src/qalc.cc:2657 ../src/qalc.cc:3289 msgid "rpn syntax" msgstr "syntaxe npi" #. qalc command #: ../src/qalc.cc:610 ../src/qalc.cc:2042 ../src/qalc.cc:2689 #: ../src/qalc.cc:2726 ../src/qalc.cc:3324 ../src/qalc.cc:3404 msgid "rpn" msgstr "npi" #: ../src/qalc.cc:611 ../src/qalc.cc:2528 ../src/qalc.cc:3177 msgid "short multiplication" msgstr "multiplication courte" #: ../src/qalc.cc:612 ../src/qalc.cc:2602 ../src/qalc.cc:3233 msgid "lowercase e" msgstr "e minuscule" #: ../src/qalc.cc:613 ../src/qalc.cc:2603 ../src/qalc.cc:3234 msgid "lowercase numbers" msgstr "nombres en minuscules" #: ../src/qalc.cc:616 ../src/qalc.cc:632 ../src/qalc.cc:686 ../src/qalc.cc:767 #: ../src/qalc.cc:790 ../src/qalc.cc:2448 ../src/qalc.cc:2484 #: ../src/qalc.cc:2545 ../src/qalc.cc:2666 ../src/qalc.cc:3119 #: ../src/qalc.cc:3151 ../src/qalc.cc:3201 ../src/qalc.cc:3297 msgid "none" msgstr "aucun" #: ../src/qalc.cc:617 ../src/qalc.cc:2546 ../src/qalc.cc:3201 msgid "normal" msgstr "" #: ../src/qalc.cc:618 ../src/qalc.cc:2547 ../src/qalc.cc:3201 msgid "alternative" msgstr "" #: ../src/qalc.cc:623 ../src/qalc.cc:639 ../src/qalc.cc:659 ../src/qalc.cc:691 #: ../src/qalc.cc:707 ../src/qalc.cc:731 ../src/qalc.cc:745 ../src/qalc.cc:759 #: ../src/qalc.cc:781 ../src/qalc.cc:797 ../src/qalc.cc:846 ../src/qalc.cc:852 #: ../src/qalc.cc:876 ../src/qalc.cc:933 ../src/qalc.cc:949 ../src/qalc.cc:963 msgid "Illegal value." msgstr "Valeur illégale." #: ../src/qalc.cc:628 ../src/qalc.cc:2621 ../src/qalc.cc:3252 msgid "two's complement" msgstr "" #: ../src/qalc.cc:629 ../src/qalc.cc:2562 ../src/qalc.cc:3214 msgid "digit grouping" msgstr "" #: ../src/qalc.cc:633 ../src/qalc.cc:2565 ../src/qalc.cc:3214 msgid "standard" msgstr "" #: ../src/qalc.cc:634 ../src/qalc.cc:654 ../src/qalc.cc:2558 #: ../src/qalc.cc:2566 ../src/qalc.cc:2626 ../src/qalc.cc:3206 #: ../src/qalc.cc:3214 ../src/qalc.cc:3259 msgid "locale" msgstr "" #: ../src/qalc.cc:644 ../src/qalc.cc:2530 ../src/qalc.cc:3179 msgid "spell out logical" msgstr "déchiffrement logique" #: ../src/qalc.cc:645 ../src/qalc.cc:2634 ../src/qalc.cc:3271 msgid "ignore dot" msgstr "" #: ../src/qalc.cc:646 ../src/qalc.cc:2631 ../src/qalc.cc:3268 msgid "ignore comma" msgstr "" #: ../src/qalc.cc:650 ../src/qalc.cc:2557 ../src/qalc.cc:2625 #: ../src/qalc.cc:3203 ../src/qalc.cc:3256 #, fuzzy msgid "decimal comma" msgstr "décimal" #: ../src/qalc.cc:669 ../src/qalc.cc:2642 ../src/qalc.cc:3286 msgid "limit implicit multiplication" msgstr "limiter les multiplications implicites" #: ../src/qalc.cc:671 ../src/qalc.cc:2529 ../src/qalc.cc:3178 msgid "spacious" msgstr "spacieux" #: ../src/qalc.cc:672 ../src/qalc.cc:2531 ../src/qalc.cc:3180 msgid "unicode" msgstr "" #: ../src/qalc.cc:675 ../src/qalc.cc:2504 ../src/qalc.cc:2760 #: ../src/qalc.cc:2765 ../src/qalc.cc:3165 msgid "units" msgstr "unités" #: ../src/qalc.cc:676 ../src/qalc.cc:2505 ../src/qalc.cc:3166 msgid "unknowns" msgstr "inconnues" #: ../src/qalc.cc:677 ../src/qalc.cc:2506 ../src/qalc.cc:2759 #: ../src/qalc.cc:2764 ../src/qalc.cc:3167 msgid "variables" msgstr "" #: ../src/qalc.cc:678 ../src/qalc.cc:2511 ../src/qalc.cc:3172 msgid "abbreviations" msgstr "abréviations" #: ../src/qalc.cc:679 ../src/qalc.cc:2620 ../src/qalc.cc:3251 msgid "show ending zeroes" msgstr "afficher les zéros de fin" #: ../src/qalc.cc:680 ../src/qalc.cc:2618 ../src/qalc.cc:3249 #, fuzzy msgid "repeating decimals" msgstr "décimales min" #: ../src/qalc.cc:681 ../src/qalc.cc:2479 ../src/qalc.cc:3151 msgid "angle unit" msgstr "unité d'angle" #: ../src/qalc.cc:683 ../src/qalc.cc:2481 ../src/qalc.cc:2482 msgid "rad" msgstr "" #: ../src/qalc.cc:683 ../src/qalc.cc:3151 msgid "radians" msgstr "" #: ../src/qalc.cc:684 msgid "deg" msgstr "" #: ../src/qalc.cc:684 ../src/qalc.cc:3151 msgid "degrees" msgstr "degrés" #: ../src/qalc.cc:685 ../src/qalc.cc:2483 msgid "gra" msgstr "gr" #: ../src/qalc.cc:685 ../src/qalc.cc:3151 msgid "gradians" msgstr "grades" #: ../src/qalc.cc:698 ../src/qalc.cc:2643 ../src/qalc.cc:3287 #: ../src/qalc.cc:3511 #, fuzzy msgid "parsing mode" msgstr "mode exp" #: ../src/qalc.cc:700 ../src/qalc.cc:859 ../src/qalc.cc:2589 #: ../src/qalc.cc:2645 ../src/qalc.cc:3232 ../src/qalc.cc:3287 #: ../src/qalc.cc:3519 #, fuzzy msgid "adaptive" msgstr "strictement positif" #: ../src/qalc.cc:701 ../src/qalc.cc:2646 ../src/qalc.cc:3287 #: ../src/qalc.cc:3516 msgid "implicit first" msgstr "" #: ../src/qalc.cc:702 ../src/qalc.cc:2647 ../src/qalc.cc:3287 #: ../src/qalc.cc:3513 #, fuzzy msgid "conventional" msgstr "optionnel" #: ../src/qalc.cc:712 ../src/qalc.cc:1433 ../src/qalc.cc:2679 #: ../src/qalc.cc:3314 msgid "update exchange rates" msgstr "" #: ../src/qalc.cc:713 ../src/qalc.cc:2682 ../src/qalc.cc:3316 msgid "never" msgstr "" #: ../src/qalc.cc:715 ../src/qalc.cc:2681 ../src/qalc.cc:3315 msgid "ask" msgstr "" #: ../src/qalc.cc:722 ../src/qalc.cc:2520 ../src/qalc.cc:3175 msgid "multiplication sign" msgstr "signe de multiplication" #: ../src/qalc.cc:736 ../src/qalc.cc:2512 ../src/qalc.cc:3173 msgid "division sign" msgstr "signe de division" #: ../src/qalc.cc:750 ../src/qalc.cc:2487 ../src/qalc.cc:3152 msgid "approximation" msgstr "approximation" #. qalc command #: ../src/qalc.cc:752 ../src/qalc.cc:803 ../src/qalc.cc:925 ../src/qalc.cc:2246 #: ../src/qalc.cc:2489 ../src/qalc.cc:2582 ../src/qalc.cc:2706 #: ../src/qalc.cc:3152 ../src/qalc.cc:3231 ../src/qalc.cc:3458 msgid "exact" msgstr "" #: ../src/qalc.cc:753 ../src/qalc.cc:2490 ../src/qalc.cc:3152 msgid "try exact" msgstr "essayer le calcul exact" #. qalc command #: ../src/qalc.cc:754 ../src/qalc.cc:1282 ../src/qalc.cc:2252 #: ../src/qalc.cc:2491 ../src/qalc.cc:2702 ../src/qalc.cc:2965 #: ../src/qalc.cc:2975 ../src/qalc.cc:3065 ../src/qalc.cc:3152 #: ../src/qalc.cc:3462 msgid "approximate" msgstr "approximer" #: ../src/qalc.cc:764 ../src/qalc.cc:2662 ../src/qalc.cc:3294 msgid "autoconversion" msgstr "" #: ../src/qalc.cc:768 ../src/qalc.cc:2403 msgid "best" msgstr "meilleur" #: ../src/qalc.cc:769 ../src/qalc.cc:2671 ../src/qalc.cc:3303 #, fuzzy msgid "optimalsi" msgstr "optionnel" #: ../src/qalc.cc:770 ../src/qalc.cc:2403 ../src/qalc.cc:2669 #: ../src/qalc.cc:3299 ../src/qalc.cc:4218 ../libqalculate/Calculator.cc:2499 #, fuzzy msgid "optimal" msgstr "optionnel" #: ../src/qalc.cc:772 ../src/qalc.cc:2665 ../src/qalc.cc:3305 #: ../src/qalc.cc:4248 ../libqalculate/Calculator.cc:2510 msgid "mixed" msgstr "" #: ../src/qalc.cc:787 ../src/qalc.cc:2674 ../src/qalc.cc:3309 #, fuzzy msgid "currency conversion" msgstr "Devise" #: ../src/qalc.cc:788 ../src/qalc.cc:2446 ../src/qalc.cc:3119 msgid "algebra mode" msgstr "mode algébrique" #. qalc command #: ../src/qalc.cc:791 ../src/qalc.cc:2434 ../src/qalc.cc:2450 #: ../src/qalc.cc:2721 ../src/qalc.cc:3097 ../src/qalc.cc:3119 msgid "simplify" msgstr "simplifier" #: ../src/qalc.cc:792 ../src/qalc.cc:2449 ../src/qalc.cc:3119 msgid "factorize" msgstr "factoriser" #: ../src/qalc.cc:814 ../src/qalc.cc:2691 ../src/qalc.cc:2719 #: ../src/qalc.cc:3326 msgid "save mode" msgstr "enregistrer le mode" #: ../src/qalc.cc:823 ../src/qalc.cc:2690 ../src/qalc.cc:2718 #: ../src/qalc.cc:3325 msgid "save definitions" msgstr "enregistrer les définitions" #: ../src/qalc.cc:832 ../src/qalc.cc:2569 ../src/qalc.cc:3215 #, fuzzy msgid "scientific notation" msgstr "scientifique" #: ../src/qalc.cc:836 ../src/qalc.cc:2572 ../src/qalc.cc:3220 msgid "auto" msgstr "" #: ../src/qalc.cc:837 ../src/qalc.cc:2573 ../src/qalc.cc:3224 msgid "pure" msgstr "pur" #: ../src/qalc.cc:838 ../src/qalc.cc:2574 ../src/qalc.cc:3226 msgid "scientific" msgstr "scientifique" #: ../src/qalc.cc:839 ../src/qalc.cc:2575 ../src/qalc.cc:3222 msgid "engineering" msgstr "" #: ../src/qalc.cc:848 ../src/qalc.cc:2495 ../src/qalc.cc:3154 msgid "precision" msgstr "précision" #: ../src/qalc.cc:857 ../src/qalc.cc:2587 ../src/qalc.cc:3232 #, fuzzy msgid "interval display" msgstr "affichage de la base" #: ../src/qalc.cc:860 ../src/qalc.cc:2592 ../src/qalc.cc:3232 #, fuzzy msgid "significant" msgstr "scientifique" #: ../src/qalc.cc:861 ../src/qalc.cc:2593 ../src/qalc.cc:3232 #, fuzzy msgid "interval" msgstr "entier" #: ../src/qalc.cc:862 ../src/qalc.cc:2594 ../src/qalc.cc:3232 #, fuzzy msgid "plusminus" msgstr "moins" #: ../src/qalc.cc:863 ../src/qalc.cc:2595 ../src/qalc.cc:3232 msgid "midpoint" msgstr "" #: ../src/qalc.cc:864 ../src/qalc.cc:2597 ../src/qalc.cc:3232 msgid "upper" msgstr "" #: ../src/qalc.cc:865 ../src/qalc.cc:2596 ../src/qalc.cc:3232 #, fuzzy msgid "lower" msgstr "e minuscule" #: ../src/qalc.cc:883 ../src/qalc.cc:2494 ../src/qalc.cc:3153 msgid "interval arithmetic" msgstr "" #: ../src/qalc.cc:890 ../src/qalc.cc:2507 ../src/qalc.cc:3168 #, fuzzy msgid "variable units" msgstr "unité d'angle" #: ../src/qalc.cc:897 ../src/qalc.cc:2604 ../src/qalc.cc:3235 msgid "max decimals" msgstr "décimales max" #: ../src/qalc.cc:909 ../src/qalc.cc:2611 ../src/qalc.cc:3242 msgid "min decimals" msgstr "décimales min" #: ../src/qalc.cc:922 ../src/qalc.cc:2579 ../src/qalc.cc:3231 msgid "fractions" msgstr "" #: ../src/qalc.cc:927 ../src/qalc.cc:2584 ../src/qalc.cc:3231 msgid "combined" msgstr "combiné" #: ../src/qalc.cc:928 ../src/qalc.cc:2583 ../src/qalc.cc:3231 msgid "long" msgstr "" #: ../src/qalc.cc:940 ../src/qalc.cc:2550 ../src/qalc.cc:3202 #, fuzzy msgid "complex form" msgstr "complexe" #: ../src/qalc.cc:942 ../src/qalc.cc:2309 ../src/qalc.cc:2552 #: ../src/qalc.cc:3202 ../src/qalc.cc:4194 msgid "rectangular" msgstr "" #: ../src/qalc.cc:942 ../src/qalc.cc:2309 ../src/qalc.cc:4194 msgid "cartesian" msgstr "" #: ../src/qalc.cc:943 ../src/qalc.cc:2318 ../src/qalc.cc:2553 #: ../src/qalc.cc:3202 ../src/qalc.cc:4202 #, fuzzy msgid "exponential" msgstr "optionnel" #: ../src/qalc.cc:944 ../src/qalc.cc:2327 ../src/qalc.cc:2554 #: ../src/qalc.cc:3202 ../src/qalc.cc:4210 msgid "polar" msgstr "" #: ../src/qalc.cc:954 ../src/qalc.cc:2650 ../src/qalc.cc:3288 msgid "read precision" msgstr "précision de saisie" #: ../src/qalc.cc:957 ../src/qalc.cc:2653 ../src/qalc.cc:3288 msgid "always" msgstr "toujours" #: ../src/qalc.cc:958 ../src/qalc.cc:2654 ../src/qalc.cc:3288 msgid "when decimals" msgstr "si décimales" #: ../src/qalc.cc:980 msgid "Unrecognized option." msgstr "Option inconnue" #: ../src/qalc.cc:1097 msgid "Calendar" msgstr "" #: ../src/qalc.cc:1097 msgid "Day" msgstr "" #: ../src/qalc.cc:1097 msgid "Month" msgstr "" #: ../src/qalc.cc:1097 msgid "Year" msgstr "" #: ../src/qalc.cc:1098 ../libqalculate/Calculator.cc:2533 msgid "failed" msgstr "" #: ../src/qalc.cc:1099 ../libqalculate/Calculator.cc:2534 msgid "Gregorian:" msgstr "" #: ../src/qalc.cc:1100 ../libqalculate/Calculator.cc:2535 msgid "Hebrew:" msgstr "" #: ../src/qalc.cc:1101 ../libqalculate/Calculator.cc:2536 msgid "Islamic:" msgstr "" #: ../src/qalc.cc:1102 ../libqalculate/Calculator.cc:2537 msgid "Persian:" msgstr "" #: ../src/qalc.cc:1103 ../libqalculate/Calculator.cc:2538 msgid "Indian national:" msgstr "" #: ../src/qalc.cc:1104 ../libqalculate/Calculator.cc:2539 msgid "Chinese:" msgstr "" #: ../src/qalc.cc:1109 ../libqalculate/Calculator.cc:2543 msgid "Julian:" msgstr "" #: ../src/qalc.cc:1110 ../libqalculate/Calculator.cc:2544 msgid "Revised julian:" msgstr "" #: ../src/qalc.cc:1111 ../libqalculate/Calculator.cc:2545 #, fuzzy msgid "Coptic:" msgstr "optionnel" #: ../src/qalc.cc:1112 ../libqalculate/Calculator.cc:2546 msgid "Ethiopian:" msgstr "" #: ../src/qalc.cc:1205 ../src/qalc.cc:1206 ../src/qalc.cc:1323 #: ../src/qalc.cc:1324 ../src/qalc.cc:1391 ../src/qalc.cc:1392 #, fuzzy msgid "" "For more information about a specific function, variable or unit, please use " "the info command (in interactive mode)." msgstr "" "Tapez info NOM pour obtenir de l'information sur une fonction, variable ou " "unité (exemple : info sin)." #: ../src/qalc.cc:1218 msgid "Variables:" msgstr "" #: ../src/qalc.cc:1220 msgid "Name" msgstr "Nom" #: ../src/qalc.cc:1221 ../src/qalc.cc:3057 msgid "Value" msgstr "Valeur" #: ../src/qalc.cc:1245 ../src/qalc.cc:3022 ../libqalculate/Function.cc:2002 msgid "matrix" msgstr "matrice" #: ../src/qalc.cc:1247 ../src/qalc.cc:3024 ../libqalculate/Function.cc:1941 msgid "vector" msgstr "vecteur" #: ../src/qalc.cc:1276 ../src/qalc.cc:3053 msgid "default assumptions" msgstr "hypothèses par défaut" #: ../src/qalc.cc:1297 #, fuzzy msgid "Functions:" msgstr "Fonction" #: ../src/qalc.cc:1311 #, fuzzy msgid "Units:" msgstr "Unité" #: ../src/qalc.cc:1318 msgid "No local variables, functions or units have been defined." msgstr "" #: ../src/qalc.cc:1426 msgid "usage: qalc [options] [expression]" msgstr "" #: ../src/qalc.cc:1428 msgid "where options are:" msgstr "où les options sont :" #: ../src/qalc.cc:1429 ../src/qalc.cc:2704 msgid "BASE" msgstr "" #: ../src/qalc.cc:1430 msgid "set the result number base" msgstr "" #: ../src/qalc.cc:1435 msgid "FILE" msgstr "FICHIER" #: ../src/qalc.cc:1436 msgid "executes commands from a file first" msgstr "commencer par exécuter les commandes dans un fichier" #: ../src/qalc.cc:1438 msgid "start in interactive mode" msgstr "" #: ../src/qalc.cc:1439 ../src/qalc.cc:1441 ../src/qalc.cc:1443 #: ../src/qalc.cc:1445 msgid "SEARCH TERM" msgstr "" #: ../src/qalc.cc:1440 #, fuzzy msgid "" "displays a list of all user-defined or matching variables, functions and " "units." msgstr "\"%s\" n'est pas une variable/fonction/unité valide." #: ../src/qalc.cc:1442 #, fuzzy msgid "displays a list of all or matching functions." msgstr "Exemple : info sin" #: ../src/qalc.cc:1444 #, fuzzy msgid "displays a list of all or matching units." msgstr "Exemple : info sin" #: ../src/qalc.cc:1446 #, fuzzy msgid "displays a list of all or matching variables." msgstr "\"%s\" n'est pas une variable/fonction/unité valide." #: ../src/qalc.cc:1447 msgid "MILLISECONDS" msgstr "" #: ../src/qalc.cc:1448 msgid "" "terminate calculation and display of result after specified amount of time" msgstr "" #: ../src/qalc.cc:1450 #, fuzzy msgid "do not load any functions, units, or variables from file" msgstr "une fonction, une unité ou un nom de variable valide" #: ../src/qalc.cc:1452 msgid "do not load any global currencies from file" msgstr "" #: ../src/qalc.cc:1454 msgid "do not load any global data sets from file" msgstr "" #: ../src/qalc.cc:1456 #, fuzzy msgid "do not load any global functions from file" msgstr "Échec du chargement des définitions globales!" #: ../src/qalc.cc:1458 msgid "do not load any global units from file" msgstr "" #: ../src/qalc.cc:1460 msgid "do not load any global variables from file" msgstr "" #: ../src/qalc.cc:1461 ../src/qalc.cc:2720 msgid "OPTION" msgstr "" #: ../src/qalc.cc:1461 ../src/qalc.cc:2720 msgid "VALUE" msgstr "VALEUR" #: ../src/qalc.cc:1462 msgid "as set command in interactive program session (ex. -set \"base 16\")" msgstr "" "comme une commande set (définition) dans une session de programme " "interactive (ex. -set \"base 16\")" #: ../src/qalc.cc:1464 msgid "reduces output to just the result of the input expression" msgstr "" #: ../src/qalc.cc:1466 msgid "turn on/off unicode support" msgstr "activer/désactiver le support de l'unicode" #: ../src/qalc.cc:1468 msgid "show application version and exit" msgstr "" #: ../src/qalc.cc:1470 #, fuzzy msgid "" "The program will start in interactive mode if no expression and no file is " "specified (or interactive mode is explicitly selected)." msgstr "" "Le programme démarrera en mode interactif si aucune expression n'est " "indiquée." #: ../src/qalc.cc:1546 msgid "No option and value specified for set command." msgstr "Pas de fonction et valeur spécifiée pour une commande set." #: ../src/qalc.cc:1554 msgid "No file specified." msgstr "Aucun fichier indiqué." #: ../src/qalc.cc:1613 msgid "ans" msgstr "" #: ../src/qalc.cc:1614 ../src/qalc.cc:1617 ../src/qalc.cc:1618 #: ../src/qalc.cc:1619 ../src/qalc.cc:1620 ../src/qalc.cc:1852 #: ../libqalculate/Calculator.cc:8938 ../libqalculate/Calculator.cc:8954 msgid "Temporary" msgstr "Temporaire" #: ../src/qalc.cc:1614 msgid "Last Answer" msgstr "Dernière réponse" #: ../src/qalc.cc:1615 msgid "answer" msgstr "réponse" #: ../src/qalc.cc:1617 msgid "Answer 2" msgstr "Réponse 2" #: ../src/qalc.cc:1618 msgid "Answer 3" msgstr "Réponse 3" #: ../src/qalc.cc:1619 msgid "Answer 4" msgstr "Réponse 4" #: ../src/qalc.cc:1620 msgid "Answer 5" msgstr "Réponse 5" #: ../src/qalc.cc:1631 msgid "Failed to load global definitions!" msgstr "Échec du chargement des définitions globales!" #: ../src/qalc.cc:1656 #, c-format msgid "Could not open \"%s\".\n" msgstr "Impossible d'ouvrir \"%s\".\n" #: ../src/qalc.cc:1696 ../src/qalc.cc:1748 ../src/qalc.cc:3541 #, c-format msgid "Illegal character, '%c', in expression." msgstr "Caractère illégal, '%c', dans l'expression" #. The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. #: ../src/qalc.cc:1814 ../src/qalc.cc:2720 ../src/qalc.cc:3101 msgid "set" msgstr "définir" #. qalc command #: ../src/qalc.cc:1818 ../src/qalc.cc:2717 ../src/qalc.cc:3355 msgid "save" msgstr "enregistrer" #: ../src/qalc.cc:1818 ../src/qalc.cc:2717 ../src/qalc.cc:3355 msgid "store" msgstr "stocker" #. qalc command #: ../src/qalc.cc:1821 ../src/qalc.cc:2437 ../src/qalc.cc:2715 #: ../src/qalc.cc:3381 msgid "mode" msgstr "" #: ../src/qalc.cc:1823 msgid "mode saved" msgstr "mode enregistré" #: ../src/qalc.cc:1825 msgid "definitions" msgstr "définitions" #: ../src/qalc.cc:1827 msgid "definitions saved" msgstr "définitions enregistrées" #: ../src/qalc.cc:1874 ../src/qalc.cc:1876 ../src/qalc.cc:1934 #: ../src/qalc.cc:1936 ../src/qalc.cc:1991 ../src/qalc.cc:1993 #, c-format msgid "Illegal name. Save as %s instead (default: no)?" msgstr "Nom illégal. Enregistrer comme %s à la place (défaut : non)?" #: ../src/qalc.cc:1883 ../src/qalc.cc:1943 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "Une unité ou une variable du même nom existe déjà.\n" "Voulez-vous l'écraser? (défaut : non)" #. qalc command #: ../src/qalc.cc:1906 ../src/qalc.cc:2723 ../src/qalc.cc:3362 #: ../libqalculate/Function.cc:2064 msgid "variable" msgstr "" #. qalc command #: ../src/qalc.cc:1963 ../src/qalc.cc:2713 ../src/qalc.cc:3368 #: ../libqalculate/Function.cc:2036 msgid "function" msgstr "fonction" #: ../src/qalc.cc:2000 #, fuzzy msgid "" "An function with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "Une unité ou une variable du même nom existe déjà.\n" "Voulez-vous l'écraser? (défaut : non)" #. qalc command #: ../src/qalc.cc:2020 ../src/qalc.cc:2705 ../src/qalc.cc:3375 msgid "delete" msgstr "" #: ../src/qalc.cc:2031 #, fuzzy msgid "No user-defined variable or function with the specified name exist." msgstr "Aucune fonction, variable ou unité avec le nom indiqué n'existe." #. qalc command #: ../src/qalc.cc:2035 ../src/qalc.cc:2703 ../src/qalc.cc:3328 msgid "assume" msgstr "supposer" #: ../src/qalc.cc:2045 msgid "syntax" msgstr "syntaxe" #. qalc command #: ../src/qalc.cc:2052 ../src/qalc.cc:2087 ../src/qalc.cc:2727 #: ../src/qalc.cc:3420 msgid "stack" msgstr "pile" #. qalc command #: ../src/qalc.cc:2072 ../src/qalc.cc:2708 ../src/qalc.cc:3400 msgid "exrates" msgstr "taux d'échange" #: ../src/qalc.cc:2089 ../src/qalc.cc:2105 ../src/qalc.cc:2114 #: ../src/qalc.cc:2147 ../src/qalc.cc:2176 ../src/qalc.cc:2185 #: ../src/qalc.cc:2202 ../src/qalc.cc:2209 ../src/qalc.cc:2227 #: ../src/qalc.cc:2234 msgid "The RPN stack is empty." msgstr "La pile NPI est vide." #. qalc command #: ../src/qalc.cc:2103 ../src/qalc.cc:2112 ../src/qalc.cc:2733 #: ../src/qalc.cc:3424 msgid "swap" msgstr "" #: ../src/qalc.cc:2107 ../src/qalc.cc:2116 ../src/qalc.cc:2149 #: ../src/qalc.cc:2178 ../src/qalc.cc:2187 #, fuzzy msgid "The RPN stack only contains one value." msgstr "La pile NPI est vide." #: ../src/qalc.cc:2135 ../src/qalc.cc:2168 ../src/qalc.cc:2216 #: ../src/qalc.cc:2240 msgid "The specified RPN stack index does not exist." msgstr "" #. qalc command #: ../src/qalc.cc:2145 ../src/qalc.cc:2730 ../src/qalc.cc:3446 msgid "move" msgstr "" #. qalc command #: ../src/qalc.cc:2174 ../src/qalc.cc:2183 ../src/qalc.cc:2732 #: ../src/qalc.cc:3442 msgid "rotate" msgstr "" #: ../src/qalc.cc:2191 msgid "up" msgstr "" #: ../src/qalc.cc:2193 msgid "down" msgstr "" #. qalc command #: ../src/qalc.cc:2200 ../src/qalc.cc:2207 ../src/qalc.cc:2729 #: ../src/qalc.cc:3434 msgid "copy" msgstr "" #. qalc command #: ../src/qalc.cc:2222 ../src/qalc.cc:2728 ../src/qalc.cc:3410 msgid "clear stack" msgstr "vider la pile" #. qalc command #: ../src/qalc.cc:2225 ../src/qalc.cc:2232 ../src/qalc.cc:2731 #: ../src/qalc.cc:3414 msgid "pop" msgstr "" #. qalc command #: ../src/qalc.cc:2258 ../src/qalc.cc:2722 ../src/qalc.cc:3466 msgid "convert" msgstr "convertir" #: ../src/qalc.cc:2258 ../src/qalc.cc:2722 ../src/qalc.cc:3466 #: ../src/qalc.cc:3503 ../libqalculate/Calculator.cc:1241 #: ../libqalculate/Calculator.cc:2623 ../libqalculate/Calculator.cc:2638 #: ../libqalculate/Calculator.cc:2639 msgid "to" msgstr "vers" #: ../src/qalc.cc:2336 ../src/qalc.cc:4188 ../libqalculate/Calculator.cc:2493 msgid "bases" msgstr "" #: ../src/qalc.cc:2380 ../src/qalc.cc:4191 ../libqalculate/Calculator.cc:2496 msgid "calendars" msgstr "" #: ../src/qalc.cc:2390 ../src/qalc.cc:4179 ../libqalculate/Calculator.cc:2484 #, fuzzy msgid "fraction" msgstr "fonction" #: ../src/qalc.cc:2399 ../src/qalc.cc:4182 ../libqalculate/Calculator.cc:2487 #, fuzzy msgid "factors" msgstr "facteur" #. qalc command #: ../src/qalc.cc:2401 ../src/qalc.cc:2431 ../src/qalc.cc:2716 #: ../src/qalc.cc:3093 ../src/qalc.cc:4185 ../libqalculate/Calculator.cc:2490 #, fuzzy msgid "partial fraction" msgstr "fonction" #. qalc command #: ../src/qalc.cc:2428 ../src/qalc.cc:2711 ../src/qalc.cc:3089 msgid "factor" msgstr "facteur" #: ../src/qalc.cc:2442 ../src/qalc.cc:3117 #, fuzzy msgid "Algebraic Mode" msgstr "mode algébrique" #: ../src/qalc.cc:2477 ../src/qalc.cc:3149 #, fuzzy msgid "Calculation" msgstr "calculs en cours..." #: ../src/qalc.cc:2497 ../src/qalc.cc:3158 msgid "Enabled Objects" msgstr "" #: ../src/qalc.cc:2509 ../src/qalc.cc:3170 msgid "Generic Display Options" msgstr "" #: ../src/qalc.cc:2533 ../src/qalc.cc:3182 #, fuzzy msgid "Numerical Display" msgstr "affichage de la base" #: ../src/qalc.cc:2623 ../src/qalc.cc:3254 #, fuzzy msgid "Parsing" msgstr "mode exp" #: ../src/qalc.cc:2659 ../src/qalc.cc:3291 #, fuzzy msgid "Units" msgstr "Unité" #: ../src/qalc.cc:2687 ../src/qalc.cc:3322 msgid "Other" msgstr "" #. qalc command #: ../src/qalc.cc:2694 ../src/qalc.cc:3085 msgid "help" msgstr "aide" #: ../src/qalc.cc:2697 #, fuzzy msgid "Enter a mathematical expression or a command and press enter." msgstr "Entrez une expression mathématique ou une commande." #: ../src/qalc.cc:2698 msgid "Complete functions, units and variables with the tabulator key." msgstr "Fonctions, unités et variables complètes avec la touche de tabulation." #: ../src/qalc.cc:2700 msgid "Available commands are:" msgstr "Les commandes disponibles sont :" #: ../src/qalc.cc:2703 msgid "ASSUMPTIONS" msgstr "HYPOTHÈSES" #: ../src/qalc.cc:2705 ../src/qalc.cc:2713 ../src/qalc.cc:2717 #: ../src/qalc.cc:2723 msgid "NAME" msgstr "NOM" #: ../src/qalc.cc:2712 ../src/qalc.cc:2744 ../src/qalc.cc:3385 msgid "find" msgstr "" #. qalc command #: ../src/qalc.cc:2712 ../src/qalc.cc:2742 ../src/qalc.cc:2744 #: ../src/qalc.cc:3385 msgid "list" msgstr "" #: ../src/qalc.cc:2713 ../src/qalc.cc:2723 msgid "EXPRESSION" msgstr "" #. qalc command #: ../src/qalc.cc:2714 ../src/qalc.cc:2770 ../src/qalc.cc:3394 #: ../libqalculate/Calculator.cc:9598 ../libqalculate/DataSet.cc:355 #: ../libqalculate/DataSet.cc:382 ../libqalculate/DataSet.cc:1012 msgid "info" msgstr "" #: ../src/qalc.cc:2717 msgid "CATEGORY" msgstr "CATÉGORIE" #: ../src/qalc.cc:2717 msgid "TITLE" msgstr "TITRE" #: ../src/qalc.cc:2722 msgid "UNIT or \"TO\" COMMAND" msgstr "" #. qalc command #: ../src/qalc.cc:2724 ../src/qalc.cc:3507 ../src/qalc.cc:3528 msgid "quit" msgstr "quitter" #: ../src/qalc.cc:2724 ../src/qalc.cc:3507 ../src/qalc.cc:3528 msgid "exit" msgstr "sortir" #: ../src/qalc.cc:2725 msgid "Commands for RPN mode:" msgstr "" #: ../src/qalc.cc:2726 msgid "STATE" msgstr "" #: ../src/qalc.cc:2729 ../src/qalc.cc:2731 msgid "INDEX" msgstr "" #: ../src/qalc.cc:2730 ../src/qalc.cc:2733 msgid "INDEX 1" msgstr "" #: ../src/qalc.cc:2730 ../src/qalc.cc:2733 msgid "INDEX 2" msgstr "" #: ../src/qalc.cc:2732 msgid "DIRECTION" msgstr "" #: ../src/qalc.cc:2735 msgid "Type help COMMAND for more information (example: help save)." msgstr "Tapez help COMMANDE pour plus d'aide (exemple : help save)." #: ../src/qalc.cc:2736 msgid "" "Type info NAME for information about a function, variable or unit (example: " "info sin)." msgstr "" "Tapez info NOM pour obtenir de l'information sur une fonction, variable ou " "unité (exemple : info sin)." #: ../src/qalc.cc:2737 msgid "" "When a line begins with '/', the following text is always interpreted as a " "command." msgstr "" #: ../src/qalc.cc:2739 msgid "" "For more information about mathematical expression, different options, and a " "complete list of functions, variables and units, see the relevant sections " "in the manual of the graphical user interface (available at http://qalculate." "github.io/manual/index.html)." msgstr "" #: ../src/qalc.cc:2757 ../src/qalc.cc:2762 #, fuzzy msgid "currencies" msgstr "Devise" #: ../src/qalc.cc:2778 msgid "No function, variable or unit with specified name exist." msgstr "Aucune fonction, variable ou unité avec le nom indiqué n'existe." #: ../src/qalc.cc:2788 msgid "Function" msgstr "Fonction" #: ../src/qalc.cc:2815 ../libqalculate/Function.cc:201 msgid "argument" msgstr "" #: ../src/qalc.cc:2839 #, c-format msgid "" "Retrieves data from the %s data set for a given object and property. If " "\"info\" is typed as property, all properties of the object will be listed." msgstr "" "Récupère les informations de l'ensemble de données %s pour un objet et une " "propriété donnés. Si \"info\" est tapé pour la propriété, toutes les " "propriétés de l'objet seront listées." #: ../src/qalc.cc:2848 #, fuzzy msgid "Example:" msgstr "Exemple : store var1" #: ../src/qalc.cc:2857 msgid "Arguments" msgstr "" #. optional argument, in description #: ../src/qalc.cc:2874 msgid "optional" msgstr "optionnel" #. argument default, in description #: ../src/qalc.cc:2878 msgid "default: " msgstr "défaut :" #: ../src/qalc.cc:2889 msgid "Requirement" msgstr "Exigences" #: ../src/qalc.cc:2897 msgid "Properties" msgstr "Propiétés" #: ../src/qalc.cc:2912 msgid "key" msgstr "touche" #: ../src/qalc.cc:2930 ../src/qalc.cc:2933 ../src/qalc.cc:3072 msgid "Unit" msgstr "Unité" #: ../src/qalc.cc:2936 ../src/qalc.cc:3004 msgid "Names" msgstr "Noms" #: ../src/qalc.cc:2954 msgid "Base Unit" msgstr "Unité de base" #: ../src/qalc.cc:2961 msgid "Relation" msgstr "" #: ../src/qalc.cc:2971 msgid "Inverse Relation" msgstr "Relation Inverse" #: ../src/qalc.cc:2983 msgid "Base Units" msgstr "Unités de base" #: ../src/qalc.cc:2998 ../src/qalc.cc:3001 msgid "Variable" msgstr "" #: ../src/qalc.cc:3016 msgid "a previous result" msgstr "un résultat précédent" #: ../src/qalc.cc:3061 msgid "Uncertainty" msgstr "" #: ../src/qalc.cc:3091 msgid "Factorizes the current result." msgstr "Factorise le résultat courant." #: ../src/qalc.cc:3095 msgid "Applies partial fraction decomposition to the current result." msgstr "" #: ../src/qalc.cc:3099 msgid "Simplifies the current result." msgstr "Simplifie le résultat courant." #: ../src/qalc.cc:3112 msgid "Sets the value of an option." msgstr "Définit la valeur d'une option." #: ../src/qalc.cc:3113 msgid "Example: set base 16." msgstr "Exemple : set base 16." #: ../src/qalc.cc:3115 #, fuzzy msgid "" "Available options and accepted values are (the current value is marked with " "'*'):" msgstr "Les options disponibles et les valeurs acceptées sont :" #: ../src/qalc.cc:3119 msgid "" "Determines if the expression is simplified or factorized after calculation." msgstr "" #: ../src/qalc.cc:3120 msgid "Determines if unknown values will be assumed non-zero (x/x=1)." msgstr "" #: ../src/qalc.cc:3121 msgid "Display a message after a value has been assumed non-zero." msgstr "" #: ../src/qalc.cc:3124 #, fuzzy msgid "Default assumptions for unknown variables." msgstr "Définit les hypothèses par défaut pour les variables inconnues." #: ../src/qalc.cc:3152 msgid "" "How approximate variables and calculations are handled. In exact mode " "approximate values will not be calculated." msgstr "" #: ../src/qalc.cc:3153 msgid "" "If activated, interval arithmetic determines the final precision of " "calculations. Avoids wrong results after loss of significance. Especially " "recommended with physical constants and/or 'read precision'." msgstr "" #: ../src/qalc.cc:3155 msgid "" "Specifies the default number of significant digits displayed and determines " "the precision used for approximate calculations." msgstr "" #: ../src/qalc.cc:3166 #, fuzzy msgid "Interprete undefined symbols in expressions as unknown variables." msgstr "Définit les hypothèses par défaut pour les variables inconnues." #: ../src/qalc.cc:3168 msgid "" "If activated physical constants include units (e.g. c = 299 792 458 m∕s)." msgstr "" #: ../src/qalc.cc:3172 #, fuzzy msgid "Use abbreviated names for units and variables." msgstr "Définit les hypothèses par défaut pour les variables inconnues." #: ../src/qalc.cc:3176 msgid "Use negative exponents instead of division in result (x/y = xy^-1)." msgstr "" #: ../src/qalc.cc:3178 msgid "Add extra space around operators." msgstr "" #: ../src/qalc.cc:3180 msgid "Display Unicode characters." msgstr "" #: ../src/qalc.cc:3184 ../src/qalc.cc:3273 msgid "bin" msgstr "" #: ../src/qalc.cc:3186 ../src/qalc.cc:3275 msgid "oct" msgstr "" #: ../src/qalc.cc:3188 ../src/qalc.cc:3277 msgid "dec" msgstr "" #: ../src/qalc.cc:3190 ../src/qalc.cc:3279 msgid "hex" msgstr "" #: ../src/qalc.cc:3192 msgid "sexa" msgstr "" #: ../src/qalc.cc:3204 ../src/qalc.cc:3257 msgid "Determines the default decimal separator." msgstr "" #: ../src/qalc.cc:3216 msgid "Determines how scientific notation are used (e.g. 5 543 000 = 5.543E6)." msgstr "" #: ../src/qalc.cc:3231 msgid "" "Determines how rational numbers are displayed (e.g. 5/4 = 1 + 1/4 = 1.25). " "'long' removes limits on the size of the numerator and denonimator." msgstr "" #: ../src/qalc.cc:3233 msgid "Use lowercase e for E-notation (5e2 = 5 * 10^2)." msgstr "" #: ../src/qalc.cc:3234 msgid "Use lowercase letters for number bases > 10." msgstr "" #: ../src/qalc.cc:3249 msgid "" "If activated, 1/6 is displayed as '0.1 666...', otherwise as '0.166667'." msgstr "" #: ../src/qalc.cc:3250 msgid "" "Determines whether halfway numbers are rounded upwards or towards the " "nearest even integer." msgstr "" #: ../src/qalc.cc:3251 msgid "If actived, zeroes are kept at the end of approximate numbers." msgstr "" #: ../src/qalc.cc:3252 msgid "" "Enables two's complement representation for display of negative binary " "numbers." msgstr "" #: ../src/qalc.cc:3268 msgid "Allows use of ',' as thousands separator." msgstr "" #: ../src/qalc.cc:3271 msgid "Allows use of '.' as thousands separator." msgstr "" #: ../src/qalc.cc:3287 #, fuzzy msgid "See 'help parsing mode'." msgstr "mode exp" #: ../src/qalc.cc:3288 msgid "" "If activated, numbers be interpreted as approximate with precision equal to " "the number of significant digits. Most useful in combination with 'interval " "arithmetic' (3.20 = 3.20+/-0.0005)." msgstr "" #: ../src/qalc.cc:3293 msgid "Enables automatic use of hecto, deca, deci, and centi." msgstr "" #: ../src/qalc.cc:3295 msgid "" "Controls automatic unit conversion of the result. 'optimalsi' always " "converts non-SI units, while 'optimal' only converts to more optimal unit " "expressions, with less units and exponents." msgstr "" #: ../src/qalc.cc:3309 msgid "" "Enables automatic conversion to the local currency when optimal unit " "conversion is enabled." msgstr "" #: ../src/qalc.cc:3310 msgid "" "Enables automatic use of prefixes in the denominator of unit expressions." msgstr "" #: ../src/qalc.cc:3311 msgid "" "If activated, units are separated from variables at the end of the result." msgstr "" #: ../src/qalc.cc:3312 msgid "Enables automatic use of prefixes in the result." msgstr "" #: ../src/qalc.cc:3317 msgid "days" msgstr "" #: ../src/qalc.cc:3324 #, fuzzy msgid "Activates the Reverse Polish Notation stack." msgstr "(Dés)active le mode Notation Polonaise Inversée." #: ../src/qalc.cc:3325 #, fuzzy msgid "Save functions, units, and variables on exit." msgstr "une fonction, une unité ou un nom de variable valide" #: ../src/qalc.cc:3326 msgid "Save settings on exit." msgstr "" #: ../src/qalc.cc:3330 msgid "Set default assumptions for unknown variables." msgstr "Définit les hypothèses par défaut pour les variables inconnues." #: ../src/qalc.cc:3357 msgid "" "Saves the current result in a variable with the specified name. You may " "optionally also provide a category (default \"Temporary\") and a title." msgstr "" "Enregistre le résultat courant dans une variable avec le nom indiqué. Vous " "pouvez éventuellement préciser aussi une catégorie (défaut \"Temporaire\") " "et un titre." #: ../src/qalc.cc:3358 msgid "" "If name equals \"mode\" or \"definitions\", the current mode and " "definitions, respectively, will be saved." msgstr "" "Si le nom est \"mode\" ou \"définitions\", le mode ou la définition " "courants, respectivement, seront enregistrés." #: ../src/qalc.cc:3360 msgid "Example: store var1." msgstr "Exemple : store var1" #: ../src/qalc.cc:3364 #, fuzzy msgid "Create a variables with the specified name and expression." msgstr "Aucune fonction, variable ou unité avec le nom indiqué n'existe." #: ../src/qalc.cc:3366 #, fuzzy msgid "Example: variable var1 pi / 2." msgstr "Exemple : store var1" #: ../src/qalc.cc:3370 #, fuzzy msgid "Creates a function with the specified name and expression." msgstr "Aucune fonction, variable ou unité avec le nom indiqué n'existe." #: ../src/qalc.cc:3371 msgid "Use '\\x', '\\y', '\\z', '\\a', etc. for arguments in the expression." msgstr "" #: ../src/qalc.cc:3373 #, fuzzy msgid "Example: function func1 5*\\x." msgstr "Exemple : info sin" #: ../src/qalc.cc:3377 #, fuzzy msgid "Removes the user-defined variable or function with the specified name." msgstr "Aucune fonction, variable ou unité avec le nom indiqué n'existe." #: ../src/qalc.cc:3379 #, fuzzy msgid "Example: delete var1." msgstr "Exemple : store var1" #: ../src/qalc.cc:3383 msgid "Displays the current mode." msgstr "Affiche le mode courant." #: ../src/qalc.cc:3387 #, fuzzy msgid "Displays a list of variables, functions and units." msgstr "\"%s\" n'est pas une variable/fonction/unité valide." #: ../src/qalc.cc:3388 msgid "" "Enter with argument 'currencies', 'functions', 'variables' or 'units' to " "show a list of all currencies, functions, variables or units. Enter a search " "term to find matching variables, functions, and/or units. If command is " "called with no argument all user-definied objects are listed." msgstr "" #: ../src/qalc.cc:3390 #, fuzzy msgid "Example: list functions." msgstr "Exemple : info sin" #: ../src/qalc.cc:3391 #, fuzzy msgid "Example: find dinar." msgstr "Exemple : info sin" #: ../src/qalc.cc:3392 #, fuzzy msgid "Example: find variables planck." msgstr "Exemple : store var1" #: ../src/qalc.cc:3396 msgid "Displays information about a function, variable or unit." msgstr "Affiche l'information sur une fonction, une variable ou une unité." #: ../src/qalc.cc:3398 msgid "Example: info sin." msgstr "Exemple : info sin" #: ../src/qalc.cc:3402 msgid "Downloads current exchange rates from the Internet." msgstr "Télécharge les taux d'échange courants sur Internet." #: ../src/qalc.cc:3406 #, fuzzy msgid "(De)activates the Reverse Polish Notation stack and syntax." msgstr "(Dés)active le mode Notation Polonaise Inversée." #: ../src/qalc.cc:3408 msgid "" "\"syntax\" activates only the RPN syntax and \"stack\" enables the RPN stack." msgstr "" #: ../src/qalc.cc:3412 #, fuzzy msgid "Clears the entire RPN stack." msgstr "Vide la pile NPI." #: ../src/qalc.cc:3416 #, fuzzy msgid "Removes the top of the RPN stack or the value at the specified index." msgstr "Aucune fonction, variable ou unité avec le nom indiqué n'existe." #: ../src/qalc.cc:3418 ../src/qalc.cc:3430 ../src/qalc.cc:3440 #: ../src/qalc.cc:3450 msgid "" "Index 1 is the top of stack and negative index values counts from the bottom " "of the stack." msgstr "" #: ../src/qalc.cc:3422 msgid "Displays the RPN stack." msgstr "Affiche la pile NPI." #: ../src/qalc.cc:3426 msgid "Swaps position of values on the RPN stack." msgstr "" #: ../src/qalc.cc:3428 msgid "" "If no index is specified, the values on the top of the stack (index 1 and " "index 2) will be swapped and if only one index is specified, the value at " "this index will be swapped with the top value." msgstr "" #: ../src/qalc.cc:3432 #, fuzzy msgid "Example: swap 2 4" msgstr "Exemple : store var1" #: ../src/qalc.cc:3436 msgid "Duplicates a value on the RPN stack to the top of the stack." msgstr "" #: ../src/qalc.cc:3438 msgid "If no index is specified, the top of the stack is duplicated." msgstr "" #: ../src/qalc.cc:3444 msgid "Rotates the RPN stack up (default) or down." msgstr "" #: ../src/qalc.cc:3448 msgid "Changes the position of a value on the RPN stack." msgstr "" #: ../src/qalc.cc:3452 #, fuzzy msgid "Example: move 2 4" msgstr "Exemple : store var1" #: ../src/qalc.cc:3456 msgid "Sets the result number base (equivalent to set base)." msgstr "" #: ../src/qalc.cc:3460 msgid "Equivalent to set approximation exact." msgstr "" #: ../src/qalc.cc:3464 msgid "Equivalent to set approximation try exact." msgstr "" #: ../src/qalc.cc:3469 #, fuzzy msgid "Converts units or changes number base in current result." msgstr "Convertit les unités dans le résultat courant." #: ../src/qalc.cc:3471 #, fuzzy msgid "Possible values:" msgstr "Les valeurs d'unité possibles sont :" #: ../src/qalc.cc:3473 #, fuzzy msgid "- a unit (e.g. meter)" msgstr "une unité (exemple : mètre)" #: ../src/qalc.cc:3474 msgid "prepend with ? to request the optimal prefix" msgstr "" #: ../src/qalc.cc:3475 msgid "prepend with + or - to force/disable use of mixed units" msgstr "" #: ../src/qalc.cc:3476 #, fuzzy msgid "- a unit expression (e.g. km/h)" msgstr "une expression d'unités (exemple : km/h)" #: ../src/qalc.cc:3477 msgid "- a physical constant (e.g. c)" msgstr "" #: ../src/qalc.cc:3478 #, fuzzy msgid "- base (convert to base units)" msgstr "base (convertit en unités de base)" #: ../src/qalc.cc:3479 #, fuzzy msgid "- optimal (convert to optimal unit)" msgstr "base (convertit en unités de base)" #: ../src/qalc.cc:3480 msgid "- mixed (convert to mixed units, e.g. hours + minutes)" msgstr "" #: ../src/qalc.cc:3482 msgid "- bin / binary (show as binary number)" msgstr "" #: ../src/qalc.cc:3483 msgid "- oct / octal (show as octal number)" msgstr "" #: ../src/qalc.cc:3484 msgid "- duo / duodecimal (show as duodecimal number)" msgstr "" #: ../src/qalc.cc:3485 msgid "- hex / hexadecimal (show as hexadecimal number)" msgstr "" #: ../src/qalc.cc:3486 msgid "- sex / sexagesimal (show as sexagesimal number)" msgstr "" #: ../src/qalc.cc:3487 #, fuzzy msgid "- roman (show as roman numerals)" msgstr "Erreur dans les chiffres romains : %s." #: ../src/qalc.cc:3488 msgid "- time (show in time format)" msgstr "" #: ../src/qalc.cc:3489 msgid "- bases (show as binary, octal, decimal and hexadecimal number)" msgstr "" #: ../src/qalc.cc:3491 msgid "- rectangular / cartesian (show complex numbers in rectangular form)" msgstr "" #: ../src/qalc.cc:3492 msgid "- exponential (show complex numbers in exponential form)" msgstr "" #: ../src/qalc.cc:3493 msgid "- polar (show complex numbers in polar form)" msgstr "" #: ../src/qalc.cc:3495 msgid "- fraction (show result in combined fractional format)" msgstr "" #: ../src/qalc.cc:3496 #, fuzzy msgid "- factors (factorize result)" msgstr "Factorise le résultat courant." #: ../src/qalc.cc:3498 msgid "- utc (show UTC date)" msgstr "" #: ../src/qalc.cc:3499 msgid "- calendars" msgstr "" #: ../src/qalc.cc:3501 #, fuzzy msgid "Example: to ?g" msgstr "Exemple : store var1" #: ../src/qalc.cc:3504 msgid "" "This command can also be typed directly at the end of the mathematical " "expression." msgstr "" #: ../src/qalc.cc:3509 msgid "Terminates this program." msgstr "Termine ce programme." #: ../src/qalc.cc:3514 msgid "" "Implicit multiplication does not differ from explicit multiplication " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." msgstr "" #: ../src/qalc.cc:3517 msgid "" "Implicit multiplication is parsed before explicit multiplication " "(\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." msgstr "" #: ../src/qalc.cc:3520 msgid "" "The default adaptive mode works as the \"implicit first\" mode, unless " "spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the " "adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/" "(5*(m/s)) = 1 s\")." msgstr "" #: ../src/qalc.cc:3522 msgid "" "Function arguments without parentheses are an exception, where implicit " "multiplication in front of variables and units is parsed first regardless of " "mode (\"sqrt 2x = sqrt(2x)\")." msgstr "" #: ../src/qalc.cc:3536 #, fuzzy msgid "Unknown command." msgstr "Chiffre romain inconnu : %c." #: ../src/qalc.cc:3585 msgid "error" msgstr "erreur" #: ../src/qalc.cc:3587 msgid "warning" msgstr "avertissement" #: ../src/qalc.cc:3663 ../src/qalc.cc:3701 ../src/qalc.cc:3997 #: ../src/qalc.cc:4401 ../libqalculate/Calculator.cc:10016 #: ../libqalculate/MathStructure.cc:713 #, c-format msgid "aborted" msgstr "interrompu" #: ../src/qalc.cc:3713 msgid "RPN Register Moved" msgstr "Registre NPI déplacé" #: ../src/qalc.cc:3769 msgid "Processing (press Enter to abort)" msgstr "Calcul en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:3856 ../src/qalc.cc:4549 msgid "approx." msgstr "" #: ../src/qalc.cc:4014 msgid "Factorizing (press Enter to abort)" msgstr "Factorisation en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:4018 msgid "Expanding partial fractions…" msgstr "" #: ../src/qalc.cc:4022 msgid "Simplifying (press Enter to abort)" msgstr "Simplification en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:4026 ../src/qalc.cc:4415 msgid "Calculating (press Enter to abort)" msgstr "Calcul en cours (appuyez sur Entrée pour interrompre)" #: ../src/qalc.cc:4500 msgid "RPN Operation" msgstr "Opération NPI" #: ../src/qalc.cc:4969 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "Impossible d'écrire les préférences pour\n" " %s" #: ../src/qalc.cc:5056 msgid "Couldn't write definitions" msgstr "Impossible d'écrire les définitions" #: ../libqalculate/BuiltinFunctions.cc:68 #, c-format msgid "Too many elements (%s) for the dimensions (%sx%s) of the matrix." msgstr "Trop d'éléments (%s) pour les dimensions (%sx%s) de la matrice." #: ../libqalculate/BuiltinFunctions.cc:131 #: ../libqalculate/BuiltinFunctions.cc:193 #, c-format msgid "Row %s does not exist in matrix." msgstr "La ligne %s n'existe pas dans la matrice." #: ../libqalculate/BuiltinFunctions.cc:144 #: ../libqalculate/BuiltinFunctions.cc:189 #, c-format msgid "Column %s does not exist in matrix." msgstr "La colonne %s n'existe pas dans la matrice." #: ../libqalculate/BuiltinFunctions.cc:204 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "Le troisième argument, %s, est ignoré pour les vecteurs." #: ../libqalculate/BuiltinFunctions.cc:208 #: ../libqalculate/BuiltinFunctions.cc:229 #, c-format msgid "Element %s does not exist in vector." msgstr "L'élément %s n'existe pas dans le vecteur." #: ../libqalculate/BuiltinFunctions.cc:370 #: ../libqalculate/BuiltinFunctions.cc:374 #: ../libqalculate/BuiltinFunctions.cc:406 #: ../libqalculate/BuiltinFunctions.cc:410 #, c-format msgid "%s() requires that all matrices/vectors have the same dimensions." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4274 #: ../libqalculate/BuiltinFunctions.cc:4317 #, c-format msgid "Unsolvable comparison in %s()." msgstr "Comparaison impossible à résoudre dans %s()." #: ../libqalculate/BuiltinFunctions.cc:4400 #: ../libqalculate/BuiltinFunctions.cc:4434 msgid "gregorian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4401 msgid "milankovic" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4402 msgid "julian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4403 msgid "islamic" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4404 msgid "hebrew" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4405 msgid "egyptian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4406 msgid "persian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4407 #, fuzzy msgid "coptic" msgstr "optionnel" #: ../libqalculate/BuiltinFunctions.cc:4408 msgid "ethiopian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4409 msgid "indian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4410 msgid "chinese" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4895 msgid "" "The number of requested elements in generate vector function must be a " "positive integer." msgstr "" "Le nombre d'éléments requis pour générer une fonction vectorielle doit être " "un entier positif." #: ../libqalculate/BuiltinFunctions.cc:5211 #: ../libqalculate/BuiltinFunctions.cc:5215 #, c-format msgid "Too few elements (%s) in vector (%s required)" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:5264 #: ../libqalculate/BuiltinFunctions.cc:5281 msgid "Comparison failed." msgstr "La comparaison a échoué." #: ../libqalculate/BuiltinFunctions.cc:5269 #: ../libqalculate/BuiltinFunctions.cc:5299 msgid "No matching item found." msgstr "Aucun élément correspondant trouvé." #: ../libqalculate/BuiltinFunctions.cc:5397 #, c-format msgid "Object %s does not exist." msgstr "L'objet %s n'existe pas." #: ../libqalculate/BuiltinFunctions.cc:5415 #, fuzzy, c-format msgid "Invalid variable name (%s)." msgstr "un nom de variable valide" #: ../libqalculate/BuiltinFunctions.cc:5432 msgid "" "A global unit or variable was deactivated. It will be restored after the new " "variable has been removed." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:5447 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "Le registre %s n'existe pas. Valeur renvoyée : zéro." #: ../libqalculate/BuiltinFunctions.cc:5796 #: ../libqalculate/MathStructure.cc:203 ../libqalculate/MathStructure.cc:235 #: ../libqalculate/MathStructure.cc:276 #, c-format msgid "To avoid division by zero, the following must be true: %s." msgstr "Pour éviter la division par zéro, ce qui suit doit être vrai : %s" #: ../libqalculate/BuiltinFunctions.cc:5852 #: ../libqalculate/BuiltinFunctions.cc:5879 #: ../libqalculate/BuiltinFunctions.cc:5899 #: ../libqalculate/BuiltinFunctions.cc:5940 #: ../libqalculate/BuiltinFunctions.cc:6035 #: ../libqalculate/BuiltinFunctions.cc:6125 #, fuzzy msgid "Unable to integrate the expression." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:5950 #: ../libqalculate/BuiltinFunctions.cc:5987 #, fuzzy msgid "Unable to integrate the expression exact." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:6073 #: ../libqalculate/BuiltinFunctions.cc:6116 msgid "Definite integral was approximated with unknown precision." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:6097 msgid "Definite integral was approximated." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:6339 msgid "" "No equality or inequality to solve. The entered expression to solve is not " "correct (ex. \"x + 5 = 3\" is correct)" msgstr "" "Pas d'égalité ou d'inégalité à résoudre. L'expression à résoudre que vous " "avez entrée est incorrecte (ex : \"x + 5 = 3\" est correcte)" #: ../libqalculate/BuiltinFunctions.cc:6386 #, c-format msgid "The comparison is true for all %s (with current assumptions)." msgstr "" "La comparaison est vraie pour tous les %s (avec les hypothèses courantes)." #: ../libqalculate/BuiltinFunctions.cc:6390 msgid "No possible solution was found (with current assumptions)." msgstr "" "Aucune solution possible n'a été trouvée (avec les hypothèses courantes)." #: ../libqalculate/BuiltinFunctions.cc:6394 #, c-format msgid "Was unable to completely isolate %s." msgstr "Impossible d'isoler complètement %s." #: ../libqalculate/BuiltinFunctions.cc:6398 #: ../libqalculate/BuiltinFunctions.cc:6566 #: ../libqalculate/BuiltinFunctions.cc:6661 #, c-format msgid "The comparison is true for all %s if %s." msgstr "La comparaison est vraie pour tous les %s si %s." #: ../libqalculate/BuiltinFunctions.cc:6402 #, c-format msgid "Was unable to isolate %s." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:6525 #: ../libqalculate/BuiltinFunctions.cc:6552 #: ../libqalculate/BuiltinFunctions.cc:6635 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed sign was " "therefor temporarily set as unknown." msgstr "" "Impossible d'isoler %s avec les hypothèses courantes. Le signe supposé a été " "temporairement défini comme inconnu." #: ../libqalculate/BuiltinFunctions.cc:6528 #: ../libqalculate/BuiltinFunctions.cc:6555 #: ../libqalculate/BuiltinFunctions.cc:6638 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed type and " "sign was therefor temporarily set as unknown." msgstr "" "Impossible d'isoler %s avec les hypothèses courantes. Le type et le signe " "supposés ont été temporairement définis comme inconnus." #: ../libqalculate/BuiltinFunctions.cc:6561 #: ../libqalculate/BuiltinFunctions.cc:6646 #, c-format msgid "The solution requires that %s." msgstr "La solution exige que %s." #: ../libqalculate/BuiltinFunctions.cc:6654 #, c-format msgid "Solution %s requires that %s." msgstr "La solution %s exige que %s." #: ../libqalculate/BuiltinFunctions.cc:6726 #, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "so that each equation at least contains the corresponding variable (if " "automatic reordering failed)." msgstr "" "Impossible d'isoler %s.\n" "\n" "Vous pourriez placer les équations et les variables dans un ordre approprié " "pour que chaque équation contienne au moins la variable correspondante (si " "le réordonnement automatique a échoué)." #: ../libqalculate/BuiltinFunctions.cc:6728 #: ../libqalculate/BuiltinFunctions.cc:6742 #: ../libqalculate/BuiltinFunctions.cc:6751 #, c-format msgid "Unable to isolate %s." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:6735 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "Les inégalités ne sont pas autorisées dans %s." #: ../libqalculate/BuiltinFunctions.cc:7078 #: ../libqalculate/BuiltinFunctions.cc:7083 msgid "No differential equation found." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:7087 #: ../libqalculate/BuiltinFunctions.cc:7116 #: ../libqalculate/BuiltinFunctions.cc:7122 msgid "Unable to solve differential equation." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:7148 #, fuzzy msgid "Unable to find limit." msgstr "Impossible d'isoler %s." #: ../libqalculate/BuiltinFunctions.cc:7195 #: ../libqalculate/BuiltinFunctions.cc:7209 #, fuzzy msgid "Matrix" msgstr "matrice" #: ../libqalculate/BuiltinFunctions.cc:7220 #: ../libqalculate/BuiltinFunctions.cc:7273 #, fuzzy msgid "Vector" msgstr "vecteur" #: ../libqalculate/BuiltinFunctions.cc:7235 #: ../libqalculate/BuiltinFunctions.cc:7284 ../libqalculate/Calculator.cc:10566 msgid "Unable to generate plot data with current min, max and step size." msgstr "" "Impossible de générer des données graphiques avec les valeurs actuelles min, " "max et pas." #: ../libqalculate/BuiltinFunctions.cc:7237 #: ../libqalculate/BuiltinFunctions.cc:7286 msgid "Sampling rate must be a positive integer." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:7246 #: ../libqalculate/BuiltinFunctions.cc:7295 ../libqalculate/Calculator.cc:10533 msgid "Unable to generate plot data with current min, max and sampling rate." msgstr "" "Impossible de générer des données graphiques avec les valeurs actuelles min, " "max et taux d'échantillonage." #: ../libqalculate/Calculator.cc:390 msgid "per" msgstr "par" #: ../libqalculate/Calculator.cc:392 msgid "times" msgstr "fois" #: ../libqalculate/Calculator.cc:394 msgid "plus" msgstr "" #: ../libqalculate/Calculator.cc:396 msgid "minus" msgstr "moins" #: ../libqalculate/Calculator.cc:398 ../libqalculate/MathStructure.cc:18761 #: ../libqalculate/Function.cc:1223 ../libqalculate/Function.cc:1231 #: ../libqalculate/Function.cc:1660 ../libqalculate/Function.cc:1822 #: ../libqalculate/Function.cc:1830 msgid "and" msgstr "et" #: ../libqalculate/Calculator.cc:402 ../libqalculate/DataSet.cc:1046 #: ../libqalculate/DataSet.cc:1109 ../libqalculate/MathStructure.cc:18776 #: ../libqalculate/Function.cc:2161 ../libqalculate/Function.cc:2177 msgid "or" msgstr "ou" #: ../libqalculate/Calculator.cc:449 ../libqalculate/Calculator.cc:1240 #: ../libqalculate/Calculator.cc:2622 ../libqalculate/Calculator.cc:2629 #: ../libqalculate/Calculator.cc:2630 msgid " to " msgstr " à " #: ../libqalculate/Calculator.cc:535 msgid "Gradians unit is missing. Creating one for this session." msgstr "L'unité grade manque. Création pour cette session." #: ../libqalculate/Calculator.cc:536 ../libqalculate/Calculator.cc:544 #: ../libqalculate/Calculator.cc:552 msgid "Angle/Plane Angle" msgstr "Angle Plan/Solide" #: ../libqalculate/Calculator.cc:543 msgid "Radians unit is missing. Creating one for this session." msgstr "L'unité radian manque. Création pour cette session." #: ../libqalculate/Calculator.cc:551 msgid "Degrees unit is missing. Creating one for this session." msgstr "L'unité degré manque. Création pour cette session." #: ../libqalculate/Calculator.cc:1631 ../libqalculate/Calculator.cc:1632 #: ../libqalculate/Calculator.cc:10080 ../libqalculate/Calculator.cc:10217 #: ../libqalculate/Calculator.cc:10275 msgid "Currency" msgstr "Devise" #: ../libqalculate/Calculator.cc:1818 msgid "" "The calculation has been forcibly terminated. Please restart the application " "and report this as a bug." msgstr "" #: ../libqalculate/Calculator.cc:2094 ../libqalculate/Calculator.cc:2219 msgid "Stack is empty. Filling remaining function arguments with zeroes." msgstr "" #: ../libqalculate/Calculator.cc:2573 msgid "calculating..." msgstr "calculs en cours..." #: ../libqalculate/Calculator.cc:4191 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or " "the variable will be lost." msgstr "" "\"%s\" n'est plus autorisé dans les noms. Changez s'il vous plaît le nom de " "\"%s\", ou la variable sera perdue." #: ../libqalculate/Calculator.cc:4209 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the function will be lost." msgstr "" "\"%s\" n'est plus autorisé dans les noms. Changez s'il vous plaît le nom \"%s" "\", ou la fonction sera perdue." #: ../libqalculate/Calculator.cc:4226 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the unit will be lost." msgstr "" "\"%s\" n'est plus autorisé dans les noms. Changez s'il vous plaît le nom \"%s" "\", ou l'unité sera perdue." #: ../libqalculate/Calculator.cc:5589 ../libqalculate/Calculator.cc:6546 #: ../libqalculate/Calculator.cc:6553 ../libqalculate/Calculator.cc:6574 #: ../libqalculate/Calculator.cc:6595 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "Opérateur(s) mal placé(s), \"%s\" ignoré" #: ../libqalculate/Calculator.cc:5630 ../libqalculate/Calculator.cc:6614 #, c-format msgid "Misplaced '%c' ignored" msgstr "L'élément mal placé '%c' ignoré" #: ../libqalculate/Calculator.cc:5662 ../libqalculate/Function.cc:1381 #: ../libqalculate/Function.cc:1412 #, c-format msgid "Internal id %s does not exist." msgstr "L'identificateur interne %s n'existe pas." #: ../libqalculate/Calculator.cc:5680 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\" n'est pas une variable/fonction/unité valide." #: ../libqalculate/Calculator.cc:5695 #, c-format msgid "" "Trailing characters \"%s\" (not a valid variable/function/unit) in number " "\"%s\" was ignored." msgstr "" "Les caractères de fin \"%s\" (variable/fonction/unité non valide) dans le " "nombre \"%s\" ont été ignorés." #: ../libqalculate/Calculator.cc:6153 msgid "RPN syntax error. Values left at the end of the RPN expression." msgstr "" "Erreur de syntaxe NPI. Des valeurs subsistent à la fin de l'expression NPI." #: ../libqalculate/Calculator.cc:6156 msgid "Unused stack values." msgstr "Valeurs de pile inutilisées." #: ../libqalculate/Calculator.cc:6195 ../libqalculate/Calculator.cc:6263 #, fuzzy, c-format msgid "RPN syntax error. Operator '%c' not supported." msgstr "Erreur de syntaxe NPI. La pile est vide." #: ../libqalculate/Calculator.cc:6223 msgid "RPN syntax error. Stack is empty." msgstr "Erreur de syntaxe NPI. La pile est vide." #: ../libqalculate/Calculator.cc:6225 msgid "RPN syntax error. Operator ignored as there where only one stack value." msgstr "" "Erreur de syntaxe NPI. L'opérateur a été ignoré comme si il n'y avait qu'une " "seule valeur de pile." #: ../libqalculate/Calculator.cc:6855 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "Le nom \"%s\" est utilisé. Remplacement par \"%s\"." #: ../libqalculate/Calculator.cc:7541 ../libqalculate/DataSet.cc:529 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "Fichier non identifié comme fichier de définitions Qalculate! : %s." #: ../libqalculate/Calculator.cc:9581 ../libqalculate/DataSet.cc:353 msgid "Object" msgstr "Objet" #: ../libqalculate/Calculator.cc:9590 ../libqalculate/DataSet.cc:354 msgid "Property" msgstr "Propriété" #: ../libqalculate/Calculator.cc:9889 msgid "column" msgstr "colonne" #: ../libqalculate/Calculator.cc:9892 msgid "Column " msgstr "Colonne" #: ../libqalculate/Calculator.cc:9968 ../libqalculate/Calculator.cc:10015 msgid "timed out" msgstr "délai expiré" #: ../libqalculate/Calculator.cc:10387 ../libqalculate/Calculator.cc:10388 #: ../libqalculate/Calculator.cc:10392 ../libqalculate/Calculator.cc:10395 #: ../libqalculate/Calculator.cc:10427 ../libqalculate/Calculator.cc:10428 #: ../libqalculate/Calculator.cc:10431 ../libqalculate/Calculator.cc:10450 #: ../libqalculate/Calculator.cc:10451 ../libqalculate/Calculator.cc:10454 #, c-format msgid "Failed to download exchange rates from %s: %s." msgstr "Échec du téléchargement des taux d'échange sur %s: %s." #: ../libqalculate/Calculator.cc:10529 ../libqalculate/Calculator.cc:10562 #: ../libqalculate/Calculator.cc:10595 ../libqalculate/Calculator.cc:10934 msgid "It took too long to generate the plot data." msgstr "" #: ../libqalculate/Calculator.cc:10629 msgid "No extension in file name. Saving as PNG image." msgstr "" "Pas d'extension dans le nom de fichier. Enregistrement comme image PNG." #: ../libqalculate/Calculator.cc:10648 msgid "Unknown extension in file name. Saving as PNG image." msgstr "" "Extension inconnu dans le nom de fichier. Enregistrement comme fichier PNG." #: ../libqalculate/Calculator.cc:10865 #, c-format msgid "Could not create temporary file %s" msgstr "Impossible de créer le fichier temporaire %s" #: ../libqalculate/Calculator.cc:10981 msgid "" "Failed to invoke gnuplot. Make sure that you have gnuplot installed in your " "path." msgstr "" "Impossible d'appeler gnuplot. Assurez vous que gnuplot est installé dans " "votre path." #: ../libqalculate/DataSet.cc:379 #, c-format msgid "Object %s not available in data set." msgstr "L'objet %s n'est pas disponible dans l'ensemble de données." #: ../libqalculate/DataSet.cc:389 #, c-format msgid "Property %s not available in data set." msgstr "La propriété %s n'est pas disponible dans l'ensemble de données." #: ../libqalculate/DataSet.cc:394 #, c-format msgid "Property %s not defined for object %s." msgstr "La propriété %s n'est pas définie pour l'objet %s." #: ../libqalculate/DataSet.cc:507 ../libqalculate/DataSet.cc:515 #, c-format msgid "Unable to load data objects in %s." msgstr "Impossible de charger les objets de données dans %s." #: ../libqalculate/DataSet.cc:1016 msgid "data property" msgstr "propriété des données" #: ../libqalculate/DataSet.cc:1018 msgid "name of a data property" msgstr "nom d'une propriété de données" #: ../libqalculate/DataSet.cc:1026 ../libqalculate/DataSet.cc:1042 msgid "no properties available" msgstr "aucune propriété n'est disponible" #: ../libqalculate/DataSet.cc:1076 #, c-format msgid "" "Data set \"%s\" has no object key that supports the provided argument type." msgstr "" "L'ensemble de données \"%s\" n'a pas de clé d'objet qui supporte le type " "d'argument entré." #: ../libqalculate/DataSet.cc:1081 msgid "data object" msgstr "objet de données" #: ../libqalculate/DataSet.cc:1083 msgid "an object from" msgstr "un objet de" #: ../libqalculate/DataSet.cc:1112 msgid "use" msgstr "utilisation" #: ../libqalculate/MathStructure.cc:174 #, fuzzy, c-format msgid "Required assumption: %s." msgstr "Hypothèse non reconnue" #: ../libqalculate/MathStructure.cc:3792 ../libqalculate/MathStructure.cc:3813 #, c-format msgid "" "The second matrix must have as many rows (was %s) as the first has columns " "(was %s) for matrix multiplication." msgstr "" "La seconde matrice doit avoir autant de lignes (valeur actuelle : %s) que la " "première a de colonnes (valeur actuelle : %s) pour la multiplication " "matricielle." #: ../libqalculate/MathStructure.cc:8265 ../libqalculate/MathStructure.cc:8306 #: ../libqalculate/MathStructure.cc:8339 ../libqalculate/MathStructure.cc:8406 #: ../libqalculate/MathStructure.cc:8434 ../libqalculate/MathStructure.cc:8453 #: ../libqalculate/MathStructure.cc:8472 ../libqalculate/MathStructure.cc:8491 #: ../libqalculate/MathStructure.cc:8600 ../libqalculate/MathStructure.cc:14408 #: ../libqalculate/MathStructure.cc:14684 msgid "This is a bug. Please report it." msgstr "Ceci est un bogue. Merci de le reporter." #: ../libqalculate/MathStructure.cc:10980 #: ../libqalculate/MathStructure.cc:10985 #, c-format msgid "Limit for %s determined graphically." msgstr "" #: ../libqalculate/MathStructure.cc:11792 msgid "Interval potentially calculated wide." msgstr "" #: ../libqalculate/MathStructure.cc:16085 msgid "" "Because of time constraints only a limited number of combinations of terms " "were tried during factorization. Repeat factorization to try other random " "combinations." msgstr "" #: ../libqalculate/MathStructure.cc:18860 msgid "undefined" msgstr "indéfini" #: ../libqalculate/MathStructure.cc:18901 #, c-format msgid "Unsolvable comparison at element %s when trying to rank vector." msgstr "" "Comparaison impossible à l'élément %s en essayant de classer le vecteur." #: ../libqalculate/MathStructure.cc:18951 #, c-format msgid "Unsolvable comparison at element %s when trying to sort vector." msgstr "Comparaison impossible à l'élément %s en essayant de trier le vecteur." #: ../libqalculate/MathStructure.cc:19376 msgid "The determinant can only be calculated for square matrices." msgstr "Le déterminant ne peut être calculé que pour les matrices carrées." #: ../libqalculate/MathStructure.cc:19439 msgid "The permanent can only be calculated for square matrices." msgstr "Le permanent ne peut être calculé que pour les matrice carrées." #: ../libqalculate/MathStructure.cc:19528 msgid "Inverse of singular matrix." msgstr "Inverse d'une matrice singulière." #: ../libqalculate/MathStructure.cc:19875 msgid "" "Calculations involving conversion of units without proportional linear " "relationship (e.g. with multiple temperature units), might give unexpected " "results and is not recommended." msgstr "" #: ../libqalculate/MathStructure.cc:20745 #: ../libqalculate/MathStructure.cc:20788 msgid "Too many data points" msgstr "" #: ../libqalculate/MathStructure.cc:20752 msgid "" "The selected min and max do not result in a positive, finite number of data " "points" msgstr "" #: ../libqalculate/MathStructure.cc:20785 msgid "" "The selected min, max and step size do not result in a positive, finite " "number of data points" msgstr "" #: ../libqalculate/MathStructure.cc:27312 #: ../libqalculate/MathStructure.cc:27488 #: ../libqalculate/MathStructure.cc:28117 #: ../libqalculate/MathStructure.cc:28625 #: ../libqalculate/MathStructure.cc:28682 #: ../libqalculate/MathStructure.cc:28724 #: ../libqalculate/MathStructure.cc:28737 #: ../libqalculate/MathStructure.cc:28787 #: ../libqalculate/MathStructure.cc:28906 #: ../libqalculate/MathStructure.cc:29041 #, c-format msgid "Interval arithmetic was disabled during calculation of %s." msgstr "" #: ../libqalculate/MathStructure.cc:29040 #, c-format msgid "Not all complex roots were calculated for %s." msgstr "" #: ../libqalculate/MathStructure.cc:30450 #, c-format msgid "Only one or two of the roots where calculated for %s." msgstr "" #: ../libqalculate/Function.cc:165 #, c-format msgid "%s() requires that %s" msgstr "%s() exige que %s" #: ../libqalculate/Function.cc:320 ../libqalculate/Function.cc:379 #: ../libqalculate/Function.cc:439 #, c-format msgid "" "Additional arguments for function %s() was ignored. Function can only use %s " "argument(s)." msgstr "" "Les arguments supplémentaires de la fonction %s() ont été ignorés. La " "fonction ne peut utiliser que %s argument(s)." #: ../libqalculate/Function.cc:460 #, c-format msgid "You need at least %s argument(s) (%s) in function %s()." msgstr "" "Vous devez utiliser au moins %s argument(s) (%s) dans la fonction %s()." #: ../libqalculate/Function.cc:462 #, c-format msgid "You need at least %s argument(s) in function %s()." msgstr "Vous devez utiliser au moins %s argument(s) dans la fonction %s()." #: ../libqalculate/Function.cc:1213 msgid "a free value" msgstr "une valeur libre" #: ../libqalculate/Function.cc:1218 msgid "that is nonzero" msgstr "ceci est non nul" #: ../libqalculate/Function.cc:1226 msgid "that is rational (polynomial)" msgstr "ceci est rationnel (polynomial)" #: ../libqalculate/Function.cc:1234 msgid "that fulfills the condition:" msgstr "ceci remplit la condition :" #: ../libqalculate/Function.cc:1237 msgid "Argument" msgstr "" #: ../libqalculate/Function.cc:1301 #, c-format msgid "Argument %s in %s() must be %s." msgstr "L'argument %s de %s() doit être %s." #: ../libqalculate/Function.cc:1303 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "L'argument %s, %s, de %s() doit être %s." #: ../libqalculate/Function.cc:1641 msgid "a rational number" msgstr "un nombre rationnel" #: ../libqalculate/Function.cc:1643 msgid "a number" msgstr "un nombre" #: ../libqalculate/Function.cc:1645 msgid "a real number" msgstr "un nombre réel" #: ../libqalculate/Function.cc:1650 ../libqalculate/Function.cc:1803 #: ../libqalculate/Function.cc:1808 msgid ">=" msgstr "" #: ../libqalculate/Function.cc:1652 msgid ">" msgstr "" #: ../libqalculate/Function.cc:1664 ../libqalculate/Function.cc:1825 #: ../libqalculate/Function.cc:1832 msgid "<=" msgstr "" #: ../libqalculate/Function.cc:1666 msgid "<" msgstr "" #: ../libqalculate/Function.cc:1800 msgid "an integer" msgstr "un entier" #: ../libqalculate/Function.cc:1857 msgid "symbol" msgstr "symbole" #: ../libqalculate/Function.cc:1858 msgid "an unknown variable/symbol" msgstr "une variable / un symbole inconnu" #: ../libqalculate/Function.cc:1871 msgid "text" msgstr "texte" #: ../libqalculate/Function.cc:1872 msgid "a text string" msgstr "une chaîne de caractères" #: ../libqalculate/Function.cc:1894 msgid "date" msgstr "" #: ../libqalculate/Function.cc:1895 msgid "a date" msgstr "une date" #: ../libqalculate/Function.cc:1944 msgid "a vector with " msgstr "en vecteur avec" #: ../libqalculate/Function.cc:1956 msgid "a vector" msgstr "un vecteur" #: ../libqalculate/Function.cc:2005 msgid "a square matrix" msgstr "une matrice carrée" #: ../libqalculate/Function.cc:2007 msgid "a matrix" msgstr "une matrice" #: ../libqalculate/Function.cc:2022 msgid "object" msgstr "objet" #: ../libqalculate/Function.cc:2023 msgid "a valid function, unit or variable name" msgstr "une fonction, une unité ou un nom de variable valide" #: ../libqalculate/Function.cc:2037 msgid "a valid function name" msgstr "un nom de fonction valide" #: ../libqalculate/Function.cc:2050 msgid "unit" msgstr "unité" #: ../libqalculate/Function.cc:2051 msgid "a valid unit name" msgstr "un nom d'unité valide" #: ../libqalculate/Function.cc:2065 msgid "a valid variable name" msgstr "un nom de variable valide" #: ../libqalculate/Function.cc:2078 msgid "file" msgstr "fichier" #: ../libqalculate/Function.cc:2079 msgid "a valid file name" msgstr "un nom de fichier valide" #: ../libqalculate/Function.cc:2092 msgid "boolean" msgstr "booléen" #: ../libqalculate/Function.cc:2093 msgid "a boolean (0 or 1)" msgstr "un booléen (0 ou 1)" #: ../libqalculate/Function.cc:2103 msgid "angle" msgstr "" #: ../libqalculate/Function.cc:2104 msgid "an angle or a number (using the default angle unit)" msgstr "un angle ou un nombre (en utilisant l'unité d'angle par défaut)" #: ../libqalculate/Number.cc:235 ../libqalculate/Number.cc:6709 msgid "" "Cannot display numbers greater than 9999 or less than -9999 as roman " "numerals." msgstr "" "Impossible 'afficher des nombres plus grands que 9999 ou plus petits que " "-9999 en chiffres romains." #: ../libqalculate/Number.cc:348 msgid "" "Assuming the unusual practice of letting a last capital I mean 2 in a roman " "numeral." msgstr "" "Hypothèse qu'on applique la pratique inhabituelle de laisser I comme " "capitale finale signifie 2 en chiffres romains." #: ../libqalculate/Number.cc:426 #, c-format msgid "Error in roman numerals: %s." msgstr "Erreur dans les chiffres romains : %s." #: ../libqalculate/Number.cc:461 #, c-format msgid "Unknown roman numeral: %c." msgstr "Chiffre romain inconnu : %c." #: ../libqalculate/Number.cc:519 #, c-format msgid "" "Errors in roman numerals: \"%s\". Interpreted as %s, which should be written " "as %s." msgstr "" "Erreurs dans les chiffres romains : \"%s\". Interprété comme %s, qui devrait " "être écrit %s." #: ../libqalculate/Number.cc:601 #, fuzzy msgid "Too large exponent." msgstr "afficher les exposants négatifs" #: ../libqalculate/Number.cc:630 msgid "':' in decimal number ignored (decimal point detected)." msgstr "':' dans les nombres décimaux ignoré (point décimal détecté)" #: ../libqalculate/Number.cc:660 #, c-format msgid "Character '%c' was ignored in the number \"%s\" with base %s." msgstr "Le caractère '%c' a été ignoré dans le nombre \"%s\" avec la base %s." #: ../libqalculate/Number.cc:1649 ../libqalculate/Number.cc:1771 msgid "Floating point underflow" msgstr "" #: ../libqalculate/Number.cc:1650 ../libqalculate/Number.cc:1772 msgid "Floating point overflow" msgstr "" #: ../libqalculate/Number.cc:1651 ../libqalculate/Number.cc:1773 msgid "Floating point division by zero exception" msgstr "" #: ../libqalculate/Number.cc:1652 ../libqalculate/Number.cc:1776 msgid "Floating point not a number exception" msgstr "" #: ../libqalculate/Number.cc:1653 ../libqalculate/Number.cc:1774 msgid "Floating point range exception" msgstr "" #: ../libqalculate/Number.cc:3222 msgid "Division by zero." msgstr "Division par zéro." #. 0^0 #: ../libqalculate/Number.cc:3228 msgid "0^0 might be considered undefined" msgstr "0^0 sera considéré comme indéfini" #: ../libqalculate/Number.cc:3235 msgid "The result of 0^i is possibly undefined" msgstr "" #: ../libqalculate/Number.cc:3284 ../libqalculate/Number.cc:4985 #: ../libqalculate/Number.cc:5096 ../libqalculate/Number.cc:5425 #: ../libqalculate/Number.cc:5433 ../libqalculate/Number.cc:5466 #: ../libqalculate/Number.cc:5563 ../libqalculate/Number.cc:5712 #: ../libqalculate/Number.cc:5824 msgid "Interval calculated wide." msgstr "" #: ../libqalculate/Number.cc:4542 msgid "Cannot handle an argument (s) that large for Riemann Zeta." msgstr "" "Impossible de supporter la fonction Zeta de Riemann pour un argument aussi " "grand." #: ../libqalculate/Number.cc:4617 ../libqalculate/Number.cc:4715 #: ../libqalculate/Number.cc:4746 ../libqalculate/Number.cc:4777 #: ../libqalculate/Number.cc:6169 #, c-format msgid "%s() lacks proper support interval arithmetic." msgstr "" #: ../libqalculate/Number.cc:6706 #, fuzzy msgid "Can only display rational numbers as roman numerals." msgstr "" "Impossible 'afficher des nombres plus grands que 9999 ou plus petits que " "-9999 en chiffres romains." #: ../libqalculate/Number.cc:7095 ../libqalculate/Number.cc:7103 msgid "infinity" msgstr "infini" #: ../libqalculate/QalculateDateTime.cc:25 msgid "January" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "February" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "March" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "April" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "May" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "June" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "July" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "August" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "September" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "October" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "November" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "December" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Thout" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paopi" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Hathor" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Koiak" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Tobi" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Meshir" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paremhat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Parmouti" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Pashons" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paoni" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Epip" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Mesori" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Pi Kogi Enavot" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Mäskäräm" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "ṬəqÉ™mt" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ḫədar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "TaḫśaÅ›" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ṭərr" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Yäkatit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Mägabit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Miyazya" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "GÉ™nbo" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Säne" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ḥamle" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Nähase" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "á¹–agume" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Muḥarram" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "á¹¢afar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rabī‘ al-awwal" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rabī‘ ath-thÄnÄ«" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "JumÄdá al-Å«lá" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "JumÄdá al-Äkhirah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rajab" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Sha‘bÄn" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Ramaá¸Än" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "ShawwÄl" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "DhÅ« al-Qa‘dah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "DhÅ« al-Ḥijjah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Farvardin" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Ordibehesht" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Khordad" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Tir" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Mordad" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Shahrivar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Mehr" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Aban" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Azar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 #, fuzzy msgid "Dey" msgstr "touche" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Bahman" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Esfand" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Chaitra" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "VaishÄkha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "JyÄ“shtha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Ä€shÄdha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "ShrÄvana" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Bhaadra" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Ä€shwin" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "KÄrtika" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Agrahayana" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Pausha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "MÄgha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Phalguna" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Wood" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Fire" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Earth" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Metal" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Water" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Ox" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Tiger" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rabbit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Dragon" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Snake" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Horse" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Goat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Monkey" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rooster" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Dog" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Pig" msgstr "" #: ../libqalculate/QalculateDateTime.cc:345 msgid "now" msgstr "maintenant" #: ../libqalculate/QalculateDateTime.cc:349 msgid "today" msgstr "aujourd'hui" #: ../libqalculate/QalculateDateTime.cc:353 msgid "tomorrow" msgstr "" #: ../libqalculate/QalculateDateTime.cc:358 msgid "yesterday" msgstr "" #: ../libqalculate/QalculateDateTime.cc:2599 msgid "leap month" msgstr "" #: ../libqalculate/Unit.cc:908 msgid "Error(s) in unitexpression." msgstr "Erreur(s) dans l'expression d'unités." #: ../libqalculate/Variable.cc:456 #, c-format msgid "Recursive variable: %s = %s" msgstr "" #: ../libqalculate/util.cc:175 msgid "Yes" msgstr "Oui" #: ../libqalculate/util.cc:176 msgid "No" msgstr "Non" #: ../libqalculate/util.cc:183 msgid "True" msgstr "Vrai" #: ../libqalculate/util.cc:184 msgid "False" msgstr "Faux" #: ../libqalculate/util.cc:191 msgid "On" msgstr "Marche" #: ../libqalculate/util.cc:192 msgid "Off" msgstr "Arrêt" #~ msgid "exp mode" #~ msgstr "mode exp" #~ msgid "negatve" #~ msgstr "strictement négatif" #~ msgid "dot as separator" #~ msgstr "point comme séparateur" #, fuzzy #~ msgid "comma as separator" #~ msgstr "point comme séparateur" #~ msgid "Error in date format for function %s()." #~ msgstr "Erreur dans le format de date pour la fonction %s()." #~ msgid "indicate infinite series" #~ msgstr "indiquer les séries infinies" #~ msgid "Can only handle Riemann Zeta with an integer argument (s) >= 1" #~ msgstr "" #~ "La fonction Zeta de Riemann ne peut être supportée qu'avec un argument " #~ "entier >= 1" #~ msgid "" #~ "Series %s contains non-numerical data (\"%s\" first of %s) which can not " #~ "be properly plotted." #~ msgstr "" #~ "La suite %s contient des données non numériques (\"%s\" premier de %s) " #~ "qui ne peut pas être correctement tracé." #~ msgid "" #~ "Series %s contains non-real data (\"%s\" first of %s) which can not be " #~ "properly plotted." #~ msgstr "" #~ "La suite %s contient des données non réelles (\"%s\" premier de %s) qui " #~ "ne peut pas être correctement tracé." #~ msgid "Failed to download exchange rates from ECB: %s" #~ msgstr "Échec du téléchargement des taux d'échange sur ECB: %s" #, fuzzy #~ msgid "Failed to download exchange rates from mycurrency.net: %s" #~ msgstr "Échec du téléchargement des taux d'échange sur ECB: %s" #~ msgid "%s() does at the moment only support integers and fractions of two." #~ msgstr "" #~ "%s ne supporte pour le moment que les entiers et les fractions de deux " #~ "entiers." #, fuzzy #~ msgid "An global unit or variable with the same name already exists." #~ msgstr "" #~ "Une unité ou une variable du même nom existe déjà.\n" #~ "Voulez-vous l'écraser? (défaut : non)" #~ msgid "" #~ "You need the download exchange rates to be able to convert between " #~ "different currencies.\n" #~ "You can later get current exchange rates with the \"exrates\" command.\n" #~ "Do you want to fetch exchange rates now from the Internet (default: yes)?" #~ msgstr "" #~ "Vous devez télécharger les taux d'échange pour pouvoir effectuer des " #~ "conversions entre les différentes devises.\n" #~ "Vous pouvez par la suite obtenir les taux d'échange actuels avec la " #~ "commande \"taux d'échange\"\n" #~ "Voulez-vous récupérer les taux d'échange sur Internet (défaut : oui) ?" #~ msgid "WGET ARGUMENTS" #~ msgstr "ARGUMENTS DE WGET" #~ msgid "The timestamp value for the date %s is too large or small for %s()." #~ msgstr "" #~ "La valeur du timestamp pour la date %s est trop grande ou trop petite " #~ "pour %s()." #, fuzzy #~ msgid "Temperature" #~ msgstr "Temporaire" #~ msgid "ON/OFF" #~ msgstr "MARCHE/ARRÊT" #~ msgid "UNIT" #~ msgstr "UNITÉ" #~ msgid "best (convert best unit)" #~ msgstr "meilleur (convertit dans la meilleure unité)" #~ msgid "Example: convert best." #~ msgstr "Exemple : convert best" #~ msgid "Decimal point in sexagesimal number treated as ':'." #~ msgstr "Point décimal dans les nombres sexagésimaux traité comme ':'." libqalculate-2.8.2/po/zh_CN.po0000644000175000017500000025754013370501720013100 00000000000000# translation of zh_CN.po to Simplified Chinese # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Roy Qu , 2007. msgid "" msgstr "" "Project-Id-Version: zh_CN\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-11-07 07:18+0100\n" "PO-Revision-Date: 2007-07-31 15:34+0800\n" "Last-Translator: Roy Qu \n" "Language-Team: Simplified Chinese\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #: ../src/qalc.cc:119 ../src/qalc.cc:186 ../src/qalc.cc:3106 #: ../libqalculate/util.cc:178 msgid "yes" msgstr "yes" #: ../src/qalc.cc:120 ../src/qalc.cc:188 ../src/qalc.cc:3106 #: ../libqalculate/util.cc:179 msgid "no" msgstr "no" #: ../src/qalc.cc:121 ../libqalculate/util.cc:186 msgid "true" msgstr "true" #: ../src/qalc.cc:122 ../libqalculate/util.cc:187 msgid "false" msgstr "false" #: ../src/qalc.cc:123 ../src/qalc.cc:653 ../src/qalc.cc:926 ../src/qalc.cc:958 #: ../src/qalc.cc:2560 ../src/qalc.cc:2583 ../src/qalc.cc:2628 #: ../src/qalc.cc:3105 ../src/qalc.cc:3210 ../src/qalc.cc:3231 #: ../src/qalc.cc:3263 ../libqalculate/util.cc:194 msgid "on" msgstr "on" #: ../src/qalc.cc:124 ../src/qalc.cc:631 ../src/qalc.cc:652 ../src/qalc.cc:835 #: ../src/qalc.cc:899 ../src/qalc.cc:911 ../src/qalc.cc:924 ../src/qalc.cc:956 #: ../src/qalc.cc:2559 ../src/qalc.cc:2564 ../src/qalc.cc:2571 #: ../src/qalc.cc:2581 ../src/qalc.cc:2608 ../src/qalc.cc:2615 #: ../src/qalc.cc:2627 ../src/qalc.cc:2652 ../src/qalc.cc:3105 #: ../src/qalc.cc:3208 ../src/qalc.cc:3214 ../src/qalc.cc:3218 #: ../src/qalc.cc:3231 ../src/qalc.cc:3237 ../src/qalc.cc:3244 #: ../src/qalc.cc:3261 ../src/qalc.cc:3288 ../libqalculate/util.cc:195 msgid "off" msgstr "off" #: ../src/qalc.cc:193 msgid "Please answer yes or no" msgstr "请回答yes或者no" #: ../src/qalc.cc:200 ../src/qalc.cc:590 ../src/qalc.cc:1274 #: ../src/qalc.cc:2474 ../src/qalc.cc:3051 ../src/qalc.cc:3126 #: ../src/qalc.cc:3332 msgid "unknown" msgstr "unknown" #: ../src/qalc.cc:206 ../src/qalc.cc:584 ../src/qalc.cc:1268 #: ../src/qalc.cc:2468 ../src/qalc.cc:3045 ../src/qalc.cc:3140 #: ../src/qalc.cc:3346 msgid "real" msgstr "real" #: ../src/qalc.cc:208 ../src/qalc.cc:586 ../src/qalc.cc:1270 #: ../src/qalc.cc:2470 ../src/qalc.cc:3047 ../src/qalc.cc:3138 #: ../src/qalc.cc:3344 ../libqalculate/Function.cc:1636 msgid "number" msgstr "number" #: ../src/qalc.cc:210 ../src/qalc.cc:583 ../src/qalc.cc:1267 #: ../src/qalc.cc:2467 ../src/qalc.cc:3044 ../src/qalc.cc:3142 #: ../src/qalc.cc:3348 msgid "rational" msgstr "rational" #: ../src/qalc.cc:212 ../src/qalc.cc:582 ../src/qalc.cc:1266 #: ../src/qalc.cc:2466 ../src/qalc.cc:3043 ../src/qalc.cc:3144 #: ../src/qalc.cc:3350 ../libqalculate/Function.cc:1797 msgid "integer" msgstr "integer" #: ../src/qalc.cc:214 ../src/qalc.cc:577 ../src/qalc.cc:1261 #: ../src/qalc.cc:2461 ../src/qalc.cc:3038 ../src/qalc.cc:3128 #: ../src/qalc.cc:3334 msgid "non-zero" msgstr "non-zero" #: ../src/qalc.cc:216 ../src/qalc.cc:573 ../src/qalc.cc:1257 #: ../src/qalc.cc:2457 ../src/qalc.cc:3034 ../src/qalc.cc:3130 #: ../src/qalc.cc:3336 msgid "positive" msgstr "positive" #: ../src/qalc.cc:218 ../src/qalc.cc:576 ../src/qalc.cc:1260 #: ../src/qalc.cc:2460 ../src/qalc.cc:3037 ../src/qalc.cc:3136 #: ../src/qalc.cc:3342 msgid "non-negative" msgstr "non-negative" #: ../src/qalc.cc:220 ../src/qalc.cc:575 ../src/qalc.cc:1259 #: ../src/qalc.cc:2459 ../src/qalc.cc:3036 ../src/qalc.cc:3132 #: ../src/qalc.cc:3338 msgid "negative" msgstr "negative" #: ../src/qalc.cc:222 ../src/qalc.cc:574 ../src/qalc.cc:1258 #: ../src/qalc.cc:2458 ../src/qalc.cc:3035 ../src/qalc.cc:3134 #: ../src/qalc.cc:3340 msgid "non-positive" msgstr "non-positive" #: ../src/qalc.cc:225 msgid "Unrecognized assumption." msgstr "未被承认的å‡è®¾" #: ../src/qalc.cc:463 ../libqalculate/Calculator.cc:10482 #, fuzzy, c-format msgid "It has been %s day(s) since the exchange rates last were updated." msgstr "è·ç¦»æœ€åŽä¸€æ¬¡æ±‡çŽ‡æ›´æ–°å·²è¶…è¿‡ä¸€å‘¨äº†ã€‚" #: ../src/qalc.cc:468 msgid "Do you wish to update the exchange rates now?" msgstr "" #: ../src/qalc.cc:482 ../src/qalc.cc:483 msgid "" "\n" "Press Enter to continue." msgstr "" "\n" "按回车键继续" #: ../src/qalc.cc:496 ../src/qalc.cc:497 ../src/qalc.cc:498 ../src/qalc.cc:499 #: ../src/qalc.cc:500 ../src/qalc.cc:501 ../src/qalc.cc:670 ../src/qalc.cc:673 #: ../src/qalc.cc:806 ../src/qalc.cc:817 ../src/qalc.cc:826 ../src/qalc.cc:2061 #: ../src/qalc.cc:2196 msgid "Illegal value" msgstr "éžæ³•值" #. qalc command #: ../src/qalc.cc:524 ../src/qalc.cc:771 ../src/qalc.cc:2039 #: ../src/qalc.cc:2409 ../src/qalc.cc:2415 ../src/qalc.cc:2535 #: ../src/qalc.cc:2670 ../src/qalc.cc:2704 ../src/qalc.cc:3184 #: ../src/qalc.cc:3301 ../src/qalc.cc:3454 ../src/qalc.cc:4229 #: ../src/qalc.cc:4240 ../libqalculate/Calculator.cc:2503 #: ../libqalculate/Calculator.cc:2507 msgid "base" msgstr "base" #: ../src/qalc.cc:524 ../src/qalc.cc:526 ../src/qalc.cc:2636 #: ../src/qalc.cc:3273 msgid "input base" msgstr "input base" #: ../src/qalc.cc:524 msgid "output base" msgstr "output base" #: ../src/qalc.cc:527 ../src/qalc.cc:2290 ../src/qalc.cc:2537 #: ../src/qalc.cc:2638 ../src/qalc.cc:3196 ../src/qalc.cc:3281 #: ../src/qalc.cc:4148 ../libqalculate/Calculator.cc:2472 msgid "roman" msgstr "roman" #: ../src/qalc.cc:528 ../src/qalc.cc:2300 ../src/qalc.cc:2539 #: ../src/qalc.cc:3194 ../src/qalc.cc:4164 ../libqalculate/Calculator.cc:2478 msgid "time" msgstr "time" #: ../src/qalc.cc:529 ../src/qalc.cc:2270 ../src/qalc.cc:4116 #: ../libqalculate/Calculator.cc:2460 msgid "hexadecimal" msgstr "hexadecimal" #: ../src/qalc.cc:530 ../src/qalc.cc:2285 ../src/qalc.cc:4140 #: ../libqalculate/Calculator.cc:2469 #, fuzzy msgid "duodecimal" msgstr "decimal" #: ../src/qalc.cc:531 ../src/qalc.cc:2275 ../src/qalc.cc:4124 #: ../libqalculate/Calculator.cc:2463 msgid "binary" msgstr "binary" #: ../src/qalc.cc:532 ../src/qalc.cc:2280 ../src/qalc.cc:4132 #: ../libqalculate/Calculator.cc:2466 msgid "octal" msgstr "octal" #: ../src/qalc.cc:533 msgid "decimal" msgstr "decimal" #: ../src/qalc.cc:534 ../src/qalc.cc:2295 ../src/qalc.cc:2538 #: ../src/qalc.cc:4156 ../libqalculate/Calculator.cc:2475 msgid "sexagesimal" msgstr "sexagesimal" #: ../src/qalc.cc:551 ../src/qalc.cc:614 ../src/qalc.cc:2543 #: ../src/qalc.cc:3201 msgid "base display" msgstr "base display" #: ../src/qalc.cc:555 msgid "Illegal base." msgstr "Illegal base." #: ../src/qalc.cc:563 ../src/qalc.cc:591 ../src/qalc.cc:2475 #: ../src/qalc.cc:3123 msgid "assumptions" msgstr "assumptions" #: ../src/qalc.cc:585 ../src/qalc.cc:1269 ../src/qalc.cc:2469 #: ../src/qalc.cc:3046 msgid "complex" msgstr "complex" #: ../src/qalc.cc:587 ../src/qalc.cc:1271 ../src/qalc.cc:2471 #: ../src/qalc.cc:3048 msgid "non-matrix" msgstr "non-matrix" #: ../src/qalc.cc:594 ../src/qalc.cc:2661 ../src/qalc.cc:3293 msgid "all prefixes" msgstr "all prefixes" #: ../src/qalc.cc:595 ../src/qalc.cc:2501 ../src/qalc.cc:3162 msgid "complex numbers" msgstr "complex numbers" #: ../src/qalc.cc:596 ../src/qalc.cc:2519 ../src/qalc.cc:3174 msgid "excessive parentheses" msgstr "excessive parentheses" #: ../src/qalc.cc:597 ../src/qalc.cc:2502 ../src/qalc.cc:2758 #: ../src/qalc.cc:2763 ../src/qalc.cc:3163 msgid "functions" msgstr "functions" #: ../src/qalc.cc:598 ../src/qalc.cc:2503 ../src/qalc.cc:3164 msgid "infinite numbers" msgstr "infinite numbers" #: ../src/qalc.cc:599 ../src/qalc.cc:2527 ../src/qalc.cc:3176 msgid "show negative exponents" msgstr "show negative exponents" #: ../src/qalc.cc:600 ../src/qalc.cc:2453 ../src/qalc.cc:3120 msgid "assume nonzero denominators" msgstr "assume nonzero denominators" #: ../src/qalc.cc:601 ../src/qalc.cc:2454 ../src/qalc.cc:3121 msgid "warn nonzero denominators" msgstr "warn nonzero denominators" #: ../src/qalc.cc:602 ../src/qalc.cc:2677 ../src/qalc.cc:3312 msgid "prefixes" msgstr "prefixes" #: ../src/qalc.cc:603 ../src/qalc.cc:2675 ../src/qalc.cc:3310 msgid "denominator prefixes" msgstr "denominator prefixes" #: ../src/qalc.cc:604 ../src/qalc.cc:2676 ../src/qalc.cc:3311 msgid "place units separately" msgstr "place units separately" #: ../src/qalc.cc:605 ../src/qalc.cc:2500 ../src/qalc.cc:3161 msgid "calculate variables" msgstr "calculate variables" #: ../src/qalc.cc:606 ../src/qalc.cc:2499 ../src/qalc.cc:3160 msgid "calculate functions" msgstr "calculate functions" #: ../src/qalc.cc:607 ../src/qalc.cc:2678 ../src/qalc.cc:3313 msgid "sync units" msgstr "sync units" #: ../src/qalc.cc:608 ../src/qalc.cc:2619 ../src/qalc.cc:3250 msgid "round to even" msgstr "round to even" #: ../src/qalc.cc:609 ../src/qalc.cc:2657 ../src/qalc.cc:3289 msgid "rpn syntax" msgstr "rpn syntax" #. qalc command #: ../src/qalc.cc:610 ../src/qalc.cc:2042 ../src/qalc.cc:2689 #: ../src/qalc.cc:2726 ../src/qalc.cc:3324 ../src/qalc.cc:3404 msgid "rpn" msgstr "rpn" #: ../src/qalc.cc:611 ../src/qalc.cc:2528 ../src/qalc.cc:3177 msgid "short multiplication" msgstr "short multiplication" #: ../src/qalc.cc:612 ../src/qalc.cc:2602 ../src/qalc.cc:3233 msgid "lowercase e" msgstr "lowercase e" #: ../src/qalc.cc:613 ../src/qalc.cc:2603 ../src/qalc.cc:3234 msgid "lowercase numbers" msgstr "lowercase numbers" #: ../src/qalc.cc:616 ../src/qalc.cc:632 ../src/qalc.cc:686 ../src/qalc.cc:767 #: ../src/qalc.cc:790 ../src/qalc.cc:2448 ../src/qalc.cc:2484 #: ../src/qalc.cc:2545 ../src/qalc.cc:2666 ../src/qalc.cc:3119 #: ../src/qalc.cc:3151 ../src/qalc.cc:3201 ../src/qalc.cc:3297 msgid "none" msgstr "none" #: ../src/qalc.cc:617 ../src/qalc.cc:2546 ../src/qalc.cc:3201 msgid "normal" msgstr "normal" #: ../src/qalc.cc:618 ../src/qalc.cc:2547 ../src/qalc.cc:3201 msgid "alternative" msgstr "alternative" #: ../src/qalc.cc:623 ../src/qalc.cc:639 ../src/qalc.cc:659 ../src/qalc.cc:691 #: ../src/qalc.cc:707 ../src/qalc.cc:731 ../src/qalc.cc:745 ../src/qalc.cc:759 #: ../src/qalc.cc:781 ../src/qalc.cc:797 ../src/qalc.cc:846 ../src/qalc.cc:852 #: ../src/qalc.cc:876 ../src/qalc.cc:933 ../src/qalc.cc:949 ../src/qalc.cc:963 msgid "Illegal value." msgstr "éžæ³•数值。" #: ../src/qalc.cc:628 ../src/qalc.cc:2621 ../src/qalc.cc:3252 msgid "two's complement" msgstr "" #: ../src/qalc.cc:629 ../src/qalc.cc:2562 ../src/qalc.cc:3214 msgid "digit grouping" msgstr "" #: ../src/qalc.cc:633 ../src/qalc.cc:2565 ../src/qalc.cc:3214 msgid "standard" msgstr "" #: ../src/qalc.cc:634 ../src/qalc.cc:654 ../src/qalc.cc:2558 #: ../src/qalc.cc:2566 ../src/qalc.cc:2626 ../src/qalc.cc:3206 #: ../src/qalc.cc:3214 ../src/qalc.cc:3259 msgid "locale" msgstr "" #: ../src/qalc.cc:644 ../src/qalc.cc:2530 ../src/qalc.cc:3179 msgid "spell out logical" msgstr "spell out logical" #: ../src/qalc.cc:645 ../src/qalc.cc:2634 ../src/qalc.cc:3271 msgid "ignore dot" msgstr "" #: ../src/qalc.cc:646 ../src/qalc.cc:2631 ../src/qalc.cc:3268 msgid "ignore comma" msgstr "" #: ../src/qalc.cc:650 ../src/qalc.cc:2557 ../src/qalc.cc:2625 #: ../src/qalc.cc:3203 ../src/qalc.cc:3256 #, fuzzy msgid "decimal comma" msgstr "decimal" #: ../src/qalc.cc:669 ../src/qalc.cc:2642 ../src/qalc.cc:3286 msgid "limit implicit multiplication" msgstr "limit implicit multiplication" #: ../src/qalc.cc:671 ../src/qalc.cc:2529 ../src/qalc.cc:3178 msgid "spacious" msgstr "spacious" #: ../src/qalc.cc:672 ../src/qalc.cc:2531 ../src/qalc.cc:3180 msgid "unicode" msgstr "unicode" #: ../src/qalc.cc:675 ../src/qalc.cc:2504 ../src/qalc.cc:2760 #: ../src/qalc.cc:2765 ../src/qalc.cc:3165 msgid "units" msgstr "units" #: ../src/qalc.cc:676 ../src/qalc.cc:2505 ../src/qalc.cc:3166 msgid "unknowns" msgstr "unknowns" #: ../src/qalc.cc:677 ../src/qalc.cc:2506 ../src/qalc.cc:2759 #: ../src/qalc.cc:2764 ../src/qalc.cc:3167 msgid "variables" msgstr "variables" #: ../src/qalc.cc:678 ../src/qalc.cc:2511 ../src/qalc.cc:3172 msgid "abbreviations" msgstr "abbreviations" #: ../src/qalc.cc:679 ../src/qalc.cc:2620 ../src/qalc.cc:3251 msgid "show ending zeroes" msgstr "show ending zeroes" #: ../src/qalc.cc:680 ../src/qalc.cc:2618 ../src/qalc.cc:3249 #, fuzzy msgid "repeating decimals" msgstr "min decimals" #: ../src/qalc.cc:681 ../src/qalc.cc:2479 ../src/qalc.cc:3151 msgid "angle unit" msgstr "angle unit" #: ../src/qalc.cc:683 ../src/qalc.cc:2481 ../src/qalc.cc:2482 msgid "rad" msgstr "rad" #: ../src/qalc.cc:683 ../src/qalc.cc:3151 msgid "radians" msgstr "radians" #: ../src/qalc.cc:684 msgid "deg" msgstr "deg" #: ../src/qalc.cc:684 ../src/qalc.cc:3151 msgid "degrees" msgstr "degrees" #: ../src/qalc.cc:685 ../src/qalc.cc:2483 msgid "gra" msgstr "gra" #: ../src/qalc.cc:685 ../src/qalc.cc:3151 msgid "gradians" msgstr "gradians" #: ../src/qalc.cc:698 ../src/qalc.cc:2643 ../src/qalc.cc:3287 #: ../src/qalc.cc:3511 #, fuzzy msgid "parsing mode" msgstr "exp mode" #: ../src/qalc.cc:700 ../src/qalc.cc:859 ../src/qalc.cc:2589 #: ../src/qalc.cc:2645 ../src/qalc.cc:3232 ../src/qalc.cc:3287 #: ../src/qalc.cc:3519 #, fuzzy msgid "adaptive" msgstr "alternative" #: ../src/qalc.cc:701 ../src/qalc.cc:2646 ../src/qalc.cc:3287 #: ../src/qalc.cc:3516 msgid "implicit first" msgstr "" #: ../src/qalc.cc:702 ../src/qalc.cc:2647 ../src/qalc.cc:3287 #: ../src/qalc.cc:3513 #, fuzzy msgid "conventional" msgstr "å¯é€‰çš„" #: ../src/qalc.cc:712 ../src/qalc.cc:1433 ../src/qalc.cc:2679 #: ../src/qalc.cc:3314 msgid "update exchange rates" msgstr "" #: ../src/qalc.cc:713 ../src/qalc.cc:2682 ../src/qalc.cc:3316 msgid "never" msgstr "" #: ../src/qalc.cc:715 ../src/qalc.cc:2681 ../src/qalc.cc:3315 #, fuzzy msgid "ask" msgstr "ans" #: ../src/qalc.cc:722 ../src/qalc.cc:2520 ../src/qalc.cc:3175 msgid "multiplication sign" msgstr "multiplication sign" #: ../src/qalc.cc:736 ../src/qalc.cc:2512 ../src/qalc.cc:3173 msgid "division sign" msgstr "division sign" #: ../src/qalc.cc:750 ../src/qalc.cc:2487 ../src/qalc.cc:3152 msgid "approximation" msgstr "è¿‘ä¼¼" #. qalc command #: ../src/qalc.cc:752 ../src/qalc.cc:803 ../src/qalc.cc:925 ../src/qalc.cc:2246 #: ../src/qalc.cc:2489 ../src/qalc.cc:2582 ../src/qalc.cc:2706 #: ../src/qalc.cc:3152 ../src/qalc.cc:3231 ../src/qalc.cc:3458 msgid "exact" msgstr "exact" #: ../src/qalc.cc:753 ../src/qalc.cc:2490 ../src/qalc.cc:3152 msgid "try exact" msgstr "try exact" #. qalc command #: ../src/qalc.cc:754 ../src/qalc.cc:1282 ../src/qalc.cc:2252 #: ../src/qalc.cc:2491 ../src/qalc.cc:2702 ../src/qalc.cc:2965 #: ../src/qalc.cc:2975 ../src/qalc.cc:3065 ../src/qalc.cc:3152 #: ../src/qalc.cc:3462 msgid "approximate" msgstr "approximate" #: ../src/qalc.cc:764 ../src/qalc.cc:2662 ../src/qalc.cc:3294 msgid "autoconversion" msgstr "autoconversion" #: ../src/qalc.cc:768 ../src/qalc.cc:2403 msgid "best" msgstr "best" #: ../src/qalc.cc:769 ../src/qalc.cc:2671 ../src/qalc.cc:3303 #, fuzzy msgid "optimalsi" msgstr "å¯é€‰çš„" #: ../src/qalc.cc:770 ../src/qalc.cc:2403 ../src/qalc.cc:2669 #: ../src/qalc.cc:3299 ../src/qalc.cc:4218 ../libqalculate/Calculator.cc:2499 #, fuzzy msgid "optimal" msgstr "å¯é€‰çš„" #: ../src/qalc.cc:772 ../src/qalc.cc:2665 ../src/qalc.cc:3305 #: ../src/qalc.cc:4248 ../libqalculate/Calculator.cc:2510 msgid "mixed" msgstr "" #: ../src/qalc.cc:787 ../src/qalc.cc:2674 ../src/qalc.cc:3309 #, fuzzy msgid "currency conversion" msgstr "autoconversion" #: ../src/qalc.cc:788 ../src/qalc.cc:2446 ../src/qalc.cc:3119 msgid "algebra mode" msgstr "algebra mode" #. qalc command #: ../src/qalc.cc:791 ../src/qalc.cc:2434 ../src/qalc.cc:2450 #: ../src/qalc.cc:2721 ../src/qalc.cc:3097 ../src/qalc.cc:3119 msgid "simplify" msgstr "simplify" #: ../src/qalc.cc:792 ../src/qalc.cc:2449 ../src/qalc.cc:3119 msgid "factorize" msgstr "factorize" #: ../src/qalc.cc:814 ../src/qalc.cc:2691 ../src/qalc.cc:2719 #: ../src/qalc.cc:3326 msgid "save mode" msgstr "save mode" #: ../src/qalc.cc:823 ../src/qalc.cc:2690 ../src/qalc.cc:2718 #: ../src/qalc.cc:3325 msgid "save definitions" msgstr "save definitions" #: ../src/qalc.cc:832 ../src/qalc.cc:2569 ../src/qalc.cc:3215 #, fuzzy msgid "scientific notation" msgstr "scientific" #: ../src/qalc.cc:836 ../src/qalc.cc:2572 ../src/qalc.cc:3220 msgid "auto" msgstr "auto" #: ../src/qalc.cc:837 ../src/qalc.cc:2573 ../src/qalc.cc:3224 msgid "pure" msgstr "pure" #: ../src/qalc.cc:838 ../src/qalc.cc:2574 ../src/qalc.cc:3226 msgid "scientific" msgstr "scientific" #: ../src/qalc.cc:839 ../src/qalc.cc:2575 ../src/qalc.cc:3222 msgid "engineering" msgstr "engineering" #: ../src/qalc.cc:848 ../src/qalc.cc:2495 ../src/qalc.cc:3154 msgid "precision" msgstr "precision" #: ../src/qalc.cc:857 ../src/qalc.cc:2587 ../src/qalc.cc:3232 #, fuzzy msgid "interval display" msgstr "base display" #: ../src/qalc.cc:860 ../src/qalc.cc:2592 ../src/qalc.cc:3232 #, fuzzy msgid "significant" msgstr "scientific" #: ../src/qalc.cc:861 ../src/qalc.cc:2593 ../src/qalc.cc:3232 #, fuzzy msgid "interval" msgstr "integer" #: ../src/qalc.cc:862 ../src/qalc.cc:2594 ../src/qalc.cc:3232 #, fuzzy msgid "plusminus" msgstr "minus" #: ../src/qalc.cc:863 ../src/qalc.cc:2595 ../src/qalc.cc:3232 msgid "midpoint" msgstr "" #: ../src/qalc.cc:864 ../src/qalc.cc:2597 ../src/qalc.cc:3232 msgid "upper" msgstr "" #: ../src/qalc.cc:865 ../src/qalc.cc:2596 ../src/qalc.cc:3232 #, fuzzy msgid "lower" msgstr "lowercase e" #: ../src/qalc.cc:883 ../src/qalc.cc:2494 ../src/qalc.cc:3153 msgid "interval arithmetic" msgstr "" #: ../src/qalc.cc:890 ../src/qalc.cc:2507 ../src/qalc.cc:3168 #, fuzzy msgid "variable units" msgstr "variables" #: ../src/qalc.cc:897 ../src/qalc.cc:2604 ../src/qalc.cc:3235 msgid "max decimals" msgstr "max decimals" #: ../src/qalc.cc:909 ../src/qalc.cc:2611 ../src/qalc.cc:3242 msgid "min decimals" msgstr "min decimals" #: ../src/qalc.cc:922 ../src/qalc.cc:2579 ../src/qalc.cc:3231 msgid "fractions" msgstr "fractions" #: ../src/qalc.cc:927 ../src/qalc.cc:2584 ../src/qalc.cc:3231 msgid "combined" msgstr "combined" #: ../src/qalc.cc:928 ../src/qalc.cc:2583 ../src/qalc.cc:3231 msgid "long" msgstr "" #: ../src/qalc.cc:940 ../src/qalc.cc:2550 ../src/qalc.cc:3202 #, fuzzy msgid "complex form" msgstr "complex" #: ../src/qalc.cc:942 ../src/qalc.cc:2309 ../src/qalc.cc:2552 #: ../src/qalc.cc:3202 ../src/qalc.cc:4194 msgid "rectangular" msgstr "" #: ../src/qalc.cc:942 ../src/qalc.cc:2309 ../src/qalc.cc:4194 msgid "cartesian" msgstr "" #: ../src/qalc.cc:943 ../src/qalc.cc:2318 ../src/qalc.cc:2553 #: ../src/qalc.cc:3202 ../src/qalc.cc:4202 #, fuzzy msgid "exponential" msgstr "å¯é€‰çš„" #: ../src/qalc.cc:944 ../src/qalc.cc:2327 ../src/qalc.cc:2554 #: ../src/qalc.cc:3202 ../src/qalc.cc:4210 msgid "polar" msgstr "" #: ../src/qalc.cc:954 ../src/qalc.cc:2650 ../src/qalc.cc:3288 msgid "read precision" msgstr "read precision" #: ../src/qalc.cc:957 ../src/qalc.cc:2653 ../src/qalc.cc:3288 msgid "always" msgstr "always" #: ../src/qalc.cc:958 ../src/qalc.cc:2654 ../src/qalc.cc:3288 msgid "when decimals" msgstr "" #: ../src/qalc.cc:980 msgid "Unrecognized option." msgstr "无法识别的选项。" #: ../src/qalc.cc:1097 msgid "Calendar" msgstr "" #: ../src/qalc.cc:1097 msgid "Day" msgstr "" #: ../src/qalc.cc:1097 msgid "Month" msgstr "" #: ../src/qalc.cc:1097 msgid "Year" msgstr "" #: ../src/qalc.cc:1098 ../libqalculate/Calculator.cc:2533 msgid "failed" msgstr "" #: ../src/qalc.cc:1099 ../libqalculate/Calculator.cc:2534 msgid "Gregorian:" msgstr "" #: ../src/qalc.cc:1100 ../libqalculate/Calculator.cc:2535 msgid "Hebrew:" msgstr "" #: ../src/qalc.cc:1101 ../libqalculate/Calculator.cc:2536 msgid "Islamic:" msgstr "" #: ../src/qalc.cc:1102 ../libqalculate/Calculator.cc:2537 msgid "Persian:" msgstr "" #: ../src/qalc.cc:1103 ../libqalculate/Calculator.cc:2538 msgid "Indian national:" msgstr "" #: ../src/qalc.cc:1104 ../libqalculate/Calculator.cc:2539 msgid "Chinese:" msgstr "" #: ../src/qalc.cc:1109 ../libqalculate/Calculator.cc:2543 msgid "Julian:" msgstr "" #: ../src/qalc.cc:1110 ../libqalculate/Calculator.cc:2544 msgid "Revised julian:" msgstr "" #: ../src/qalc.cc:1111 ../libqalculate/Calculator.cc:2545 #, fuzzy msgid "Coptic:" msgstr "å¯é€‰çš„" #: ../src/qalc.cc:1112 ../libqalculate/Calculator.cc:2546 msgid "Ethiopian:" msgstr "" #: ../src/qalc.cc:1205 ../src/qalc.cc:1206 ../src/qalc.cc:1323 #: ../src/qalc.cc:1324 ../src/qalc.cc:1391 ../src/qalc.cc:1392 #, fuzzy msgid "" "For more information about a specific function, variable or unit, please use " "the info command (in interactive mode)." msgstr "输入info åç§° 以获å–关于函数,å˜é‡æˆ–å•ä½çš„ä¿¡æ¯ã€‚(例:info sin)" #: ../src/qalc.cc:1218 #, fuzzy msgid "Variables:" msgstr "å˜é‡" #: ../src/qalc.cc:1220 #, fuzzy msgid "Name" msgstr "åç§°" #: ../src/qalc.cc:1221 ../src/qalc.cc:3057 msgid "Value" msgstr "值" #: ../src/qalc.cc:1245 ../src/qalc.cc:3022 ../libqalculate/Function.cc:2002 msgid "matrix" msgstr "matrix" #: ../src/qalc.cc:1247 ../src/qalc.cc:3024 ../libqalculate/Function.cc:1941 msgid "vector" msgstr "vector" #: ../src/qalc.cc:1276 ../src/qalc.cc:3053 msgid "default assumptions" msgstr "缺çœå‡è®¾" #: ../src/qalc.cc:1297 #, fuzzy msgid "Functions:" msgstr "函数" #: ../src/qalc.cc:1311 #, fuzzy msgid "Units:" msgstr "å•ä½" #: ../src/qalc.cc:1318 msgid "No local variables, functions or units have been defined." msgstr "" #: ../src/qalc.cc:1426 msgid "usage: qalc [options] [expression]" msgstr "用法:qalc [选项] [表达å¼]" #: ../src/qalc.cc:1428 msgid "where options are:" msgstr "å¯ç”¨é€‰é¡¹æœ‰ï¼š" #: ../src/qalc.cc:1429 ../src/qalc.cc:2704 msgid "BASE" msgstr "BASE" #: ../src/qalc.cc:1430 msgid "set the result number base" msgstr "" #: ../src/qalc.cc:1435 msgid "FILE" msgstr "文件" #: ../src/qalc.cc:1436 msgid "executes commands from a file first" msgstr "首先执行指定文件中的命令" #: ../src/qalc.cc:1438 msgid "start in interactive mode" msgstr "" #: ../src/qalc.cc:1439 ../src/qalc.cc:1441 ../src/qalc.cc:1443 #: ../src/qalc.cc:1445 msgid "SEARCH TERM" msgstr "" #: ../src/qalc.cc:1440 #, fuzzy msgid "" "displays a list of all user-defined or matching variables, functions and " "units." msgstr "\"%s\"䏿˜¯åˆæ³•çš„å˜é‡/函数/å•ä½ã€‚" #: ../src/qalc.cc:1442 #, fuzzy msgid "displays a list of all or matching functions." msgstr "例如: info sin." #: ../src/qalc.cc:1444 #, fuzzy msgid "displays a list of all or matching units." msgstr "例如: info sin." #: ../src/qalc.cc:1446 #, fuzzy msgid "displays a list of all or matching variables." msgstr "\"%s\"䏿˜¯åˆæ³•çš„å˜é‡/函数/å•ä½ã€‚" #: ../src/qalc.cc:1447 msgid "MILLISECONDS" msgstr "" #: ../src/qalc.cc:1448 msgid "" "terminate calculation and display of result after specified amount of time" msgstr "" #: ../src/qalc.cc:1450 msgid "do not load any functions, units, or variables from file" msgstr "ä¸è½½å…¥æ–‡ä»¶ä¸­çš„函数ã€å•ä½å’Œå˜é‡å®šä¹‰" #: ../src/qalc.cc:1452 msgid "do not load any global currencies from file" msgstr "ä¸è½½å…¥æ–‡ä»¶ä¸­çš„全局货å¸å®šä¹‰" #: ../src/qalc.cc:1454 msgid "do not load any global data sets from file" msgstr "ä¸è½½å…¥æ–‡ä»¶ä¸­çš„全局数æ®é›†" #: ../src/qalc.cc:1456 msgid "do not load any global functions from file" msgstr "ä¸è½½å…¥æ–‡ä»¶ä¸­çš„全局函数定义" #: ../src/qalc.cc:1458 msgid "do not load any global units from file" msgstr "ä¸è½½å…¥æ–‡ä»¶ä¸­çš„全局å•ä½å®šä¹‰" #: ../src/qalc.cc:1460 msgid "do not load any global variables from file" msgstr "ä¸è½½å…¥æ–‡ä»¶ä¸­çš„全局å˜é‡å®šä¹‰" #: ../src/qalc.cc:1461 ../src/qalc.cc:2720 msgid "OPTION" msgstr "选项" #: ../src/qalc.cc:1461 ../src/qalc.cc:2720 msgid "VALUE" msgstr "值" #: ../src/qalc.cc:1462 msgid "as set command in interactive program session (ex. -set \"base 16\")" msgstr "与在交互编程环境下使用set命令的作用一致 (例如, -set \"base 16\")" #: ../src/qalc.cc:1464 msgid "reduces output to just the result of the input expression" msgstr "é™åˆ¶è¾“出,仅输出输入表达å¼çš„结果" #: ../src/qalc.cc:1466 msgid "turn on/off unicode support" msgstr "打开/关闭unicode支æŒ" #: ../src/qalc.cc:1468 msgid "show application version and exit" msgstr "" #: ../src/qalc.cc:1470 #, fuzzy msgid "" "The program will start in interactive mode if no expression and no file is " "specified (or interactive mode is explicitly selected)." msgstr "如果未指定表达å¼ï¼Œç¨‹åºå°†ä»¥äº¤äº’模å¼å¯åŠ¨ã€‚" #: ../src/qalc.cc:1546 msgid "No option and value specified for set command." msgstr "在set命令中未指定选项或数值。" #: ../src/qalc.cc:1554 msgid "No file specified." msgstr "未指定文件。" #: ../src/qalc.cc:1613 msgid "ans" msgstr "ans" #: ../src/qalc.cc:1614 ../src/qalc.cc:1617 ../src/qalc.cc:1618 #: ../src/qalc.cc:1619 ../src/qalc.cc:1620 ../src/qalc.cc:1852 #: ../libqalculate/Calculator.cc:8938 ../libqalculate/Calculator.cc:8954 msgid "Temporary" msgstr "临时" #: ../src/qalc.cc:1614 msgid "Last Answer" msgstr "最åŽä¸€ä¸ªç­”案" #: ../src/qalc.cc:1615 msgid "answer" msgstr "answer" #: ../src/qalc.cc:1617 msgid "Answer 2" msgstr "答案2" #: ../src/qalc.cc:1618 msgid "Answer 3" msgstr "答案3" #: ../src/qalc.cc:1619 msgid "Answer 4" msgstr "答案4" #: ../src/qalc.cc:1620 msgid "Answer 5" msgstr "答案5" #: ../src/qalc.cc:1631 msgid "Failed to load global definitions!" msgstr "载入全局定义失败ï¼" #: ../src/qalc.cc:1656 #, c-format msgid "Could not open \"%s\".\n" msgstr "无法打开\"%s\".\n" #: ../src/qalc.cc:1696 ../src/qalc.cc:1748 ../src/qalc.cc:3541 #, c-format msgid "Illegal character, '%c', in expression." msgstr "在表达å¼ä¸­æœ‰éžæ³•字符\"%c\"。" #. The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. #: ../src/qalc.cc:1814 ../src/qalc.cc:2720 ../src/qalc.cc:3101 msgid "set" msgstr "set" #. qalc command #: ../src/qalc.cc:1818 ../src/qalc.cc:2717 ../src/qalc.cc:3355 msgid "save" msgstr "save" #: ../src/qalc.cc:1818 ../src/qalc.cc:2717 ../src/qalc.cc:3355 msgid "store" msgstr "store" #. qalc command #: ../src/qalc.cc:1821 ../src/qalc.cc:2437 ../src/qalc.cc:2715 #: ../src/qalc.cc:3381 msgid "mode" msgstr "mode" #: ../src/qalc.cc:1823 msgid "mode saved" msgstr "模å¼å·²ä¿å­˜" #: ../src/qalc.cc:1825 msgid "definitions" msgstr "definitions" #: ../src/qalc.cc:1827 msgid "definitions saved" msgstr "定义已ä¿å­˜" #: ../src/qalc.cc:1874 ../src/qalc.cc:1876 ../src/qalc.cc:1934 #: ../src/qalc.cc:1936 ../src/qalc.cc:1991 ../src/qalc.cc:1993 #, c-format msgid "Illegal name. Save as %s instead (default: no)?" msgstr "éžæ³•文件å。是å¦å¦å­˜ä¸º%s?" #: ../src/qalc.cc:1883 ../src/qalc.cc:1943 msgid "" "An unit or variable with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "åŒåçš„å•使ˆ–å˜é‡å·²å­˜åœ¨ã€‚\n" "您è¦è¦†ç›–它å—?" #. qalc command #: ../src/qalc.cc:1906 ../src/qalc.cc:2723 ../src/qalc.cc:3362 #: ../libqalculate/Function.cc:2064 msgid "variable" msgstr "variable" #. qalc command #: ../src/qalc.cc:1963 ../src/qalc.cc:2713 ../src/qalc.cc:3368 #: ../libqalculate/Function.cc:2036 msgid "function" msgstr "function" #: ../src/qalc.cc:2000 #, fuzzy msgid "" "An function with the same name already exists.\n" "Do you want to overwrite it (default: no)?" msgstr "" "åŒåçš„å•使ˆ–å˜é‡å·²å­˜åœ¨ã€‚\n" "您è¦è¦†ç›–它å—?" #. qalc command #: ../src/qalc.cc:2020 ../src/qalc.cc:2705 ../src/qalc.cc:3375 msgid "delete" msgstr "" #: ../src/qalc.cc:2031 #, fuzzy msgid "No user-defined variable or function with the specified name exist." msgstr "找ä¸åˆ°æŒ‡å®šå称的函数ã€å˜é‡æˆ–å•ä½ã€‚" #. qalc command #: ../src/qalc.cc:2035 ../src/qalc.cc:2703 ../src/qalc.cc:3328 msgid "assume" msgstr "assume" #: ../src/qalc.cc:2045 #, fuzzy msgid "syntax" msgstr "rpn syntax" #. qalc command #: ../src/qalc.cc:2052 ../src/qalc.cc:2087 ../src/qalc.cc:2727 #: ../src/qalc.cc:3420 msgid "stack" msgstr "stack" #. qalc command #: ../src/qalc.cc:2072 ../src/qalc.cc:2708 ../src/qalc.cc:3400 msgid "exrates" msgstr "exrates" #: ../src/qalc.cc:2089 ../src/qalc.cc:2105 ../src/qalc.cc:2114 #: ../src/qalc.cc:2147 ../src/qalc.cc:2176 ../src/qalc.cc:2185 #: ../src/qalc.cc:2202 ../src/qalc.cc:2209 ../src/qalc.cc:2227 #: ../src/qalc.cc:2234 msgid "The RPN stack is empty." msgstr "é€†æ³¢å…°èŒƒå¼æ ˆä¸ºç©ºã€‚" #. qalc command #: ../src/qalc.cc:2103 ../src/qalc.cc:2112 ../src/qalc.cc:2733 #: ../src/qalc.cc:3424 msgid "swap" msgstr "" #: ../src/qalc.cc:2107 ../src/qalc.cc:2116 ../src/qalc.cc:2149 #: ../src/qalc.cc:2178 ../src/qalc.cc:2187 #, fuzzy msgid "The RPN stack only contains one value." msgstr "é€†æ³¢å…°èŒƒå¼æ ˆä¸ºç©ºã€‚" #: ../src/qalc.cc:2135 ../src/qalc.cc:2168 ../src/qalc.cc:2216 #: ../src/qalc.cc:2240 msgid "The specified RPN stack index does not exist." msgstr "" #. qalc command #: ../src/qalc.cc:2145 ../src/qalc.cc:2730 ../src/qalc.cc:3446 msgid "move" msgstr "" #. qalc command #: ../src/qalc.cc:2174 ../src/qalc.cc:2183 ../src/qalc.cc:2732 #: ../src/qalc.cc:3442 msgid "rotate" msgstr "" #: ../src/qalc.cc:2191 msgid "up" msgstr "" #: ../src/qalc.cc:2193 msgid "down" msgstr "" #. qalc command #: ../src/qalc.cc:2200 ../src/qalc.cc:2207 ../src/qalc.cc:2729 #: ../src/qalc.cc:3434 msgid "copy" msgstr "" #. qalc command #: ../src/qalc.cc:2222 ../src/qalc.cc:2728 ../src/qalc.cc:3410 msgid "clear stack" msgstr "clear stack" #. qalc command #: ../src/qalc.cc:2225 ../src/qalc.cc:2232 ../src/qalc.cc:2731 #: ../src/qalc.cc:3414 msgid "pop" msgstr "" #. qalc command #: ../src/qalc.cc:2258 ../src/qalc.cc:2722 ../src/qalc.cc:3466 msgid "convert" msgstr "convert" #: ../src/qalc.cc:2258 ../src/qalc.cc:2722 ../src/qalc.cc:3466 #: ../src/qalc.cc:3503 ../libqalculate/Calculator.cc:1241 #: ../libqalculate/Calculator.cc:2623 ../libqalculate/Calculator.cc:2638 #: ../libqalculate/Calculator.cc:2639 msgid "to" msgstr "to" #: ../src/qalc.cc:2336 ../src/qalc.cc:4188 ../libqalculate/Calculator.cc:2493 #, fuzzy msgid "bases" msgstr "base" #: ../src/qalc.cc:2380 ../src/qalc.cc:4191 ../libqalculate/Calculator.cc:2496 msgid "calendars" msgstr "" #: ../src/qalc.cc:2390 ../src/qalc.cc:4179 ../libqalculate/Calculator.cc:2484 #, fuzzy msgid "fraction" msgstr "fractions" #: ../src/qalc.cc:2399 ../src/qalc.cc:4182 ../libqalculate/Calculator.cc:2487 #, fuzzy msgid "factors" msgstr "factor" #. qalc command #: ../src/qalc.cc:2401 ../src/qalc.cc:2431 ../src/qalc.cc:2716 #: ../src/qalc.cc:3093 ../src/qalc.cc:4185 ../libqalculate/Calculator.cc:2490 #, fuzzy msgid "partial fraction" msgstr "fractions" #. qalc command #: ../src/qalc.cc:2428 ../src/qalc.cc:2711 ../src/qalc.cc:3089 msgid "factor" msgstr "factor" #: ../src/qalc.cc:2442 ../src/qalc.cc:3117 #, fuzzy msgid "Algebraic Mode" msgstr "algebra mode" #: ../src/qalc.cc:2477 ../src/qalc.cc:3149 #, fuzzy msgid "Calculation" msgstr "正在计算" #: ../src/qalc.cc:2497 ../src/qalc.cc:3158 msgid "Enabled Objects" msgstr "" #: ../src/qalc.cc:2509 ../src/qalc.cc:3170 msgid "Generic Display Options" msgstr "" #: ../src/qalc.cc:2533 ../src/qalc.cc:3182 #, fuzzy msgid "Numerical Display" msgstr "base display" #: ../src/qalc.cc:2623 ../src/qalc.cc:3254 #, fuzzy msgid "Parsing" msgstr "exp mode" #: ../src/qalc.cc:2659 ../src/qalc.cc:3291 #, fuzzy msgid "Units" msgstr "å•ä½" #: ../src/qalc.cc:2687 ../src/qalc.cc:3322 msgid "Other" msgstr "" #. qalc command #: ../src/qalc.cc:2694 ../src/qalc.cc:3085 msgid "help" msgstr "help" #: ../src/qalc.cc:2697 #, fuzzy msgid "Enter a mathematical expression or a command and press enter." msgstr "è¯·è¾“å…¥ä¸€ä¸ªæ•°å­¦è¡¨è¾¾å¼æˆ–命令。" #: ../src/qalc.cc:2698 msgid "Complete functions, units and variables with the tabulator key." msgstr "使用tab键补全函数ã€å‘½ä»¤å’Œå•ä½ã€‚" #: ../src/qalc.cc:2700 msgid "Available commands are:" msgstr "候选命令有:" #: ../src/qalc.cc:2703 msgid "ASSUMPTIONS" msgstr "å‡è®¾" #: ../src/qalc.cc:2705 ../src/qalc.cc:2713 ../src/qalc.cc:2717 #: ../src/qalc.cc:2723 msgid "NAME" msgstr "åç§°" #: ../src/qalc.cc:2712 ../src/qalc.cc:2744 ../src/qalc.cc:3385 msgid "find" msgstr "" #. qalc command #: ../src/qalc.cc:2712 ../src/qalc.cc:2742 ../src/qalc.cc:2744 #: ../src/qalc.cc:3385 msgid "list" msgstr "" #: ../src/qalc.cc:2713 ../src/qalc.cc:2723 msgid "EXPRESSION" msgstr "" #. qalc command #: ../src/qalc.cc:2714 ../src/qalc.cc:2770 ../src/qalc.cc:3394 #: ../libqalculate/Calculator.cc:9598 ../libqalculate/DataSet.cc:355 #: ../libqalculate/DataSet.cc:382 ../libqalculate/DataSet.cc:1012 msgid "info" msgstr "info" #: ../src/qalc.cc:2717 msgid "CATEGORY" msgstr "类别" #: ../src/qalc.cc:2717 msgid "TITLE" msgstr "标题" #: ../src/qalc.cc:2722 msgid "UNIT or \"TO\" COMMAND" msgstr "" #. qalc command #: ../src/qalc.cc:2724 ../src/qalc.cc:3507 ../src/qalc.cc:3528 msgid "quit" msgstr "quit" #: ../src/qalc.cc:2724 ../src/qalc.cc:3507 ../src/qalc.cc:3528 msgid "exit" msgstr "exit" #: ../src/qalc.cc:2725 msgid "Commands for RPN mode:" msgstr "" #: ../src/qalc.cc:2726 msgid "STATE" msgstr "" #: ../src/qalc.cc:2729 ../src/qalc.cc:2731 msgid "INDEX" msgstr "" #: ../src/qalc.cc:2730 ../src/qalc.cc:2733 msgid "INDEX 1" msgstr "" #: ../src/qalc.cc:2730 ../src/qalc.cc:2733 msgid "INDEX 2" msgstr "" #: ../src/qalc.cc:2732 msgid "DIRECTION" msgstr "" #: ../src/qalc.cc:2735 #, fuzzy msgid "Type help COMMAND for more information (example: help save)." msgstr "输入help 命令 ä»¥èŽ·å–æ›´å¤šå¸®åŠ©(例如:help save)" #: ../src/qalc.cc:2736 #, fuzzy msgid "" "Type info NAME for information about a function, variable or unit (example: " "info sin)." msgstr "输入info åç§° 以获å–关于函数,å˜é‡æˆ–å•ä½çš„ä¿¡æ¯ã€‚(例:info sin)" #: ../src/qalc.cc:2737 msgid "" "When a line begins with '/', the following text is always interpreted as a " "command." msgstr "" #: ../src/qalc.cc:2739 msgid "" "For more information about mathematical expression, different options, and a " "complete list of functions, variables and units, see the relevant sections " "in the manual of the graphical user interface (available at http://qalculate." "github.io/manual/index.html)." msgstr "" #: ../src/qalc.cc:2757 ../src/qalc.cc:2762 #, fuzzy msgid "currencies" msgstr "è´§å¸" #: ../src/qalc.cc:2778 msgid "No function, variable or unit with specified name exist." msgstr "找ä¸åˆ°æŒ‡å®šå称的函数ã€å˜é‡æˆ–å•ä½ã€‚" #: ../src/qalc.cc:2788 msgid "Function" msgstr "函数" #: ../src/qalc.cc:2815 ../libqalculate/Function.cc:201 msgid "argument" msgstr "argument" #: ../src/qalc.cc:2839 #, c-format msgid "" "Retrieves data from the %s data set for a given object and property. If " "\"info\" is typed as property, all properties of the object will be listed." msgstr "" "从数æ®é›†%s中为给定的标é‡å’Œå±žæ€§è¯»å–æ•°æ®ã€‚如果将\"info\"作为属性,则将会 列出对" "象的全部属性。" #: ../src/qalc.cc:2848 #, fuzzy msgid "Example:" msgstr "例如: store var1." #: ../src/qalc.cc:2857 msgid "Arguments" msgstr "自å˜é‡" #. optional argument, in description #: ../src/qalc.cc:2874 msgid "optional" msgstr "å¯é€‰çš„" #. argument default, in description #: ../src/qalc.cc:2878 msgid "default: " msgstr "缺çœï¼š" #: ../src/qalc.cc:2889 msgid "Requirement" msgstr "è¦æ±‚" #: ../src/qalc.cc:2897 msgid "Properties" msgstr "属性" #: ../src/qalc.cc:2912 msgid "key" msgstr "key" #: ../src/qalc.cc:2930 ../src/qalc.cc:2933 ../src/qalc.cc:3072 msgid "Unit" msgstr "å•ä½" #: ../src/qalc.cc:2936 ../src/qalc.cc:3004 msgid "Names" msgstr "åç§°" #: ../src/qalc.cc:2954 msgid "Base Unit" msgstr "基准å•ä½" #: ../src/qalc.cc:2961 msgid "Relation" msgstr "关系" #: ../src/qalc.cc:2971 msgid "Inverse Relation" msgstr "åå‘关系" #: ../src/qalc.cc:2983 msgid "Base Units" msgstr "基准å•ä½" #: ../src/qalc.cc:2998 ../src/qalc.cc:3001 msgid "Variable" msgstr "å˜é‡" #: ../src/qalc.cc:3016 msgid "a previous result" msgstr "之å‰çš„结果" #: ../src/qalc.cc:3061 msgid "Uncertainty" msgstr "" #: ../src/qalc.cc:3091 msgid "Factorizes the current result." msgstr "å› å¼åˆ†è§£å½“å‰ç»“果。" #: ../src/qalc.cc:3095 msgid "Applies partial fraction decomposition to the current result." msgstr "" #: ../src/qalc.cc:3099 msgid "Simplifies the current result." msgstr "化简当å‰ç»“果。" #: ../src/qalc.cc:3112 msgid "Sets the value of an option." msgstr "设置选项的值。" #: ../src/qalc.cc:3113 msgid "Example: set base 16." msgstr "例: set base 16." #: ../src/qalc.cc:3115 #, fuzzy msgid "" "Available options and accepted values are (the current value is marked with " "'*'):" msgstr "å¯ç”¨çš„选项以åŠç›¸åº”的值有:" #: ../src/qalc.cc:3119 msgid "" "Determines if the expression is simplified or factorized after calculation." msgstr "" #: ../src/qalc.cc:3120 msgid "Determines if unknown values will be assumed non-zero (x/x=1)." msgstr "" #: ../src/qalc.cc:3121 msgid "Display a message after a value has been assumed non-zero." msgstr "" #: ../src/qalc.cc:3124 #, fuzzy msgid "Default assumptions for unknown variables." msgstr "设置关于未知数的缺çœå‡è®¾ã€‚" #: ../src/qalc.cc:3152 msgid "" "How approximate variables and calculations are handled. In exact mode " "approximate values will not be calculated." msgstr "" #: ../src/qalc.cc:3153 msgid "" "If activated, interval arithmetic determines the final precision of " "calculations. Avoids wrong results after loss of significance. Especially " "recommended with physical constants and/or 'read precision'." msgstr "" #: ../src/qalc.cc:3155 msgid "" "Specifies the default number of significant digits displayed and determines " "the precision used for approximate calculations." msgstr "" #: ../src/qalc.cc:3166 #, fuzzy msgid "Interprete undefined symbols in expressions as unknown variables." msgstr "设置关于未知数的缺çœå‡è®¾ã€‚" #: ../src/qalc.cc:3168 msgid "" "If activated physical constants include units (e.g. c = 299 792 458 m∕s)." msgstr "" #: ../src/qalc.cc:3172 #, fuzzy msgid "Use abbreviated names for units and variables." msgstr "设置关于未知数的缺çœå‡è®¾ã€‚" #: ../src/qalc.cc:3176 msgid "Use negative exponents instead of division in result (x/y = xy^-1)." msgstr "" #: ../src/qalc.cc:3178 msgid "Add extra space around operators." msgstr "" #: ../src/qalc.cc:3180 msgid "Display Unicode characters." msgstr "" #: ../src/qalc.cc:3184 ../src/qalc.cc:3273 msgid "bin" msgstr "bin" #: ../src/qalc.cc:3186 ../src/qalc.cc:3275 msgid "oct" msgstr "oct" #: ../src/qalc.cc:3188 ../src/qalc.cc:3277 msgid "dec" msgstr "dec" #: ../src/qalc.cc:3190 ../src/qalc.cc:3279 msgid "hex" msgstr "hex" #: ../src/qalc.cc:3192 msgid "sexa" msgstr "" #: ../src/qalc.cc:3204 ../src/qalc.cc:3257 msgid "Determines the default decimal separator." msgstr "" #: ../src/qalc.cc:3216 msgid "Determines how scientific notation are used (e.g. 5 543 000 = 5.543E6)." msgstr "" #: ../src/qalc.cc:3231 msgid "" "Determines how rational numbers are displayed (e.g. 5/4 = 1 + 1/4 = 1.25). " "'long' removes limits on the size of the numerator and denonimator." msgstr "" #: ../src/qalc.cc:3233 msgid "Use lowercase e for E-notation (5e2 = 5 * 10^2)." msgstr "" #: ../src/qalc.cc:3234 msgid "Use lowercase letters for number bases > 10." msgstr "" #: ../src/qalc.cc:3249 msgid "" "If activated, 1/6 is displayed as '0.1 666...', otherwise as '0.166667'." msgstr "" #: ../src/qalc.cc:3250 msgid "" "Determines whether halfway numbers are rounded upwards or towards the " "nearest even integer." msgstr "" #: ../src/qalc.cc:3251 msgid "If actived, zeroes are kept at the end of approximate numbers." msgstr "" #: ../src/qalc.cc:3252 msgid "" "Enables two's complement representation for display of negative binary " "numbers." msgstr "" #: ../src/qalc.cc:3268 msgid "Allows use of ',' as thousands separator." msgstr "" #: ../src/qalc.cc:3271 msgid "Allows use of '.' as thousands separator." msgstr "" #: ../src/qalc.cc:3287 #, fuzzy msgid "See 'help parsing mode'." msgstr "exp mode" #: ../src/qalc.cc:3288 msgid "" "If activated, numbers be interpreted as approximate with precision equal to " "the number of significant digits. Most useful in combination with 'interval " "arithmetic' (3.20 = 3.20+/-0.0005)." msgstr "" #: ../src/qalc.cc:3293 msgid "Enables automatic use of hecto, deca, deci, and centi." msgstr "" #: ../src/qalc.cc:3295 msgid "" "Controls automatic unit conversion of the result. 'optimalsi' always " "converts non-SI units, while 'optimal' only converts to more optimal unit " "expressions, with less units and exponents." msgstr "" #: ../src/qalc.cc:3309 msgid "" "Enables automatic conversion to the local currency when optimal unit " "conversion is enabled." msgstr "" #: ../src/qalc.cc:3310 msgid "" "Enables automatic use of prefixes in the denominator of unit expressions." msgstr "" #: ../src/qalc.cc:3311 msgid "" "If activated, units are separated from variables at the end of the result." msgstr "" #: ../src/qalc.cc:3312 msgid "Enables automatic use of prefixes in the result." msgstr "" #: ../src/qalc.cc:3317 msgid "days" msgstr "" #: ../src/qalc.cc:3324 #, fuzzy msgid "Activates the Reverse Polish Notation stack." msgstr "切æ¢é€†æ³¢å…°èŒƒå¼æ¨¡å¼ã€‚" #: ../src/qalc.cc:3325 #, fuzzy msgid "Save functions, units, and variables on exit." msgstr "ä¸€ä¸ªåˆæ³•的函数ã€å•使ˆ–函数å" #: ../src/qalc.cc:3326 msgid "Save settings on exit." msgstr "" #: ../src/qalc.cc:3330 msgid "Set default assumptions for unknown variables." msgstr "设置关于未知数的缺çœå‡è®¾ã€‚" #: ../src/qalc.cc:3357 msgid "" "Saves the current result in a variable with the specified name. You may " "optionally also provide a category (default \"Temporary\") and a title." msgstr "" "将当å‰ç»“æžœä¿å­˜åœ¨æŒ‡å®šçš„å˜é‡ä¸­ã€‚您å¯ä»¥åŒæ—¶ä¸ºå®ƒæŒ‡å®šä¸€ä¸ªç±»åˆ«(缺çœä¸º\"临时\")和标" "题。" #: ../src/qalc.cc:3358 msgid "" "If name equals \"mode\" or \"definitions\", the current mode and " "definitions, respectively, will be saved." msgstr "如果å称等于\"mode\"或\"definitions\",将ä¿å­˜å½“剿¨¡å¼æˆ–定义。" #: ../src/qalc.cc:3360 msgid "Example: store var1." msgstr "例如: store var1." #: ../src/qalc.cc:3364 #, fuzzy msgid "Create a variables with the specified name and expression." msgstr "找ä¸åˆ°æŒ‡å®šå称的函数ã€å˜é‡æˆ–å•ä½ã€‚" #: ../src/qalc.cc:3366 #, fuzzy msgid "Example: variable var1 pi / 2." msgstr "例如: store var1." #: ../src/qalc.cc:3370 #, fuzzy msgid "Creates a function with the specified name and expression." msgstr "找ä¸åˆ°æŒ‡å®šå称的函数ã€å˜é‡æˆ–å•ä½ã€‚" #: ../src/qalc.cc:3371 msgid "Use '\\x', '\\y', '\\z', '\\a', etc. for arguments in the expression." msgstr "" #: ../src/qalc.cc:3373 #, fuzzy msgid "Example: function func1 5*\\x." msgstr "例如: info sin." #: ../src/qalc.cc:3377 #, fuzzy msgid "Removes the user-defined variable or function with the specified name." msgstr "找ä¸åˆ°æŒ‡å®šå称的函数ã€å˜é‡æˆ–å•ä½ã€‚" #: ../src/qalc.cc:3379 #, fuzzy msgid "Example: delete var1." msgstr "例如: store var1." #: ../src/qalc.cc:3383 msgid "Displays the current mode." msgstr "æ˜¾ç¤ºå½“å‰æ¨¡å¼ã€‚" #: ../src/qalc.cc:3387 #, fuzzy msgid "Displays a list of variables, functions and units." msgstr "\"%s\"䏿˜¯åˆæ³•çš„å˜é‡/函数/å•ä½ã€‚" #: ../src/qalc.cc:3388 msgid "" "Enter with argument 'currencies', 'functions', 'variables' or 'units' to " "show a list of all currencies, functions, variables or units. Enter a search " "term to find matching variables, functions, and/or units. If command is " "called with no argument all user-definied objects are listed." msgstr "" #: ../src/qalc.cc:3390 #, fuzzy msgid "Example: list functions." msgstr "例如: info sin." #: ../src/qalc.cc:3391 #, fuzzy msgid "Example: find dinar." msgstr "例如: info sin." #: ../src/qalc.cc:3392 #, fuzzy msgid "Example: find variables planck." msgstr "例如: store var1." #: ../src/qalc.cc:3396 msgid "Displays information about a function, variable or unit." msgstr "显示关于函数,å˜é‡æˆ–å•ä½çš„ä¿¡æ¯ã€‚" #: ../src/qalc.cc:3398 msgid "Example: info sin." msgstr "例如: info sin." #: ../src/qalc.cc:3402 msgid "Downloads current exchange rates from the Internet." msgstr "从因特网上下载最新汇率。" #: ../src/qalc.cc:3406 #, fuzzy msgid "(De)activates the Reverse Polish Notation stack and syntax." msgstr "切æ¢é€†æ³¢å…°èŒƒå¼æ¨¡å¼ã€‚" #: ../src/qalc.cc:3408 msgid "" "\"syntax\" activates only the RPN syntax and \"stack\" enables the RPN stack." msgstr "" #: ../src/qalc.cc:3412 #, fuzzy msgid "Clears the entire RPN stack." msgstr "清空逆波兰范å¼(RPN)æ ˆ" #: ../src/qalc.cc:3416 #, fuzzy msgid "Removes the top of the RPN stack or the value at the specified index." msgstr "找ä¸åˆ°æŒ‡å®šå称的函数ã€å˜é‡æˆ–å•ä½ã€‚" #: ../src/qalc.cc:3418 ../src/qalc.cc:3430 ../src/qalc.cc:3440 #: ../src/qalc.cc:3450 msgid "" "Index 1 is the top of stack and negative index values counts from the bottom " "of the stack." msgstr "" #: ../src/qalc.cc:3422 msgid "Displays the RPN stack." msgstr "显示逆波兰范å¼(RPN)æ ˆ" #: ../src/qalc.cc:3426 msgid "Swaps position of values on the RPN stack." msgstr "" #: ../src/qalc.cc:3428 msgid "" "If no index is specified, the values on the top of the stack (index 1 and " "index 2) will be swapped and if only one index is specified, the value at " "this index will be swapped with the top value." msgstr "" #: ../src/qalc.cc:3432 #, fuzzy msgid "Example: swap 2 4" msgstr "例如: store var1." #: ../src/qalc.cc:3436 msgid "Duplicates a value on the RPN stack to the top of the stack." msgstr "" #: ../src/qalc.cc:3438 msgid "If no index is specified, the top of the stack is duplicated." msgstr "" #: ../src/qalc.cc:3444 msgid "Rotates the RPN stack up (default) or down." msgstr "" #: ../src/qalc.cc:3448 msgid "Changes the position of a value on the RPN stack." msgstr "" #: ../src/qalc.cc:3452 #, fuzzy msgid "Example: move 2 4" msgstr "例如: store var1." #: ../src/qalc.cc:3456 #, fuzzy msgid "Sets the result number base (equivalent to set base)." msgstr "设置结果base(相当于set base)" #: ../src/qalc.cc:3460 msgid "Equivalent to set approximation exact." msgstr "相当于set approximation exact" #: ../src/qalc.cc:3464 msgid "Equivalent to set approximation try exact." msgstr "相当于set approximation try exact." #: ../src/qalc.cc:3469 #, fuzzy msgid "Converts units or changes number base in current result." msgstr "为当å‰ç»“æžœæ¢ç®—å•ä½" #: ../src/qalc.cc:3471 #, fuzzy msgid "Possible values:" msgstr "å¯ç”¨çš„å•ä½å€¼æœ‰ï¼š" #: ../src/qalc.cc:3473 #, fuzzy msgid "- a unit (e.g. meter)" msgstr "一个å•ä½ï¼ˆä¾‹å¦‚: ç±³)" #: ../src/qalc.cc:3474 msgid "prepend with ? to request the optimal prefix" msgstr "" #: ../src/qalc.cc:3475 msgid "prepend with + or - to force/disable use of mixed units" msgstr "" #: ../src/qalc.cc:3476 #, fuzzy msgid "- a unit expression (e.g. km/h)" msgstr "一个å•ä½è¡¨è¾¾å¼ (例如 km/h)" #: ../src/qalc.cc:3477 msgid "- a physical constant (e.g. c)" msgstr "" #: ../src/qalc.cc:3478 #, fuzzy msgid "- base (convert to base units)" msgstr "base (转æ¢ä¸ºåŸºå‡†å•ä½)" #: ../src/qalc.cc:3479 #, fuzzy msgid "- optimal (convert to optimal unit)" msgstr "base (转æ¢ä¸ºåŸºå‡†å•ä½)" #: ../src/qalc.cc:3480 msgid "- mixed (convert to mixed units, e.g. hours + minutes)" msgstr "" #: ../src/qalc.cc:3482 msgid "- bin / binary (show as binary number)" msgstr "" #: ../src/qalc.cc:3483 msgid "- oct / octal (show as octal number)" msgstr "" #: ../src/qalc.cc:3484 msgid "- duo / duodecimal (show as duodecimal number)" msgstr "" #: ../src/qalc.cc:3485 msgid "- hex / hexadecimal (show as hexadecimal number)" msgstr "" #: ../src/qalc.cc:3486 msgid "- sex / sexagesimal (show as sexagesimal number)" msgstr "" #: ../src/qalc.cc:3487 #, fuzzy msgid "- roman (show as roman numerals)" msgstr "在罗马数字中有错:\"%s\"" #: ../src/qalc.cc:3488 msgid "- time (show in time format)" msgstr "" #: ../src/qalc.cc:3489 msgid "- bases (show as binary, octal, decimal and hexadecimal number)" msgstr "" #: ../src/qalc.cc:3491 msgid "- rectangular / cartesian (show complex numbers in rectangular form)" msgstr "" #: ../src/qalc.cc:3492 msgid "- exponential (show complex numbers in exponential form)" msgstr "" #: ../src/qalc.cc:3493 msgid "- polar (show complex numbers in polar form)" msgstr "" #: ../src/qalc.cc:3495 msgid "- fraction (show result in combined fractional format)" msgstr "" #: ../src/qalc.cc:3496 #, fuzzy msgid "- factors (factorize result)" msgstr "å› å¼åˆ†è§£å½“å‰ç»“果。" #: ../src/qalc.cc:3498 msgid "- utc (show UTC date)" msgstr "" #: ../src/qalc.cc:3499 msgid "- calendars" msgstr "" #: ../src/qalc.cc:3501 #, fuzzy msgid "Example: to ?g" msgstr "例如: store var1." #: ../src/qalc.cc:3504 msgid "" "This command can also be typed directly at the end of the mathematical " "expression." msgstr "" #: ../src/qalc.cc:3509 msgid "Terminates this program." msgstr "ç»“æŸæ­¤ç¨‹åºã€‚" #: ../src/qalc.cc:3514 msgid "" "Implicit multiplication does not differ from explicit multiplication " "(\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\")." msgstr "" #: ../src/qalc.cc:3517 msgid "" "Implicit multiplication is parsed before explicit multiplication " "(\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\")." msgstr "" #: ../src/qalc.cc:3520 msgid "" "The default adaptive mode works as the \"implicit first\" mode, unless " "spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the " "adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/" "(5*(m/s)) = 1 s\")." msgstr "" #: ../src/qalc.cc:3522 msgid "" "Function arguments without parentheses are an exception, where implicit " "multiplication in front of variables and units is parsed first regardless of " "mode (\"sqrt 2x = sqrt(2x)\")." msgstr "" #: ../src/qalc.cc:3536 #, fuzzy msgid "Unknown command." msgstr "ä¸è®¤è¯†çš„罗马数字:\"%c\"" #: ../src/qalc.cc:3585 msgid "error" msgstr "错误" #: ../src/qalc.cc:3587 msgid "warning" msgstr "警告" #: ../src/qalc.cc:3663 ../src/qalc.cc:3701 ../src/qalc.cc:3997 #: ../src/qalc.cc:4401 ../libqalculate/Calculator.cc:10016 #: ../libqalculate/MathStructure.cc:713 #, c-format msgid "aborted" msgstr "已终止" #: ../src/qalc.cc:3713 msgid "RPN Register Moved" msgstr "逆波兰范å¼å¯„存器已被移动" #: ../src/qalc.cc:3769 msgid "Processing (press Enter to abort)" msgstr "正在处ç†(按回车键终止)" #: ../src/qalc.cc:3856 ../src/qalc.cc:4549 msgid "approx." msgstr "约" #: ../src/qalc.cc:4014 msgid "Factorizing (press Enter to abort)" msgstr "正在分解因å¼(按回车键终止)" #: ../src/qalc.cc:4018 msgid "Expanding partial fractions…" msgstr "" #: ../src/qalc.cc:4022 msgid "Simplifying (press Enter to abort)" msgstr "正在化简(按回车键终止)" #: ../src/qalc.cc:4026 ../src/qalc.cc:4415 msgid "Calculating (press Enter to abort)" msgstr "正在计算(按回车键终止)" #: ../src/qalc.cc:4500 msgid "RPN Operation" msgstr "(RPN)é€†æ³¢å…°èŒƒå¼æ“作" #: ../src/qalc.cc:4969 #, c-format msgid "" "Couldn't write preferences to\n" "%s" msgstr "" "无法将å好设置写入\n" "%s" #: ../src/qalc.cc:5056 msgid "Couldn't write definitions" msgstr "无法写定义" #: ../libqalculate/BuiltinFunctions.cc:68 #, c-format msgid "Too many elements (%s) for the dimensions (%sx%s) of the matrix." msgstr "%s个元素对于%s X %s的矩阵而言太多。" #: ../libqalculate/BuiltinFunctions.cc:131 #: ../libqalculate/BuiltinFunctions.cc:193 #, c-format msgid "Row %s does not exist in matrix." msgstr "在矩阵中ä¸å­˜åœ¨è¡Œ%s。" #: ../libqalculate/BuiltinFunctions.cc:144 #: ../libqalculate/BuiltinFunctions.cc:189 #, c-format msgid "Column %s does not exist in matrix." msgstr "在矩阵中ä¸å­˜åœ¨åˆ—%s。" #: ../libqalculate/BuiltinFunctions.cc:204 #, c-format msgid "Argument 3, %s, is ignored for vectors." msgstr "已为å‘é‡å¿½ç•¥äº†å‚æ•°3, %s。" #: ../libqalculate/BuiltinFunctions.cc:208 #: ../libqalculate/BuiltinFunctions.cc:229 #, c-format msgid "Element %s does not exist in vector." msgstr "在å‘é‡ä¸­ä¸å­˜åœ¨å…ƒç´ %s。" #: ../libqalculate/BuiltinFunctions.cc:370 #: ../libqalculate/BuiltinFunctions.cc:374 #: ../libqalculate/BuiltinFunctions.cc:406 #: ../libqalculate/BuiltinFunctions.cc:410 #, c-format msgid "%s() requires that all matrices/vectors have the same dimensions." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4274 #: ../libqalculate/BuiltinFunctions.cc:4317 #, c-format msgid "Unsolvable comparison in %s()." msgstr "在%s()中无法进行比较。" #: ../libqalculate/BuiltinFunctions.cc:4400 #: ../libqalculate/BuiltinFunctions.cc:4434 msgid "gregorian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4401 msgid "milankovic" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4402 msgid "julian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4403 msgid "islamic" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4404 msgid "hebrew" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4405 msgid "egyptian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4406 msgid "persian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4407 #, fuzzy msgid "coptic" msgstr "å¯é€‰çš„" #: ../libqalculate/BuiltinFunctions.cc:4408 msgid "ethiopian" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4409 #, fuzzy msgid "indian" msgstr "radians" #: ../libqalculate/BuiltinFunctions.cc:4410 msgid "chinese" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:4895 msgid "" "The number of requested elements in generate vector function must be a " "positive integer." msgstr "在常规å‘é‡å‡½æ•°ä¸­ï¼Œéœ€æ±‚的元素个数必须为正整数。" #: ../libqalculate/BuiltinFunctions.cc:5211 #: ../libqalculate/BuiltinFunctions.cc:5215 #, c-format msgid "Too few elements (%s) in vector (%s required)" msgstr "" #: ../libqalculate/BuiltinFunctions.cc:5264 #: ../libqalculate/BuiltinFunctions.cc:5281 msgid "Comparison failed." msgstr "比较失败。" #: ../libqalculate/BuiltinFunctions.cc:5269 #: ../libqalculate/BuiltinFunctions.cc:5299 msgid "No matching item found." msgstr "未能找到匹é…项。" #: ../libqalculate/BuiltinFunctions.cc:5397 #, c-format msgid "Object %s does not exist." msgstr "对象%sä¸å­˜åœ¨ã€‚" #: ../libqalculate/BuiltinFunctions.cc:5415 #, fuzzy, c-format msgid "Invalid variable name (%s)." msgstr "ä¸€ä¸ªåˆæ³•çš„å˜é‡å" #: ../libqalculate/BuiltinFunctions.cc:5432 msgid "" "A global unit or variable was deactivated. It will be restored after the new " "variable has been removed." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:5447 #, c-format msgid "Register %s does not exist. Returning zero." msgstr "寄存器%sä¸å­˜åœ¨ã€‚返回零。" #: ../libqalculate/BuiltinFunctions.cc:5796 #: ../libqalculate/MathStructure.cc:203 ../libqalculate/MathStructure.cc:235 #: ../libqalculate/MathStructure.cc:276 #, c-format msgid "To avoid division by zero, the following must be true: %s." msgstr "为了é¿å…被零,必须满足:%s。" #: ../libqalculate/BuiltinFunctions.cc:5852 #: ../libqalculate/BuiltinFunctions.cc:5879 #: ../libqalculate/BuiltinFunctions.cc:5899 #: ../libqalculate/BuiltinFunctions.cc:5940 #: ../libqalculate/BuiltinFunctions.cc:6035 #: ../libqalculate/BuiltinFunctions.cc:6125 #, fuzzy msgid "Unable to integrate the expression." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:5950 #: ../libqalculate/BuiltinFunctions.cc:5987 #, fuzzy msgid "Unable to integrate the expression exact." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:6073 #: ../libqalculate/BuiltinFunctions.cc:6116 msgid "Definite integral was approximated with unknown precision." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:6097 msgid "Definite integral was approximated." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:6339 msgid "" "No equality or inequality to solve. The entered expression to solve is not " "correct (ex. \"x + 5 = 3\" is correct)" msgstr "æ— æ³•è§£ç­‰å¼æˆ–ä¸ç­‰å¼ã€‚ 输入的表达å¼ä¸æ­£ç¡®ï¼ˆä¾‹å¦‚:\"x + 5 = 3\"是正确的)" #: ../libqalculate/BuiltinFunctions.cc:6386 #, c-format msgid "The comparison is true for all %s (with current assumptions)." msgstr "此比较对所有%s为真。 (按照目å‰çš„å‡è®¾)" #: ../libqalculate/BuiltinFunctions.cc:6390 msgid "No possible solution was found (with current assumptions)." msgstr "未找到å¯è¡Œè§£ã€‚ (按照目å‰çš„å‡è®¾)" #: ../libqalculate/BuiltinFunctions.cc:6394 #, c-format msgid "Was unable to completely isolate %s." msgstr "无法完æˆåˆ†ç¦»%s/" #: ../libqalculate/BuiltinFunctions.cc:6398 #: ../libqalculate/BuiltinFunctions.cc:6566 #: ../libqalculate/BuiltinFunctions.cc:6661 #, c-format msgid "The comparison is true for all %s if %s." msgstr "此比较对所有%s为真,如果%s。" #: ../libqalculate/BuiltinFunctions.cc:6402 #, c-format msgid "Was unable to isolate %s." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:6525 #: ../libqalculate/BuiltinFunctions.cc:6552 #: ../libqalculate/BuiltinFunctions.cc:6635 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed sign was " "therefor temporarily set as unknown." msgstr "按照当å‰çš„å‡è®¾æ¡ä»¶æ— æ³•分离%s。 因此,å‡è®¾ç¬¦å·æš‚时已被设æˆäº†æœªçŸ¥ã€‚" #: ../libqalculate/BuiltinFunctions.cc:6528 #: ../libqalculate/BuiltinFunctions.cc:6555 #: ../libqalculate/BuiltinFunctions.cc:6638 #, c-format msgid "" "Was unable to isolate %s with the current assumptions. The assumed type and " "sign was therefor temporarily set as unknown." msgstr "" "按照当å‰çš„å‡è®¾æ¡ä»¶æ— æ³•分离%s。 因此,å‡è®¾ç±»åž‹å’Œç¬¦å·æš‚时都已被设æˆäº†æœªçŸ¥ã€‚" #: ../libqalculate/BuiltinFunctions.cc:6561 #: ../libqalculate/BuiltinFunctions.cc:6646 #, c-format msgid "The solution requires that %s." msgstr "解需è¦%s。" #: ../libqalculate/BuiltinFunctions.cc:6654 #, c-format msgid "Solution %s requires that %s." msgstr "è§£%s需è¦%s。" #: ../libqalculate/BuiltinFunctions.cc:6726 #, fuzzy, c-format msgid "" "Unable to isolate %s.\n" "\n" "You might need to place the equations and variables in an appropriate order " "so that each equation at least contains the corresponding variable (if " "automatic reordering failed)." msgstr "" "无法分离%s。\n" "\n" "您å¯èƒ½éœ€è¦æŒ‰ç…§æ­£ç¡®çš„é¡ºåºæŽ’åˆ—ç­‰å¼å’Œå˜é‡ï¼Œè¿™æ ·æ¯ä¸ªç­‰å¼éƒ½è‡³å°‘包å«ä¸€ä¸ªå¯¹åº”å˜é‡ã€‚ " "(如果自动排åºå¤±è´¥çš„è¯)。" #: ../libqalculate/BuiltinFunctions.cc:6728 #: ../libqalculate/BuiltinFunctions.cc:6742 #: ../libqalculate/BuiltinFunctions.cc:6751 #, c-format msgid "Unable to isolate %s." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:6735 #, c-format msgid "Inequalities is not allowed in %s()." msgstr "在%s中ä¸å…许ä¸ç­‰å¼ã€‚" #: ../libqalculate/BuiltinFunctions.cc:7078 #: ../libqalculate/BuiltinFunctions.cc:7083 msgid "No differential equation found." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:7087 #: ../libqalculate/BuiltinFunctions.cc:7116 #: ../libqalculate/BuiltinFunctions.cc:7122 msgid "Unable to solve differential equation." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:7148 #, fuzzy msgid "Unable to find limit." msgstr "无法分离%s。" #: ../libqalculate/BuiltinFunctions.cc:7195 #: ../libqalculate/BuiltinFunctions.cc:7209 #, fuzzy msgid "Matrix" msgstr "matrix" #: ../libqalculate/BuiltinFunctions.cc:7220 #: ../libqalculate/BuiltinFunctions.cc:7273 #, fuzzy msgid "Vector" msgstr "vector" #: ../libqalculate/BuiltinFunctions.cc:7235 #: ../libqalculate/BuiltinFunctions.cc:7284 ../libqalculate/Calculator.cc:10566 msgid "Unable to generate plot data with current min, max and step size." msgstr "按照当å‰çš„æœ€å¤§ã€æœ€å°å’Œæ­¥é•¿ï¼Œæ— æ³•生æˆç»˜å›¾æ•°æ®ã€‚" #: ../libqalculate/BuiltinFunctions.cc:7237 #: ../libqalculate/BuiltinFunctions.cc:7286 msgid "Sampling rate must be a positive integer." msgstr "" #: ../libqalculate/BuiltinFunctions.cc:7246 #: ../libqalculate/BuiltinFunctions.cc:7295 ../libqalculate/Calculator.cc:10533 msgid "Unable to generate plot data with current min, max and sampling rate." msgstr "按照当å‰çš„æœ€å¤§ã€æœ€å°å’Œé‡‡æ ·çŽ‡ï¼Œæ— æ³•ç”Ÿæˆç»˜å›¾æ•°æ®ã€‚" #: ../libqalculate/Calculator.cc:390 msgid "per" msgstr "per" #: ../libqalculate/Calculator.cc:392 msgid "times" msgstr "times" #: ../libqalculate/Calculator.cc:394 msgid "plus" msgstr "plus" #: ../libqalculate/Calculator.cc:396 msgid "minus" msgstr "minus" #: ../libqalculate/Calculator.cc:398 ../libqalculate/MathStructure.cc:18761 #: ../libqalculate/Function.cc:1223 ../libqalculate/Function.cc:1231 #: ../libqalculate/Function.cc:1660 ../libqalculate/Function.cc:1822 #: ../libqalculate/Function.cc:1830 msgid "and" msgstr "and" #: ../libqalculate/Calculator.cc:402 ../libqalculate/DataSet.cc:1046 #: ../libqalculate/DataSet.cc:1109 ../libqalculate/MathStructure.cc:18776 #: ../libqalculate/Function.cc:2161 ../libqalculate/Function.cc:2177 msgid "or" msgstr "or" #: ../libqalculate/Calculator.cc:449 ../libqalculate/Calculator.cc:1240 #: ../libqalculate/Calculator.cc:2622 ../libqalculate/Calculator.cc:2629 #: ../libqalculate/Calculator.cc:2630 msgid " to " msgstr " to " #: ../libqalculate/Calculator.cc:535 msgid "Gradians unit is missing. Creating one for this session." msgstr "梯度å•ä½ä¸¢å¤±ã€‚自动为本会è¯åˆ›å»ºäº†ä¸€ä¸ªã€‚" #: ../libqalculate/Calculator.cc:536 ../libqalculate/Calculator.cc:544 #: ../libqalculate/Calculator.cc:552 msgid "Angle/Plane Angle" msgstr "è§’/å¹³é¢è§’" #: ../libqalculate/Calculator.cc:543 msgid "Radians unit is missing. Creating one for this session." msgstr "弧度å•ä½ä¸¢å¤±ã€‚自动为本会è¯åˆ›å»ºäº†ä¸€ä¸ªã€‚" #: ../libqalculate/Calculator.cc:551 msgid "Degrees unit is missing. Creating one for this session." msgstr "角度å•ä½ä¸¢å¤±ã€‚自动为本会è¯åˆ›å»ºäº†ä¸€ä¸ªã€‚" #: ../libqalculate/Calculator.cc:1631 ../libqalculate/Calculator.cc:1632 #: ../libqalculate/Calculator.cc:10080 ../libqalculate/Calculator.cc:10217 #: ../libqalculate/Calculator.cc:10275 msgid "Currency" msgstr "è´§å¸" #: ../libqalculate/Calculator.cc:1818 msgid "" "The calculation has been forcibly terminated. Please restart the application " "and report this as a bug." msgstr "" #: ../libqalculate/Calculator.cc:2094 ../libqalculate/Calculator.cc:2219 msgid "Stack is empty. Filling remaining function arguments with zeroes." msgstr "" #: ../libqalculate/Calculator.cc:2573 msgid "calculating..." msgstr "正在计算" #: ../libqalculate/Calculator.cc:4191 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or " "the variable will be lost." msgstr "在å称中ä¸å†å…许使用\"%s\"。请修改åç§°\"%s\",å¦åˆ™æ­¤å˜é‡å°†æ¶ˆå¤±ã€‚" #: ../libqalculate/Calculator.cc:4209 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the function will be lost." msgstr "在å称中ä¸å†å…许使用\"%s\"。请修改åç§°\"%s\",å¦åˆ™æ­¤å‡½æ•°å°†æ¶ˆå¤±ã€‚" #: ../libqalculate/Calculator.cc:4226 #, c-format msgid "" "\"%s\" is not allowed in names anymore. Please change the name \"%s\", or " "the unit will be lost." msgstr "在å称中ä¸å†å…许使用\"%s\"。请修改åç§°\"%s\",å¦åˆ™æ­¤å•ä½å°†æ¶ˆå¤±ã€‚" #: ../libqalculate/Calculator.cc:5589 ../libqalculate/Calculator.cc:6546 #: ../libqalculate/Calculator.cc:6553 ../libqalculate/Calculator.cc:6574 #: ../libqalculate/Calculator.cc:6595 #, c-format msgid "Misplaced operator(s) \"%s\" ignored" msgstr "已忽略放错地方的è¿ç®—符\"%s\"。" #: ../libqalculate/Calculator.cc:5630 ../libqalculate/Calculator.cc:6614 #, c-format msgid "Misplaced '%c' ignored" msgstr "已忽略放错地方的\"%c\"。" #: ../libqalculate/Calculator.cc:5662 ../libqalculate/Function.cc:1381 #: ../libqalculate/Function.cc:1412 #, c-format msgid "Internal id %s does not exist." msgstr "内部id %sä¸å­˜åœ¨ã€‚" #: ../libqalculate/Calculator.cc:5680 #, c-format msgid "\"%s\" is not a valid variable/function/unit." msgstr "\"%s\"䏿˜¯åˆæ³•çš„å˜é‡/函数/å•ä½ã€‚" #: ../libqalculate/Calculator.cc:5695 #, c-format msgid "" "Trailing characters \"%s\" (not a valid variable/function/unit) in number " "\"%s\" was ignored." msgstr "尾部字符\"%s\"(䏿˜¯åˆæ³•çš„å˜é‡/函数/å•ä½) in æ•°å­—\"%s\"已被忽略。" #: ../libqalculate/Calculator.cc:6153 msgid "RPN syntax error. Values left at the end of the RPN expression." msgstr "RPN语法错误。在逆波兰表达å¼çš„æœ€åŽå‰©ä¸‹äº†æ•°å€¼ã€‚" #: ../libqalculate/Calculator.cc:6156 msgid "Unused stack values." msgstr "栈内还有值未被使用。" #: ../libqalculate/Calculator.cc:6195 ../libqalculate/Calculator.cc:6263 #, fuzzy, c-format msgid "RPN syntax error. Operator '%c' not supported." msgstr "RPN语法错误。栈内是空的。" #: ../libqalculate/Calculator.cc:6223 msgid "RPN syntax error. Stack is empty." msgstr "RPN语法错误。栈内是空的。" #: ../libqalculate/Calculator.cc:6225 msgid "RPN syntax error. Operator ignored as there where only one stack value." msgstr "RPNè¯­æ³•é”™è¯¯ã€‚æ ˆå†…åªæœ‰ä¸€ä¸ªå€¼ï¼Œå› æ­¤è¿ç®—符已被忽略。" #: ../libqalculate/Calculator.cc:6855 #, c-format msgid "Name \"%s\" is in use. Replacing with \"%s\"." msgstr "åç§°\"%s\"已被使用。替æ¢ä¸º\"%s\"。" #: ../libqalculate/Calculator.cc:7541 ../libqalculate/DataSet.cc:529 #, c-format msgid "File not identified as Qalculate! definitions file: %s." msgstr "指定的文件无法被Qalculate!è¯†åˆ«ï¼ å®šä¹‰æ–‡ä»¶ï¼š%s。" #: ../libqalculate/Calculator.cc:9581 ../libqalculate/DataSet.cc:353 msgid "Object" msgstr "对象" #: ../libqalculate/Calculator.cc:9590 ../libqalculate/DataSet.cc:354 msgid "Property" msgstr "属性" #: ../libqalculate/Calculator.cc:9889 msgid "column" msgstr "column" #: ../libqalculate/Calculator.cc:9892 msgid "Column " msgstr "列" #: ../libqalculate/Calculator.cc:9968 ../libqalculate/Calculator.cc:10015 msgid "timed out" msgstr "已超时" #: ../libqalculate/Calculator.cc:10387 ../libqalculate/Calculator.cc:10388 #: ../libqalculate/Calculator.cc:10392 ../libqalculate/Calculator.cc:10395 #: ../libqalculate/Calculator.cc:10427 ../libqalculate/Calculator.cc:10428 #: ../libqalculate/Calculator.cc:10431 ../libqalculate/Calculator.cc:10450 #: ../libqalculate/Calculator.cc:10451 ../libqalculate/Calculator.cc:10454 #, c-format msgid "Failed to download exchange rates from %s: %s." msgstr "从%s下载汇率失败:%s。" #: ../libqalculate/Calculator.cc:10529 ../libqalculate/Calculator.cc:10562 #: ../libqalculate/Calculator.cc:10595 ../libqalculate/Calculator.cc:10934 msgid "It took too long to generate the plot data." msgstr "" #: ../libqalculate/Calculator.cc:10629 msgid "No extension in file name. Saving as PNG image." msgstr "未指定文件扩展å。ä¿å­˜ä¸ºPNG图åƒã€‚" #: ../libqalculate/Calculator.cc:10648 msgid "Unknown extension in file name. Saving as PNG image." msgstr "未知的文件扩展å。ä¿å­˜ä¸ºPNG图åƒã€‚" #: ../libqalculate/Calculator.cc:10865 #, c-format msgid "Could not create temporary file %s" msgstr "无法创建临时文件%s" #: ../libqalculate/Calculator.cc:10981 msgid "" "Failed to invoke gnuplot. Make sure that you have gnuplot installed in your " "path." msgstr "调用gnuplot失败。请确认在您的路径中包å«gnuplot。" #: ../libqalculate/DataSet.cc:379 #, c-format msgid "Object %s not available in data set." msgstr "æ•°æ®é›†ä¸­æ²¡æœ‰å¯¹è±¡%s。" #: ../libqalculate/DataSet.cc:389 #, c-format msgid "Property %s not available in data set." msgstr "æ•°æ®é›†ä¸­æ²¡æœ‰å±žæ€§%s。" #: ../libqalculate/DataSet.cc:394 #, c-format msgid "Property %s not defined for object %s." msgstr "属性%s在对象%s中没有定义。" #: ../libqalculate/DataSet.cc:507 ../libqalculate/DataSet.cc:515 #, c-format msgid "Unable to load data objects in %s." msgstr "无法从%s中载入数æ®ã€‚" #: ../libqalculate/DataSet.cc:1016 msgid "data property" msgstr "data property" #: ../libqalculate/DataSet.cc:1018 msgid "name of a data property" msgstr "æ•°æ®å±žæ€§çš„åç§°" #: ../libqalculate/DataSet.cc:1026 ../libqalculate/DataSet.cc:1042 msgid "no properties available" msgstr "没有å¯ç”¨çš„属性" #: ../libqalculate/DataSet.cc:1076 #, c-format msgid "" "Data set \"%s\" has no object key that supports the provided argument type." msgstr "æ•°æ®é›†\"%s\"ä¸­æ²¡æœ‰æ”¯æŒæ‰€æä¾›çš„傿•°ç±»åž‹çš„对象关键字。" #: ../libqalculate/DataSet.cc:1081 msgid "data object" msgstr "data object" #: ../libqalculate/DataSet.cc:1083 msgid "an object from" msgstr "æ¥è‡ªäºŽ...的对象" #: ../libqalculate/DataSet.cc:1112 msgid "use" msgstr "use" #: ../libqalculate/MathStructure.cc:174 #, fuzzy, c-format msgid "Required assumption: %s." msgstr "未被承认的å‡è®¾" #: ../libqalculate/MathStructure.cc:3792 ../libqalculate/MathStructure.cc:3813 #, c-format msgid "" "The second matrix must have as many rows (was %s) as the first has columns " "(was %s) for matrix multiplication." msgstr "在矩阵乘法中,第二个å‘é‡çš„列数(%s)必须与第一个å‘é‡çš„行数(%s)相åŒã€‚" #: ../libqalculate/MathStructure.cc:8265 ../libqalculate/MathStructure.cc:8306 #: ../libqalculate/MathStructure.cc:8339 ../libqalculate/MathStructure.cc:8406 #: ../libqalculate/MathStructure.cc:8434 ../libqalculate/MathStructure.cc:8453 #: ../libqalculate/MathStructure.cc:8472 ../libqalculate/MathStructure.cc:8491 #: ../libqalculate/MathStructure.cc:8600 ../libqalculate/MathStructure.cc:14408 #: ../libqalculate/MathStructure.cc:14684 msgid "This is a bug. Please report it." msgstr "这是个bug。请想我们报告它。" #: ../libqalculate/MathStructure.cc:10980 #: ../libqalculate/MathStructure.cc:10985 #, c-format msgid "Limit for %s determined graphically." msgstr "" #: ../libqalculate/MathStructure.cc:11792 msgid "Interval potentially calculated wide." msgstr "" #: ../libqalculate/MathStructure.cc:16085 msgid "" "Because of time constraints only a limited number of combinations of terms " "were tried during factorization. Repeat factorization to try other random " "combinations." msgstr "" #: ../libqalculate/MathStructure.cc:18860 msgid "undefined" msgstr "undefined" #: ../libqalculate/MathStructure.cc:18901 #, c-format msgid "Unsolvable comparison at element %s when trying to rank vector." msgstr "" #: ../libqalculate/MathStructure.cc:18951 #, c-format msgid "Unsolvable comparison at element %s when trying to sort vector." msgstr "试图为å‘釿ޒåºï¼Œä½†æ— æ³•比较元素%s。" #: ../libqalculate/MathStructure.cc:19376 msgid "The determinant can only be calculated for square matrices." msgstr "åªèƒ½ä¸ºæ–¹é˜µè®¡ç®—行列å¼" #: ../libqalculate/MathStructure.cc:19439 msgid "The permanent can only be calculated for square matrices." msgstr "åªèƒ½ä¸ºæ–¹é˜µè®¡ç®—ä¸å˜ç§¯å’Œå¼" #: ../libqalculate/MathStructure.cc:19528 msgid "Inverse of singular matrix." msgstr "奇异矩阵的逆。" #: ../libqalculate/MathStructure.cc:19875 msgid "" "Calculations involving conversion of units without proportional linear " "relationship (e.g. with multiple temperature units), might give unexpected " "results and is not recommended." msgstr "" #: ../libqalculate/MathStructure.cc:20745 #: ../libqalculate/MathStructure.cc:20788 msgid "Too many data points" msgstr "" #: ../libqalculate/MathStructure.cc:20752 msgid "" "The selected min and max do not result in a positive, finite number of data " "points" msgstr "" #: ../libqalculate/MathStructure.cc:20785 msgid "" "The selected min, max and step size do not result in a positive, finite " "number of data points" msgstr "" #: ../libqalculate/MathStructure.cc:27312 #: ../libqalculate/MathStructure.cc:27488 #: ../libqalculate/MathStructure.cc:28117 #: ../libqalculate/MathStructure.cc:28625 #: ../libqalculate/MathStructure.cc:28682 #: ../libqalculate/MathStructure.cc:28724 #: ../libqalculate/MathStructure.cc:28737 #: ../libqalculate/MathStructure.cc:28787 #: ../libqalculate/MathStructure.cc:28906 #: ../libqalculate/MathStructure.cc:29041 #, c-format msgid "Interval arithmetic was disabled during calculation of %s." msgstr "" #: ../libqalculate/MathStructure.cc:29040 #, c-format msgid "Not all complex roots were calculated for %s." msgstr "" #: ../libqalculate/MathStructure.cc:30450 #, c-format msgid "Only one or two of the roots where calculated for %s." msgstr "" #: ../libqalculate/Function.cc:165 #, c-format msgid "%s() requires that %s" msgstr "%s()需è¦%s。" #: ../libqalculate/Function.cc:320 ../libqalculate/Function.cc:379 #: ../libqalculate/Function.cc:439 #, c-format msgid "" "Additional arguments for function %s() was ignored. Function can only use %s " "argument(s)." msgstr "已忽略函数%sçš„å¤šä½™å‚æ•°ã€‚它åªéœ€è¦%sä¸ªå‚æ•°ã€‚" #: ../libqalculate/Function.cc:460 #, c-format msgid "You need at least %s argument(s) (%s) in function %s()." msgstr "你需è¦è‡³å°‘%sä¸ªå‚æ•°(%s)æä¾›ç»™å‡½æ•°%s()" #: ../libqalculate/Function.cc:462 #, c-format msgid "You need at least %s argument(s) in function %s()." msgstr "你需è¦è‡³å°‘%sä¸ªå‚æ•°æä¾›ç»™å‡½æ•°%s()" #: ../libqalculate/Function.cc:1213 msgid "a free value" msgstr "一个自由é‡" #: ../libqalculate/Function.cc:1218 msgid "that is nonzero" msgstr "éžé›¶" #: ../libqalculate/Function.cc:1226 msgid "that is rational (polynomial)" msgstr "åˆç†çš„(多项å¼çš„)" #: ../libqalculate/Function.cc:1234 msgid "that fulfills the condition:" msgstr "满足下列æ¡ä»¶ï¼š" #: ../libqalculate/Function.cc:1237 msgid "Argument" msgstr "自å˜é‡" #: ../libqalculate/Function.cc:1301 #, c-format msgid "Argument %s in %s() must be %s." msgstr "傿•°%s, 在%s()中必须为%s。" #: ../libqalculate/Function.cc:1303 #, c-format msgid "Argument %s, %s, in %s() must be %s." msgstr "傿•°%s,%s, 在%s()中必须为%s。" #: ../libqalculate/Function.cc:1641 msgid "a rational number" msgstr "ä¸€ä¸ªæœ‰ç†æ•°" #: ../libqalculate/Function.cc:1643 msgid "a number" msgstr "一个数" #: ../libqalculate/Function.cc:1645 msgid "a real number" msgstr "一个实数" #: ../libqalculate/Function.cc:1650 ../libqalculate/Function.cc:1803 #: ../libqalculate/Function.cc:1808 msgid ">=" msgstr ">=" #: ../libqalculate/Function.cc:1652 msgid ">" msgstr ">" #: ../libqalculate/Function.cc:1664 ../libqalculate/Function.cc:1825 #: ../libqalculate/Function.cc:1832 msgid "<=" msgstr "<=" #: ../libqalculate/Function.cc:1666 msgid "<" msgstr "<" #: ../libqalculate/Function.cc:1800 msgid "an integer" msgstr "一个整数" #: ../libqalculate/Function.cc:1857 msgid "symbol" msgstr "symbol" #: ../libqalculate/Function.cc:1858 msgid "an unknown variable/symbol" msgstr "一个未知å˜é‡æˆ–符å·" #: ../libqalculate/Function.cc:1871 msgid "text" msgstr "text" #: ../libqalculate/Function.cc:1872 msgid "a text string" msgstr "一段文字" #: ../libqalculate/Function.cc:1894 msgid "date" msgstr "date" #: ../libqalculate/Function.cc:1895 msgid "a date" msgstr "一个日期" #: ../libqalculate/Function.cc:1944 msgid "a vector with " msgstr "一个å‘é‡with" #: ../libqalculate/Function.cc:1956 msgid "a vector" msgstr "一个å‘é‡" #: ../libqalculate/Function.cc:2005 msgid "a square matrix" msgstr "一个方阵" #: ../libqalculate/Function.cc:2007 msgid "a matrix" msgstr "一个矩阵" #: ../libqalculate/Function.cc:2022 msgid "object" msgstr "object" #: ../libqalculate/Function.cc:2023 msgid "a valid function, unit or variable name" msgstr "ä¸€ä¸ªåˆæ³•的函数ã€å•使ˆ–函数å" #: ../libqalculate/Function.cc:2037 msgid "a valid function name" msgstr "ä¸€ä¸ªåˆæ³•的函数å" #: ../libqalculate/Function.cc:2050 msgid "unit" msgstr "unit" #: ../libqalculate/Function.cc:2051 msgid "a valid unit name" msgstr "ä¸€ä¸ªåˆæ³•çš„å•ä½å" #: ../libqalculate/Function.cc:2065 msgid "a valid variable name" msgstr "ä¸€ä¸ªåˆæ³•çš„å˜é‡å" #: ../libqalculate/Function.cc:2078 msgid "file" msgstr "file" #: ../libqalculate/Function.cc:2079 msgid "a valid file name" msgstr "ä¸€ä¸ªåˆæ³•的文件å" #: ../libqalculate/Function.cc:2092 msgid "boolean" msgstr "boolean" #: ../libqalculate/Function.cc:2093 msgid "a boolean (0 or 1)" msgstr "一个逻辑é‡(0或者1)" #: ../libqalculate/Function.cc:2103 msgid "angle" msgstr "angle" #: ../libqalculate/Function.cc:2104 msgid "an angle or a number (using the default angle unit)" msgstr "一个角度或者数字(使用缺çœè§’度å•ä½)" #: ../libqalculate/Number.cc:235 ../libqalculate/Number.cc:6709 msgid "" "Cannot display numbers greater than 9999 or less than -9999 as roman " "numerals." msgstr "无法显示大于9999或å°äºŽ-9999的罗马数字。" #: ../libqalculate/Number.cc:348 msgid "" "Assuming the unusual practice of letting a last capital I mean 2 in a roman " "numeral." msgstr "å‡è®¾ä¸€ç§ä¸å¸¸è§çš„æƒ…况:在罗马数字中,最åŽä¸€ä¸ªå¤§å†™çš„\"I\"表示2。" #: ../libqalculate/Number.cc:426 #, c-format msgid "Error in roman numerals: %s." msgstr "在罗马数字中有错:\"%s\"" #: ../libqalculate/Number.cc:461 #, c-format msgid "Unknown roman numeral: %c." msgstr "ä¸è®¤è¯†çš„罗马数字:\"%c\"" #: ../libqalculate/Number.cc:519 #, c-format msgid "" "Errors in roman numerals: \"%s\". Interpreted as %s, which should be written " "as %s." msgstr "罗马数字中有错误:\"%s\"。已被翻译æˆ\"%s\",它正确的写法是\"%s\"。" #: ../libqalculate/Number.cc:601 #, fuzzy msgid "Too large exponent." msgstr "show negative exponents" #: ../libqalculate/Number.cc:630 msgid "':' in decimal number ignored (decimal point detected)." msgstr "å进制数中的\":\"被忽略。(å·²å‘çŽ°å°æ•°ç‚¹)" #: ../libqalculate/Number.cc:660 #, c-format msgid "Character '%c' was ignored in the number \"%s\" with base %s." msgstr "字符\"%c\"被忽略,在数字\"%s\"中,其base为\"%s\"。" #: ../libqalculate/Number.cc:1649 ../libqalculate/Number.cc:1771 msgid "Floating point underflow" msgstr "" #: ../libqalculate/Number.cc:1650 ../libqalculate/Number.cc:1772 msgid "Floating point overflow" msgstr "" #: ../libqalculate/Number.cc:1651 ../libqalculate/Number.cc:1773 msgid "Floating point division by zero exception" msgstr "" #: ../libqalculate/Number.cc:1652 ../libqalculate/Number.cc:1776 msgid "Floating point not a number exception" msgstr "" #: ../libqalculate/Number.cc:1653 ../libqalculate/Number.cc:1774 msgid "Floating point range exception" msgstr "" #: ../libqalculate/Number.cc:3222 msgid "Division by zero." msgstr "被零除。" #. 0^0 #: ../libqalculate/Number.cc:3228 msgid "0^0 might be considered undefined" msgstr "0^0å°†è¢«å½“æˆæœªå®šä¹‰é‡å¤„ç†" #: ../libqalculate/Number.cc:3235 msgid "The result of 0^i is possibly undefined" msgstr "" #: ../libqalculate/Number.cc:3284 ../libqalculate/Number.cc:4985 #: ../libqalculate/Number.cc:5096 ../libqalculate/Number.cc:5425 #: ../libqalculate/Number.cc:5433 ../libqalculate/Number.cc:5466 #: ../libqalculate/Number.cc:5563 ../libqalculate/Number.cc:5712 #: ../libqalculate/Number.cc:5824 msgid "Interval calculated wide." msgstr "" #: ../libqalculate/Number.cc:4542 msgid "Cannot handle an argument (s) that large for Riemann Zeta." msgstr "无法处ç†å¯¹äºŽé»Žæ›¼Zeta函数æ¥è¯´å¤ªå¤§çš„傿•°" #: ../libqalculate/Number.cc:4617 ../libqalculate/Number.cc:4715 #: ../libqalculate/Number.cc:4746 ../libqalculate/Number.cc:4777 #: ../libqalculate/Number.cc:6169 #, c-format msgid "%s() lacks proper support interval arithmetic." msgstr "" #: ../libqalculate/Number.cc:6706 #, fuzzy msgid "Can only display rational numbers as roman numerals." msgstr "无法显示大于9999或å°äºŽ-9999的罗马数字。" #: ../libqalculate/Number.cc:7095 ../libqalculate/Number.cc:7103 msgid "infinity" msgstr "infinity" #: ../libqalculate/QalculateDateTime.cc:25 msgid "January" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "February" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "March" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "April" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "May" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "June" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "July" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "August" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "September" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "October" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "November" msgstr "" #: ../libqalculate/QalculateDateTime.cc:25 msgid "December" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Thout" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paopi" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Hathor" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Koiak" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Tobi" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Meshir" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paremhat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Parmouti" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Pashons" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Paoni" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Epip" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Mesori" msgstr "" #: ../libqalculate/QalculateDateTime.cc:26 msgid "Pi Kogi Enavot" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Mäskäräm" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "ṬəqÉ™mt" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ḫədar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "TaḫśaÅ›" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ṭərr" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Yäkatit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Mägabit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Miyazya" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "GÉ™nbo" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Säne" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Ḥamle" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 msgid "Nähase" msgstr "" #: ../libqalculate/QalculateDateTime.cc:27 #, fuzzy msgid "á¹–agume" msgstr "argument" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Muḥarram" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "á¹¢afar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rabī‘ al-awwal" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rabī‘ ath-thÄnÄ«" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "JumÄdá al-Å«lá" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "JumÄdá al-Äkhirah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Rajab" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Sha‘bÄn" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "Ramaá¸Än" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "ShawwÄl" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "DhÅ« al-Qa‘dah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:28 msgid "DhÅ« al-Ḥijjah" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Farvardin" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Ordibehesht" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Khordad" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Tir" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Mordad" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Shahrivar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Mehr" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Aban" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Azar" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 #, fuzzy msgid "Dey" msgstr "key" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Bahman" msgstr "" #: ../libqalculate/QalculateDateTime.cc:29 msgid "Esfand" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Chaitra" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "VaishÄkha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "JyÄ“shtha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Ä€shÄdha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "ShrÄvana" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Bhaadra" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Ä€shwin" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "KÄrtika" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Agrahayana" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Pausha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "MÄgha" msgstr "" #: ../libqalculate/QalculateDateTime.cc:30 msgid "Phalguna" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Wood" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Fire" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Earth" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Metal" msgstr "" #: ../libqalculate/QalculateDateTime.cc:31 msgid "Water" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Ox" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Tiger" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rabbit" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Dragon" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Snake" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Horse" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Goat" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Monkey" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Rooster" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Dog" msgstr "" #: ../libqalculate/QalculateDateTime.cc:32 msgid "Pig" msgstr "" #: ../libqalculate/QalculateDateTime.cc:345 msgid "now" msgstr "now" #: ../libqalculate/QalculateDateTime.cc:349 msgid "today" msgstr "today" #: ../libqalculate/QalculateDateTime.cc:353 msgid "tomorrow" msgstr "" #: ../libqalculate/QalculateDateTime.cc:358 msgid "yesterday" msgstr "" #: ../libqalculate/QalculateDateTime.cc:2599 msgid "leap month" msgstr "" #: ../libqalculate/Unit.cc:908 msgid "Error(s) in unitexpression." msgstr "å•ä½è¡¨è¾¾å¼é‡Œæœ‰é”™ã€‚" #: ../libqalculate/Variable.cc:456 #, c-format msgid "Recursive variable: %s = %s" msgstr "" #: ../libqalculate/util.cc:175 msgid "Yes" msgstr "Yes" #: ../libqalculate/util.cc:176 msgid "No" msgstr "No" #: ../libqalculate/util.cc:183 msgid "True" msgstr "True" #: ../libqalculate/util.cc:184 msgid "False" msgstr "False" #: ../libqalculate/util.cc:191 msgid "On" msgstr "On" #: ../libqalculate/util.cc:192 msgid "Off" msgstr "Off" #~ msgid "exp mode" #~ msgstr "exp mode" #~ msgid "negatve" #~ msgstr "negatve" #~ msgid "sex" #~ msgstr "sex" #~ msgid "dot as separator" #~ msgstr "dot as separator" #, fuzzy #~ msgid "comma as separator" #~ msgstr "dot as separator" #~ msgid "Error in date format for function %s()." #~ msgstr "函数%s()的日期格å¼é”™è¯¯ã€‚" #~ msgid "" #~ "Both the lower and upper limit must be set to get the definite integral." #~ msgstr "å¿…é¡»åŒæ—¶è®¾ç½®ç§¯åˆ†ä¸Šä¸‹é™ï¼Œæ‰èƒ½èŽ·å¾—å®šç§¯åˆ†ã€‚" #~ msgid "indicate infinite series" #~ msgstr "indicate infinite series" #~ msgid "Can only handle Riemann Zeta with an integer argument (s) >= 1" #~ msgstr "åªèƒ½å¤„ç†å‚数为大于等于1的正整数的黎曼Zeta函数" #~ msgid "" #~ "Series %s contains non-numerical data (\"%s\" first of %s) which can not " #~ "be properly plotted." #~ msgstr "åºåˆ—%sä¸­åŒ…å«æ— æ³•è¢«æ­£ç¡®ç»˜åˆ¶çš„éžæ•°å­—型数æ®(\"%s\"first of %s)。" #~ msgid "" #~ "Series %s contains non-real data (\"%s\" first of %s) which can not be " #~ "properly plotted." #~ msgstr "åºåˆ—%sä¸­åŒ…å«æ— æ³•被正确绘制的éžå®žæ•°æ•°æ®(\"%s\"first of %s)。" #~ msgid "Failed to download exchange rates from ECB: %s" #~ msgstr "从ECB下载汇率失败:%s" #, fuzzy #~ msgid "Failed to download exchange rates from mycurrency.net: %s" #~ msgstr "从ECB下载汇率失败:%s" #~ msgid "%s() does at the moment only support integers and fractions of two." #~ msgstr "%sç›®å‰åªæ”¯æŒæ•´æ•°å’Œ2的分数。" #, fuzzy #~ msgid "An global unit or variable with the same name already exists." #~ msgstr "" #~ "åŒåçš„å•使ˆ–å˜é‡å·²å­˜åœ¨ã€‚\n" #~ "您è¦è¦†ç›–它å—?" #, fuzzy #~ msgid "" #~ "You need the download exchange rates to be able to convert between " #~ "different currencies.\n" #~ "You can later get current exchange rates with the \"exrates\" command.\n" #~ "Do you want to fetch exchange rates now from the Internet (default: yes)?" #~ msgstr "" #~ "需è¦å…ˆä¸‹è½½æ±‡çŽ‡ï¼Œæ‰èƒ½è¿›è¡Œè´§å¸æ¢ç®—。\n" #~ "ä½ å¯ä»¥ä»¥åŽé€šè¿‡\"exchange rates\"命令获å–当剿±‡çŽ‡ã€‚ 是å¦çŽ°åœ¨å°±ä»Žå› ç‰¹ç½‘ä¸‹è½½" #~ "汇率?(缺çœï¼šæ˜¯ï¼‰" #~ msgid "WGET ARGUMENTS" #~ msgstr "WGET ARGUMENTS" #~ msgid "The timestamp value for the date %s is too large or small for %s()." #~ msgstr "对于函数%s而言,时间戳%s的值太大或太å°ã€‚" #, fuzzy #~ msgid "Temperature" #~ msgstr "临时" #~ msgid "ON/OFF" #~ msgstr "ON/OFF" #~ msgid "UNIT" #~ msgstr "å•ä½" #~ msgid "best (convert best unit)" #~ msgstr "best (转æ¢ä¸ºæœ€ä½³å•ä½)" #~ msgid "Example: convert best." #~ msgstr "例:convert best" #~ msgid "Decimal point in sexagesimal number treated as ':'." #~ msgstr "å…­åè¿›åˆ¶æ•°ä¸­çš„å°æ•°ç‚¹è¢«å¤„ç†ä¸º\":\"" libqalculate-2.8.2/po/POTFILES.in0000644000175000017500000000062313265660231013306 00000000000000# List of source files containing translatable strings. [encoding: UTF-8] src/qalc.cc libqalculate/BuiltinFunctions.cc libqalculate/Calculator.cc libqalculate/DataSet.cc libqalculate/ExpressionItem.cc libqalculate/MathStructure.cc libqalculate/Function.cc libqalculate/Number.cc libqalculate/Prefix.cc libqalculate/QalculateDateTime.cc libqalculate/Unit.cc libqalculate/Variable.cc libqalculate/util.cc libqalculate-2.8.2/TODO0000644000175000017500000000066013362134262011602 00000000000000* Lambert W branches * Quoted ")" in function * Replace pointers to unit when unit type has changed (a different object must be created) * Enhanced integration * More functions * More units * Increase support for non-glibc systems * Sane and stable API * Script/code plugins for advanced functions * Load data set from csv file * Complete non-square free factorization * Simplification of division by polynomial with roots libqalculate-2.8.2/data/0000755000175000017500000000000013401033232012066 500000000000000libqalculate-2.8.2/data/currencies.xml.in0000644000175000017500000007620713314426556015335 00000000000000 <_title>Currency <_title>European Euros <_names>ar:EUR,au:€,euro,p:euros <_countries>Andorra, Austria, Belgium, Cyprus, Estonia, Finland, France, Germany, Greece, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, Portugal, San Marino, Slovakia, Slovenia, Spain, Vatican City <_title>U.S. Dollars <_names>a:$,ar:USD,dollar,p:dollars <_countries>United States, East Timor, Ecuador, El Salvador, Micronesia, Marshall Islands, Palau, Zimbabwe <_title>Japanese Yen <_names>ar:JPY,au:¥,yen <_countries>Japan <_title>Danish Kroner <_names>ar:DKK <_countries>Denmark <_title>British Pounds <_names>ar:GBP,au:£ <_countries>United Kingdom <_title>Thai Baht <_names>ar:THB <_countries>Thailand <_title>Swedish Krona <_names>ar:SEK <_countries>Sweden <_title>Swiss Francs <_names>ar:CHF <_countries>Switzerland <_title>Norwegian Kroner <_names>ar:NOK <_countries>Norway <_title>Bulgarian Lev <_names>lev,ar:BGN <_countries>Bulgaria <_title>Russian Ruble <_names>ar:RUB,au:₽,ruble <_countries>Russia <_title>Philippine Peso <_names>ar:PHP,au:₱ <_countries>Philippines <_title>Malaysian Ringgit <_names>ar:MYR <_countries>Malaysia <_title>Croatian Kuna <_names>ar:HRK <_countries>Croatia <_title>Yuan Renminbi (PR China) <_names>ar:CNY <_countries>China <_title>Indonesian Rupiah <_names>ar:IDR,rupiah <_countries>Indonesia <_title>Czech Koruna <_names>ar:CZK,au-c:Kč <_countries>Czech Republic <_title>Hungarian Forint <_names>forint,ar:HUF <_countries>Hungary <_title>Polish Zloty <_names>ar:PLN,au:zł,zloty <_countries>Poland <_title>Romanian Leu <_names>ar:RON <_countries>Romania <_title>Turkish New Lira <_names>ar:TRY,au:₺ <_countries>Turkey <_title>Australian Dollars <_names>ar:AUD <_countries>Australia <_title>Canadian Dollars <_names>ar:CAD <_countries>Canada <_title>Hong Kong Dollars <_names>ar:HKD <_title>New Zealand Dollars <_names>ar:NZD <_countries>New Zealand <_title>Singapore Dollars <_names>ar:SGD <_countries>Singapore <_title>South Korean Won <_names>ar:KRW,au:₩,won <_countries>South Korea <_title>South African Rand <_names>ar:ZAR <_countries>South Africa <_title>Indian Rupee <_names>ar:INR,au:₹,rupee <_countries>India <_title>Israeli New Sheqel <_names>ar:ILS,au:₪,sheqel <_countries>Israel <_title>Mexican Peso <_names>ar:MXN <_countries>Mexico <_title>Brazilian Real <_names>ar:BRL <_countries>Brazil <_title>Icelandic Krónur <_names>ar:ISK <_countries>Iceland <_title>Bitcoins <_names>ar:BTC,au:₿,a:XBT,bitcoin,p:bitcoins <_title>Kenya Shilling <_names>ar:KES <_countries>Kenya <_title>Afghan Afghani <_names>ar:AFN,aiu:؋ <_countries>Afghanistan <_title>Albanian Lek <_names>ar:ALL <_countries>Albania <_title>Algerian Dinar <_names>ar:DZD <_countries>Algeria <_title>Angolan Kwanza <_names>ar:AOA <_countries>Angola <_title>Eastern Caribbean Dollar <_names>ar:XCD <_countries>Antigua and Barbuda, Dominica, Grenada, Montserrat, Saint Kitts and Nevis, Saint Lucia, Saint Vincent and the Grenadines, Anguilla <_title>Argentine Peso <_names>ar:ARS <_countries>Argentina <_title>Armenian Dram <_names>ar:AMD,au:֏ <_countries>Armenia <_title>Aruban Florin <_names>ar:AWG <_countries>Aruba <_title>Netherlands Antillean Guilder <_names>ar:ANG <_countries>Curaçao, Sint Maarten <_title>Azerbaijani Manat <_names>ar:AZN,au:₼ <_countries>Azerbaijan <_title>Bahamian Dollar <_names>ar:BSD <_countries>Bahamas <_title>Bahraini Dinar <_names>ar:BHD <_countries>Bahrain <_title>Bangladeshi Taka <_names>ar:BDT,au:৳ <_countries>Bangladesh <_title>Barbadian Dollar <_names>ar:BBD <_countries>Barbados <_title>Belarusian Ruble p. (obsolete) <_names>ar:BYR <_title>Belize Dollar <_names>ar:BZD <_countries>Belize <_title>West African CFA Franc <_names>ar:XOF,a:CFA <_countries>Benin, Burkina Faso, Guinea-Bissau, Ivory Coast, Mali, Niger, Senegal, Togo <_title>Bermudian Dollar <_names>ar:BMD <_countries>Bermuda <_title>Bolivian Boliviano Bs <_names>ar:BOB <_countries>Bolivia <_title>Bosnia and Herzegovina Convertible Mark <_names>ar:BAM <_countries>Bosnia and Herzegovina <_title>Botswana Pula <_names>ar:BWP <_countries>Botswana <_title>Brunei Dollar <_names>ar:BND <_countries>Brunei <_title>Burundian Franc <_names>ar:BIF <_countries>Burundi <_title>Cambodian Riel <_names>ar:KHR,aiu:៛ <_countries>Cambodia <_title>Central African CFA Franc <_names>ar:XAF,a:FCFA <_countries>Cameroon, Central African Republic, Chad, Republic of the Congo, Equatorial Guinea, Gabon <_title>Cape Verdean Escudo <_names>ar:CVE <_countries>Cape Verde <_title>Cayman Islands Dollar <_names>ar:KYD <_countries>Cayman Islands <_title>Chilean Peso <_names>ar:CLP <_countries>Chile <_title>Colombian Peso <_names>ar:COP <_countries>Colombia <_title>Comorian Franc <_names>ar:KMF <_countries>Comoros <_title>Democratic Republic of the Congo (Congolese Franc) <_names>ar:CDF <_countries>Democratic Republic of the Congo <_title>Costa Rican colón <_names>ar:CRC <_countries>Costa Rica <_title>Cuban Peso <_names>ar:CUP <_countries>Cuba <_title>Djiboutian Franc <_names>ar:DJF <_countries>Djibouti <_title>Dominican Peso <_names>ar:DOP <_countries>Dominican Republic <_title>Egyptian Pound <_names>ar:EGP <_countries>Egypt <_title>El Salvadoran Colon (obsolete) <_names>ar:SVC <_title>Eritrean Nafka <_names>ar:ERN <_countries>Eritrea <_title>Ethiopian Birr <_names>ar:ETB <_countries>Ethiopia <_title>Falkland Islands Pound <_names>ar:FKP <_countries>Falkland Islands <_title>Fijian Dollar <_names>ar:FJD <_countries>Fiji <_title>CFP franc <_names>ar:XPF <_countries>French Polynesia, New Caledonia, Wallis and Futuna <_title>Gambian Dalasi <_names>ar:GMD <_countries>Gambia <_title>Georgian Lari <_names>ar:GEL,au:₾ <_countries>Georgia <_title>Ghanaian Cedi <_names>ar:GHS,au:₵ <_countries>Ghana <_title>Gibraltar Pound <_names>ar:GIP <_countries>Gibraltar <_title>Guatemalan Quetzal <_names>ar:GTQ <_countries>Guatemala <_title>Guernsey Pound <_names>ar:GGP <_countries>Guernsey <_title>Guinean Franc <_names>ar:GNF <_countries>Guinea <_title>Guyanese Dollar <_names>ar:GYD <_countries>Guyana <_title>Haitian Gourde <_names>ar:HTG <_countries>Haiti <_title>Honduran Lempira <_names>ar:HNL <_countries>Honduras <_title>Iranian Rial <_names>ar:IRR,aiu:﷼ <_countries>Iran <_title>Iraqi Dinar <_names>ar:IQD <_countries>Iraq <_title>Jamaican Dollar <_names>ar:JMD <_countries>Jamaica <_title>Jordanian Dinar <_names>ar:JOD <_countries>Jordan <_title>Kazakhstani Tenge <_names>ar:KZT,au:₸ <_countries>Kazakhstan <_title>North Korean Won <_names>ar:KPW <_countries>North Korea <_title>Kuwaiti Dinar <_names>ar:KWD <_countries>Kuwait <_title>Kyrgyzstani Som <_names>ar:KGS,au:с <_countries>Kyrgyzstan <_title>Lao Kip <_names>ar:LAK,au:₭ <_countries>Laos <_title>Lebanese Pound <_names>ar:LBP <_countries>Lebanon <_title>Lesotho Loti <_names>ar:LSL <_countries>Lesotho <_title>Liberian Dollar <_names>ar:LRD <_countries>Liberia <_title>Libyan Dinar <_names>ar:LYD <_countries>Libya <_title>Macanese Pataca <_names>ar:MOP <_title>Macedonian Denar <_names>ar:MKD <_countries>Macedonia <_title>Malagasy Ariary <_names>ar:MGA <_countries>Madagascar <_title>Malawian Kwacha <_names>ar:MWK <_countries>Malawi <_title>Maldivian Rufiyaa <_names>ar:MVR <_countries>Maldives <_title>Mauritanian Ouguiya (obsolete) <_names>ar:MRO <_title>Mauritian Rupee <_names>ar:MUR <_countries>Mauritius <_title>Moldovan Leu <_names>ar:MDL <_countries>Moldova <_title>Mongolian Tögrög <_names>ar:MNT,au:₮ <_countries>Mongolia <_title>Moroccan Dirham <_names>ar:MAD <_countries>Morocco <_title>Mozambican Metical <_names>ar:MZN <_countries>Mozambique <_title>Myanmar (Burmese Kyat) <_names>ar:MMK <_countries>Myanmar <_title>Namibian Dollar <_names>ar:NAD <_countries>Namibia <_title>Nepalese Rupee <_names>ar:NPR <_countries>Nepal <_title>Nicaraguan Córdoba <_names>ar:NIO <_countries>Nicaragua <_title>Nigerian Naira <_names>ar:NGN,au:₦ <_countries>Nigeria <_title>Omani Rial <_names>ar:OMR <_countries>Oman <_title>Pakistani Rupee <_names>ar:PKR <_countries>Pakistan <_title>Panamaian Balboa <_names>ar:PAB <_countries>Panama <_title>Papua New Guinean Kina <_names>ar:PGK <_countries>Papua New Guinea <_title>Paraguayan Guaraní <_names>ar:PYG,au:₲ <_countries>Paraguay <_title>Peruvian Sol <_names>ar:PEN <_countries>Peru <_title>Qatari Riyal <_names>ar:QAR <_countries>Qatar <_title>Rwandan Franc <_names>ar:RWF <_countries>Rwanda <_title>São Tomé and Príncipe Dobra <_names>ar:STD <_countries>Sao Tome and Principe <_title>Saudi Riyal <_names>ar:SAR <_countries>Saudi Arabia <_title>Serbian Dinar <_names>ar:RSD <_countries>Serbia <_title>Seychellois Rupee <_names>ar:SCR <_countries>Seychelles <_title>Sierra Leonean Leone <_names>ar:SLL <_countries>Sierra Leone <_title>Solomon Islands Dollar <_names>ar:SBD <_countries>Solomon Islands <_title>Somali Shilling <_names>ar:SOS <_countries>Somalia <_title>Sri Lankan Rupee; <_names>ar:LKR,au:௹ <_countries>Sri Lanka <_title>Sudanese Pound <_names>ar:SDG <_countries>Sudan <_title>Surinamese Dollar <_names>ar:SRD <_countries>Suriname <_title>Swazi Lilangeni <_names>ar:SZL <_countries>Swaziland <_title>Syrian Pound <_names>ar:SYP <_countries>Syria <_title>New Taiwan Dollar <_names>ar:TWD <_countries>Taiwan <_title>Tajikistani Somoni <_names>ar:TJS <_countries>Tajikistan <_title>Tanzanian Shilling <_names>ar:TZS <_countries>Tanzania <_title>Tongan PaÊ»anga <_names>ar:TOP <_countries>Tonga <_title>Trinidad and Tobago dollar <_names>ar:TTD <_countries>Trinidad and Tobago <_title>Tunisian Dinar <_names>ar:TND <_countries>Tunisia <_title>Turkmenistan Manat <_names>ar:TMT <_countries>Turkmenistan <_title>Ugandan Shilling <_names>ar:UGX <_countries>Uganda <_title>Ukrainian Hryvnia <_names>ar:UAH,au:₴ <_countries>Ukraine <_title>United Arab Emirates Dirham <_names>ar:AED <_countries>United Arab Emirates <_title>Uruguayan Peso <_names>ar:UYU <_countries>Uruguay <_title>Uzbekistan SoÊ»m <_names>ar:UZS <_countries>Uzbekistan <_title>Vanuatu Vatu <_names>ar:VUV <_countries>Vanuatu <_title>Venezuelan Bolívar <_names>ar:VEF <_countries>Venezuela <_title>Vietnamese Dồng <_names>ar:VND,au:₫ <_countries>Vietnam <_title>Yemeni Rial <_names>ar:YER <_countries>Yemen <_title>Zambian Kwacha (obsolete) <_names>ar:ZMK <_title>Euro Cent <_names>r:eurocent,p:eurocents EUR 1/100 1 <_title>Cent (USD) <_names>au:¢,r:cent,p:cents USD 1/100 1 true <_title>Belgian Franc (obsolete) <_names>ar:BEF EUR 1/40.3399 1 true <_title>Greek Drachma (obsolete) <_names>ar:GRD,au:₯ EUR 1/340.750 1 true <_title>French Franc (obsolete) <_names>ar:FRF,au:₣ EUR 1/6.55957 1 true <_title>Italian Lira (obsolete) <_names>ar:ITL EUR 1/1936.27 1 true <_title>Dutch Guilder (obsolete) <_names>ar:NLG EUR 1/2.20371 1 true <_title>Portuguese Escudo (obsolete) <_names>ar:PTE EUR 1/200.482 1 true <_title>Deutsche Mark (obsolete) <_names>ar:DEM EUR 1/1.95583 1 true <_title>Spanish Peseta (obsolete) <_names>ar:ESP,au:₧ EUR 1/166.386 1 true <_title>Irish Pound (obsolete) <_names>ar:IEP EUR 1/0.787564 1 true <_title>Luxembourg Franc (obsolete) <_names>ar:LUF EUR 1/40.3399 1 true <_title>Austrian Schilling (obsolete) <_names>ar:ATS EUR 1/13.7603 1 true <_title>Finnish Markka (obsolete) <_names>ar:FIM EUR 1/5.94573 1 true <_title>Slovenian Tolar (obsolete) <_names>ar:SIT EUR 1/239.640 1 true <_title>Cypriot Pound (obsolete) <_names>ar:CYP EUR 1/0.585274 1 true <_title>Estonian Kroon (obsolete) <_names>ar:EEK EUR 1/15.6466 1 true <_title>Slovak Koruna (obsolete) <_names>ar:SKK EUR 1/30.1260 1 true <_title>Maltese Lira (obsolete) <_names>ar:MTL EUR 1/0.429300 1 true <_title>Latvian Lats (obsolete) <_names>ar:LVL EUR 1/0.702800 1 true <_title>Lithuanian Litas (obsolete) <_names>ar:LTL EUR 1/3.45280 1 true <_title>Belarusian Ruble <_names>ar:BYN <_countries>Belarus BYR 10000 1 true <_title>Zambian Kwacha <_names>ar:ZMW <_countries>Zambia ZMK 1000 1 true <_title>Mauritanian Ouguiya <_names>ar:MRU <_countries>Mauritania MRO 10 1 libqalculate-2.8.2/data/variables.xml0000644000175000017500000010565713374225247014540 00000000000000 Small Numbers Kleine getallen SmÃ¥ tal å°æ•°å­— Per Mille Per mille Promille åƒåˆ†ä¹‹ä¸€ r:permille,au:‰ pourmille,au:‰ promille,au:‰ Per Myriad Per myriad Permyriad 万分之一 r:permyriad,au:‱ Percent Procent Procent ç™¾åˆ†ä½æ•° a:%,r:percent a:%,pourcent a:%,r:procent Large Numbers Grands Nombres Grote getallen Stora tal 大数 Googolplex Googolplex r:googolplex 10^(10^100) Googol Googol 大数 r:googol 10^100 Centillion Quinquagintiljard 百万的一百次方 -r:centillion quinquagintiljard 1E303 Vigintillion Deciljard Deciljard -r:vigintillion deciljard deciljard,p:deciljarder 1E63 Novemdecillion deciljoen Deciljon -r:novemdecillion deciljoen deciljon,p:deciljoner 1E60 Octodecillion Noniljard Noniljard -r:octodecillion noniljard noniljard,p:noniljarder 1E57 Septendecillion Noniljoen Noniljon -r:septendecillion noniljoen noniljon,p:noniljoner 1E54 Sexdecillion Octiljard Oktiljard -r:sexdecillion octiljard oktiljard,p:oktiljarder 1E51 Quindecillion Octiljoen Oktiljon -r:quindecillion octiljoen oktiljon,p:oktiljoner 1E48 Quattuordecillion Septiljard Septiljard -r:quattuordecillion septiljard septiljard,p:septiljarder 1E45 Tredecillion Septiljoen Septiljon -r:tredecillion septiljoen septiljon,p:septiljoner 1E42 Duodecillion Sextiljard Sextiljard -r:duodecillion sextiljard sextiljard,p:sextiljarder 1E39 Undecillion Sextiljoen Sextiljon -r:undecillion sextiljoen sextiljon,p:sextiljoner 1E36 Decillion Quintiljard Kvintiljard -r:decillion quintiljard kvintiljard,p:kvintiljarder 1E33 Nonillion Quintiljoen Kvintiljon -r:nonillion quintiljoen kvintiljon,p:kvintiljoner 1E30 Octillion Quadriljard Kvadriljard -r:octillion quadriljard kvadriljard,p:kvadriljarder 1E27 Septillion Quadriljoen Kvadriljon -r:septillion quadriljoen kvadriljon,p:kvadriljoner 1E24 Sextillion Triljard Triljard -r:sextillion triljard triljard,p:triljarder 1E21 Quintillion Triljoen Triljon -r:quintillion triljoen triljon,p:triljoner 1E18 Quadrillion Biljard Biljard -r:quadrillion biljard biljard,p:biljarder 1E15 Trillion Biljoen Biljon å…† -r:trillion biljoen biljon,p:biljoner 1E12 Billion Milliard Miljard Miljard å亿 -r:billion miljard miljard,p:miljarder 1E9 Million Million Miljoen Miljon 百万 -r:million miljoen miljon,p:miljoner 1E6 Thousand Duizend Tusen åƒ -r:thousand duizend tusen 1E3 Hundred Honderd Hundra 百 -r:hundred honderd hundra 1E2 Physical Constants Constantes Physiques Natuurkundige constanten Fysikaliska konstanter 物ç†å¸¸æ•° Universal Constants Constantes Universelles Universele constanten Universala konstanter 普适常数 Speed of Light in Vacuum Vitesse de la Lumière dans le Vide Lichtsnelheid in vacuüm Ljusets hastighet i vakuum 真空中光速 ar:c,speed_of_light a:c,vitesse_de_la_lumière a:c,licht_snelheid a:c,ljusets_hastighet 299792458 Planck Time Temps de Planck Plancktijd Planck-tid 普朗克时间 r:planck_time,ais:t_P planck_tijd,ais:t_P 5.39116E-44 Planck Temperature Température de Planck Plancktemperatuur Planck-temperatur 普朗克温度 r:planck_temperature,ais:T_P température_de_planck,ais:T_P planck_temperatuur,ais:T_P 1.416808E32 Planck Mass Masse de Planck Planckmassa Planck-massa æ™®æœ—å…‹è´¨é‡ r:planck_mass,ais:m_P masse_de_planck,ais:m_P planck_massa,ais:m_P 2.176470E-5 Planck Length Longueur de Planck Plancklengte Planck-längd 普朗克长度 r:planck_length,ais:l_P longueur_de_planck,ais:l_P planck_lengte,ais:l_P 1.616229E-35 Planck Constant Constantes de Planck Planck constante Plancks konstant 普朗克常数 r:planck,au:ℎ 6.626070040E-34 Planck Constant over 2 pi Constante de Planck sur 2 pi Planck constante gedeeld door 2 pi Plancks konstant över 2 pi 普朗克常数æ¯2π r:planck2pi,au:ℏ planck/(2*pi) Newtonian Constant of Gravitation Constante de la Gravitation de Newton Newtons zwaartekrachtconstante Newtonska gravitationskonstanten 牛顿引力常数 r:newtonian_constant,a:G constante_de_newton,a:G newton_constante,a:G 6.67408E-11 Electric Constant (Permittivity of Free Space) Constante Électrique (Permittivité du Vide) Elektrische constante (permittiviteit vrije ruimte) Elektriska konstanten 介电常数(自由空间介电常数) r:electric_constant,asu:ε_0,vacuum_permittivity,aos:epsilon_0 1/(4E-7*pi*299792458^2) Magnetic Constant (Permeability of Free Space) Constante Magnétique (Perméabilité du Vide) Magnetische constante (permeabiliteit vrije ruimte) Magnetiska konstanten ç£å¸¸æ•°(自由空间ç£å¯¼çŽ‡ï¼‰ r:magnetic_constant,asu:μ_0,vacuum_permeability,aos:mu_0 4E-7*pi Characteristic Impedance of Vacuum Karakteristieke impedantie vacuüm Karaktäristisk impedans för vakuum 真空特性阻抗 r:characteristic_impedance,ais:Z_0 impédance_caractéristique,ais:Z_0 karakteristieke_impedantie,ais:Z_0 4E-7*pi*299792458 Electromagnetic Constants Constantes Électromagnétiques Elektromagnetische constanten Elektromagnetiska konstanter 电ç£å¸¸æ•° Bohr Magneton Bohrs magneton 玻尔ç£å­ r:bohr_magneton,asu:μ_B,aos:mu_B 927.4009994E-26 Conductance Quantum Geleidingsvermogen kwantum Konduktanskvantum é‡å­ç”µå¯¼ r:conductance_quantum,ais:G_0 geleidings_kwantum,ais:G_0 7.7480917310E-5 Elementary Charge Charge Élémentaire Elementaire lading Elementarladdning åŸºæœ¬ç”µè· r:elementary_charge,ais:e_charge charge_élémentaire,ais:e_charge elementaire_lading,ais:e_lading 1.6021766208E-19 Josephson Constant Josephson constante Josephsons konstant 约瑟夫森常数 r:josephson,ais:K_J 483597.8525E9 Magnetic Flux Quantum Magnetische flux kwantum Magnetflödeskonstanten ç£é€šé‡é‡å­ r:magnetic_flux_quantum,asu:Φ_0,aos:phi_0 2.067833831E-15 Nuclear Magneton Nucleaire magneton Kärnmagneton æ ¸ç£å­ r:nuclear_magneton,asu:μ_N,aos:mu_N 5.050783699E-27 von Klitzing Constant Constante de von Klitzing von Klitzing constante von Klitzing-konstanten 冯·克里é’常数 r:klitzing,ais:R_K 25812.8074555 Atomic and Nuclear Constants Constantes Atomiques et Nucléaires Atomaire- en nucleaire constanten Atomära och nukleära konstanter 原å­ä¸Žæ ¸ç‰©ç†å¸¸æ•° Alpha Particle Mass Massa alfadeeltje Alfapartikelmassa αç²’å­è´¨é‡ r:alpha_particle_mass,aisu:m_α masse_de_particule_alpha,aisu:m_α alfa_deeltje_massa,aisu:m_α 6.644657230E-24 Bohr Radius Rayon de Bohr Bohr-straal Bohr-radie 玻尔åŠå¾„ r:bohr_radius,ais:a_0 0.52917721067E-10 Classical Electron Radius Klassieke straal elektron Klassisk elektron-radie ç»å…¸ç”µå­åŠå¾„ r:classical_electron_radius,ais:r_e klassieke_electron_radius,ais:r_e 2.8179403227E-15 Compton Wavelength Compton golflengte Compton-vÃ¥glängd 康普顿波长 r:compton_wavelength,asu:λ_C,aos:lambda_C 2.4263102367E-12 Electron Mass Masse de l'Électron Elektronmassa Elektronmassa 电å­è´¨é‡ r:electron_mass,ais:m_e masse_de_l'électron,ais:m_e elektron_massa,ais:m_e 9.10938356E-28 Helion Mass Helionmassa Helion-massa Helionè´¨é‡ r:helion_mass,ais:m_h helion_massa,ais:m_h 5.006412700E-24 Neutron Mass Masse du Neutron Neutronmassa Neutronmassa 中å­è´¨é‡ r:neutron_mass,ais:m_n masse_du_neutron,ais:m_n neutron_massa,ais:m_n 1.674927471E-24 Proton Mass Masse du Proton Protonmassa Protonmassa è´¨å­è´¨é‡ r:proton_mass,ais:m_p masse_du_proton,ais:m_p proton_massa,ais:m_p 1.672621898E-24 Rydberg Constant Rydberg constante Rydbergs konstant 里德伯常数 r:rydberg,aisu:R_∞ 10973731.568508 Tau Mass Tau massa Tau-massa γè´¨é‡ r:tau_mass,aisu:m_τ tau_massa,aisu:m_τ 3.16747E-24 Physico-Chemical Constants Constantes Physico-Chimiques Fysisch-chemische constanten Fysikalisk-kemiska konstanter 物ç†åŒ–学常数 Atomic Mass Constant Constante de Masse Atomique Atomaire massaconstante Atommassenhet 原å­è´¨é‡å¸¸æ•° r:atomic_mass,ais:m_u masse_atomique,ais:m_u atoommassa,ais:m_u atommassa,ais:m_u 1.660539040E-24 Avogadro Constant Constante d'Avogadro Avogadro's constante Avogadros konstant 阿佛加德罗常数 r:avogadro,ais:N_A 6.022140857E23 Boltzmann Constant Constante de Boltzmann Constante van Boltzmann Boltzmanns konstant 玻耳兹曼常数 r:boltzmann,ais:k_B 1.38064852E-23 Faraday Constant Constante de Faraday Faraday constante Faradays konstant 法拉第常数 r:faraday 96485.33289 First Radiation Constant Eerste stralingsconstante Första strÃ¥lningskonstanten 第一è¾å°„常数 r:first_radiation,ais:c_1 eerste_straling,ais:c_1 3.741771790E-16 Ideal Gas Constant Constante des Gaz Parfaits Ideale gasconstante Gaskonstant ç†æƒ³æ°”体常数 r:ideal_gas ideale_gas 8.3144598 Second Radiation Constant Tweede stralingsconstante Andra strÃ¥lningskonstanten 第二è¾å°„常数 r:second_radiation,ais:c_2 tweede_straling,aisc_2 1.43877736E-2 Basic Constants Constantes Basiques Basisconstanten Grundläggande konstanter 基本常数 Golden Ratio Le Nombre d'Or Gulden snede Golden ratio 黄金比例 r:golden,au:φ gouden,φ (1+sqrt(5))/2 Omega Constant Omega constante Omegakonstanten Ω常数 r:omega lambertw(1) Pythagoras' Constant (sqrt 2) Constante de Pythagore (sqrt 2) Pythagoras constante (sqrt 2) Pythagoras konstant (sqrt 2) 毕达哥拉斯常数(æ ¹å·2) r:pythagoras pythagore sqrt(2) Apery's Constant Apery's constante Aperys konstant Apery常数 r:apery zeta(3) Base of Natural Logarithms (e) La Base des Logarithmes Naturels (e) Grondtal natuurlijke logaritmen (e) Basen för naturliga logaritmer (e) 自然对数的底e r:e Archimedes' Constant (pi) Archimede's constante (pi) Archimedes konstant (pi) 圆周率(π) au:π,r:pi Euler's Constant Constante d'Euler Euler's constante Eulers konstant 欧拉常数 au:γ,r:euler Catalan's Constant Catalan's constante Catalans konstant Catalan常数 r:catalan Special Numbers Bijzondere getallen Speciella nummer 特殊数字 Imaginary i (sqrt -1) Nombre Imaginaire i (tel que i^2 = -1) Imaginaire i (sqrt -1) Imaginärt i (sqrt -1) 虚数i(sqrt -1) r:i . Positive Infinity Infini Positif Positief oneindig Positiv oändlighet 正无穷 a:∞,r:plus_infinity,r:infinity a:∞,oändlighet Negative Infinity Infini Négatif Negatief oneindig Negativ oändlighet è´Ÿæ— ç©· r:minus_infinity infini_négatif min_oneindig minus_oändlighet Undefined Indéfini Ongedefinieerd Odefinierad 未定义的 r:undefined indéfini ongedefinieerd odefinierad true Precision Precision r:precision False Faux Onwaar Falskt å‡ r:false,r:no faux,non onwaar,nee falskt,nej 0 True Vrai Waar Sant 真 r:true,r:yes vrai,oui waar,ja sant,ja 1 Unknowns Inconnues Onbekenden Okända 未知数 r:x r:y r:z n (integer) n (heltal) r:n Date & Time Date & Heure Datum & Tijd Datum & Tid 日期与时间 Today Idag r:today idag Tomorrow Imorgon r:tomorrow imorgon Yesterday IgÃ¥r r:yesterday igÃ¥r Now (date and time) Nu (datum och tid) r:now libqalculate-2.8.2/data/prefixes.xml0000644000175000017500000000636413374225247014410 00000000000000 yocto y -24 zepto z -21 atto a -18 femto f -15 pico p -12 nano n -9 micro u µ -6 milli m -3 centi c -2 deci d -1 deka da 1 hecto h 2 kilo k 3 mega M 6 giga G 9 tera T 12 peta P 15 exa E 18 zetta Z 21 yotta Y 24 kibi Ki 10 mebi Mi 20 gibi Gi 30 tebi Ti 40 pebi Pi 50 exbi Ei 60 libqalculate-2.8.2/data/currencies.xml0000644000175000017500000011270013374225247014715 00000000000000 Currency Monnaie Valuta Valuta è´§å¸ European Euros Euros européens Europese euro Euro 欧元 ar:EUR,au:€,euro,p:euros a:EUR,au:€,euro ar:EUR,au:€,欧元 Andorra, Austria, Belgium, Cyprus, Estonia, Finland, France, Germany, Greece, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, Portugal, San Marino, Slovakia, Slovenia, Spain, Vatican City U.S. Dollars Dollar US U.S. dollar Amerikanska dollar 美元 a:$,ar:USD,dollar,p:dollars a:$,a:USD,dollar a:$,ar:USD,美元 United States, East Timor, Ecuador, El Salvador, Micronesia, Marshall Islands, Palau, Zimbabwe Japanese Yen Yen japonais Japanse yen Japanska yen 日元 ar:JPY,au:¥,yen ar:JPY,au:¥,日元 Japan Danish Kroner Couronne danoise Deense kroon Danska kronor 丹麦Kroner ar:DKK Denmark British Pounds Livre sterling Britse Pond Brittiska pund 英镑 ar:GBP,au:£ ar:GBP,au:£ United Kingdom Thai Baht Baht thailandais Thailandse bat Thailändska baht 泰国Bat ar:THB Thailand Swedish Krona Couronne suédoise Zweedse kroon Svenska kronor 瑞典克郎 ar:SEK a:kr,a:SEK,krona,p:kronor Sweden Swiss Francs Franc suisse Zwitserse franc Schweizerfranc 瑞士法郎 ar:CHF Switzerland Norwegian Kroner Couronne norvégienne Noorse kroon Norska kronor 挪å¨Kroner ar:NOK Norway Bulgarian Lev Lev bulgare Bulgaarse Lev Bulgariska lev ä¿åŠ åˆ©äºšåˆ—å¼— lev,ar:BGN Bulgaria Russian Ruble Rouble russe Russische roebel Ryska rubel ä¿„ç½—æ–¯å¢å¸ƒ ar:RUB,au:₽,ruble ar:RUB,au:₽,rouble a:RUB,au:₽,roebel a:RUB,au:₽,rubel ar:RUB,au:₽,å¢å¸ƒ Russia Philippine Peso Peso philippin Filippijnse peso Filippinska peso ar:PHP,au:₱ Philippines Malaysian Ringgit Ringgit malaisien Maleisische ringgit Malaysiska ringgit 马æ¥è¥¿äºšæž—å‰ç‰¹ ar:MYR Malaysia Croatian Kuna Kuna croate Kroatische kuna Kroatiska kuna 克罗地亚 ar:HRK Croatia Yuan Renminbi (PR China) Yuan renminbi (rep. pop. de Chine) 人民å¸å…ƒ ar:CNY China Indonesian Rupiah Rouple indonésienne Indonesische roepiah Indonesiska rupiah å°å°¼å¢æ¯” ar:IDR,rupiah a:IDR Indonesia Czech Koruna Koruna tchèque Tsjechische kroon Tjeckiska koruna æ·å…‹å…‹æœ— ar:CZK,au-c:Kč Czech Republic Hungarian Forint Florin hongrois Hongaarse forint Ungerska forint åŒˆç‰™åˆ©ç¦æž— forint,ar:HUF florint hongrois,ar:HUF Hungary Polish Zloty Zloty polonais Poolse zloty Polska zloty 波兰兹罗æ ar:PLN,au:zł,zloty Poland Romanian Leu Rumänska leu ar:RON Romania Turkish New Lira Nouvelle livre turque Nieuwe Turkse lire Turkiska nya lira 土耳其新里拉 ar:TRY,au:₺ Turkey Australian Dollars Dollar australien Australische dollar Australiensiska dollar 澳大利亚元 ar:AUD Australia Canadian Dollars Dollar canadien Canadese dollar Kanadensiska dollar 加拿大元 ar:CAD Canada Hong Kong Dollars Dollar de Hong Kong Hongkong dollar Hong Kong dollar æ¸¯å¸ ar:HKD New Zealand Dollars Dollars néo-zélandais Nieuwzeelandse dollar Nya Zeeländska dollar 新西兰元 ar:NZD New Zealand Singapore Dollars Dollar de Singapour Singapore dollar Singaporedollar 新加å¡å…ƒ ar:SGD Singapore South Korean Won Won sud corréenne Zuid-Koreaanse won Sydkoreanska won 韩元 ar:KRW,au:₩,won South Korea South African Rand Rand sudafricaine Zuid-Afrikaanse rand Sydafrikanska rand å—éžå…°ç‰¹ ar:ZAR South Africa Indian Rupee Indiska rupier ar:INR,au:₹,rupee a:INR,au:₹,rupie,p:rupier India Israeli New Sheqel Israeliska Sheqels ar:ILS,au:₪,sheqel a:ILS,au:₪,sheqel Israel Mexican Peso Mexikanska pesos ar:MXN Mexico Brazilian Real Brasilianska real ar:BRL Brazil Icelandic Krónur Isländska kronor ar:ISK Iceland Bitcoins ar:BTC,au:₿,a:XBT,bitcoin,p:bitcoins Kenya Shilling ar:KES Kenya Afghan Afghani ar:AFN,aiu:؋ Afghanistan Albanian Lek ar:ALL Albania Algerian Dinar ar:DZD Algeria Angolan Kwanza ar:AOA Angola Eastern Caribbean Dollar ar:XCD Antigua and Barbuda, Dominica, Grenada, Montserrat, Saint Kitts and Nevis, Saint Lucia, Saint Vincent and the Grenadines, Anguilla Argentine Peso ar:ARS Argentina Armenian Dram ar:AMD,au:֏ Armenia Aruban Florin ar:AWG Aruba Netherlands Antillean Guilder ar:ANG Curaçao, Sint Maarten Azerbaijani Manat ar:AZN,au:₼ Azerbaijan Bahamian Dollar ar:BSD Bahamas Bahraini Dinar ar:BHD Bahrain Bangladeshi Taka ar:BDT,au:৳ Bangladesh Barbadian Dollar ar:BBD Barbados Belarusian Ruble p. (obsolete) ar:BYR Belize Dollar ar:BZD Belize West African CFA Franc ar:XOF,a:CFA Benin, Burkina Faso, Guinea-Bissau, Ivory Coast, Mali, Niger, Senegal, Togo Bermudian Dollar ar:BMD Bermuda Bolivian Boliviano Bs ar:BOB Bolivia Bosnia and Herzegovina Convertible Mark ar:BAM Bosnia and Herzegovina Botswana Pula ar:BWP Botswana Brunei Dollar ar:BND Brunei Burundian Franc ar:BIF Burundi Cambodian Riel ar:KHR,aiu:៛ Cambodia Central African CFA Franc ar:XAF,a:FCFA Cameroon, Central African Republic, Chad, Republic of the Congo, Equatorial Guinea, Gabon Cape Verdean Escudo ar:CVE Cape Verde Cayman Islands Dollar ar:KYD Cayman Islands Chilean Peso ar:CLP Chile Colombian Peso ar:COP Colombia Comorian Franc ar:KMF Comoros Democratic Republic of the Congo (Congolese Franc) ar:CDF Democratic Republic of the Congo Costa Rican colón ar:CRC Costa Rica Cuban Peso ar:CUP Cuba Djiboutian Franc ar:DJF Djibouti Dominican Peso ar:DOP Dominican Republic Egyptian Pound ar:EGP Egypt El Salvadoran Colon (obsolete) ar:SVC Eritrean Nafka ar:ERN Eritrea Ethiopian Birr ar:ETB Ethiopia Falkland Islands Pound ar:FKP Falkland Islands Fijian Dollar ar:FJD Fiji CFP franc ar:XPF French Polynesia, New Caledonia, Wallis and Futuna Gambian Dalasi ar:GMD Gambia Georgian Lari ar:GEL,au:₾ Georgia Ghanaian Cedi ar:GHS,au:₵ Ghana Gibraltar Pound ar:GIP Gibraltar Guatemalan Quetzal ar:GTQ Guatemala Guernsey Pound ar:GGP Guernsey Guinean Franc ar:GNF Guinea Guyanese Dollar ar:GYD Guyana Haitian Gourde ar:HTG Haiti Honduran Lempira ar:HNL Honduras Iranian Rial ar:IRR,aiu:﷼ Iran Iraqi Dinar ar:IQD Iraq Jamaican Dollar ar:JMD Jamaica Jordanian Dinar ar:JOD Jordan Kazakhstani Tenge ar:KZT,au:₸ Kazakhstan North Korean Won ar:KPW North Korea Kuwaiti Dinar ar:KWD Kuwait Kyrgyzstani Som ar:KGS,au:с Kyrgyzstan Lao Kip ar:LAK,au:₭ Laos Lebanese Pound ar:LBP Lebanon Lesotho Loti ar:LSL Lesotho Liberian Dollar ar:LRD Liberia Libyan Dinar ar:LYD Libya Macanese Pataca ar:MOP Macedonian Denar ar:MKD Macedonia Malagasy Ariary ar:MGA Madagascar Malawian Kwacha ar:MWK Malawi Maldivian Rufiyaa ar:MVR Maldives Mauritanian Ouguiya (obsolete) ar:MRO Mauritian Rupee ar:MUR Mauritius Moldovan Leu ar:MDL Moldova Mongolian Tögrög ar:MNT,au:₮ Mongolia Moroccan Dirham ar:MAD Morocco Mozambican Metical ar:MZN Mozambique Myanmar (Burmese Kyat) ar:MMK Myanmar Namibian Dollar ar:NAD Namibia Nepalese Rupee ar:NPR Nepal Nicaraguan Córdoba ar:NIO Nicaragua Nigerian Naira ar:NGN,au:₦ Nigeria Omani Rial ar:OMR Oman Pakistani Rupee ar:PKR Pakistan Panamaian Balboa ar:PAB Panama Papua New Guinean Kina ar:PGK Papua New Guinea Paraguayan Guaraní ar:PYG,au:₲ Paraguay Peruvian Sol ar:PEN Peru Qatari Riyal ar:QAR Qatar Rwandan Franc ar:RWF Rwanda São Tomé and Príncipe Dobra ar:STD Sao Tome and Principe Saudi Riyal ar:SAR Saudi Arabia Serbian Dinar ar:RSD Serbia Seychellois Rupee ar:SCR Seychelles Sierra Leonean Leone ar:SLL Sierra Leone Solomon Islands Dollar ar:SBD Solomon Islands Somali Shilling ar:SOS Somalia Sri Lankan Rupee; ar:LKR,au:௹ Sri Lanka Sudanese Pound ar:SDG Sudan Surinamese Dollar ar:SRD Suriname Swazi Lilangeni ar:SZL Swaziland Syrian Pound ar:SYP Syria New Taiwan Dollar ar:TWD Taiwan Tajikistani Somoni ar:TJS Tajikistan Tanzanian Shilling ar:TZS Tanzania Tongan PaÊ»anga ar:TOP Tonga Trinidad and Tobago dollar ar:TTD Trinidad and Tobago Tunisian Dinar ar:TND Tunisia Turkmenistan Manat ar:TMT Turkmenistan Ugandan Shilling ar:UGX Uganda Ukrainian Hryvnia ar:UAH,au:₴ Ukraine United Arab Emirates Dirham ar:AED United Arab Emirates Uruguayan Peso ar:UYU Uruguay Uzbekistan SoÊ»m ar:UZS Uzbekistan Vanuatu Vatu ar:VUV Vanuatu Venezuelan Bolívar ar:VEF Venezuela Vietnamese Dồng ar:VND,au:₫ Vietnam Yemeni Rial ar:YER Yemen Zambian Kwacha (obsolete) ar:ZMK Euro Cent centime d'Euro Eurocent Eurocent 欧元分 r:eurocent,p:eurocents eurocent,p:eurocenten eurocent r:欧元分 EUR 1/100 1 Cent (USD) Cent (USD) Cent (USD) 美分 au:¢,r:cent,p:cents au:¢,cent,p:centen au:¢,cent au:¢,r:美分 USD 1/100 1 true Belgian Franc (obsolete) ar:BEF EUR 1/40.3399 1 true Greek Drachma (obsolete) ar:GRD,au:₯ EUR 1/340.750 1 true French Franc (obsolete) ar:FRF,au:₣ EUR 1/6.55957 1 true Italian Lira (obsolete) ar:ITL EUR 1/1936.27 1 true Dutch Guilder (obsolete) ar:NLG EUR 1/2.20371 1 true Portuguese Escudo (obsolete) ar:PTE EUR 1/200.482 1 true Deutsche Mark (obsolete) ar:DEM EUR 1/1.95583 1 true Spanish Peseta (obsolete) ar:ESP,au:₧ EUR 1/166.386 1 true Irish Pound (obsolete) ar:IEP EUR 1/0.787564 1 true Luxembourg Franc (obsolete) ar:LUF EUR 1/40.3399 1 true Austrian Schilling (obsolete) ar:ATS EUR 1/13.7603 1 true Finnish Markka (obsolete) ar:FIM EUR 1/5.94573 1 true Slovenian Tolar (obsolete) ar:SIT EUR 1/239.640 1 true Cypriot Pound (obsolete) ar:CYP EUR 1/0.585274 1 true Estonian Kroon (obsolete) ar:EEK ar:EEK EUR 1/15.6466 1 true Slovak Koruna (obsolete) ar:SKK EUR 1/30.1260 1 true Maltese Lira (obsolete) ar:MTL EUR 1/0.429300 1 true Latvian Lats (obsolete) ar:LVL EUR 1/0.702800 1 true Lithuanian Litas (obsolete) ar:LTL EUR 1/3.45280 1 true Belarusian Ruble ar:BYN Belarus BYR 10000 1 true Zambian Kwacha ar:ZMW Zambia ZMK 1000 1 true Mauritanian Ouguiya ar:MRU Mauritania MRO 10 1 libqalculate-2.8.2/data/variables.xml.in0000644000175000017500000003535013363356477015145 00000000000000 <_title>Small Numbers <_title>Per Mille <_names>r:permille,au:‰ <_title>Per Myriad <_names>r:permyriad,au:‱ <_title>Percent <_names>a:%,r:percent <_title>Large Numbers <_title>Googolplex <_names>r:googolplex 10^(10^100) <_title>Googol <_names>r:googol 10^100 <_title>Centillion <_names>-r:centillion 1E303 <_title>Vigintillion <_names>-r:vigintillion 1E63 <_title>Novemdecillion <_names>-r:novemdecillion 1E60 <_title>Octodecillion <_names>-r:octodecillion 1E57 <_title>Septendecillion <_names>-r:septendecillion 1E54 <_title>Sexdecillion <_names>-r:sexdecillion 1E51 <_title>Quindecillion <_names>-r:quindecillion 1E48 <_title>Quattuordecillion <_names>-r:quattuordecillion 1E45 <_title>Tredecillion <_names>-r:tredecillion 1E42 <_title>Duodecillion <_names>-r:duodecillion 1E39 <_title>Undecillion <_names>-r:undecillion 1E36 <_title>Decillion <_names>-r:decillion 1E33 <_title>Nonillion <_names>-r:nonillion 1E30 <_title>Octillion <_names>-r:octillion 1E27 <_title>Septillion <_names>-r:septillion 1E24 <_title>Sextillion <_names>-r:sextillion 1E21 <_title>Quintillion <_names>-r:quintillion 1E18 <_title>Quadrillion <_names>-r:quadrillion 1E15 <_title>Trillion <_names>-r:trillion 1E12 <_title>Billion <_names>-r:billion 1E9 <_title>Million <_names>-r:million 1E6 <_title>Thousand <_names>-r:thousand 1E3 <_title>Hundred <_names>-r:hundred 1E2 <_title>Physical Constants <_title>Universal Constants <_title>Speed of Light in Vacuum <_names>ar:c,speed_of_light 299792458 <_title>Planck Time <_names>r:planck_time,ais:t_P 5.39116E-44 <_title>Planck Temperature <_names>r:planck_temperature,ais:T_P 1.416808E32 <_title>Planck Mass <_names>r:planck_mass,ais:m_P 2.176470E-5 <_title>Planck Length <_names>r:planck_length,ais:l_P 1.616229E-35 <_title>Planck Constant <_names>r:planck,au:ℎ 6.626070040E-34 <_title>Planck Constant over 2 pi <_names>r:planck2pi,au:ℏ planck/(2*pi) <_title>Newtonian Constant of Gravitation <_names>r:newtonian_constant,a:G 6.67408E-11 <_title>Electric Constant (Permittivity of Free Space) <_names>r:electric_constant,asu:ε_0,vacuum_permittivity,aos:epsilon_0 1/(4E-7*pi*299792458^2) <_title>Magnetic Constant (Permeability of Free Space) <_names>r:magnetic_constant,asu:μ_0,vacuum_permeability,aos:mu_0 4E-7*pi <_title>Characteristic Impedance of Vacuum <_names>r:characteristic_impedance,ais:Z_0 4E-7*pi*299792458 <_title>Electromagnetic Constants <_title>Bohr Magneton <_names>r:bohr_magneton,asu:μ_B,aos:mu_B 927.4009994E-26 <_title>Conductance Quantum <_names>r:conductance_quantum,ais:G_0 7.7480917310E-5 <_title>Elementary Charge <_names>r:elementary_charge,ais:e_charge 1.6021766208E-19 <_title>Josephson Constant <_names>r:josephson,ais:K_J 483597.8525E9 <_title>Magnetic Flux Quantum <_names>r:magnetic_flux_quantum,asu:Φ_0,aos:phi_0 2.067833831E-15 <_title>Nuclear Magneton <_names>r:nuclear_magneton,asu:μ_N,aos:mu_N 5.050783699E-27 <_title>von Klitzing Constant <_names>r:klitzing,ais:R_K 25812.8074555 <_title>Atomic and Nuclear Constants <_title>Alpha Particle Mass <_names>r:alpha_particle_mass,aisu:m_α 6.644657230E-24 <_title>Bohr Radius <_names>r:bohr_radius,ais:a_0 0.52917721067E-10 <_title>Classical Electron Radius <_names>r:classical_electron_radius,ais:r_e 2.8179403227E-15 <_title>Compton Wavelength <_names>r:compton_wavelength,asu:λ_C,aos:lambda_C 2.4263102367E-12 <_title>Electron Mass <_names>r:electron_mass,ais:m_e 9.10938356E-28 <_title>Helion Mass <_names>r:helion_mass,ais:m_h 5.006412700E-24 <_title>Neutron Mass <_names>r:neutron_mass,ais:m_n 1.674927471E-24 <_title>Proton Mass <_names>r:proton_mass,ais:m_p 1.672621898E-24 <_title>Rydberg Constant <_names>r:rydberg,aisu:R_∞ 10973731.568508 <_title>Tau Mass <_names>r:tau_mass,aisu:m_τ 3.16747E-24 <_title>Physico-Chemical Constants <_title>Atomic Mass Constant <_names>r:atomic_mass,ais:m_u 1.660539040E-24 <_title>Avogadro Constant <_names>r:avogadro,ais:N_A 6.022140857E23 <_title>Boltzmann Constant <_names>r:boltzmann,ais:k_B 1.38064852E-23 <_title>Faraday Constant <_names>r:faraday 96485.33289 <_title>First Radiation Constant <_names>r:first_radiation,ais:c_1 3.741771790E-16 <_title>Ideal Gas Constant <_names>r:ideal_gas 8.3144598 <_title>Second Radiation Constant <_names>r:second_radiation,ais:c_2 1.43877736E-2 <_title>Basic Constants <_title>Golden Ratio <_names>r:golden,au:φ (1+sqrt(5))/2 <_title>Omega Constant <_names>r:omega lambertw(1) <_title>Pythagoras' Constant (sqrt 2) <_names>r:pythagoras sqrt(2) <_title>Apery's Constant <_names>r:apery zeta(3) <_title>Base of Natural Logarithms (e) <_names>r:e <_title>Archimedes' Constant (pi) <_names>au:π,r:pi <_title>Euler's Constant <_names>au:γ,r:euler <_title>Catalan's Constant <_names>r:catalan <_title>Special Numbers <_title>Imaginary i (sqrt -1) <_names>r:i <_title>Positive Infinity <_names>a:∞,r:plus_infinity,r:infinity <_title>Negative Infinity <_names>r:minus_infinity <_title>Undefined <_names>r:undefined true <_title>Precision <_names>r:precision <_title>False <_names>r:false,r:no 0 <_title>True <_names>r:true,r:yes 1 <_title>Unknowns <_names>r:x <_names>r:y <_names>r:z <_title>n (integer) <_names>r:n <_title>Date & Time <_title>Today <_names>r:today <_title>Tomorrow <_names>r:tomorrow <_title>Yesterday <_names>r:yesterday <_title>Now (date and time) <_names>r:now libqalculate-2.8.2/data/units.xml.in0000644000175000017500000025040313370501651014315 00000000000000 <_title>!units!Length SI <_title>Meter <_names>ar:m,meter,p:meters,metre,p:metres <_title>Kilometer r:km_c m 3 1 <_title>Decimeter r:dm_c m -1 1 <_title>Centimeter r:cm_c m -2 1 <_title>Millimeter r:mm_c m -3 1 <_title>Nautical Mile <_names>r:nautical_mile,p:nautical_miles m 1852 1 <_title>Ångström <_names>aru:Å,u:ångström,angstrom true m 1E-10 1 <_title>U.S. Survey Inch US Survey <_names>ar:US_in,US_inch,p:US_inches m 100/3937 1 <_title>Inch Imperial/US <_names>ar:in,inch,p:inches m 0.0254 1 <_title>Hand Imperial/US <_names>r:hand,p:hands in 4 1 2 <_title>Foot Imperial/US <_names>ar:ft,foot,p:feet hand 3 1 1 <_title>U.S. Survey Foot US Survey <_names>ar:US_ft,US_foot,p:US_feet US_in 12 1 1 <_title>Link Imperial/US <_names>ar:li,link,p:links in 7.92 1 3 <_title>Yard Imperial/US <_names>ar:yd,yard,p:yards ft 3 1 1 <_title>Rod (pole/perch) US Survey <_names>ar:rd,rod,p:rods US_ft 16.5 1 2 <_title>Fathom Imperial/US <_names>r:fathom,p:fathoms yd 2 1 2 <_title>Chain Imperial/US <_names>ar:ch,chain,p:chains li 100 1 2 <_title>Furlong Imperial/US <_names>ar:fur,furlong,p:furlongs ch 10 1 2 <_title>Mile Imperial/US <_names>ar:mi,mile,p:miles yd 1760 1 1 <_title>U.S. Survey Mile US Survey <_names>ar:US_mi,US_mile,p:US_miles US_ft 5280 1 1 <_title>Mil (1/1000 in) Imperial/US <_names>r:mil,p:mils in 0.001 1 <_title>Astronomical Unit <_names>ar:AU,astronomical_unit,p:astronomical_units m 149578706600 1 <_title>Light Year <_names>ar:ly,lightyear,p:lightyears m 9460730472580800 1 <_title>Parsec <_names>ar:pc,parsec,p:parsecs true AU 648000/pi 1 <_title>Pied du roi (French Royal Foot) <_names>r:pied_du_roi m 9000/27706 1 <_title>Pouce (French Royal Inch) <_names>r:pouce pied_du_roi 1/12 1 <_title>Ligne <_names>r:ligne pouce 1/12 1 <_title>Toise <_names>r:toise pied_du_roi 6 1 <_title>!units!Angle <_title>Plane Angle true <_title>Meter per Meter r:m_p_m m 0 1 m 0 -1 SI <_title>Radian <_names>ar:rad,radian,p:radians false m_p_m 1 1 <_title>Degree <_names>ar:deg,au:°,degree,p:degrees false rad pi/180 1 <_title>Gradian (Gon) <_names>ar:gra,gradian,p:gradians,gon,p:gons false rad pi/200 1 <_title>Arcminute <_names>ar:arcmin,arcminute,p:arcminutes deg 1/60 1 <_title>Arcsecond <_names>ar:arcsec,arcsecond,p:arcseconds arcmin 1/60 1 <_title>Turn <_names>r:turn,p:turns deg 360 1 <_title>Solid Angle true <_title>Square Meter per Square Meter r:sqm_p_sqm m 0 2 m 0 -2 SI <_title>Steradian <_names>ar:sr,steradian,p:steradians m_p_m 1 1 <_title>Angular Acceleration SI <_title>Radians per Second Squared r:rad_p_sqs rad 0 1 s 0 -2 <_title>Angular Velocity SI <_title>Radians per Second r:rad_p_s rad 0 1 s 0 -1 <_title>!units!Mass SI <_title>Gram <_names>ar:g,gram,p:grams <_title>Kilogram r:kg_c g 3 1 <_title>Hectogram r:hg_c g 2 1 <_title>Metric Ton (Tonne) <_names>ar:t,tonne,p:tonnes,ton,p:tons true g 1000000 1 <_title>Grain Troy <_names>ar:gr,grain,p:grains g 0.06479891 1 <_title>Pennyweight Troy <_names>ar:pwt,pennyweight,p:pennyweights gr 24 1 1 <_title>Ounce (troy) Troy <_names>ar:oz_t,troy_ounce,p:troy_ounces pwt 20 1 1 <_title>Pound (troy) Troy <_names>ar:lb_t,troy_pound,p:troy_pounds oz_t 12 1 1 <_title>Dram Imperial/US <_names>ar:dr,dram,p:drams g 1.7718451953125 1 <_title>Ounce Imperial/US <_names>ar:oz,ounce,p:ounces dr 16 1 <_title>Pound Imperial/US <_names>ar:lb,pound,p:pounds oz 16 1 1 <_title>Short Hundredweight (Cental) US <_names>ar:cwt,hundredweight,cental,p:hundredweights,centals lb 100 1 <_title>Long Hundredweight Imperial <_names>ar:l_cwt,long_hundredweight,p:long_hundredweights lb 112 1 <_title>Short Ton US <_names>ar:s_ton,short_ton,p:short_tons lb 2000 1 <_title>Long Ton Imperial <_names>ar:l_ton,long_ton,p:long_tons lb 2240 1 <_title>Stone Imperial <_names>r:stone,p:stones lb 14 1 2 <_title>Carat <_names>r:carat,p:carats g 0.2 1 <_title>Pfund <_names>r:pfund g 500 1 <_title>Zentner <_names>r:zentner pfund 100 1 <_title>Density SI <_title>Kilogram per Cubic Meter r:kg_p_cum g 3 1 m 0 -3 <_title>Gram per Cubic Decimeter r:g_p_cudm g 0 1 m -1 -3 <_title>Gram per Cubic Centimeter r:g_p_cucm g 0 1 m -2 -3 <_title>Atomic Mass <_title>Gram per Mole r:g_p_mol g 0 1 mol 0 -1 <_title>Atomic Mass Unit <_names>ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units g_p_mol 1 1 <_title>Dalton <_names>ar:Da,dalton,p:daltons true g_p_mol 1 1 <_title>Kilodalton r:kDa_c Da 3 1 <_title>Mass Fraction SI <_title>Kilogram per Kilogram r:kg_p_kg g 3 1 g 3 -1 <_title>Time SI <_title>Second <_names>ar:s,second,p:seconds <_title>Minute <_names>ar:min,minute,p:minutes s 60 1 1 <_title>Hour <_names>ar:h,hour,p:hours min 60 1 1 <_title>Day <_names>ar:d,day,p:days h 24 1 1 <_title>Week <_names>r:week,p:weeks day 7 1 2 <_title>Fortnight <_names>r:fortnight,p:fortnights week 2 1 <_title>Julian Year <_names>r:year,p:years d 365.25 1 2 <_title>Month <_names>r:month,p:months d 30.4375 1 <_title>!units!Frequency SI <_title>Hertz <_names>ar:Hz,hertz s 1 -1 <_title>Electricity <_title>Electric Current SI <_title>Ampere <_names>ar:A,ampere,p:amperes CGS <_title>Abampere <_names>r:abampere,a:abA,a:aA,p:abamperes A 10 1 <_title>Current Density SI <_title>Ampere per Meter Squared r:A_p_sqm A 0 1 m 0 -2 <_title>Electric Charge <_title>Second Ampere r:s_A s 0 1 A 0 1 SI <_title>Coulomb <_names>ar:C,coulomb,p:coulombs s_A 1 1 CGS <_title>Abcoulomb <_names>r:abcoulomb,p:abcoulombs,a:abC,a:aC C 10 1 CGS <_title>Statcoloumb (Franklin) <_names>r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins C 1/2997924580 1 <_title>Electric Charge Density SI <_title>Coulomb per Cubic Meter r:C_p_cum C 0 1 m 0 -3 <_title>Electric Flux Density SI <_title>Coulomb per Meter Squared r:C_p_sqm C 0 1 m 0 -2 <_title>Electric Potential <_title>Watt per Ampere r:W_p_A W 0 1 A 0 -1 SI <_title>Volt <_names>ar:V,volt,p:volts W_p_A 1 1 CGS <_title>Statvolt <_names>r:statvolt,p:statvolts,a:statV V 299.792458 1 CGS <_title>Abvolt <_names>r:abvolt,p:abvolts,a:abV V 1E-8 1 <_title>Capacitance <_title>Coulomb per Volt r:C_p_V C 0 1 V 0 -1 SI <_title>Farad <_names>ar:F,farad,p:farads C_p_V 1 1 <_title>Electric Resistance SI <_title>Volt per Ampere r:V_p_A V 0 1 A 0 -1 SI <_title>Ohm <_names>au:Ω,r:ohm,p:ohms V_p_A 1 1 CGS <_title>Abohm <_names>r:abohm,p:abohms,au:abΩ ohm 1E-9 1 CGS <_title>Statohm <_names>r:statohm,p:statohms,au:statΩ ohm 8.9875517873681764E11 1 <_title>Electric Conductance <_title>Ampere per Volt r:A_p_V A 0 1 V 0 -1 SI <_title>Siemens <_names>ar:S,siemens A_p_V 1 1 <_title>Electric Field Strength SI <_title>Volt per Meter r:V_p_m V 0 1 m 0 -1 <_title>Permittivity SI <_title>Farad per Meter r:F_p_m F 0 1 m 0 -1 <_title>Inductance <_title>Weber per Ampere r:Wb_p_A Wb 0 1 A 0 -1 SI <_title>Henry <_names>ar:H,henry,p:henrys Wb_p_A 1 1 <_title>Permeability SI <_title>Henry per Meter r:H_p_m H 0 1 m 0 -1 <_title>Temperature SI <_title>Kelvin <_names>ar:K,kelvin,p:kelvins SI <_title>Degree Celsius <_names>ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades false K \x + 273.15 \x - 273.15 1 <_title>Degree Rankine Imperial/US <_names>ar:oR,au:°R,r:rankine K 5/9 1 <_title>Degree Fahrenheit Imperial/US <_names>ar:oF,au:°F,au:℉,r:fahrenheit K (\x+459.67)*5/9 (\x*9/5)-459.67 1 <_title>Substance SI <_title>Mole <_names>ar:mol,mole,p:moles <_title>Einstein <_names>r:einstein,p:einsteins <_title>Substance Concentration SI <_title>Mole per Cubic Meter r:mol_p_cum mol 0 1 m 0 -3 <_title>Catalytic Activity <_title>Reciprocal Seconds Mole r:recs_mol mol 0 1 s 0 -1 SI <_title>Katal <_names>ar:kat,katal,p:katals recs_mol 1 1 <_title>Catalytic Concentration SI <_title>Katal per Cubic Meter r:kat_p_cum kat 0 1 m 0 -3 <_title>Light <_title>Luminous Intensity SI <_title>Candela <_names>ar:cd,candela,p:candelas <_title>Luminance SI <_title>Candela per Meter Squared r:cd_p_sqm cd 0 1 m 0 -2 CGS <_title>Stilb <_names>ar:sb,stilb,p:stilbs cd_p_sqm 10000 1 <_title>Luminous Flux <_title>Candela Steradian r:cd_sr cd 0 1 sr 0 1 SI <_title>Lumen <_names>ar:lm,lumen,p:lumens cd_sr 1 1 <_title>Illuminance <_title>Lumen per Meter Squared r:lm_p_sqm lm 0 1 m 0 -2 true <_title>Lumen per Foot Squared r:lm_p_sqft lm 0 1 ft 0 -2 SI <_title>Lux <_names>ar:lx,lux lm_p_sqm 1 1 <_title>Foot-Candle Imperial/US <_names>ar:fc,footcandle,p:footcandles lm_p_sqft 1 1 CGS <_title>Phot <_names>ar:ph,phot,p:phots lx 10000 1 <_title>Radiant Intensity <_title>Watt per Steradian r:W_p_sr W 0 1 sr 0 -1 <_title>Irradiance SI <_title>Watt per Meter Squared r:W_p_sqm W 0 1 m 0 -2 <_title>Einstein per Meter Squared per Second r:einstein_p_sqm_p_s einstein 0 1 m 0 -2 s 0 -1 <_title>Microeinstein per Meter Squared per Second r:microeinstein_p_sqm_p_s einstein -6 1 m 0 -2 s 0 -1 <_title>Radiance SI <_title>Watt per Square Meter Steradian r:W_p_sqm_sr W 0 1 sr 0 -1 m 0 -2 <_title>Area SI <_title>Square Meter r:sqm m 0 2 <_title>Square Kilometer r:sqkm m 3 2 <_title>Are <_names>ar:a,are,p:ares m 100 2 true <_title>Hectare <_names>ar:ha,hectare,p:hectares a 100 1 <_title>Decare <_names>a:da,r:decare,p:decares a 10 1 <_title>Barn <_names>ar:b,barn,p:barns m 1E-28 2 <_title>Rood Imperial <_names>r:rood,p:roods yd 1210 2 <_title>Acre Imperial <_names>r:acre,p:acres ch 10 2 <_title>Section US Survey <_names>r:section,p:sections US_mi 1 2 <_title>Township US Survey <_names>r:township,p:townships section 36 1 1 <_title>Square Foot Imperial/US r:sqft ft 0 2 <_title>Square Inch Imperial/US r:sqin in 0 2 <_title>Square Mile Imperial/US r:sqmi mi 0 2 <_title>Volume SI <_title>Cubic Meter r:cum m 0 3 <_title>Liter <_names>ar:L,a:l,liter,p:liters,litre,p:litres m 0.001 3 <_title>Milliliter r:ml_c l -3 1 <_title>Centiliter r:cl_c l -2 1 <_title>Deciliter r:dl_c l -1 1 <_title>Cubic Inch Imperial/US r:cuin in 0 3 <_title>Fuel Economy <_title>Liter per Kilometer r:l_p_km l 0 1 m 3 -1 <_title>Kilometer per Liter r:km_p_l m 3 1 l 0 -1 true <_title>Miles per Gallon US r:mile_p_gal mi 0 1 gal 0 -1 <_title>Miles per Gallon US <_names>a-cr:mpg mile_p_gal 1 1 <_title>Cooking <_title>Teaspoon <_names>r:teaspoon,p:teaspoons L 0.005 1 1 <_title>Dessertspoon <_names>r:dessertspoon,p:dessertspoons teaspoon 2 1 2 <_title>Tablespoon <_names>r:tablespoon,p:tablespoons teaspoon 3 1 1 <_title>Cup (U.S.) US <_names>r:cup,p:cups L 0.2365882365 1 <_title>Imperial Capacity <_title>Imperial Fluid Ounce Imperial <_names>ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces L 0.0284130625 1 <_title>Imperial Gill Imperial <_names>ar:UK_gi,imperial_gill,p:imperial_gills UK_fl_oz 5 1 2 <_title>Imperial Pint Imperial <_names>ar:UK_pt,imperial_pint,p:imperial_pints UK_gi 4 1 1 <_title>Imperial Quart Imperial <_names>ar:UK_qt,imperial_quart,p:imperial_quarts UK_pt 2 1 2 <_title>Imperial Gallon Imperial <_names>ar:UK_gal,imperial_gallon,p:imperial_gallons UK_qt 4 1 1 <_title>Imperial Minim Imperial <_names>r:imperial_minim,p:imperial_minims UK_fl_oz 1/480 1 <_title>Imperial Fluid Scuple Imperial <_names>r:imperial_fluid_scuple,p:imperial_fluid_scuples imperial_minim 20 1 <_title>Imperial Fluid Drachm Imperial <_names>ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms imperial_fluid_scuple 3 1 <_title>Imperial Bushel Imperial <_names>ar:UK_bu,imperial_bushel,p:imperial_bushels UK_gal 8 1 1 <_title>U.S. Capacity <_title>U.S. Fluid Ounce US <_names>ar:fl_oz,fluid_ounce,p:fluid_ounces in 231/128 3 <_title>U.S. Gill US <_names>ar:gi,gill,p:gills fl_oz 4 1 <_title>U.S. Liquid Pints US <_names>ar:liq_pt,liquid_pint,p:liquid_pints gi 4 1 <_title>U.S. Liquid Quarts US <_names>ar:liq_qt,liquid_quart,p:liquid_quarts liq_pt 2 1 <_title>U.S. Minim US <_names>r:minim,p:minims fl_oz 1/480 1 <_title>U.S. Fluid Drachm US <_names>ar:fl_dr,fluid_drachm,p:fluid_drachms minim 60 1 <_title>U.S. Dry Pint US <_names>ar:dry_pt,dry_pint,p:dry_pints in 33.6003125 3 <_title>U.S. Dry Quart US <_names>ar:dry_qt,dry_quart,p:dry_quarts dry_pt 2 1 <_title>U.S. Peck US <_names>ar:pk,peck,p:pecks dry_qt 8 1 <_title>U.S. Bushel US <_names>ar:bu,bushel,p:bushels pk 4 1 <_title>U.S. Gallon US <_names>ar:gal,gallon,p:gallons liq_qt 4 1 <_title>U.S. Barrel (oil) US <_names>ar:bbl,barrel,p:barrels gal 42 1 <_title>Specific Volume SI <_title>Cubic Meter per Kilogram r:cum_p_kg m 0 3 g 3 -1 <_title>Speed SI <_title>Meter per Second r:m_p_s m 0 1 s 0 -1 <_title>Kilometer per Hour r:km_p_h m 3 1 h 0 -1 <_title>Nautical Mile per Hour r:nautical_mile_p_h nautical_mile 0 1 h 0 -1 <_title>Knot <_names>r:knot,p:knots nautical_mile_p_h 1 1 true <_title>Miles per Hour Imperial/US r:mile_p_h mi 0 1 h 0 -1 <_title>Miles per Hour Imperial/US <_names>a-cr:mph mile_p_h 1 1 <_title>Acceleration SI <_title>Meter per Second Squared r:m_p_sqs m 0 1 s 0 -2 <_title>Galileo <_names>ar:Gal,galileo,p:galileos m_p_sqs 1/100 1 <_title>Gee <_names>r:gee,p:gees m_p_sqs 9.80665 1 <_title>Magnetism <_title>Wave Number SI <_title>Reciprocal Meter r:recm m 0 -1 <_title>Magnetic Field Strength SI <_title>Ampere per Meter r:A_p_m A 0 1 m 0 -1 CGS <_title>Oersted <_names>ar:Oe,oersted,p:oersteds A_p_m 1000/(4*pi) 1 <_title>Magnetic Flux <_title>Volt Seconds r:V_s V 0 1 s 0 1 SI <_title>Weber <_names>ar:Wb,weber,p:webers V_s 1 1 CGS <_title>Maxwell <_names>ar:Mx,maxwell,p:maxwells Wb 1E-8 1 <_title>Magnetic Flux Density <_title>Weber per Meter Squared r:Wb_p_sqm Wb 0 1 m 0 -2 SI <_title>Tesla <_names>ar:T,tesla,p:teslas Wb_p_sqm 1 1 CGS <_title>Gauss <_names>r:gauss T 0.0001 1 <_title>Force <_title>Meter Kilogram per Second Squared r:m_kg_p_sqs m 0 1 g 3 1 s 0 -2 SI <_title>Newton <_names>ar:N,newton,p:newtons m_kg_p_sqs 1 1 CGS <_title>Dyne <_names>ar:dyn,dyne,p:dynes N 1E-5 1 Imperial <_title>Pound-force <_names>ar:lbf,pound_force N 4.4482216152605 1 true <_title>Pound Foot per Second Squared r:lb_ft_p_sqs lb 0 1 ft 0 1 s 0 -2 Imperial <_title>Poundal <_names>r:poundal,p:poundals,a:pdl lb_ft_p_sqs 1 1 <_title>Pond (Gram-Force) <_names>r:pond,p:ponds,a:gf true N 0.00980665 1 <_title>Kilopond (Kilogram-Force) r:kpond_c pond 3 1 <_title>Moment of Force SI <_title>Newton Meter r:N_m N 0 1 m 0 1 <_title>Pressure <_title>Newton per Meter Squared r:N_p_sqm N 0 1 m 0 -2 <_title>Pound-force per Square Inch Imperial/US true r:lbf_p_sqin lbf 0 1 in 0 -2 SI <_title>Pascal <_names>ar:Pa,pascal,p:pascals N_p_sqm 1 1 <_title>Pound-force per Square Inch (psi) Imperial/US <_names>a-cr:psi lbf_p_sqin 1 1 <_title>Bar <_names>r:bar,p:bars true Pa 100000 1 <_title>Atmosphere <_names>ar:atm,atmosphere,p:atmospheres Pa 101325 1 <_title>Torr <_names>r:torr,p:torrs atm 1/760 1 <_title>Millimeter of Mercury <_names>ar:mmHg atm 1/760 1 <_title>Inch of Mercury <_names>ar:inHg mmHg 25.4 1 <_title>Dynamic Viscosity SI <_title>Pascal Second r:Pa_s Pa 0 1 s 0 1 CGS <_title>Poise <_names>ar:P,poise,p:poises Pa_s 0.1 1 <_title>Kinematic Viscosity <_title>Square Meter per Second r:sqm_p_s m 0 2 s 0 -1 CGS <_title>Stokes <_names>ar:St,stokes sqm_p_s 0.0001 1 <_title>Surface Tension SI <_title>Newton per Meter r:N_p_m N 0 1 m 0 -1 <_title>Energy SI <_title>Joule <_names>ar:J,joule,p:joules N_m 1 1 <_title>Watt Hour r:W_h W 0 1 h 0 1 <_title>Kilowatt Hour r:W_h W 3 1 h 0 1 <_title>Calorie (international table) <_names>ais:cal_IT,ar:cal,c:calorie,cp:calories J 4.1868 1 <_title>Calorie (capital C) <_names>cr:Calorie,cp:Calories cal 1000 1 <_title>Calorie (thermochemical) <_names>ars:cal_th J 4.184 1 <_title>Gram of TNT <_names>a-cr:gTNT,gramTNT cal_th 1000 1 <_title>Ton of TNT <_names>a-cr:tTNT,tonTNT gTNT 1000000 1 <_title>Calorie (15 degrees Celsius) <_names>ars:cal_fifteen J 4.185880 1 <_title>Calorie (mean) <_names>ars:cal_mean J 4.19002 1 <_title>British Thermal Unit (IT) <_names>ar:Btu J 1055.056 1 <_title>Electron Volt <_names>ar:eV,electron_volt,p:electron_volts J 1.6021766208E-19 1 CGS <_title>Erg <_names>r:erg,p:ergs J 1E-7 1 <_title>Foe <_names>r:foe,p:foes erg 1E51 1 Imperial <_title>Foot-Pound Force r:ft_lbf ft 0 1 lbf 0 1 <_title>Hartree <_names>ar:Ha,as:E_h,hartree J 4.359744650E-18 1 <_title>Rydberg <_names>ar:Ry,s:rydberg_unit Ha 0.5 1 <_title>Specific Energy SI <_title>Joule per Kilogram r:J_p_kg J 0 1 g 3 -1 <_title>Power <_title>Joule per Second r:J_p_s J 0 1 s 0 -1 SI <_title>Watt <_names>ar:W,watt,p:watts J_p_s 1 1 <_title>Horse Power <_names>ar:hp,horsepower,p:horsepowers W 745.699987158227022 1 <_title>Pferdestärke <_names>ar:PS,u:pferdestärke W 735.49875 1 <_title>Entropy SI <_title>Joule per Kelvin r:J_p_K J 0 1 K 0 -1 <_title>Specific Entropy SI <_title>Joule per Kilogram Kelvin r:J_p_kg_K J 0 1 g 3 -1 K 0 -1 <_title>Thermal Conductivity SI <_title>Watt per Meter Kelvin r:W_p_m_K W 0 1 m 0 -1 K 0 -1 <_title>Energy Density SI <_title>Joule per Cubic Meter r:J_p_cum J 0 1 m 0 -3 <_title>Molar Energy SI <_title>Joule per Mole r:J_p_mol J 0 1 mol 0 -1 <_title>Molar Entropy SI <_title>Joule per Mole Kelvin r:J_p_mol_K J 0 1 mol 0 -1 K 0 -1 <_title>Radioactivity SI <_title>Becquerel <_names>ar:Bq,becquerel,p:becquerels s 1 -1 <_title>Curie <_names>ar:Ci,curie,p:curies Bq 3.7E10 1 <_title>Absorbed Dose SI <_title>Gray <_names>ar:Gy,gray,p:grays J_p_kg 1 1 <_title>Rad <_names>r:rad_radioactivity Gy 1/100 1 <_title>Dose Equivalent SI <_title>Sievert <_names>ar:Sv,sievert,p:sieverts J_p_kg 1 1 <_title>Rem <_names>r:rem_radioactivity Sv 1/100 1 <_title>Exposure SI <_title>Coulomb per Kilogram r:C_p_kg C 0 1 g 3 -1 <_title>Roentgen <_names>ar:R,roentgen,p:roentgens C_p_kg 0.000258 1 <_title>Absorbed Dose Rate SI <_title>Gray per Second r:Gy_p_s Gy 0 1 s 0 -1 <_title>Ratio <_title>Neper <_names>ar:Np,neper,p:nepers <_title>Bel <_names>ar:B,bel,p:bels Np 0.5*ln(10) 1 <_title>Decibel r:dB_c B -1 1 <_title>Information <_title>Bit <_names>r:bit,p:bits true <_title>Byte (8-bit) <_names>r:byte,p:bytes,octet,p:octets true bit 8 1 <_title>Nibble <_names>r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets bit 4 1 <_title>Tribble <_names>r:tribble,p:tribbles nibble 3 1 <_title>Word (16-bit) <_names>r:word,p:words bit 16 1 <_title>Kilobyte r:kbyte_c byte 3 1 <_title>Kibibyte r:Kibyte_c byte 10 1 <_title>Mebibyte r:Mibyte_c byte 20 1 <_title>Gibibyte r:Gibyte_c byte 30 1 <_title>Megabyte r:Mbyte_c byte 6 1 <_title>Gigabyte r:Gbyte_c byte 9 1 <_title>Terabyte r:Tbyte_c byte 12 1 <_title>Kilobit r:kbit_c bit 3 1 <_title>Kibibit r:Kibit_c bit 10 1 <_title>Mebibit r:Mibit_c bit 20 1 <_title>Gibibit r:Gibit_c bit 30 1 <_title>Megabit r:Mbit_c bit 6 1 <_title>Gigabit r:Gbit_c bit 9 1 <_title>Terabit r:Tbit_c bit 12 1 <_title>Typography <_title>PostScript Point <_names>ar:pt,a:pts,point,p:points in 1/72 1 <_title>PostScript Pica <_names>r:pica,p:picas pt 12 1 <_title>ATA Pica <_names>r:ata_pica,p:ata_picas in 0.166 1 <_title>ATA Point <_names>r:ata_point,a:ata_pt,p:ata_points ata_pica 1/12 1 <_title>New Didot Point <_names>r:new_didot m 0.000375 1 <_title>Didot Point <_names>r:didot,a:dd pouce 1/72 1 <_title>Cicero <_names>r:cicero didot 12 1 libqalculate-2.8.2/data/functions.xml0000644000175000017500000132400413374225250014560 00000000000000 Matrices & Vectors Matrices & Vecteurs Matrices & vectoren Matriser & Vektorer 矩阵与å‘é‡ Construct Vector Construire un Vecteur Vector construeren Skapa vektor 构造å‘é‡ r:vector vektor Returns a vector with listed elements. Retourne un vecteur avec les éléments listés. Retourneert een vector met de opgegeven elementen. Returnerar en vektor med listade element. 使用列出的元素生æˆä¸€ä¸ªå‘é‡å¹¶è¿”回。 Elements Éléments Elementen Antal element 多个元素 Generate Vector Générer un vecteur Vector aanmaken Generera vektor 生æˆå‘é‡ r:genvector Returns a vector generated from a function with a variable (default x) running from min to max. The fourth argument is either the requested number of elements if the sixth argument is false (default) or the step between each value of the variable. Retourne un vecteur généré par une fonction à une variable (par défaut : x) parcourant des valeurs entre min et max. Le quatrième argument est soit le nombre d'éléments voulus si le sixième argument est faux (par défaut) ou le pas entre chaque valeur de la variable. Berekent een vector met behulp van een functie waarvan de variabele (standaard x) waarden krijgt tussen min en max. Het vierde argument is of het vereiste aantal elementen indien het zesde argument onwaar is (standaard) of de stapgrootte tussen elke waarde van de variabele. Returnerar en vektor skapad frÃ¥n en funktion med en variabel (förvald: x) som gÃ¥r frÃ¥n min till max. Den fjärde parametern är antingen det efterfrÃ¥gade antalet element, om det sjätte argumentet är falskt (förvalt), eller steget mellan varje värde för variabeln. æ ¹æ®æŒ‡å®šçš„自å˜é‡(缺çœä¸ºx)和数æ®èŒƒå›´ï¼Œç”¨æŒ‡å®šå‡½æ•°çš„值生æˆä¸€ä¸ªå‘é‡å¹¶è¿”å›žã€‚å¦‚æžœç¬¬å…­ä¸ªå‚æ•°æ˜¯å‡(缺çœå€¼)ï¼Œåˆ™ç¬¬å››ä¸ªå‚æ•°è¡¨ç¤ºéœ€è¦çš„元素个数;å¦åˆ™ï¼Œç¬¬å››ä¸ª 傿•°è¡¨ç¤ºå˜é‡æ¯ä¸ªå€¼ä¹‹é—´çš„æ­¥é•¿ã€‚ Function Fonction Functie Funktion 函数 Min Min 最å°å€¼ Max Max 最大值 Dimension / Step size Dimension / Taille du pas Dimensie / stapgrootte Dimension / stegstorlek ç»´æ•°/步长 Variable Variabele Variabel å˜é‡ Use step size Utiliser le pas Stapgrootte gebruiken Använd stegstorlek 使用步长 Sort Trier Sorteren Sortera æŽ’åº r:sort sorteren sortera Returns a sorted vector. Returnerar en sorterad vektor. $name([6, 1, 4]) = [1, 4, 6] Vector Vecteur Vektor å‘é‡ Ascending Ascendant Oplopend Stigande å‡åº Rank Rangorde Rangordna r:rank rangorde rangordna Returns a vector with values of elements replaced with their mutual ranks. Retourne un vecteur dont les valeurs de éléments ont été remplacées par leur rang respectif. Retourneert een vector waarin de elementen zijn vervangen door hun onderlinge rangorde. Returnerar en vektor med elementens värden ersatta av deras inbördes rangordning. $name([6, 1, 4]) = [3, 1, 2] Vector Vecteur Vektor å‘é‡ Ascending Ascendant Oplopend Stigande å‡åº Vector Limits Limites de Vecteur Vectorgrenzen Vektorgränser å‘é‡é™ r:limits limites grenzen gränser Returns a part of a vector between two positions. Retourne une partie de vecteur entre deux positions. Retourneert een deel van een vector tussen twee posities. Returnerar en del av en vektor mellan tvÃ¥ positioner. 返回一个å‘é‡ä¸¤ä¸ªä½ç½®ä¹‹é—´çš„一部分。 Vector Vecteur Vektor å‘é‡ Lower limit Limite inférieure Ondergrens Undre gräns ä¸‹é™ Upper limit Limite Supérieure Bovengrens Övre gräns ä¸Šé™ Dimension Dimensie Dimension ç»´æ•° r:dimension dimensie Returns the number of elements in a vector. Retourne le nombre d'éléments dans un vecteur. Retourneert het aantal elementen in een vector. Returnerar antalet element i en vektor. 返回一个å‘é‡å†…的元素数é‡ã€‚ Vector Vecteur Vektor å‘é‡ Merge Vectors Regrouper les Vecteurs Vectoren samenvoegen SammanslÃ¥ vektorer åˆå¹¶å‘é‡ r:mergevectors regrouper_vecteurs vectorensamenvoegen Returns a vector with the elements from two vectors. Retourne un vecteur avec les éléments de deux vecteurs. Retourneert een vector met de elementen van twee vectoren. Returnerar en vektor med element frÃ¥n tvÃ¥ vektorer. 将两个å‘é‡åˆæˆä¸€ä¸ªå¹¶è¿”回。 Vector 1 Vecteur 1 Vektor 1 å‘é‡1 Vector 2 Vecteur 2 Vektor 2 å‘é‡2 Construct Matrix Construire une Matrice Matrix construeren Skapa matris 构造矩阵 r:matrix matrice matris Returns a matrix with specified dimensions and listed elements. Omitted elements are set to zero. Retourne une matrice avec les dimensions spécifiées et les éléments listés. Les éléments omis sont fixés à zéro. Retourneert een matrix met opgegeven dimensies en gegeven elementen. Weggelaten elementen worden op nul gesteld. Returnerar en matris med specifierat antal rader och kolumner, och angivna element. Utelämnade element sätts till noll. æ ¹æ®æŒ‡å®šçš„维数和列出的元素返回一个矩阵。çœç•¥è¢«è®¾ä¸ºé›¶çš„元素。 Rows Lignes Rijen Rader 行 Columns Colonnes Kolommen Kolumner 列 Elements Éléments Elementen Antal element 多个元素 Convert Matrix to Vector Convertir une matrice en vecteur Matrix naar vector converteren Omvandla matris till vektor 将矩阵转æ¢ä¸ºå‘é‡ r:matrix2vector matrice_vers_vecteur Puts each element of a matrix in vertical order in a vector. Met chaque élément d'une matrice dans un vecteur en la parcourant verticalement. Ieder element van een matrix wordt in verticale volgorde in een vector geplaatst. Placerar varje element i en matris i vertikal ordning i en vektor. 将按照垂直顺åºå°†çŸ©é˜µä¸­çš„æ¯ä¸ªå…ƒç´ æ”¾åˆ°å‘é‡ä¸­ã€‚ Matrix Matrice Matris 矩阵 Matrix Area Matrixbereik Matrisarea å­çŸ©é˜µ r:area oppervlak Returns a part of a matrix. Retourne une partie de matrice. Retourneert een deel van een matrix. Returnerar en del av en matris. 返回矩阵的一部分。 Matrix Matrice Matris 矩阵 Start row Ligne de départ Startrij Startrad 起始行 Start column Colonne de départ Startkolom Startkolumn 起始列 End row Terminer la ligne Einde rij Slutrad 结æŸè¡Œ End column Terminer la colonne Einde kolom Slutkolumn 结æŸåˆ— Rows Lignes Rijen Rader 行 r:rows rijen rader Returns the number of rows in a matrix. Retourne le nombre de lignes d'une matrice. Retourneert het aantal rijen in een matrix. Returnerar antalet rader i en matris. 返回矩阵中的行数。 Matrix Matrice Matris 矩阵 Columns Colonnes Kolommen Kolumner 列 r:columns colonnes kolommen kolumner Returns the number of columns in a matrix. Retourne le nombre de colonnes dans une matrice. Retourneert het aantal kolommen in een matrix. Returner antalet kolumner i en matris. 返回矩阵的列数。 Matrix Matrice Matris 矩阵 Extract row as vector Extraire une ligne comme vecteur Rij als vector uit (matrix) halen Skapa vektor frÃ¥n rad 将行æå–为å‘é‡ r:row rij rad Returns a row in a matrix as a vector. Retourne une ligne dans une matrice sous forme de vecteur. Retourneert een rij in een matrix als een vector. Returnerar en rad i en matris som en vektor. 将矩阵的一行作为å‘é‡è¿”回。 Matrix Matrice Matris 矩阵 Row Ligne Rij Rad 行 Extract Column as Vector Extraire une Colonne comme Vecteur Kolom als vector uit (matrix) halen Extrahera kolumn som vektor 将列æå–为å‘é‡ r:column colonne kolom kolumn Returns a column in a matrix as a vector. Retourne une colonne de matrice comme vecteur. Retourneert een kolom van een matrix als een vector. Returnerar en kolumn i en matris som en vektor. 将矩阵的一列作为å‘é‡è¿”回。 Matrix Matrice Matris 矩阵 Column Colonne Kolom Kolumn 列 Elements Éléments Elementen Antal element 多个元素 r:elements éléments elementen Returns the number of elements in a matrix or vector. Retourne le nombre d'éléments dans une matrice ou un vecteur. Retourneert het aantal elementen in een matrix of vector. Returnerar antalet element i en matris eller vektor. 返回一个矩阵或å‘é‡å†…的元素数目。 Matrix or vector Matrice ou vecteur Matrix of vector Matris eller vektor 矩阵或å‘é‡ Element Élément Element 一个元素 r:element élément Returns the element at specified position in a matrix (row and column) or vector (index). Retourne l'élément de matrice à la position spécifiée (ligne et colonne) ou vecteur (index). Retourneert het element op de opgegeven positie in een matrix (rij en kolom) of vector (index). Returnerar elementet pÃ¥ angiven position i en matris (rad och kolumn) eller en vektor (index). 返回矩阵(行和列)或å‘é‡(下标)指定ä½ç½®ä¸Šçš„元素。 Matrix/vector Matrice/Vecteur Matrix/vector Matris/vektor 矩阵/å‘é‡ Row/index Ligne/indice Rij/Index Rad/index 行/下标 Column Colonne Kolom Kolumn 列 Transpose Transposée Transponeren Transponera 转置 r:transpose transponeren transponera Returns the transpose of a matrix. Retourne la transposée d'une matrice. Retourneert de getransponeerde van een matrix. Returnerar transponeringen av en matris. 返回矩阵的转置。 Matrix Matrice Matris 矩阵 Identity Identité Identiteit Identitetsmatris å•ä½çŸ©é˜µ r:identity identité identiteit identitetsmatris Returns the identity matrix of a matrix or with specified number of rows/columns. Retourne la matrice identité ou une matrice avec le nombre indiqué de lignes/colonnes. Retourneert de eenheidsmatrix bij een matrix of met een opgegeven aantal rijen/kolommen. Returnerar identitetsmatrisen för en matris eller med angivet antal rader/kolumner. 返回指定行/列数或与指定矩阵åŒé˜¶çš„å•ä½çŸ©é˜µã€‚ Matrix or rows/columns Matrice ou lignes/colonnes Matrix of rijen/kolommen Matris eller rader/kolumner 矩阵或行/列 Determinant Déterminant Determinanten è¡Œåˆ—å¼ r:det Calculates the determinant of a matrix. Calcule le déterminant d'une matrice. Berekent de determinant van een matrix. Beräknar determinanten för en matris. 计算矩阵的行列å¼ã€‚ Matrix Matrice Matris 矩阵 Permanent Permanent ç§¯å’Œå¼ r:permanent Calculates the permanent of a matrix. The permanent differs from a determinant in that all signs in the expansion by minors are taken as positive. Calcule le permanent d'une matrice. Le permanent diffère du déterminant dans le fait que tous les signes dans le développement en mineurs sont pris positifs. Berekent de permanent van een matrix. Het verschil met de determinant is dat alle subdeterminanten met +1 worden vermenigvuldigd, en bij de determinant om en om met +1 en met -1. Beräknar permanenten av en matris. Permanenten skiljer sig frÃ¥n en determinant genom att alla tecken i expansionen sätts som positiva. 计算矩阵的积和å¼ã€‚积和å¼ä¸Žè¡Œåˆ—å¼çš„ä¸åŒä¹‹å¤„在于,在展开时,所有展开å¼å‰é¢çš„符å·éƒ½ä¸ºæ­£ã€‚ Matrix Matrice Matris 矩阵 Adjugate (Adjoint) Comatrice Aangrenzend Adjungerad matris (Adjunkt) ä¼´éšçŸ©é˜µ r:adj Calculates the adjugate or adjoint of a matrix. Calcule la comatrice de la matrice Berekent de geadjungeerde matrix. Beräknar den adjungerade matrisen eller adjunkten för en matris. 计算矩阵的伴éšçŸ©é˜µ Matrix Matrice Matris 矩阵 Cofactor Cofacteur Kofaktor ä½™å› å­ r:cofactor cofacteur kofaktor Calculates the cofactor of the element at specified position. Calcule le cofacteur à la position désignée. Berekent de cofactor van het element op de opgegeven positie. Beräknar kofaktorn för elementet pÃ¥ angiven position 计算指定ä½ç½®å…ƒç´ çš„余因å­ã€‚ Matrix Matrice Matris 矩阵 Row Ligne Rij Rad 行 Column Colonne Kolom Kolumn 列 Matrix Inverse Inverse de Matrice Inverse matrix Matrisinvers 求逆矩阵 r:inverse invers Calculates the inverse of a matrix. The inverse is the matrix that multiplied by the original matrix equals the identity matrix (AB = BA = I). Calcule l'inverse d'une matrice. L'inverse est la matrice qui multipliée à la matrice originale est égale à la matrice identité (AB = BA = I). Retourneert de inverse van een matrix. De inverse matrix is de matrix die, vermenigvuldigd met de originele matrix, de eenheidsmatrix geeft (AB = BA = E). Beräknar inversen av en matris. Inversen är den matrix som multiplicerad med den ursprungliga matrisen är lika med identitetsmatrisen (AB = BA = I). 计算矩阵的逆。矩阵的逆是一个与原矩阵相乘等于å•ä½çŸ©é˜µçš„矩阵。(AB = BA = I)。 Matrix Matrice Matris 矩阵 Load CSV File Charger un Fichier CSV Inlezen CSV-bestand Ladda CSV-fil 载入CSV文件 r:load lees ladda Returns a matrix imported from a CSV data file. Retourne une matrice importée d'un fichier de données CSV. Retourneert een matrix, geïmporteerd uit een CSV-gegevensbestand. Returnerar en matris importerad frÃ¥n en CSV-datafil. 返回从CSVæ•°æ®æ–‡ä»¶å¯¼å…¥çš„矩阵 Filename Nom de fichier Bestandsnaam Filnamn 文件å First data row Première ligne de données Eerste gegevensrij Första raden med data ç¬¬ä¸€è¡Œæ•°æ® Separator Séparateur Scheidingsteken Avskiljare 分隔符 Export To CSV File Exporter dans un ficher CSV Exporteren naar CSV-bestand Exportera till CSV-fil 导出到CSV文件 r:export exporteren exportera Exports a matrix to a CSV data file. Exporte une matrice dans un fichier de données CSV. Exporteert een matrix naar een CSV-gegevensbestand. Exporterar en matris till en CSV-datafil 将矩阵导出到CSVæ•°æ®æ–‡ä»¶ Matrix/vector Matrice/Vecteur Matrix/vector Matris/vektor 矩阵/å‘é‡ Filename Nom de fichier Bestandsnaam Filnamn 文件å Separator Séparateur Scheidingsteken Avskiljare 分隔符 Magnitude Magnitud r:magnitude magnutud Calculates the magnitude of a value. This function returns the same value as abs() for all values except vectors. Beräknar magnituden av ett värde. Funktionen returnerar samma värde som abs() för alla värden utom vektorer. Value Valeur Waarde Värde 值 Hadamard Product Hadamardprodukt r:hadamard Mulitplies each separate element in matrix 1 with the corresponding element in matrix 2. Multiplicerar varje separat element i matris 1 med motsvarande element i matrix 2. Matrix 1 Matris 1 Matrix 2 Matris 2 Entrywise Function Komponentvis funktion r:entrywise Calculates a new matrix or vector using each separate element in matrix/vector 1 and the corresponding (in the same row and column) elements in matrix/vector 2. An unlimited number of matrices/vectors can be specified, with each matrix/vector argument followed by the corresponding variable used in the function argument. Beräknar en ny matris eller vektor utifrÃ¥n varje separat element i matris/vektor 1 och motsvarande (i samma rad och kolumnen) element i matris/vektor 2. Ett obegränsat antal matriser/vektorer kan anges, med varje matris-/vektorparameter följd av motsvarande variabel used in the functionsparametern. $name(x / y, [4, 10, 12], x, [2, 2, 4], y) = [2, 5, 3] Function Fonction Functie Funktion 函数 Matrices/vectors and variables Matriser/vektorer och variabler Norm (length) Norme (longueur) Norm (lengte) Normal 范数(长度) r:norm Calculates the norm/length of a vector. Calcule la norme d'un vecteur. Berekent de norm/lengte van een vector. Beräknar normalen för en vektor. 计算å‘é‡çš„范数/长度。 abs((\x*\x)^(1/2)) Vector Vecteur Vektor å‘é‡ false Cross Product Uitproduct Vektoriell produkt å‘é‡ç§¯ r:cross uitproduct vektoriell Calculates the cross product of two 3-dimensional vectors. Berekent het uitproduct van twee 3-dimensionale vectoren. Beräknar den vektoriella produkten för tvÃ¥ 3-dimensionella vektorer. 计算两个三维å‘é‡çš„å‘é‡ç§¯ [(element(\x,2)*element(\y,3))-(element(\x,3)*element(\y,2)),(element(\x,3)*element(\y,1))-(element(\x,1)*element(\y,3)),(element(\x,1)*element(\y,2))-(element(\x,2)*element(\y,1))] Vector 1 Vecteur 1 Vektor 1 å‘é‡1 dimension(\x)==3 Vector 2 Vecteur 2 Vektor 2 å‘é‡2 dimension(\x)==3 Combinatorics Combinatoire Combinatoriek Kombinatorik 组åˆå­¦ Factorial Factorielle Faculteit Fakultet 阶乘 Calculates the factorial of an integer. Multiplies the argument with every lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number followed by one exclamation mark. Calcule la factorielle d'un entier. Multiplie l'argument avec tous les entiers positifs plus petits : n(n-1)(n-2)...2*1. Peut aussi être entré comme un nombre suivi d'un point d'exclamation. Berekent de faculteit van een positief geheel getal n: (n(n-1)(n-2)... *2*1. Kan ook worden ingevoerd als een positief geheel getal, gevolgd door een uitroepteken. Beräknar fakulteten för ett heltal. Multiplicerar parametern med varje mindre positivt heltal (n(n-1)(n-2)...2*1). Kan ocksÃ¥ skrivas som ett nummer följt av ett utropstecken. 计算整数的阶乘,å³n(n-1)(n-2)...2*1。也å¯ä»¥ç”¨æ•´æ•°åŽé¢è·Ÿä¸€ä¸ª"!"æ¥ è¡¨ç¤ºã€‚ $name(5) = 5! = 5 * 4 * 3 * 2 * 1 = 120 r:factorial factorielle faculteit fakultet Value Valeur Waarde Värde 值 Double Factorial Factorielle double Dubbele faculteit Dubbelfakultet åŒé˜¶ä¹˜ r:factorial2 factorielle2 faculteit2 fakultet2 Calculates the double factorial of an integer. Multiplies the argument with every second lesser positive integer (n(n-2)(n-4)...). Can also be entered as a number followed by two exclamation marks. Calcule la double factorielle d'un entier. Multiplie l'argument avec tous les deuxièmes entiers positifs plus petits : n(n-2)(n-4)... Peut aussi être entré comme un nombre suivi de deux points d'exclamation. Berekent de dubbelfaculteit van een positief geheel getal n: (n(n-2)(n-4)... Kan ook worden ingevoerd als een positief geheel getal, gevolgd door twee uitroeptekens. Beräknar dubbelfakulteten för ett heltal. Multiplicerar parametern med varannan mindre positivt heltal (n(n-2)(n-4)...). Kan ocksÃ¥ skrivas som ett nummer följt av tvÃ¥ utropstecken. 计算整数的åŒé˜¶ä¹˜ã€‚å³n(n-2)(n-4)....。也å¯ä»¥ç”¨æ•´æ•°åŽé¢è¿žè¾“两个"!"æ¥ è¡¨ç¤ºã€‚ $name(5) = 5!! = 5 * 3 * 1 = 15 Value Valeur Waarde Värde 值 Multifactorial Multifactorielle Multifaculteit Multifakultet 多阶乘 r:multifactorial multifactorielle multifaculteit multifakultet Calculates the multifactorial of an integer. Multiplies the argument with every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a number followed by three or more exclamation marks. Calcule la multifactorielle d'un entier. Multiplie l'argument avec tous les entiers positifs plus petits placés tous les x (n(n-x)(n-2x)...). Peut aussi être entré comme un nombre suivi de trois points d'exclamation ou plus. Berekent de multifaculteit van een positief geheel getal n: (n(n-x)(n-2x)...). Kan ook worden ingevoerd als een positief geheel getal gevolgd door drie of meer uitroeptekens. Beräknar multifakulteten för ett heltal. Multiplicerar parametern med varje x mindre positivt heltal (n(n-x)(n-2x)...). Kan ocksÃ¥ skrivas som ett nummer följt av tre eller fler utropstecken. 计算整数的多阶乘,å³n(n-x)(n-2x)...。也å¯ä»¥ç”¨åœ¨æ•´æ•°åŽé¢è·Ÿä¸‰ä¸ªæˆ–多个"!"æ¥è¡¨ç¤ºã€‚ $name(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240 Value Valeur Waarde Värde 值 Factorial Factorielle Faculteit Fakultet 阶乘 Binomial Coefficient Coefficient binomial Binomiaalcoëfficiënt Binomial koefficient 二项å¼ç³»æ•° r:binomial binomiaal Exponent Exposant Exponent 指数 Index Index 下标 Hyperfactorial Hyperfactorielle Hyperfaculteit Hyperfakultet hyper阶乘 r:hyperfactorial hyperfactorielle hyperfaculteit hyperfakultet product(x^x,1,\x,x) Calculates the hyperfactorial of an integer. Multiplies the argument raised by itself with every lesser positive integer raised by themselves (1^1 * 2^2 ... n^n). Calcule l'hyperfactorielle d'un entier. Multiplie l'argument élevé à lui-même avec tous les entiers positifs plus petits élevés à eux-mêmes (1^1 * 2^2 ... n^n). Berekent de hyperfaculteit van een positief geheel getal n: (n^n*(n-1)^(n-1)...*2^2*1^1. Beräknar hyperfakulteten för ett heltal. Multiplicerar parametern upphöjt med varje mindre positivt heltal upphöjt dem själva(1^1 * 2^2 ... n^n). 计算整数的hyper阶乘,å³(1^1 * 2^2 ... n^n)。 $name(3) = (3^3) * (2^2) * (1^1) = 108 Value Valeur Waarde Värde 值 1 Superfactorial Superfactorielle Superfaculteit Superfakultet 超级阶乘 r:superfactorial superfaculteit superfakultet product(factorial(x),0,\x,x) Calculates the superfactorial of an integer. Multiplies the factorial of the argument with the factorial of every lesser positive integer (1! * 2! ... n!). Calcule la superfactorielle d'un entier. Multiplie la factorielle de l'argument avec la factorielle de tous les entiers positifs plus petits (1! * 2! ... n!). Berekent de superfaculteit van een positief geheel getal n: (n!*(n-1)!...*2!*1!) Beräknar superfakulteten för ett heltal. Mulitplicerar fakulteten av parametern med fakulteten för varje mindre positivt heltal (1! * 2! ... n!). 计算整数的超级阶乘,å³1! * 2! ... n!。 $name(5) = 5! * 4! * 3! * 2! * 1! = 34 560 Value Valeur Waarde Värde 值 0 Permutations (Variations) Permutaties (Variaties) Permutationer (Variationer) 排列 r:perm,variations perm,variaties variationer \x!/(\x-\y)! Returns the number of possible arrangements of an ordered list with a number of objects to choose from and a list size. If there are three objects (1, 2 and 3) that is put in a list with two positions, the alternatives are [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of permutations is 6. Retourne le nombre d'arrangements possibles d'une liste ordonnée avec un nombre d'objets à choisir et une taille de liste. Si il y a trois objets (1, 2 et 3) qui sont mis dans une liste à deux positions, les alternatives sont [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] et [3, 2], et le nombre de permutations est donc 6. Retourneert op hoeveel manieren een bepaald aantal objecten op een geordende manier kunnen worden gekozen uit een verzameling van (verschillende) objecten. Stel er zijn drie objecten (1, 2, en 3) waarvan er twee moeten worden gekozen in een geordende lijst, dan zijn de mogelijkheden [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] en [3, 2], en is het aantal permutaties dus 6. Returnerar antalet möjliga arrangemang av en ordnad lista med ett antal objekt att välja mellan och en liststorlek. Om det finns tre olika objekt (1, 2 och 3) som sätts i en lista med tvÃ¥ positioner, dÃ¥ är möjliga alternativ [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] och [3, 2], och därmed är antalet permutationer 6. 返回排列数,å³ä»ŽåŒ…嫿Œ‡å®šæ•°é‡å¯¹è±¡çš„集åˆä¸­é€‰æ‹©æŒ‡å®šæ•°é‡ä¸ªå…ƒç´ ç”Ÿæˆæœ‰åºåˆ—è¡¨ï¼Œæ‰€èƒ½ç”Ÿæˆ çš„æ‰€æœ‰ä¸åŒæœ‰åºåˆ—表的个数。例如,如果集åˆä¸­æœ‰ä¸‰ä¸ªå…ƒç´ (1,2å’Œ3),ä»Žä¸­ä»»é€‰ä¸¤ä¸ªå…ƒç´ ç”Ÿæˆ æœ‰åºåˆ—表,å¯èƒ½çš„列表为[1, 2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2],因此排列数为6。 Objects Objets Objecten Objekt 对象个数 true Size Taille Grootte Storlek å¤§å° true Combinations Combinaisons Combinaties Kombinationer ç»„åˆ r:comb kam kombinationer \x!/(\y!*(\x-\y)!) Returns the number of possible arrangements of an unordered list with a number of objects to choose from and a list size. If there are three objects (1, 2 and 3) that is put in a list with place for two, the alternatives are [1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3. Retourne le nombre d'arrangements possibles d'une liste non ordonnée avec un nombre d'objets à choisir et une taille de liste. S'il y a trois objets (1,2 et 3) qui sont mis dans une liste à deux positions, les alternatives sont [1, 2], [1, 3], et [2, 3], et le nombre de combinaisons est donc 3. Retourneert op hoeveel manieren een bepaald aantal objecten op een niet geordende manier kunnen worden gekozen uit een verzameling van (verschillende) objecten. Stel er zijn drie objecten (1, 2, en 3) waarvan er twee moeten worden gekozen in een niet geordende lijst, dan zijn de mogelijkheden [1, 2], [1, 3] en [2, 3], en is het aantal combinaties dus 6. Returnerar antalet möjliga arrangemang av en oordnad lista med ett antal objekt att välja mellan och en liststorlek. Om det finns tre olika objekt (1, 2 och 3) som sätts i en lista med plats för tvÃ¥, dÃ¥ är möjliga alternativ [1, 2], [1, 3], och [2, 3], och därmed är antalet kombinationer 3. è¿”å›žç»„åˆæ•°ï¼Œå³ä»ŽåŒ…嫿Œ‡å®šæ•°é‡å¯¹è±¡çš„集åˆä¸­é€‰æ‹©æŒ‡å®šæ•°é‡ä¸ªå…ƒç´ ç”Ÿæˆæ— åºåˆ—è¡¨ï¼Œæ‰€èƒ½ç”Ÿæˆ çš„æ‰€æœ‰ä¸åŒæ— åºåˆ—表的个数。例如,如果集åˆä¸­æœ‰ä¸‰ä¸ªå…ƒç´ (1,2å’Œ3),ä»Žä¸­ä»»é€‰ä¸¤ä¸ªå…ƒç´ ç”Ÿæˆ æœ‰åºåˆ—表,å¯èƒ½çš„列表为[1, 2], [1, 3], and [2, 3]ï¼Œå› æ­¤ç»„åˆæ•°ä¸º3。 Objects Objets Objecten Objekt 对象个数 true Size Taille Grootte Storlek å¤§å° true Derangements Arrangements Derangementen Derangemang é‡æŽ’æ•° r:derangements derangementen derangemang Returns the number of possible rearrangements of an ordered list, of a certain size, where none of the objects are on their original position. If the original list is [1, 2, 3], the possible derangements are [2, 3, 1] and [3, 1, 2], and thus the number of derangements is 2. Retourne le nombre de réarrangements possibles d'une liste non ordonnée, d'une certaine taille, où aucun des objets n'est à sa position initiale. Si la liste de départ est [1, 2, 3], les réarrangements possibles sont [2, 3, 1] et [3, 1, 2]; le nombre de réarrangements est donc 2. Retourneert op hoeveel manieren een geordende lijst van objecten zo kan worden herschikt dat geen der objecten op zijn oorspronkelijke posite terecht komt. Indien de oorspronkelijke lijst [1, 2, 3] is, zijn de mogelijke herschikkingen [2, 3, 1] en [3, 1, 2], en is het aantal mogelijke herschikkingen dus 2. Returnerar antalet möjliga omarrangemang av en ordnad lista, med en viss storlek, där inget av objekten är pÃ¥ sin ursprungliga position. Om den ursprungliga listan är [1, 2, 3], dÃ¥ är de möjliga omarrangemangen [2, 3, 1] och [3, 1, 2], och därmed returneras 2. è¿”å›žé‡æŽ’æ•°ï¼Œå³å¯¹ç»™å®šåˆ—è¡¨ä¸­çš„å…ƒç´ é‡æ–°æŽ’列,并且é™å®šæ¯ä¸ªå…ƒç´ éƒ½ä¸èƒ½åœ¨åŽŸæ¥çš„ä½ç½® 上,所得的列表数é‡ã€‚例如,如果原始列表为[1,2,3],则å¯èƒ½çš„é‡æŽ’åˆ—è¡¨ä¸º[2, 3, 1]å’Œ[3, 1, 2]ã€‚å› æ­¤é‡æŽ’æ•°ä¸º2。 factorial(\x)*sum(((-1)^"i")/factorial("i"),0,\x,"i") Number of elements Nombre d'éléments Aantal elementen Antal element 元素个数 1 Number Theory Théorie des Nombres Getallentheorie Nummerteori 数论 Absolute Value Valeur absolue Absolute waarde Absolut värde ç»å¯¹å€¼ r:abs Value Valeur Waarde Värde 值 Arithmetic Arithmétique Rekenen Aritmetik 算术 Signum Sigma 符å·å‡½æ•° r:sgn Number Nombre Nummer Nummer æ•°å­— Value for zero Numerator Numérateur Teller Täljare åˆ†å­ r:numerator numérateur noemer täljare Number Nombre Nummer Nummer æ•°å­— Denominator Dénominateur Noemer Nämnare åˆ†æ¯ r:denominator dénominateur noemer nämnare Number Nombre Nummer Nummer æ•°å­— Remainder Reste Rest Rest 余数 r:rem Numerator Numérateur Teller Täljare åˆ†å­ Denominator Dénominateur Noemer Nämnare åˆ†æ¯ Modulus Coefficient Modulus Modulus 模 r:mod . Numerator Numérateur Teller Täljare åˆ†å­ Denominator Dénominateur Noemer Nämnare åˆ†æ¯ Negate Opposé Ander teken Negera éž r:neg anderteken -\x Value Valeur Waarde Värde 值 Reciprocal Réciproque Omgekeerde waarde (x naar 1/x) Reciprok 倒数 r:inv \x^(-1) Value Valeur Waarde Värde 值 true Multiply Multiplier Vermenigvuldigen Multiplicera 乘 r:multiply multiplier vermenigvuldigen multiplicera product(element(\x,"x"),1,dimension(\x),"x") Factors Facteurs Factoren Faktorer å› å­ Add Ajouter Optellen Addera 加 r:add optellen addera total(\x) Terms Termes Termen Termer 项 Subtract Aftrekken Subtrahera å‡ r:subtract aftrekken subtrahera csum(2,-1,element(\x,1),"y"-"x","x","y",\x) Terms Termes Termen Termer 项 Divide Diviser Delen Dela 除 r:divide divise delen dela \x/\y Numerator Numérateur Teller Täljare åˆ†å­ Denominator Dénominateur Noemer Nämnare åˆ†æ¯ Raise Élever Machtverheffen Upphöj 乘方 r:raise machtverheffen upphöj \x^\y Base Grondtal Bas 基/底 true Exponent Exposant Exponent 指数 true Polynomials Polynômes Polynomen (veeltermen) Polynomer å¤šé¡¹å¼ Coefficient Coëfficiënt Koefficient 系数 r:coeff Polynomial Polynôme Polynoom (veelterm) Polynom å¤šé¡¹å¼ Number Nombre Nummer Nummer æ•°å­— Variable Variabele Variabel å˜é‡ Leading Coefficient Coefficient dominant Eerste coëfficiënt Ledande koefficient 首项系数 r:lcoeff Polynomial Polynôme Polynoom (veelterm) Polynom å¤šé¡¹å¼ Variable Variabele Variabel å˜é‡ Trailing Coefficient Laatste coëfficiënt Avslutande koefficient 末项系数 r:tcoeff Polynomial Polynôme Polynoom (veelterm) Polynom å¤šé¡¹å¼ Variable Variabele Variabel å˜é‡ Polynomial Degree Degré du Polynôme Graad van polynoom (veelterm) Polynomgrad å¤šé¡¹å¼æ¬¡æ•° r:degree degré graad grad Polynomial Polynôme Polynoom (veelterm) Polynom å¤šé¡¹å¼ Variable Variabele Variabel å˜é‡ Lowest Degree (Valuation) Plus Petit Degré (Estimation) Laagste graad (waardebepaling) Lägsta grad (valuering) 末项次数(估计) r:ldegree lgraad Polynomial Polynôme Polynoom (veelterm) Polynom å¤šé¡¹å¼ Variable Variabele Variabel å˜é‡ Content Part Part du Montant Inhoudgedeelte InnehÃ¥llsdel å¸¸æ•°å…¬å› å­ r:pcontent pinhoud Polynomial Polynôme Polynoom (veelterm) Polynom å¤šé¡¹å¼ Variable Variabele Variabel å˜é‡ Primitive Part Primitieve deel Primitiv del 原始部分 r:primpart Polynomial Polynôme Polynoom (veelterm) Polynom å¤šé¡¹å¼ Variable Variabele Variabel å˜é‡ Unit Part Eenheidsgedeelte Enhetsdel å•ä½éƒ¨åˆ† r:punit peenheid Polynomial Polynôme Polynoom (veelterm) Polynom å¤šé¡¹å¼ Variable Variabele Variabel å˜é‡ Greatest Common Divisor Plus Grand Diviseur Commun Grootste gemene deler Största gemensamma delare 最大公约数 r:gcd pgcd ggd 1st value 1ère valeur 1e waarde 1:a värdet 值1 2nd value 2e valeur 2de waarde 2:a värdet 值2 Least Common Multiple Plus Petit Facteur Commun Kleinste gemene veelvoud Minsta gemensamma multipel 最å°å…¬å€æ•° r:lcm kgv 1st value 1ère valeur 1e waarde 1:a värdet 值1 2nd value 2e valeur 2de waarde 2:a värdet 值2 Fibonacci Number Fibonaccital r:fibonacci Returns the n-th term of the Fibonacci sequence. Returnerar tal n i Fibonaccis talföljd. (golden^\x−(1−golden)^\x)/sqrt(5) Index (n) Index (n) 0 false Rounding Arrondi Afronding Avrundning å–æ•´ Round Arrondi Afronden Avrunda å–æ•´ r:round afronden avrunda Value Valeur Waarde Värde 值 Round Downwards Arrondi à la Valeur Inférieure Naar beneden afronden Avrunda nerÃ¥t å‘䏋喿•´ r:floor plancher golv Value Valeur Waarde Värde 值 Round Upwards Arrondi à la Valeur Supérieure Naar boven afronden Avrunda uppÃ¥t å‘ä¸Šå–æ•´ r:ceil plafond tak Value Valeur Waarde Värde 值 Round Towards Zero Afronden in de richting van nul Avrunda mot noll å‘é›¶å–æ•´ r:trunc afkap Value Valeur Waarde Värde 值 Extract Integer Part Extraire la Partie Entière Gehele deel uit (getal) halen Extrahera heltal æå–整数部分 r:int Value Valeur Waarde Värde 值 Extract Fractional Part Extraire la Partie Fractionnaire Fractionele deel uit (getal) halen Extrahera brÃ¥kdel æå–分数部分 r:frac Value Valeur Waarde Värde 值 Number Bases Bases Numériques Grondtallen voor talstelsels Talbaser 数字进制 Number Base Base Numérique Grondtal talstelsel Talbas 数字进制 r:base grondtal bas Returns an value from an expression using a specified base between 2 and 36 Returnerar ett värde frÃ¥n ett uttryck med angiven bas mellan 2 och 36. Number Nombre Nummer Nummer æ•°å­— Base Grondtal Bas 基/底 Binary Binaire Binair Binär 二进制 r:bin Returns a value from a binary expression. If two's complement is true, numbers beginning with '1' is interpreted as negative binary numbers using two's complement. Returnerar ett värde frÃ¥n ett binärt uttryck. Om tvÃ¥komplementsform är sant, kommer tal som börjar med '1' att tolkas som negative binära tal som använder tvÃ¥komplementsform. Binary number Nombre binaire Binair getal Binärt nummer 二进制数 Two's complement TvÃ¥komplementsform Octal Octaal Oktal 八进制 r:oct okt Returns a value from an octal expression. Returnerar ett värde frÃ¥n ett oktalt uttryck. Octal number Nombre octal Octaal getal Oktalt nummer 八进制数 Hexadecimal Hexadécimal Hexadecimaal Hexadecimal å六进制 r:hex Returns a value from a hexadecimal expression. Returnerar ett värde frÃ¥n ett hexadecimalt uttryck. Hexadecimal number Nombre hexadécimal Hexadecimaal getal Hexadecimalt nummer å六进制数 Integers Entiers Gehele getallen Heltal æ•´æ•° Even Pair Jämnt å¶ r:even pair jämn Number Nombre Nummer Nummer æ•°å­— Odd Impair Oneven Ojämnt 奇 r:odd impair oneven udda Number Nombre Nummer Nummer æ•°å­— Step Functions Stapfuncties SprÃ¥ngfunktioner 阶梯函数 Heaviside Step Function Heaviside stapfunctie Heavisides stegfunktion Heaviside阶梯函数 r:heaviside,au:θ Discontinuous function also known as "unit step function". Returns 0 if x < 0, 1 if x > 0, and 1/2 if x = 0. Discontinue functie die ook bekend staat als de "eenheids stapfunctie". Retourneert 0 indien x < 0, 1 indien x ;gt; 0, en 1/2 indien x=0. Stegfunktion även kallad "enhetsstegfunktion". Returnerar 0 om x < 0, 1 om x > 0, och 1/2 om x = 0. 间断函数也被称作是" å•ä½é˜¶è·ƒå‡½æ•°"。当 x < 0时值为0, x > 0时值为1, x = 0时则为1/2。 Dirac Delta Function Diracs deltafunktion r:dirac,au:δ Returns 0 if x is non-zero, and infinity if x is zero. Returnerar 0 om x inte är noĺl, och oändlighet om x är noll. Ramp Function Rampfunctie Rampfunktion æ–œå¡å‡½æ•° r:ramp (\x+abs(\x))/2 Value Valeur Waarde Värde 值 false false Rectangular Function Rechthoekige functie Rektangulär funktion 矩阵函数 r:rectangular rechthoekig rektangulär heaviside(\x+(1/2))-heaviside(\x-(1/2)) Value Valeur Waarde Värde 值 false false Sigmoid Function Sigmoïde functie Sigmoidfunktion sigmoid函数 r:sigmoid sigmoïde 1/(1+e^(-\x)) Value Valeur Waarde Värde 值 false Logit Transformation Logit transformatie Logit transformation Logitå˜æ¢ r:logit ln(\x/(1-\x)) Value Valeur Waarde Värde 值 Triangular Function Driehoekige functie Triangulär funktion 三角函数 r:triangular driehoekig triangulär if(abs(\x)<1,1-abs(\x),0) Value Valeur Waarde Värde 值 false false Special Functions Speciella funktioner Gamma Function Fonction Gamma Gamma-functie Gammafunktion γ函数 r:gamma Digamma Function Digammafunktion r:digamma,psi Beta Function Fonction bêta Beta-functie Betafunktion β函数 r:beta Error Function Felfunktion r:erf Complementary Error Function Komplementära felfunktionen r:erfc Polylogarithm Polylogaritm rc:Li,polylog Order Ordre Orde Ordning 次数 Argument Airy Function Airyfunktion r:airy Bessel Function of the First Kind Besselfunktion av det första slaget r:besselj Order Ordre Orde Ordning 次数 Argument Bessel Function of the Second Kind Besselfunktion av det andra slaget r:bessely Order Ordre Orde Ordning 次数 Argument Riemann Zeta Riemann Zeta Riemanns Zeta Riemann Zeta r:zeta Integral point Point intégral Gehele waarde Integralpunkt 积分点 Kronecker Delta Kronecker Delta Kroneckerdelta Kronecker Delta r:kronecker Returns 0 if i != j and 1 if i = j. Retourneert 0 indien i != j en 1 if i = j. Returnerar 0 om i != j och 1 if i = j. 如果iä¸ç­‰äºŽj,返回0;如果i等于j,返回1。 \x=\Y{0} Value 1 (i) Valeur 1 (i) Waarde 1 (i) Värde 1 (i) 值1(i) false false Value 2 (j) Valeur 2 (j) Waarde 2 (j) Värde 2 (j) 值2(i) false false Complex Numbers Komplexa tal Real Part Partie Réelle Reële deel Reell del 实部 r:re Complex number Nombre complexe Complex getal Komplext nummer 夿•° Imaginary Part Partie Imaginaire Imaginaire deel Imaginär del 虚部 r:im Complex number Nombre complexe Complex getal Komplext nummer 夿•° Principal Argument Principialargument r:arg Complex number Nombre complexe Complex getal Komplext nummer 夿•° Complex Conjugate Komplexkonjugat r:conj re(\x)-i*im(\x) Complex number Nombre complexe Complex getal Komplext nummer 夿•° false Exponents & Logarithms Exponentielles et logarithmes Exponenten & Logaritmen Exponenter & Logaritmer 指数与对数 Square Root Racine Carrée Vierkantswortel Kvadratrot 平方根 au:√,r:sqrt Returns the principal square root (for positive values the positive root is returned). Returnerar principalkvadratroten (för positiva värden returneras den positiva roten). Value Valeur Waarde Värde 值 Cube Root Racine Cubique Derdemachtswortel Kubikrot 立方根 au:∛,r:cbrt Returns the third real root. Returnerar den tredje reella roten. Value Valeur Waarde Värde 值 Nth root Racine n-ième N-de wortel N:te roten N次方根 r:root wortel rot Returns the real root. For negative values the degree must be odd. Complex values are not allowed. Returnerar den reella roten. För negativa värden krävs en udda grad. Komplexa värden är inte tillÃ¥tna. Value Valeur Waarde Värde 值 Degree Degré Graad Grad 度 Square Carré Vierkant Kvadrat 正方形 r:sq Value Valeur Waarde Värde 值 Exponential (e^x) Exponentielle (e^x) Exponent (e^x) Exponentialfunktion (e^x) e的乘方 r:exp Exponent Exposant Exponent 指数 Natural Logarithm Logarithme Naturel (népérien) Natuurlijke logaritme Naturlig logaritm 自然对数 r:ln Value Valeur Waarde Värde 值 Base-N Logarithm Logarithme en base N Logaritme met grondtal N Bas-N-logaritm 以n为底的对数 r:log Value Valeur Waarde Värde 值 Base Grondtal Bas 基/底 Lambert W Function (Omega Function, Product Log) Lambert W Functie (Omega Functie, Product Log) Lambers W-funktion (Omegafunktionen) Lambert W函数(ω函数, Product Log) r:lambertw,productlog r:lambertw,productlog Returns the inverse function for mx*e^x as ln() does for e^x. Only the principal branch and real valued results are currently supported. Returnerar den inverterade funktionen för mx*e^x sÃ¥som ln() gör för e^x. Enbart principalgrenen och värden som ger reeala result stöds för närvarande. Value Valeur Waarde Värde 值 Branch Gren Base-2 Logarithm Logarithme en base 2 Logaritme met grondtal 2 Bas-2-logaritm 以2为底的对数 rs:log2 Returns the base n logarithm. Retourne le logarithme en base n. Retourneert de logaritme met grondtal n. Returnerar logaritmen för bas n. 返回以n为底的对数。 log(\x,2) Value Valeur Waarde Värde 值 false 0 Base-10 Logarithm Logarithme en base 10 Logaritme met grondtal 10 Bas-10-logaritm 以10为底的对数 rs:log10 Returns the base n logarithm. Retourne le logarithme en base n. Retourneert de logaritme met grondtal n. Returnerar logaritmen för bas n. 返回以n为底的对数。 log(\x,10) Value Valeur Waarde Värde 值 false 0 Complex Exponential (Cis) Exponentielle Complexe Complex Exponentieel (Cis) Komplex exponentialfunction (Cis) 夿Œ‡æ•°(Cis) r:cis e^(\x*i) Exponent Exposant Exponent 指数 true 2 raised to the power X 2 élevé à la puissance X 2 tot de macht X 2 upphöjt med X 2的乘方 rs:exp2 2^\x Exponent Exposant Exponent 指数 true 10 raised to the power X 10 élevé à la puissance X 10 tot de macht X 10 upphöjt med X 10的乘方 rs:exp10 10^\x Exponent Exposant Exponent 指数 true X raised to the power Y X élevé à la puissance Y X tot de macht Y X upphöjt med Y Xçš„Y次方 r:pow macht upphöj \x^\y Base Grondtal Bas 基/底 true Exponent Exposant Exponent 指数 true Square root (x * pi) Racine carrée (x * pi) Vierkantswortel (x * pi) Kvadratrot (x * pi) 平方根(x*π) r:sqrtpi Returns the non-negative square root of x * pi Retourne la racine carrée de x * pi Retourneert de niet-negatieve vierkantswortel van x * pi Returnerar icke-negativa kvadratroten av x * pi 返回xπçš„éžè´Ÿå¹³æ–¹æ ¹ abs((\x*pi)^(1/2)) Non-negative value Valeur strictement positive Niet-negatieve waarde Icke-negativt nummer éžè´Ÿå€¼ 0 Trigonometry Trigonométrie Goniometrie Trigonometri 三角学 Sine Sinus Sinus Sinus 正弦 r:sin Angle Hoek Vinkel 角度 Cosine Cosinus Cosinus Cosinus 余弦 r:cos Angle Hoek Vinkel 角度 Tangent Tangente Tangens Tangens 正切 r:tan Angle Hoek Vinkel 角度 Inverse Sine Arcsinus Inverse sinus Invers sinus åæ­£å¼¦ r:asin arcsin Inverse Cosine Arccosinus Inverse cosinus Invers cosinus å余弦 r:acos arccos Inverse Tangent Arctangente Inverse tangens Invers tangens åæ­£åˆ‡ r:atan arctan Hyperbolic Sine Sinus Hyperbolique Hyperbolische sinus Sinus hyperbolicus åŒæ›²æ­£å¼¦ r:sinh Hyperbolic Cosine Cosinus Hyperbolique Hyperbolische cosinus Cosinus hyperbolicus åŒæ›²ä½™å¼¦ r:cosh Hyperbolic Tangent Tangente Hyperbolique Hyperbolische tangens Tangens hyperbolicus åŒæ›²æ­£å‰² r:tanh Inverse Hyperbolic Sine Argsinus Hyperbolique Inverse hyperbolische sinus Invers sinus hyperbolicus ååŒæ›²æ­£å¼¦ r:asinh argsh Inverse Hyperbolic Cosine Argcosinus Hyperbolique Inverse hyperbolische cosinus Invers cosinus hyperbolicus ååŒæ›²ä½™å¼¦ r:acosh argcosh Inverse Hyperbolic Tangent Argtangente Hyperbolique Inverse hyperbolische tangens Invers tangens hyperbolicus ååŒæ›²æ­£åˆ‡ r:atanh argth Four-quadrant Inverse Tangent Fyra kvadranters invers tangens r:atan2 Computes the principal value of the argument function applied to the complex number x+iy. Beräknar principalvärdet för argumentfunktionen applicerad pÃ¥ det komplex talet x+iy. Y X X X X Cardinal Sine (Sinc Function) Sinc-funktionen r:sinc Radians to Default Angle Unit Radians en Unité d'Angle par Défaut Radialen naar standaard hoekeenheid Radians till färvald vinkelenhet 将弧度转æ¢åˆ°ç¼ºçœè§’度å•ä½ r:radtodef radnaardef Radians Radialen Radianer 弧度 Secant Secans Sekant 正割 r:sec 1/cos(\x) Angle Hoek Vinkel 角度 false true Cosecant Cosécante Cosecant Cosekant 余割 r:csc 1/sin(\x) Angle Hoek Vinkel 角度 false true Cotangent Cotangente Cotangens Cotangens 余切 r:cot 1/tan(\x) Angle Hoek Vinkel 角度 false true Hyperbolic Secant Sécante hyperbolique Hyperbolische secans Sekant hyperbolicus åŒæ›²æ­£åˆ‡ r:sech 1/cosh(\x) false Hyperbolic Cosecant Cosécante hyperbolique Hyperbolische cosecans Cosekant hyperbolicus åŒæ›²ä½™å‰² r:csch 1/sinh(\x) false Hyperbolic Cotangent Cotangente Hyperbolique Hyperbolische cotangens Cotangens hyperbolicus åŒæ›²ä½™åˆ‡ r:coth 1/tanh(\x) false Inverse Secant Arcsécante Inverse secans Invers sekant åæ­£å‰² r:asec radtodef(0.5pi+i*ln(sqrt(1-1\x^2)+i/\x)) false Inverse Cosecant Arccosécante Inverse cosecans Invers cosekant å余割 r:acsc radtodef(-i*ln(sqrt(1-1\x^2)+i/\x)) false Inverse Cotangent Arccotangente Inverse cotangens Invers cotangens å余切 r:acot radtodef(i/2*(ln((\x-i)/\x)-ln((\x+i)/\x))) false Inverse Hyperbolic Secant Argsécante Hyperbolique Inverse hyperbolische secans Invers sekant hyperbolicus ååŒæ›²æ­£å‰² r:asech ln(sqrt(1/\x-1)*sqrt(1/\x+1)+1/\x) false Inverse Hyperbolic Cosecant Argcosécante Hyperbolique Inverse hyperbolische cosecans Invers cosekant hyperbolicus ååŒæ›²ä½™å‰² r:acsch ln(sqrt(1+1/\x^2)+1/\x) false Inverse Hyperbolic Cotangent Argcotangente Hyperbolique Inverse hyperbolische cotangens Invers cotangens hyperbolicus ååŒæ›²ä½™åˆ‡ r:acoth (ln(1+1/\x)-ln(1-1/\x))/2 false Miscellaneous Divers Diversen Diverse æ‚项 Body Mass Index (BMI) Indice de masse corporelle (IMC) Body Mass Index (BMI) (Index voor lichaamsmassa) 体质指数(BMI) -r:bmi imc Calculates the Body Mass Index. The resulting BMI-value is sometimes interpreted as follows (although varies with age, sex, etc.): Underweight < 18.5 Normal weight 18.5-25 Overweight 25-30 Obesity > 30 Note that you must use units for weight (ex. 59kg) and length (ex. 174cm). Calcule l'Indice de Masse Corporelle. L'IMC est parfois interprété de la façon suivante (bien qu'il varie selon l'âge, le sexe, etc.) : Maigreur < 18.5 Corpulence normale 18.5-25 Surpoids 25-30 Obésité > 30 Notez que vous devez utiliser des unités pour la masse (p. ex. 59kg) et la taille (p. ex. 174cm). Beräknar BMI (Body Mass Index). Det resulterande BMI-värdet tolkas ibland som följer: Undervikt < 18.5 Idealvikt 18.5-25 Övervikt 25-30 Fetma > 30 Notera att du mÃ¥ste använda enheter för vikt (ex. 59kg) och längd (ex. 174cm). 计算体质指数(Body Mass Index, 简称BMI)。所得BMI结果的å‚考æ„义如下: 体é‡è¿‡è½» < 18.5 体釿­£å¸¸ 18.5-25 体é‡è¿‡é‡ 25-30 肥胖 > 30 æ³¨æ„æ‚¨å¿…须使用 é‡é‡å’Œé•¿åº¦å•ä½ï¼ˆå¦‚,59kgå’Œ174cm)。 $name(127 lb, 5ft + 4in) = 21.80 (\x/(1000g))/(\y/m)^2 Weight Poids Gewicht Vikt é‡é‡ true Length Longueur Lengte Längd 长度 true Roman Number Nombre Romain Romeins getal Romerskt tal 罗马数字 r:roman romeins Returns the value of a roman number. Retourneert de waarde van een Romeins getal. Returnerar värdet för romerska siffror. 返回罗马数字表示的值。 Roman number Nombre romain Romeins getal Romerskt tal 罗马数字 Statistics Statistique Statistiek Statistik 统计 Descriptive Statistics Statistiques Descriptives Beschrijvende statistiek Beskrivande statistik æè¿°æ€§ç»Ÿè®¡ Sum (total) Somme (total) Som (totaal) Summa (total) 总和 r:total totaal totalt Data Donnée Gegevens Data æ•°æ® Percentile Percentiel Percentil ç™¾åˆ†ä½æ•° r:percentile percentiel percentil Vector Vecteur Vektor å‘é‡ Percentile (%) Percentiel (%) Percentil (%) ç™¾åˆ†ä½æ•°(%) Quantile Algorithm (as in R) Kvantilalgoritm (som i R) Min Min 最å°å€¼ r:min Returns the lowest value. Retourne la valeur la plus petite. Retourneert de kleinste waarde. Returnerar det lägsta värdet. 返回最å°å€¼ã€‚ Vector Vecteur Vektor å‘é‡ Max Max 最大值 r:max Returns the highest value. Retourne la plus grande valeur. Retourneert de grootste waarde. Returnerar det högsta värdet. 返回最大值。 Vector Vecteur Vektor å‘é‡ Mode Modus Typvärde æ¨¡å¼ r:mode modus typvärde Returns the most frequently occurring value. Retourne la valeur qui apparaît le plus souvent. Retourneert de meest voorkomende waarde. Returnerar det mest förekommande värdet. 返回最常出现的值。 Vector Vecteur Vektor å‘é‡ Range Bereik OmfÃ¥ng 范围 r:range bereik omfÃ¥ng Calculates the difference between the min and max value. Calcule la différence entre la valeur minimale et maximale. Berekent het verschil tussen de kleinste en de grootste waarde. Beräknar skillnaden mellan min och max värdet. 计算最大和最å°å€¼ä¹‹é—´çš„差。 max(\x)-min(\x) Data Donnée Gegevens Data æ•°æ® Median Médianne Mediaan Median 䏭使•° r:median médiane mediaan percentile(\x,50) Data Donnée Gegevens Data æ•°æ® Quartile Quartile Kwartiel Kvartil å››åˆ†ä½æ•° r:quartile kwartiel kvartil percentile(\x,25*\y,\Z{8}) Data Donnée Gegevens Data æ•°æ® Quartile Quartile Kwartiel Kvartil å››åˆ†ä½æ•° 0 4 Quantile Algorithm (as in R) Kvantilalgoritm (som i R) 1 9 Decile Décile Deciel Decil ååˆ†ä½æ•° r:decile deciel decil percentile(\x,10*\y,\Z{8}) Data Donnée Gegevens Data æ•°æ® Decile Décile Deciel Decil ååˆ†ä½æ•° 0 10 Quantile Algorithm (as in R) Kvantilalgoritm (som i R) 1 9 Interquartile Range Écart interquartile Interkwartiel bereik KvartilavstÃ¥nd 四分ä½è· r:iqr Calculates the difference between the first and third quartile. Calcule la différence entre le premier et le troisième quartile. Berekent het verschil tussen het eerste en het derde kwartiel. Beräknar skillnaden mellan den första och tredje kvartilen. è®¡ç®—ç¬¬ä¸€å’Œç¬¬ä¸‰å››åˆ†ä½æ•°ä¹‹é—´çš„差。 quartile(\x,3,\Y{8})-quartile(\x,1,\Y{8}) Data Donnée Gegevens Data æ•°æ® Quantile Algorithm (as in R) Kvantilalgoritm (som i R) 1 9 Number of Samples Nombre d'Échantillons Aantal monsters Antal æ ·æœ¬æ•°é‡ r:number nombre getal antal Returns the number of samples. Retourne le nombre d'échantillons. Retourneert het aantal monsters. Returnerar antalet prov. 返回样本数é‡ã€‚ dimension(\x) Data Donnée Gegevens Data æ•°æ® Random Number Nombre Aléatoire Willekeurig getal Slumptal éšæœºæ•° r:rand wilk slumptal Generates a pseudo-random number. Returns a real number between 0 and 1, if ceil is zero (default), or an integer between 1 and (including) ceil. Génère un nombre pseudo-aléatoire. Retourne un nombre réel entre 0 et 1, si le plafond est zéro (valeur par défaut), ou un entier entre 1 et le plafond (inclusivement). Levert een pseudowillekeurig getal. Retourneert een reëel getal tussen 0 en 1 als ceil nul is (standaard), of een getal tussen 1 en ceil (inclusief). Generar ett pseudo-slumpmässigt nummer. Returnerar ett reealt tal mellan 0 och 1, om taket är noll (förval), eller ett heltal mellan 1 och (inklusive) taket. äº§ç”Ÿä¸€ä¸ªä¼ªéšæœºæ•°ã€‚如果顶部值为0(缺çœå€¼),返回一个在0与1之间的实数;å¦åˆ™è¿”回一个 在1与顶部值之间(包å«é¡¶éƒ¨å€¼)的整数。 Ceil Plafond Ceil Tak 顶部值 Random Number Between Limits Nombre Aléatoire entre les limites Willekeurig getal tussen twee grenswaarden Slumptal mellan gränser 在æŸä¸€èŒƒå›´å†…çš„éšæœºæ•° r:randbetween wilktussen Returns an integer between (including) bottom and top. Retourne un entier entre le bas et le haut (inclusivement). Retourneert een geheel getal tussen onder- en bovengrens (inclusief). Returnerar ett heltal mellan (inklusive) nedre och övre gräns 返回在顶部和底部之间(å«åº•部)的一个整数。 rand(\y-\x+1)+\x-1 \x<=\y Bottom Bas Onder Nedre gräns 底部 Top Haut Boven Övre gräns 顶部 Means Moyenne Gemiddelden Medelvärde å¹³å‡ Mean Moyenne Gemiddelde Medelvärde å¹³å‡ r:mean,average,au:x̄ medel,genomsnitt,au:x̄ total(\x)/dimension(\x) Data Donnée Gegevens Data æ•°æ® Harmonic Mean Moyenne Harmonique Harmonisch gemiddelde Harmoniskt medelvärde è°ƒå’Œå¹³å‡ r:harmmean harmgem harmmedel dimension(\x)/csum(1,-1,0,"y"+1/"x","x","y",\x) Data Donnée Gegevens Data æ•°æ® Geometric Mean Moyenne géométrique Meetkundig gemiddelde Geometriskt medelvärde å‡ ä½•å¹³å‡ r:geomean moyenne_géométrique meetkgem geomedel abs(csum(1,-1,1,"y"*"x","x","y",\x)^(1/dimension(\x))) Data Donnée Gegevens Data æ•°æ® Trimmed Mean Getrimd gemiddelde Trimmat medelvärde 截尾å‡å€¼ r:trimmean trimgemidd mean(limits(sort(\x),round(dimension(\x)/100*\y)+1,round(dimension(\x)/100*(100-\y)))) Data Donnée Gegevens Data æ•°æ® Trimmed percentage (at each end) Getrimd percentage (aan beide kanten) Trimmad procent (i bÃ¥da ändarna) 截尾百分比(在æ¯ä¸€ç«¯) true Winsorized Mean Gewinsoriseerd gemiddelde Winsor-medelvärde Winsorizedå¹³å‡ r:winsormean winsorgemidd sort(\x) dimension(\x) round(dimension(\x)/100*\y) (element(\1,\2-\3)*\3+element(\1,\3+1)*\3+total(limits(\1,\3+1,\2-\3)))/\2 Data Donnée Gegevens Data æ•°æ® Winsorized percentage (at each end) Gewinsoriseerd percentage (aan beide kanten) Winsorprocent (i bÃ¥da ändarna) Winsorized百分比(在æ¯ä¸€ç«¯) true Weighted Mean Moyenne Pondérée Gewogen gemiddelde Viktat medelvärde 加æƒå¹³å‡ r:weighmean gewogengemidd dimension(\x) min(dimension(\x),dimension(\y)) csum(1,\2,0,"y"+"x"*element("v","i"+\1),"x","y",mergevectors(\x,\y),"i","v")/total(limits(\y,1,\2)) Data Donnée Gegevens Data æ•°æ® Weights Poids Gewichten Vikter æƒé‡ Quadratic Mean (RMS) Moyenne Quadratique (RMS) Kwadratisch gemiddelde (RMS) Kvadratiskt medelvärde 凿–¹(RMS) r:rms abs((csum(1,-1,0,"y"+"x"^2,"x","y",\x)/dimension(\x))^(1/2)) Data Donnée Gegevens Data æ•°æ® Moments Momenten Moment 统计矩 Standard Deviation (entire population) Standaarddeviatie (gehele populatie) Standardavvikelse (komplett population) 标准差(总体) r:stdevp abs(varp(\x)^(1/2)) Data Donnée Gegevens Data æ•°æ® Standard Deviation (random sampling) Standaarddeviatie (willekeurige steekproef) Standardavvikelse (slumpmässigt urval) 标准差(éšæœºé‡‡æ ·) r:stdev standardavvikelse abs(var(\x)^(1/2)) Data Donnée Gegevens Data æ•°æ® Variance (entire population) Variance (population entière) Variantie (gehele populatie) Varians (komplett population) 方差(总体) r:varp mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/dimension(\x) Data Donnée Gegevens Data æ•°æ® Variance (random sampling) Variance (échantillon aléatoire) Variantie (willekeurige steekproef) Varians (slumpmässigt urval) 方差(éšæœºæ ·æœ¬) r:var mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/(dimension(\x)-1) Data Donnée Gegevens Data æ•°æ® Standard Error Standaardfout Standardfel 标准误差 r:stderr standardfel abs((var(\x)/dimension(\x))^(1/2)) Data Donnée Gegevens Data æ•°æ® Mean Deviation Déviation Moyenne Gemiddelde afwijking Medelavvikelse å‡å·® r:meandev gemiddev medelavvikelse mean(\x) csum(1,-1,0,"y"+abs("x"-\1),"x","y",\x)/dimension(\x) Data Donnée Gegevens Data æ•°æ® Covariance Covariantie Kovarians åæ–¹å·® r:cov,r:covar mean(\x) mean(\y) dimension(\x) min(dimension(\x),dimension(\y)) csum(1,\4,0,"y"+("x"-\1)*(element("v","i"+\3)-\2),"x","y",mergevectors(\x,\y),"i","v")/(\4) Data 1 Donnée 1 Gegevens 1 Data 1 æ•°æ®1 Data 2 Donnée 2 Gegevens 2 Data 2 æ•°æ®2 Pooled Variance Pooled variantie Gemensam varians åˆå¹¶æ–¹å·® r:poolvar mean(\x) mean(\y)^2 (csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)+csum(1,-1,0,"y"+("x"-\2)^2,"x","y",\y))/(dimension(\x)+dimension(\y)-2) Data 1 Donnée 1 Gegevens 1 Data 1 æ•°æ®1 Data 2 Donnée 2 Gegevens 2 Data 2 æ•°æ®2 Regression Régression Regressie Regression å›žå½’åˆ†æž Statistical Correlation Corrélation Statistique Statistische correlatie Statistisk korrelation 统计相关 r:cor covar(\x,\y)/(stdev(\x)*stdev(\y)) Data 1 Donnée 1 Gegevens 1 Data 1 æ•°æ®1 Data 2 Donnée 2 Gegevens 2 Data 2 æ•°æ®2 Pearson's Correlation Coefficient Coefficient de Corrélation de Pearson Pearson's correlatiecoëfficiënt Pearsons korrelationskoefficient 个人相关系数 r:pearson,r:correl korrelation dimension(\x)=dimension(\y) total(\x) total(\y) dimension(\x) dimension(\y) (\x*\y-\1*\2/\3)/abs(((\x^2-(\1^2)/\3)*(\y^2-(\2^2)/\4))^(1/2)) Data 1 Donnée 1 Gegevens 1 Data 1 æ•°æ®1 Data 2 Donnée 2 Gegevens 2 Data 2 æ•°æ®2 Spearman's Rho Spearman's Rho Spearmans Rho r:spearman dimension(\x)=dimension(\y) pearson(rank(\x),rank(\y)) Data 1 Donnée 1 Gegevens 1 Data 1 æ•°æ®1 Data 2 Donnée 2 Gegevens 2 Data 2 æ•°æ®2 Statistical Tests Statistische testen Statistika tester 统计测试 Unpaired T-Test Ongepaarde T-proef T-test éžé…对T测试 r:ttest poolvar(\x,\y)^2 (mean(\x)-mean(\y))/abs(((\1)/dimension(\x)+(\1)/dimension(\y))^(1/2)) Data 1 Donnée 1 Gegevens 1 Data 1 æ•°æ®1 Data 2 Donnée 2 Gegevens 2 Data 2 æ•°æ®2 Paired T-Test Test du T Gepaarde t-proef Parvist t-test é…对t检验 r:pttest mean(\x-\y)/stderr(\x-\y) Data 1 Donnée 1 Gegevens 1 Data 1 æ•°æ®1 Data 2 Donnée 2 Gegevens 2 Data 2 æ•°æ®2 Distribution Distributie Distribution 分布 Rayleigh Distribution Distribution de Rayleigh Rayleigh-verdeling Rayleighfördelning Rayleigh分布 r:rayleigh Returns the probability density p(x) at x for a Rayleigh distribution with scale parameter sigma. (from Gnumeric) Retourne la densité de probabilité p(x) au x choisi pour une distribution de Rayleigh avec le paramètre d'échelle sigma. (utilise Gnumeric) Retourneert de kansdichtheid p(x) in x voor een Rayleigh-verdeling met schaalparameter sigma. (van Gnumeric) æ ¹æ®æŒ‡å®šçš„è§„æ¨¡å‚æ•°Sigma返回Rayleigh分布在x点的密度概率p(x)。(用Gnumeric) if(\x < 0,0,(\x/\y)/\y*exp(-(\x/\y)*(\x/\y)/2)) X X X X Sigma Sigma Sigma Sigma 0 Rayleigh Tail Distribution Distribution de Queue de Rayleigh Rayleigh-staartverdeling Rayleighsvansfördelning Rayleigh尾分布 r:rayleightail rayleighstaart Returns the probability density p(x) at x for a Rayleigh tail distribution with scale parameter sigma and a lower limit. (from Gnumeric) Retourneert de kansdichtheid p(x) in x voor een Rayleigh-staartverdeling met schaalparameter sigma en een ondergrens. (van Gnumeric) æ ¹æ®æŒ‡å®šçš„è§„æ¨¡å‚æ•°Sigma和下é™è¿”回Rayleigh尾分布在x点的密度概率p(x)。(用Gnumeric) if(\x < \y,0,(\x/\z)/\z*exp(((\y/\z)+(\x/\z))*((\y/\z)-(\x/\z))/2)) X X X X Lower limit Limite inférieure Ondergrens Undre gräns ä¸‹é™ Sigma Sigma Sigma Sigma 0 Pareto Distribution Distribution de Pareto Paretoverdeling Paretofördelning Pareto分布 r:pareto Returns the probability density p(x) at x for a Pareto distribution with exponent and scale. (from Gnumeric) Retourne la densité de probabilité p(x) au x choisi pour une distribution de Pareto avec l'exposant et l'échelle. (utilise Gnumeric) Retourneert de kansdichtheid p(x) in x voor een Pareto-verdeling met exponent en schaal. (van Gnumeric) æ ¹æ®æŒ‡å®šçš„æŒ‡æ•°å’Œè§„模返回Pareto分布在x点的密度概率p(x)。(用Gnumeric) if(\x < \z,0,(\y/\z)/(\x/\z)^(\y+1)) X X X X Exponent Exposant Exponent 指数 0 Scale Échelle Schaal Skala 规模 0 Logistic Distribution Distribution logistique Logistische verdeling Logistisk distribution Logistic分布 r:logistic logistique logistisch Returns the probability density p(x) at x for a logistic distribution with scale parameter. (from Gnumeric) Retourneert de kansdichtheid p(x) in x voor een logistische verdeling met schaalparameter. (van Gnumeric) æ ¹æ®æŒ‡å®šçš„规模返回logistic分布在x点的密度概率p(x)。(用Gnumeric) exp(-abs(\x)/\y)/(abs(\y)*(1+exp(-abs(\x)/\y))^2) X X X X Scale Échelle Schaal Skala 规模 0 Date & Time Date & Heure Datum & Tijd Datum & Tid 日期与时间 Construct Date Skapa datum r:date datum Returns a date. Available calendars gregorian (1), hebrew (2), islamic (3), persian (4), indian (5), chinese (6), julian (7), milankovic (8), coptic (9), ethiopian (10), egyptian (11). The Chinese year uses an epoch of 2697 BEC and chinese leap months are indicated by adding 12 to the month number (e.g. leap month 4 = 16). Returnerar ett datum. Tillgängliga kalendrar är grekorinsk (1), hebreisk (2), muslimsk(3), persisk(4), indisk (5), kinesisk (6), juliansk (7), milnkovic (8), koptisk (9), etiopisk (10), egyptisk (11). Det kinesiska Ã¥ret använder en epok som börjar 2697 f.Kr. och kinesiska skottmÃ¥nader indikeras genom att addera 12 till mÃ¥nadens nummer (t.ex. skottmÃ¥nad 4 = 16). Year Année Jaar Ã…r å¹´ Month Mois Maand MÃ¥nad 月份 Day Jour Dag Dag æ—¥ Calendar Kalender Construct Date and Time Skapa datum och tid r:datetime Year Année Jaar Ã…r å¹´ Month Mois Maand MÃ¥nad 月份 Day Jour Dag Dag æ—¥ Hour Heure Uur Timme å°æ—¶ Minute Minuut Minut 分 Second Seconde Seconde Sekund ç§’ Days between two dates Jours entre deux dates Aantal dagen tussen twee data Antal dagar mellan tvÃ¥ datum 两个日期之间的天数 r:days jours dagen dagar Returns the number of days between two dates. Basis is the type of day counting you want to use: 0: US 30/360, 1: real days (default), 2: real days/360, 3: real days/365 or 4: European 30/360. Retourne le nombre de jours entre deux dates. La base est la manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360, 1 : jours réels (par défaut), 2 : jours réels/360, 3 : jours réels/365 ou 4 : Européenne 30/360. Retourneert het aantal dagen tussen twee data. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. Returnerar antalet dagar mellan tvÃ¥ datum. Dagsräkningssystem kan vara: 0: Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360 返回两个日期之间的天数。 "基准"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。 First date Première date Eerste datum Första datumet 第一个日期 Second date Tweede datum Andra datumet 第二个日期 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 Financial function mode Mode de fonctions financières Financiële functiemodus Läge för financiella funktioner 金èžå‡½æ•°æ¨¡å¼ Years between two dates Années entre deux dates Jaren tussen twee data Antal Ã¥r mellan tvÃ¥ datum 两个日期之间相隔的年数 r:yearfrac jaarfrac Returns the number of years (fractional) between two dates. Basis is the type of day counting you want to use: 0: US 30/360, 1: real days (default), 2: real days/360, 3: real days/365 or 4: European 30/360. Retourne le nombre d'années (sous forme de fraction) entre deux dates. La base est la manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360, 1 : jours réels (par défaut), 2 : jours réels/360, 3 : jours réels/365 ou 4 : Européenne 30/360. Retourneert het aantal jaren (niet noodzakelijk geheel) tussen twee data. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. Returnerar antalet Ã¥r (decimala) mellan tvÃ¥ datum. Dagsräkningssystem kan vara: 0: Amerikanskt 30/360, 1: verkliga dagar (förvald), 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360 返回两个日期之间的年数(分数值)。 "基准"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。 First date Première date Eerste datum Första datumet 第一个日期 Second date Tweede datum Andra datumet 第二个日期 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 Financial function mode Mode de fonctions financières Financiële functiemodus Läge för financiella funktioner 金èžå‡½æ•°æ¨¡å¼ Week of Year Semaine de l'Année Week van het jaar Vecka pÃ¥ Ã¥ret 一年中的第几周 r:week vecka Date Datum Datum 日期 Week begins on Sunday La semaine commence le dimanche Week begint op zondag Veckor börjar pÃ¥ söndag æ¯å‘¨ä»Žæ˜ŸæœŸå¤©å¼€å§‹ Day of Week Jour de la semaine Dag van de week Veckodag 星期中的第几天 r:weekday weekdag veckodag Date Datum Datum 日期 Week begins on Sunday La semaine commence le dimanche Week begint op zondag Veckor börjar pÃ¥ söndag æ¯å‘¨ä»Žæ˜ŸæœŸå¤©å¼€å§‹ Month Mois Maand MÃ¥nad 月份 r:month mois maand mÃ¥nad Date Datum Datum 日期 Day of Month Jour du mois Dag van de maand MÃ¥nadsdag 月份中的第几天 r:day jour dag dag Date Datum Datum 日期 Year Année Jaar Ã…r å¹´ r:year jaar Ã¥r Date Datum Datum 日期 Day of Year Jour de l'année Dag van het jaar Dag pÃ¥ Ã¥ret 一年中的第几天 r:yearday jaardag Ã¥rsdag Date Datum Datum 日期 Current Time Heure actuelle Huidige tijd Nuvarande tid 当剿—¶é—´ r:time tijd tid Time Value Tidsvärde r:timevalue tidsvärde Returns the time part, in fractional hours, of a date and time value. Returnerar tidsdelen, i timmar, för ett datum och tid-värde. Date Datum Datum 日期 Date to Unix Timestamp Date selon l'Horodatage Unix Datum naar Unix-timestamp Datum till Unixtid 将时间转æ¢ä¸ºUnix时间戳 r:timestamp Date Datum Datum 日期 Unix Timestamp to Date Unix Timestamp naar datum Unixtid till datum Unix时间戳转æ¢ä¸ºæ—¥æœŸ r:stamptodate,unix2date Returns the local date and time represented by the specified Unix timestamp (seconds, excluding leap seconds, since 1970-01-01). Supports time units. Returnerar det lokala datum och tid som representeras av den angivna Unixtiden (sekunderar, exklusive skottsekunders, sedan 1970-01-01). Tidsenheter stöds. Timestamp Timestamp Unixtid 时间戳 Add Days Dagen bijtellen Addera dagar 加日 r:addDays dagen bijtellen adderaDagar Date Datum Datum 日期 Days Dagen Dagar æ—¥ Add Months Maanden bijtellen Addera mÃ¥nader 加月份 r:addMonths maanden bijtellen adderaMÃ¥nader Date Datum Datum 日期 Months Maanden MÃ¥nader 月份 Add Years Jaren bijtellen Addera Ã¥r 加年 r:addYears jaren bijtellen adderaÃ…r Date Datum Datum 日期 Years Années Jaren Antal Ã¥r å¹´ Add Time Tijd optellen Addera tid 加时间 r:addTime tijd bijtellen adderaTid Adds a time value to a date. The value can be positive or negative, but must use a unit based on seconds (such as day and year). Fractions of days are truncated. Telt een tijdswaarde op bij een datum. Deze waarde kan zowel positief zijn als negatief, maar moet in een eenheid zijn uitgedrukt die op seconden is gebaseerd (zoals dag of jaar). Fracties van dagen worden afgekapt tot hele dagen. Adderar ett tidsvärde till ett datum. Värdet kan vara positivt eller negativt, men mÃ¥ste använda en enhet baserad pÃ¥ sekunder (sÃ¥som dag och Ã¥r). Delar av dagar avrundas mot noll. å°†ä¸€ä¸ªæ—¶é—´é—´éš”å€¼åŠ åˆ°æ—¥æœŸä¸­ã€‚è¯¥å€¼å¯æ­£å¯è´Ÿï¼Œä½†å…¶å•ä½å¿…须基于秒(如日或者年)ã€‚æ—¥æœŸçš„åˆ†æ•°éƒ¨åˆ†ä¼šè¢«æˆªå–æŽ‰ã€‚ \x+\y Date Datum Datum 日期 Time Temps Tijd Tid æ—¶é—´ isNumber(\x/s) Lunar Phase MÃ¥nfas r:lunarphase mÃ¥nfas Returns the lunar phase, as a number between 0 and 1, for the specified date. 0 represents new moon, 0.5 full moon, and 0.25 and 0.75 quarter moons. Returnerar mÃ¥nfasen, som ett nummer mellan 0 och 1, för det angivna datumet. 0 representerar nymÃ¥ne, 0,5 fullmÃ¥nar, och 0,25 samt 0,75 kvartsmÃ¥nar. Date Datum Datum 日期 Find Lunar Phase Hitta mÃ¥nfas r:nextlunarphase nästamÃ¥nfas Returns the date when the specified lunar phase occurs. The function searches forward beginning at the specified date. The lunar phase are specified as a number between 0 and 1, where 0 represents new moon, 0.5 full moon, and 0.25 and 0.75 quarter moons. Returnerar datumet när den angivna mÃ¥nfasen inträffar. Funktion söker framÃ¥t med början pÃ¥ angivet datum. MÃ¥nfasen anges som ett nummer mellan 0 och 1, där 0 representerar nymÃ¥ne, 0,5 fullmÃ¥nar, och 0,25 samt 0,75 kvartsmÃ¥nar. Lunar Phase MÃ¥nfas Start Date Startdatum Utilities Utilitaires Hulpmiddelen Verktyg 工具 Plot Functions and Vectors Rita funktioner och vektorer r:plot Expression or vector Uttryck eller vektor Minimum x value Minsta x-värde Maximum x value Högsta x-värde Number of samples / Step size Nombre d'Échantillons / Taille du pas Aantal monsters / stapgrootte Antal värden / stegstorlek 样本数é‡/步长 X variable X-variabel Use step size Utiliser le pas Stapgrootte gebruiken Använd stegstorlek 使用步长 Plots one or more expressions or vectors. Use a vector for the first argument to plot multiple series. Only the first argument is used for vector series. It is also possible to plot a matrix where each row is a pair of x and y values. Ritar en eller flera uttryck eller vektorer i ett linjediagram. Använd en vektor till den första parametern för att rita flera serier. Enbart den första parametern används för vektorserier. Det är även möjligt att rita en matrix där varje rad utgör parvisa x och y värden. $name([x^2, 2x, [0,1,4,8,16]], 0, 4). ASCII Value Valeur ASCII ASCII-waarde ASCII värde ASCII值 r:code kod Character Caractère Karakter Tecken 字符 ASCII Char Caractère ASCII ASCII-kar ASCII tecken ASCII字符 r:char tecken Value Valeur Waarde Värde 值 Length of string Longueur de la chaîne Lengte van karakterrij Textsträngslängd 字符串长度 r:len längd Text Texte Tekst Text 文字 Concatenate Strings Concaténer les chaînes Karakterrijen samenvoegen Sammanfoga textsträngar 连接字符串 r:concatenate samenvoegen sammanfoga Text string 1 Chaîne de texte 1 Tekstrij 1 Textsträng 1 文字1 Text string 2 Chaîne de texte 2 Tekstrij 2 Textsträng 2 文字2 Replace Remplacer Vervangen Ersätt æ›¿æ¢ r:replace vervangen ersätt Replaces a certain value in an expression with a new value. The expression is calculated before the replacement if the fourth argument is true. Remplace une certaine valeur dans une expression par une nouvelle valeur. L'expression est calculée avant le remplacement si le quatrième argument est vrai. Vervangt een waarde in een expressie door een nieuwe waarde. Eerst wordt de expressie berekend indien het vierde argument waar (true) is. Ersätt ett visst värde i ett uttryck med ett nytt värde. Uttrycket beräknas innan ersättandet om den parametern är satt till sant. 使用新值替æ¢è¡¨è¾¾å¼ä¸­çš„ç‰¹å®šå€¼ã€‚å¦‚æžœç¬¬å››ä¸ªå‚æ•°æ˜¯çœŸï¼Œåˆ™åœ¨æ›¿æ¢å‰é¦–å…ˆå¯¹è¡¨è¾¾å¼ è¿›è¡Œè®¡ç®—ã€‚ Expression Expressie Uttryck è¡¨è¾¾å¼ Original value Valeur originale Originele waarde Ursprungligt värde 原始值 New value Nouvelle valeur Nieuwe waarde Nytt värde 新值 Precalculate expression Expression précalculée Voorbereken expressie Beräkna uttrycket först é¢„å…ˆè®¡ç®—è¡¨è¾¾å¼ Strip Units Eenheden verwijderen Ta bort enheter 剥离å•ä½ r:nounit,strip_units geeneenheid,eenheden_weg Removes all units from an expression. The expression is calculated before the removal. Enlève toutes les unités de l'expression. L'expression est calculée avant la suppression. Verwijdert alle eenheden uit een expressie. De expressie wordt hierbij eerst berekend. Tar bort alla enheter frÃ¥n ett uttryck. Uttrycket beräknas innan borttagandet. 从表达å¼ä¸­åˆ é™¤å…¨éƒ¨å•ä½ã€‚在删除之å‰ä¼šå…ˆå¯¹è¡¨è¾¾å¼è¿›è¡Œè®¡ç®—。 Expression Expressie Uttryck è¡¨è¾¾å¼ Process Vector Elements Calculer les Éléments de Vecteur Vector-elementen verwerken Modifiera vektorelement 处ç†å‘é‡å…ƒç´  r:process verwerken Function Fonction Functie Funktion 函数 Element variable Variable Élément Elementvariabele Elementvariabel 元素å˜é‡ Vector Vecteur Vektor å‘é‡ Index variable Variable d'index Indexvariabele Indexvariabel 下标å˜é‡ Vector variable Variable vecteur Vectorvariabele Vektorvariabel å‘é‡å˜é‡ Process Matrix Elements Calculer les Éléments de Matrice Matrix-elementen verwerken Modifiera matriselement 处ç†çŸ©é˜µå…ƒç´  r:processm Function Fonction Functie Funktion 函数 Element variable Variable Élément Elementvariabele Elementvariabel 元素å˜é‡ Matrix Matrice Matris 矩阵 Row variable Variable de Ligne Rijvariabele Radvariabel 行å˜é‡ Column variable Variable de colonne Kolomvariabele Kolumnvariabel åˆ—æ ‡é‡ Matrix variable Variable matricielle Matrixvariabele Matrisvariabel 矩阵å˜é‡ Custom Sum of Elements Somme d'éléments personnalisée Aangepaste som van elementen Anpassad elementsumma 元素的自定义和 r:csum csom First element Premier élément Eerste element Första elementet 最åŽä¸€ä¸ªå…ƒç´  Last element Dernier élément Laatste element Sista elementet 最åŽä¸€ä¸ªå…ƒç´  Initial value Valeur initiale Beginwaarde Initialt värde åˆå§‹å€¼ Function Fonction Functie Funktion 函数 Value variable Variable valeur Waarde variabele Värdevariabel 值å˜é‡ Element variable Variable Élément Elementvariabele Elementvariabel 元素å˜é‡ Vector Vecteur Vektor å‘é‡ Index variable Variable d'index Indexvariabele Indexvariabel 下标å˜é‡ Vector variable Variable vecteur Vectorvariabele Vektorvariabel å‘é‡å˜é‡ Select Vector Elements Sélectionner les Éléments de Vecteur Vectorelementen selecteren Utvälj vektorelement 选择矩阵元素 r:select selecteer Vector Vecteur Vektor å‘é‡ Condition Conditie Förutsättning æ¡ä»¶ Element variable Variable Élément Elementvariabele Elementvariabel 元素å˜é‡ Select first match Sélectionner la première occurrence Eerste overeenkomst secteren Välj första matchande element 选择第一个匹é…项 Function Fonction Functie Funktion 函数 r:function fonction functie funktion Expression Expressie Uttryck è¡¨è¾¾å¼ Arguments Arguments Argumenten Parametrar 自å˜é‡ Title Titre Titel Titel 标题 r:title titel titel Name Nom Naam Namn åç§° Display Error Afficher l'erreur Weergavefout Visa felmeddelande 显示错误 r:error erreur fout fel Message Bericht Meddelande ä¿¡æ¯ Display Warning Afficher l'avertissement Waarschuwing weergeven Visa varning 显示警告 r:warning waarschuwing varning Message Bericht Meddelande ä¿¡æ¯ Display Message Afficher le message Bericht weergeven Visa meddelande æ˜¾ç¤ºä¿¡æ¯ r:message bericht meddelande Message Bericht Meddelande ä¿¡æ¯ Save as Variable Enregistrer comme variable Opslaan als variabele Spara som variabel 作为å˜é‡ä¿å­˜ r:save opslaan spara Value Valeur Waarde Värde 值 Name Nom Naam Namn åç§° Category Catégorie Categorie Kategori 类别 Title Titre Titel Titel 标题 RPN Stack Register Registre de Pile NPI RPN-register in stapelgeheugen RPN-stackregister RPN栈寄存器 r:register Returns the value of a RPN stack register. Retourne la valeur d'un registre de pile NPI. Retourneert de waarde in een register van het RPN-stapelgeheugen. Returnerar värdet för ett register pÃ¥ RPN-stacken. 返回RPN栈寄存器的值。 Index Index 下标 RPN Stack Vector Vecteur de Pile NPI RPN-vector in stapelgeheugen RPN-stackvektor RPNæ ˆå‘é‡ r:stack stapelgeheugen Returns the RPN stack as a vector. Retourne la pile NPI sous forme de vecteur. Retourneert de inhoud van het RPN-stapelgeheugen als een vector. Returnerar RPN-stacken som en vektor. å°†RPN栈作为å‘é‡è¿”回。 Is Number Is een getal Är nummer 是数字 r:isNumber isGetal ärNummer Value Valeur Waarde Värde 值 Is Real Is een reëel getal Är reellt 是实数 r:isReal isReëel ärReellt Value Valeur Waarde Värde 值 Is Rational Is een rationaal getal Är rationellt æ˜¯æœ‰ç†æ•° r:isRational isRationaal ärRationellt Value Valeur Waarde Värde 值 Is Integer Is een geheel getal Är heltal 是整数 r:isInteger isGeheel ärHeltal Value Valeur Waarde Värde 值 Represents Number Geeft een getal weer Representar nummer 代表数字 r:representsNumber isGetal representerarNummer Value Valeur Waarde Värde 值 Represents Real Geeft een reëel getal weer Representerar reellt tal 代表实数 r:representsReal isReëel representerarReelt Value Valeur Waarde Värde 值 Represents Rational Geeft een rationaal getal weer Representerar rationellt tal ä»£è¡¨æœ‰ç†æ•° r:representsRational isRationaalgetal representerarRationellt Value Valeur Waarde Värde 值 Represents Integer Geeft een geheel getal weer Representerar ett heltal 代表整数 r:representsInteger isGeheelgetal representarHeltal Value Valeur Waarde Värde 值 Interval Intervall r:interval intervall Lower endpoint Undre gräns Upper endpoint Övre gräns Logical Logique Logisch Logik 逻辑 For...Do For...Do (Pour...Faire) For...Do För...utför For...Do r:for pour för Initial value of counter Valeur initiale du compteur Beginwaarde van teller Initialt värde för räknare 计数器åˆå§‹å€¼ Counter variable Variable de compteur Tellervariabele Räknarvariabel 计数器å˜é‡ For condition Condition de boucle for For-voorwaarde Medans-villkor Foræ¡ä»¶ Counter update function Fonction d'incrémentation du compteur Functie voor bijwerken van de teller Funktion för uppdatering av räknare 计数器更新函数 Initial value Valeur initiale Beginwaarde Initialt värde åˆå§‹å€¼ Do function Fonction 'faire' Do-functie Utför-funktion Do函数 Value variable Variable valeur Waarde variabele Värdevariabel 值å˜é‡ If...Then...Else Si...Sinon..Alors If...Then...Else Om...dÃ¥...annars If...Then...Else r:if si om Tests a condition and returns a value depending on the result. Teste une condition et retourne une valeur en fonction du résultat. Test een conditie en retourneert een waarde afhankelijk van het resultaat. Testar ett villkor och returnerar ett värde beroende av result. 对一个æ¡ä»¶è¿›è¡Œæµ‹è¯•ï¼Œå¹¶æ ¹æ®æµ‹è¯•结果返回一个值。 Condition Conditie Förutsättning æ¡ä»¶ Expression if condition is met Expression si la condition est remplie Expressie indien aan conditie wordt voldaan Uttryck om villkoret uppfylls æ¡ä»¶æ»¡è¶³æ—¶çš„è¡¨è¾¾å¼ Expression if condition is NOT met Expression si la condition N'EST PAS remplie Expressie indien NIET aan conditie wordt voldaan Uttryck om villkoret INTE uppfylls æ¡ä»¶ä¸æ»¡è¶³æ—¶çš„è¡¨è¾¾å¼ Logical Exclusive OR OU Exclusif Logique Booleaanse XOR 逻辑排斥OR r:xor Value 1 Valeur 1 Waarde 1 Värde 1 值1 Value 2 Valeur 2 Waarde 2 Värde 2 值2 Bitwise Exclusive OR OU exclusif bit à bit Bitsgewijs XOR æŒ‰ä½æŽ’æ–¥OR r:bitxor Value 1 Valeur 1 Waarde 1 Värde 1 值1 Value 2 Valeur 2 Waarde 2 Värde 2 值2 Bitwise Shift Décalage de bits Bitsgewijs verschuiven (shift) 按ä½ç§»ä½ r:shift Number Nombre Nummer Nummer æ•°å­— Bits Bits 比特 Bitwise Complement (Not) r:bitcmp Number Nombre Nummer Nummer æ•°å­— Bits Bits 比特 Algebra Algèbre Algebra Algebra 代数 Summation Summa au:Σ,r:sum au:Σ,som au:Σ,summa Corresponds to the summation symbol. Adds terms for each x ranging from the lower to the upper limit. Motsvarar summasymbolen. Adderar termer för varje x frÃ¥n den undre till den övre gränsen. $name(x^2, 1, 5) = 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55 Term expression Expressie voor term Termuttryck é¡¹è¡¨è¾¾å¼ Lower limit (i) Limite inférieure (i) Ondergrens (i) Undre gräns (i) 下é™(i) Upper limit (n) Limite Supérieure (n) Bovengrens (n) Övre gräns (n) 上é™(n) Index variable Variable d'index Indexvariabele Indexvariabel 下标å˜é‡ Product of a sequence Produkt av en serie au:Π,r:product au:Π,produkt Corresponds to the product symbol. Multiplies factors for each x ranging from the lower to the upper limit. Correspond au symbole du produit. Multiplie les facteurs pour chaque x allant de la la limite inférieure à la limite supérieure. Komt overeen met het symbool voor vermenigvuldiging. Vermenigvuldigt met factoren met een waarde tussen de kleinste en de grootste grenswaarde. Motsvarar produktsymbolen. Multiplicerar faktorer för varje x frÃ¥n den undre till den övre gränsen. 相当于连乘符å·Π。将从上é™åˆ°ä¸‹é™çš„æ¯é¡¹x相乘。 $name(x^2, 1, 5) = 1^2 * 2^2 * 3^2 * 4^2 * 5^2 = 1440 Factor expression Factoriser l'expression Expressie voor factor Faktoruttryck å› å­è¡¨è¾¾å¼ Lower limit (i) Limite inférieure (i) Ondergrens (i) Undre gräns (i) 下é™(i) Upper limit (n) Limite Supérieure (n) Bovengrens (n) Övre gräns (n) 上é™(n) Index variable Variable d'index Indexvariabele Indexvariabel 下标å˜é‡ Solve for multiple variables Résoudre pour des variables multiples Oplossen voor meerdere variabelen Lös för flera variabler 多å˜é‡æ±‚è§£ r:multisolve meerdereoplossen r:multisolve Equation vector Vecteur d'équation Vergelijkingsvector Ekvationsvektor 方程å‘é‡ Variable vector Variable vecteur Variabele vector Variabelvektor å˜é‡å‘é‡ Solve equation Résoudre l'équation Vergelijking oplossen Lös ekvation 方程求解 r:solve oplossen lös Equation Équation Vergelijking Ekvation 方程 With respect to Met betrekking tot Med avseende pÃ¥ 关于 Solve differential equation Lös differentialekvation r:dsolve Equation Équation Vergelijking Ekvation 方程 Initial condition: function value (y) Initialt villkor: funktionsvärde (y) Initial condition: argument value (x) Initialt villkor: parametervärde (x) Solves a differential equation and returns the value of y(x). The derivative in the equation should be in the format diff(y, x). Only first-order differential equations are currently supported. Löser en differentialekvation och returnerar värdet pÃ¥ y(x). Derivatan i ekvation mÃ¥ste vara i formatet diff(y; x). Enbart första ordningens differentialekvationer stöds för nuvarande. $name(2 * diff(y, x) - y = 4x, 5, 2) = 21e^(x/2) / e - 4x - 8 Solve for two variables Résoudre pour deux variables Oplossen voor twee variabelen Lös för tvÃ¥ variabler åŒå˜é‡æ±‚è§£ r:solve2 oplossen2 lös2 Solves two equations with two unknown variables. Returns the value of the first variable. Résout deux équations à deux inconnues. Retourne la valeur de la première variable. Lost twee vergelijkingen op in twee variabelen. Retourneert de waarde van de eerste variabele. Lös tvÃ¥ ekvationer med tvÃ¥ okända variabler. Returnerar värdet pÃ¥ den första variabeln. è§£ç”±ä¸¤ä¸ªæœªçŸ¥æ•°å’Œä¸¤ä¸ªæ–¹ç¨‹ç»„æˆæ–¹ç¨‹ç»„。返回第一个å˜é‡çš„值。 solve(replace(\x,\A{y},solve(\y,\A)),\Z{x}) Equation 1 Équation 2 Vergelijking 1 Ekvation 1 方程1 Equation 2 Équation 2 Vergelijking 2 Ekvation 2 方程 Variable 1 Variabele 1 Variabel 1 å˜é‡1 Variable 2 Variabele 2 Variabel 2 å˜é‡2 Find Linear Function Trouver une fonction affine Lineaire functie bepalen Finn linjär funktion 寻找线性函数 r:linearfunction lineairefunctie linjär_funktion Finds the linear function for the straight line between two distinct points. Trouve la fonction affine pour la ligne droite passant entre deux points distincts. Bepaalt de lineaire functie voor de rechte lijn tussen twee verschillende punten. Finner den linjära funktionen för den räta linjen mellan tvÃ¥ distinkta punkter. 寻找过两点直线段的线性函数 (\a-\y)/(\z-\x)*("x"-\x)+\y x1 y1 x2 y2 Calculus Calcul Calculus Calculus 微积分 Differentiate Derivera ç™¾åˆ†ä½æ•° r:diff Function Fonction Functie Funktion 函数 With respect to Met betrekking tot Med avseende pÃ¥ 关于 Order Ordre Orde Ordning 次数 Integrate Intégrale Integreren Integrera 积分 r:integrate intégrer integreren integrera Function Fonction Functie Funktion 函数 Variable of integration Variable d'intégration Integratievariabele Variabel för integration 积分å˜é‡ Lower limit Limite inférieure Ondergrens Undre gräns ä¸‹é™ Upper limit Limite Supérieure Bovengrens Övre gräns ä¸Šé™ Limit Gränsvärde Returns the two-sided limit of the function if direction is zero, limit from left (below) if direction is -1, or limit from right (above) if direction is +1. Returnerar det tvÃ¥-sidiga gränsvärdet för funktionen om riktning är noll, gränsvärdet frÃ¥n vänster (underifrÃ¥n) om riktning är -1 eller gränsvärdet frpn höger (ovanifrÃ¥n) om riktning är +1. r:limit Function Fonction Functie Funktion 函数 Value to approach Värde att närma Variable Variabele Variabel å˜é‡ Direction Riktning Extreme Values Valeurs extrêmes Uiterste waarden Extremvärden æžé™å€¼ r:extremum uiterste solve(diff(\x, \Y{x})=0, \Y) Function Fonction Functie Funktion 函数 With respect to Met betrekking tot Med avseende pÃ¥ 关于 Named Integrals Namngivna integraler Logarithmic Integral Logaritmisk integral rc:li,logint The integral of 1/ln(x). Integralen av 1/ln(x). Exponential Integral Exponentiell integral rc:Ei,expint The integral of e^x/x. Integralen av e^x/x. Sine Integral Sineintegral rc:Si,sinint Angle Hoek Vinkel 角度 The integral of sin(x)/x. Integralen av sin(x)/x Cosine Integral Cosineintegral rc:Ci,cosint Angle Hoek Vinkel 角度 The integral of cos(x)/x. Integralen av cos(x)/x. Hyperbolic Sine Integral Sinus hyperbolicus-integral rc:Shi,sinhint The integral of sinh(x)/x. Integralen av sinh(x)/x. Hyperbolic Cosine Integral Cosinus hyperbolicus-integral rc:Chi,coshint The integral of cosh(x)/x. Integralen av cosh(x)/x. Upper Incomplete Gamma Function Övre ofullständig gammafunktion r:igamma Lower Incomplete Gamma Function Undre ofullständig gammafunktion r:gammainc 1-igamma(\x,\y)/gamma(\x) Geometry Géométrie Meetkunde Geometri 几何 Triangle Driehoek Triangel 三角形 Hypotenuse Hypoténuse Hypotenusa Hypotenusa 斜边 r:hypot sqrt(\x^2+\y^2) Side A Côté A Zijde A Sida A è¾¹A Side B Côté B Zijde B Sida B è¾¹B Triangle Area Aire de Triangle Oppervlakte van driehoek Triangelarea 三角形é¢ç§¯ r:triangle driehoek triangel (\x*\y)/2 Base Grondtal Bas 基/底 Height Hauteur Hoogte Höjd 高度 Triangle Perimeter Périmètre de Triangle Omtrek van driehoek Rektangelomkrets (ç›´è§’)三角形周长 r:triangle_perimeter driehoek_omtrek triangelomkrets \x+\y+\z Side A Côté A Zijde A Sida A è¾¹A Side B Côté B Zijde B Sida B è¾¹B Side C Côté C Zijde C Sida C è¾¹C Circle Cercle Cirkel Cirkel 圆形 Circle Area Aire d'un cercle Cirkeloppervlak Cirkelarea 圆é¢ç§¯ r:circle cercle cirkel cirkel Calculates the area of a circle using the radius Calcule l'aire d'un cercle d'après son rayon Berekent met de straal het oppervlak van een cirkel Beräknar arean för en cirkel. 使用åŠå¾„计算圆é¢ç§¯ \x^2*pi Radius Rayon Straal Radie åŠå¾„ Circle Circumference Circonférence d'un cercle Cirkelomtrek Cirkelomkrets 圆周长 r:circumference circonférence cirkelomtrek omkrets Calculates the area of a circle using the radius Calcule l'aire d'un cercle d'après son rayon Berekent met de straal het oppervlak van een cirkel Beräknar arean för en cirkel. 使用åŠå¾„计算圆é¢ç§¯ \x*2*pi Radius Rayon Straal Radie åŠå¾„ Cylinder Cylindre Cilinder Cylinder 圆柱 Cylinder Volume Volume d'un cylindre Volume van cilinder Cylindervolym 圆柱体积 r:cylinder cylindre cilinder \x^2*pi*\y Radius Rayon Straal Radie åŠå¾„ Height Hauteur Hoogte Höjd 高度 Surface Area of Cylinder Aire de la Surface d'un Cylindre Oppervlaktegrootte van cilinder Ytarea för en cylinder 圆柱体表é¢ç§¯ r:cylinder_sa cilinder_opp cylinderyta 2*\x^2*pi+2*pi*\x*\y Radius Rayon Straal Radie åŠå¾„ Height Hauteur Hoogte Höjd 高度 Cone Cône Kegel Kon 圆锥 Cone Volume Volume d'un cône Volume van kegel Konvolym 圆锥体积 r:cone cône kegel kon \x^2*pi*\y/3 Radius Rayon Straal Radie åŠå¾„ Height Hauteur Hoogte Höjd 高度 Surface Area of Cone Aire de la Surface d'un Cône Oppervlaktegrootte van kegel Ytarea för en kon 圆锥表é¢ç§¯ r:cone_sa kegel_opp konyta \x^2*pi+pi*\x*abs((\y^2+\x^2)^(1/2)) Radius Rayon Straal Radie åŠå¾„ Height Hauteur Hoogte Höjd 高度 Sphere Sphère Bol Sfär çƒä½“ Sphere Volume Volume de Sphère Volume van bol Sfärvolym çƒä½“积 r:sphere bol sfär \x^3*pi*4/3 Radius Rayon Straal Radie åŠå¾„ Surface Area of Sphere Aire de la Surface d'une Sphère Oppervlaktegrootte van bol Ytarea för en sfär çƒä½“表é¢ç§¯ r:sphere_sa bol_oppervlak sfäryta \x^2*pi*4 Radius Rayon Straal Radie åŠå¾„ Square Carré Vierkant Kvadrat 正方形 Square Area Aire d'un Carré Oppervlakte van vierkant Kvadratarea 正方形é¢ç§¯ r:square vierkant kvadrat \x^2 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Square Perimeter Périmètre d'un Carré Omtrek van vierkant Kvadratomkrets 正方形周长 r:square_perimeter vierkant_omtrek kvadratomkrets \x*4 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Cube Derdemacht Kub 立方体 Cube Volume Volume d'un cube Volume kubus Kubvolym 立方体体积 r:cube kubus kub \x^3 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Surface Area of Cube Aire de la Surface d'un Cube Oppervlaktegrootte van kubus Ytarea för en kub 立方体表é¢ç§¯ r:cube_sa kubus_opp kubyta (\x^2)*6 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Rectangle Rechthoek Rektangel 矩形 Rectangle Area Aire de Rectangle Oppervlak rechthoek Rektangelarea 矩形é¢ç§¯ r:rect rektangel \x*\y Length Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Rectangle Perimeter Périmètre de Rectangle Omtrek rechthoek Rektangelomkrets 矩形周长 r:rect_perimeter rect_omtrek rektangelomkrets (\x+\y)*2 Length Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Prism Prisme Prisma Prism 棱柱 Volume of Rectangular Prism Volume de Prisme Rectangulaire Inhoud van rechthoekig prisma Volym för en rektangulär prism 矩形棱柱体积 r:rectprism rectprisma rektangelprism Calculates the volume of a prism with rectangular base. Calcule le volume d'un prisme à base rectangulaire. Berekent de inhoud van een prisma met een rechthoekig basisvlak. Beräknar volymen för en prisma med rektangulär bas. 计算矩形棱柱的体积。 \x*\y*\z Length Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Height Hauteur Hoogte Höjd 高度 Surface Area of Rectangular Prism Aire de la Surface d'un Prisme Rectangulaire Oppervlaktegrootte van rechthoekig prisma Ytarea för en rektangulär prism 矩形棱柱表é¢ç§¯ r:rectprism_sa rectprisma_opp rektangelprismyta Calculates the surface area of a prism with rectangular base. Calcule l'aire de la surface d'un prisme à base rectangulaire. Berekent de oppervlakte van een prisma met een rechthoekig basisvlak. Beräknar ytarean för en prisma med rektangulär bas. 计算矩形棱柱的表é¢ç§¯ (\x*\y)*2+(\x*\z)*2+(\y*\z)*2 Length Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Height Hauteur Hoogte Höjd 高度 Volume of Triangular Prism Volume de Prisme Rectangulaire Inhoud van driehoekig prisma Volym för en triangulär prism 三角棱柱体积 r:triangleprism driehoekprisma triangelprism Calculates the volume of a prism with triangular base. Calcule le volume d'un prisme à base triangulaire. Berekent de inhoud van een prisma met een driehoekig basisvlak. Beräknar volymen för en prisma med triangulär bas. 计算三角棱柱的体积。 \x*\y*\z/2 Length Longueur Lengte Längd 长度 Width Largeur Breedte Bredd 宽度 Height Hauteur Hoogte Höjd 高度 Pyramid Pyramide Piramide Pyramid 锥体 Pyramid Volume Volume de Pyramide Volume van piramide Pyramidvolym 锥体体积 r:pyramid piramide Calculates the volume of a 3-dimensional shape standing on a rectangular base and terminating in a point at the top. Calcule le volume d'une forme à trois dimensions basée sur un rectangle et se finissant en un point au sommet. Berekent de inhoud van een 3-dimensionaal lichaam met een rechthoekig basisvlak en een top in de vorm van een punt. Beräknar volymen för en 3-dimensionell form som stÃ¥r pÃ¥ en rektangulär bas och som slutar en punkt pÃ¥ toppen. 计算矩形锥体的体积。 \x*\y*\z/3 Length of base Longueur de la taille Lengte van basis Basens längd 底é¢é•¿åº¦ Width of base Largeur de la base Basislengte Basens bredd 底é¢å®½åº¦ Height Hauteur Hoogte Höjd 高度 Volume of Regular Tetrahedron Volume de Tétraèdre Régulier Inhoud van regelmatig viervlak (tetraëder) Volym för en liksidig tetrahedron 正四é¢ä½“体积 r:tetrahedron tetraëder sqrt(2)/12*\x^3 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Surface Area of Regular Tetrahedron Aire de la Surface d'un Tétraèdre Régulier Oppervlaktegrootte van regelmatig viervlak (tetraëder) Ytarea för en liksidig tetrahedron 正四é¢ä½“表é¢ç§¯ r:tetrahedron_sa tetraëder_opp tetrahedronyta sqrt(3)*\x^2 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Height of Regular Tetrahedron Hauteur d'un Tétraèdre Régulier Hoogte van een regelmatig viervlak (tetraëder) Höjden pÃ¥ en liksidig tetrahedron 正四é¢ä½“的高度 r:tetrahedron_height tetraëder_hoogte tetrahedronhöjd sqrt(6)/3*\x Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Volume of Square Pyramid Volume de Pyramide à Base Carrée Inhoud van vierkant prisma Volym för en kvadratisk pyramid 方锥体体积 r:sqpyramid vierkpiramide kvpyramid sqrt(2)/6*\x^3 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Surface Area of Square Pyramid Aire de la Surface d'une Pyramide Oppervlaktegrootte van vierkante piramide Ytarea för en kvadratisk pyramid 方锥体表é¢ç§¯ r:sqpyramid_sa vierkpiramide_opp kvpyramidyta (1+sqrt(3))*\x^2 Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Height of Square Pyramid Hauteur d'une Pyramide à Base Carrée Hoogte van een vierkante piramide Höjden pÃ¥ en kvadratisk pyramid 方角锥的高度 r:sqpyramid_height midhoogte_vierkpiramide kvpyramidhöjd sqrt(2)/2*\x Length of side Longueur du côté Lengte van zijde Sidans längd 边长 Parallelogram Parallélogramme Parallellogram Parallelogram 平行四边形 Parallelogram Area Aire d'un Parallélogramme Oppervlak van parallellogram Parallelogramarea 平行四边形é¢ç§¯ r:parallelogram parallélogramme parallellogram parallellogram Calculates the area of a four-sided figure whose opposite sides are both parallel and equal in length. Berekent de oppervlakte van een figuur met vier zijden waarvan de overstaande zijden zowel evenwijdig als even lang zijn. Beräknar arean för en fyrsidig figur vars motstÃ¥ende sidor är parallella och är lika lÃ¥nga. 计算平行四边形的é¢ç§¯ã€‚ \x*\y Base Grondtal Bas 基/底 Height Hauteur Hoogte Höjd 高度 Parallelogram Perimeter Périmètre d'un Parallélogramme Omtrek van parallellogram Parallelogramomkrets 平行四边形周长 r:parallelogram_perimeter périmètre_de_parallélogramme parallellogram_omtrek parallellogramomkrets Calculates the perimeter of a four-sided figure whose opposite sides are both parallel and equal in length. Berekent de omtrek van een figuur met vier zijden waarvan de overstaande zijden zowel evenwijdig als even lang zijn. Beräknar omkretsen för en fyrsidig figur vars motstÃ¥ende sidor är bÃ¥de parallella och lika lÃ¥nga. 计算平行四边形的周长。 (\x+\y)*2 Side A Côté A Zijde A Sida A è¾¹A Side B Côté B Zijde B Sida B è¾¹B Trapezoid Trapezium Trapetsoid 梯形 Trapezoid Area Oppervlakte van trapezium Trapetsoidarea 梯形é¢ç§¯ r:trapezoid trapezium trapetsoid Calculates the area of a four-sided figure with two parallel sides. Berekent de oppervlakte van een figuur met vier zijden waarvan twee zijden evenwijdig zijn. Beräknar arean för en fyrsidig figur med tvÃ¥ parallella sidor. 计算梯形的é¢ç§¯ã€‚ (\x+\y)/2*\z Side A Côté A Zijde A Sida A è¾¹A Side B Côté B Zijde B Sida B è¾¹B Height Hauteur Hoogte Höjd 高度 Economics Économie Economie Ekonomi ç»æµŽå­¦ Microeconomics Micro-économie Microëconomie Mikroekonomi å¾®è§‚ç»æµŽå­¦ Elasticity Élasticité Elasticiteit Elasticitet 弹性 r:elasticity élasticité elasticiteit elasticitet Calculates the demand elasticity. Also works for supply elasticity, income elasticity, cross-price elasticity, etc. Just replace demand with supply, or price with income... eg. elasticity(100-x^2, 3) calculates the demand elasticity when the price is 3 for the function "Q = 100 - x^2" where x is the default price variable. Calcule l'élasticité de la demande. Fonctionne également pour l'élasticité de l'offre, de revenu, de prix croisés, etc. Remplacez simplement demande par offre, ou prix par revenu... Ex. elasticity(100-x^2, 3) calcule l'élasticité de la demande quand le prix est 3 pour la fonction "Q = 100 - x^2" où x est la variable de prix par défaut. Berekent de vraagelasticiteit. Is ook toepasbaar op aanbodelasticiteit, inkomenselasticiteit, prijselasticiteit, enzovoorts. Vervang vraag door aanbod of prijs met inkomen... %#10; De formule elasticity(100-x^2, 3) bijvoorbeeld berekent de vraagelasticiteit als de prijs 3 is voor de functie "Q = 100 -x^2". waar x de standaard prijsvariabele is. Beräknar efterfrÃ¥geelasticitet. Fungerar lika bra för tillgÃ¥ng- och inkomstelasticitet, etc. Ersätt bara efterfrÃ¥gan med tillgÃ¥ng, eller pris med inkomst... t ex elasticity(100-x^2, 3) beräknar efterfrÃ¥geelasticiteten när priset är 3 för functionen "Q = 100 - x^2" där x är den förvalda prisvariabeln. è®¡ç®—éœ€æ±‚å¼¹æ€§ã€‚å°†éœ€æ±‚æ›¿æ¢æˆä¾›ç»™ã€æ”¶å…¥â€¦â€¦ç­‰ï¼Œä¹Ÿå¯ä»¥ç”¨å®ƒæ¥è®¡ç®—ä¾›ç»™å¼¹æ€§ã€æ”¶å…¥å¼¹æ€§ã€äº¤å‰ä»·æ ¼å¼¹æ€§ç­‰ã€‚ 例如,表达å¼elasticity(100-x^2, 3)计算x为价格å˜é‡çš„函数"Q = 100 - x^2",当价格为3æ—¶çš„ 需求弹性。 replace(diff(\x,\Z{x}),\Z,\y,1)*\y/replace(\x,\Z,\y) Demand function Fonction de la demande Vraagfunctie EfterfrÃ¥gefunktion 需求函数 Price Prix Prijs Pris ä»·æ ¼ Price variable Variable de prix Prijsvariabele Prisvariabel ä»·æ ¼å˜é‡ Sum-of-Years Digits Depreciation Afschrijving volgens som der jaren Ã…rlig avskrivningssumma 年数总和折旧 r:syd Calculates the sum-of-years digits depreciation for an asset based on its cost, salvage value, anticipated life, and a particular period. This method accelerates the rate of the depreciation, so that more depreciation expense occurs in earlier periods than in later ones. The depreciable cost is the actual cost minus the salvage value. The useful life is the number of periods (typically years) over which the asset is depreciated. Calcule la dépréciation d'un actif d'après son coût, sa valeur résiduelle, sa durée prévue et une période particulière. Cette méthode accélère le taux de dépréciation, ainsi les frais de dépréciation sont plus importants dans les premières périodes que dans les dernières. Le coût amortissable est la valeur réelle moins la valeur résiduelle. La vie utile est le nombre de périodes (typiquement années) pendant lesquelles les actifs sont dépréciés. Berekent de afschrijving naar leeftijd voor een actief gebaseerd op de aanschafkosten, de restwaarde, de verwachte economische levensduur en een bepaalde periode. Deze methode vermindert de afschrijvingskosten naarmate het actief ouder word. De afschrijvingskosten zijn dus aan het begin het hoogst. De af te schrijven waarde wordt berekend uit het verschil tussen aanschaf- en restwaarde. De economische levensduur is het aantal perioden (meestal jaren) waarin het actief word afgeschreven. Beräknar "sum-of-years digits"-avskrivningen för en tillgÃ¥ng, baserat pÃ¥ dess kostnad, slutvärde, förväntad livslängd och en given period. Metoden accelererar värdeminskningen, sÃ¥ att störst värdeminskning sker i början. Den avskrivbara kostnaden är den faktiskta kostnaden minus slutvärdet. Livslängden är den period (anges ofta i Ã¥r) som värdeminskningen pÃ¥gÃ¥r. æ ¹æ®ä¸€é¡¹èµ„äº§çš„æˆæœ¬ã€æ®‹å€¼ã€é¢„期寿命和特定周期计算它的年数总和折旧(SOYD)。 è¿™ç§æ–¹æ³•加速折旧率,因此在早期的折旧支出比晚期è¦å¤šã€‚"æŠ˜æ—§æˆæœ¬"æ˜¯å®žé™…çš„æˆæœ¬ å‡åŽ»æ®‹å€¼ã€‚"寿命"是指该资产折旧的周期数目(通常å•ä½ä¸ºå¹´)。 ((\x-\y)*(\z-\a+1)*2)/(\z*(\z+1)) Cost Coût Kosten Kostnad æˆæœ¬ Salvage value Restwaarde Slutvärde 残值 Life Vie Levensduur Livslängd Period Période Termijn Period 周期 Straight Line Depreciation Gelijkblijvende afschrijving Linjär avskrivning 直线折旧 r:sln Determines the straight line depreciation of an asset for a single period. Cost is the amount you paid for the asset. Salvage is the value of the asset at the end of the period. Life is the number of periods over which the asset is depreciated. SLN divides the cost evenly over the life of an asset. Calcule la dépréciation linéaire d'un actif pour une période. Le coût est le montant pour lequel vous avez payé pour l'actif. La valeur résiduelle est la valeur de l'actif à la fin de la période. La vie est le nombre de périodes pendant lesquelles l'actif est déprécié. Bepaalt de waardevermindering volgens een rechte lijn van een bezit gedurende een enkele termijn. Kosten is het voor het bezit betaalde bedrag. Restwaarde is de waarde van het bezit aan het einde van de termijn. Levensduur is het aantal termijnen waarover het bezit wordt afgeschreven. Door deze vorm van afschrijven worden de kosten gelijkelijk verdeeld over de gehele afschrijvingsduur. 定义一项资产在å•一周期内的直线折旧(SLN方法)。 "æˆæœ¬"是您购买此资产的花销。"残值"是此资产在周期 ç»“æŸæ—¶çš„价值。"寿命"是指该资产折旧的周期数目。SLN将资产的价值 凿‘Šåˆ°å®ƒçš„寿命上。 (\x-\y)/\z Cost Coût Kosten Kostnad æˆæœ¬ Salvage value Restwaarde Slutvärde 残值 Life Vie Levensduur Livslängd Present Value Valeur Actuelle Huidige waarde Nuvärde 现值 r:pv Returns the present value of an investment. If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. Retourne la valeur actuelle d'un investissement. Si type = 1 alors le paiement est fait au début de la période, si type = 0 (ou omis) il est fait à la fin de chaque période. Berekent de huidige waarde van een investering. Indien type = 1 is de uitbetaling aan het begin van de termijn, indien type = 0 (of weggelaten) aan het einde van elke termijn. 返回一项投资的现值。 "类型" 定义了到期日期。"1"代表在æ¯ä¸ªå‘¨æœŸçš„开头支付; "0"(缺çœå€¼)代表在æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚ (-\A{0}-\z*(1+\x*\B{0})*(((1+\x)^\y-1)/\x))/((1+\x)^\y) Interest rate Taux d'intérêt Rentepercentage Räntesats 利率 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 Payment made each period Versement effectué à chaque période Termijnbetaling Periodisk avbetalning æ¯æœŸæ”¯ä»˜ Future value Valeur future Toekomstige waarde Framtida värde 未æ¥å€¼ Type Type Typ 类型 Nominal Interest Rate Taux d'Intérêt Nominal Nominaal rentepercentage Nominell räntesats å义利率 r:nominal nominaal Calculates the nominal interest rate from a given effective interest rate compounded at given intervals. Calcule le taux d'intérêt nominal pour un taux d'intérêt effectif donné composé à des intervalles donnés. Berekent de nominale rente uit de effectieve rente betaald over het opgegeven tijdsinterval. Beräknar den nominella räntesatsen frÃ¥n en given effektiv ränta. æ ¹æ®åœ¨ç»™å®šæ—¶é—´æ®µå†…å¤åˆçš„给定有效利率计算å义利率。 \y*(abs((\x+1)^(1/\y))-1) Effective interest rate Taux d'intérêt effectif Effectief rentepercentage Effektiv räntesats 有效利率 Periods Périodes Termijnen Antal perioder 周期 Zero Coupon Zonder coupons Nollkupong é›¶æ¯ r:zero_coupon geen_coupon Calculates the value of a zero-coupon (pure discount) bond. Berekent de waarde van een obligatie zonder coupons. 计算零æ¯å€ºåˆ¸(纯贴现债券)的值。 \x/((1+\y)^\z) Face value Valeur nominale Nominale waarde Nominellt värde 票é¢ä»·å€¼ Interest rate Taux d'intérêt Rentepercentage Räntesats 利率 Years Années Jaren Antal Ã¥r å¹´ Treasury Bill Yield Opbrengst kortlopende overheidsobligatie zonder coupons Avkastningen för statsskuldväxel 短期债券收益 r:tbillyield Returns the yield for a treasury bill. Berekent de opbrengst van een kortlopende overheidsobligatie zonder coupons. 返回短期债券的收益。 (100-\z)/\z*(360/days(\x,\y,1,1)) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Price per $100 face value Prix pour 100 $ de valeur faciale Pris per 100 kr nominellt värde æ¯$100票é¢ä»·å€¼çš„ä»·æ ¼ Treasury Bill Price Prijs kortlopende overheidsobligatie zonder coupons Värde för statsskuldväxel 短期债券价格 r:tbillprice Returns the price per $100 value for a treasury bill. Retourne le prix pour 100 $ de valeur de bons du trésor. Berekent de prijs per € 100 voor een kortlopende overheidsobligatie zonder coupons. 返回一支短期债券æ¯100美元é¢å€¼çš„价格。 100*(1-(\z*days(\x,\y,1,1))/360) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Discount rate Taux d'actualisation Discontopercentage Diskonto 贴现率 Treasury Bill Equivalent Equivalent van kortlopende overheidsobligatie zonder coupons Statsskultväxelavkastning motsvarande obligation 短期债券等价物 r:tbilleq Returns the bond equivalent for a treasury bill. Berekent het obligatie-equivalent voor een kortlopende overheidsobligatie zonder coupons. 返回与一支短期债券等值的债券。 365*\z/(360-\z*days(\x,\y,1,1)) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Discount rate Taux d'actualisation Discontopercentage Diskonto 贴现率 Interest paid on a given period of an investment (ISPMT) Intérêt payé pour une période donnée d'un investissement Rente betaald over een gegeven investeringstermijn (ISPMT) Ränta betalad under specifik betalningsperiod (ISPMT) ç»™å®šæŠ•èµ„æœŸå†…è¦æ”¯ä»˜çš„利æ¯(ISPMT) r:ispmt Calculates the interest paid on a given period of an investment. Calcule l'intérêt d'un investissement payé sur une période donnée. Berekent de betaalde rente over de opgegeven investeringstermijn. Beräknar den betalda räntan för en viss period av en investering. 计算一项投资在给定周期内支付的利æ¯ã€‚ (-\a*\x)-((-\a*\x)/\z*\y) Periodic interest rate Periodiek rentepercentage Periodisk räntesats 周期利率 Amortizement period Période d'amortissement Amortisatieperiode Amorteringsperiod å¿è¿˜æœŸ 1 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 1 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Payment for a loan Versement pour un emprunt Betaling voor een lening Betalning för ett lÃ¥n 贷款å¿è¿˜ r:pmt Returns the amount of payment (negative) each period for a loan based on a constant interest rate and constant payments (each payment is equal amount). If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. Note that the interest rate here refers to the rate for each period and if you calculate with an annual rate, each period will be interpreted as a whole year. To get monthly payments divide the annual interest rate by 12 and enter the total number of months (12 times number of year) in the periods field. Returnerar storleken pÃ¥ betalningar (negativt) under varje period för ett lÃ¥n baserat pÃ¥ en fast räntesats och fasta betalningar (varje betalning är lika stor). Om typ = 1 sÃ¥ sker betalningen vid början av perioden, om typ = 2 görs betalningarna i slutet av varje period. Observera att räntan här syftar pÃ¥ räntan för varje period och om du anger Ã¥rsräntan tolkas varje period som ett helt Ã¥r. För att erhÃ¥lla mÃ¥natliga betalningar, dela Ã¥rsräntan med 12 och ange det totala antalet mÃ¥nader (12 gÃ¥nger antalet Ã¥r) i fältet för period. $name(2%/12, 10*12, 100000€) = -€920 (-\z*((1+\x)^\y)-\A{0})/((1+\x*\B{0})*(((1+\x)^\y-1)/\x)) Rate Räntesats 利率 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Future value Valeur future Toekomstige waarde Framtida värde 未æ¥å€¼ Type Type Typ 类型 Periods of an investment Termijnen van een investering Perioder för en investering 投资的期数 r:nper nterm Calculates number of periods of an investment based on periodic constant payments and a constant interest rate. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. Calcule le nombre de périodes d'un investissement reposant sur des paiements périodiques constants et un taux d'intérêt constant.. Le type définit l'échéance. 1 pour paiement en début de période et 0 (par défaut) pour paiement en fin de période. Berekent het aantal termijnen voor een investering op basis van periodiek gelijkblijvende betalingen en een gelijkblijvende rente. Type bepaalt de datum waarop moet worden betaald. 1 voor betalen aan het begin van een termijn en 0 (standaard) voor betalen aan het eind van een termijn. Beräknar anatalet perioder för investering baserad pÃ¥ periodiska, konstanta betalningar och konstant ränta. Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 (förvald) för betalning i slutet av perioden. 计算基于周期性固定支付和固定利率的投资的周期数目。 "类型" 定义了到期日期。"1"代表在æ¯ä¸ªå‘¨æœŸçš„开头支付;"0"(缺çœå€¼)代表在 æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚ ln((\y*(1+\x*\B{0})-\A{0}*\x)/(\z*\x+\y*(1+\x*\B)))/ln(1+\x) Interest rate Taux d'intérêt Rentepercentage Räntesats 利率 Payment made each period Versement effectué à chaque période Termijnbetaling Periodisk avbetalning æ¯æœŸæ”¯ä»˜ Present value Valeur actuelle Huidige waarde Nuvärde 现值 Future value Valeur future Toekomstige waarde Framtida värde 未æ¥å€¼ Type Type Typ 类型 Periods for investment to attain desired value Termijnen waarin een investering de gewenste waarde bereikt Perioder för investering att uppnÃ¥ önskat värde è¦èŽ·å¾—æƒ³è¦çš„值,需è¦çš„æŠ•资期数 r:g_duration g_duur Returns the number of periods needed for an investment to attain a desired value. Retourne le nombre de périodes nécessaires à un investissement pour atteindre un valeur désirée. Retourneert het aantal benodigde termijnen waarna een investering een gewenste waarde bereikt. Returnerar antalet perioder som krävs för en investering att uppnÃ¥ ett önskat värde. 返回一项投资è¦å¾—到想è¦çš„金é¢ï¼Œæ‰€éœ€è¦çš„æœŸæ•°ã€‚ ln(\z/\y)/ln(1+\x) Rate Räntesats 利率 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Future value Valeur future Toekomstige waarde Framtida värde 未æ¥å€¼ Payment of an annuity going towards principal (PPMT) Versements d'une rente orientée vers le capital Aflossingsdeel van een termijn van een annuïteit (PPMT) Betalning för livränta som gÃ¥r mot kapital (PPMT) 本金的年金支付é¢(PPMT) r:ppmt Calculates the amount of a payment of an annuity going towards principal. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. Calcule le montant des versements d'une rente orientée vers le capital. Le type définit la date de paiement. 1 pour des paiements en début de période et 0 (par défaut) pour des paiements en fin de période. Berekent het aflossingsdeel van een periodieke betaling voor een annuïteit. Type bepaalt de vervaldatum van de betaling. 1 voor betaling aanhet het begin van de termijn en 0 (standaard) voor betaling aan het einde van de termijn. Beräknar summan av en betalning pÃ¥ en livränta som gÃ¥r mot kapital. Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 (förvald) för betalning i slutet av perioden. 计算关于本金的年金支付é¢ã€‚ "类型" 定义了到期日期。"1"代表在æ¯ä¸ªå‘¨æœŸçš„开头支付; "0"(缺çœå€¼)代表在æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚ ((-\a*(pow(1+\x,\z))-\B{0})/((1+\x*\C{0})*((pow(1+\x,\z)-1)/\x)))+(\a*pow(1+\x,(\y-1))+((-\a*(pow(1+\x,\z))-\B)/((1+\x*\C)*((pow(1+\x,\z)-1)/\x)))*((pow(1+\x,(\y-1))-1)/\x))*\x Periodic interest rate Periodiek rentepercentage Periodisk räntesats 周期利率 Amortizement period Période d'amortissement Amortisatieperiode Amorteringsperiod å¿è¿˜æœŸ 1 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 1 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Desired future value Valeur future souhaitée Gewenste toekomstige waarde Önskat framtida värde 期望的未æ¥ä»·å€¼ Type Type Typ 类型 Effective Interest Rate Taux d'intérêt effectif Effectief rentepercentage Effektiv räntesats 有效利率 r:effect effet Calculates the effective interest for a given nominal rate. Calcule l'intérêt effectif pour un taux nominal donné. Berekent de effectieve rente bij een gegeven nominale rente. Beräknar den effektiva räntan frÃ¥n en given nominell räntesats. æ ¹æ®ç»™å®šçš„å义利率计算有效利æ¯ã€‚ (1+\x/\y)^\y-1 Nominal interest rate Taux d'intérêt nominal Nominaal rentepercentage Nominell räntesats å义利率 Periods Périodes Termijnen Antal perioder 周期 Future Value Valeur Future Toekomstige waarde Framtida värde 未æ¥å€¼ r:fv Computes the future value of an investment. This is based on periodic, constant payments and a constant interest rate. If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. Calcule la valeur future d'un investissement. Cela est basé sur des paiements constants périodiques et un taux d'intérêt constant. Si le type = 1 alors le paiement est effectué au début de chaque période; si le type = 0 (ou omis), il a lieu à la fin de chaque période. Berekent de waarde van een investering. Dit wordt gebaseerd op periodieke gelijkblijvende betalingen en een gelijkblijvende rente. Indien type = 1 wordt er betaald aanhet het begin van de termijn, als type = 0 (of weggelaten)wordt er betaald aan het einde van elke termijn. Beräknar anatalet perioder för investering baserad pÃ¥ periodiska, konstanta betalningar och konstant ränta. Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 (förvald) för betalning i slutet av perioden. 计算一项价值的未æ¥ä»·å€¼ã€‚这是根æ®å‘¨æœŸã€å›ºå®šæ”¯ä»˜å’Œå›ºå®šåˆ©çŽ‡è®¡ç®—å‡ºæ¥çš„。 "type"说明了到期日期。"1"代表在æ¯ä¸ªå‘¨æœŸçš„开头支付; "0"(缺çœå€¼)代表在æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚ -(\A{0}*((1+\x)^\y)+\z*(1+\x*\B{0})*(((1+\x)^\y-1)/\x)) Interest rate Taux d'intérêt Rentepercentage Räntesats 利率 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 Payment made each period Versement effectué à chaque période Termijnbetaling Periodisk avbetalning æ¯æœŸæ”¯ä»˜ Present value Valeur actuelle Huidige waarde Nuvärde 现值 Type Type Typ 类型 Return on continuously compounded interest Retour sur intérêt continûment composé Opbrengst van continu samengestelde rente Avkastning pÃ¥ fortlöpande sammansatt ränta æ ¹æ®è¿žç»­å¤åˆåˆ©çŽ‡çš„å›žæŠ¥ r:continuous continu Calculates the return on continuously compounded interest, given the principal, nominal rate and time in years. Calcule le retour sur intérêt composé continument, étant donnés le taux nominal principal et la durée en années. Berekent de opbrengst bij een continu samengestelde rente, gegeven de hoofdsom, nominale rente en de tijd in jaren. æ ¹æ®ç»™å®šçš„æœ¬é‡‘ã€å义利率和以年为å•ä½çš„æ—¶é—´ï¼Œè®¡ç®—连续å¤åˆåˆ©çŽ‡çš„å›žæŠ¥ã€‚ \x*exp(\y*\z) Principal Capital Hoofdsom 本金 Interest rate Taux d'intérêt Rentepercentage Räntesats 利率 Years Années Jaren Antal Ã¥r å¹´ Compound Composé Samengesteld Sammansatt å¤åˆå€¼ r:compound samenstellen Returns the value of an investment, given the principal, nominal interest rate, compounding frequency and time. Berekent de waarde van een investering, gegeven de hoofdsom, nominale rente, samenstellingsfrequentie en tijdsduur. æ ¹æ®ç»™å®šçš„æœ¬é‡‘ã€å义利率ã€å¤åˆé¢‘率和时间计算并返回投资的值。 \x*(1+\y/\z)^(\z*\a) Principal Capital Hoofdsom 本金 Nominal interest rate Taux d'intérêt nominal Nominaal rentepercentage Nominell räntesats å义利率 Periods per year Termijnen per jaar Perioder per Ã¥r æ¯å¹´çš„æœŸæ•° Years Années Jaren Antal Ã¥r å¹´ Payment of an annuity going towards interest (IPMT) Versements d'une rente orientée vers les intérêts Interestdeel van een termijn van een annuïteit (IPMT) Betalning för livränta som gÃ¥r mot ränta (IPMT) 利æ¯çš„年金支付é¢(IPMT) r:ipmt Calculates the amount of a payment of an annuity going towards interest. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. Calcule le montant des versements d'une rente orientée vers les intérêts. Le type définit la date de paiement. 1 pour des paiements en début de période et 0 (par défaut) pour des paiements en fin de période. Berekent het interestdeel van een periodieke betaling voor een annuïteit. Type bepaalt de vervaldatum van de betaling. 1 voor betaling aanhet het begin van de termijn en 0 (standaard) voor betaling aan het einde van de termijn. Beräknar summan av en betalning pÃ¥ en livränta som gÃ¥r mot ränta. Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 (förvald) för betalning i slutet av perioden. è®¡ç®—å…³äºŽæœ¬é‡‘çš„å¹´é‡‘åˆ©æ¯æ”¯ä»˜é¢. "类型" 定义了到期日期。"1"代表在æ¯ä¸ªå‘¨æœŸçš„开头支付; "0"(缺çœå€¼)代表在æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚ -(\a*pow(1+\x,(\y-1))+((-\a*(pow(1+\x,\z))-\B)/((1+\x*\C)*((pow(1+\x,\z)-1)/\x)))*((pow(1+\x,(\y-1))-1)/\x))*\x Periodic interest rate Periodiek rentepercentage Periodisk räntesats 周期利率 Period Période Termijn Period 周期 1 Number of periods Nombre de périodes Aantal termijnen Antal perioder 期数 1 Present value Valeur actuelle Huidige waarde Nuvärde 现值 Future value Valeur future Toekomstige waarde Framtida värde 未æ¥å€¼ Type Type Typ 类型 Interest rate for a fully invested security Taux d'intérêt d'une obligation entièrement investie Interestpercentage voor een waardepapier waarvan de hoofdsom aan het einde vrijvalt Räntesats för betalt värdepapper 一项已充分投资è¯åˆ¸çš„利率 r:intrate renteperc Returns the interest rate for a fully invested security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Retourne le taux d'intérêt pour une obligation entièrement investie. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360.La date de contrat doit être antérieure à l'échéance. Berekent het rentepercentage voor een volledig geïnvesteerd waardepapier. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. 返回一支已充分投资的è¯åˆ¸çš„利率。 "基准"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。 (\a-\z)/\z/yearfrac(\x,\y,\B{0},1) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Investment Investissement Investering Investering 投资 Redemption Amortissement Aflossing Utlösande summa å¿è¿˜ Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Dollar Fraction Fraction en dollars Dollar fractie Kronor till brÃ¥ktal 美元分数 r:dollarfr Converts a decimal dollar price into a dollar price expressed as a fraction. Convertit un prix en dollars décimaux en un prix en dollars sous forme de fraction. Converteert een prijs in decimale dollars naar een prijs in dollars uitgedrukt als een breuk. å°†ç”¨å°æ•°è¡¨ç¤ºçš„美元价格转化为用分数表示的价格。 int(\x)+frac(\x)*\y/10^ceil(log(\y)) Decimal dollar Dollar décimal Decimale dollar BrÃ¥ktal till kronor å°æ•°è¡¨ç¤ºçš„美元 Denominator of fraction Dénominateur d'une fraction Noemer van breuk BrÃ¥ktalets nämnare åˆ†æ•°çš„åˆ†æ¯ 1 Dollar Decimal Dollar décimal Dollar decimaal Decimaltal ç¾Žå…ƒå°æ•° r:dollarde Converts a dollar price expressed as a fraction into a dollar price expressed as a decimal number. Convertit en prix en dollars sous forme de fraction en un prix en dollars décimaux. Converteert een prijs in dollars uitgedrukt als een breuk naar een prijs uitgedrukt in een decimaal getal. å°†ç”¨åˆ†æ•°è¡¨ç¤ºçš„ç¾Žå…ƒä»·æ ¼è½¬åŒ–ä¸ºç”¨å°æ•°è¡¨ç¤ºçš„价格。 int(\x)+frac(\x)*10^ceil(log(\y))/\y Fractional dollar Dollar fractionnaire Dollar als breuk BrÃ¥ktal 分数表示的美元 Denominator of fraction Dénominateur d'une fraction Noemer van breuk BrÃ¥ktalets nämnare åˆ†æ•°çš„åˆ†æ¯ 1 Amount received at maturity for a security bond Montant reçu à maturité par un bon de sécurité Ontvangen bedrag voor een waardepapier op vervaldatum ErhÃ¥llet belopp för en säkerhet vid mognad å€ºåˆ¸åˆ°æœŸæ—¶èŽ·å¾—çš„é‡‘é¢ r:received ontvangen Returns the amount received at the maturity date for an invested security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. The settlement date must be before maturity date. Retourne le montant reçu à échéance pour un investissement en obligation. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360.La date de contrat doit être antérieure à l'échéance. Berekent het te ontvangen bedrag na de afloopdatum van een investeringswaardepapier. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. De afwikkeling moet plaats vinden voor de afloopdatum. 返回一支è¯åˆ¸åˆ°æœŸæ—¶å¯å¾—到的金é¢ã€‚ "基准"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。 \z/(1-\a*yearfrac(\x,\y,\B{0},1)) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Investment Investissement Investering Investering 投资 Discount rate Taux d'actualisation Discontopercentage Diskonto 贴现率 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Discount rate for a security Taux d'actualisation d'une obligation Discontopercentage voor een waardepapier Reduceringshastighet för säkerhet è¯åˆ¸çš„贴现率 r:disc kort Returns the discount rate for a security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Berekent het rentepercentage voor een waardepapier. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. 返回一支è¯åˆ¸çš„贴现率。 "基准"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。 (\a-\z)/\a/yearfrac(\x,\y,\B{0},1)) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Price per $100 face value Prix pour 100 $ de valeur faciale Pris per 100 kr nominellt värde æ¯$100票é¢ä»·å€¼çš„ä»·æ ¼ Redemption Amortissement Aflossing Utlösande summa å¿è¿˜ Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Accrued interest of security paying at maturity Totale rente van waardepapier op vervaldatum Ränta för en säkerhet frÃ¥n start till mognad 到期时支付的è¯åˆ¸åº”è®¡åˆ©æ¯ r:accrintm Returns the accrued interest for a security which pays interest at maturity date. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Retourne les intérêts cumulés d'une obligation dont le versement à lieu à échéance. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360. Berekent de aangegroeide rente voor een waardepapier waarvan de rente wordt uitgekeerd na de afloopdatum. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. 返回一个在到期时支付利æ¯çš„è¯åˆ¸çš„应计利æ¯ã€‚ "基准"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。 \A{1000}*\z*yearfrac(\x,\y,\B{0},1) Issue date Date de fin Uitgiftedatum Startdatum å‘表日期 Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Annual rate of security Taux de sécurité annuel Jaarlijkse rente van waardepapier Ã…rlig hastighet è¯åˆ¸å¹´åˆ©çއ Par value Montant nominal Nominale waarde Nominellt värde é¢å€¼ Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Accrued interest of security with periodic interest payments Totale rente van waardepapier met periodieke renteuitkeringen Ränta för en säkerhet med periodisk ränta 分期支付的è¯åˆ¸åº”è®¡åˆ©æ¯ r:accrint Returns accrued interest for a security which pays periodic interest. Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Retourne les intérêts cumulés pour une obligation dont les versements sont périodiques. Les fréquences autorisées sont 1 - annuelle, 2 - semestrielle ou 4 - trimestrielle. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360. Berekent de aangegroeide rente voor een waardepapier met een periodieke rente-uitkering. Mogelijke frequenties zijn 1 - jaarlijks, 2 - halfjaarlijks of 4 - per kwartaal. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. 返回一个定期支付利æ¯çš„è¯åˆ¸çš„应计利æ¯ã€‚ å…许的支付频率为:1 - 年付, 2 - åŠå¹´ä»˜ 或 4 - 季付。 "基准"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。 \b*\a/\c*\c*yearfrac(\x,\z,\D{0},1)+\y*0 Issue date Date de fin Uitgiftedatum Startdatum å‘表日期 First interest Premier intérêt Eerste rente Första ränteinbetalning ç¬¬ä¸€ç¬”åˆ©æ¯ Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Annual rate of security Taux de sécurité annuel Jaarlijkse rente van waardepapier Ã…rlig hastighet è¯åˆ¸å¹´åˆ©çއ Par value Montant nominal Nominale waarde Nominellt värde é¢å€¼ Frequency Fréquence Frequentie Frekvens 频率 1 4 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Number of coupons to be paid Nombre de coupons à payer Aantal te betalen coupons Antal förfallande kuponger è¦æ”¯ä»˜çš„æ¯ç¥¨æ•°é‡ r:coupnum Returns the number of coupons to be paid between the settlement and the maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Retourne le nombre de coupons à payer entre la date de transaction et l'échéance. La base est les manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360.La date de contrat doit être antérieure à l'échéance. berekent het aantal te betalen coupons tussen afwikkeling en de afloopdatum. Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. è¿”å›žåœ¨ç»“ç®—æ—¥å’Œåˆ°æœŸæ—¥æœŸä¹‹é—´è¦æ”¯ä»˜çš„æœŸç¥¨æ•°é‡ã€‚ "基准"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。 trunc(yearfrac(\x,\y,\A{0},1)*\z) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Frequency Fréquence Frequentie Frekvens 频率 1 12 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Price per $100 face value of a discounted security Pris per 100 kr nominellt värde för diskonterat värdepapper r:pricedisc prijskorting Calculates and returns the price per $100 face value of a discounted security. The security does not pay interest at maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Beräknar och returnerar priset per 100 kr värde av en diskonterad säkerhet. Säkerheten betalar inte ränta vid mognad. Dagsräkningssystem kan vara: 0: Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360 \a-\z*\a*yearfrac(\x,\y,\B{0},1) Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Discount Escompte Korting Diskonto 贴现 Redemption Amortissement Aflossing Utlösande summa å¿è¿˜ Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Price per $100 face value of a security Prix pour 100 $ de valeur faciale d'une obligation Pris per 100 kr nominellt värde för säkerhet 一支è¯åˆ¸æ¯$100票é¢ä»·å€¼çš„ä»·æ ¼ r:pricemat prijsmat Calculates and returns the price per $100 face value of a security. The security pays interest at maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. Calcule et retourne le prix par obligation de 100$ de valeur faciale. L'obligation paie des intérêts à maturité. La base est la manière de compter les jours que vous souhaitez utiliser : 0: US 30/360 (par défaut), 1: jours réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360. Beräknar och returnerar priset per $100 värde av en säkerhet. Säkerheten betalar ränta vid mognad. Dagsräkningssystem kan vara: 0: Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360 计算并返回一个债券æ¯100美元票é¢ä»·å€¼çš„价格。此债券在到期时支付利æ¯ã€‚ "基准"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。 (100+yearfrac(\z,\y,\C{0},1)*\a*100)/(1+yearfrac(\x,\y,\C,1)*\b)-yearfrac(\z,\x,\C,1)*\a*100 Settlement date Afwikkeldatum Avräkningsdatum 结算日期 Maturity date Échéance Vervaldatum Mognadsdatum 到期日期 Issue date Date de fin Uitgiftedatum Startdatum å‘表日期 Discount rate Taux d'actualisation Discontopercentage Diskonto 贴现率 Annual yield Revenu annuel Opbrengst per jaar Ã…rlig avkastning 年收益 Day counting basis Base de comptage des jours Basis dagtelling Dagsräkningssystem 天数计算基准 0 4 Level-Coupon Bond Obligatie met gelijkblijvende coupons Jämn kupongobligation æ¯ç¥¨å€ºåˆ¸ r:level_coupon gelijke_coupon r:level_coupon Calculates the value of a level-coupon bond. Berekent de waarde van een obligatie met gelijkblijvende coupons. 计算æ¯ç¥¨å€ºåˆ¸çš„值。 (\y*\x/\z)*((1-1/(((1+(\b/\z))^(\a*\z))))/(\b/\z))+(\x/((1+(\b/\z))^(\a*\z))) Face value Valeur nominale Nominale waarde Nominellt värde 票é¢ä»·å€¼ Coupon rate Taux du coupon Couponrente Kupongränta æ¯ç¥¨åˆ©çއ Coupons per year Coupons par an Aantal coupons per jaar Antal kuponger per Ã¥r æ¯ç¥¨æ•°æ¯å¹´ Years Années Jaren Antal Ã¥r å¹´ Market interest rate Taux d'intérêt du marché Marktrente Marknadsränta 市场利率 libqalculate-2.8.2/data/datasets.xml0000644000175000017500000003151413374225247014366 00000000000000 Data Sets Ensembles de Données Gegevensverzamelingen Dataset æ•°æ®é›† !datasets!Elements Elementen Grundämnen 元素 elements.xml r:atom r:atome atoom !datasets!Element Element 元素 Symbol Symbole Symbool Symbol ç¬¦å· text true r:symbol r:symbole symbool !datasets!Number Nombre Getal Nummer ç¼–å· number true !datasets!r:number r:nombre getal nummer ç¼–å· Name Nom Naam Namn åç§° text true r:name r:nom naam namn Classification Klassificatie Klassificering 分类 A number representing an element group: 1 Alkali Metal 2 Alkaline-Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 Metal 7 Metalloid 8 Polyatomic Non-Metal 9 Diatomic Non-Metal 10 Noble Gas 11 Unknown chemical properties Ett nummer som representerar en elementgrupp: 1 Alkalimetall 2 Jordalkalimetall 3 Lantanid 4 Aktinid 5 ÖvergÃ¥ngsmetall 6 Metall 7 Halvmetall 8 Polyatomisk icke-metall 9 Diatomisk icke-metall 10 Ädelgas 11 Okända kemiska egenskaper number r:class r:classe klasse klass Weight Poids Gewicht Vikt é‡é‡ number true AMU true r:weight,mass r:poids,masse gewicht,massa vikt,massa Boiling Point Kookpunt Kokpunkt 沸点 number K true r:boiling kokend kokpunkt Melting Point Smeltpunt Smältpunkt 熔点 number K true r:melting smeltend smältpunkt Density Densité Dichtheid Densitet 密度 Density at 295K Dichtheid bij 295K Densitet vid 295K 295K时的密度 number g/cm^3 true r:density r:densité dichtheid densitet X Position Position en X X Positie Xåæ ‡ number true r:x_pos Y Position Position en Y Y Positie Yåæ ‡ number true r:y_pos Planets Planètes Planeten Planeter 行星 planets.xml This data uses material from the Wikipedia articles "Earth" (http://www.wikipedia.org/wiki/Earth), "Jupiter (planet)" (http://www.wikipedia.org/wiki/Jupiter_(planet)), "Mars (planet)" (http://www.wikipedia.org/wiki/Mars_(planet)), "Mercury (planet)" (http://www.wikipedia.org/wiki/Mercury_(planet)), "Neptune (planet)" (http://www.wikipedia.org/wiki/Neptune_(planet)), "Pluto (planet)" (http://www.wikipedia.org/wiki/Pluto_(planet)), "Saturn (planet)" (http://www.wikipedia.org/wiki/Saturn_(planet)), "Uranus (planet)" (http://www.wikipedia.org/wiki/Uranus_(planet)), and "Venus (planet)" (http://en.wikipedia.org/wiki/Venus_(planet)), licensed under the GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html) r:planet r:planète planeet Planet Planète Planeet 行星 Name Nom Naam Namn åç§° text true r:name r:nom naam namn Orbital Period (Year) Période Orbitale (Année) Omloopperiode (Jaar) Omkretstid (Ã¥r) 轨é“周期(å¹´) number d true !datasets!r:year r:année jaar Ã¥r å¹´ Average Orbital Speed Vitesse Orbitale Moyenne Gemiddelde baansnelheid Genomsnittlig kretsloppshastighet å¹³å‡å½’到速度 number km/s true r:speed r:vitesse snelheid hastighet Eccentricity Excentricité Excentriciteit Excentricitet å心率 number true r:eccentricity r:excentricité excentriciteit excentricitet Inclination Inclinaison Inclinatie Inklination 倾角 number true r:inclination r:inclinaison inclinatie inklination Number of Satellites Nombre de Satellites Aantal satellieten Antal satelliter 嫿˜Ÿä¸ªæ•° number r:satellites satellieten satelliter !datasets!Mass Masse Massa Massa è´¨é‡ number kg true r:mass r:masse massa massa Mean Density Densité Moyenne Gemiddelde dichtheid Genomsnittlig densitet å¹³å‡å¯†åº¦ number g/cm^3 true r:density r:densité dichtheid densitet Surface Area Aire Oppervlak (3D) Ytarea 表é¢ç§¯ number km^2 true !datasets!r:area r:aire oppervlak é¢ç§¯ Equatorial Gravity Gravité Équatoriale Equatoriale zwaartekracht Ekvatoriell tyngdkraft 赤é“é‡åŠ› number m/s^2 true r:gravity r:gravité zwaartekracht tyngdkraft Mean Surface Temperature Température Moyenne de Surface Gemiddelde oppervlaktetemperatuur Genomsnittlig yttemperatur å¹³å‡è¡¨é¢æ¸©åº¦ number K true r:temperature r:température temperatuur temperatur libqalculate-2.8.2/data/rates.json0000644000175000017500000002453613306531354014045 00000000000000[{"currency_code":"AED","rate":3.6727,"code":"AE","name":"United Arab Emirates"},{"currency_code":"AFN","rate":69.9997,"code":"AF","name":"Afghanistan"},{"currency_code":"ALL","rate":106.75,"code":"AL","name":"Albania"},{"currency_code":"AMD","rate":482.82,"code":"AM","name":"Armenia"},{"currency_code":"ANG","rate":1.77996,"code":"AW","name":"Aruba"},{"currency_code":"AOA","rate":225.576,"code":"AO","name":"Angola"},{"currency_code":"ARS","rate":20.513,"code":"AR","name":"Argentina"},{"currency_code":"AUD","rate":1.33597,"code":"AU","name":"Australian"},{"currency_code":"AZN","rate":1.6995,"code":"AZ","name":"Azerbaijan"},{"currency_code":"BAM","rate":1.6332,"code":"BA","name":"Bosnia and Herzegovina"},{"currency_code":"BBD","rate":2,"code":"BB","name":"Barbados"},{"currency_code":"BDT","rate":84.19,"code":"BD","name":"Bangladesh"},{"currency_code":"BGN","rate":1.6192,"code":"BG","name":"Bulgaria"},{"currency_code":"BHD","rate":0.376899,"code":"BH","name":"Bahrain"},{"currency_code":"BIF","rate":1750.98,"code":"BI","name":"Burundi"},{"currency_code":"BMD","rate":1,"code":"BM","name":"Bermuda"},{"currency_code":"BND","rate":1.2931,"code":"BN","name":"Brunei Darussalam"},{"currency_code":"BOB","rate":6.85976,"code":"BO","name":"Bolivia"},{"currency_code":"BRL","rate":3.5063,"code":"BR","name":"Brazil"},{"currency_code":"BSD","rate":1,"code":"BS","name":"Bahamas"},{"currency_code":"BWP","rate":9.7702,"code":"BW","name":"Botswana"},{"currency_code":"BYR","rate":19600,"code":"BY","name":"Belarus"},{"currency_code":"BZD","rate":1.9978,"code":"BZ","name":"Belize"},{"currency_code":"CAD","rate":1.28523,"code":"CA","name":"Canada"},{"currency_code":"CDF","rate":1565.5,"code":"CD","name":"Congo (Kinshasa)"},{"currency_code":"CHF","rate":0.996202,"code":"LI","name":"Liechtenstein"},{"currency_code":"CLP","rate":614.63,"code":"CL","name":"Chile"},{"currency_code":"CNY","rate":6.3325,"code":"CN","name":"China"},{"currency_code":"COP","rate":2799.4,"code":"CO","name":"Colombia"},{"currency_code":"CRC","rate":561.75,"code":"CR","name":"Costa Rica"},{"currency_code":"CUP","rate":26.5,"code":"CU","name":"Cuba"},{"currency_code":"CVE","rate":91.95,"code":"CV","name":"Cape Verde"},{"currency_code":"CZK","rate":21.4058,"code":"CZ","name":"Czech Republic"},{"currency_code":"DJF","rate":176.83,"code":"DJ","name":"Djibouti"},{"currency_code":"DKK","rate":6.21198,"code":"DK","name":"Denmark"},{"currency_code":"DOP","rate":49.49,"code":"DO","name":"Dominican Republic"},{"currency_code":"DZD","rate":114.945,"code":"DZ","name":"Algeria"},{"currency_code":"EEK","rate":13.947,"code":"EE","name":"Estonia"},{"currency_code":"EGP","rate":17.63,"code":"EG","name":"Egypt"},{"currency_code":"ETB","rate":27.22,"code":"ER","name":"Eritrea"},{"currency_code":"EUR","rate":0.833599,"code":"AS","name":"American Samoa"},{"currency_code":"FJD","rate":2.05499,"code":"FJ","name":"Fiji"},{"currency_code":"FKP","rate":0.734096,"code":"FK","name":"Falkland Islands (Malvinas)"},{"currency_code":"GBP","rate":0.73486,"code":"GS","name":"South Georgia and the South Sandwich Islands"},{"currency_code":"GEL","rate":2.4452,"code":"GE","name":"Georgia"},{"currency_code":"GGP","rate":0.734893,"code":"GG","name":"Guernsey"},{"currency_code":"GHS","rate":4.4935,"code":"GH","name":"Ghana"},{"currency_code":"GIP","rate":0.734401,"code":"GI","name":"Gibraltar"},{"currency_code":"GMD","rate":46.85,"code":"GM","name":"Gambia"},{"currency_code":"GNF","rate":9002,"code":"GN","name":"Guinea"},{"currency_code":"GTQ","rate":7.33601,"code":"GT","name":"Guatemala"},{"currency_code":"GYD","rate":205.39,"code":"GY","name":"Guyana"},{"currency_code":"HKD","rate":7.8493,"code":"HK","name":"Hong Kong"},{"currency_code":"HNL","rate":23.568,"code":"HN","name":"Honduras"},{"currency_code":"HRK","rate":6.1752,"code":"HR","name":"Croatia (Hrvatska)"},{"currency_code":"HTG","rate":63.86,"code":"HT","name":"Haiti"},{"currency_code":"HUF","rate":261.67,"code":"HU","name":"Hungary"},{"currency_code":"IDR","rate":13925,"code":"TP","name":"East Timor"},{"currency_code":"ILS","rate":3.60619,"code":"IL","name":"Israel"},{"currency_code":"INR","rate":66.84,"code":"BT","name":"Bhutan"},{"currency_code":"IQD","rate":1184,"code":"IQ","name":"Iraq"},{"currency_code":"IRR","rate":42000,"code":"IR","name":"Iran (Islamic Republic of)"},{"currency_code":"ISK","rate":101.7,"code":"IS","name":"Iceland"},{"currency_code":"JMD","rate":123.44,"code":"JM","name":"Jamaica"},{"currency_code":"JOD","rate":0.708501,"code":"JO","name":"Jordan"},{"currency_code":"JPY","rate":109.8,"code":"JP","name":"Japan"},{"currency_code":"KES","rate":100.35,"code":"KE","name":"Kenya"},{"currency_code":"KGS","rate":68.7826,"code":"KG","name":"Kyrgyzstan"},{"currency_code":"KHR","rate":4007.7,"code":"KH","name":"Cambodia"},{"currency_code":"KMF","rate":407.93,"code":"KM","name":"Comoros"},{"currency_code":"KPW","rate":900,"code":"KP","name":"Korea North"},{"currency_code":"KRW","rate":1073.45,"code":"KR","name":"Korea South"},{"currency_code":"KWD","rate":0.30115,"code":"KW","name":"Kuwait"},{"currency_code":"KYD","rate":0.81998,"code":"KY","name":"Cayman Islands"},{"currency_code":"KZT","rate":327.36,"code":"KZ","name":"Kazakhstan"},{"currency_code":"LAK","rate":8297,"code":"LA","name":"Laos"},{"currency_code":"LBP","rate":1505,"code":"LB","name":"Lebanon"},{"currency_code":"LKR","rate":157.87,"code":"LK","name":"Sri Lanka"},{"currency_code":"LRD","rate":131.74,"code":"LR","name":"Liberia"},{"currency_code":"LSL","rate":12.6202,"code":"LS","name":"Lesotho"},{"currency_code":"LTL","rate":3.0487,"code":"LT","name":"Lithuania"},{"currency_code":"LVL","rate":0.62055,"code":"LV","name":"Latvia"},{"currency_code":"LYD","rate":1.3388,"code":"LY","name":"Libyan Arab Jamahiriya"},{"currency_code":"MAD","rate":9.3306,"code":"MA","name":"Morocco"},{"currency_code":"MDL","rate":16.509,"code":"MD","name":"Moldova Republic of"},{"currency_code":"MGA","rate":3195,"code":"MG","name":"Madagascar"},{"currency_code":"MKD","rate":51.06,"code":"MK","name":"Macedonia"},{"currency_code":"MMK","rate":1329,"code":"MM","name":"Myanmar"},{"currency_code":"MNT","rate":2394,"code":"MN","name":"Mongolia"},{"currency_code":"MOP","rate":8.0844,"code":"MO","name":"Macao S.A.R."},{"currency_code":"MRO","rate":353,"code":"MR","name":"Mauritania"},{"currency_code":"MUR","rate":33.9996,"code":"MU","name":"Mauritius"},{"currency_code":"MVR","rate":15.5696,"code":"MV","name":"Maldives"},{"currency_code":"MWK","rate":713.45,"code":"MW","name":"Malawi"},{"currency_code":"MXN","rate":18.9386,"code":"MX","name":"Mexico"},{"currency_code":"MYR","rate":3.92502,"code":"MY","name":"Malaysia"},{"currency_code":"MZN","rate":58.9,"code":"MZ","name":"Mozambique"},{"currency_code":"NAD","rate":12.659,"code":"NA","name":"Namibia"},{"currency_code":"NGN","rate":359,"code":"NG","name":"Nigeria"},{"currency_code":"NIO","rate":30.9998,"code":"NI","name":"Nicaragua"},{"currency_code":"NOK","rate":8.0865,"code":"BV","name":"Bouvet Island"},{"currency_code":"NPR","rate":106.553,"code":"NP","name":"Nepal"},{"currency_code":"NZD","rate":1.4277,"code":"NZ","name":"New Zealand"},{"currency_code":"OMR","rate":0.384799,"code":"OM","name":"Oman"},{"currency_code":"PAB","rate":1,"code":"PA","name":"Panama"},{"currency_code":"PEN","rate":3.2487,"code":"PE","name":"Peru"},{"currency_code":"PGK","rate":3.2797,"code":"PG","name":"Papua New Guinea"},{"currency_code":"PHP","rate":51.8204,"code":"PH","name":"Philippines"},{"currency_code":"PKR","rate":115.49,"code":"PK","name":"Pakistan"},{"currency_code":"PLN","rate":3.5659,"code":"PL","name":"Poland"},{"currency_code":"PYG","rate":5529,"code":"PY","name":"Paraguay"},{"currency_code":"QAR","rate":3.6398,"code":"QA","name":"Qatar"},{"currency_code":"RON","rate":3.8894,"code":"RO","name":"Romania"},{"currency_code":"RSD","rate":97.1313,"code":"RS","name":"Serbia"},{"currency_code":"RUB","rate":63.5295,"code":"RU","name":"Russian Federation"},{"currency_code":"RWF","rate":846.41,"code":"RW","name":"Rwanda"},{"currency_code":"SAR","rate":3.74999,"code":"SA","name":"Saudi Arabia"},{"currency_code":"SBD","rate":7.7917,"code":"SB","name":"Solomon Islands"},{"currency_code":"SCR","rate":13.4299,"code":"SC","name":"Seychelles"},{"currency_code":"SDG","rate":18.0502,"code":"SD","name":"Sudan"},{"currency_code":"SEK","rate":8.84367,"code":"SE","name":"Sweden"},{"currency_code":"SGD","rate":1.33384,"code":"SG","name":"Singapore"},{"currency_code":"SLL","rate":7820,"code":"SL","name":"Sierra Leone"},{"currency_code":"SOS","rate":563,"code":"SO","name":"Somalia"},{"currency_code":"SRD","rate":7.4198,"code":"SR","name":"Suriname"},{"currency_code":"STD","rate":20431.9,"code":"ST","name":"Sao Tome and Principe"},{"currency_code":"SVC","rate":8.7496,"code":"SV","name":"El Salvador"},{"currency_code":"SYP","rate":514.98,"code":"SY","name":"Syrian Arab Republic"},{"currency_code":"SZL","rate":12.6652,"code":"SZ","name":"Swaziland"},{"currency_code":"THB","rate":31.7,"code":"TH","name":"Thailand"},{"currency_code":"TJS","rate":8.9005,"code":"TJ","name":"Tajikistan"},{"currency_code":"TMT","rate":3.41,"code":"TM","name":"Turkmenistan"},{"currency_code":"TND","rate":2.5011,"code":"TN","name":"Tunisia"},{"currency_code":"TOP","rate":2.2816,"code":"TO","name":"Tonga"},{"currency_code":"TRY","rate":4.1035,"code":"TR","name":"Turkey"},{"currency_code":"TTD","rate":6.6495,"code":"TT","name":"Trinidad and Tobago"},{"currency_code":"TWD","rate":29.679,"code":"TW","name":"Taiwan"},{"currency_code":"TZS","rate":2276,"code":"TZ","name":"Tanzania"},{"currency_code":"UAH","rate":26.21,"code":"UA","name":"Ukraine"},{"currency_code":"UGX","rate":3709,"code":"UG","name":"Uganda"},{"currency_code":"USD","rate":1,"code":"IO","name":"British Indian Ocean Territory"},{"currency_code":"UYU","rate":28.5703,"code":"UY","name":"Uruguay"},{"currency_code":"UZS","rate":8048,"code":"UZ","name":"Uzbekistan"},{"currency_code":"VEF","rate":68827,"code":"VE","name":"Venezuela"},{"currency_code":"VND","rate":22762,"code":"VN","name":"Vietnam"},{"currency_code":"VUV","rate":109.4,"code":"VU","name":"Vanuatu"},{"currency_code":"XAF","rate":546.499,"code":"CM","name":"Cameroon"},{"currency_code":"XCD","rate":2.70355,"code":"AI","name":"Anguilla"},{"currency_code":"XOF","rate":546.498,"code":"BJ","name":"Benin"},{"currency_code":"XPF","rate":99.506,"code":"PF","name":"French Polynesia"},{"currency_code":"YER","rate":249.9,"code":"YE","name":"Yemen"},{"currency_code":"ZAR","rate":12.6681,"code":"ZA","name":"South Africa"},{"currency_code":"ZMK","rate":9001.21,"code":"ZM","name":"Zambia"}]libqalculate-2.8.2/data/prefixes.xml.in0000644000175000017500000000634412705146643015012 00000000000000 yocto y -24 zepto z -21 atto a -18 femto f -15 pico p -12 nano n -9 micro u µ -6 milli m -3 centi c -2 deci d -1 deka da 1 hecto h 2 kilo k 3 mega M 6 giga G 9 tera T 12 peta P 15 exa E 18 zetta Z 21 yotta Y 24 kibi Ki 10 mebi Mi 20 gibi Gi 30 tebi Ti 40 pebi Pi 50 exbi Ei 60 libqalculate-2.8.2/data/Makefile.in0000644000175000017500000004021013401033103014045 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # data/Makefile.am for qalculate # VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = data ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(xmldir)" DATA = $(xml_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEST = @QALCULATE_TEST@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ xmldir = $(datadir)/qalculate xml_in_files = currencies.xml.in datasets.xml.in elements.xml.in functions.xml.in planets.xml.in prefixes.xml.in units.xml.in variables.xml.in xml_DATA = $(xml_in_files:.xml.in=.xml) eurofxref-daily.xml rates.json EXTRA_DIST = \ $(xml_in_files) $(xml_DATA) eurofxref-daily.xml rates.json all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-xmlDATA: $(xml_DATA) @$(NORMAL_INSTALL) @list='$(xml_DATA)'; test -n "$(xmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(xmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(xmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(xmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(xmldir)" || exit $$?; \ done uninstall-xmlDATA: @$(NORMAL_UNINSTALL) @list='$(xml_DATA)'; test -n "$(xmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(xmldir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(xmldir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-xmlDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-xmlDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-xmlDATA installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-xmlDATA .PRECIOUS: Makefile @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libqalculate-2.8.2/data/planets.xml.in0000644000175000017500000000750312705146643014631 00000000000000 <_name>Earth 365.25696 29.7859 0.01671022 0.00005 1 5.9737E24 5.515 510.0657E6 9.766 287 <_name>Mars 686.9601 24.1309 0.09341233 1.85061 2 6.4191E23 3.94 1.44E8 3.71 210 <_name>!planets!Mercury 87.96935 47.8725 0.20563069 7.00487 0 3.302E23 5.43 7.5E7 3.70 440 <_name>Venus 224.70096 35.0214 0.00677323 3.39471 0 4.869E24 5.24 4.60E8 8.87 737 <_name>Jupiter 4335.3545 13.0697 0.04839266 1.30530 63 1.899E27 1.33 6.41E10 23.12 152 <_name>Saturn 10757.7365 9.6724 0.05415060 2.48446 33 5.688E26 0.69 4.38E10 8.96 143 <_name>Neptune 60224.9036 5.4778 0.00858587 1.76917 13 1.024E26 1.64 7.65E9 11.0 53 <_name>Pluto 90613.3058 4.7490 0.24880766 17.14175 1 1.290E22 2.05 1.7E7 0.6 44 <_name>Uranus 30708.1600 6.8352 0.04716771 0.76986 27 8.686E25 1.29 8.13E9 8.69 68 libqalculate-2.8.2/data/planets.xml0000644000175000017500000001013513374225247014220 00000000000000 Earth Terre Aarde Jorden åœ°çƒ 365.25696 29.7859 0.01671022 0.00005 1 5.9737E24 5.515 510.0657E6 9.766 287 Mars ç«æ˜Ÿ 686.9601 24.1309 0.09341233 1.85061 2 6.4191E23 3.94 1.44E8 3.71 210 !planets!Mercury Mercure Mercurius Merkurius 水星 87.96935 47.8725 0.20563069 7.00487 0 3.302E23 5.43 7.5E7 3.70 440 Venus Vénus 金星 224.70096 35.0214 0.00677323 3.39471 0 4.869E24 5.24 4.60E8 8.87 737 Jupiter 木星 4335.3545 13.0697 0.04839266 1.30530 63 1.899E27 1.33 6.41E10 23.12 152 Saturn Saturne Saturnus Saturnus 土星 10757.7365 9.6724 0.05415060 2.48446 33 5.688E26 0.69 4.38E10 8.96 143 Neptune Neptunus Neptunus 海王星 60224.9036 5.4778 0.00858587 1.76917 13 1.024E26 1.64 7.65E9 11.0 53 Pluto Pluton 冥王星 90613.3058 4.7490 0.24880766 17.14175 1 1.290E22 2.05 1.7E7 0.6 44 Uranus 天王星 30708.1600 6.8352 0.04716771 0.76986 27 8.686E25 1.29 8.13E9 8.69 68 libqalculate-2.8.2/data/elements.xml0000644000175000017500000011051013374225247014364 00000000000000 Hydrogen Hydrogène Waterstof Väte æ°¢ 9 1.008 20.271 13.99 0.00008988 1 1 Helium Hélium æ°¦ 10 4.002602 4.222 0.0001785 18 1 Lithium Litium 锂 1 6.94 1603 453.65 0.533 1 2 Beryllium Béryllium é“ 2 9.0121831 2742 1560 1.85 2 2 Boron Bore Boor Bor 硼 7 10.81 4200 2349 2.34 13 2 Carbon Carbone Koolstof Kol 碳 8 12.011 2.267 14 2 Nitrogen Azote Stikstof Kväve æ°® 9 14.007 77.355 63.15 0.0012506 15 2 Oxygen Oxygène Zuurstof Syre æ°§ 9 15.999 90.188 54.36 0.001429 16 2 Fluorine Fluor Fluor Fluor æ°Ÿ 9 18.998403163 85.04 53.48 0.001696 17 2 Neon Néon æ°– 10 20.1797 27.104 24.56 0.0008999 18 2 Sodium Natrium Natrium é’  1 22.98976928 1156.090 370.944 0.971 1 3 Magnesium Magnésium é• 2 24.305 1363 923 1.738 2 3 Aluminum Aluminium Aluminium é“ 6 26.9815385 2743 933.47 2.698 13 3 Silicon Silicium Silicium Kisel ç¡… 7 28.085 3538 1687 2.3296 14 3 Phosphorus Phosphore Fosfor Fosfor 磷 8 30.973761998 550 317.30 1.82 15 3 Sulfur Soufre Zwavel Svavel ç¡« 8 32.06 717.8 388.36 2.067 16 3 Chlorine Chlore Chloor Klor æ°¯ 9 35.45 239.11 171.6 0.003214 17 3 Argon æ°© 10 39.948 87.302 83.81 0.0017837 18 3 Potassium Kalium Kalium é’¾ 1 39.0983 1032 336.7 0.862 1 4 Calcium Kalcium é’™ 2 40.078 1757 1115 1.54 2 4 Scandium Skandium é’ª 5 44.955908 3109 1814 2.989 3 4 Titanium Titane Titaan Titan é’› 5 47.867 3560 1941 4.54 4 4 Vanadium Vanadin é’’ 5 50.9415 3680 2183 6.11 5 4 Chromium Chrome Chroom Krom 铬 5 51.9961 2755 2180 7.15 6 4 Manganese Manganèse Mangaan Mangan é”° 5 54.938044 2334 1519 7.44 7 4 Iron Fer IJzer Järn é“ 5 55.845 3143 1811 7.874 8 4 Cobalt Kobalt Kobolt é’´ 5 58.933194 3200 1768 8.86 9 4 Nickel Nikkel é• 5 58.6934 3002 1728 8.912 10 4 Copper Cuivre Koper Koppar 铜 5 63.546 2835 1357.77 8.96 11 4 Zinc Zink Zink 锌 5 65.38 1180 692.68 7.134 12 4 Gallium é•“ 6 69.723 2673 302.9146 5.907 13 4 Germanium é”— 7 72.630 3106 1211.40 5.323 14 4 Arsenic Arsenicum Arsenik ç · 7 74.921595 887 1090 5.776 15 4 Selenium Sélénium Selen ç¡’ 8 78.971 958 494 4.809 16 4 Bromine Brome Broom Brom 溴 9 79.904 332.0 265.8 3.122 17 4 Krypton æ°ª 10 83.798 119.735 115.78 0.003733 18 4 Rubidium é“· 1 85.4678 961 312.45 1.532 1 5 Strontium é”¶ 2 87.62 1650 1050 2.64 2 5 Yttrium é’‡ 5 88.90584 3203 1799 4.469 3 5 Zirconium Zirkonium 锆 5 91.224 4650 2128 6.506 4 5 Niobium Niob 铌 5 92.90637 5017 2750 8.57 5 5 Molybdenum Molybdène Molybdeen Molybden é’¼ 5 95.95 4912 2896 10.22 6 5 Technetium Technétium Teknetium é” 5 [98] 4538 2430 11.5 7 5 Ruthenium Rutenium é’Œ 5 101.07 4423 2607 12.37 8 5 Rhodium Rodium é“‘ 5 102.90550 3968 2237 12.41 9 5 Palladium é’¯ 5 106.42 3236 1828.05 12.02 10 5 Silver Argent Zilver é“¶ 5 107.8682 2483 1234.93 10.501 11 5 Cadmium Kadmium 镉 5 112.414 1040 594.22 8.69 12 5 Indium 铟 6 114.818 2345 429.75 7.31 13 5 Tin Étain Tenn 锡 6 118.710 2875 505.08 7.287 14 5 Antimony Antimoine Antimoon Antimon 锑 7 121.760 1908 903.78 6.685 15 5 Tellurium Tellure Telluur Tellur 碲 7 127.60 1261 722.66 6.232 16 5 Iodine Iode Jood Jod 碘 9 126.90447 457.4 386.85 4.93 17 5 Xenon Xénon æ°™ 10 131.293 165.051 161.40 0.005887 18 5 Cesium Césium 铯 1 132.90545196 944 301.7 1.873 1 6 Barium Baryum é’¡ 2 137.327 1910 1000 3.596 2 6 Lanthanum Lanthane Lanthaan Lantan é•§ 3 138.9054 3737 1193 6.145 3 9 Cerium Cérium 铈 3 140.116 3716 1068 6.77 4 9 Praseodymium Praséodyme Praseodym 镨 3 140.90766 3403 1208 6.773 5 9 Neodymium Néodyme Neodym é’• 3 144.242 3347 1297 7.007 6 9 Promethium Prométhium Prometium é’· 3 [145] 3273 1315 7.26 7 9 Samarium é’ 3 150.36 2173 1345 7.52 8 9 Europium é“• 3 151.964 1802 1099 5.243 9 9 Gadolinium Gadolinium guld é’† 3 157.25 3273 1585 7.895 10 9 Terbium 铽 3 158.92535 3396 1629 8.229 11 9 Dysprosium é• 3 162.500 2840 1680 8.55 12 9 Holmium é’¬ 3 164.93033 2873 1734 8.795 13 9 Erbium é“’ 3 167.259 3141 1802 9.066 14 9 Thulium Tulium é“¥ 3 168.93422 2223 1818 9.321 15 9 Ytterbium 镱 3 173.045 1703 1097 6.965 16 9 Lutetium é•¥ 3 174.9668 3675 1925 9.84 3 6 Hafnium 铪 5 178.49 4876 2506 13.31 4 6 Tantalum Tantale Tantaal Tantal é’½ 5 180.94788 5731 3290 16.654 5 6 Tungsten Tungstène Volfram é’¨ 5 183.84 6203 3695 19.25 6 6 Rhenium Rhénium 铼 5 186.207 5869 3459 21.02 7 6 Osmium 锇 5 190.23 5285 3306 22.61 8 6 Iridium 铱 5 192.217 4403 2719 22.56 9 6 Platinum Platine Platina Platina é“‚ 5 195.084 4098 2041.4 21.46 10 6 Gold Or Goud Guld 金 5 196.966569 3129 1337.33 19.282 11 6 !elements!Mercury Mercure Kwik Kvicksilver 汞 5 200.592 629.88 234.32 13.5336 12 6 Thallium Tallium 铊 6 204.38 1746 577 11.85 13 6 Lead Plomb Lood Bly é“… 6 207.2 2022 600.61 11.342 14 6 Bismuth Bismut Vismut é“‹ 6 208.98040 1837 544.7 9.807 15 6 Polonium é’‹ 6 [209] 1235 527 9.32 16 6 Astatine Astate Astat ç ¹ 7 [210] 575 7 17 6 Radon æ°¡ 10 [222] 211.5 202 0.00973 18 6 Francium é’« 1 [223] 300 1.87 1 7 Radium é•­ 2 [226] 2010 973 5.5 2 7 Actinium Aktinium 锕 4 [227] 3471 1323 10.07 3 10 Thorium Torium é’ 4 232.0377 5061 2115 11.72 4 10 Protactinium Protaktinium 镤 4 231.03588 1841 15.37 5 10 Uranium Uraan Uran é“€ 4 238.02891 4404 1405.3 18.95 6 10 Neptunium 镎 4 [237] 4273 917 20.45 7 10 Plutonium é’š 4 [244] 3501 912.5 19.84 8 10 Americium é•… 4 [243] 2880 1449 13.69 9 10 Curium é”” 4 [247] 3383 1613 13.51 10 10 Berkelium Berkélium 锫 4 [247] 1323 14.79 11 10 Californium 锎 4 [251] 1173 15.1 12 10 Einsteinium 锿 4 [252] 1133 8.84 13 10 Fermium é•„ 4 [257] 1800 14 10 Mendelevium é’” 4 [258] 1100 15 10 Nobelium 锘 4 [259] 1100 16 10 Lawrencium 铹 4 [266] 1900 3 7 Rutherfordium 5 [267] 4 7 Dubnium 5 [268] 5 7 Seaborgium 5 [269] 6 7 Bohrium 5 [270] 7 7 Hassium 5 [269] 8 7 Meitnerium 11 [278] 9 7 Darmstadtium 11 [281] 10 7 Roentgenium 11 [282] 11 7 Copernicium 5 [285] 12 7 Nihonium 11 [286] 13 7 Flerovium 6 [289] 14 7 Moscovium 11 [290] 15 7 Livermorium 11 [293] 16 7 Tennessine 11 [294] 17 7 Oganesson 11 [294] 18 7 libqalculate-2.8.2/data/Makefile.am0000644000175000017500000000061713307171405014060 00000000000000# # data/Makefile.am for qalculate # xmldir = $(datadir)/qalculate xml_in_files = currencies.xml.in datasets.xml.in elements.xml.in functions.xml.in planets.xml.in prefixes.xml.in units.xml.in variables.xml.in xml_DATA = $(xml_in_files:.xml.in=.xml) eurofxref-daily.xml rates.json @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ EXTRA_DIST = \ $(xml_in_files) $(xml_DATA) eurofxref-daily.xml rates.json libqalculate-2.8.2/data/datasets.xml.in0000644000175000017500000001260312715132301014753 00000000000000 <_title>Data Sets <_title>!datasets!Elements elements.xml <_names>r:atom <_title>!datasets!Element <_title>Symbol text true <_names>r:symbol <_title>!datasets!Number number true <_names>!datasets!r:number <_title>Name text true <_names>r:name <_title>Classification <_description>A number representing an element group: 1 Alkali Metal 2 Alkaline-Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 Metal 7 Metalloid 8 Polyatomic Non-Metal 9 Diatomic Non-Metal 10 Noble Gas 11 Unknown chemical properties number <_names>r:class <_title>Weight number true AMU true <_names>r:weight,mass <_title>Boiling Point number K true <_names>r:boiling <_title>Melting Point number K true <_names>r:melting <_title>Density <_description>Density at 295K number g/cm^3 true <_names>r:density <_title>X Position number true <_names>r:x_pos <_title>Y Position number true <_names>r:y_pos <_title>Planets planets.xml This data uses material from the Wikipedia articles "Earth" (http://www.wikipedia.org/wiki/Earth), "Jupiter (planet)" (http://www.wikipedia.org/wiki/Jupiter_(planet)), "Mars (planet)" (http://www.wikipedia.org/wiki/Mars_(planet)), "Mercury (planet)" (http://www.wikipedia.org/wiki/Mercury_(planet)), "Neptune (planet)" (http://www.wikipedia.org/wiki/Neptune_(planet)), "Pluto (planet)" (http://www.wikipedia.org/wiki/Pluto_(planet)), "Saturn (planet)" (http://www.wikipedia.org/wiki/Saturn_(planet)), "Uranus (planet)" (http://www.wikipedia.org/wiki/Uranus_(planet)), and "Venus (planet)" (http://en.wikipedia.org/wiki/Venus_(planet)), licensed under the GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html) <_names>r:planet <_title>Planet <_title>Name text true <_names>r:name <_title>Orbital Period (Year) number d true <_names>!datasets!r:year <_title>Average Orbital Speed number km/s true <_names>r:speed <_title>Eccentricity number true <_names>r:eccentricity <_title>Inclination number true <_names>r:inclination <_title>Number of Satellites number <_names>r:satellites <_title>!datasets!Mass number kg true <_names>r:mass <_title>Mean Density number g/cm^3 true <_names>r:density <_title>Surface Area number km^2 true <_names>!datasets!r:area <_title>Equatorial Gravity number m/s^2 true <_names>r:gravity <_title>Mean Surface Temperature number K true <_names>r:temperature libqalculate-2.8.2/data/functions.xml.in0000644000175000017500000037062413365376572015213 00000000000000 <_title>Matrices & Vectors <_title>Construct Vector <_names>r:vector <_description>Returns a vector with listed elements. <_title>Elements <_title>Generate Vector <_names>r:genvector <_description>Returns a vector generated from a function with a variable (default x) running from min to max. The fourth argument is either the requested number of elements if the sixth argument is false (default) or the step between each value of the variable. <_title>Function <_title>Min <_title>Max <_title>Dimension / Step size <_title>Variable <_title>Use step size <_title>Sort <_names>r:sort <_description>Returns a sorted vector. $name([6, 1, 4]) = [1, 4, 6] <_title>Vector <_title>Ascending <_title>Rank <_names>r:rank <_description>Returns a vector with values of elements replaced with their mutual ranks. $name([6, 1, 4]) = [3, 1, 2] <_title>Vector <_title>Ascending <_title>Vector Limits <_names>r:limits <_description>Returns a part of a vector between two positions. <_title>Vector <_title>Lower limit <_title>Upper limit <_title>Dimension <_names>r:dimension <_description>Returns the number of elements in a vector. <_title>Vector <_title>Merge Vectors <_names>r:mergevectors <_description>Returns a vector with the elements from two vectors. <_title>Vector 1 <_title>Vector 2 <_title>Construct Matrix <_names>r:matrix <_description>Returns a matrix with specified dimensions and listed elements. Omitted elements are set to zero. <_title>Rows <_title>Columns <_title>Elements <_title>Convert Matrix to Vector <_names>r:matrix2vector <_description>Puts each element of a matrix in vertical order in a vector. <_title>Matrix <_title>Matrix Area <_names>r:area <_description>Returns a part of a matrix. <_title>Matrix <_title>Start row <_title>Start column <_title>End row <_title>End column <_title>Rows <_names>r:rows <_description>Returns the number of rows in a matrix. <_title>Matrix <_title>Columns <_names>r:columns <_description>Returns the number of columns in a matrix. <_title>Matrix <_title>Extract row as vector <_names>r:row <_description>Returns a row in a matrix as a vector. <_title>Matrix <_title>Row <_title>Extract Column as Vector <_names>r:column <_description>Returns a column in a matrix as a vector. <_title>Matrix <_title>Column <_title>Elements <_names>r:elements <_description>Returns the number of elements in a matrix or vector. <_title>Matrix or vector <_title>Element <_names>r:element <_description>Returns the element at specified position in a matrix (row and column) or vector (index). <_title>Matrix/vector <_title>Row/index <_title>Column <_title>Transpose <_names>r:transpose <_description>Returns the transpose of a matrix. <_title>Matrix <_title>Identity <_names>r:identity <_description>Returns the identity matrix of a matrix or with specified number of rows/columns. <_title>Matrix or rows/columns <_title>Determinant <_names>r:det <_description>Calculates the determinant of a matrix. <_title>Matrix <_title>Permanent <_names>r:permanent <_description>Calculates the permanent of a matrix. The permanent differs from a determinant in that all signs in the expansion by minors are taken as positive. <_title>Matrix <_title>Adjugate (Adjoint) <_names>r:adj <_description>Calculates the adjugate or adjoint of a matrix. <_title>Matrix <_title>Cofactor <_names>r:cofactor <_description>Calculates the cofactor of the element at specified position. <_title>Matrix <_title>Row <_title>Column <_title>Matrix Inverse <_names>r:inverse <_description>Calculates the inverse of a matrix. The inverse is the matrix that multiplied by the original matrix equals the identity matrix (AB = BA = I). <_title>Matrix <_title>Load CSV File <_names>r:load <_description>Returns a matrix imported from a CSV data file. <_title>Filename <_title>First data row <_title>Separator <_title>Export To CSV File <_names>r:export <_description>Exports a matrix to a CSV data file. <_title>Matrix/vector <_title>Filename <_title>Separator <_title>Magnitude <_names>r:magnitude <_description>Calculates the magnitude of a value. This function returns the same value as abs() for all values except vectors. <_title>Value <_title>Hadamard Product <_names>r:hadamard <_description>Mulitplies each separate element in matrix 1 with the corresponding element in matrix 2. <_title>Matrix 1 <_title>Matrix 2 <_title>Entrywise Function <_names>r:entrywise <_description>Calculates a new matrix or vector using each separate element in matrix/vector 1 and the corresponding (in the same row and column) elements in matrix/vector 2. An unlimited number of matrices/vectors can be specified, with each matrix/vector argument followed by the corresponding variable used in the function argument. $name(x / y, [4, 10, 12], x, [2, 2, 4], y) = [2, 5, 3] <_title>Function <_title>Matrices/vectors and variables <_title>Norm (length) <_names>r:norm <_description>Calculates the norm/length of a vector. abs((\x*\x)^(1/2)) <_title>Vector false <_title>Cross Product <_names>r:cross <_description>Calculates the cross product of two 3-dimensional vectors. [(element(\x,2)*element(\y,3))-(element(\x,3)*element(\y,2)),(element(\x,3)*element(\y,1))-(element(\x,1)*element(\y,3)),(element(\x,1)*element(\y,2))-(element(\x,2)*element(\y,1))] <_title>Vector 1 dimension(\x)==3 <_title>Vector 2 dimension(\x)==3 <_title>Combinatorics <_title>Factorial <_description>Calculates the factorial of an integer. Multiplies the argument with every lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number followed by one exclamation mark. $name(5) = 5! = 5 * 4 * 3 * 2 * 1 = 120 <_names>r:factorial <_title>Value <_title>Double Factorial <_names>r:factorial2 <_description>Calculates the double factorial of an integer. Multiplies the argument with every second lesser positive integer (n(n-2)(n-4)...). Can also be entered as a number followed by two exclamation marks. $name(5) = 5!! = 5 * 3 * 1 = 15 <_title>Value <_title>Multifactorial <_names>r:multifactorial <_description>Calculates the multifactorial of an integer. Multiplies the argument with every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a number followed by three or more exclamation marks. $name(18, 4) = 18!!!! = 18 * 14 * 10 * 6 * 2 = 30 240 <_title>Value <_title>Factorial <_title>Binomial Coefficient <_names>r:binomial <_title>Exponent <_title>Index <_title>Hyperfactorial <_names>r:hyperfactorial product(x^x,1,\x,x) <_description>Calculates the hyperfactorial of an integer. Multiplies the argument raised by itself with every lesser positive integer raised by themselves (1^1 * 2^2 ... n^n). $name(3) = (3^3) * (2^2) * (1^1) = 108 <_title>Value 1 <_title>Superfactorial <_names>r:superfactorial product(factorial(x),0,\x,x) <_description>Calculates the superfactorial of an integer. Multiplies the factorial of the argument with the factorial of every lesser positive integer (1! * 2! ... n!). $name(5) = 5! * 4! * 3! * 2! * 1! = 34 560 <_title>Value 0 <_title>Permutations (Variations) <_names>r:perm,variations \x!/(\x-\y)! <_description>Returns the number of possible arrangements of an ordered list with a number of objects to choose from and a list size. If there are three objects (1, 2 and 3) that is put in a list with two positions, the alternatives are [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of permutations is 6. <_title>Objects true <_title>Size true <_title>Combinations <_names>r:comb \x!/(\y!*(\x-\y)!) <_description>Returns the number of possible arrangements of an unordered list with a number of objects to choose from and a list size. If there are three objects (1, 2 and 3) that is put in a list with place for two, the alternatives are [1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3. <_title>Objects true <_title>Size true <_title>Derangements <_names>r:derangements <_description>Returns the number of possible rearrangements of an ordered list, of a certain size, where none of the objects are on their original position. If the original list is [1, 2, 3], the possible derangements are [2, 3, 1] and [3, 1, 2], and thus the number of derangements is 2. factorial(\x)*sum(((-1)^"i")/factorial("i"),0,\x,"i") <_title>Number of elements 1 <_title>Number Theory <_title>Absolute Value <_names>r:abs <_title>Value <_title>Arithmetic <_title>Signum <_names>r:sgn <_title>Number <_title>Value for zero <_title>Numerator <_names>r:numerator <_title>Number <_title>Denominator <_names>r:denominator <_title>Number <_title>Remainder <_names>r:rem <_title>Numerator <_title>Denominator <_title>Modulus <_names>r:mod <_title>Numerator <_title>Denominator <_title>Negate <_names>r:neg -\x <_title>Value <_title>Reciprocal <_names>r:inv \x^(-1) <_title>Value true <_title>Multiply <_names>r:multiply product(element(\x,"x"),1,dimension(\x),"x") <_title>Factors <_title>Add <_names>r:add total(\x) <_title>Terms <_title>Subtract <_names>r:subtract csum(2,-1,element(\x,1),"y"-"x","x","y",\x) <_title>Terms <_title>Divide <_names>r:divide \x/\y <_title>Numerator <_title>Denominator <_title>Raise <_names>r:raise \x^\y <_title>Base true <_title>Exponent true <_title>Polynomials <_title>Coefficient <_names>r:coeff <_title>Polynomial <_title>Number <_title>Variable <_title>Leading Coefficient <_names>r:lcoeff <_title>Polynomial <_title>Variable <_title>Trailing Coefficient <_names>r:tcoeff <_title>Polynomial <_title>Variable <_title>Polynomial Degree <_names>r:degree <_title>Polynomial <_title>Variable <_title>Lowest Degree (Valuation) <_names>r:ldegree <_title>Polynomial <_title>Variable <_title>Content Part <_names>r:pcontent <_title>Polynomial <_title>Variable <_title>Primitive Part <_names>r:primpart <_title>Polynomial <_title>Variable <_title>Unit Part <_names>r:punit <_title>Polynomial <_title>Variable <_title>Greatest Common Divisor <_names>r:gcd <_title>1st value <_title>2nd value <_title>Least Common Multiple <_names>r:lcm <_title>1st value <_title>2nd value <_title>Fibonacci Number <_names>r:fibonacci <_description>Returns the n-th term of the Fibonacci sequence. (golden^\x−(1−golden)^\x)/sqrt(5) <_title>Index (n) 0 false <_title>Rounding <_title>Round <_names>r:round <_title>Value <_title>Round Downwards <_names>r:floor <_title>Value <_title>Round Upwards <_names>r:ceil <_title>Value <_title>Round Towards Zero <_names>r:trunc <_title>Value <_title>Extract Integer Part <_names>r:int <_title>Value <_title>Extract Fractional Part <_names>r:frac <_title>Value <_title>Number Bases <_title>Number Base <_names>r:base <_description>Returns an value from an expression using a specified base between 2 and 36 <_title>Number <_title>Base <_title>Binary <_names>r:bin <_description>Returns a value from a binary expression. If two's complement is true, numbers beginning with '1' is interpreted as negative binary numbers using two's complement. <_title>Binary number <_title>Two's complement <_title>Octal <_names>r:oct <_description>Returns a value from an octal expression. <_title>Octal number <_title>Hexadecimal <_names>r:hex <_description>Returns a value from a hexadecimal expression. <_title>Hexadecimal number <_title>Integers <_title>Even <_names>r:even <_title>Number <_title>Odd <_names>r:odd <_title>Number <_title>Step Functions <_title>Heaviside Step Function <_names>r:heaviside,au:θ <_description>Discontinuous function also known as "unit step function". Returns 0 if x < 0, 1 if x > 0, and 1/2 if x = 0. <_title>Dirac Delta Function <_names>r:dirac,au:δ <_description>Returns 0 if x is non-zero, and infinity if x is zero. <_title>Ramp Function <_names>r:ramp (\x+abs(\x))/2 <_title>Value false false <_title>Rectangular Function <_names>r:rectangular heaviside(\x+(1/2))-heaviside(\x-(1/2)) <_title>Value false false <_title>Sigmoid Function <_names>r:sigmoid 1/(1+e^(-\x)) <_title>Value false <_title>Logit Transformation <_names>r:logit ln(\x/(1-\x)) <_title>Value <_title>Triangular Function <_names>r:triangular if(abs(\x)<1,1-abs(\x),0) <_title>Value false false <_title>Special Functions <_title>Gamma Function <_names>r:gamma <_title>Digamma Function <_names>r:digamma,psi <_title>Beta Function <_names>r:beta <_title>Error Function <_names>r:erf <_title>Complementary Error Function <_names>r:erfc <_title>Polylogarithm <_names>rc:Li,polylog <_title>Order <_title>Argument <_title>Airy Function <_names>r:airy <_title>Bessel Function of the First Kind <_names>r:besselj <_title>Order <_title>Argument <_title>Bessel Function of the Second Kind <_names>r:bessely <_title>Order <_title>Argument <_title>Riemann Zeta <_names>r:zeta <_title>Integral point <_title>Kronecker Delta <_names>r:kronecker <_description>Returns 0 if i != j and 1 if i = j. \x=\Y{0} <_title>Value 1 (i) false false <_title>Value 2 (j) false false <_title>Complex Numbers <_title>Real Part <_names>r:re <_title>Complex number <_title>Imaginary Part <_names>r:im <_title>Complex number <_title>Principal Argument <_names>r:arg <_title>Complex number <_title>Complex Conjugate <_names>r:conj re(\x)-i*im(\x) <_title>Complex number false <_title>Exponents & Logarithms <_title>Square Root <_names>au:√,r:sqrt <_description>Returns the principal square root (for positive values the positive root is returned). <_title>Value <_title>Cube Root <_names>au:∛,r:cbrt <_description>Returns the third real root. <_title>Value <_title>Nth root <_names>r:root <_description>Returns the real root. For negative values the degree must be odd. Complex values are not allowed. <_title>Value <_title>Degree <_title>Square <_names>r:sq <_title>Value <_title>Exponential (e^x) <_names>r:exp <_title>Exponent <_title>Natural Logarithm <_names>r:ln <_title>Value <_title>Base-N Logarithm <_names>r:log <_title>Value <_title>Base <_title>Lambert W Function (Omega Function, Product Log) <_names>r:lambertw,productlog <_description>Returns the inverse function for mx*e^x as ln() does for e^x. Only the principal branch and real valued results are currently supported. <_title>Value <_title>Branch <_title>Base-2 Logarithm <_names>rs:log2 <_description>Returns the base n logarithm. log(\x,2) <_title>Value false 0 <_title>Base-10 Logarithm <_names>rs:log10 <_description>Returns the base n logarithm. log(\x,10) <_title>Value false 0 <_title>Complex Exponential (Cis) <_names>r:cis e^(\x*i) <_title>Exponent true <_title>2 raised to the power X <_names>rs:exp2 2^\x <_title>Exponent true <_title>10 raised to the power X <_names>rs:exp10 10^\x <_title>Exponent true <_title>X raised to the power Y <_names>r:pow \x^\y <_title>Base true <_title>Exponent true <_title>Square root (x * pi) <_names>r:sqrtpi <_description>Returns the non-negative square root of x * pi abs((\x*pi)^(1/2)) <_title>Non-negative value 0 <_title>Trigonometry <_title>Sine <_names>r:sin <_title>Angle <_title>Cosine <_names>r:cos <_title>Angle <_title>Tangent <_names>r:tan <_title>Angle <_title>Inverse Sine <_names>r:asin <_title>Inverse Cosine <_names>r:acos <_title>Inverse Tangent <_names>r:atan <_title>Hyperbolic Sine <_names>r:sinh <_title>Hyperbolic Cosine <_names>r:cosh <_title>Hyperbolic Tangent <_names>r:tanh <_title>Inverse Hyperbolic Sine <_names>r:asinh <_title>Inverse Hyperbolic Cosine <_names>r:acosh <_title>Inverse Hyperbolic Tangent <_names>r:atanh <_title>Four-quadrant Inverse Tangent <_names>r:atan2 <_description>Computes the principal value of the argument function applied to the complex number x+iy. <_title>Y <_title>X <_title>Cardinal Sine (Sinc Function) <_names>r:sinc <_title>Radians to Default Angle Unit <_names>r:radtodef <_title>Radians <_title>Secant <_names>r:sec 1/cos(\x) <_title>Angle false true <_title>Cosecant <_names>r:csc 1/sin(\x) <_title>Angle false true <_title>Cotangent <_names>r:cot 1/tan(\x) <_title>Angle false true <_title>Hyperbolic Secant <_names>r:sech 1/cosh(\x) false <_title>Hyperbolic Cosecant <_names>r:csch 1/sinh(\x) false <_title>Hyperbolic Cotangent <_names>r:coth 1/tanh(\x) false <_title>Inverse Secant <_names>r:asec radtodef(0.5pi+i*ln(sqrt(1-1\x^2)+i/\x)) false <_title>Inverse Cosecant <_names>r:acsc radtodef(-i*ln(sqrt(1-1\x^2)+i/\x)) false <_title>Inverse Cotangent <_names>r:acot radtodef(i/2*(ln((\x-i)/\x)-ln((\x+i)/\x))) false <_title>Inverse Hyperbolic Secant <_names>r:asech ln(sqrt(1/\x-1)*sqrt(1/\x+1)+1/\x) false <_title>Inverse Hyperbolic Cosecant <_names>r:acsch ln(sqrt(1+1/\x^2)+1/\x) false <_title>Inverse Hyperbolic Cotangent <_names>r:acoth (ln(1+1/\x)-ln(1-1/\x))/2 false <_title>Miscellaneous <_title>Body Mass Index (BMI) <_names>-r:bmi <_description>Calculates the Body Mass Index. The resulting BMI-value is sometimes interpreted as follows (although varies with age, sex, etc.): Underweight < 18.5 Normal weight 18.5-25 Overweight 25-30 Obesity > 30 Note that you must use units for weight (ex. 59kg) and length (ex. 174cm). $name(127 lb, 5ft + 4in) = 21.80 (\x/(1000g))/(\y/m)^2 <_title>Weight true <_title>Length true <_title>Roman Number <_names>r:roman <_description>Returns the value of a roman number. <_title>Roman number <_title>Statistics <_title>Descriptive Statistics <_title>Sum (total) <_names>r:total <_title>Data <_title>Percentile <_names>r:percentile <_title>Vector <_title>Percentile (%) <_title>Quantile Algorithm (as in R) <_title>Min <_names>r:min <_description>Returns the lowest value. <_title>Vector <_title>Max <_names>r:max <_description>Returns the highest value. <_title>Vector <_title>Mode <_names>r:mode <_description>Returns the most frequently occurring value. <_title>Vector <_title>Range <_names>r:range <_description>Calculates the difference between the min and max value. max(\x)-min(\x) <_title>Data <_title>Median <_names>r:median percentile(\x,50) <_title>Data <_title>Quartile <_names>r:quartile percentile(\x,25*\y,\Z{8}) <_title>Data <_title>Quartile 0 4 <_title>Quantile Algorithm (as in R) 1 9 <_title>Decile <_names>r:decile percentile(\x,10*\y,\Z{8}) <_title>Data <_title>Decile 0 10 <_title>Quantile Algorithm (as in R) 1 9 <_title>Interquartile Range <_names>r:iqr <_description>Calculates the difference between the first and third quartile. quartile(\x,3,\Y{8})-quartile(\x,1,\Y{8}) <_title>Data <_title>Quantile Algorithm (as in R) 1 9 <_title>Number of Samples <_names>r:number <_description>Returns the number of samples. dimension(\x) <_title>Data <_title>Random Number <_names>r:rand <_description>Generates a pseudo-random number. Returns a real number between 0 and 1, if ceil is zero (default), or an integer between 1 and (including) ceil. <_title>Ceil <_title>Random Number Between Limits <_names>r:randbetween <_description>Returns an integer between (including) bottom and top. rand(\y-\x+1)+\x-1 \x<=\y <_title>Bottom <_title>Top <_title>Means <_title>Mean <_names>r:mean,average,au:x̄ total(\x)/dimension(\x) <_title>Data <_title>Harmonic Mean <_names>r:harmmean dimension(\x)/csum(1,-1,0,"y"+1/"x","x","y",\x) <_title>Data <_title>Geometric Mean <_names>r:geomean abs(csum(1,-1,1,"y"*"x","x","y",\x)^(1/dimension(\x))) <_title>Data <_title>Trimmed Mean <_names>r:trimmean mean(limits(sort(\x),round(dimension(\x)/100*\y)+1,round(dimension(\x)/100*(100-\y)))) <_title>Data <_title>Trimmed percentage (at each end) true <_title>Winsorized Mean <_names>r:winsormean sort(\x) dimension(\x) round(dimension(\x)/100*\y) (element(\1,\2-\3)*\3+element(\1,\3+1)*\3+total(limits(\1,\3+1,\2-\3)))/\2 <_title>Data <_title>Winsorized percentage (at each end) true <_title>Weighted Mean <_names>r:weighmean dimension(\x) min(dimension(\x),dimension(\y)) csum(1,\2,0,"y"+"x"*element("v","i"+\1),"x","y",mergevectors(\x,\y),"i","v")/total(limits(\y,1,\2)) <_title>Data <_title>Weights <_title>Quadratic Mean (RMS) <_names>r:rms abs((csum(1,-1,0,"y"+"x"^2,"x","y",\x)/dimension(\x))^(1/2)) <_title>Data <_title>Moments <_title>Standard Deviation (entire population) <_names>r:stdevp abs(varp(\x)^(1/2)) <_title>Data <_title>Standard Deviation (random sampling) <_names>r:stdev abs(var(\x)^(1/2)) <_title>Data <_title>Variance (entire population) <_names>r:varp mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/dimension(\x) <_title>Data <_title>Variance (random sampling) <_names>r:var mean(\x) csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)/(dimension(\x)-1) <_title>Data <_title>Standard Error <_names>r:stderr abs((var(\x)/dimension(\x))^(1/2)) <_title>Data <_title>Mean Deviation <_names>r:meandev mean(\x) csum(1,-1,0,"y"+abs("x"-\1),"x","y",\x)/dimension(\x) <_title>Data <_title>Covariance <_names>r:cov,r:covar mean(\x) mean(\y) dimension(\x) min(dimension(\x),dimension(\y)) csum(1,\4,0,"y"+("x"-\1)*(element("v","i"+\3)-\2),"x","y",mergevectors(\x,\y),"i","v")/(\4) <_title>Data 1 <_title>Data 2 <_title>Pooled Variance <_names>r:poolvar mean(\x) mean(\y)^2 (csum(1,-1,0,"y"+("x"-\1)^2,"x","y",\x)+csum(1,-1,0,"y"+("x"-\2)^2,"x","y",\y))/(dimension(\x)+dimension(\y)-2) <_title>Data 1 <_title>Data 2 <_title>Regression <_title>Statistical Correlation <_names>r:cor covar(\x,\y)/(stdev(\x)*stdev(\y)) <_title>Data 1 <_title>Data 2 <_title>Pearson's Correlation Coefficient <_names>r:pearson,r:correl dimension(\x)=dimension(\y) total(\x) total(\y) dimension(\x) dimension(\y) (\x*\y-\1*\2/\3)/abs(((\x^2-(\1^2)/\3)*(\y^2-(\2^2)/\4))^(1/2)) <_title>Data 1 <_title>Data 2 <_title>Spearman's Rho <_names>r:spearman dimension(\x)=dimension(\y) pearson(rank(\x),rank(\y)) <_title>Data 1 <_title>Data 2 <_title>Statistical Tests <_title>Unpaired T-Test <_names>r:ttest poolvar(\x,\y)^2 (mean(\x)-mean(\y))/abs(((\1)/dimension(\x)+(\1)/dimension(\y))^(1/2)) <_title>Data 1 <_title>Data 2 <_title>Paired T-Test <_names>r:pttest mean(\x-\y)/stderr(\x-\y) <_title>Data 1 <_title>Data 2 <_title>Distribution <_title>Rayleigh Distribution <_names>r:rayleigh <_description>Returns the probability density p(x) at x for a Rayleigh distribution with scale parameter sigma. (from Gnumeric) if(\x < 0,0,(\x/\y)/\y*exp(-(\x/\y)*(\x/\y)/2)) <_title>X <_title>Sigma 0 <_title>Rayleigh Tail Distribution <_names>r:rayleightail <_description>Returns the probability density p(x) at x for a Rayleigh tail distribution with scale parameter sigma and a lower limit. (from Gnumeric) if(\x < \y,0,(\x/\z)/\z*exp(((\y/\z)+(\x/\z))*((\y/\z)-(\x/\z))/2)) <_title>X <_title>Lower limit <_title>Sigma 0 <_title>Pareto Distribution <_names>r:pareto <_description>Returns the probability density p(x) at x for a Pareto distribution with exponent and scale. (from Gnumeric) if(\x < \z,0,(\y/\z)/(\x/\z)^(\y+1)) <_title>X <_title>Exponent 0 <_title>Scale 0 <_title>Logistic Distribution <_names>r:logistic <_description>Returns the probability density p(x) at x for a logistic distribution with scale parameter. (from Gnumeric) exp(-abs(\x)/\y)/(abs(\y)*(1+exp(-abs(\x)/\y))^2) <_title>X <_title>Scale 0 <_title>Date & Time <_title>Construct Date <_names>r:date <_description>Returns a date. Available calendars gregorian (1), hebrew (2), islamic (3), persian (4), indian (5), chinese (6), julian (7), milankovic (8), coptic (9), ethiopian (10), egyptian (11). The Chinese year uses an epoch of 2697 BEC and chinese leap months are indicated by adding 12 to the month number (e.g. leap month 4 = 16). <_title>Year <_title>Month <_title>Day <_title>Calendar <_title>Construct Date and Time <_names>r:datetime <_title>Year <_title>Month <_title>Day <_title>Hour <_title>Minute <_title>Second <_title>Days between two dates <_names>r:days <_description>Returns the number of days between two dates. Basis is the type of day counting you want to use: 0: US 30/360, 1: real days (default), 2: real days/360, 3: real days/365 or 4: European 30/360. <_title>First date <_title>Second date <_title>Day counting basis <_title>Financial function mode <_title>Years between two dates <_names>r:yearfrac <_description>Returns the number of years (fractional) between two dates. Basis is the type of day counting you want to use: 0: US 30/360, 1: real days (default), 2: real days/360, 3: real days/365 or 4: European 30/360. <_title>First date <_title>Second date <_title>Day counting basis <_title>Financial function mode <_title>Week of Year <_names>r:week <_title>Date <_title>Week begins on Sunday <_title>Day of Week <_names>r:weekday <_title>Date <_title>Week begins on Sunday <_title>Month <_names>r:month <_title>Date <_title>Day of Month <_names>r:day <_title>Date <_title>Year <_names>r:year <_title>Date <_title>Day of Year <_names>r:yearday <_title>Date <_title>Current Time <_names>r:time <_title>Time Value <_names>r:timevalue <_description>Returns the time part, in fractional hours, of a date and time value. <_title>Date <_title>Date to Unix Timestamp <_names>r:timestamp <_title>Date <_title>Unix Timestamp to Date <_names>r:stamptodate,unix2date <_description>Returns the local date and time represented by the specified Unix timestamp (seconds, excluding leap seconds, since 1970-01-01). Supports time units. <_title>Timestamp <_title>Add Days <_names>r:addDays <_title>Date <_title>Days <_title>Add Months <_names>r:addMonths <_title>Date <_title>Months <_title>Add Years <_names>r:addYears <_title>Date <_title>Years <_title>Add Time <_names>r:addTime <_description>Adds a time value to a date. The value can be positive or negative, but must use a unit based on seconds (such as day and year). Fractions of days are truncated. \x+\y <_title>Date <_title>Time isNumber(\x/s) <_title>Lunar Phase <_names>r:lunarphase <_description>Returns the lunar phase, as a number between 0 and 1, for the specified date. 0 represents new moon, 0.5 full moon, and 0.25 and 0.75 quarter moons. <_title>Date <_title>Find Lunar Phase <_names>r:nextlunarphase <_description>Returns the date when the specified lunar phase occurs. The function searches forward beginning at the specified date. The lunar phase are specified as a number between 0 and 1, where 0 represents new moon, 0.5 full moon, and 0.25 and 0.75 quarter moons. <_title>Lunar Phase <_title>Start Date <_title>Utilities <_title>Plot Functions and Vectors <_names>r:plot <_title>Expression or vector <_title>Minimum x value <_title>Maximum x value <_title>Number of samples / Step size <_title>X variable <_title>Use step size <_description>Plots one or more expressions or vectors. Use a vector for the first argument to plot multiple series. Only the first argument is used for vector series. It is also possible to plot a matrix where each row is a pair of x and y values. $name([x^2, 2x, [0,1,4,8,16]], 0, 4). <_title>ASCII Value <_names>r:code <_title>Character <_title>ASCII Char <_names>r:char <_title>Value <_title>Length of string <_names>r:len <_title>Text <_title>Concatenate Strings <_names>r:concatenate <_title>Text string 1 <_title>Text string 2 <_title>Replace <_names>r:replace <_description>Replaces a certain value in an expression with a new value. The expression is calculated before the replacement if the fourth argument is true. <_title>Expression <_title>Original value <_title>New value <_title>Precalculate expression <_title>Strip Units <_names>r:nounit,strip_units <_description>Removes all units from an expression. The expression is calculated before the removal. <_title>Expression <_title>Process Vector Elements <_names>r:process <_title>Function <_title>Element variable <_title>Vector <_title>Index variable <_title>Vector variable <_title>Process Matrix Elements <_names>r:processm <_title>Function <_title>Element variable <_title>Matrix <_title>Row variable <_title>Column variable <_title>Matrix variable <_title>Custom Sum of Elements <_names>r:csum <_title>First element <_title>Last element <_title>Initial value <_title>Function <_title>Value variable <_title>Element variable <_title>Vector <_title>Index variable <_title>Vector variable <_title>Select Vector Elements <_names>r:select <_title>Vector <_title>Condition <_title>Element variable <_title>Select first match <_title>Function <_names>r:function <_title>Expression <_title>Arguments <_title>Title <_names>r:title <_title>Name <_title>Display Error <_names>r:error <_title>Message <_title>Display Warning <_names>r:warning <_title>Message <_title>Display Message <_names>r:message <_title>Message <_title>Save as Variable <_names>r:save <_title>Value <_title>Name <_title>Category <_title>Title <_title>RPN Stack Register <_names>r:register <_description>Returns the value of a RPN stack register. <_title>Index <_title>RPN Stack Vector <_names>r:stack <_description>Returns the RPN stack as a vector. <_title>Is Number <_names>r:isNumber <_title>Value <_title>Is Real <_names>r:isReal <_title>Value <_title>Is Rational <_names>r:isRational <_title>Value <_title>Is Integer <_names>r:isInteger <_title>Value <_title>Represents Number <_names>r:representsNumber <_title>Value <_title>Represents Real <_names>r:representsReal <_title>Value <_title>Represents Rational <_names>r:representsRational <_title>Value <_title>Represents Integer <_names>r:representsInteger <_title>Value <_title>Interval <_names>r:interval <_title>Lower endpoint <_title>Upper endpoint <_title>Logical <_title>For...Do <_names>r:for <_title>Initial value of counter <_title>Counter variable <_title>For condition <_title>Counter update function <_title>Initial value <_title>Do function <_title>Value variable <_title>If...Then...Else <_names>r:if <_description>Tests a condition and returns a value depending on the result. <_title>Condition <_title>Expression if condition is met <_title>Expression if condition is NOT met <_title>Logical Exclusive OR <_names>r:xor <_title>Value 1 <_title>Value 2 <_title>Bitwise Exclusive OR <_names>r:bitxor <_title>Value 1 <_title>Value 2 <_title>Bitwise Shift <_names>r:shift <_title>Number <_title>Bits <_title>Bitwise Complement (Not) <_names>r:bitcmp <_title>Number <_title>Bits <_title>Algebra <_title>Summation <_names>au:Σ,r:sum <_description>Corresponds to the summation symbol. Adds terms for each x ranging from the lower to the upper limit. $name(x^2, 1, 5) = 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55 <_title>Term expression <_title>Lower limit (i) <_title>Upper limit (n) <_title>Index variable <_title>Product of a sequence <_names>au:Π,r:product <_description>Corresponds to the product symbol. Multiplies factors for each x ranging from the lower to the upper limit. $name(x^2, 1, 5) = 1^2 * 2^2 * 3^2 * 4^2 * 5^2 = 1440 <_title>Factor expression <_title>Lower limit (i) <_title>Upper limit (n) <_title>Index variable <_title>Solve for multiple variables <_names>r:multisolve <_title>Equation vector <_title>Variable vector <_title>Solve equation <_names>r:solve <_title>Equation <_title>With respect to <_title>Solve differential equation <_names>r:dsolve <_title>Equation <_title>Initial condition: function value (y) <_title>Initial condition: argument value (x) <_description>Solves a differential equation and returns the value of y(x). The derivative in the equation should be in the format diff(y, x). Only first-order differential equations are currently supported. $name(2 * diff(y, x) - y = 4x, 5, 2) = 21e^(x/2) / e - 4x - 8 <_title>Solve for two variables <_names>r:solve2 <_description>Solves two equations with two unknown variables. Returns the value of the first variable. solve(replace(\x,\A{y},solve(\y,\A)),\Z{x}) <_title>Equation 1 <_title>Equation 2 <_title>Variable 1 <_title>Variable 2 <_title>Find Linear Function <_names>r:linearfunction <_description>Finds the linear function for the straight line between two distinct points. (\a-\y)/(\z-\x)*("x"-\x)+\y <_title>x1 <_title>y1 <_title>x2 <_title>y2 <_title>Calculus <_title>Differentiate <_names>r:diff <_title>Function <_title>With respect to <_title>Order <_title>Integrate <_names>r:integrate <_title>Function <_title>Variable of integration <_title>Lower limit <_title>Upper limit <_title>Limit <_description>Returns the two-sided limit of the function if direction is zero, limit from left (below) if direction is -1, or limit from right (above) if direction is +1. <_names>r:limit <_title>Function <_title>Value to approach <_title>Variable <_title>Direction <_title>Extreme Values <_names>r:extremum solve(diff(\x, \Y{x})=0, \Y) <_title>Function <_title>With respect to <_title>Named Integrals <_title>Logarithmic Integral <_names>rc:li,logint <_description>The integral of 1/ln(x). <_title>Exponential Integral <_names>rc:Ei,expint <_description>The integral of e^x/x. <_title>Sine Integral <_names>rc:Si,sinint <_title>Angle <_description>The integral of sin(x)/x. <_title>Cosine Integral <_names>rc:Ci,cosint <_title>Angle <_description>The integral of cos(x)/x. <_title>Hyperbolic Sine Integral <_names>rc:Shi,sinhint <_description>The integral of sinh(x)/x. <_title>Hyperbolic Cosine Integral <_names>rc:Chi,coshint <_description>The integral of cosh(x)/x. <_title>Upper Incomplete Gamma Function <_names>r:igamma <_title>Lower Incomplete Gamma Function <_names>r:gammainc 1-igamma(\x,\y)/gamma(\x) <_title>Geometry <_title>Triangle <_title>Hypotenuse <_names>r:hypot sqrt(\x^2+\y^2) <_title>Side A <_title>Side B <_title>Triangle Area <_names>r:triangle (\x*\y)/2 <_title>Base <_title>Height <_title>Triangle Perimeter <_names>r:triangle_perimeter \x+\y+\z <_title>Side A <_title>Side B <_title>Side C <_title>Circle <_title>Circle Area <_names>r:circle <_description>Calculates the area of a circle using the radius \x^2*pi <_title>Radius <_title>Circle Circumference <_names>r:circumference <_description>Calculates the area of a circle using the radius \x*2*pi <_title>Radius <_title>Cylinder <_title>Cylinder Volume <_names>r:cylinder \x^2*pi*\y <_title>Radius <_title>Height <_title>Surface Area of Cylinder <_names>r:cylinder_sa 2*\x^2*pi+2*pi*\x*\y <_title>Radius <_title>Height <_title>Cone <_title>Cone Volume <_names>r:cone \x^2*pi*\y/3 <_title>Radius <_title>Height <_title>Surface Area of Cone <_names>r:cone_sa \x^2*pi+pi*\x*abs((\y^2+\x^2)^(1/2)) <_title>Radius <_title>Height <_title>Sphere <_title>Sphere Volume <_names>r:sphere \x^3*pi*4/3 <_title>Radius <_title>Surface Area of Sphere <_names>r:sphere_sa \x^2*pi*4 <_title>Radius <_title>Square <_title>Square Area <_names>r:square \x^2 <_title>Length of side <_title>Square Perimeter <_names>r:square_perimeter \x*4 <_title>Length of side <_title>Cube <_title>Cube Volume <_names>r:cube \x^3 <_title>Length of side <_title>Surface Area of Cube <_names>r:cube_sa (\x^2)*6 <_title>Length of side <_title>Rectangle <_title>Rectangle Area <_names>r:rect \x*\y <_title>Length <_title>Width <_title>Rectangle Perimeter <_names>r:rect_perimeter (\x+\y)*2 <_title>Length <_title>Width <_title>Prism <_title>Volume of Rectangular Prism <_names>r:rectprism <_description>Calculates the volume of a prism with rectangular base. \x*\y*\z <_title>Length <_title>Width <_title>Height <_title>Surface Area of Rectangular Prism <_names>r:rectprism_sa <_description>Calculates the surface area of a prism with rectangular base. (\x*\y)*2+(\x*\z)*2+(\y*\z)*2 <_title>Length <_title>Width <_title>Height <_title>Volume of Triangular Prism <_names>r:triangleprism <_description>Calculates the volume of a prism with triangular base. \x*\y*\z/2 <_title>Length <_title>Width <_title>Height <_title>Pyramid <_title>Pyramid Volume <_names>r:pyramid <_description>Calculates the volume of a 3-dimensional shape standing on a rectangular base and terminating in a point at the top. \x*\y*\z/3 <_title>Length of base <_title>Width of base <_title>Height <_title>Volume of Regular Tetrahedron <_names>r:tetrahedron sqrt(2)/12*\x^3 <_title>Length of side <_title>Surface Area of Regular Tetrahedron <_names>r:tetrahedron_sa sqrt(3)*\x^2 <_title>Length of side <_title>Height of Regular Tetrahedron <_names>r:tetrahedron_height sqrt(6)/3*\x <_title>Length of side <_title>Volume of Square Pyramid <_names>r:sqpyramid sqrt(2)/6*\x^3 <_title>Length of side <_title>Surface Area of Square Pyramid <_names>r:sqpyramid_sa (1+sqrt(3))*\x^2 <_title>Length of side <_title>Height of Square Pyramid <_names>r:sqpyramid_height sqrt(2)/2*\x <_title>Length of side <_title>Parallelogram <_title>Parallelogram Area <_names>r:parallelogram <_description>Calculates the area of a four-sided figure whose opposite sides are both parallel and equal in length. \x*\y <_title>Base <_title>Height <_title>Parallelogram Perimeter <_names>r:parallelogram_perimeter <_description>Calculates the perimeter of a four-sided figure whose opposite sides are both parallel and equal in length. (\x+\y)*2 <_title>Side A <_title>Side B <_title>Trapezoid <_title>Trapezoid Area <_names>r:trapezoid <_description>Calculates the area of a four-sided figure with two parallel sides. (\x+\y)/2*\z <_title>Side A <_title>Side B <_title>Height <_title>Economics <_title>Microeconomics <_title>Elasticity <_names>r:elasticity <_description>Calculates the demand elasticity. Also works for supply elasticity, income elasticity, cross-price elasticity, etc. Just replace demand with supply, or price with income... eg. elasticity(100-x^2, 3) calculates the demand elasticity when the price is 3 for the function "Q = 100 - x^2" where x is the default price variable. replace(diff(\x,\Z{x}),\Z,\y,1)*\y/replace(\x,\Z,\y) <_title>Demand function <_title>Price <_title>Price variable <_title>Sum-of-Years Digits Depreciation <_names>r:syd <_description>Calculates the sum-of-years digits depreciation for an asset based on its cost, salvage value, anticipated life, and a particular period. This method accelerates the rate of the depreciation, so that more depreciation expense occurs in earlier periods than in later ones. The depreciable cost is the actual cost minus the salvage value. The useful life is the number of periods (typically years) over which the asset is depreciated. ((\x-\y)*(\z-\a+1)*2)/(\z*(\z+1)) <_title>Cost <_title>Salvage value <_title>Life <_title>Period <_title>Straight Line Depreciation <_names>r:sln <_description>Determines the straight line depreciation of an asset for a single period. Cost is the amount you paid for the asset. Salvage is the value of the asset at the end of the period. Life is the number of periods over which the asset is depreciated. SLN divides the cost evenly over the life of an asset. (\x-\y)/\z <_title>Cost <_title>Salvage value <_title>Life <_title>Present Value <_names>r:pv <_description>Returns the present value of an investment. If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. (-\A{0}-\z*(1+\x*\B{0})*(((1+\x)^\y-1)/\x))/((1+\x)^\y) <_title>Interest rate <_title>Number of periods <_title>Payment made each period <_title>Future value <_title>Type <_title>Nominal Interest Rate <_names>r:nominal <_description>Calculates the nominal interest rate from a given effective interest rate compounded at given intervals. \y*(abs((\x+1)^(1/\y))-1) <_title>Effective interest rate <_title>Periods <_title>Zero Coupon <_names>r:zero_coupon <_description>Calculates the value of a zero-coupon (pure discount) bond. \x/((1+\y)^\z) <_title>Face value <_title>Interest rate <_title>Years <_title>Treasury Bill Yield <_names>r:tbillyield <_description>Returns the yield for a treasury bill. (100-\z)/\z*(360/days(\x,\y,1,1)) <_title>Settlement date <_title>Maturity date <_title>Price per $100 face value <_title>Treasury Bill Price <_names>r:tbillprice <_description>Returns the price per $100 value for a treasury bill. 100*(1-(\z*days(\x,\y,1,1))/360) <_title>Settlement date <_title>Maturity date <_title>Discount rate <_title>Treasury Bill Equivalent <_names>r:tbilleq <_description>Returns the bond equivalent for a treasury bill. 365*\z/(360-\z*days(\x,\y,1,1)) <_title>Settlement date <_title>Maturity date <_title>Discount rate <_title>Interest paid on a given period of an investment (ISPMT) <_names>r:ispmt <_description>Calculates the interest paid on a given period of an investment. (-\a*\x)-((-\a*\x)/\z*\y) <_title>Periodic interest rate <_title>Amortizement period 1 <_title>Number of periods 1 <_title>Present value <_title>Payment for a loan <_names>r:pmt <_description>Returns the amount of payment (negative) each period for a loan based on a constant interest rate and constant payments (each payment is equal amount). If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. Note that the interest rate here refers to the rate for each period and if you calculate with an annual rate, each period will be interpreted as a whole year. To get monthly payments divide the annual interest rate by 12 and enter the total number of months (12 times number of year) in the periods field. $name(2%/12, 10*12, 100000€) = -€920 (-\z*((1+\x)^\y)-\A{0})/((1+\x*\B{0})*(((1+\x)^\y-1)/\x)) <_title>Rate <_title>Number of periods <_title>Present value <_title>Future value <_title>Type <_title>Periods of an investment <_names>r:nper <_description>Calculates number of periods of an investment based on periodic constant payments and a constant interest rate. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. ln((\y*(1+\x*\B{0})-\A{0}*\x)/(\z*\x+\y*(1+\x*\B)))/ln(1+\x) <_title>Interest rate <_title>Payment made each period <_title>Present value <_title>Future value <_title>Type <_title>Periods for investment to attain desired value <_names>r:g_duration <_description>Returns the number of periods needed for an investment to attain a desired value. ln(\z/\y)/ln(1+\x) <_title>Rate <_title>Present value <_title>Future value <_title>Payment of an annuity going towards principal (PPMT) <_names>r:ppmt <_description>Calculates the amount of a payment of an annuity going towards principal. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. ((-\a*(pow(1+\x,\z))-\B{0})/((1+\x*\C{0})*((pow(1+\x,\z)-1)/\x)))+(\a*pow(1+\x,(\y-1))+((-\a*(pow(1+\x,\z))-\B)/((1+\x*\C)*((pow(1+\x,\z)-1)/\x)))*((pow(1+\x,(\y-1))-1)/\x))*\x <_title>Periodic interest rate <_title>Amortizement period 1 <_title>Number of periods 1 <_title>Present value <_title>Desired future value <_title>Type <_title>Effective Interest Rate <_names>r:effect <_description>Calculates the effective interest for a given nominal rate. (1+\x/\y)^\y-1 <_title>Nominal interest rate <_title>Periods <_title>Future Value <_names>r:fv <_description>Computes the future value of an investment. This is based on periodic, constant payments and a constant interest rate. If type = 1 then the payment is made at the beginning of the period, If type = 0 (or omitted) it is made at the end of each period. -(\A{0}*((1+\x)^\y)+\z*(1+\x*\B{0})*(((1+\x)^\y-1)/\x)) <_title>Interest rate <_title>Number of periods <_title>Payment made each period <_title>Present value <_title>Type <_title>Return on continuously compounded interest <_names>r:continuous <_description>Calculates the return on continuously compounded interest, given the principal, nominal rate and time in years. \x*exp(\y*\z) <_title>Principal <_title>Interest rate <_title>Years <_title>Compound <_names>r:compound <_description>Returns the value of an investment, given the principal, nominal interest rate, compounding frequency and time. \x*(1+\y/\z)^(\z*\a) <_title>Principal <_title>Nominal interest rate <_title>Periods per year <_title>Years <_title>Payment of an annuity going towards interest (IPMT) <_names>r:ipmt <_description>Calculates the amount of a payment of an annuity going towards interest. Type defines the due date. 1 for payment at the beginning of a period and 0 (default) for payment at the end of a period. -(\a*pow(1+\x,(\y-1))+((-\a*(pow(1+\x,\z))-\B)/((1+\x*\C)*((pow(1+\x,\z)-1)/\x)))*((pow(1+\x,(\y-1))-1)/\x))*\x <_title>Periodic interest rate <_title>Period 1 <_title>Number of periods 1 <_title>Present value <_title>Future value <_title>Type <_title>Interest rate for a fully invested security <_names>r:intrate <_description>Returns the interest rate for a fully invested security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. (\a-\z)/\z/yearfrac(\x,\y,\B{0},1) <_title>Settlement date <_title>Maturity date <_title>Investment <_title>Redemption <_title>Day counting basis 0 4 <_title>Dollar Fraction <_names>r:dollarfr <_description>Converts a decimal dollar price into a dollar price expressed as a fraction. int(\x)+frac(\x)*\y/10^ceil(log(\y)) <_title>Decimal dollar <_title>Denominator of fraction 1 <_title>Dollar Decimal <_names>r:dollarde <_description>Converts a dollar price expressed as a fraction into a dollar price expressed as a decimal number. int(\x)+frac(\x)*10^ceil(log(\y))/\y <_title>Fractional dollar <_title>Denominator of fraction 1 <_title>Amount received at maturity for a security bond <_names>r:received <_description>Returns the amount received at the maturity date for an invested security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. The settlement date must be before maturity date. \z/(1-\a*yearfrac(\x,\y,\B{0},1)) <_title>Settlement date <_title>Maturity date <_title>Investment <_title>Discount rate <_title>Day counting basis 0 4 <_title>Discount rate for a security <_names>r:disc <_description>Returns the discount rate for a security. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. (\a-\z)/\a/yearfrac(\x,\y,\B{0},1)) <_title>Settlement date <_title>Maturity date <_title>Price per $100 face value <_title>Redemption <_title>Day counting basis 0 4 <_title>Accrued interest of security paying at maturity <_names>r:accrintm <_description>Returns the accrued interest for a security which pays interest at maturity date. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. \A{1000}*\z*yearfrac(\x,\y,\B{0},1) <_title>Issue date <_title>Settlement date <_title>Annual rate of security <_title>Par value <_title>Day counting basis 0 4 <_title>Accrued interest of security with periodic interest payments <_names>r:accrint <_description>Returns accrued interest for a security which pays periodic interest. Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. \b*\a/\c*\c*yearfrac(\x,\z,\D{0},1)+\y*0 <_title>Issue date <_title>First interest <_title>Settlement date <_title>Annual rate of security <_title>Par value <_title>Frequency 1 4 <_title>Day counting basis 0 4 <_title>Number of coupons to be paid <_names>r:coupnum <_description>Returns the number of coupons to be paid between the settlement and the maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. trunc(yearfrac(\x,\y,\A{0},1)*\z) <_title>Settlement date <_title>Maturity date <_title>Frequency 1 12 <_title>Day counting basis 0 4 <_title>Price per $100 face value of a discounted security <_names>r:pricedisc <_description>Calculates and returns the price per $100 face value of a discounted security. The security does not pay interest at maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. \a-\z*\a*yearfrac(\x,\y,\B{0},1) <_title>Settlement date <_title>Maturity date <_title>Discount <_title>Redemption <_title>Day counting basis 0 4 <_title>Price per $100 face value of a security <_names>r:pricemat <_description>Calculates and returns the price per $100 face value of a security. The security pays interest at maturity. Basis is the type of day counting you want to use: 0: US 30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360. (100+yearfrac(\z,\y,\C{0},1)*\a*100)/(1+yearfrac(\x,\y,\C,1)*\b)-yearfrac(\z,\x,\C,1)*\a*100 <_title>Settlement date <_title>Maturity date <_title>Issue date <_title>Discount rate <_title>Annual yield <_title>Day counting basis 0 4 <_title>Level-Coupon Bond <_names>r:level_coupon <_description>Calculates the value of a level-coupon bond. (\y*\x/\z)*((1-1/(((1+(\b/\z))^(\a*\z))))/(\b/\z))+(\x/((1+(\b/\z))^(\a*\z))) <_title>Face value <_title>Coupon rate <_title>Coupons per year <_title>Years <_title>Market interest rate libqalculate-2.8.2/data/units.xml0000644000175000017500000040737113374225247013730 00000000000000 !units!Length Longueur Lengte Längd 长度 SI Meter Mètre ç±³ ar:m,meter,p:meters,metre,p:metres a:m,meter,p:meters a:m,meter Kilometer Kilomètre åƒç±³ r:km_c m 3 1 Decimeter Décimètre 分米 r:dm_c m -1 1 Centimeter Centimètre Centimeter 厘米 r:cm_c m -2 1 Millimeter Millimètre Milimeter 毫米 r:mm_c m -3 1 Nautical Mile Nautische mijl Sjömil 海里 r:nautical_mile,p:nautical_miles nautische_mijl,p:nautische_mijlen sjömil m 1852 1 Ångström Ã…ngström aru:Å,u:ångström,angstrom true m 1E-10 1 U.S. Survey Inch US Survey ar:US_in,US_inch,p:US_inches m 100/3937 1 Inch Pouce Tum 英寸 Imperial/US ar:in,inch,p:inches tum,a:in,inch m 0.0254 1 Hand Imperial/US r:hand,p:hands in 4 1 2 Foot Pied Voet Engelsk Fot 英尺 Imperial/US ar:ft,foot,p:feet hand 3 1 1 U.S. Survey Foot US Survey ar:US_ft,US_foot,p:US_feet US_in 12 1 1 Link Länk Imperial/US ar:li,link,p:links in 7.92 1 3 Yard ç  Imperial/US ar:yd,yard,p:yards ft 3 1 1 Rod (pole/perch) US Survey ar:rd,rod,p:rods US_ft 16.5 1 2 Fathom Vadem Famn 英寻 Imperial/US r:fathom,p:fathoms vadem,p:vadems yd 2 1 2 Chain 链 Imperial/US ar:ch,chain,p:chains li 100 1 2 Furlong 弗隆 Imperial/US ar:fur,furlong,p:furlongs ch 10 1 2 Mile Mile Mijl 英里 Imperial/US ar:mi,mile,p:miles a:mi,mijl,p:mijlen yd 1760 1 1 U.S. Survey Mile US Survey ar:US_mi,US_mile,p:US_miles US_ft 5280 1 1 Mil (1/1000 in) 毫英寸(1/1000英寸) Imperial/US r:mil,p:mils in 0.001 1 Astronomical Unit Unité Astronomique Astronomische eenheid Astronomisk enhet 天文å•ä½ ar:AU,astronomical_unit,p:astronomical_units unité_astronomique,p:unités_astronomiques a:AU,astronomische_eenheid,p:astronomische_eenheden a:AU,astronomisk_enhet,p:astronomiska_enheter m 149578706600 1 Light Year Année Lumière Lichtjaar LjusÃ¥r 光年 ar:ly,lightyear,p:lightyears a:lj,lichtjaar,p:lichtjaren a:ly,ljusÃ¥r m 9460730472580800 1 Parsec ç§’å·®è· ar:pc,parsec,p:parsecs a:pc,parsek,p:parseks true AU 648000/pi 1 Pied du roi (French Royal Foot) Pied du roi (Franse koninklijke voet) r:pied_du_roi m 9000/27706 1 Pouce (French Royal Inch) Pouce (Franse koninklijke duim) r:pouce pied_du_roi 1/12 1 Ligne Ligne (1/40 inch) r:ligne pouce 1/12 1 Toise r:toise pied_du_roi 6 1 !units!Angle Angle Hoek Vinkel 角度 Plane Angle Angle Plan Vlakke hoek Planvinkel å¹³é¢è§’ true Meter per Meter Mètre par Mètre Meter per meter Meter per meter ç±³æ¯ç±³ r:m_p_m m 0 1 m 0 -1 SI Radian Radiaal Radian 弧度 ar:rad,radian,p:radians a:rad,radiaal,p:radialen false m_p_m 1 1 Degree Degré Graad Grad 度 ar:deg,au:°,degree,p:degrees a:grd,au:°,graad,p:graden a:deg,au:°,grad,p:grader false rad pi/180 1 Gradian (Gon) Grad (Gon) Gradient (Gon) ar:gra,gradian,p:gradians,gon,p:gons a:gra,grad,p:grads,gon,p:gons false rad pi/200 1 Arcminute Boogminuut BÃ¥gminut 弧分 ar:arcmin,arcminute,p:arcminutes boogminuut,p:boogminuten bÃ¥gminut,p:bÃ¥gminuter deg 1/60 1 Arcsecond Boogseconde BÃ¥gsekund å¼§ç§’ ar:arcsec,arcsecond,p:arcseconds boogseconde,p:boogseconden bÃ¥gsekund,p:bÃ¥gsekunder arcmin 1/60 1 Turn Slag r:turn,p:turns slag,p:slagen r:turn,p:turns deg 360 1 Solid Angle Angle Solide Ruimtehoek Rymdvinkel 立体角 true Square Meter per Square Meter Mètre Carré par Mètre Carré Vierkante meter per vierkante meter Kvadratmeter per kvadratmeter 平方米æ¯å¹³æ–¹ç±³ r:sqm_p_sqm m 0 2 m 0 -2 SI Steradian Steradiaal Steradian çƒé¢åº¦ ar:sr,steradian,p:steradians a:sr,steradiaal,p:steradialen m_p_m 1 1 Angular Acceleration Accélération Angulaire Hoekversnelling Vinkelacceleration 角加速度 SI Radians per Second Squared Radians par Seconde Carrée Radialen per seconde kwadraat Radianter per kvadratsekund 弧度æ¯å¹³æ–¹ç§’ r:rad_p_sqs rad 0 1 s 0 -2 Angular Velocity Hoeksnelheid Vinkelhastighet 角速度 SI Radians per Second Radians par Seconde Radialen per seconde Radianter per sekund 弧度æ¯ç§’ r:rad_p_s rad 0 1 s 0 -1 !units!Mass Masse Massa Massa è´¨é‡ SI Gram Gramme å…‹ ar:g,gram,p:grams a:g,gram,p:grammen a:g,gram Kilogram Kilogramme åƒå…‹ r:kg_c g 3 1 Hectogram Hectogramme Hektogram r:hg_c g 2 1 Metric Ton (Tonne) Tonne Métrique (Tonne) Metrische ton (Ton) Ton å…¬å¨ ar:t,tonne,p:tonnes,ton,p:tons a:t,ton,p:tonnen a:t,ton true g 1000000 1 Grain 格令 Troy ar:gr,grain,p:grains g 0.06479891 1 Pennyweight 本尼å¨ç‰¹ Troy ar:pwt,pennyweight,p:pennyweights gr 24 1 1 Ounce (troy) é‡‘è¡¡åˆ¶ç›Žå¸ Troy ar:oz_t,troy_ounce,p:troy_ounces pwt 20 1 1 Pound (troy) Pund (troy) 金衡制磅 Troy ar:lb_t,troy_pound,p:troy_pounds oz_t 12 1 1 Dram 英钱 Imperial/US ar:dr,dram,p:drams g 1.7718451953125 1 Ounce ç›Žå¸ Imperial/US ar:oz,ounce,p:ounces dr 16 1 Pound Pund 磅 Imperial/US ar:lb,pound,p:pounds oz 16 1 1 Short Hundredweight (Cental) US ar:cwt,hundredweight,cental,p:hundredweights,centals lb 100 1 Long Hundredweight Long hundredweight é•¿æ‹… Imperial ar:l_cwt,long_hundredweight,p:long_hundredweights lb 112 1 Short Ton Short ton çŸ­å¨ US ar:s_ton,short_ton,p:short_tons lb 2000 1 Long Ton Long ton é•¿å¨ Imperial ar:l_ton,long_ton,p:long_tons lb 2240 1 Stone Imperial r:stone,p:stones lb 14 1 2 Carat Karaat Karat 克拉 r:carat,p:carats karaat karat g 0.2 1 Pfund Pond r:pfund g 500 1 Zentner r:zentner r:zentner pfund 100 1 Density Densité Dichtheid Densitet 密度 SI Kilogram per Cubic Meter Kilogramme par Mètre Cube Kilogram per kubieke meter Kilogram per kubikmeter åƒå…‹æ¯ç«‹æ–¹ç±³ r:kg_p_cum g 3 1 m 0 -3 Gram per Cubic Decimeter Gramme par Décimètre Cube Gram per kubieke decimeter Gram per kubikdecimeter å…‹æ¯ç«‹æ–¹åˆ†ç±³ r:g_p_cudm g 0 1 m -1 -3 Gram per Cubic Centimeter Gramme par Centimètre Cube Gram per kubieke centimeter Gram per kubikcentimeter å…‹æ¯ç«‹æ–¹åŽ˜ç±³ r:g_p_cucm g 0 1 m -2 -3 Atomic Mass Masse Atomique Atommassa Gram per Mole Gramme par Mole Gram per mol Gram per mol å…‹æ¯æ‘©å°” r:g_p_mol g 0 1 mol 0 -1 Atomic Mass Unit Unité de Masse Atomique Atomaire massa-eenheid Atommassenhet 原å­è´¨é‡å•ä½ ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units AMU,atomaire_massa_eenheid,atomaire_massa_eenheden a:u,a:AMU,atommassenhet,p:atommassenheter g_p_mol 1 1 Dalton ar:Da,dalton,p:daltons true g_p_mol 1 1 Kilodalton Kilodalton r:kDa_c Da 3 1 Mass Fraction Massafractie MassbrÃ¥k è´¨é‡åˆ†æ•° SI Kilogram per Kilogram Kilogramme par Kilogramme Kilogram per kilogram Kilogram per kilogram åƒå…‹æ¯åƒå…‹ r:kg_p_kg g 3 1 g 3 -1 Time Temps Tijd Tid æ—¶é—´ SI Second Seconde Seconde Sekund ç§’ ar:s,second,p:seconds a:s,seconde,p:seconden a:s,sekund,p:sekunder Minute Minuut Minut 分 ar:min,minute,p:minutes a:min,minuut,p:minuten a:min,minut,p:minuter s 60 1 1 Hour Heure Uur Timme å°æ—¶ ar:h,hour,p:hours a:h,uur,p:uren a:h,timme,p:timmar min 60 1 1 Day Jour Dag Dag æ—¥ ar:d,day,p:days jour,p:jours a:d,dag,p:dagen a:d,dag,day,p:dagar,days h 24 1 1 Week Semaine Vecka 周 r:week,p:weeks week,p:weken vecka,p:veckor day 7 1 2 Fortnight 两星期 r:fortnight,p:fortnights week 2 1 Julian Year Juliaans jaar Julianskt Ã¥r 儒略年 r:year,p:years jaar,p:jaren Ã¥r d 365.25 1 2 Month Mois Maand MÃ¥nad 月份 r:month,p:months a:mÃ¥nad,p:mÃ¥nader d 30.4375 1 !units!Frequency Fréquence Frequentie Frekvens 频率 SI Hertz 赫兹 ar:Hz,hertz s 1 -1 Electricity Électricité Elektriciteit Elektricitet 电学 Electric Current Courant Électrique Elektrische stroom Elektrisk ström ç”µæµ SI Ampere Ampère Ampere 安培 ar:A,ampere,p:amperes ampère,p:ampères a:A,ampere CGS Abampere Abampere ç»å¯¹å®‰åŸ¹ r:abampere,a:abA,a:aA,p:abamperes A 10 1 Current Density Densité de Courant Stroomdichtheid Strömtäthet 电æµå¯†åº¦ SI Ampere per Meter Squared Ampère par mètre Carré Ampere per meter kwadraat Ampere per kvadratmeter 安培æ¯å¹³æ–¹ç±³ r:A_p_sqm A 0 1 m 0 -2 Electric Charge Charge Électrique Elektrische lading Elektrisk laddning ç”µè· Second Ampere Ampère Seconde Seconde ampere Sekundampere 秒安培 r:s_A s 0 1 A 0 1 SI Coulomb Coulomb 库仑 ar:C,coulomb,p:coulombs a:C,coulomb s_A 1 1 CGS Abcoulomb Abcoulomb ç»å¯¹åº“伦 r:abcoulomb,p:abcoulombs,a:abC,a:aC C 10 1 CGS Statcoloumb (Franklin) r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins C 1/2997924580 1 Electric Charge Density Densité de Charge Électrique Elektrische ladingsdichtheid Laddningstäthet 电è·å¯†åº¦ SI Coulomb per Cubic Meter Coulomb par Mètre Cube Coulomb per kubieke meter Coulomb per kubikmeter 库仑æ¯ç«‹æ–¹ç±³ r:C_p_cum C 0 1 m 0 -3 Electric Flux Density Elektrische fluxdichtheid Elektrisk flödestäthet 电通密度 SI Coulomb per Meter Squared Coulomb par Mètre Carré Coulomb per vierkante meter Coulomb per kvadratmeter 库仑æ¯å¹³ç±³ r:C_p_sqm C 0 1 m 0 -2 Electric Potential Potentiel Électrique Elektrische potentiaal Elektrisk potential 电势 Watt per Ampere Watt par Ampère Watt per ampere Watt per ampere 瓦æ¯å®‰åŸ¹ r:W_p_A W 0 1 A 0 -1 SI Volt ä¼ç‰¹ ar:V,volt,p:volts a:V,volt W_p_A 1 1 CGS Statvolt é™ä¼ç‰¹ r:statvolt,p:statvolts,a:statV V 299.792458 1 CGS Abvolt Abvolt ç»å¯¹ä¼ç‰¹ r:abvolt,p:abvolts,a:abV V 1E-8 1 Capacitance Capaciteit Kapasitans 电容 Coulomb per Volt Coulomb par Volt Coulomb per volt Coloumb per volt 库仑æ¯ä¼ç‰¹ r:C_p_V C 0 1 V 0 -1 SI Farad 法拉 ar:F,farad,p:farads a:F,farad C_p_V 1 1 Electric Resistance Résistance Électrique Elektrische weerstand Resistans 电阻 SI Volt per Ampere Volt par Ampère Volt per ampere Volt per ampere ä¼ç‰¹æ¯å®‰åŸ¹ r:V_p_A V 0 1 A 0 -1 SI Ohm 欧姆 au:Ω,r:ohm,p:ohms au:Ω,ohm au:Ω,ohm V_p_A 1 1 CGS Abohm Abohm ç»å¯¹å•使¬§å§† r:abohm,p:abohms,au:abΩ ohm 1E-9 1 CGS Statohm 陿¬§å§† r:statohm,p:statohms,au:statΩ ohm 8.9875517873681764E11 1 Electric Conductance Conductance Électrique Elektrisch geleidingsvermogen Induktion 电导 Ampere per Volt Ampère par Volt Ampere per volt Ampere per volt 安培æ¯ä¼ç‰¹ r:A_p_V A 0 1 V 0 -1 SI Siemens ar:S,siemens A_p_V 1 1 Electric Field Strength Elektrische veldsterkte Elektrisk fältstyrka 电场强度 SI Volt per Meter Volt par Mètre Volt per meter Volt per meter ä¼ç‰¹æ¯ç±³ r:V_p_m V 0 1 m 0 -1 Permittivity Permittivité Permittiviteit Permitivitet 电容率 SI Farad per Meter Farad par mètre Farad per meter Farad per meter 法拉æ¯ç±³ r:F_p_m F 0 1 m 0 -1 Inductance Zelfinductie Induktans 电感 Weber per Ampere Weber per ampere Weber per ampere 韦伯æ¯å®‰åŸ¹ r:Wb_p_A Wb 0 1 A 0 -1 SI Henry 亨利 ar:H,henry,p:henrys a:H,henry Wb_p_A 1 1 Permeability Permeabiliteit Permeabilitet ç£å¯¼çއ SI Henry per Meter Henry par Mètre Henry per meter Henry per meter 亨利æ¯ç±³ r:H_p_m H 0 1 m 0 -1 Temperature Température Temperatuur Temperatur 温度 SI Kelvin Kelvin 开尔文 ar:K,kelvin,p:kelvins a:K,kelvin SI Degree Celsius Degré Celsius Graden Celsius Grader Celsius æ‘„æ°åº¦ ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades ar:oC,au:°C,au:℃,r:celsius false K \x + 273.15 \x - 273.15 1 Degree Rankine Degrés Rankine Graden Rankine Grader Rankine åŽæ°åº¦ Imperial/US ar:oR,au:°R,r:rankine K 5/9 1 Degree Fahrenheit Degrés Fahrenheit Graden Fahrenheit Grader Fahrenheit åŽæ°åº¦ Imperial/US ar:oF,au:°F,au:℉,r:fahrenheit K (\x+459.67)*5/9 (\x*9/5)-459.67 1 Substance Stofhoeveelheid Substans 物质 SI Mole Mole Mol Mol æ‘©å°” ar:mol,mole,p:moles a:mol,mol,p:molen mol Einstein çˆ±å› æ–¯å¦ r:einstein,p:einsteins einstein Substance Concentration Concentratie van stof Substanskoncentration 物质浓度 SI Mole per Cubic Meter Mole par Mètre Cube Mol per kubieke meter Mol per kubikmeter æ‘©å°”æ¯å¹³ç±³ r:mol_p_cum mol 0 1 m 0 -3 Catalytic Activity Activité Catalytique Katalitische activiteit Katalytisk aktivitet 催化活性 Reciprocal Seconds Mole Omgekeerde seconden mol Reciproka sekundmol r:recs_mol mol 0 1 s 0 -1 SI Katal å¡å¡”å°” ar:kat,katal,p:katals a:kat,katal recs_mol 1 1 Catalytic Concentration Concentration Catalytique Catalitische concentratie Katalytisk koncentration 催化浓度 SI Katal per Cubic Meter Katal per kubieke meter Katal per kubikmeter å¡å¡”å°”æ¯ç«‹æ–¹ç±³ r:kat_p_cum kat 0 1 m 0 -3 Light Lumière Licht Ljus 光学 Luminous Intensity Intensité Lumineuse Lichtsterkte Luminansintensitet å‘光强度 SI Candela Candela ar:cd,candela,p:candelas a:cd,candela Luminance Luminantie Luminans 亮度 SI Candela per Meter Squared Candela par mètre carré Candela per vierkante meter Candela per kvadratmeter r:cd_p_sqm cd 0 1 m 0 -2 CGS Stilb 熙æ ar:sb,stilb,p:stilbs cd_p_sqm 10000 1 Luminous Flux Flux Lumineux Lichtstroom Luminansflöde å…‰é€šé‡ Candela Steradian Candela-steradiaal Candelasteradian r:cd_sr cd 0 1 sr 0 1 SI Lumen æµæ˜Ž ar:lm,lumen,p:lumens a:lm,lumen a:lm,lumen cd_sr 1 1 Illuminance Verlichtingssterkte Illuminans 照度 Lumen per Meter Squared Lumen per vierkante meter Lumen per kvadratmeter æµæ˜Žæ¯å¹³ç±³ r:lm_p_sqm lm 0 1 m 0 -2 true Lumen per Foot Squared Lumen per vierkante voet Lumen per kvadratfor æµæ˜Žæ¯å¹³æ–¹è‹±å°º r:lm_p_sqft lm 0 1 ft 0 -2 SI Lux å‹’å…‹æ–¯ ar:lx,lux lm_p_sqm 1 1 Foot-Candle Imperial/US ar:fc,footcandle,p:footcandles lm_p_sqft 1 1 CGS Phot å¹…é€ ar:ph,phot,p:phots lx 10000 1 Radiant Intensity Stralingsintensiteit StrÃ¥lningsstyrka è¾å°„强度 Watt per Steradian Watt par Stéradian Watt per steradiaal Watt per steradian 瓦æ¯çƒé¢åº¦ r:W_p_sr W 0 1 sr 0 -1 Irradiance Irradiantie Irradians è¾ç…§åº¦ SI Watt per Meter Squared Watt par Mètre Carré Watt per meter kwadraat Watt per kvadratmeter 瓦æ¯å¹³ç±³ r:W_p_sqm W 0 1 m 0 -2 Einstein per Meter Squared per Second Einstein par Mètre Carré par Seconde Einstein per vierkante meter per seconde Einsteins per kvadratmeter per sekund çˆ±å› æ–¯å¦æ¯å¹³æ–¹ç±³æ¯ç§’ r:einstein_p_sqm_p_s einstein 0 1 m 0 -2 s 0 -1 Microeinstein per Meter Squared per Second Microeinstein par Mètre Carré par Seconde Micro-einstein per vierkante meter per seconde Kikroeinstein per kvadratmeter per sekund r:microeinstein_p_sqm_p_s einstein -6 1 m 0 -2 s 0 -1 Radiance Radiantie Radians è¾å°„率 SI Watt per Square Meter Steradian Watt par Mètre Carré Stéradian Watt per vierkante meter per steradiaal Watt per steradiankvadratmeter 瓦æ¯å¹³ç±³çƒé¢åº¦ r:W_p_sqm_sr W 0 1 sr 0 -1 m 0 -2 Area Aire Oppervlak é¢ç§¯ SI Square Meter Mètre Carré Vierkante meter Kvadratmeter 平方米 r:sqm m 0 2 Square Kilometer Kilomètre Carré Vierkante kilometer Kvadratkilometer 平方åƒç±³ r:sqkm m 3 2 Are Ar ar:a,are,p:ares a:a,ar,are m 100 2 true Hectare Hektar 公顷 ar:ha,hectare,p:hectares a:ha,hektar,hectare a 100 1 Decare Dekar a:da,r:decare,p:decares a:da,dekar,decare a 10 1 Barn é¶ ar:b,barn,p:barns m 1E-28 2 Rood Imperial r:rood,p:roods yd 1210 2 Acre 英亩 Imperial r:acre,p:acres ch 10 2 Section Sectie US Survey r:section,p:sections sectie,p:secties US_mi 1 2 Township US Survey r:township,p:townships section 36 1 1 Square Foot Pied Carré Vierkante voet Kvadratfot 平方英尺 Imperial/US r:sqft ft 0 2 Square Inch Pouce Carré Vierkante inch Kvadrattum 平方英寸 Imperial/US r:sqin in 0 2 Square Mile Mile Carrée Vierkante mijl Kvadratmile 平方英里 Imperial/US r:sqmi mi 0 2 Volume Volym 体积 SI Cubic Meter Mètre Cube Kubieke meter Kubikmeter 立方米 r:cum m 0 3 Liter Litre å‡ ar:L,a:l,liter,p:liters,litre,p:litres litre,p:litres a:L,a:l,liter,p:liters a:L,a:l,liter m 0.001 3 Milliliter Millilitre Mililiter æ¯«å‡ r:ml_c l -3 1 Centiliter Centilitre Centiliter åŽ˜å‡ r:cl_c l -2 1 Deciliter Décilitre åˆ†å‡ r:dl_c l -1 1 Cubic Inch Pouce Cube Kubieke inch Kubiktum 立方英寸 Imperial/US r:cuin in 0 3 Fuel Economy Brandstofgebruik Bränsleförbrukning ç‡ƒæ–™ç»æµŽ Liter per Kilometer Litre par Kilomètre Liter per kilometer Liter per kilometer 凿¯åƒç±³ r:l_p_km l 0 1 m 3 -1 Kilometer per Liter Kilomètre par Litre Kilometer per liter Kilometer per liter åƒç±³æ¯å‡ r:km_p_l m 3 1 l 0 -1 true Miles per Gallon Miles par Gallon 英里æ¯åР仑 US r:mile_p_gal mi 0 1 gal 0 -1 Miles per Gallon Miles par Gallon 英里æ¯åР仑 US a-cr:mpg a-cr:mpg mile_p_gal 1 1 Cooking Cuisine Koken Matlagning 烹饪 Teaspoon Theelepel Tesked 茶匙 r:teaspoon,p:teaspoons theelepel,p:theelepels tesked,p:teskedar L 0.005 1 1 Dessertspoon Cuillère à Dessert Dessertlepel Dessertsked 点心匙 r:dessertspoon,p:dessertspoons dessertlepel,p:dessertlepels dessertsked,p:dessertskedar teaspoon 2 1 2 Tablespoon Eetlepel Matsked 汤匙 r:tablespoon,p:tablespoons eetlepel,p:eetlepels matsked,p:matskedar teaspoon 3 1 1 Cup (U.S.) US r:cup,p:cups kop,p:koppen L 0.2365882365 1 Imperial Capacity Imperial Fluid Ounce Imperial ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces L 0.0284130625 1 Imperial Gill Imperial ar:UK_gi,imperial_gill,p:imperial_gills UK_fl_oz 5 1 2 Imperial Pint Imperial ar:UK_pt,imperial_pint,p:imperial_pints UK_gi 4 1 1 Imperial Quart Imperial ar:UK_qt,imperial_quart,p:imperial_quarts UK_pt 2 1 2 Imperial Gallon Imperial ar:UK_gal,imperial_gallon,p:imperial_gallons UK_qt 4 1 1 Imperial Minim Imperial r:imperial_minim,p:imperial_minims UK_fl_oz 1/480 1 Imperial Fluid Scuple Imperial r:imperial_fluid_scuple,p:imperial_fluid_scuples imperial_minim 20 1 Imperial Fluid Drachm Imperial ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms imperial_fluid_scuple 3 1 Imperial Bushel Imperial ar:UK_bu,imperial_bushel,p:imperial_bushels UK_gal 8 1 1 U.S. Capacity U.S. Fluid Ounce US ar:fl_oz,fluid_ounce,p:fluid_ounces in 231/128 3 U.S. Gill US ar:gi,gill,p:gills fl_oz 4 1 U.S. Liquid Pints US ar:liq_pt,liquid_pint,p:liquid_pints gi 4 1 U.S. Liquid Quarts US ar:liq_qt,liquid_quart,p:liquid_quarts liq_pt 2 1 U.S. Minim US r:minim,p:minims fl_oz 1/480 1 U.S. Fluid Drachm US ar:fl_dr,fluid_drachm,p:fluid_drachms minim 60 1 U.S. Dry Pint US ar:dry_pt,dry_pint,p:dry_pints in 33.6003125 3 U.S. Dry Quart US ar:dry_qt,dry_quart,p:dry_quarts dry_pt 2 1 U.S. Peck US ar:pk,peck,p:pecks dry_qt 8 1 U.S. Bushel US ar:bu,bushel,p:bushels pk 4 1 U.S. Gallon US ar:gal,gallon,p:gallons liq_qt 4 1 U.S. Barrel (oil) US ar:bbl,barrel,p:barrels gal 42 1 Specific Volume Soortelijk volume Specifik volym SI Cubic Meter per Kilogram Mètre Cube par Kilogramme Kubieke meter per kilogram Kubikmeter per kilogram 立方米æ¯å…¬æ–¤ r:cum_p_kg m 0 3 g 3 -1 Speed Vitesse Snelheid Hastighet 速度 SI Meter per Second Mètre par Seconde Meter per seconde Meter per sekund ç±³æ¯ç§’ r:m_p_s m 0 1 s 0 -1 Kilometer per Hour Kilomètre par Heure Kilometer per uur Kilometer per timme åƒç±³æ¯å°æ—¶ r:km_p_h m 3 1 h 0 -1 Nautical Mile per Hour Nautische mijl per uur Sjömil per timme 海里æ¯å°æ—¶ r:nautical_mile_p_h nautical_mile 0 1 h 0 -1 Knot Noeud Knoop Knop 节 r:knot,p:knots knoop,p:knopen knop nautical_mile_p_h 1 1 true Miles per Hour Miles par Heure Miles per Hour 英里æ¯å°æ—¶ Imperial/US r:mile_p_h mi 0 1 h 0 -1 Miles per Hour Miles par Heure Miles per Hour 英里æ¯å°æ—¶ Imperial/US a-cr:mph mile_p_h 1 1 Acceleration Accélération Versnelling Acceleration 加速度 SI Meter per Second Squared Mètre par Seconde Carrée Meter per seconde kwadraat Meter per kvadratsekund ç±³æ¯å¹³æ–¹ç§’ r:m_p_sqs m 0 1 s 0 -2 Galileo 伽利略 ar:Gal,galileo,p:galileos a:Gal,galileo m_p_sqs 1/100 1 Gee r:gee,p:gees m_p_sqs 9.80665 1 Magnetism Magnétisme Magnetisme Magnetism ç£å­¦ Wave Number Golfgetal VÃ¥gtal 波数 SI Reciprocal Meter Omgekeerde meter Reciproka meter r:recm m 0 -1 Magnetic Field Strength Magnetische veldsterkte Magnetisk fältstyrka ç£åœºå¼ºåº¦ SI Ampere per Meter Ampère par mètre Ampere per meter Ampere per meter 安培æ¯ç±³ r:A_p_m A 0 1 m 0 -1 CGS Oersted 奥斯特 ar:Oe,oersted,p:oersteds Oe,oersted,oersteds a:Oe,oersted A_p_m 1000/(4*pi) 1 Magnetic Flux Flux Magnétique Magnetische flux Magnetiskt flöde ç£é€šé‡ Volt Seconds Volt Seconde Volt seconden Voltsekund ä¼ç‰¹ç§’ r:V_s V 0 1 s 0 1 SI Weber 韦伯 ar:Wb,weber,p:webers a:Wb,weber V_s 1 1 CGS Maxwell 麦克斯韦 ar:Mx,maxwell,p:maxwells a:Mx,maxwell Wb 1E-8 1 Magnetic Flux Density Densité de Flux Magnétique Magnetische fluxdichtheid Magnetisk flödestäthet ç£é€šå¯†åº¦ Weber per Meter Squared Weber per meter kwadraat Weber per kvadratmeter 韦伯æ¯å¹³ç±³ r:Wb_p_sqm Wb 0 1 m 0 -2 SI Tesla 特斯拉 ar:T,tesla,p:teslas a:T,tesla Wb_p_sqm 1 1 CGS Gauss 高斯 r:gauss T 0.0001 1 Force Kracht Kraft 力学 Meter Kilogram per Second Squared Mètre Kilogramme par Seconde Carrée Meter kilogram per seconde kwadraat Meterkilogram per kvadratsekund ç±³åƒå…‹æ¯å¹³æ–¹ç§’ r:m_kg_p_sqs m 0 1 g 3 1 s 0 -2 SI Newton 牛顿 ar:N,newton,p:newtons a:N,newton m_kg_p_sqs 1 1 CGS Dyne 达因 ar:dyn,dyne,p:dynes N 1E-5 1 Imperial Pound-force 磅力 ar:lbf,pound_force ar:lbf,pound_force N 4.4482216152605 1 true Pound Foot per Second Squared Pound Foot per seconde kwadraat Pundfot per kvadratsekund 磅英尺æ¯å¹³æ–¹ç§’ r:lb_ft_p_sqs lb 0 1 ft 0 1 s 0 -2 Imperial Poundal 磅达 r:poundal,p:poundals,a:pdl lb_ft_p_sqs 1 1 Pond (Gram-Force) Pond (gram-kracht) 克力 r:pond,p:ponds,a:gf pond,p:ponden,a:gf true N 0.00980665 1 Kilopond (Kilogram-Force) Kilopond (Kilogram-kracht) åƒå…‹åŠ› r:kpond_c pond 3 1 Moment of Force Moment de Force Krachtmoment Kraftmoment 力矩 SI Newton Meter Newton Mètre Newtonmeter Newtonmeter 牛顿米 r:N_m N 0 1 m 0 1 Pressure Pression Druk Tryck 压强 Newton per Meter Squared Newton par Mètre Carré Newton per vierkante meter Newton per kvadratmeter 牛顿æ¯å¹³ç±³ r:N_p_sqm N 0 1 m 0 -2 Pound-force per Square Inch Pound-force per inch kwadraat Pound-force per kvadrattum 磅力æ¯å¹³æ–¹è‹±å¯¸ Imperial/US true r:lbf_p_sqin lbf 0 1 in 0 -2 SI Pascal å¸•æ–¯å¡ ar:Pa,pascal,p:pascals a:Pa,pascal N_p_sqm 1 1 Pound-force per Square Inch (psi) Pound-force per inch kwadraat (psi) Pound-force per kvadrattum (psi) 磅力æ¯å¹³æ–¹è‹±å¯¸(psi) Imperial/US a-cr:psi lbf_p_sqin 1 1 Bar Bar å·´ r:bar,p:bars bar true Pa 100000 1 Atmosphere Atmosphère Atmosfeer Atmosfär 大气压 ar:atm,atmosphere,p:atmospheres atmosphère,p:atmosphères a:atm,atmosfeer a:atm,atmosfär,p:atmosfärer Pa 101325 1 Torr 托 r:torr,p:torrs atm 1/760 1 Millimeter of Mercury Millimètre de Mercure Milimeter kwik Millimeter kvicksilver 毫米汞柱 ar:mmHg atm 1/760 1 Inch of Mercury Inches kwik Fot kvicksilver 英寸汞柱 ar:inHg mmHg 25.4 1 Dynamic Viscosity Viscosité Dynamique Dynamische viscositeit Dynamisk viskositet 动æ€ç²˜åº¦ SI Pascal Second Pascal Seconde Pascal seconde Pascalsekund 帕斯å¡ç§’ r:Pa_s Pa 0 1 s 0 1 CGS Poise 泊 ar:P,poise,p:poises a:P,poise Pa_s 0.1 1 Kinematic Viscosity Kinematische viscositeit Kinematisk viskositet è¿åŠ¨ç²˜åº¦ Square Meter per Second Mètre Carré par Seconde Vierkante meter per seconde Kvadratmeter per sekund 平方米æ¯ç§’ r:sqm_p_s m 0 2 s 0 -1 CGS Stokes ar:St,stokes sqm_p_s 0.0001 1 Surface Tension Oppervlaktespanning Ytspänning 表é¢å¼ åŠ› SI Newton per Meter Newton par Mètre Newton per meter Newton per meter 牛顿æ¯ç±³ r:N_p_m N 0 1 m 0 -1 Energy Énergie Energie Energi èƒ½é‡ SI Joule 焦耳 ar:J,joule,p:joules a:J,joule N_m 1 1 Watt Hour Watt Heure Wattuur Watttimme ç“¦å°æ—¶ r:W_h W 0 1 h 0 1 Kilowatt Hour Kilowatt Heure Kilowattuur Kilowatttimme 度(åƒç“¦æ—¶) r:W_h W 3 1 h 0 1 Calorie (international table) Calorie (internationale tabel) Kalorier (international table) ais:cal_IT,ar:cal,c:calorie,cp:calories ais:cal_IT,a:cal,c:calorie,cp:calorieën ais:cal_IT,a:cal,c:kalori,cp:kalorier J 4.1868 1 Calorie (capital C) Calorie (hoofdletter C) Kalorier (med stort K) cr:Calorie,cp:Calories c:Calorie,cp:Calorieën cal 1000 1 Calorie (thermochemical) Calorie (thermochemisch) Kalorier (termokemiska) ars:cal_th as:cal_th J 4.184 1 Gram of TNT Gram TNT Gram TNT å…‹TNTå½“é‡ a-cr:gTNT,gramTNT cal_th 1000 1 Ton of TNT Ton TNT Ton TNT å¨TNTå½“é‡ a-cr:tTNT,tonTNT gTNT 1000000 1 Calorie (15 degrees Celsius) Calorie (15°C) Calorie (15 graden Celcius) Kalorier (15 grader Celsius) Calorie(15æ‘„æ°åº¦) ars:cal_fifteen as:cal_fifteen as:cal_femton J 4.185880 1 Calorie (mean) Calorie (moyenne) Calorie (gemiddeld) Kalorier (medel) ars:cal_mean as:cal_gemiddeld as:cal_medel J 4.19002 1 British Thermal Unit (IT) 英制热é‡å•ä½(IT) ar:Btu J 1055.056 1 Electron Volt Électron Volt Elektronvolt Elektronvolt 电å­ä¼ç‰¹ ar:eV,electron_volt,p:electron_volts a:eV,elektronvolt J 1.6021766208E-19 1 CGS Erg r:erg,p:ergs J 1E-7 1 Foe r:foe,p:foes erg 1E51 1 Imperial Foot-Pound Force r:ft_lbf ft 0 1 lbf 0 1 Hartree ar:Ha,as:E_h,hartree J 4.359744650E-18 1 Rydberg Rydberg ar:Ry,s:rydberg_unit ar:Ry,s:rydberg_enhet Ha 0.5 1 Specific Energy Soortelijke energie Specifik energi SI Joule per Kilogram Joule par Kilogramme Joule per kilogram Joule per kilogram 焦耳æ¯åƒå…‹ r:J_p_kg J 0 1 g 3 -1 Power Puissance Vermogen Effekt 功率 Joule per Second Joule par Seconde Joule per seconde Joule per sekund 焦耳æ¯ç§’ r:J_p_s J 0 1 s 0 -1 SI Watt Watt 瓦 ar:W,watt,p:watts a:W,watt J_p_s 1 1 Horse Power Paardekracht (Engels) Hästkraft 匹 ar:hp,horsepower,p:horsepowers a:hp,hästkraft,p:hästkrafter W 745.699987158227022 1 Pferdestärke Paardekracht (metrisch) ar:PS,u:pferdestärke pk,paardekracht,paardekrachten W 735.49875 1 Entropy Entropie Entropie Entropi 熵 SI Joule per Kelvin Joule par Kelvin Joule per Kelvin Joule per Kelvin 焦耳æ¯å¼€å°”æ–‡ r:J_p_K J 0 1 K 0 -1 Specific Entropy Soortelijke entropie Specifik entropi SI Joule per Kilogram Kelvin Joule par Kilogramme Kelvin Joule per kilogram Kelvin Joule per kilogram kelvin 焦耳æ¯åƒå…‹å¼€å°”æ–‡ r:J_p_kg_K J 0 1 g 3 -1 K 0 -1 Thermal Conductivity Conductivité Thermique Thermisch geleidingsvermogen Termisk konduktivitet 导热系数 SI Watt per Meter Kelvin Watt par Mètre Kelvin Watt per meter Kelvin Watt per meter kelvin 瓦æ¯ç±³å¼€å°”æ–‡ r:W_p_m_K W 0 1 m 0 -1 K 0 -1 Energy Density Densité d'Énergie Energiedichtheid Energitäthet 能é‡å¯†åº¦ SI Joule per Cubic Meter Joule par Mètre Cube Joule per kubieke meter Joule per kubikmeter 焦耳æ¯ç«‹æ–¹ç±³ r:J_p_cum J 0 1 m 0 -3 Molar Energy Énergie Molaire Molaire energie Molarenergi SI Joule per Mole Joule par Mole Joule per mol Joule per mol ç„¦è€³æ¯æ‘©å°” r:J_p_mol J 0 1 mol 0 -1 Molar Entropy Entropie Molaire Molaire entropy Molarentropi 摩尔熵 SI Joule per Mole Kelvin Joule par Mole Kelvin Joule per mol Kelvin Joule per mol kelvin ç„¦è€³æ¯æ‘©å°”开尔文 r:J_p_mol_K J 0 1 mol 0 -1 K 0 -1 Radioactivity Radioactivité Radioactiviteit Radioaktivitet 放射性 SI Becquerel Becquerel è´å¯ ar:Bq,becquerel,p:becquerels a:Bq,becquerel s 1 -1 Curie 居里 ar:Ci,curie,p:curies a:Ci,curie Bq 3.7E10 1 Absorbed Dose Dose Absorbée Absorptiedosis Absorberad dos 叿”¶å‰‚é‡ SI Gray 戈瑞 ar:Gy,gray,p:grays a:Gy,gray J_p_kg 1 1 Rad Rad r:rad_radioactivity rad_radioaktivitet Gy 1/100 1 Dose Equivalent Dosisequivalent Dosekvivalent 剂é‡å½“é‡ SI Sievert ar:Sv,sievert,p:sieverts a:Sv,sievert J_p_kg 1 1 Rem 人体伦ç´å½“é‡ r:rem_radioactivity rem_radioaktivitet Sv 1/100 1 Exposure Belichting Exponering ç…§å°„é‡ SI Coulomb per Kilogram Coulomb par Kilogramme Coulomb per kilogram Coloumb per kilogram 库仑æ¯åƒå…‹ r:C_p_kg C 0 1 g 3 -1 Roentgen Röntgen ä¼¦ç´ ar:R,roentgen,p:roentgens a:R,roentgen C_p_kg 0.000258 1 Absorbed Dose Rate Absorptiesnelheid Absorberad dosrat 剂é‡å¸æ”¶çއ SI Gray per Second Gray par Seconde Gray per seconde Gray per sekund 戈瑞æ¯ç§’ r:Gy_p_s Gy 0 1 s 0 -1 Ratio Verhouding 比值 Neper 奈培 ar:Np,neper,p:nepers a:Np,neper Bel è´ ar:B,bel,p:bels a:B,bel Np 0.5*ln(10) 1 Decibel Décibel åˆ†è´ r:dB_c B -1 1 Information Informatie ä¿¡æ¯ Bit Bit 比特 r:bit,p:bits bit,p:bitar true Byte (8-bit) Octet (8 bits) Byte (8-bit) 字节(8比特) r:byte,p:bytes,octet,p:octets byte,oktet true bit 8 1 Nibble Nibble åŠå­—节 r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets bit 4 1 Tribble r:tribble,p:tribbles nibble 3 1 Word (16-bit) Mot (16 bits) å­—(16比特) r:word,p:words woord,p:woorden bit 16 1 Kilobyte Kiloctet åƒå­—节 r:kbyte_c byte 3 1 Kibibyte Kibioctet r:Kibyte_c byte 10 1 Mebibyte Mébioctet r:Mibyte_c byte 20 1 Gibibyte Gibioctet r:Gibyte_c byte 30 1 Megabyte Mégaoctet 兆字节 r:Mbyte_c byte 6 1 Gigabyte Gigaoctet åƒå…†æ¯”特 r:Gbyte_c byte 9 1 Terabyte Téraoctet 万亿字节 r:Tbyte_c byte 12 1 Kilobit åƒæ¯”特 r:kbit_c bit 3 1 Kibibit r:Kibit_c bit 10 1 Mebibit Mébibit r:Mibit_c bit 20 1 Gibibit r:Gibit_c bit 30 1 Megabit Mégabit 兆比特 r:Mbit_c bit 6 1 Gigabit åƒå…†æ¯”特 r:Gbit_c bit 9 1 Terabit Térabit 万亿比特 r:Tbit_c bit 12 1 Typography Typografie Typografi å°åˆ· PostScript Point PostScipt-punkt ar:pt,a:pts,point,p:points punkt,point,p:punkter,p:points in 1/72 1 PostScript Pica PostScript-pica r:pica,p:picas pt 12 1 ATA Pica ATA-pica r:ata_pica,p:ata_picas in 0.166 1 ATA Point ATA-punkt r:ata_point,a:ata_pt,p:ata_points ata_pica 1/12 1 New Didot Point Nieuwe Didot Point Ny Didotpunkt r:new_didot nieuwe_didot m 0.000375 1 Didot Point Didotpunkt r:didot,a:dd pouce 1/72 1 Cicero r:cicero didot 12 1 libqalculate-2.8.2/data/elements.xml.in0000644000175000017500000006704513125703226014777 00000000000000 <_name>Hydrogen 9 1.008 20.271 13.99 0.00008988 1 1 <_name>Helium 10 4.002602 4.222 0.0001785 18 1 <_name>Lithium 1 6.94 1603 453.65 0.533 1 2 <_name>Beryllium 2 9.0121831 2742 1560 1.85 2 2 <_name>Boron 7 10.81 4200 2349 2.34 13 2 <_name>Carbon 8 12.011 2.267 14 2 <_name>Nitrogen 9 14.007 77.355 63.15 0.0012506 15 2 <_name>Oxygen 9 15.999 90.188 54.36 0.001429 16 2 <_name>Fluorine 9 18.998403163 85.04 53.48 0.001696 17 2 <_name>Neon 10 20.1797 27.104 24.56 0.0008999 18 2 <_name>Sodium 1 22.98976928 1156.090 370.944 0.971 1 3 <_name>Magnesium 2 24.305 1363 923 1.738 2 3 <_name>Aluminum 6 26.9815385 2743 933.47 2.698 13 3 <_name>Silicon 7 28.085 3538 1687 2.3296 14 3 <_name>Phosphorus 8 30.973761998 550 317.30 1.82 15 3 <_name>Sulfur 8 32.06 717.8 388.36 2.067 16 3 <_name>Chlorine 9 35.45 239.11 171.6 0.003214 17 3 <_name>Argon 10 39.948 87.302 83.81 0.0017837 18 3 <_name>Potassium 1 39.0983 1032 336.7 0.862 1 4 <_name>Calcium 2 40.078 1757 1115 1.54 2 4 <_name>Scandium 5 44.955908 3109 1814 2.989 3 4 <_name>Titanium 5 47.867 3560 1941 4.54 4 4 <_name>Vanadium 5 50.9415 3680 2183 6.11 5 4 <_name>Chromium 5 51.9961 2755 2180 7.15 6 4 <_name>Manganese 5 54.938044 2334 1519 7.44 7 4 <_name>Iron 5 55.845 3143 1811 7.874 8 4 <_name>Cobalt 5 58.933194 3200 1768 8.86 9 4 <_name>Nickel 5 58.6934 3002 1728 8.912 10 4 <_name>Copper 5 63.546 2835 1357.77 8.96 11 4 <_name>Zinc 5 65.38 1180 692.68 7.134 12 4 <_name>Gallium 6 69.723 2673 302.9146 5.907 13 4 <_name>Germanium 7 72.630 3106 1211.40 5.323 14 4 <_name>Arsenic 7 74.921595 887 1090 5.776 15 4 <_name>Selenium 8 78.971 958 494 4.809 16 4 <_name>Bromine 9 79.904 332.0 265.8 3.122 17 4 <_name>Krypton 10 83.798 119.735 115.78 0.003733 18 4 <_name>Rubidium 1 85.4678 961 312.45 1.532 1 5 <_name>Strontium 2 87.62 1650 1050 2.64 2 5 <_name>Yttrium 5 88.90584 3203 1799 4.469 3 5 <_name>Zirconium 5 91.224 4650 2128 6.506 4 5 <_name>Niobium 5 92.90637 5017 2750 8.57 5 5 <_name>Molybdenum 5 95.95 4912 2896 10.22 6 5 <_name>Technetium 5 [98] 4538 2430 11.5 7 5 <_name>Ruthenium 5 101.07 4423 2607 12.37 8 5 <_name>Rhodium 5 102.90550 3968 2237 12.41 9 5 <_name>Palladium 5 106.42 3236 1828.05 12.02 10 5 <_name>Silver 5 107.8682 2483 1234.93 10.501 11 5 <_name>Cadmium 5 112.414 1040 594.22 8.69 12 5 <_name>Indium 6 114.818 2345 429.75 7.31 13 5 <_name>Tin 6 118.710 2875 505.08 7.287 14 5 <_name>Antimony 7 121.760 1908 903.78 6.685 15 5 <_name>Tellurium 7 127.60 1261 722.66 6.232 16 5 <_name>Iodine 9 126.90447 457.4 386.85 4.93 17 5 <_name>Xenon 10 131.293 165.051 161.40 0.005887 18 5 <_name>Cesium 1 132.90545196 944 301.7 1.873 1 6 <_name>Barium 2 137.327 1910 1000 3.596 2 6 <_name>Lanthanum 3 138.9054 3737 1193 6.145 3 9 <_name>Cerium 3 140.116 3716 1068 6.77 4 9 <_name>Praseodymium 3 140.90766 3403 1208 6.773 5 9 <_name>Neodymium 3 144.242 3347 1297 7.007 6 9 <_name>Promethium 3 [145] 3273 1315 7.26 7 9 <_name>Samarium 3 150.36 2173 1345 7.52 8 9 <_name>Europium 3 151.964 1802 1099 5.243 9 9 <_name>Gadolinium 3 157.25 3273 1585 7.895 10 9 <_name>Terbium 3 158.92535 3396 1629 8.229 11 9 <_name>Dysprosium 3 162.500 2840 1680 8.55 12 9 <_name>Holmium 3 164.93033 2873 1734 8.795 13 9 <_name>Erbium 3 167.259 3141 1802 9.066 14 9 <_name>Thulium 3 168.93422 2223 1818 9.321 15 9 <_name>Ytterbium 3 173.045 1703 1097 6.965 16 9 <_name>Lutetium 3 174.9668 3675 1925 9.84 3 6 <_name>Hafnium 5 178.49 4876 2506 13.31 4 6 <_name>Tantalum 5 180.94788 5731 3290 16.654 5 6 <_name>Tungsten 5 183.84 6203 3695 19.25 6 6 <_name>Rhenium 5 186.207 5869 3459 21.02 7 6 <_name>Osmium 5 190.23 5285 3306 22.61 8 6 <_name>Iridium 5 192.217 4403 2719 22.56 9 6 <_name>Platinum 5 195.084 4098 2041.4 21.46 10 6 <_name>Gold 5 196.966569 3129 1337.33 19.282 11 6 <_name>!elements!Mercury 5 200.592 629.88 234.32 13.5336 12 6 <_name>Thallium 6 204.38 1746 577 11.85 13 6 <_name>Lead 6 207.2 2022 600.61 11.342 14 6 <_name>Bismuth 6 208.98040 1837 544.7 9.807 15 6 <_name>Polonium 6 [209] 1235 527 9.32 16 6 <_name>Astatine 7 [210] 575 7 17 6 <_name>Radon 10 [222] 211.5 202 0.00973 18 6 <_name>Francium 1 [223] 300 1.87 1 7 <_name>Radium 2 [226] 2010 973 5.5 2 7 <_name>Actinium 4 [227] 3471 1323 10.07 3 10 <_name>Thorium 4 232.0377 5061 2115 11.72 4 10 <_name>Protactinium 4 231.03588 1841 15.37 5 10 <_name>Uranium 4 238.02891 4404 1405.3 18.95 6 10 <_name>Neptunium 4 [237] 4273 917 20.45 7 10 <_name>Plutonium 4 [244] 3501 912.5 19.84 8 10 <_name>Americium 4 [243] 2880 1449 13.69 9 10 <_name>Curium 4 [247] 3383 1613 13.51 10 10 <_name>Berkelium 4 [247] 1323 14.79 11 10 <_name>Californium 4 [251] 1173 15.1 12 10 <_name>Einsteinium 4 [252] 1133 8.84 13 10 <_name>Fermium 4 [257] 1800 14 10 <_name>Mendelevium 4 [258] 1100 15 10 <_name>Nobelium 4 [259] 1100 16 10 <_name>Lawrencium 4 [266] 1900 3 7 <_name>Rutherfordium 5 [267] 4 7 <_name>Dubnium 5 [268] 5 7 <_name>Seaborgium 5 [269] 6 7 <_name>Bohrium 5 [270] 7 7 <_name>Hassium 5 [269] 8 7 <_name>Meitnerium 11 [278] 9 7 <_name>Darmstadtium 11 [281] 10 7 <_name>Roentgenium 11 [282] 11 7 <_name>Copernicium 5 [285] 12 7 <_name>Nihonium 11 [286] 13 7 <_name>Flerovium 6 [289] 14 7 <_name>Moscovium 11 [290] 15 7 <_name>Livermorium 11 [293] 16 7 <_name>Tennessine 11 [294] 17 7 <_name>Oganesson 11 [294] 18 7 libqalculate-2.8.2/data/eurofxref-daily.xml0000644000175000017500000000320113401032610015630 00000000000000 Reference rates European Central Bank libqalculate-2.8.2/AUTHORS0000644000175000017500000000005713127506563012170 00000000000000Hanna Knutsson libqalculate-2.8.2/NEWS0000644000175000017500000000001512705146643011611 00000000000000see changeloglibqalculate-2.8.2/install-sh0000755000175000017500000003601013350174156013117 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libqalculate-2.8.2/autogen.sh0000755000175000017500000001002013237106042013076 00000000000000#!/bin/sh # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. DIE=0 (test -f $srcdir/configure.ac) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" echo " top-level package directory" exit 1 } (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`autoconf' installed." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } (grep "^AC_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && { (intltoolize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`intltool' installed." echo "You can get it from:" echo " ftp://ftp.gnome.org/pub/GNOME/stable/sources/intltool/" DIE=1 } } (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && { (libtoolize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`libtool' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 } } grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && { grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \ (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`glib' installed." echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" DIE=1 } } (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`automake' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 NO_AUTOMAKE=yes } # if no automake, don't bother testing for aclocal test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: Missing \`aclocal'. The version of \`automake'" echo "installed doesn't appear recent enough." echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi if test x$NOCONFIGURE = x -a -z "$*"; then echo "**Warning**: I am going to run \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" echo \`$0\'" command line." echo fi case $CC in xlc ) am_opt=--include-deps;; esac for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.ac -print` do dr=`dirname $coin` if test -f $dr/NO-AUTO-GEN; then echo skipping $dr -- flagged as no auto-gen else echo processing $dr ( cd $dr aclocalinclude="$ACLOCAL_FLAGS" if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then echo "Creating $dr/aclocal.m4 ..." test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 echo "Running glib-gettextize... Ignore non-fatal messages." echo "no" | glib-gettextize --force --copy echo "Making $dr/aclocal.m4 writable ..." test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 fi if grep "^AC_PROG_INTLTOOL" configure.ac >/dev/null; then echo "Running intltoolize..." intltoolize --copy --force --automake fi if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then if test -z "$NO_LIBTOOLIZE" ; then echo "Running libtoolize..." libtoolize --force --copy fi fi echo "Running aclocal $aclocalinclude ..." aclocal $aclocalinclude if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then echo "Running autoheader..." autoheader fi echo "Running automake --gnu $am_opt ..." automake --add-missing --gnu $am_opt echo "Running autoconf ..." autoconf ) fi done conf_flags="--enable-maintainer-mode" if test x$NOCONFIGURE = x; then echo Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure $conf_flags "$@" \ && echo Now type \`make\' to compile. || exit 1 else echo Skipping configure process. fi cd $srcdir/docs/reference echo "Generating API documentation" doxygen Doxyfile cd ../../ cd $srcdir if [ ! -d "$srcdir/docs/reference/html" ]; then echo "API documentation is missing. Please install doxygen and run autogen.sh again." exit 1 fi libqalculate-2.8.2/config.sub0000755000175000017500000010645513350174156013111 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-03-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # 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 General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libqalculate-2.8.2/libqalculate/0000755000175000017500000000000013401033232013617 500000000000000libqalculate-2.8.2/libqalculate/Number.cc0000644000175000017500000101773413367354535015342 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "Number.h" #include "Calculator.h" #include "Function.h" #include #include #include #include "util.h" #define BIT_PRECISION ((long int) ((PRECISION) * 3.3219281) + 100) #define PRECISION_TO_BITS(p) (((p) * 3.3219281) + 100) #define BITS_TO_PRECISION(p) (::ceil(((p) - 100) / 3.3219281)) #define TO_BIT_PRECISION(p) ((::ceil((p) * 3.3219281))) #define FROM_BIT_PRECISION(p) ((::floor((p) / 3.3219281))) #define PRINT_MPFR(x, y) mpfr_out_str(stdout, y, 0, x, MPFR_RNDU); cout << endl; gmp_randstate_t randstate; Number nr_e; int char2val(const char &c, const int &base) { if(c <= '9') return c - '0'; if(base == 12 && c == 'X') return 10; else if(base == 12 && c == 'E') return 11; else return c - 'A' + 10; } void insert_thousands_separator(string &str, const PrintOptions &po) { if(po.digit_grouping != DIGIT_GROUPING_NONE && (po.digit_grouping != DIGIT_GROUPING_LOCALE || !CALCULATOR->local_digit_group_separator.empty())) { size_t i_deci = str.rfind(po.decimalpoint()); size_t i; if(i_deci != string::npos) { i = i_deci; /*i += 5 + po.decimalpoint().length(); while(i < str.length()) { str.insert(i, po.thousandsseparator()); i += 5 + po.thousandsseparator().length(); } i = i_deci;*/ } else { i = str.length(); } size_t group_size = 3, i_format = 0; if(po.digit_grouping == DIGIT_GROUPING_LOCALE && CALCULATOR->local_digit_group_format.size() > i_format) { if(CALCULATOR->local_digit_group_format[i_format] == CHAR_MAX) return; if(CALCULATOR->local_digit_group_format[i_format] > 0) group_size = CALCULATOR->local_digit_group_format[i_format]; } if(po.digit_grouping == DIGIT_GROUPING_LOCALE || i > group_size + 1) { while(i > group_size) { i -= group_size; if(po.digit_grouping != DIGIT_GROUPING_LOCALE) { #ifdef _WIN32 str.insert(i, " "); #else if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (" ", po.can_display_unicode_string_arg))) { str.insert(i, " "); } else { str.insert(i, " "); } #endif } else { str.insert(i, CALCULATOR->local_digit_group_separator); } if(po.digit_grouping == DIGIT_GROUPING_LOCALE && CALCULATOR->local_digit_group_format.size() - 1 > i_format) { i_format++; if(CALCULATOR->local_digit_group_format[i_format] == CHAR_MAX) break; if(CALCULATOR->local_digit_group_format[i_format] > 0) group_size = CALCULATOR->local_digit_group_format[i_format]; } } } } } string format_number_string(string cl_str, int base, BaseDisplay base_display, bool show_neg, bool format_base_two = true, const PrintOptions &po = default_print_options) { if(format_base_two && base == 2 && base_display != BASE_DISPLAY_NONE) { unsigned int bits = po.binary_bits; size_t l = cl_str.find(po.decimalpoint()); if(l == string::npos) l = cl_str.length(); if(bits == 0) { bits = l; if(bits % 4 != 0) bits += 4 - bits % 4; } if(l < bits) { string str; str.resize(bits - l, '0'); cl_str = str + cl_str; l = bits; } if(base_display == BASE_DISPLAY_NORMAL) { for(int i = (int) l - 4; i > 0; i -= 4) { cl_str.insert(i, 1, ' '); } } } string str = ""; if(show_neg) { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MINUS, po.can_display_unicode_string_arg))) str += SIGN_MINUS; else str += '-'; } if(base_display == BASE_DISPLAY_NORMAL) { if(base == 16) { str += "0x"; } else if(base == 8) { str += "0"; } } else if(base_display == BASE_DISPLAY_ALTERNATIVE) { if(base == 16) { str += "0x0"; } else if(base == 8) { str += "0"; } else if(base == 2) { str += "0b00"; } } if(base == BASE_DUODECIMAL) { for(size_t i = 0; i < cl_str.length(); i++) { if(cl_str[i] == 'A' || cl_str[i] == 'a' || cl_str[i] == 'X') { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) ("↊", po.can_display_unicode_string_arg))) {cl_str.replace(i, 1, "↊"); i += strlen("↊") - 1;} else cl_str[i] = 'X'; } else if(cl_str[i] == 'B' || cl_str[i] == 'b' || cl_str[i] == 'E') { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) ("↋", po.can_display_unicode_string_arg))) {cl_str.replace(i, 1, "↋"); i += strlen("↋") - 1;} else cl_str[i] = 'E'; } } } else if(base == BASE_DECIMAL) { insert_thousands_separator(cl_str, po); } str += cl_str; return str; } string printMPZ(mpz_ptr integ_pre, int base = 10, bool display_sign = true, bool lower_case = false) { int sign = mpz_sgn(integ_pre); if(base == BASE_ROMAN_NUMERALS) { if(sign != 0 && mpz_cmpabs_ui(integ_pre, 10000) == -1) { string str; int value = (int) mpz_get_si(integ_pre); if(value < 0) { value = -value; if(display_sign) { str += "-"; } } int times = value / 1000; for(; times > 0; times--) { if(lower_case) str += "m"; else str += "M"; } value = value % 1000; times = value / 100; if(times == 9) { if(lower_case) str += "c"; else str += "C"; if(lower_case) str += "m"; else str += "M"; times = 0; } else if(times >= 5) { if(lower_case) str += "d"; else str += "D"; times -= 5; } else if(times == 4) { times = 0; if(lower_case) str += "c"; else str += "C"; if(lower_case) str += "d"; else str += "D"; } for(; times > 0; times--) { if(lower_case) str += "c"; else str += "C"; } value = value % 100; times = value / 10; if(times == 9) { if(lower_case) str += "x"; else str += "X"; if(lower_case) str += "c"; else str += "C"; times = 0; } else if(times >= 5) { if(lower_case) str += "l"; else str += "L"; times -= 5; } else if(times == 4) { times = 0; if(lower_case) str += "x"; else str += "X"; if(lower_case) str += "l"; else str += "L"; } for(; times > 0; times--) { if(lower_case) str += "x"; else str += "X"; } value = value % 10; times = value; if(times == 9) { if(lower_case) str += "i"; else str += "I"; if(lower_case) str += "x"; else str += "X"; times = 0; } else if(times >= 5) { if(lower_case) str += "v"; else str += "V"; times -= 5; } else if(times == 4) { times = 0; if(lower_case) str += "i"; else str += "I"; if(lower_case) str += "v"; else str += "V"; } for(; times > 0; times--) { if(lower_case) str += "i"; else str += "I"; } return str; } else if(sign != 0) { CALCULATOR->error(false, _("Cannot display numbers greater than 9999 or less than -9999 as roman numerals."), NULL); } base = 10; } string cl_str; mpz_t integ; mpz_init_set(integ, integ_pre); if(sign == -1) { mpz_neg(integ, integ); if(display_sign) cl_str += "-"; } char *tmp = mpz_get_str(NULL, base, integ); cl_str += tmp; void (*freefunc)(void *, size_t); mp_get_memory_functions (NULL, NULL, &freefunc); freefunc(tmp, strlen(tmp) + 1); if(base > 10) { if(lower_case) { for(size_t i = 0; i < cl_str.length(); i++) { if(cl_str[i] >= 'A' && cl_str[i] <= 'Z') { cl_str[i] += 32; } } } else { for(size_t i = 0; i < cl_str.length(); i++) { if(cl_str[i] >= 'a' && cl_str[i] <= 'z') { cl_str[i] -= 32; } } } } if(cl_str[cl_str.length() - 1] == '.') { cl_str.erase(cl_str.length() - 1, 1); } mpz_clear(integ); return cl_str; } string printMPZ(mpz_srcptr integ_pre, int base = 10, bool display_sign = true, bool lower_case = false) { mpz_t integ; mpz_init_set(integ, integ_pre); string str = printMPZ(integ, base, display_sign, lower_case); mpz_clear(integ); return str; } Number::Number() { b_imag = false; i_value = NULL; n_type = NUMBER_TYPE_RATIONAL; mpq_init(r_value); clear(); } Number::Number(string number, const ParseOptions &po) { b_imag = false; i_value = NULL; n_type = NUMBER_TYPE_RATIONAL; mpq_init(r_value); set(number, po); } Number::Number(long int numerator, long int denominator, long int exp_10) { b_imag = false; i_value = NULL; n_type = NUMBER_TYPE_RATIONAL; mpq_init(r_value); set(numerator, denominator, exp_10); } Number::Number(const Number &o) { b_imag = false; i_value = NULL; n_type = NUMBER_TYPE_RATIONAL; mpq_init(r_value); set(o); } Number::~Number() { mpq_clear(r_value); if(n_type == NUMBER_TYPE_FLOAT) mpfr_clears(fu_value, fl_value, NULL); if(i_value) delete i_value; } void Number::set(string number, const ParseOptions &po) { size_t pm_index = number.find(SIGN_PLUSMINUS); if(pm_index == string::npos) pm_index = number.find("+/-"); if(pm_index != string::npos) { ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; set(number.substr(0, pm_index), po2); number = number.substr(pm_index + (number[pm_index] == '+' ? strlen("+/-") : strlen(SIGN_PLUSMINUS))); if(!number.empty()) { Number pm_nr(number, po2); setUncertainty(pm_nr, true); } return; } if(po.base == BASE_ROMAN_NUMERALS) { remove_blanks(number); Number nr; Number cur; bool large = false; vector numbers; bool capital = false; for(size_t i = 0; i < number.length(); i++) { switch(number[i]) { case 'I': { if(!capital && i > 0 && i == number.length() - 1) { cur.set(2); CALCULATOR->error(false, _("Assuming the unusual practice of letting a last capital I mean 2 in a roman numeral."), NULL); break; } } case 'J': {capital = true;} case 'i': {} case 'j': { cur.set(1); break; } case 'V': {capital = true;} case 'v': { cur.set(5); break; } case 'X': {capital = true;} case 'x': { cur.set(10); break; } case 'L': {capital = true;} case 'l': { cur.set(50); break; } case 'C': {capital = true;} case 'c': { cur.set(100); break; } case 'D': {capital = true;} case 'd': { cur.set(500); break; } case 'M': {capital = true;} case 'm': { cur.set(1000); break; } case '(': { int multi = 1, multi2 = 0; bool turn = false; bool error = false; i++; for(; i < number.length(); i++) { if(number[i] == '|') { if(!turn) { turn = true; multi2 = multi; } else { error = true; break; } } else if(number[i] == ')') { if(turn) { multi2--; if(multi2 < 1) { break; } } else { error = true; break; } } else if(number[i] == '(') { if(!turn) { multi++; } else { error = true; break; } } else { error = true; i--; break; } } if(error | !turn) { CALCULATOR->error(true, _("Error in roman numerals: %s."), number.c_str(), NULL); } else { cur.set(10); cur.raise(multi); cur.multiply(100); } break; } case '|': { if(large) { cur.clear(); large = false; break; } else if(number.length() > i + 1 && number[i + 2] == ')') { i++; int multi = 1; for(; i < number.length(); i++) { if(number[i] != ')') { i--; break; } multi++; } cur.set(10); cur.raise(multi); cur.multiply(50); break; } else if(number.length() > i + 2 && number[i + 2] == '|') { cur.clear(); large = true; break; } } default: { cur.clear(); CALCULATOR->error(true, _("Unknown roman numeral: %c."), number[i], NULL); } } if(!cur.isZero()) { if(large) { cur.multiply(100000L); } numbers.resize(numbers.size() + 1); numbers[numbers.size() - 1].set(cur); } } vector values; values.resize(numbers.size()); bool error = false; int rep = 1; for(size_t i = 0; i < numbers.size(); i++) { if(i == 0 || numbers[i].isLessThanOrEqualTo(numbers[i - 1])) { nr.add(numbers[i]); if(i > 0 && numbers[i].equals(numbers[i - 1])) { rep++; if(rep > 3 && numbers[i].isLessThan(1000)) { error = true; } else if(rep > 1 && (numbers[i].equals(5) || numbers[i].equals(50) || numbers[i].equals(500))) { error = true; } } else { rep = 1; } } else { numbers[i - 1].multiply(10); if(numbers[i - 1].isLessThan(numbers[i])) { error = true; } numbers[i - 1].divide(10); for(int i2 = i - 2; ; i2--) { if(i2 < 0) { nr.negate(); nr.add(numbers[i]); break; } else if(numbers[i2].isGreaterThan(numbers[i2 + 1])) { Number nr2(nr); nr2.subtract(values[i2]); nr.subtract(nr2); nr.subtract(nr2); nr.add(numbers[i]); if(numbers[i2].isLessThan(numbers[i])) { error = true; } break; } error = true; } } values[i].set(nr); } if(error) { PrintOptions pro; pro.base = BASE_ROMAN_NUMERALS; CALCULATOR->error(false, _("Errors in roman numerals: \"%s\". Interpreted as %s, which should be written as %s."), number.c_str(), nr.print().c_str(), nr.print(pro).c_str(), NULL); } values.clear(); numbers.clear(); set(nr); return; } mpz_t num, den; mpz_init(num); mpz_init_set_ui(den, 1); int base = po.base; remove_blank_ends(number); if(base == 16 && number.length() >= 2 && number[0] == '0' && (number[1] == 'x' || number[1] == 'X')) { number = number.substr(2, number.length() - 2); } else if(base == 8 && number.length() >= 2 && number[0] == '0' && (number[1] == 'o' || number[1] == 'O')) { number = number.substr(2, number.length() - 2); } else if(base == 8 && number.length() > 1 && number[0] == '0' && number[1] != '.') { number.erase(number.begin()); } else if(base == 2 && number.length() >= 2 && number[0] == '0' && (number[1] == 'b' || number[1] == 'B')) { number = number.substr(2, number.length() - 2); } bool b_twos = po.twos_complement && base == 2 && number.length() > 0 && number[0] == '1'; if(base > 36) base = 36; if(base < 0) base = 10; long int readprec = 0; bool numbers_started = false, minus = false, in_decimals = false, b_cplx = false, had_nonzero = false; for(size_t index = 0; index < number.size(); index++) { if(number[index] >= '0' && ((base >= 10 && number[index] <= '9') || (base < 10 && number[index] < '0' + base))) { mpz_mul_si(num, num, base); if(b_twos) { if(number[index] == '0') number[index] = '1'; else if(number[index] == '1') number[index] = '0'; } if(number[index] != '0') { mpz_add_ui(num, num, (unsigned long int) number[index] - '0'); if(!had_nonzero) readprec = 0; had_nonzero = true; } if(in_decimals) { mpz_mul_si(den, den, base); } readprec++; numbers_started = true; } else if(base == BASE_DUODECIMAL && (number[index] == 'X' || number[index] == 'E' || number[index] == 'x' || number[index] == 'e')) { mpz_mul_si(num, num, base); mpz_add_ui(num, num, (number[index] == 'E' || number[index] == 'e') ? 11L : 10L); if(in_decimals) { mpz_mul_si(den, den, base); } if(!had_nonzero) readprec = 0; had_nonzero = true; readprec++; numbers_started = true; } else if(base > 10 && number[index] >= 'a' && number[index] < 'a' + base - 10) { mpz_mul_si(num, num, base); mpz_add_ui(num, num, (unsigned long int) number[index] - 'a' + 10); if(in_decimals) { mpz_mul_si(den, den, base); } if(!had_nonzero) readprec = 0; had_nonzero = true; readprec++; numbers_started = true; } else if(base > 10 && number[index] >= 'A' && number[index] < 'A' + base - 10) { mpz_mul_si(num, num, base); mpz_add_ui(num, num, (unsigned long int) number[index] - 'A' + 10); if(in_decimals) { mpz_mul_si(den, den, base); } if(!had_nonzero) readprec = 0; had_nonzero = true; readprec++; numbers_started = true; } else if((number[index] == 'E' || number[index] == 'e') && base <= 10) { index++; numbers_started = false; bool exp_minus = false; unsigned long int exp = 0; unsigned long int max_exp = ULONG_MAX / 10; while(index < number.size()) { if(number[index] >= '0' && number[index] <= '9') { if(exp > max_exp) { CALCULATOR->error(true, _("Too large exponent."), NULL); } else { exp = exp * 10; exp = exp + number[index] - '0'; numbers_started = true; } } else if(!numbers_started && number[index] == '-') { exp_minus = !exp_minus; } index++; } if(exp_minus) { mpz_t e_den; mpz_init(e_den); mpz_ui_pow_ui(e_den, 10, exp); mpz_mul(den, den, e_den); mpz_clear(e_den); } else { mpz_t e_num; mpz_init(e_num); mpz_ui_pow_ui(e_num, 10, exp); mpz_mul(num, num, e_num); mpz_clear(e_num); } break; } else if(number[index] == '.') { in_decimals = true; } else if(number[index] == ':') { if(in_decimals) { CALCULATOR->error(true, _("\':\' in decimal number ignored (decimal point detected)."), NULL); } else { size_t index_colon = index; Number divisor(1, 1); Number num_temp; clear(); i_precision = -1; index = 0; while(index_colon < number.size()) { num_temp.set(number.substr(index, index_colon - index), po); if(!num_temp.isZero()) { num_temp.divide(divisor); add(num_temp); } index = index_colon + 1; index_colon = number.find(":", index); divisor.multiply(Number(60, 1)); } num_temp.set(number.substr(index), po); if(!num_temp.isZero()) { num_temp.divide(divisor); add(num_temp); } return; } } else if(!numbers_started && number[index] == '-') { minus = !minus; } else if(number[index] == 'i') { b_cplx = true; } else if(number[index] != ' ') { CALCULATOR->error(true, _("Character \'%c\' was ignored in the number \"%s\" with base %s."), number[index], number.c_str(), i2s(base).c_str(), NULL); } } if(b_twos) { mpz_add_ui(num, num, 1); minus = !minus; } clear(); if((po.read_precision == ALWAYS_READ_PRECISION || (in_decimals && po.read_precision == READ_PRECISION_WHEN_DECIMALS)) && CALCULATOR->usesIntervalArithmetic()) { mpz_mul_si(num, num, 2); mpz_mul_si(den, den, 2); mpq_t rv1, rv2; mpq_inits(rv1, rv2, NULL); mpz_add_ui(num, num, 1); if(minus) mpz_neg(mpq_numref(rv1), num); else mpz_set(mpq_numref(rv1), num); mpz_set(mpq_denref(rv1), den); mpq_canonicalize(rv1); mpz_sub_ui(num, num, 2); if(minus) mpz_neg(mpq_numref(rv2), num); else mpz_set(mpq_numref(rv2), num); mpz_set(mpq_denref(rv2), den); mpq_canonicalize(rv2); mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); mpfr_clear_flags(); mpfr_set_q(fu_value, minus ? rv2 : rv1, MPFR_RNDD); mpfr_set_q(fl_value, minus ? rv1 : rv2, MPFR_RNDU); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); n_type = NUMBER_TYPE_FLOAT; b_approx = true; testErrors(2); if(b_cplx) { if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->set(*this, false, true); clearReal(); } mpq_clears(rv1, rv2, NULL); } else { if(minus) mpz_neg(num, num); if(b_cplx) { if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->setInternal(num, den, false, true); mpq_canonicalize(i_value->internalRational()); } else { mpz_set(mpq_numref(r_value), num); mpz_set(mpq_denref(r_value), den); mpq_canonicalize(r_value); } if(po.read_precision == ALWAYS_READ_PRECISION || (in_decimals && po.read_precision == READ_PRECISION_WHEN_DECIMALS)) { if(base != 10) { Number precmax(10); precmax.raise(readprec); precmax--; precmax.log(base); precmax.floor(); readprec = precmax.intValue(); } if(b_cplx) i_value->setPrecision(readprec); setPrecision(readprec); } } mpz_clears(num, den, NULL); } void Number::set(long int numerator, long int denominator, long int exp_10, bool keep_precision, bool keep_imag) { if(!keep_precision) { b_approx = false; i_precision = -1; } if(denominator < 0) { denominator = -denominator; numerator = -numerator; } mpq_set_si(r_value, numerator, denominator == 0 ? 1 : denominator); mpq_canonicalize(r_value); if(n_type == NUMBER_TYPE_FLOAT) mpfr_clears(fu_value, fl_value, NULL); n_type = NUMBER_TYPE_RATIONAL; if(exp_10 != 0) { exp10(exp_10); } if(!keep_imag && i_value) i_value->clear(); else if(i_value) setPrecisionAndApproximateFrom(*i_value); } void Number::setFloat(long double d_value) { b_approx = true; if(n_type != NUMBER_TYPE_FLOAT) {mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION);} if(CALCULATOR->usesIntervalArithmetic()) { mpfr_set_ld(fu_value, d_value, MPFR_RNDU); mpfr_set_ld(fl_value, d_value, MPFR_RNDD); } else { mpfr_set_ld(fl_value, d_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } n_type = NUMBER_TYPE_FLOAT; mpq_set_ui(r_value, 0, 1); if(i_value) i_value->clear(); } bool Number::setInterval(const Number &nr_lower, const Number &nr_upper, bool keep_precision) { Number nr_l(nr_lower), nr_u(nr_upper); if(nr_l == nr_u) { set(nr_l, true); setPrecisionAndApproximateFrom(nr_u); return true; } if(!nr_l.setToFloatingPoint() || !nr_u.setToFloatingPoint()) return false; clear(keep_precision); mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); mpfr_clear_flags(); if(mpfr_cmp(nr_l.internalUpperFloat(), nr_u.internalUpperFloat()) > 0) mpfr_set(fu_value, nr_l.internalUpperFloat(), MPFR_RNDU); else mpfr_set(fu_value, nr_u.internalUpperFloat(), MPFR_RNDU); if(mpfr_cmp(nr_l.internalLowerFloat(), nr_u.internalLowerFloat()) > 0) mpfr_set(fl_value, nr_u.internalLowerFloat(), MPFR_RNDD); else mpfr_set(fl_value, nr_l.internalLowerFloat(), MPFR_RNDD); setPrecisionAndApproximateFrom(nr_l); setPrecisionAndApproximateFrom(nr_u); if(!b_imag && (nr_l.hasImaginaryPart() || nr_u.hasImaginaryPart())) { if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->setInterval(nr_l.imaginaryPart(), nr_u.imaginaryPart(), keep_precision); setPrecisionAndApproximateFrom(*i_value); } b_approx = true; n_type = NUMBER_TYPE_FLOAT; return true; } void Number::setInternal(mpz_srcptr mpz_value, bool keep_precision, bool keep_imag) { if(!keep_precision) { b_approx = false; i_precision = -1; } mpq_set_z(r_value, mpz_value); if(n_type == NUMBER_TYPE_FLOAT) mpfr_clears(fu_value, fl_value, NULL); n_type = NUMBER_TYPE_RATIONAL; if(!keep_imag && i_value) i_value->clear(); else if(i_value) setPrecisionAndApproximateFrom(*i_value); } void Number::setInternal(const mpz_t &mpz_value, bool keep_precision, bool keep_imag) { if(!keep_precision) { b_approx = false; i_precision = -1; } mpq_set_z(r_value, mpz_value); if(n_type == NUMBER_TYPE_FLOAT) mpfr_clears(fu_value, fl_value, NULL); n_type = NUMBER_TYPE_RATIONAL; if(!keep_imag && i_value) i_value->clear(); else if(i_value) setPrecisionAndApproximateFrom(*i_value); } void Number::setInternal(const mpq_t &mpq_value, bool keep_precision, bool keep_imag) { if(!keep_precision) { b_approx = false; i_precision = -1; } mpq_set(r_value, mpq_value); if(n_type == NUMBER_TYPE_FLOAT) mpfr_clears(fu_value, fl_value, NULL); n_type = NUMBER_TYPE_RATIONAL; if(!keep_imag && i_value) i_value->clear(); else if(i_value) setPrecisionAndApproximateFrom(*i_value); } void Number::setInternal(const mpz_t &mpz_num, const mpz_t &mpz_den, bool keep_precision, bool keep_imag) { if(!keep_precision) { b_approx = false; i_precision = -1; } mpz_set(mpq_numref(r_value), mpz_num); mpz_set(mpq_denref(r_value), mpz_den); if(n_type == NUMBER_TYPE_FLOAT) mpfr_clears(fu_value, fl_value, NULL); n_type = NUMBER_TYPE_RATIONAL; if(!keep_imag && i_value) i_value->clear(); else if(i_value) setPrecisionAndApproximateFrom(*i_value); } void Number::setInternal(const mpfr_t &mpfr_value, bool merge_precision, bool keep_imag) { b_approx = true; if(n_type != NUMBER_TYPE_FLOAT) {mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION);} if(CALCULATOR->usesIntervalArithmetic()) { mpfr_set(fu_value, mpfr_value, MPFR_RNDU); mpfr_set(fl_value, mpfr_value, MPFR_RNDD); } else { mpfr_set(fl_value, mpfr_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } n_type = NUMBER_TYPE_FLOAT; mpq_set_ui(r_value, 0, 1); if(!keep_imag && i_value) i_value->clear(); } void Number::setImaginaryPart(const Number &o) { if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->set(o, false, true); setPrecisionAndApproximateFrom(*i_value); } void Number::setImaginaryPart(long int numerator, long int denominator, long int exp_10) { if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->set(numerator, denominator, exp_10); } void Number::set(const Number &o, bool merge_precision, bool keep_imag) { mpq_set(r_value, o.internalRational()); if(o.internalType() == NUMBER_TYPE_FLOAT) { if(n_type != NUMBER_TYPE_FLOAT) {mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION);} if(CALCULATOR->usesIntervalArithmetic() || o.isInterval()) { mpfr_set(fu_value, o.internalUpperFloat(), MPFR_RNDU); mpfr_set(fl_value, o.internalLowerFloat(), MPFR_RNDD); } else { mpfr_set(fl_value, o.internalLowerFloat(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } } n_type = o.internalType(); if(!merge_precision) { i_precision = -1; b_approx = false; } if(o.isApproximate()) b_approx = true; if(i_precision < 0 || o.precision() < i_precision) i_precision = o.precision(); if(!keep_imag && !b_imag) { if(o.hasImaginaryPart()) { setImaginaryPart(*o.internalImaginary()); } else if(i_value) { i_value->clear(); } } } void Number::setPlusInfinity(bool keep_precision, bool keep_imag) { if(keep_imag) clearReal(); else clear(keep_precision); n_type = NUMBER_TYPE_PLUS_INFINITY; } void Number::setMinusInfinity(bool keep_precision, bool keep_imag) { if(keep_imag) clearReal(); else clear(keep_precision); n_type = NUMBER_TYPE_MINUS_INFINITY; } void Number::clear(bool keep_precision) { if(i_value) i_value->clear(); if(!keep_precision) { b_approx = false; i_precision = -1; } if(n_type == NUMBER_TYPE_FLOAT) { mpfr_clear(fl_value); mpfr_clear(fu_value); } n_type = NUMBER_TYPE_RATIONAL; mpq_set_si(r_value, 0, 1); } void Number::clearReal() { if(n_type == NUMBER_TYPE_FLOAT) { mpfr_clear(fl_value); mpfr_clear(fu_value); } n_type = NUMBER_TYPE_RATIONAL; mpq_set_si(r_value, 0, 1); } void Number::clearImaginary() { if(i_value) i_value->clear(); } const mpq_t &Number::internalRational() const { return r_value; } const mpfr_t &Number::internalUpperFloat() const { return fu_value; } const mpfr_t &Number::internalLowerFloat() const { return fl_value; } mpq_t &Number::internalRational() { return r_value; } mpfr_t &Number::internalUpperFloat() { return fu_value; } mpfr_t &Number::internalLowerFloat() { return fl_value; } Number *Number::internalImaginary() const { return i_value; } void Number::markAsImaginaryPart(bool is_imag) { b_imag = is_imag; } const NumberType &Number::internalType() const { return n_type; } bool Number::setToFloatingPoint() { if(n_type != NUMBER_TYPE_FLOAT) { mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); mpfr_clear_flags(); if(n_type == NUMBER_TYPE_RATIONAL) { if(!CALCULATOR->usesIntervalArithmetic()) { mpfr_set_q(fl_value, r_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_set_q(fu_value, r_value, MPFR_RNDU); mpfr_set_q(fl_value, r_value, MPFR_RNDD); } if(!testFloatResult(true, 1, false)) { mpfr_clears(fu_value, fl_value, NULL); return false; } } else if(n_type == NUMBER_TYPE_PLUS_INFINITY) { mpfr_set_inf(fl_value, 1); mpfr_set_inf(fu_value, 1); } else if(n_type == NUMBER_TYPE_MINUS_INFINITY) { mpfr_set_inf(fl_value, -1); mpfr_set_inf(fu_value, -1); } else { mpfr_clears(fu_value, fl_value, NULL); return false; } mpq_set_ui(r_value, 0, 1); n_type = NUMBER_TYPE_FLOAT; } return true; } void Number::precisionToInterval() { if(hasImaginaryPart()) i_value->precisionToInterval(); if(i_precision >= 0 && !isInfinite(true) && !isInterval()) { if(!setToFloatingPoint()) return; mpfr_clear_flags(); mpfr_t f_log; mpfr_init2(f_log, mpfr_get_prec(fl_value)); mpfr_abs(f_log, fu_value, MPFR_RNDN); mpfr_log10(f_log, f_log, MPFR_RNDN); mpfr_floor(f_log, f_log); mpfr_sub_ui(f_log, f_log, i_precision, MPFR_RNDN); mpfr_ui_pow(f_log, 10, f_log, MPFR_RNDD); mpfr_div_ui(f_log, f_log, 2, MPFR_RNDD); mpfr_sub(fl_value, fl_value, f_log, MPFR_RNDU); mpfr_add(fu_value, fu_value, f_log, MPFR_RNDD); mpfr_clear(f_log); testErrors(2); i_precision = -1; } } bool Number::intervalToPrecision(long int min_precision) { if(n_type == NUMBER_TYPE_FLOAT && !mpfr_equal_p(fl_value, fu_value)) { mpfr_clear_flags(); mpfr_t f_diff, f_mid; mpfr_inits2(mpfr_get_prec(fl_value), f_diff, f_mid, NULL); mpfr_sub(f_diff, fu_value, fl_value, MPFR_RNDN); mpfr_div_ui(f_diff, f_diff, 2, MPFR_RNDN); mpfr_add(f_mid, fl_value, f_diff, MPFR_RNDN); mpfr_mul_ui(f_diff, f_diff, 2, MPFR_RNDN); mpfr_div(f_diff, f_mid, f_diff, MPFR_RNDN); mpfr_abs(f_diff, f_diff, MPFR_RNDN); mpfr_log10(f_diff, f_diff, MPFR_RNDN); long int i_prec = mpfr_get_si(f_diff, MPFR_RNDD) + 1; if(i_prec < min_precision || testErrors(0)) return false; if(i_value && !i_value->intervalToPrecision()) return false; if(i_precision < 0 || i_prec < i_precision) i_precision = i_prec; mpfr_set(fl_value, f_mid, MPFR_RNDN); mpfr_set(fu_value, f_mid, MPFR_RNDN); mpfr_clears(f_diff, f_mid, NULL); b_approx = true; } else if(i_value && !i_value->intervalToPrecision()) return false; return true; } void Number::intervalToMidValue() { if(n_type == NUMBER_TYPE_FLOAT && !mpfr_equal_p(fl_value, fu_value)) { mpfr_sub(fu_value, fu_value, fl_value, MPFR_RNDN); mpfr_div_ui(fu_value, fu_value, 2, MPFR_RNDN); mpfr_add(fl_value, fl_value, fu_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } } void Number::splitInterval(unsigned int nr_of_parts, vector &v) const { if(n_type == NUMBER_TYPE_FLOAT && isReal()) { if(nr_of_parts == 2) { mpfr_t f_mid; mpfr_init2(f_mid, mpfr_get_prec(fl_value)); mpfr_sub(f_mid, fu_value, fl_value, MPFR_RNDN); mpfr_div_ui(f_mid, f_mid, 2, MPFR_RNDN); mpfr_add(f_mid, f_mid, fl_value, MPFR_RNDN); v.push_back(*this); mpfr_set(v.back().internalUpperFloat(), f_mid, MPFR_RNDU); v.push_back(*this); //mpfr_nextabove(f_mid); mpfr_set(v.back().internalLowerFloat(), f_mid, MPFR_RNDD); } else { mpfr_t value_diff, lower_value, upper_value, value_add; mpfr_inits2(mpfr_get_prec(fl_value), value_diff, lower_value, upper_value, value_add, NULL); mpfr_sub(value_diff, fu_value, fl_value, MPFR_RNDN); mpfr_div_ui(value_diff, value_diff, nr_of_parts, MPFR_RNDN); mpfr_set(lower_value, fl_value, MPFR_RNDD); for(unsigned int i = 1; i <= nr_of_parts; i++) { mpfr_mul_ui(value_add, value_diff, i, MPFR_RNDU); mpfr_add(upper_value, fl_value, value_add, MPFR_RNDU); if(mpfr_cmp(upper_value, fu_value) > 0) mpfr_set(upper_value, fu_value, MPFR_RNDU); v.push_back(*this); mpfr_set(v.back().internalLowerFloat(), lower_value, MPFR_RNDD); mpfr_set(v.back().internalUpperFloat(), upper_value, MPFR_RNDU); mpfr_set(lower_value, upper_value, MPFR_RNDD); } } } } bool Number::getCentralInteger(Number &nr_int, bool *b_multiple, vector *v) const { if(!isInterval() || !isReal()) { if(b_multiple) *b_multiple = false; return false; } mpfr_t fintl, fintu; mpfr_init2(fintl, mpfr_get_prec(fl_value)); mpfr_init2(fintu, mpfr_get_prec(fu_value)); mpfr_floor(fintu, fu_value); mpfr_ceil(fintl, fl_value); int cmp = mpfr_cmp(fintl, fintu); if(cmp == 0) { mpz_t z_int; mpz_init(z_int); mpfr_get_z(z_int, fl_value, MPFR_RNDN); nr_int.setInternal(z_int); if(b_multiple) *b_multiple = false; if(v) { mpfr_t f_prec; mpfr_init2(f_prec, mpfr_get_prec(fl_value)); mpfr_ui_pow_ui(f_prec, 10, PRECISION + 10, MPFR_RNDN); mpfr_div(f_prec, fintl, f_prec, MPFR_RNDN); if(mpfr_cmp(fintl, fl_value) > 0) { mpfr_sub(fintl, fintl, f_prec, MPFR_RNDD); v->push_back(*this); mpfr_set(v->back().internalUpperFloat(), fintl, MPFR_RNDD); } if(mpfr_cmp(fintu, fu_value) < 0) { mpfr_add(fintu, fintu, f_prec, MPFR_RNDU); v->push_back(*this); mpfr_set(v->back().internalLowerFloat(), fintu, MPFR_RNDU); } } return true; } else if(cmp > 0) { if(b_multiple) *b_multiple = false; } else { if(b_multiple) *b_multiple = true; } return false; } bool Number::mergeInterval(const Number &o, bool set_to_overlap) { if(equals(o)) return true; if(!isReal() || !o.isReal()) return false; if(isRational()) { mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); mpfr_clear_flags(); if(o.isRational()) { if(set_to_overlap) {mpfr_clears(fu_value, fl_value, NULL); return false;} if(mpq_cmp(r_value, o.internalRational()) > 0) { mpfr_set_q(fl_value, o.internalRational(), MPFR_RNDD); mpfr_set_q(fu_value, r_value, MPFR_RNDU); } else { mpfr_set_q(fu_value, o.internalRational(), MPFR_RNDU); mpfr_set_q(fl_value, r_value, MPFR_RNDD); } } else { if(mpfr_cmp_q(o.internalUpperFloat(), r_value) < 0) { if(set_to_overlap) {mpfr_clears(fu_value, fl_value, NULL); return false;} mpfr_set(fl_value, o.internalLowerFloat(), MPFR_RNDD); mpfr_set_q(fu_value, r_value, MPFR_RNDU); } else if(mpfr_cmp_q(o.internalLowerFloat(), r_value) > 0) { if(set_to_overlap) {mpfr_clears(fu_value, fl_value, NULL); return false;} mpfr_set(fu_value, o.internalUpperFloat(), MPFR_RNDU); mpfr_set_q(fl_value, r_value, MPFR_RNDD); } else { if(set_to_overlap) { mpfr_clears(fu_value, fl_value, NULL); setPrecisionAndApproximateFrom(o); return true; } mpfr_set(fl_value, o.internalLowerFloat(), MPFR_RNDD); mpfr_set(fu_value, o.internalUpperFloat(), MPFR_RNDU); } } if(!testFloatResult(true, 1, false)) { mpfr_clears(fu_value, fl_value, NULL); return false; } mpq_set_ui(r_value, 0, 1); n_type = NUMBER_TYPE_FLOAT; } else if(o.isRational()) { if(mpfr_cmp_q(fu_value, o.internalRational()) < 0) { if(set_to_overlap) return false; mpfr_set_q(fu_value, o.internalRational(), MPFR_RNDU); } else if(mpfr_cmp_q(fl_value, o.internalRational()) > 0) { if(set_to_overlap) return false; mpfr_set_q(fl_value, o.internalRational(), MPFR_RNDD); } else { if(set_to_overlap) { set(o, true); return true; } } } else if(set_to_overlap) { if(mpfr_cmp(fl_value, o.internalUpperFloat()) > 0 || mpfr_cmp(fu_value, o.internalLowerFloat()) < 0) { return false; } else { if(mpfr_cmp(fl_value, o.internalLowerFloat()) < 0) mpfr_set(fl_value, o.internalLowerFloat(), MPFR_RNDD); if(mpfr_cmp(fu_value, o.internalUpperFloat()) > 0) mpfr_set(fu_value, o.internalUpperFloat(), MPFR_RNDU); } } else { if(mpfr_cmp(fl_value, o.internalLowerFloat()) > 0) mpfr_set(fl_value, o.internalLowerFloat(), MPFR_RNDD); if(mpfr_cmp(fu_value, o.internalUpperFloat()) < 0) mpfr_set(fu_value, o.internalUpperFloat(), MPFR_RNDU); } setPrecisionAndApproximateFrom(o); return true; } void Number::setUncertainty(const Number &o, bool force_interval) { if(!o.isReal() || !isReal()) return; b_approx = true; if(!force_interval && !CALCULATOR->usesIntervalArithmetic() && !isInterval()) { Number nr(*this); nr.abs(); nr.divide(o); nr.divide(2); nr.log(10); nr.floor(); long int i_prec = nr.lintValue(); if(i_prec > 0) { if(i_precision < 0 || i_prec < i_precision) i_precision = i_prec; return; } } mpfr_clear_flags(); if(isRational()) { mpfr_inits2(BIT_PRECISION, fl_value, fu_value, NULL); if(o.isRational()) { mpfr_set_q(fl_value, r_value, MPFR_RNDD); mpfr_set_q(fu_value, r_value, MPFR_RNDU); mpq_set_ui(r_value, 0, 1); n_type = NUMBER_TYPE_FLOAT; } } if(o.isRational()) { mpfr_sub_q(fl_value, fl_value, o.internalRational(), MPFR_RNDD); mpfr_add_q(fu_value, fu_value, o.internalRational(), MPFR_RNDU); } else if(isRational()) { mpfr_sub_q(fl_value, o.internalUpperFloat(), r_value, MPFR_RNDU); mpfr_neg(fl_value, fl_value, MPFR_RNDD); mpfr_add_q(fu_value, o.internalUpperFloat(), r_value, MPFR_RNDU); mpq_set_ui(r_value, 0, 1); n_type = NUMBER_TYPE_FLOAT; } else { mpfr_sub(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDD); mpfr_add(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDU); } testErrors(2); } Number Number::uncertainty() const { if(!isInterval()) return Number(); mpfr_t f_mid; mpfr_init2(f_mid, BIT_PRECISION); mpfr_sub(f_mid, fu_value, fl_value, MPFR_RNDU); mpfr_div_ui(f_mid, f_mid, 2, MPFR_RNDU); Number nr; nr.setInternal(f_mid); mpfr_clear(f_mid); return nr; } Number Number::relativeUncertainty() const { if(!isInterval()) return Number(); mpfr_t f_mid, f_diff; mpfr_inits2(BIT_PRECISION, f_mid, f_diff, NULL); mpfr_sub(f_diff, fu_value, fl_value, MPFR_RNDU); mpfr_div_ui(f_diff, f_diff, 2, MPFR_RNDU); mpfr_add(f_mid, fl_value, f_diff, MPFR_RNDN); mpfr_abs(f_mid, f_mid, MPFR_RNDN); mpfr_div(f_mid, f_diff, f_mid, MPFR_RNDN); Number nr; nr.setInternal(f_mid); mpfr_clears(f_mid, f_diff, NULL); return nr; } double Number::floatValue() const { if(n_type == NUMBER_TYPE_RATIONAL) { return mpq_get_d(r_value); } else if(n_type == NUMBER_TYPE_FLOAT) { return mpfr_get_d(fu_value, MPFR_RNDN) / 2.0 + mpfr_get_d(fl_value, MPFR_RNDN) / 2.0; } return 0.0; } int Number::intValue(bool *overflow) const { if(includesInfinity()) return 0; if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_fits_sint_p(mpq_numref(r_value)) == 0) { if(overflow) *overflow = true; if(mpz_sgn(mpq_numref(r_value)) == -1) return INT_MIN; return INT_MAX; } return (int) mpz_get_si(mpq_numref(r_value)); } else { Number nr; nr.set(*this, false, true); nr.round(); return nr.intValue(overflow); } } unsigned int Number::uintValue(bool *overflow) const { if(includesInfinity()) return 0; if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_fits_uint_p(mpq_numref(r_value)) == 0) { if(overflow) *overflow = true; if(mpz_sgn(mpq_numref(r_value)) == -1) return 0; return UINT_MAX; } return (unsigned int) mpz_get_ui(mpq_numref(r_value)); } else { Number nr; nr.set(*this, false, true); nr.round(); return nr.uintValue(overflow); } } long int Number::lintValue(bool *overflow) const { if(includesInfinity()) return 0; if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_fits_slong_p(mpq_numref(r_value)) == 0) { if(overflow) *overflow = true; if(mpz_sgn(mpq_numref(r_value)) == -1) return LONG_MIN; return LONG_MAX; } return mpz_get_si(mpq_numref(r_value)); } else { Number nr; nr.set(*this, false, true); nr.round(); return nr.lintValue(overflow); } } long long int Number::llintValue() const { if(includesInfinity()) return 0; if(n_type == NUMBER_TYPE_RATIONAL) { long long result = 0; mpz_export(&result, 0, -1, sizeof result, 0, 0, mpq_numref(r_value)); if(mpq_sgn(r_value) < 0) return -result; return result; } else { Number nr; nr.set(*this, false, true); nr.round(); return nr.llintValue(); } } unsigned long int Number::ulintValue(bool *overflow) const { if(includesInfinity()) return 0; if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_fits_ulong_p(mpq_numref(r_value)) == 0) { if(overflow) *overflow = true; if(mpz_sgn(mpq_numref(r_value)) == -1) return 0; return ULONG_MAX; } return mpz_get_ui(mpq_numref(r_value)); } else { Number nr; nr.set(*this, false, true); nr.round(); return nr.ulintValue(overflow); } } bool Number::isApproximate() const { return b_approx; } bool Number::isFloatingPoint() const { return (n_type == NUMBER_TYPE_FLOAT); } bool Number::isInterval(bool ignore_imag) const { return (n_type == NUMBER_TYPE_FLOAT && !mpfr_equal_p(fl_value, fu_value)) || (!ignore_imag && i_value && i_value->isInterval()); } bool Number::imaginaryPartIsInterval() const { return i_value && i_value->isInterval(); } void Number::setApproximate(bool is_approximate) { if(is_approximate != isApproximate()) { if(is_approximate) { //i_precision = PRECISION; b_approx = true; } else { i_precision = -1; b_approx = false; } } } int Number::precision(int calculate_from_interval) const { if(calculate_from_interval < 0) { int iv_prec = precision(1); if(i_precision < 0 || iv_prec < i_precision) return iv_prec; } else if(calculate_from_interval > 0) { if(n_type == NUMBER_TYPE_FLOAT && !mpfr_equal_p(fl_value, fu_value)) { mpfr_clear_flags(); mpfr_t f_diff, f_mid; mpfr_inits2(mpfr_get_prec(fl_value), f_diff, f_mid, NULL); mpfr_sub(f_diff, fu_value, fl_value, MPFR_RNDN); mpfr_div_ui(f_diff, f_diff, 2, MPFR_RNDN); mpfr_add(f_mid, fl_value, f_diff, MPFR_RNDN); mpfr_mul_ui(f_diff, f_diff, 2, MPFR_RNDN); mpfr_div(f_diff, f_mid, f_diff, MPFR_RNDN); mpfr_abs(f_diff, f_diff, MPFR_RNDN); mpfr_log10(f_diff, f_diff, MPFR_RNDN); int i_prec = -1; if(mpfr_sgn(f_diff) < 0) { i_prec = 0; } else if(!mpfr_fits_sint_p(f_diff, MPFR_RNDU)) { if(mpfr_sgn(f_diff) < 0) i_prec = 0; } else { i_prec = mpfr_get_si(f_diff, MPFR_RNDD) + 1; } if(i_value) { int imag_prec = i_value->precision(1); if(imag_prec >= 0 && (i_prec < 0 || imag_prec < i_prec)) i_prec = imag_prec; } mpfr_clears(f_diff, f_mid, NULL); return i_prec; } else if(i_value) return i_value->precision(1); return -1; } return i_precision; } void Number::setPrecision(int prec) { i_precision = prec; if(i_precision >= 0) b_approx = true; } bool Number::isUndefined() const { return false; } bool Number::isInfinite(bool ignore_imag) const { return n_type >= NUMBER_TYPE_PLUS_INFINITY && (ignore_imag || !i_value || i_value->isZero()); } bool Number::isPlusInfinity(bool ignore_imag) const { return n_type == NUMBER_TYPE_PLUS_INFINITY && (ignore_imag || !i_value || i_value->isZero()); } bool Number::isMinusInfinity(bool ignore_imag) const { return n_type == NUMBER_TYPE_MINUS_INFINITY && (ignore_imag || !i_value || i_value->isZero()); } bool Number::includesInfinity(bool ignore_imag) const { return n_type >= NUMBER_TYPE_PLUS_INFINITY || (n_type == NUMBER_TYPE_FLOAT && (mpfr_inf_p(fl_value) || mpfr_inf_p(fu_value))) || (!ignore_imag && i_value && i_value->includesInfinity()); } bool Number::includesPlusInfinity() const { return n_type == NUMBER_TYPE_PLUS_INFINITY || (n_type == NUMBER_TYPE_FLOAT && (mpfr_inf_p(fu_value) && mpfr_sgn(fu_value) >= 0)); } bool Number::includesMinusInfinity() const { return n_type == NUMBER_TYPE_MINUS_INFINITY || (n_type == NUMBER_TYPE_FLOAT && (mpfr_inf_p(fl_value) && mpfr_sgn(fl_value) < 0)); } Number Number::realPart() const { Number real_part; real_part.set(*this, true, true); return real_part; } Number Number::imaginaryPart() const { if(!i_value) return Number(); return *i_value; } Number Number::lowerEndPoint(bool include_imag) const { if(i_value && !i_value->isZero()) { if(include_imag) { if(!isInterval(false)) return *this; Number nr; if(isInterval(true)) nr.setInternal(fl_value); else nr.set(realPart()); nr.setImaginaryPart(i_value->lowerEndPoint()); nr.setPrecisionAndApproximateFrom(*this); return nr; } if(!isInterval()) return realPart(); } else if(!isInterval()) return *this; Number nr; nr.setInternal(fl_value); nr.setPrecisionAndApproximateFrom(*this); return nr; } Number Number::upperEndPoint(bool include_imag) const { if(i_value && !i_value->isZero()) { if(include_imag) { if(!isInterval(false)) return *this; Number nr; if(isInterval(true)) nr.setInternal(fu_value); else nr.set(realPart()); nr.setImaginaryPart(i_value->upperEndPoint()); nr.setPrecisionAndApproximateFrom(*this); return nr; } if(!isInterval()) return realPart(); } else if(!isInterval()) return *this; Number nr; nr.setInternal(fu_value); nr.setPrecisionAndApproximateFrom(*this); return nr; } Number Number::numerator() const { Number num; num.setInternal(mpq_numref(r_value)); return num; } Number Number::denominator() const { Number den; den.setInternal(mpq_denref(r_value)); return den; } Number Number::complexNumerator() const { Number num; if(hasImaginaryPart()) num.setInternal(mpq_numref(i_value->internalRational())); return num; } Number Number::complexDenominator() const { Number den(1, 0); if(hasImaginaryPart()) den.setInternal(mpq_denref(i_value->internalRational())); return den; } void Number::operator = (const Number &o) {set(o);} void Number::operator = (long int i) {set(i, 1);} void Number::operator -- (int) { if(n_type == NUMBER_TYPE_RATIONAL) { mpz_sub(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); } else if(n_type == NUMBER_TYPE_FLOAT) { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_sub_ui(fl_value, fl_value, 1, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_sub_ui(fu_value, fu_value, 1, MPFR_RNDU); mpfr_sub_ui(fl_value, fl_value, 1, MPFR_RNDD); } } } void Number::operator ++ (int) { if(n_type == NUMBER_TYPE_RATIONAL) { mpz_add(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); } else if(n_type == NUMBER_TYPE_FLOAT) { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_add_ui(fl_value, fl_value, 1, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_add_ui(fu_value, fu_value, 1, MPFR_RNDU); mpfr_add_ui(fl_value, fl_value, 1, MPFR_RNDD); } } } Number Number::operator - () const {Number o(*this); o.negate(); return o;} Number Number::operator * (const Number &o) const {Number o2(*this); o2.multiply(o); return o2;} Number Number::operator / (const Number &o) const {Number o2(*this); o2.divide(o); return o2;} Number Number::operator + (const Number &o) const {Number o2(*this); o2.add(o); return o2;} Number Number::operator - (const Number &o) const {Number o2(*this); o2.subtract(o); return o2;} Number Number::operator ^ (const Number &o) const {Number o2(*this); o2.raise(o); return o2;} Number Number::operator * (long int i) const {Number o2(*this); o2.multiply(i); return o2;} Number Number::operator / (long int i) const {Number o2(*this); o2.divide(i); return o2;} Number Number::operator + (long int i) const {Number o2(*this); o2.add(i); return o2;} Number Number::operator - (long int i) const {Number o2(*this); o2.subtract(i); return o2;} Number Number::operator ^ (long int i) const {Number o2(*this); o2.raise(i); return o2;} Number Number::operator && (const Number &o) const {Number o2(*this); o2.add(o, OPERATION_LOGICAL_AND); return o2;} Number Number::operator || (const Number &o) const {Number o2(*this); o2.add(o, OPERATION_LOGICAL_OR); return o2;} Number Number::operator ! () const {Number o(*this); o.setLogicalNot(); return o;} void Number::operator *= (const Number &o) {multiply(o);} void Number::operator /= (const Number &o) {divide(o);} void Number::operator += (const Number &o) {add(o);} void Number::operator -= (const Number &o) {subtract(o);} void Number::operator ^= (const Number &o) {raise(o);} void Number::operator *= (long int i) {multiply(i);} void Number::operator /= (long int i) {divide(i);} void Number::operator += (long int i) {add(i);} void Number::operator -= (long int i) {subtract(i);} void Number::operator ^= (long int i) {raise(i);} bool Number::operator == (const Number &o) const {return equals(o);} bool Number::operator != (const Number &o) const {return !equals(o);} bool Number::operator < (const Number &o) const {return isLessThan(o);} bool Number::operator <= (const Number &o) const {return isLessThanOrEqualTo(o);} bool Number::operator > (const Number &o) const {return isGreaterThan(o);} bool Number::operator >= (const Number &o) const {return isGreaterThanOrEqualTo(o);} bool Number::operator == (long int i) const {return equals(i);} bool Number::operator != (long int i) const {return !equals(i);} bool Number::operator < (long int i) const {return isLessThan(i);} bool Number::operator <= (long int i) const {return isLessThanOrEqualTo(i);} bool Number::operator > (long int i) const {return isGreaterThan(i);} bool Number::operator >= (long int i) const {return isGreaterThanOrEqualTo(i);} bool Number::bitAnd(const Number &o) { if(!o.isInteger() || !isInteger()) return false; mpz_and(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); setPrecisionAndApproximateFrom(o); return true; } bool Number::bitOr(const Number &o) { if(!o.isInteger() || !isInteger()) return false; mpz_ior(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); setPrecisionAndApproximateFrom(o); return true; } bool Number::bitXor(const Number &o) { if(!o.isInteger() || !isInteger()) return false; mpz_xor(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); setPrecisionAndApproximateFrom(o); return true; } bool Number::bitNot() { if(!isInteger()) return false; mpz_com(mpq_numref(r_value), mpq_numref(r_value)); return true; } bool Number::bitCmp(unsigned int bits) { if(!isInteger()) return false; if(isNegative()) { return negate() && subtract(1); } for(unsigned int i = 0; i < bits; i++) { mpz_combit(mpq_numref(r_value), i); } return true; } bool Number::bitEqv(const Number &o) { if(!o.isInteger() || !isInteger()) return false; bitXor(o); bitNot(); setPrecisionAndApproximateFrom(o); return true; } bool Number::shiftLeft(const Number &o) { if(!o.isInteger() || !isInteger() || o.isNegative()) return false; bool overflow = false; long int y = o.lintValue(&overflow); if(overflow) return false; mpz_mul_2exp(mpq_numref(r_value), mpq_numref(r_value), (unsigned long int) y); setPrecisionAndApproximateFrom(o); return true; } bool Number::shiftRight(const Number &o) { if(!o.isInteger() || !isInteger() || o.isNegative()) return false; bool overflow = false; long int y = o.lintValue(&overflow); if(overflow) return false; mpz_tdiv_q_2exp(mpq_numref(r_value), mpq_numref(r_value), (unsigned long int) y); setPrecisionAndApproximateFrom(o); return true; } bool Number::shift(const Number &o) { if(!o.isInteger() || !isInteger()) return false; bool overflow = false; long int y = o.lintValue(&overflow); if(overflow) return false; if(y < 0) mpz_tdiv_q_2exp(mpq_numref(r_value), mpq_numref(r_value), (unsigned long int) -y); else mpz_mul_2exp(mpq_numref(r_value), mpq_numref(r_value), (unsigned long int) y); setPrecisionAndApproximateFrom(o); return true; } bool Number::hasRealPart() const { if(isInfinite(true)) return true; if(n_type == NUMBER_TYPE_RATIONAL) return mpq_sgn(r_value) != 0; return !mpfr_zero_p(fu_value) || !mpfr_zero_p(fl_value); } bool Number::hasImaginaryPart() const { return i_value && !i_value->isZero(); } bool Number::testErrors(int error_level) const { if(mpfr_underflow_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point underflow"), NULL); return true;} if(mpfr_overflow_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point overflow"), NULL); return true;} if(mpfr_divby0_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point division by zero exception"), NULL); return true;} if(mpfr_nanflag_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point not a number exception"), NULL); return true;} if(mpfr_erangeflag_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point range exception"), NULL); return true;} return false; } bool testComplexZero(const Number *this_nr, const Number *i_nr) { if(!i_nr) return false; if(!this_nr->isInfinite(true) && !i_nr->isInfinite(true) && !i_nr->isZero() && !this_nr->isZero()) { if(i_nr->isFloatingPoint() && (!i_nr->isInterval() || !i_nr->isNonZero())) { mpfr_t thisf, testf; mpfr_inits2(BIT_PRECISION - 10, thisf, testf, NULL); bool b = true, b2 = false; if(!this_nr->isInterval() || (!mpfr_zero_p(this_nr->internalLowerFloat()) && !mpfr_inf_p(this_nr->internalLowerFloat()))) { b2 = true; if(this_nr->isFloatingPoint()) { mpfr_set(thisf, this_nr->internalLowerFloat(), MPFR_RNDN); } else { mpfr_set_q(thisf, this_nr->internalRational(), MPFR_RNDN); } mpfr_add(testf, thisf, i_nr->internalLowerFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); if(b) { mpfr_add(testf, thisf, i_nr->internalUpperFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); } } if(b && this_nr->isInterval() && !mpfr_zero_p(this_nr->internalUpperFloat()) && !mpfr_inf_p(this_nr->internalUpperFloat())) { b2 = true; mpfr_set(thisf, this_nr->internalUpperFloat(), MPFR_RNDN); mpfr_add(testf, thisf, i_nr->internalLowerFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); if(b) { mpfr_add(testf, thisf, i_nr->internalUpperFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); } } mpfr_clears(thisf, testf, NULL); if(b && b2) { return true; } } } return false; } bool testComplex(Number *this_nr, Number *i_nr) { if(!i_nr) return false; if(!this_nr->isInfinite(true) && !i_nr->isInfinite(true) && !i_nr->isZero() && !this_nr->isZero()) { if(i_nr->isFloatingPoint() && (!i_nr->isInterval() || !i_nr->isNonZero())) { mpfr_t thisf, testf; mpfr_inits2(BIT_PRECISION - 10, thisf, testf, NULL); bool b = true, b2 = false; if(!this_nr->isInterval() || (!mpfr_zero_p(this_nr->internalLowerFloat()) && !mpfr_inf_p(this_nr->internalLowerFloat()))) { b2 = true; if(this_nr->isFloatingPoint()) { mpfr_set(thisf, this_nr->internalLowerFloat(), MPFR_RNDN); } else { mpfr_set_q(thisf, this_nr->internalRational(), MPFR_RNDN); } mpfr_add(testf, thisf, i_nr->internalLowerFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); if(b) { mpfr_add(testf, thisf, i_nr->internalUpperFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); } } if(b && this_nr->isInterval() && !mpfr_zero_p(this_nr->internalUpperFloat()) && !mpfr_inf_p(this_nr->internalUpperFloat())) { b2 = true; mpfr_set(thisf, this_nr->internalUpperFloat(), MPFR_RNDN); mpfr_add(testf, thisf, i_nr->internalLowerFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); if(b) { mpfr_add(testf, thisf, i_nr->internalUpperFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); } } mpfr_clears(thisf, testf, NULL); if(b && b2) { i_nr->clear(true); return true; } } if(this_nr->isFloatingPoint() && (!this_nr->isInterval() || !this_nr->realPartIsNonZero())) { mpfr_t thisf, testf; mpfr_inits2(BIT_PRECISION - 10, thisf, testf, NULL); bool b = true, b2 = false; if(!this_nr->isInterval() || (!mpfr_zero_p(i_nr->internalLowerFloat()) && !mpfr_inf_p(i_nr->internalLowerFloat()))) { b2 = true; if(i_nr->isFloatingPoint()) { mpfr_set(thisf, i_nr->internalLowerFloat(), MPFR_RNDN); } else { mpfr_set_q(thisf, i_nr->internalRational(), MPFR_RNDN); } mpfr_add(testf, thisf, this_nr->internalLowerFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); if(b) { mpfr_add(testf, thisf, this_nr->internalUpperFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); } } if(b && i_nr->isInterval() && !mpfr_zero_p(i_nr->internalUpperFloat()) && !mpfr_inf_p(i_nr->internalUpperFloat())) { b2 = true; mpfr_set(thisf, i_nr->internalUpperFloat(), MPFR_RNDN); mpfr_add(testf, thisf, this_nr->internalLowerFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); if(b) { mpfr_add(testf, thisf, this_nr->internalUpperFloat(), MPFR_RNDN); b = mpfr_equal_p(thisf, testf); } } mpfr_clears(thisf, testf, NULL); if(b && b2) { this_nr->clearReal(); return true; } } } return false; } bool Number::testFloatResult(bool allow_infinite_result, int error_level, bool test_integer) { if(mpfr_underflow_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point underflow"), NULL); return false;} if(mpfr_overflow_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point overflow"), NULL); return false;} if(mpfr_divby0_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point division by zero exception"), NULL); return false;} if(mpfr_erangeflag_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point range exception"), NULL); return false;} if(mpfr_nan_p(fu_value) || mpfr_nan_p(fl_value)) return false; if(mpfr_nanflag_p()) {if(error_level) CALCULATOR->error(error_level > 1, _("Floating point not a number exception"), NULL); return false;} if(mpfr_inexflag_p()) { b_approx = true; if(!CALCULATOR->usesIntervalArithmetic() && !isInterval() && (i_precision < 0 || i_precision > FROM_BIT_PRECISION(BIT_PRECISION))) i_precision = FROM_BIT_PRECISION(BIT_PRECISION); } mpfr_clear_flags(); if(mpfr_inf_p(fl_value) && mpfr_inf_p(fu_value) && mpfr_sgn(fl_value) == mpfr_sgn(fu_value)) { if(!allow_infinite_result) return false; int sign = mpfr_sgn(fl_value); if(sign >= 0) n_type = NUMBER_TYPE_PLUS_INFINITY; else if(sign < 0) n_type = NUMBER_TYPE_MINUS_INFINITY; mpfr_clears(fl_value, fu_value, NULL); } else if(mpfr_inf_p(fl_value) || mpfr_inf_p(fu_value)) { if(!allow_infinite_result) return false; } if(test_integer) testInteger(); if(!b_imag) testComplex(this, i_value); return true; } void Number::testInteger() { if(isFloatingPoint()) { if(mpfr_equal_p(fu_value, fl_value) && mpfr_integer_p(fl_value) && mpfr_integer_p(fu_value)) { mpfr_get_z(mpq_numref(r_value), fl_value, MPFR_RNDN); mpfr_clears(fl_value, fu_value, NULL); n_type = NUMBER_TYPE_RATIONAL; } } if(i_value) i_value->testInteger(); } void Number::setPrecisionAndApproximateFrom(const Number &o) { if(o.precision() >= 0 && (i_precision < 0 || o.precision() < i_precision)) i_precision = o.precision(); if(o.isApproximate()) b_approx = true; } bool Number::isComplex() const { return i_value && i_value->isNonZero(); } Number Number::integer() const { if(isInteger()) return *this; Number nr(*this); nr.round(); return nr; } bool Number::isInteger(IntegerType integer_type) const { if(isInfinite(true)) return false; if(hasImaginaryPart()) return false; if(isFloatingPoint()) return false; if(mpz_cmp_ui(mpq_denref(r_value), 1) != 0) return false; switch(integer_type) { case INTEGER_TYPE_NONE: {return true;} case INTEGER_TYPE_SIZE: {} case INTEGER_TYPE_UINT: {return mpz_fits_uint_p(mpq_numref(r_value)) != 0;} case INTEGER_TYPE_SINT: {return mpz_fits_sint_p(mpq_numref(r_value)) != 0;} case INTEGER_TYPE_ULONG: {return mpz_fits_ulong_p(mpq_numref(r_value)) != 0;} case INTEGER_TYPE_SLONG: {return mpz_fits_slong_p(mpq_numref(r_value)) != 0;} } return true; } bool Number::isRational() const { return n_type == NUMBER_TYPE_RATIONAL && (!i_value || i_value->isZero()); } bool Number::realPartIsRational() const { return n_type == NUMBER_TYPE_RATIONAL; } bool Number::isReal() const { return !includesInfinity() && !hasImaginaryPart(); } bool Number::isFraction() const { if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_RATIONAL) { return mpz_cmpabs(mpq_denref(r_value), mpq_numref(r_value)) > 0; } else if(n_type == NUMBER_TYPE_FLOAT) { bool frac_u = mpfr_cmp_ui(fu_value, 1) < 0 && mpfr_cmp_si(fu_value, -1) > 0; bool frac_l = mpfr_cmp_ui(fl_value, 1) < 0 && mpfr_cmp_si(fl_value, -1) > 0; return frac_u && frac_l; } return false; } bool Number::isZero() const { if(i_value && !i_value->isZero()) return false; if(n_type == NUMBER_TYPE_FLOAT) return mpfr_zero_p(fu_value) && mpfr_zero_p(fl_value); else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) == 0; return false; } bool Number::isNonZero() const { if(i_value && i_value->isNonZero()) return true; if(n_type == NUMBER_TYPE_FLOAT) return !mpfr_zero_p(fu_value) && mpfr_sgn(fu_value) == mpfr_sgn(fl_value); else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) != 0; return true; } bool Number::isOne() const { if(!isReal()) return false; if(n_type == NUMBER_TYPE_FLOAT) {return mpfr_cmp_ui(fu_value, 1) == 0 && mpfr_cmp_ui(fl_value, 1) == 0;} return mpz_cmp(mpq_denref(r_value), mpq_numref(r_value)) == 0; } bool Number::isTwo() const { if(!isReal()) return false; if(n_type == NUMBER_TYPE_FLOAT) {return mpfr_cmp_ui(fu_value, 2) == 0 && mpfr_cmp_ui(fl_value, 2) == 0;} return mpq_cmp_si(r_value, 2, 1) == 0; } bool Number::isI() const { if(!i_value || !i_value->isOne()) return false; if(n_type == NUMBER_TYPE_FLOAT) return mpfr_zero_p(fu_value) && mpfr_zero_p(fl_value); else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) == 0; return false; } bool Number::isMinusOne() const { if(!isReal()) return false; if(n_type == NUMBER_TYPE_FLOAT) {return mpfr_cmp_si(fu_value, -1) == 0 && mpfr_cmp_si(fl_value, -1) == 0;} return mpq_cmp_si(r_value, -1, 1) == 0; } bool Number::isMinusI() const { if(!i_value || !i_value->isMinusOne()) return false; if(n_type == NUMBER_TYPE_FLOAT) return mpfr_zero_p(fu_value) && mpfr_zero_p(fl_value); else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) == 0; return false; } bool Number::isNegative() const { if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_FLOAT) return mpfr_sgn(fu_value) < 0; else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) < 0; else if(n_type == NUMBER_TYPE_MINUS_INFINITY) return true; return false; } bool Number::isNonNegative() const { if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_FLOAT) {return mpfr_sgn(fl_value) >= 0;} else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) >= 0; else if(n_type == NUMBER_TYPE_PLUS_INFINITY) return true; return false; } bool Number::isPositive() const { if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_FLOAT) {return mpfr_sgn(fl_value) > 0;} else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) > 0; else if(n_type == NUMBER_TYPE_PLUS_INFINITY) return true; return false; } bool Number::isNonPositive() const { if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_FLOAT) {return mpfr_sgn(fu_value) <= 0;} else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) <= 0; else if(n_type == NUMBER_TYPE_MINUS_INFINITY) return true; return false; } bool Number::realPartIsNegative() const { if(n_type == NUMBER_TYPE_FLOAT) return mpfr_sgn(fu_value) < 0; else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) < 0; else if(n_type == NUMBER_TYPE_MINUS_INFINITY) return true; return false; } bool Number::realPartIsPositive() const { if(n_type == NUMBER_TYPE_FLOAT) return mpfr_sgn(fl_value) > 0; else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) > 0; else if(n_type == NUMBER_TYPE_PLUS_INFINITY) return true; return false; } bool Number::realPartIsNonNegative() const { if(n_type == NUMBER_TYPE_FLOAT) {return mpfr_sgn(fl_value) >= 0;} else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) >= 0; else if(n_type == NUMBER_TYPE_PLUS_INFINITY) return true; return false; } bool Number::realPartIsNonZero() const { if(n_type == NUMBER_TYPE_FLOAT) return !mpfr_zero_p(fu_value) && mpfr_sgn(fu_value) == mpfr_sgn(fl_value); else if(n_type == NUMBER_TYPE_RATIONAL) return mpz_sgn(mpq_numref(r_value)) != 0; return true; } bool Number::imaginaryPartIsNegative() const { return i_value && i_value->isNegative(); } bool Number::imaginaryPartIsPositive() const { return i_value && i_value->isPositive(); } bool Number::imaginaryPartIsNonNegative() const { return i_value && i_value->isNonNegative(); } bool Number::imaginaryPartIsNonPositive() const { return i_value && i_value->isNonPositive(); } bool Number::imaginaryPartIsNonZero() const { return i_value && i_value->isNonZero(); } bool Number::hasNegativeSign() const { if(hasRealPart()) return realPartIsNegative(); return imaginaryPartIsNegative(); } bool Number::hasPositiveSign() const { if(hasRealPart()) return realPartIsPositive(); return imaginaryPartIsPositive(); } bool Number::equalsZero() const { return isZero(); } bool Number::equals(const Number &o, bool allow_interval, bool allow_infinite) const { if(!allow_infinite && (includesInfinity() || o.includesInfinity())) return false; if(o.hasImaginaryPart()) { if(!i_value || !i_value->equals(*o.internalImaginary(), allow_interval, allow_infinite)) return false; } else if(hasImaginaryPart()) { return false; } if(allow_infinite) { if(o.isPlusInfinity()) return isPlusInfinity(); if(o.isMinusInfinity()) return isMinusInfinity(); } if(o.isFloatingPoint() && n_type != NUMBER_TYPE_FLOAT) { return mpfr_cmp_q(o.internalLowerFloat(), r_value) == 0 && mpfr_cmp_q(o.internalUpperFloat(), r_value) == 0; } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) return (allow_interval || mpfr_equal_p(fu_value, fl_value)) && mpfr_equal_p(fl_value, o.internalLowerFloat()) && mpfr_equal_p(fu_value, o.internalUpperFloat()); else return mpfr_cmp_q(fu_value, o.internalRational()) == 0 && mpfr_cmp_q(fl_value, o.internalRational()) == 0; } return mpq_cmp(r_value, o.internalRational()) == 0; } bool Number::equals(long int i) const { if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_FLOAT) return mpfr_cmp_si(fl_value, i) == 0 && mpfr_cmp_si(fu_value, i) == 0; else if(n_type == NUMBER_TYPE_RATIONAL) return mpq_cmp_si(r_value, i, 1) == 0; return false; } int Number::equalsApproximately(const Number &o, int prec) const { if(includesInfinity() || o.includesInfinity()) return false; if(o.isInterval() && !isInterval()) return o.equalsApproximately(*this, prec); if(equals(o)) return true; int b = 1; if(o.hasImaginaryPart()) { if(i_value) { b = i_value->equalsApproximately(*o.internalImaginary(), prec); if(b == 0) return b; } else { b = o.internalImaginary()->equalsApproximately(nr_zero, prec); if(b == 0) return b; } } else if(hasImaginaryPart()) { b = i_value->equalsApproximately(nr_zero, prec); if(b == 0) return b; } bool prec_choosen = prec >= 0; if(prec == EQUALS_PRECISION_LOWEST) { prec = PRECISION; if(i_precision >= 0 && i_precision < prec) prec = i_precision; if(o.precision() >= 0 && o.precision() < prec) prec = o.precision(); } else if(prec == EQUALS_PRECISION_HIGHEST) { prec = i_precision; if(o.precision() >= 0 && o.precision() > prec) prec = o.precision(); if(prec < 0) prec = PRECISION; } else if(prec == EQUALS_PRECISION_DEFAULT) { prec = PRECISION; } if(prec_choosen || isApproximate() || o.isApproximate()) { int b2 = 0; if(isInterval()) { if(o.isInterval()) { mpfr_t test1, test2, test3, test4; mpfr_inits2(::ceil(prec * 3.3219281), test1, test2, test3, test4, NULL); if(!isNonZero() || !o.isNonZero()) { mpfr_add_ui(test1, fl_value, 1, MPFR_RNDN); mpfr_add_ui(test2, fu_value, 1, MPFR_RNDN); mpfr_add_ui(test3, o.internalLowerFloat(), 1, MPFR_RNDN); mpfr_add_ui(test4, o.internalUpperFloat(), 1, MPFR_RNDN); } else { mpfr_set(test1, fl_value, MPFR_RNDN); mpfr_set(test2, fu_value, MPFR_RNDN); mpfr_set(test3, o.internalLowerFloat(), MPFR_RNDN); mpfr_set(test4, o.internalUpperFloat(), MPFR_RNDN); } if(mpfr_equal_p(test1, test2) && mpfr_equal_p(test2, test3) && mpfr_equal_p(test3, test4)) b2 = 1; else if(mpfr_cmp(test1, test4) > 0 || mpfr_cmp(test2, test3) < 0) b2 = 0; else b2 = -1; mpfr_clears(test1, test2, test3, test4, NULL); } else if(!isNonZero() && o.isZero()) { mpfr_t test1, test2; mpfr_inits2(::ceil(prec * 3.3219281), test1, test2, NULL); mpfr_add_ui(test1, fl_value, 1, MPFR_RNDN); mpfr_add_ui(test2, fu_value, 1, MPFR_RNDN); if(mpfr_equal_p(test1, test2)) b2 = true; mpfr_clears(test1, test2, NULL); } else { mpfr_t test1, test2, test3; mpfr_inits2(::ceil(prec * 3.3219281), test1, test2, test3, NULL); mpfr_set(test1, fl_value, MPFR_RNDN); mpfr_set(test2, fu_value, MPFR_RNDN); if(o.isFloatingPoint()) { mpfr_set(test3, o.internalLowerFloat(), MPFR_RNDN); } else { mpfr_set_q(test3, o.internalRational(), MPFR_RNDN); } if(mpfr_equal_p(test1, test2) && mpfr_equal_p(test2, test3)) b2 = 1; else if(mpfr_cmp(test3, test1) < 0 || mpfr_cmp(test3, test2) > 0) b2 = 0; else b2 = -1; mpfr_clears(test1, test2, test3, NULL); } } else { mpfr_t test1, test2; mpfr_inits2(::ceil(prec * 3.3219281), test1, test2, NULL); if(n_type == NUMBER_TYPE_FLOAT) { mpfr_set(test1, fl_value, MPFR_RNDN); } else { mpfr_set_q(test1, r_value, MPFR_RNDN); } if(o.isFloatingPoint()) { mpfr_set(test2, o.internalLowerFloat(), MPFR_RNDN); } else { mpfr_set_q(test2, o.internalRational(), MPFR_RNDN); } if(mpfr_equal_p(test1, test2)) { b2 = 1; } else { mpfr_add_ui(test1, test1, 1, MPFR_RNDN); mpfr_add_ui(test2, test2, 1, MPFR_RNDN); if(mpfr_equal_p(test1, test2)) b2 = -1; } mpfr_clears(test1, test2, NULL); } if(b2 < 0) b = -1; if(b2 == 0) b = 0; return b; } if(b == 1) b = 0; return b; } ComparisonResult Number::compare(long int i) const {return compare(Number(i, 1));} ComparisonResult Number::compare(const Number &o, bool ignore_imag) const { if(isPlusInfinity()) { if((!ignore_imag && o.hasImaginaryPart()) || o.includesPlusInfinity()) return COMPARISON_RESULT_UNKNOWN; else return COMPARISON_RESULT_LESS; } if(isMinusInfinity()) { if((!ignore_imag && o.hasImaginaryPart()) || o.includesMinusInfinity()) return COMPARISON_RESULT_UNKNOWN; else return COMPARISON_RESULT_GREATER; } if(o.isPlusInfinity()) { if((!ignore_imag && hasImaginaryPart()) || includesPlusInfinity()) return COMPARISON_RESULT_UNKNOWN; return COMPARISON_RESULT_GREATER; } if(o.isMinusInfinity()) { if((!ignore_imag && hasImaginaryPart()) || includesMinusInfinity()) return COMPARISON_RESULT_UNKNOWN; return COMPARISON_RESULT_LESS; } if(!ignore_imag && equals(o)) return COMPARISON_RESULT_EQUAL; if(ignore_imag || (!hasImaginaryPart() && !o.hasImaginaryPart())) { int i = 0, i2 = 0; if(o.isFloatingPoint() && n_type != NUMBER_TYPE_FLOAT) { i = mpfr_cmp_q(o.internalLowerFloat(), r_value); i2 = mpfr_cmp_q(o.internalUpperFloat(), r_value); if(i != i2) return COMPARISON_RESULT_CONTAINS; } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) { i = mpfr_cmp(o.internalUpperFloat(), fl_value); i2 = mpfr_cmp(o.internalLowerFloat(), fu_value); if(i != i2 && i2 <= 0 && i >= 0) { i = mpfr_cmp(o.internalLowerFloat(), fl_value); i2 = mpfr_cmp(o.internalUpperFloat(), fu_value); if(i > 0) { if(i2 <= 0) return COMPARISON_RESULT_CONTAINED; else return COMPARISON_RESULT_OVERLAPPING_GREATER; } else if(i < 0) { if(i2 >= 0) return COMPARISON_RESULT_CONTAINS; else return COMPARISON_RESULT_OVERLAPPING_LESS; } else { if(i2 == 0) return COMPARISON_RESULT_EQUAL_LIMITS; else if(i2 > 0) return COMPARISON_RESULT_CONTAINS; else return COMPARISON_RESULT_CONTAINED; } } } else { i = -mpfr_cmp_q(fl_value, o.internalRational()); i2 = -mpfr_cmp_q(fu_value, o.internalRational()); if(i != i2) return COMPARISON_RESULT_CONTAINED; } } else { i = mpq_cmp(o.internalRational(), r_value); i2 = i; } if(i2 == 0 || i == 0) { if(i == 0) i = i2; if(i > 0) return COMPARISON_RESULT_EQUAL_OR_GREATER; else if(i < 0) return COMPARISON_RESULT_EQUAL_OR_LESS; } else if(i2 != i) { return COMPARISON_RESULT_UNKNOWN; } if(i == 0) return COMPARISON_RESULT_EQUAL; else if(i > 0) return COMPARISON_RESULT_GREATER; else return COMPARISON_RESULT_LESS; } else { if(hasImaginaryPart()) { if(o.hasImaginaryPart()) { ComparisonResult cr = realPart().compare(o.realPart()); if(COMPARISON_IS_NOT_EQUAL(cr)) return COMPARISON_RESULT_NOT_EQUAL; if(cr == COMPARISON_RESULT_EQUAL || COMPARISON_MIGHT_BE_EQUAL(cr)) { cr = imaginaryPart().compare(o.imaginaryPart()); if(COMPARISON_IS_NOT_EQUAL(cr)) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_UNKNOWN; } } else if(!i_value->isNonZero()) { ComparisonResult cr = realPart().compare(o.realPart()); if(COMPARISON_IS_NOT_EQUAL(cr)) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_UNKNOWN; } } else if(!o.imaginaryPartIsNonZero()) { ComparisonResult cr = realPart().compare(o.realPart()); if(COMPARISON_IS_NOT_EQUAL(cr)) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_UNKNOWN; } return COMPARISON_RESULT_NOT_EQUAL; } } ComparisonResult Number::compareAbsolute(const Number &o, bool ignore_imag) const { if(isPositive()) { if(o.isPositive()) return compare(o, ignore_imag); Number nr(o); nr.negate(); return compare(nr, ignore_imag); } else if(o.isPositive()) { Number nr(*this); nr.negate(); return nr.compare(o, ignore_imag); } if(!ignore_imag && (hasImaginaryPart() || o.hasImaginaryPart())) { Number nr1(*this); nr1.negate(); Number nr2(o); nr2.negate(); return nr1.compare(nr2, ignore_imag); } return o.compare(*this, ignore_imag); } ComparisonResult Number::compareApproximately(const Number &o, int prec) const { if(isPlusInfinity()) { if(o.hasImaginaryPart() || o.includesPlusInfinity()) return COMPARISON_RESULT_UNKNOWN; else return COMPARISON_RESULT_LESS; } if(isMinusInfinity()) { if(o.hasImaginaryPart() || o.includesMinusInfinity()) return COMPARISON_RESULT_UNKNOWN; else return COMPARISON_RESULT_GREATER; } if(o.isPlusInfinity()) { if(hasImaginaryPart() || includesPlusInfinity()) return COMPARISON_RESULT_UNKNOWN; return COMPARISON_RESULT_GREATER; } if(o.isMinusInfinity()) { if(hasImaginaryPart() || includesMinusInfinity()) return COMPARISON_RESULT_UNKNOWN; return COMPARISON_RESULT_LESS; } int b = equalsApproximately(o, prec); if(b > 0) return COMPARISON_RESULT_EQUAL; else if(b < 0) return COMPARISON_RESULT_UNKNOWN; if(!hasImaginaryPart() && !o.hasImaginaryPart()) { int i = 0, i2 = 0; if(o.isFloatingPoint() && n_type != NUMBER_TYPE_FLOAT) { i = mpfr_cmp_q(o.internalLowerFloat(), r_value); i2 = mpfr_cmp_q(o.internalUpperFloat(), r_value); if(i != i2) return COMPARISON_RESULT_CONTAINS; } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) { i = mpfr_cmp(o.internalUpperFloat(), fl_value); i2 = mpfr_cmp(o.internalLowerFloat(), fu_value); if(i != i2 && i2 <= 0 && i >= 0) { i = mpfr_cmp(o.internalLowerFloat(), fl_value); i2 = mpfr_cmp(o.internalUpperFloat(), fu_value); if(i > 0) { if(i2 <= 0) return COMPARISON_RESULT_CONTAINED; else return COMPARISON_RESULT_OVERLAPPING_GREATER; } else if(i < 0) { if(i2 >= 0) return COMPARISON_RESULT_CONTAINS; else return COMPARISON_RESULT_OVERLAPPING_LESS; } else { if(i2 == 0) return COMPARISON_RESULT_EQUAL_LIMITS; else if(i2 > 0) return COMPARISON_RESULT_CONTAINS; else return COMPARISON_RESULT_CONTAINED; } } } else { i = -mpfr_cmp_q(fl_value, o.internalRational()); i2 = -mpfr_cmp_q(fu_value, o.internalRational()); if(i != i2) return COMPARISON_RESULT_CONTAINED; } } else { i = mpq_cmp(o.internalRational(), r_value); i2 = i; } if(i2 == 0 || i == 0) { if(i == 0) i = i2; if(i > 0) return COMPARISON_RESULT_EQUAL_OR_GREATER; else if(i < 0) return COMPARISON_RESULT_EQUAL_OR_LESS; } else if(i2 != i) { return COMPARISON_RESULT_UNKNOWN; } if(i == 0) return COMPARISON_RESULT_EQUAL; else if(i > 0) return COMPARISON_RESULT_GREATER; else return COMPARISON_RESULT_LESS; } else { if(hasImaginaryPart()) { if(o.hasImaginaryPart()) { ComparisonResult cr = realPart().compareApproximately(o.realPart()); if(COMPARISON_IS_NOT_EQUAL(cr)) return COMPARISON_RESULT_NOT_EQUAL; if(cr == COMPARISON_RESULT_EQUAL || COMPARISON_MIGHT_BE_EQUAL(cr)) { cr = imaginaryPart().compareApproximately(o.imaginaryPart()); if(COMPARISON_IS_NOT_EQUAL(cr)) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_UNKNOWN; } } else if(!i_value->isNonZero()) { ComparisonResult cr = realPart().compareApproximately(o.realPart()); if(COMPARISON_IS_NOT_EQUAL(cr)) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_UNKNOWN; } } else if(!o.imaginaryPartIsNonZero()) { ComparisonResult cr = realPart().compareApproximately(o.realPart()); if(COMPARISON_IS_NOT_EQUAL(cr)) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_UNKNOWN; } return COMPARISON_RESULT_NOT_EQUAL; } } ComparisonResult Number::compareImaginaryParts(const Number &o) const { if(o.hasImaginaryPart()) { if(!i_value) { if(o.imaginaryPartIsNonZero()) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_UNKNOWN; } return i_value->compareRealParts(*o.internalImaginary()); } else if(hasImaginaryPart()) { if(i_value->isNonZero()) return COMPARISON_RESULT_NOT_EQUAL; return COMPARISON_RESULT_NOT_EQUAL; } return COMPARISON_RESULT_EQUAL; } ComparisonResult Number::compareRealParts(const Number &o) const { return compare(o, true); } bool Number::isGreaterThan(const Number &o) const { if(n_type == NUMBER_TYPE_MINUS_INFINITY || o.isPlusInfinity()) return false; if(o.isMinusInfinity()) return true; if(n_type == NUMBER_TYPE_PLUS_INFINITY) return true; if(hasImaginaryPart() || o.hasImaginaryPart()) return false; if(o.isFloatingPoint() && n_type != NUMBER_TYPE_FLOAT) { return mpfr_cmp_q(o.internalUpperFloat(), r_value) < 0; } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) return mpfr_greater_p(fl_value, o.internalUpperFloat()); else return mpfr_cmp_q(fl_value, o.internalRational()) > 0; } return mpq_cmp(r_value, o.internalRational()) > 0; } bool Number::isLessThan(const Number &o) const { if(o.isMinusInfinity() || n_type == NUMBER_TYPE_PLUS_INFINITY) return false; if(n_type == NUMBER_TYPE_MINUS_INFINITY || o.isPlusInfinity()) return true; if(hasImaginaryPart() || o.hasImaginaryPart()) return false; if(o.isFloatingPoint() && n_type != NUMBER_TYPE_FLOAT) { return mpfr_cmp_q(o.internalLowerFloat(), r_value) > 0; } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) return mpfr_less_p(fu_value, o.internalLowerFloat()); else return mpfr_cmp_q(fu_value, o.internalRational()) < 0; } return mpq_cmp(r_value, o.internalRational()) < 0; } bool Number::isGreaterThanOrEqualTo(const Number &o) const { if(n_type == NUMBER_TYPE_MINUS_INFINITY || o.isPlusInfinity()) return false; if(o.isMinusInfinity()) return true; if(n_type == NUMBER_TYPE_PLUS_INFINITY) return true; if(!hasImaginaryPart() && !o.hasImaginaryPart()) { if(o.isFloatingPoint() && n_type != NUMBER_TYPE_FLOAT) { return mpfr_cmp_q(o.internalUpperFloat(), r_value) <= 0; } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) return mpfr_greaterequal_p(fl_value, o.internalUpperFloat()); else return mpfr_cmp_q(fl_value, o.internalRational()) >= 0; } return mpq_cmp(r_value, o.internalRational()) >= 0; } return false; } bool Number::isLessThanOrEqualTo(const Number &o) const { if(o.isMinusInfinity() || n_type == NUMBER_TYPE_PLUS_INFINITY) return false; if(n_type == NUMBER_TYPE_MINUS_INFINITY || o.isPlusInfinity()) return true; if(!hasImaginaryPart() && !o.hasImaginaryPart()) { if(o.isFloatingPoint() && n_type != NUMBER_TYPE_FLOAT) { return mpfr_cmp_q(o.internalLowerFloat(), r_value) >= 0; } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) return mpfr_lessequal_p(fu_value, o.internalLowerFloat()); else return mpfr_cmp_q(fu_value, o.internalRational()) <= 0; } return mpq_cmp(r_value, o.internalRational()) <= 0; } return false; } bool Number::isGreaterThan(long int i) const { if(n_type == NUMBER_TYPE_MINUS_INFINITY) return false; if(n_type == NUMBER_TYPE_PLUS_INFINITY) return true; if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_FLOAT) { return mpfr_cmp_si(fl_value, i) > 0; } return mpq_cmp_si(r_value, i, 1) > 0; } bool Number::isLessThan(long int i) const { if(n_type == NUMBER_TYPE_PLUS_INFINITY) return false; if(n_type == NUMBER_TYPE_MINUS_INFINITY) return true; if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_FLOAT) { return mpfr_cmp_si(fu_value, i) < 0; } return mpq_cmp_si(r_value, i, 1) < 0; } bool Number::isGreaterThanOrEqualTo(long int i) const { if(n_type == NUMBER_TYPE_MINUS_INFINITY) return false; if(n_type == NUMBER_TYPE_PLUS_INFINITY) return true; if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_FLOAT) { return mpfr_cmp_si(fl_value, i) >= 0; } return mpq_cmp_si(r_value, i, 1) >= 0; } bool Number::isLessThanOrEqualTo(long int i) const { if(n_type == NUMBER_TYPE_PLUS_INFINITY) return false; if(n_type == NUMBER_TYPE_MINUS_INFINITY) return true; if(hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_FLOAT) { return mpfr_cmp_si(fu_value, i) <= 0; } return mpq_cmp_si(r_value, i, 1) <= 0; } bool Number::numeratorIsGreaterThan(long int i) const { if(!isRational()) return false; return mpz_cmp_si(mpq_numref(r_value), i) > 0; } bool Number::numeratorIsLessThan(long int i) const { if(!isRational()) return false; return mpz_cmp_si(mpq_numref(r_value), i) < 0; } bool Number::numeratorEquals(long int i) const { if(!isRational()) return false; return mpz_cmp_si(mpq_numref(r_value), i) == 0; } bool Number::denominatorIsGreaterThan(long int i) const { if(!isRational()) return false; return mpz_cmp_si(mpq_denref(r_value), i) > 0; } bool Number::denominatorIsLessThan(long int i) const { if(!isRational()) return false; return mpz_cmp_si(mpq_denref(r_value), i) < 0; } bool Number::denominatorEquals(long int i) const { if(!isRational()) return false; return mpz_cmp_si(mpq_denref(r_value), i) == 0; } bool Number::denominatorIsGreater(const Number &o) const { if(!isRational() || !o.isRational()) return false; return mpz_cmp(mpq_denref(r_value), mpq_denref(o.internalRational())) > 0; } bool Number::denominatorIsLess(const Number &o) const { if(!isRational() || !o.isRational()) return false; return mpz_cmp(mpq_denref(r_value), mpq_denref(o.internalRational())) < 0; } bool Number::denominatorIsEqual(const Number &o) const { if(!isRational() || !o.isRational()) return false; return mpz_cmp(mpq_denref(r_value), mpq_denref(o.internalRational())) == 0; } bool Number::isEven() const { return isInteger() && mpz_even_p(mpq_numref(r_value)); } bool Number::denominatorIsEven() const { return !isInfinite() && !hasImaginaryPart() && !isFloatingPoint() && mpz_even_p(mpq_denref(r_value)); } bool Number::denominatorIsTwo() const { return !isInfinite() && !hasImaginaryPart() && !isFloatingPoint() && mpz_cmp_si(mpq_denref(r_value), 2) == 0; } bool Number::numeratorIsEven() const { return !isInfinite() && !hasImaginaryPart() && !isFloatingPoint() && mpz_even_p(mpq_numref(r_value)); } bool Number::numeratorIsOne() const { return !isInfinite() && !hasImaginaryPart() && !isFloatingPoint() && mpz_cmp_si(mpq_numref(r_value), 1) == 0; } bool Number::numeratorIsMinusOne() const { return !isInfinite() && !hasImaginaryPart() && !isFloatingPoint() && mpz_cmp_si(mpq_numref(r_value), -1) == 0; } bool Number::isOdd() const { return isInteger() && mpz_odd_p(mpq_numref(r_value)); } int Number::integerLength() const { if(isInteger()) return mpz_sizeinbase(mpq_numref(r_value), 2); return 0; } bool Number::add(const Number &o) { if(n_type == NUMBER_TYPE_RATIONAL && o.realPartIsRational()) { if(o.hasImaginaryPart()) { if(!i_value) {i_value = new Number(*o.internalImaginary()); i_value->markAsImaginaryPart();} else if(!i_value->add(*o.internalImaginary())) return false; setPrecisionAndApproximateFrom(*i_value); } mpq_add(r_value, r_value, o.internalRational()); setPrecisionAndApproximateFrom(o); return true; } Number nr_bak(*this); if(o.hasImaginaryPart()) { if(!i_value) {i_value = new Number(*o.internalImaginary()); i_value->markAsImaginaryPart();} else if(!i_value->add(*o.internalImaginary())) return false; setPrecisionAndApproximateFrom(*i_value); } if(includesMinusInfinity() && o.includesPlusInfinity()) return false; if(includesPlusInfinity() && o.includesMinusInfinity()) return false; if(isInfinite(true)) { setPrecisionAndApproximateFrom(o); return true; } if(o.isPlusInfinity(true)) { setPlusInfinity(true, true); setPrecisionAndApproximateFrom(o); return true; } if(o.isMinusInfinity(true)) { setMinusInfinity(true, true); setPrecisionAndApproximateFrom(o); return true; } if(o.isFloatingPoint() || n_type == NUMBER_TYPE_FLOAT) { mpfr_clear_flags(); if(n_type != NUMBER_TYPE_FLOAT) { mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); n_type = NUMBER_TYPE_FLOAT; if(!CALCULATOR->usesIntervalArithmetic() && !o.isInterval()) { mpfr_add_q(fl_value, o.internalLowerFloat(), r_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_add_q(fu_value, o.internalUpperFloat(), r_value, MPFR_RNDU); mpfr_add_q(fl_value, o.internalLowerFloat(), r_value, MPFR_RNDD); } mpq_set_ui(r_value, 0, 1); } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval() && !o.isInterval()) { mpfr_add(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_add(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDU); mpfr_add(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDD); } } else { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_add_q(fl_value, fl_value, o.internalRational(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_add_q(fu_value, fu_value, o.internalRational(), MPFR_RNDU); mpfr_add_q(fl_value, fl_value, o.internalRational(), MPFR_RNDD); } } } if(!testFloatResult(true)) { set(nr_bak); return false; } } setPrecisionAndApproximateFrom(o); return true; } bool Number::add(long int i) { if(i == 0) return true; if(isInfinite(true)) return true; if(n_type == NUMBER_TYPE_FLOAT) { Number nr_bak(*this); mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_add_si(fl_value, fl_value, i, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_add_si(fu_value, fu_value, i, MPFR_RNDU); mpfr_add_si(fl_value, fl_value, i, MPFR_RNDD); } if(!testFloatResult(true)) { set(nr_bak); return false; } } else { if(i < 0) mpz_submul_ui(mpq_numref(r_value), mpq_denref(r_value), (unsigned int) (-i)); else mpz_addmul_ui(mpq_numref(r_value), mpq_denref(r_value), (unsigned int) i); } return true; } bool Number::subtract(const Number &o) { if(n_type == NUMBER_TYPE_RATIONAL && o.realPartIsRational()) { if(o.hasImaginaryPart()) { if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} if(!i_value->subtract(*o.internalImaginary())) return false; setPrecisionAndApproximateFrom(*i_value); } mpq_sub(r_value, r_value, o.internalRational()); setPrecisionAndApproximateFrom(o); return true; } Number nr_bak(*this); if(includesPlusInfinity() && o.includesPlusInfinity()) return false; if(includesMinusInfinity() && o.includesMinusInfinity()) return false; if(o.hasImaginaryPart()) { if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} if(!i_value->subtract(*o.internalImaginary())) return false; setPrecisionAndApproximateFrom(*i_value); } if(isInfinite()) { setPrecisionAndApproximateFrom(o); return true; } if(o.isPlusInfinity(true)) { setMinusInfinity(true, true); setPrecisionAndApproximateFrom(o); return true; } if(o.isMinusInfinity(true)) { setPlusInfinity(true, true); setPrecisionAndApproximateFrom(o); return true; } if(o.isFloatingPoint() || n_type == NUMBER_TYPE_FLOAT) { mpfr_clear_flags(); if(n_type != NUMBER_TYPE_FLOAT) { mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); n_type = NUMBER_TYPE_FLOAT; if(!CALCULATOR->usesIntervalArithmetic() && !o.isInterval()) { mpfr_sub_q(fl_value, o.internalLowerFloat(), r_value, MPFR_RNDN); mpfr_neg(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_sub_q(fu_value, o.internalLowerFloat(), r_value, MPFR_RNDD); mpfr_neg(fu_value, fu_value, MPFR_RNDU); mpfr_sub_q(fl_value, o.internalUpperFloat(), r_value, MPFR_RNDU); mpfr_neg(fl_value, fl_value, MPFR_RNDD); } mpq_set_ui(r_value, 0, 1); } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval() && !o.isInterval()) { mpfr_sub(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_sub(fu_value, fu_value, o.internalLowerFloat(), MPFR_RNDU); mpfr_sub(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDD); } } else { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_sub_q(fl_value, fl_value, o.internalRational(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_sub_q(fu_value, fu_value, o.internalRational(), MPFR_RNDU); mpfr_sub_q(fl_value, fl_value, o.internalRational(), MPFR_RNDD); } } } if(!testFloatResult(true)) { set(nr_bak); return false; } } setPrecisionAndApproximateFrom(o); return true; } bool Number::subtract(long int i) { if(i == 0) return true; if(isInfinite(true)) return true; if(n_type == NUMBER_TYPE_FLOAT) { Number nr_bak(*this); mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_sub_si(fl_value, fl_value, i, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_sub_si(fu_value, fu_value, i, MPFR_RNDU); mpfr_sub_si(fl_value, fl_value, i, MPFR_RNDD); } if(!testFloatResult(true)) { set(nr_bak); return false; } } else { if(i < 0) mpz_addmul_ui(mpq_numref(r_value), mpq_denref(r_value), (unsigned int) (-i)); else mpz_submul_ui(mpq_numref(r_value), mpq_denref(r_value), (unsigned int) i); } return true; } bool Number::multiply(const Number &o) { if(o.hasImaginaryPart()) { if(o.hasRealPart()) { Number nr_copy; if(hasImaginaryPart()) { if(hasRealPart()) { Number nr_real; nr_real.set(*this, false, true); nr_copy.set(*i_value); if(!nr_real.multiply(o.realPart()) || !nr_copy.multiply(o.imaginaryPart()) || !nr_copy.negate() || !nr_real.add(nr_copy)) return false; Number nr_imag(*i_value); nr_copy.set(*this, false, true); if(!nr_copy.multiply(o.imaginaryPart()) || !nr_imag.multiply(o.realPart()) || !nr_imag.add(nr_copy)) return false; set(nr_real, true, true); i_value->set(nr_imag, true); setPrecisionAndApproximateFrom(*i_value); testComplex(this, i_value); return true; } nr_copy.set(*i_value); nr_copy.negate(); } else if(hasRealPart()) { nr_copy.setImaginaryPart(*this); } Number nr_bak(*this); if(!nr_copy.multiply(o.imaginaryPart())) return false; if(!multiply(o.realPart())) return false; if(!add(nr_copy)) { set(nr_bak); return false; } return true; } else if(hasImaginaryPart()) { Number nr_copy(*i_value); nr_copy.negate(); if(hasRealPart()) { nr_copy.setImaginaryPart(*this); } if(!nr_copy.multiply(o.imaginaryPart())) return false; set(nr_copy); return true; } if(!multiply(*o.internalImaginary())) return false; if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->set(*this, true, true); clearReal(); return true; } if(o.includesInfinity() && !isNonZero()) return false; if(includesInfinity() && !o.isNonZero()) return false; if(n_type == NUMBER_TYPE_MINUS_INFINITY || n_type == NUMBER_TYPE_PLUS_INFINITY) { if(hasImaginaryPart()) { if(!i_value->multiply(o)) return false; setPrecisionAndApproximateFrom(*i_value); } if(o.isNegative()) { if(n_type == NUMBER_TYPE_MINUS_INFINITY) { n_type = NUMBER_TYPE_PLUS_INFINITY; } else { n_type = NUMBER_TYPE_MINUS_INFINITY; } setPrecisionAndApproximateFrom(o); } return true; } if(o.isPlusInfinity()) { if(hasRealPart() && !realPartIsNonZero()) return false; if(hasImaginaryPart()) { if(!i_value->multiply(o)) return false; setPrecisionAndApproximateFrom(*i_value); } if(hasRealPart()) { if(isNegative()) setMinusInfinity(true, true); else setPlusInfinity(true, true); setPrecisionAndApproximateFrom(o); } return true; } if(o.isMinusInfinity()) { if(hasRealPart() && !realPartIsNonZero()) return false; if(hasImaginaryPart()) { if(!i_value->multiply(o)) return false; setPrecisionAndApproximateFrom(*i_value); } if(hasRealPart()) { if(isNegative()) setPlusInfinity(true, true); else setMinusInfinity(true, true); } setPrecisionAndApproximateFrom(o); return true; } if(isZero()) return true; if(o.isZero()) { clear(); setPrecisionAndApproximateFrom(o); return true; } if(o.isFloatingPoint() || n_type == NUMBER_TYPE_FLOAT) { Number nr_bak(*this); if(hasImaginaryPart()) { if(!i_value->multiply(o)) return false; setPrecisionAndApproximateFrom(*i_value); } if(hasRealPart()) { mpfr_clear_flags(); if(n_type != NUMBER_TYPE_FLOAT) { mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); n_type = NUMBER_TYPE_FLOAT; if(!CALCULATOR->usesIntervalArithmetic() && !o.isInterval()) { mpfr_mul_q(fl_value, o.internalLowerFloat(), r_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { if(mpq_sgn(r_value) < 0) { mpfr_mul_q(fu_value, o.internalLowerFloat(), r_value, MPFR_RNDU); mpfr_mul_q(fl_value, o.internalUpperFloat(), r_value, MPFR_RNDD); } else { mpfr_mul_q(fu_value, o.internalUpperFloat(), r_value, MPFR_RNDU); mpfr_mul_q(fl_value, o.internalLowerFloat(), r_value, MPFR_RNDD); } } mpq_set_ui(r_value, 0, 1); } else if(n_type == NUMBER_TYPE_FLOAT) { if(o.isFloatingPoint()) { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval() && !o.isInterval()) { mpfr_mul(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { int sgn_l = mpfr_sgn(fl_value), sgn_u = mpfr_sgn(fu_value), sgn_ol = mpfr_sgn(o.internalLowerFloat()), sgn_ou = mpfr_sgn(o.internalUpperFloat()); if((sgn_l < 0) != (sgn_u < 0)) { if((sgn_ol < 0) != (sgn_ou < 0)) { mpfr_t fu_value2, fl_value2; mpfr_init2(fu_value2, BIT_PRECISION); mpfr_init2(fl_value2, BIT_PRECISION); mpfr_mul(fu_value2, fl_value, o.internalLowerFloat(), MPFR_RNDU); mpfr_mul(fl_value2, fu_value, o.internalLowerFloat(), MPFR_RNDD); mpfr_mul(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDU); mpfr_mul(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDD); if(mpfr_cmp(fu_value, fu_value2) < 0) mpfr_set(fu_value, fu_value2, MPFR_RNDU); if(mpfr_cmp(fl_value, fl_value2) > 0) mpfr_set(fl_value, fl_value2, MPFR_RNDD); mpfr_clears(fu_value2, fl_value2, NULL); } else if(sgn_ol < 0) { mpfr_mul(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDU); mpfr_mul(fu_value, fu_value, o.internalLowerFloat(), MPFR_RNDD); mpfr_swap(fu_value, fl_value); } else { mpfr_mul(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDU); mpfr_mul(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDD); } } else if((sgn_ol < 0) != (sgn_ou < 0)) { if(sgn_l < 0) { mpfr_mul(fu_value, fl_value, o.internalLowerFloat(), MPFR_RNDU); mpfr_mul(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDD); } else { mpfr_mul(fl_value, fu_value, o.internalLowerFloat(), MPFR_RNDD); mpfr_mul(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDU); } } else if(sgn_l < 0) { if(sgn_ol < 0) { mpfr_mul(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDU); mpfr_mul(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDD); mpfr_swap(fl_value, fu_value); } else { mpfr_mul(fu_value, fu_value, o.internalLowerFloat(), MPFR_RNDU); mpfr_mul(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDD); } } else if(sgn_ol < 0) { mpfr_mul(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDU); mpfr_mul(fu_value, fu_value, o.internalLowerFloat(), MPFR_RNDD); mpfr_swap(fu_value, fl_value); } else { mpfr_mul(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDU); mpfr_mul(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDD); } } } else { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_mul_q(fl_value, fl_value, o.internalRational(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else if(mpq_sgn(o.internalRational()) < 0) { mpfr_mul_q(fu_value, fu_value, o.internalRational(), MPFR_RNDD); mpfr_mul_q(fl_value, fl_value, o.internalRational(), MPFR_RNDU); mpfr_swap(fu_value, fl_value); } else { mpfr_mul_q(fu_value, fu_value, o.internalRational(), MPFR_RNDU); mpfr_mul_q(fl_value, fl_value, o.internalRational(), MPFR_RNDD); } } } if(!testFloatResult(true)) { set(nr_bak); return false; } } } else { if(hasImaginaryPart()) { if(!i_value->multiply(o)) return false; setPrecisionAndApproximateFrom(*i_value); } mpq_mul(r_value, r_value, o.internalRational()); } setPrecisionAndApproximateFrom(o); return true; } bool Number::multiply(long int i) { if(i == 0 && includesInfinity()) return false; if(n_type == NUMBER_TYPE_MINUS_INFINITY || n_type == NUMBER_TYPE_PLUS_INFINITY) { if(hasImaginaryPart()) { if(!i_value->multiply(i)) return false; setPrecisionAndApproximateFrom(*i_value); } if(i < 0) { if(n_type == NUMBER_TYPE_MINUS_INFINITY) { n_type = NUMBER_TYPE_PLUS_INFINITY; } else { n_type = NUMBER_TYPE_MINUS_INFINITY; } } return true; } if(isZero()) return true; if(i == 0) { clear(); return true; } if(n_type == NUMBER_TYPE_FLOAT) { Number nr_bak(*this); if(hasImaginaryPart()) { if(!i_value->multiply(i)) return false; setPrecisionAndApproximateFrom(*i_value); } mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_mul_si(fl_value, fl_value, i, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_mul_si(fu_value, fu_value, i, MPFR_RNDU); mpfr_mul_si(fl_value, fl_value, i, MPFR_RNDD); if(i < 0) mpfr_swap(fu_value, fl_value); } if(!testFloatResult(true)) { set(nr_bak); return false; } } else { if(hasImaginaryPart()) { if(!i_value->multiply(i)) return false; setPrecisionAndApproximateFrom(*i_value); } mpq_t r_i; mpq_init(r_i); mpz_set_si(mpq_numref(r_i), i); mpq_mul(r_value, r_value, r_i); mpq_clear(r_i); } return true; } bool Number::divide(const Number &o) { if(isInfinite() || o.isInfinite() || o.hasImaginaryPart() || o.isFloatingPoint() || n_type == NUMBER_TYPE_FLOAT) { Number oinv(o); if(!oinv.recip()) return false; return multiply(oinv); } if(!o.isNonZero()) { if(isZero()) return false; return false; } if(isZero()) { setPrecisionAndApproximateFrom(o); return true; } if(hasImaginaryPart()) { if(!i_value->divide(o)) return false; setPrecisionAndApproximateFrom(*i_value); } mpq_div(r_value, r_value, o.internalRational()); setPrecisionAndApproximateFrom(o); return true; } bool Number::divide(long int i) { if(includesInfinity() && i == 0) return false; if(isInfinite(true)) { if(hasImaginaryPart()) { if(!i_value->divide(i)) return false; setPrecisionAndApproximateFrom(*i_value); } if(i < 0) { if(n_type == NUMBER_TYPE_PLUS_INFINITY) { n_type = NUMBER_TYPE_MINUS_INFINITY; } else if(n_type == NUMBER_TYPE_MINUS_INFINITY) { n_type = NUMBER_TYPE_PLUS_INFINITY; } } return true; } if(i == 0) return false; if(isZero()) return true; if(n_type == NUMBER_TYPE_FLOAT) { Number oinv(i < 0 ? -1 : 1, i < 0 ? -i : i, 0); return multiply(oinv); } if(hasImaginaryPart()) { if(!i_value->divide(i)) return false; setPrecisionAndApproximateFrom(*i_value); } mpq_t r_i; mpq_init(r_i); mpz_set_si(mpq_numref(r_i), i); mpq_div(r_value, r_value, r_i); mpq_clear(r_i); return true; } bool Number::recip() { if(!isNonZero()) { return false; } if(isInfinite(false)) { clear(); return true; } if(hasImaginaryPart()) { if(hasRealPart()) { if(isInterval(false)) { // 1/(x+yi) = (x-yi)/(x^2+y^2); max/min x/(x^2+y^2): x=abs(y), x=-abs(y) Number nr_bak(*this); if(!setToFloatingPoint()) return false; if(!i_value->setToFloatingPoint()) return false; mpfr_t abs_il, abs_iu, absm_iu, absm_il, abs_rl, abs_ru, absm_ru, absm_rl, ftmp1, ftmp2, fu_tmp, fl_tmp; mpfr_inits2(BIT_PRECISION, abs_il, abs_iu, absm_iu, absm_il, abs_rl, abs_ru, absm_ru, absm_rl, ftmp1, ftmp2, fu_tmp, fl_tmp, NULL); if(mpfr_sgn(fl_value) != mpfr_sgn(fu_value)) mpfr_set_zero(abs_rl, 0); else if(mpfr_cmpabs(fu_value, fl_value) < 0) mpfr_abs(abs_rl, fu_value, MPFR_RNDD); else mpfr_abs(abs_rl, fl_value, MPFR_RNDD); if(mpfr_cmpabs(fl_value, fu_value) > 0) mpfr_abs(abs_ru, fl_value, MPFR_RNDU); else mpfr_abs(abs_ru, fu_value, MPFR_RNDU); mpfr_neg(absm_ru, abs_ru, MPFR_RNDD); mpfr_neg(absm_rl, abs_rl, MPFR_RNDD); if(mpfr_sgn(i_value->internalLowerFloat()) != mpfr_sgn(i_value->internalUpperFloat())) mpfr_set_zero(abs_il, 0); else if(mpfr_cmpabs(i_value->internalUpperFloat(), i_value->internalLowerFloat()) < 0) mpfr_abs(abs_il, i_value->internalUpperFloat(), MPFR_RNDD); else mpfr_abs(abs_il, i_value->internalLowerFloat(), MPFR_RNDD); if(mpfr_cmpabs(i_value->internalLowerFloat(), i_value->internalUpperFloat()) > 0) mpfr_abs(abs_iu, i_value->internalLowerFloat(), MPFR_RNDU); else mpfr_abs(abs_iu, i_value->internalUpperFloat(), MPFR_RNDU); mpfr_neg(absm_iu, abs_iu, MPFR_RNDD); mpfr_neg(absm_il, abs_il, MPFR_RNDD); for(size_t i = 0; i < 2; i++) { if(i == 0) { mpfr_swap(fu_tmp, fu_value); mpfr_swap(fl_tmp, fl_value); } else { mpfr_swap(fu_tmp, i_value->internalUpperFloat()); mpfr_swap(fl_tmp, i_value->internalLowerFloat()); mpfr_swap(abs_il, abs_rl); mpfr_swap(abs_iu, abs_ru); mpfr_swap(absm_iu, absm_ru); mpfr_swap(absm_il, absm_rl); mpfr_neg(fu_tmp, fu_tmp, MPFR_RNDU); mpfr_neg(fl_tmp, fl_tmp, MPFR_RNDD); mpfr_swap(fl_tmp, fu_tmp); } bool neg = mpfr_sgn(fu_tmp) < 0; if(neg) { mpfr_neg(fu_tmp, fu_tmp, MPFR_RNDD); mpfr_neg(fl_tmp, fl_tmp, MPFR_RNDU); mpfr_swap(fl_tmp, fu_tmp); } if(mpfr_cmp(fl_tmp, abs_il) <= 0) { if(mpfr_cmp(fu_tmp, abs_il) >= 0) { mpfr_sqr(ftmp1, abs_il, MPFR_RNDD); mpfr_mul_ui(ftmp1, ftmp1, 2, MPFR_RNDD); mpfr_div(fu_tmp, abs_il, ftmp1, MPFR_RNDU); } else { mpfr_sqr(ftmp1, fu_tmp, MPFR_RNDD); mpfr_sqr(ftmp2, abs_il, MPFR_RNDD); mpfr_add(ftmp1, ftmp1, ftmp2, MPFR_RNDD); mpfr_div(fu_tmp, fu_tmp, ftmp1, MPFR_RNDU); } } else { mpfr_sqr(ftmp1, fl_tmp, MPFR_RNDD); mpfr_sqr(ftmp2, abs_il, MPFR_RNDD); mpfr_add(ftmp1, ftmp1, ftmp2, MPFR_RNDD); mpfr_div(fu_tmp, fl_tmp, ftmp1, MPFR_RNDU); } if(mpfr_sgn(fl_tmp) < 0) { if(mpfr_cmp(fl_tmp, absm_il) <= 0) { mpfr_sqr(ftmp1, abs_il, MPFR_RNDU); mpfr_mul_ui(ftmp1, ftmp1, 2, MPFR_RNDU); mpfr_div(fl_tmp, absm_il, ftmp1, MPFR_RNDD); } else { mpfr_sqr(ftmp1, fl_tmp, MPFR_RNDD); mpfr_sqr(ftmp2, abs_il, MPFR_RNDD); mpfr_add(ftmp1, ftmp1, ftmp2, MPFR_RNDD); mpfr_div(fl_tmp, fl_tmp, ftmp1, MPFR_RNDU); } } else if(mpfr_cmp(fl_tmp, absm_iu) <= 0) { if(mpfr_cmp(abs_ru, absm_iu) >= 0) { mpfr_sqr(ftmp1, abs_iu, MPFR_RNDU); mpfr_mul_ui(ftmp1, ftmp1, 2, MPFR_RNDU); mpfr_div(fl_tmp, absm_iu, ftmp1, MPFR_RNDD); } else { mpfr_sqr(ftmp1, abs_ru, MPFR_RNDU); mpfr_sqr(ftmp2, abs_iu, MPFR_RNDU); mpfr_add(ftmp1, ftmp1, ftmp2, MPFR_RNDU); mpfr_div(fl_tmp, abs_ru, ftmp1, MPFR_RNDD); } } else { if(mpfr_cmp(fl_tmp, abs_iu) > 0) { mpfr_sqr(ftmp1, abs_ru, MPFR_RNDU); mpfr_sqr(ftmp2, abs_iu, MPFR_RNDU); mpfr_add(ftmp1, ftmp1, ftmp2, MPFR_RNDU); mpfr_div(fl_tmp, abs_ru, ftmp1, MPFR_RNDD); } else { mpfr_sqr(ftmp1, abs_rl, MPFR_RNDU); mpfr_sqr(ftmp2, abs_iu, MPFR_RNDU); mpfr_add(ftmp1, ftmp1, ftmp2, MPFR_RNDU); mpfr_div(fl_tmp, fl_tmp, ftmp1, MPFR_RNDD); if(mpfr_cmp(abs_ru, abs_iu) > 0) { mpfr_sqr(ftmp1, abs_ru, MPFR_RNDU); mpfr_sqr(ftmp2, abs_iu, MPFR_RNDU); mpfr_add(ftmp1, ftmp1, ftmp2, MPFR_RNDU); mpfr_div(ftmp1, abs_ru, ftmp1, MPFR_RNDD); if(mpfr_cmp(ftmp1, fl_tmp) < 0) { mpfr_swap(ftmp1, fl_tmp); } } } } if(neg) { mpfr_neg(fu_tmp, fu_tmp, MPFR_RNDD); mpfr_neg(fl_tmp, fl_tmp, MPFR_RNDU); mpfr_swap(fl_tmp, fu_tmp); } if(i == 0) { mpfr_swap(fu_tmp, fu_value); mpfr_swap(fl_tmp, fl_value); } else { mpfr_swap(fu_tmp, i_value->internalUpperFloat()); mpfr_swap(fl_tmp, i_value->internalLowerFloat()); } } mpfr_clears(abs_il, abs_iu, absm_iu, absm_il, abs_rl, abs_ru, absm_ru, absm_rl, ftmp1, ftmp2, fu_tmp, fl_tmp, NULL); if(!testFloatResult(true) || !i_value->testFloatResult(true)) { set(nr_bak); return false; } return true; } else { Number den1(*i_value); Number den2; den2.set(*this, false, true); Number num_r(den2), num_i(den1); if(!den1.square() || !num_i.negate() || !den2.square() || !den1.add(den2) || !num_r.divide(den1) || !num_i.divide(den1)) return false; set(num_r); setImaginaryPart(num_i); } return true; } if(!i_value->recip() || !i_value->negate()) return false; setPrecisionAndApproximateFrom(*i_value); return true; } if(n_type == NUMBER_TYPE_FLOAT) { Number nr_bak(*this); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_ui_div(fl_value, 1, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_ui_div(fu_value, 1, fu_value, MPFR_RNDD); mpfr_ui_div(fl_value, 1, fl_value, MPFR_RNDU); mpfr_swap(fu_value, fl_value); } if(!testFloatResult(true)) { set(nr_bak); return false; } } else { mpq_inv(r_value, r_value); } return true; } bool Number::raise(const Number &o, bool try_exact) { if(o.isTwo()) return square(); if(o.isMinusOne()) { if(!recip()) return false; setPrecisionAndApproximateFrom(o); return true; } if((includesInfinity(true) || o.includesInfinity(true)) && !hasImaginaryPart() && !o.hasImaginaryPart()) { if(isInfinite(false)) { if(o.isNegative()) { clear(true); return true; } if(!o.isNonZero() || o.hasImaginaryPart()) { return false; } if(isMinusInfinity()) { if(o.isEven()) { n_type = NUMBER_TYPE_PLUS_INFINITY; } else if(!o.isInteger()) { return false; } } setPrecisionAndApproximateFrom(o); return true; } if(includesInfinity()) { if(hasImaginaryPart() || !o.isNonZero() || o.hasImaginaryPart()) { return false; } } if(o.includesMinusInfinity()) { if(o.isFloatingPoint() && o.includesPlusInfinity()) return false; if(!isNonZero()) { return false; } else if(isNegative()) { if(!isLessThan(-1)) return false; if(!o.isFloatingPoint()) clear(true); } else if(hasImaginaryPart()) { if(hasRealPart()) return false; if(!o.isFloatingPoint() && !i_value->raise(o)) return false; } else if(isGreaterThan(1)) { if(!o.isFloatingPoint()) clear(true); } else if(isPositive() && isLessThan(1)) { setPlusInfinity(); } else { return false; } if(!o.isFloatingPoint()) { setPrecisionAndApproximateFrom(o); return true; } } else if(o.includesPlusInfinity()) { if(!isNonZero()) { return false; } else if(isNegative()) { if(!isGreaterThan(-1)) return false; if(!o.isFloatingPoint()) clear(true); } else if(hasImaginaryPart()) { if(hasRealPart()) return false; if(!o.isFloatingPoint() && !i_value->raise(o)) return false; } else if(isGreaterThan(1)) { setPlusInfinity(); } else if(isPositive() && isLessThan(1)) { if(!o.isFloatingPoint()) clear(true); } else { return false; } if(!o.isFloatingPoint()) { setPrecisionAndApproximateFrom(o); return true; } } } if(isZero() && o.isNegative()) { CALCULATOR->error(true, _("Division by zero."), NULL); return false; } if(isZero()) { if(o.isZero()) { //0^0 CALCULATOR->error(false, _("0^0 might be considered undefined"), NULL); set(1, 1, 0, true); setPrecisionAndApproximateFrom(o); return true; } else if(!o.realPartIsNonNegative()) { return false; } else if(o.hasImaginaryPart()) { CALCULATOR->error(false, _("The result of 0^i is possibly undefined"), NULL); } return true; } if(o.isZero()) { if(hasImaginaryPart() && i_value->includesInfinity()) return false; set(1, 1, 0, false); setPrecisionAndApproximateFrom(o); return true; } if(o.isOne()) { setPrecisionAndApproximateFrom(o); return true; } if(isOne() && !o.includesInfinity()) { return true; } if(o.hasImaginaryPart()) { if(b_imag) return false; Number nr_a, nr_b, nr_c, nr_d; if(hasImaginaryPart()) { if(hasRealPart()) nr_a = realPart(); nr_b = imaginaryPart(); } else { nr_a.set(*this); } if(o.hasRealPart()) nr_c = o.realPart(); nr_d = o.imaginaryPart(); Number a2b2c2(1, 1); Number a2b2(nr_a); Number b2(nr_b); if(!a2b2.square() || !b2.square() || !a2b2.add(b2)) return false; if(!nr_c.isZero()) { Number chalf(nr_c); a2b2c2 = a2b2; if(!chalf.multiply(nr_half) || !a2b2c2.raise(chalf)) return false; } Number nr_arg(nr_b); if(!nr_arg.atan2(nr_a, true)) return false; Number eraised, nexp(nr_d); eraised.e(); if(!nexp.negate() || !nexp.multiply(nr_arg) || !eraised.raise(nexp, false)) return false; if(!nr_arg.multiply(nr_c) || !nr_d.multiply(nr_half) || !a2b2.ln() || !nr_d.multiply(a2b2) || !nr_arg.add(nr_d)) return false; Number nr_cos(nr_arg); Number nr_sin(nr_arg); if(!nr_cos.cos() || !nr_sin.sin() || !nr_sin.multiply(nr_one_i) || !nr_cos.add(nr_sin)) return false; if(!eraised.multiply(a2b2c2) || !eraised.multiply(nr_cos)) return false; if((hasImaginaryPart() || o.hasRealPart()) && eraised.isInterval(false) && eraised.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("Interval calculated wide."), NULL); set(eraised); setPrecisionAndApproximateFrom(o); return true; } if(hasImaginaryPart()) { if(o.isNegative()) { if(o.isMinusOne()) return recip(); Number ninv(*this), opos(o); if(!ninv.recip() ||!opos.negate() || !ninv.raise(opos, try_exact)) return false; set(ninv); return true; }// else if(!o.isNonNegative()) return false; if(hasRealPart() || !o.isInteger()) { if(try_exact && !isFloatingPoint() && !i_value->isFloatingPoint() && o.isInteger() && o.isPositive() && o.isLessThan(100)) { int i = o.intValue(); Number nr_init(*this); while(i > 1) { if(CALCULATOR->aborted()) return false; if(!multiply(nr_init)) { set(nr_init); return false; } i--; } setPrecisionAndApproximateFrom(o); return true; } Number nbase, nexp(*this); nbase.e(); if(!nexp.ln() || !nexp.multiply(o) || !nbase.raise(nexp, false)) return false; set(nbase); return true; } if(!i_value->raise(o, try_exact)) return false; Number ibneg(o); if(!ibneg.iquo(2)) return false; if(!ibneg.isEven() && !i_value->negate()) return false; if(o.isEven()) { set(*i_value, true, true); clearImaginary(); } else { setPrecisionAndApproximateFrom(*i_value); } setPrecisionAndApproximateFrom(o); return true; } if(isMinusOne() && o.isRational()) { if(o.isInteger()) { if(o.isEven()) set(1, 1, 0, true); setPrecisionAndApproximateFrom(o); return true; } else if(o.denominatorIsTwo()) { if(b_imag) return false; clear(true); if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} if(o.numeratorIsOne()) { i_value->set(1, 1, 0); } else { mpz_t zrem; mpz_init(zrem); mpz_tdiv_r_ui(zrem, mpq_numref(o.internalRational()), 4); if(mpz_cmp_ui(zrem, 1) == 0 || mpz_cmp_si(zrem, -3) == 0) { i_value->set(1, 1, 0); } else { i_value->set(-1, 1, 0); } } setPrecisionAndApproximateFrom(o); return true; } } if(n_type == NUMBER_TYPE_RATIONAL && !o.isFloatingPoint()) { bool success = false; if(mpz_fits_slong_p(mpq_numref(o.internalRational())) != 0 && mpz_fits_ulong_p(mpq_denref(o.internalRational())) != 0) { long int i_pow = mpz_get_si(mpq_numref(o.internalRational())); unsigned long int i_root = mpz_get_ui(mpq_denref(o.internalRational())); size_t length1 = mpz_sizeinbase(mpq_numref(r_value), 10); size_t length2 = mpz_sizeinbase(mpq_denref(r_value), 10); if(length2 > length1) length1 = length2; if((i_root <= 2 || mpq_sgn(r_value) > 0) && ((!try_exact && i_root <= 3 && (long long int) labs(i_pow) * length1 < 1000) || (try_exact && (long long int) labs(i_pow) * length1 < 1000000LL && i_root < 1000000L))) { bool complex_result = false; if(i_root != 1) { mpq_t r_test; mpq_init(r_test); bool b_neg = i_pow < 0; if(b_neg) { mpq_inv(r_test, r_value); i_pow = -i_pow; } else { mpq_set(r_test, r_value); } if(mpz_cmp_ui(mpq_denref(r_test), 1) == 0) { if(i_pow != 1) mpz_pow_ui(mpq_numref(r_test), mpq_numref(r_test), (unsigned long int) i_pow); if(i_root % 2 == 0 && mpq_sgn(r_test) < 0) { if(b_imag) {mpq_clear(r_test); return false;} if(i_root == 2) { mpq_neg(r_test, r_test); success = mpz_root(mpq_numref(r_test), mpq_numref(r_test), i_root); complex_result = true; } } else { success = mpz_root(mpq_numref(r_test), mpq_numref(r_test), i_root); } } else { if(i_pow != 1) { mpz_pow_ui(mpq_numref(r_test), mpq_numref(r_test), (unsigned long int) i_pow); mpz_pow_ui(mpq_denref(r_test), mpq_denref(r_test), (unsigned long int) i_pow); } if(i_root % 2 == 0 && mpq_sgn(r_test) < 0) { if(b_imag) {mpq_clear(r_test); return false;} if(i_root == 2) { mpq_neg(r_test, r_test); success = mpz_root(mpq_numref(r_test), mpq_numref(r_test), i_root) && mpz_root(mpq_denref(r_test), mpq_denref(r_test), i_root); complex_result = true; } } else { success = mpz_root(mpq_numref(r_test), mpq_numref(r_test), i_root) && mpz_root(mpq_denref(r_test), mpq_denref(r_test), i_root); } } if(success) { if(complex_result) { if(b_neg) mpq_neg(r_test, r_test); if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->setInternal(r_test, false, true); if(i_pow % 4 == 3) i_value->negate(); mpq_set_ui(r_value, 0, 1); } else { mpq_set(r_value, r_test); } } mpq_clear(r_test); } else if(i_pow != 1) { if(i_pow < 0) { mpq_inv(r_value, r_value); i_pow = -i_pow; } if(i_pow != 1) { mpz_pow_ui(mpq_numref(r_value), mpq_numref(r_value), (unsigned long int) i_pow); if(mpz_cmp_ui(mpq_denref(r_value), 1) != 0) mpz_pow_ui(mpq_denref(r_value), mpq_denref(r_value), (unsigned long int) i_pow); } success = true; } else { success = true; } } } if(success) { setPrecisionAndApproximateFrom(o); return true; } } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); int sgn_l = mpfr_sgn(fl_value), sgn_u = mpfr_sgn(fu_value); bool try_complex = false; if(o.isFloatingPoint()) { int sgn_ol = mpfr_sgn(o.internalLowerFloat()), sgn_ou = mpfr_sgn(o.internalUpperFloat()); if(sgn_ol < 0 && (sgn_l == 0 || sgn_l != sgn_u)) { //CALCULATOR->error(true, _("Division by zero."), NULL); set(nr_bak); return false; } if(sgn_l < 0) { try_complex = true; } else { if(!isInterval() && !o.isInterval()) { if(!CALCULATOR->usesIntervalArithmetic()) { mpfr_pow(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_pow(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDD); mpfr_pow(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDU); } } else { mpfr_t f_value1, f_value2, f_value3, f_value4; mpfr_inits2(BIT_PRECISION, f_value1, f_value2, f_value3, f_value4, NULL); mpfr_pow(f_value1, fu_value, o.internalUpperFloat(), MPFR_RNDN); mpfr_pow(f_value2, fl_value, o.internalLowerFloat(), MPFR_RNDN); mpfr_pow(f_value3, fu_value, o.internalLowerFloat(), MPFR_RNDN); mpfr_pow(f_value4, fl_value, o.internalUpperFloat(), MPFR_RNDN); int i_upper = 1, i_lower = 1; if(mpfr_cmp(f_value2, f_value1) > 0) { if(mpfr_cmp(f_value3, f_value2) > 0) { if(mpfr_cmp(f_value4, f_value3) > 0) i_upper = 4; else i_upper = 3; } else if(mpfr_cmp(f_value4, f_value2) > 0) i_upper = 4; else i_upper = 2; } else if(mpfr_cmp(f_value3, f_value1) > 0) { if(mpfr_cmp(f_value4, f_value3) > 0) i_upper = 4; else i_upper = 3; } else if(mpfr_cmp(f_value4, f_value1) > 0) i_upper = 4; if(mpfr_cmp(f_value2, f_value1) < 0) { if(mpfr_cmp(f_value3, f_value2) < 0) { if(mpfr_cmp(f_value4, f_value3) < 0) i_lower = 4; else i_lower = 3; } else if(mpfr_cmp(f_value4, f_value2) < 0) i_lower = 4; else i_lower = 2; } else if(mpfr_cmp(f_value3, f_value1) < 0) { if(mpfr_cmp(f_value4, f_value3) < 0) i_lower = 4; else i_lower = 3; } else if(mpfr_cmp(f_value4, f_value1) < 0) i_lower = 4; switch(i_upper) { case 1: {mpfr_pow(f_value1, fu_value, o.internalUpperFloat(), MPFR_RNDU); break;} case 2: {mpfr_pow(f_value1, fl_value, o.internalLowerFloat(), MPFR_RNDU); break;} case 3: {mpfr_pow(f_value1, fu_value, o.internalLowerFloat(), MPFR_RNDU); break;} case 4: {mpfr_pow(f_value1, fl_value, o.internalUpperFloat(), MPFR_RNDU); break;} } switch(i_lower) { case 1: {mpfr_pow(fl_value, fu_value, o.internalUpperFloat(), MPFR_RNDD); break;} case 2: {mpfr_pow(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDD); break;} case 3: {mpfr_pow(fl_value, fu_value, o.internalLowerFloat(), MPFR_RNDD); break;} case 4: {mpfr_pow(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDD); break;} } mpfr_set(fu_value, f_value1, MPFR_RNDU); if(sgn_ou != sgn_ol) { if(mpfr_cmp_ui(fl_value, 1) > 0) mpfr_set_ui(fl_value, 1, MPFR_RNDD); else if(mpfr_cmp_ui(fu_value, 1) < 0) mpfr_set_ui(fu_value, 1, MPFR_RNDU); } mpfr_clears(f_value1, f_value2, f_value3, f_value4, NULL); } } } else { if(!o.isNonNegative() && (sgn_l == 0 || sgn_l != sgn_u)) { //CALCULATOR->error(true, _("Division by zero."), NULL); set(nr_bak); return false; } if(o.isInteger() && o.integerLength() < 1000000L) { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_pow_z(fl_value, fl_value, mpq_numref(o.internalRational()), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else if(o.isEven() && sgn_l < 0 && sgn_u >= 0) { if(mpfr_cmpabs(fu_value, fl_value) < 0) { mpfr_pow_z(fu_value, fl_value, mpq_numref(o.internalRational()), MPFR_RNDU); } else { mpfr_pow_z(fu_value, fu_value, mpq_numref(o.internalRational()), MPFR_RNDU); } mpfr_set_ui(fl_value, 0, MPFR_RNDD); } else { bool b_reverse = o.isEven() && sgn_l < 0; if(o.isNegative()) { if(b_reverse) { b_reverse = false; } else { b_reverse = true; } } if(b_reverse) { mpfr_pow_z(fu_value, fu_value, mpq_numref(o.internalRational()), MPFR_RNDD); mpfr_pow_z(fl_value, fl_value, mpq_numref(o.internalRational()), MPFR_RNDU); mpfr_swap(fu_value, fl_value); } else { mpfr_pow_z(fu_value, fu_value, mpq_numref(o.internalRational()), MPFR_RNDU); mpfr_pow_z(fl_value, fl_value, mpq_numref(o.internalRational()), MPFR_RNDD); } } } else { if(sgn_l < 0) { if(sgn_u < 0 && mpz_cmp_ui(mpq_denref(o.internalRational()), 2) == 0) { if(b_imag) {set(nr_bak); return false;} if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->set(*this, false, true); if(!i_value->negate() || !i_value->raise(o)) { set(nr_bak); return false; } if(!o.numeratorIsOne()) { mpz_t zrem; mpz_init(zrem); mpz_tdiv_r_ui(zrem, mpq_numref(o.internalRational()), 4); if(mpz_cmp_ui(zrem, 1) != 0 && mpz_cmp_si(zrem, -3) != 0) i_value->negate(); } clearReal(); setPrecisionAndApproximateFrom(*i_value); return true; } else { try_complex = true; } } else { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_t f_pow; mpfr_init2(f_pow, BIT_PRECISION); mpfr_set_q(f_pow, o.internalRational(), MPFR_RNDN); mpfr_pow(fl_value, fl_value, f_pow, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); mpfr_clears(f_pow, NULL); } else { mpfr_t f_pow_u, f_pow_l; mpfr_init2(f_pow_u, BIT_PRECISION); mpfr_init2(f_pow_l, BIT_PRECISION); mpfr_set_q(f_pow_u, o.internalRational(), MPFR_RNDU); mpfr_set_q(f_pow_l, o.internalRational(), MPFR_RNDD); if(o.isNegative()) { mpfr_pow(fu_value, fu_value, f_pow_u, MPFR_RNDD); mpfr_pow(fl_value, fl_value, f_pow_l, MPFR_RNDU); mpfr_swap(fu_value, fl_value); } else { mpfr_pow(fu_value, fu_value, f_pow_u, MPFR_RNDU); mpfr_pow(fl_value, fl_value, f_pow_l, MPFR_RNDD); } mpfr_clears(f_pow_u, f_pow_l, NULL); } } } } if(try_complex) { set(nr_bak); if(sgn_l < 0 && sgn_u >= 0) { Number nr_neg(lowerEndPoint()); if(!nr_neg.raise(o) || (b_imag && nr_neg.hasImaginaryPart())) return false; Number nr_pos(upperEndPoint()); if(!nr_pos.raise(o)) return false; if(!nr_neg.setInterval(nr_zero, nr_neg) || !nr_pos.setInterval(nr_zero, nr_pos)) return false; if(!setInterval(nr_neg, nr_pos)) return false; } else { Number nbase, nexp(*this); nbase.e(); if(!nexp.ln()) return false; if(!nexp.multiply(o)) return false; if(!nbase.raise(nexp, false)) return false; if(b_imag && nbase.hasImaginaryPart()) return false; set(nbase); } return true; } if(!testFloatResult(true)) { set(nr_bak); return false; } setPrecisionAndApproximateFrom(o); return true; } bool Number::sqrt() { if(hasImaginaryPart()) return raise(Number(1, 2, 0), true); if(isNegative()) { if(b_imag) return false; if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->set(*this, false, true); if(!i_value->negate() || !i_value->sqrt()) { i_value->clear(); return false; } clearReal(); setPrecisionAndApproximateFrom(*i_value); return true; } if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_perfect_square_p(mpq_numref(r_value)) && mpz_perfect_square_p(mpq_denref(r_value))) { mpz_sqrt(mpq_numref(r_value), mpq_numref(r_value)); mpz_sqrt(mpq_denref(r_value), mpq_denref(r_value)); return true; } } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_sqrt(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { if(mpfr_sgn(fl_value) < 0) { if(b_imag) { set(nr_bak); return false; } else { if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} if(mpfr_sgn(fu_value) > 0) { i_value->setInterval(lowerEndPoint(), nr_zero); } else { i_value->set(*this, false, true); } if(!i_value->abs() || !i_value->sqrt()) {set(nr_bak); return false;} } mpfr_sqrt(fu_value, fu_value, MPFR_RNDU); mpfr_set_zero(fl_value, 0); } else { mpfr_sqrt(fu_value, fu_value, MPFR_RNDU); mpfr_sqrt(fl_value, fl_value, MPFR_RNDD); } } if(!testFloatResult(true)) { set(nr_bak); return false; } return true; } bool Number::cbrt() { if(hasImaginaryPart()) return raise(Number(1, 3, 0), true); if(isOne() || isMinusOne() || isZero()) return true; Number nr_bak(*this); if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_root(mpq_numref(r_value), mpq_numref(r_value), 3) && mpz_root(mpq_denref(r_value), mpq_denref(r_value), 3)) { return true; } set(nr_bak); } if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_cbrt(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_cbrt(fu_value, fu_value, MPFR_RNDU); mpfr_cbrt(fl_value, fl_value, MPFR_RNDD); } if(!testFloatResult(true)) { set(nr_bak); return false; } return true; } bool Number::root(const Number &o) { if(!o.isInteger() || !o.isPositive() || hasImaginaryPart() || (o.isEven() && !isNonNegative())) return false; if(isOne() || o.isOne() || isZero() || isPlusInfinity()) return true; if(o.isTwo()) return sqrt(); /*if(o.isEven() && (!isReal() || isNegative())) { Number o_odd_factor(o); Number o_even_factor(1, 1, 0); while(o_odd_factor.isEven() && !o_odd_factor.isTwo()) { if(!o_odd_factor.multiply(nr_half) || !o_even_factor.multiply(2)) return false; if(CALCULATOR->aborted()) return false; } if(!o_even_factor.recip()) return false; Number nr_bak(*this); if(!root(o_odd_factor)) return false; if(!raise(o_even_factor)) {set(nr_bak); return false;} return true; } if(!isReal()) { if(!hasRealPart()) { Number nr_o(o); if(!nr_o.irem(4) || !i_value->root(o)) return false; if(!nr_o.isOne()) i_value->negate(); return true; } return false; }*/ if(isMinusOne()) return true; Number nr_bak(*this); if(!mpz_fits_ulong_p(mpq_numref(o.internalRational()))) { if(!setToFloatingPoint()) return false; Number o_inv(o); o_inv.recip(); mpfr_t f_pow_u, f_pow_l; mpfr_init2(f_pow_u, BIT_PRECISION); mpfr_init2(f_pow_l, BIT_PRECISION); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_set_q(f_pow_l, o.internalRational(), MPFR_RNDN); int sgn_l = mpfr_sgn(fl_value); if(sgn_l < 0) mpfr_neg(fl_value, fl_value, MPFR_RNDN); mpfr_pow(fl_value, fl_value, f_pow_l, MPFR_RNDN); if(sgn_l < 0) mpfr_neg(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_set_q(f_pow_u, o.internalRational(), MPFR_RNDU); mpfr_set_q(f_pow_l, o.internalRational(), MPFR_RNDD); int sgn_l = mpfr_sgn(fl_value), sgn_u = mpfr_sgn(fu_value); if(sgn_u < 0) mpfr_neg(fu_value, fu_value, MPFR_RNDD); if(sgn_l < 0) mpfr_neg(fl_value, fl_value, MPFR_RNDU); mpfr_pow(fu_value, fu_value, f_pow_u, MPFR_RNDU); mpfr_pow(fl_value, fl_value, f_pow_l, MPFR_RNDD); if(sgn_u < 0) mpfr_neg(fu_value, fu_value, MPFR_RNDU); if(sgn_l < 0) mpfr_neg(fl_value, fl_value, MPFR_RNDD); } mpfr_clears(f_pow_u, f_pow_l, NULL); } else { unsigned long int i_root = mpz_get_ui(mpq_numref(o.internalRational())); if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_root(mpq_numref(r_value), mpq_numref(r_value), i_root) && mpz_root(mpq_denref(r_value), mpq_denref(r_value), i_root)) { return true; } set(nr_bak); if(!setToFloatingPoint()) return false; } mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { #if MPFR_VERSION_MAJOR < 4 mpfr_root(fl_value, fl_value, i_root, MPFR_RNDN); #else mpfr_rootn_ui(fl_value, fl_value, i_root, MPFR_RNDN); #endif mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { #if MPFR_VERSION_MAJOR < 4 mpfr_root(fu_value, fu_value, i_root, MPFR_RNDU); mpfr_root(fl_value, fl_value, i_root, MPFR_RNDD); #else mpfr_rootn_ui(fu_value, fu_value, i_root, MPFR_RNDU); mpfr_rootn_ui(fl_value, fl_value, i_root, MPFR_RNDD); #endif } } if(!testFloatResult(true)) { set(nr_bak); return false; } return true; } bool Number::allroots(const Number &o, vector &roots) { if(!o.isInteger() || !o.isPositive()) return false; if(isOne() || o.isOne() || isZero()) { roots.push_back(*this); return true; } if(o.isTwo()) { Number nr(*this); if(!nr.sqrt()) return false; roots.push_back(nr); if(!nr.negate()) return false; roots.push_back(nr); return true; } if(isInfinite()) return false; Number o_inv(o); if(!o_inv.recip()) return false; Number nr_arg; nr_arg.set(*this, false, true); if(!nr_arg.atan2(*i_value)) return false; Number nr_pi2; nr_pi2.pi(); nr_pi2 *= 2; Number nr_i; Number nr_re; nr_re.set(*this, false, true); Number nr_im(*i_value); if(!nr_re.square() || !nr_im.square() || !nr_re.add(nr_im) || !nr_re.sqrt() || !nr_re.raise(o_inv)) return false; while(nr_i.isLessThan(o)) { if(CALCULATOR->aborted()) return false; Number nr(nr_pi2); if(!nr.multiply(nr_i) || !nr.add(nr_arg) || !nr.multiply(nr_one_i) || !nr.multiply(o_inv) || !nr.exp() || !nr.multiply(nr_re)) return false; roots.push_back(nr); nr_i++; } return true; } bool Number::exp10(const Number &o) { if(isZero()) return true; if(o.isZero()) { setPrecisionAndApproximateFrom(o); return true; } Number ten(10, 1); if(!ten.raise(o)) { return false; } multiply(ten); return true; } bool Number::exp10() { if(isZero()) { set(1, 1); return true; } Number ten(10, 1); if(!ten.raise(*this)) { return false; } set(ten); return true; } bool Number::exp2(const Number &o) { if(isZero()) return true; if(o.isZero()) { setPrecisionAndApproximateFrom(o); return true; } Number two(2, 1); if(!two.raise(o)) { return false; } multiply(two); return true; } bool Number::exp2() { if(isZero()) { set(1, 1); return true; } Number two(2, 1); if(!two.raise(*this)) { return false; } set(two); return true; } bool Number::square() { if(isInfinite()) { n_type = NUMBER_TYPE_PLUS_INFINITY; return true; } if(hasImaginaryPart()) { if(n_type == NUMBER_TYPE_FLOAT && (CALCULATOR->usesIntervalArithmetic() || isInterval())) { Number nr_bak(*this); if(!i_value->setToFloatingPoint()) return false; mpfr_t f_ru, f_rl, f_iu, f_il, f_tmp; mpfr_inits2(BIT_PRECISION, f_ru, f_rl, f_iu, f_il, f_tmp, NULL); if(mpfr_sgn(fl_value) < 0 && mpfr_sgn(fu_value) > 0) { mpfr_set_zero(f_rl, 0); if(mpfr_cmpabs(fl_value, fu_value) > 0) { mpfr_sqr(f_ru, fl_value, MPFR_RNDU); } else { mpfr_sqr(f_ru, fu_value, MPFR_RNDU); } } else { if(mpfr_cmpabs(fl_value, fu_value) > 0) { mpfr_sqr(f_ru, fl_value, MPFR_RNDU); mpfr_sqr(f_rl, fu_value, MPFR_RNDD); } else { mpfr_sqr(f_rl, fl_value, MPFR_RNDD); mpfr_sqr(f_ru, fu_value, MPFR_RNDU); } } if(mpfr_sgn(i_value->internalLowerFloat()) < 0 && mpfr_sgn(i_value->internalUpperFloat()) > 0) { if(mpfr_cmpabs(i_value->internalLowerFloat(), i_value->internalUpperFloat()) > 0) { mpfr_sqr(f_tmp, i_value->internalLowerFloat(), MPFR_RNDU); mpfr_sub(f_rl, f_rl, f_tmp, MPFR_RNDD); } else { mpfr_sqr(f_tmp, i_value->internalLowerFloat(), MPFR_RNDU); mpfr_sub(f_rl, f_rl, f_tmp, MPFR_RNDD); } } else if(mpfr_cmpabs(i_value->internalLowerFloat(), i_value->internalUpperFloat()) > 0) { mpfr_sqr(f_tmp, i_value->internalLowerFloat(), MPFR_RNDU); mpfr_sub(f_rl, f_rl, f_tmp, MPFR_RNDD); mpfr_sqr(f_tmp, i_value->internalUpperFloat(), MPFR_RNDD); mpfr_sub(f_ru, f_ru, f_tmp, MPFR_RNDU); } else { mpfr_sqr(f_tmp, i_value->internalUpperFloat(), MPFR_RNDU); mpfr_sub(f_rl, f_rl, f_tmp, MPFR_RNDD); mpfr_sqr(f_tmp, i_value->internalLowerFloat(), MPFR_RNDD); mpfr_sub(f_ru, f_ru, f_tmp, MPFR_RNDU); } bool neg_rl = mpfr_sgn(fl_value) < 0, neg_ru = mpfr_sgn(fu_value) < 0, neg_il = mpfr_sgn(i_value->internalLowerFloat()) < 0, neg_iu = mpfr_sgn(i_value->internalUpperFloat()) < 0; if(neg_rl && !neg_ru && !neg_il) { mpfr_mul(f_il, fl_value, i_value->internalUpperFloat(), MPFR_RNDD); mpfr_mul(f_iu, fu_value, i_value->internalUpperFloat(), MPFR_RNDU); } else if(!neg_rl && neg_il && !neg_iu) { mpfr_mul(f_il, fu_value, i_value->internalLowerFloat(), MPFR_RNDD); mpfr_mul(f_iu, fu_value, i_value->internalUpperFloat(), MPFR_RNDU); } else if(neg_rl && neg_ru && !neg_il) { mpfr_mul(f_il, fl_value, i_value->internalUpperFloat(), MPFR_RNDD); mpfr_mul(f_iu, fu_value, i_value->internalLowerFloat(), MPFR_RNDU); } else if(!neg_rl && neg_il && neg_iu) { mpfr_mul(f_il, fu_value, i_value->internalLowerFloat(), MPFR_RNDD); mpfr_mul(f_iu, fl_value, i_value->internalUpperFloat(), MPFR_RNDU); } else if(neg_rl && neg_ru && neg_il && !neg_iu) { mpfr_mul(f_il, fl_value, i_value->internalUpperFloat(), MPFR_RNDD); mpfr_mul(f_iu, fl_value, i_value->internalLowerFloat(), MPFR_RNDU); } else if(neg_il && neg_iu && neg_rl && !neg_ru) { mpfr_mul(f_il, fu_value, i_value->internalLowerFloat(), MPFR_RNDD); mpfr_mul(f_iu, fl_value, i_value->internalLowerFloat(), MPFR_RNDU); } else if(neg_rl && !neg_ru && neg_il && !neg_iu) { mpfr_mul(f_il, fu_value, i_value->internalLowerFloat(), MPFR_RNDD); mpfr_mul(f_tmp, fl_value, i_value->internalUpperFloat(), MPFR_RNDD); if(mpfr_cmp(f_tmp, f_il) < 0) mpfr_swap(f_il, f_tmp); mpfr_mul(f_iu, fu_value, i_value->internalUpperFloat(), MPFR_RNDU); mpfr_mul(f_tmp, fl_value, i_value->internalLowerFloat(), MPFR_RNDU); if(mpfr_cmp(f_tmp, f_iu) > 0) mpfr_swap(f_iu, f_tmp); } else if(neg_rl && neg_ru && neg_il && neg_iu) { mpfr_mul(f_iu, fl_value, i_value->internalLowerFloat(), MPFR_RNDU); mpfr_mul(f_il, fu_value, i_value->internalUpperFloat(), MPFR_RNDD); } else { mpfr_mul(f_il, fl_value, i_value->internalLowerFloat(), MPFR_RNDD); mpfr_mul(f_iu, fu_value, i_value->internalUpperFloat(), MPFR_RNDU); } mpfr_mul_ui(f_il, f_il, 2, MPFR_RNDD); mpfr_mul_ui(f_iu, f_iu, 2, MPFR_RNDU); mpfr_swap(f_rl, fl_value); mpfr_swap(f_ru, fu_value); mpfr_swap(f_il, i_value->internalLowerFloat()); mpfr_swap(f_iu, i_value->internalUpperFloat()); mpfr_clears(f_ru, f_rl, f_iu, f_il, f_tmp, NULL); if(!testFloatResult(true) || !i_value->testFloatResult(true)) { set(nr_bak); return false; } return true; } Number nr(*this); return multiply(nr); } if(n_type == NUMBER_TYPE_RATIONAL) { mpq_mul(r_value, r_value, r_value); } else { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_sqr(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else if(mpfr_sgn(fl_value) < 0) { if(mpfr_sgn(fu_value) < 0) { mpfr_sqr(fu_value, fu_value, MPFR_RNDD); mpfr_sqr(fl_value, fl_value, MPFR_RNDU); mpfr_swap(fu_value, fl_value); } else { if(mpfr_cmpabs(fu_value, fl_value) < 0) mpfr_sqr(fu_value, fl_value, MPFR_RNDU); else mpfr_sqr(fu_value, fu_value, MPFR_RNDU); mpfr_set_zero(fl_value, 0); } } else { mpfr_sqr(fu_value, fu_value, MPFR_RNDU); mpfr_sqr(fl_value, fl_value, MPFR_RNDD); } testFloatResult(true, 2); } return true; } bool Number::negate() { if(i_value) i_value->negate(); switch(n_type) { case NUMBER_TYPE_PLUS_INFINITY: { n_type = NUMBER_TYPE_MINUS_INFINITY; break; } case NUMBER_TYPE_MINUS_INFINITY: { n_type = NUMBER_TYPE_PLUS_INFINITY; break; } case NUMBER_TYPE_RATIONAL: { mpq_neg(r_value, r_value); break; } case NUMBER_TYPE_FLOAT: { mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_neg(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_neg(fu_value, fu_value, MPFR_RNDD); mpfr_neg(fl_value, fl_value, MPFR_RNDU); mpfr_swap(fu_value, fl_value); } testFloatResult(true, 2); break; } default: {break;} } return true; } void Number::setNegative(bool is_negative) { switch(n_type) { case NUMBER_TYPE_PLUS_INFINITY: { if(is_negative) n_type = NUMBER_TYPE_MINUS_INFINITY; break; } case NUMBER_TYPE_MINUS_INFINITY: { if(!is_negative) n_type = NUMBER_TYPE_PLUS_INFINITY; break; } case NUMBER_TYPE_RATIONAL: { if(is_negative != (mpq_sgn(r_value) < 0)) mpq_neg(r_value, r_value); break; } case NUMBER_TYPE_FLOAT: { mpfr_clear_flags(); if(mpfr_sgn(fl_value) != mpfr_sgn(fu_value)) { if(is_negative) { mpfr_neg(fu_value, fu_value, MPFR_RNDU); if(mpfr_cmp(fl_value, fu_value) < 0) mpfr_swap(fu_value, fl_value); mpfr_set_zero(fu_value, 0); } else { mpfr_abs(fl_value, fl_value, MPFR_RNDU); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fu_value, fl_value); mpfr_set_zero(fl_value, 0); } } else if(is_negative != (mpfr_sgn(fl_value) < 0)) { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_neg(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_neg(fu_value, fu_value, MPFR_RNDD); mpfr_neg(fl_value, fl_value, MPFR_RNDU); mpfr_swap(fu_value, fl_value); } testFloatResult(true, 2); } break; } default: {break;} } } bool Number::abs() { if(hasImaginaryPart()) { if(hasRealPart()) { Number nr_bak(*this); if(!i_value->square()) return false; Number *i_v = i_value; i_value = NULL; if(!square() || !add(*i_v)) { set(nr_bak); return false; } i_v->clear(); i_value = i_v; if(!raise(nr_half)) { set(nr_bak); return false; } return true; } set(*i_value, true, true); clearImaginary(); } if(isInfinite()) { n_type = NUMBER_TYPE_PLUS_INFINITY; return true; } if(n_type == NUMBER_TYPE_RATIONAL) { mpq_abs(r_value, r_value); } else { if(mpfr_sgn(fl_value) != mpfr_sgn(fu_value)) { mpfr_abs(fl_value, fl_value, MPFR_RNDU); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fu_value, fl_value); mpfr_set_zero(fl_value, 0); } else if(mpfr_sgn(fl_value) < 0) { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_neg(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_neg(fu_value, fu_value, MPFR_RNDD); mpfr_neg(fl_value, fl_value, MPFR_RNDU); mpfr_swap(fu_value, fl_value); } testFloatResult(true, 2); } } return true; } bool Number::signum() { if(isZero()) return true; if(hasImaginaryPart()) { if(hasRealPart()) { Number nabs(*this); if(!nabs.abs() || !nabs.recip()) return false; return multiply(nabs); } return i_value->signum(); } if(isPositive()) {set(1, 1); return true;} if(isNegative()) {set(-1, 1); return true;} return false; } bool Number::round(bool halfway_to_even) { if(includesInfinity() || hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_RATIONAL) { if(!isInteger()) { mpz_t i_rem; mpz_init(i_rem); mpz_mul_ui(mpq_numref(r_value), mpq_numref(r_value), 2); mpz_add(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); mpz_mul_ui(mpq_denref(r_value), mpq_denref(r_value), 2); mpz_fdiv_qr(mpq_numref(r_value), i_rem, mpq_numref(r_value), mpq_denref(r_value)); mpz_set_ui(mpq_denref(r_value), 1); if(mpz_sgn(i_rem) == 0 && (!halfway_to_even || mpz_odd_p(mpq_numref(r_value)))) { if(halfway_to_even) mpz_sub(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); else if(mpz_sgn(mpq_numref(r_value)) <= 0) mpz_sub(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); } mpz_clear(i_rem); } } else { mpz_set_ui(mpq_denref(r_value), 1); intervalToMidValue(); if(!halfway_to_even) mpfr_rint_round(fl_value, fl_value, MPFR_RNDN); mpfr_get_z(mpq_numref(r_value), fl_value, MPFR_RNDN); n_type = NUMBER_TYPE_RATIONAL; mpfr_clears(fl_value, fu_value, NULL); } return true; } bool Number::floor() { if(isInfinite() || hasImaginaryPart()) return false; //if(b_approx && !isInteger()) b_approx = false; if(n_type == NUMBER_TYPE_RATIONAL) { if(!isInteger()) { mpz_fdiv_q(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); mpz_set_ui(mpq_denref(r_value), 1); } } else { if(mpfr_inf_p(fl_value)) return false; mpz_set_ui(mpq_denref(r_value), 1); mpfr_get_z(mpq_numref(r_value), fl_value, MPFR_RNDD); n_type = NUMBER_TYPE_RATIONAL; mpfr_clears(fl_value, fu_value, NULL); } return true; } bool Number::ceil() { if(isInfinite() || hasImaginaryPart()) return false; //if(b_approx && !isInteger()) b_approx = false; if(n_type == NUMBER_TYPE_RATIONAL) { if(!isInteger()) { mpz_cdiv_q(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); mpz_set_ui(mpq_denref(r_value), 1); } } else { if(mpfr_inf_p(fu_value)) return false; mpz_set_ui(mpq_denref(r_value), 1); mpfr_get_z(mpq_numref(r_value), fu_value, MPFR_RNDU); n_type = NUMBER_TYPE_RATIONAL; mpfr_clears(fl_value, fu_value, NULL); } return true; } bool Number::trunc() { if(isInfinite() || hasImaginaryPart()) return false; //if(b_approx && !isInteger()) b_approx = false; if(n_type == NUMBER_TYPE_RATIONAL) { if(!isInteger()) { mpz_tdiv_q(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); mpz_set_ui(mpq_denref(r_value), 1); } } else { if(mpfr_inf_p(fl_value) && mpfr_inf_p(fu_value)) return false; mpz_set_ui(mpq_denref(r_value), 1); if(mpfr_sgn(fu_value) <= 0) mpfr_get_z(mpq_numref(r_value), fu_value, MPFR_RNDU); else if(mpfr_sgn(fl_value) >= 0) mpfr_get_z(mpq_numref(r_value), fl_value, MPFR_RNDD); else mpz_set_ui(mpq_numref(r_value), 0); n_type = NUMBER_TYPE_RATIONAL; mpfr_clears(fl_value, fu_value, NULL); } return true; } bool Number::round(const Number &o, bool halfway_to_even) { if(isInfinite() || o.isInfinite()) { return divide(o) && round(); } if(hasImaginaryPart()) return false; if(o.hasImaginaryPart()) return false; return divide(o) && round(halfway_to_even); } bool Number::floor(const Number &o) { if(isInfinite() || o.isInfinite()) { return divide(o) && floor(); } if(hasImaginaryPart()) return false; if(o.hasImaginaryPart()) return false; return divide(o) && floor(); } bool Number::ceil(const Number &o) { if(isInfinite() || o.isInfinite()) { return divide(o) && ceil(); } if(hasImaginaryPart()) return false; if(o.hasImaginaryPart()) return false; return divide(o) && ceil(); } bool Number::trunc(const Number &o) { if(isInfinite() || o.isInfinite()) { return divide(o) && trunc(); } if(hasImaginaryPart()) return false; if(o.hasImaginaryPart()) return false; return divide(o) && trunc(); } bool Number::mod(const Number &o) { if(includesInfinity() || o.includesInfinity()) return false; if(hasImaginaryPart() || o.hasImaginaryPart()) return false; if(o.isZero()) return false; if(isRational() && o.isRational()) { if(isInteger() && o.isInteger()) { mpz_fdiv_r(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); } else { mpq_div(r_value, r_value, o.internalRational()); mpz_fdiv_r(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); mpq_mul(r_value, r_value, o.internalRational()); } } else { // TODO: Interval too wide when o is interval if(!divide(o) || !frac()) return false; if(isNegative()) { (*this)++; testFloatResult(true, 2); } return multiply(o); } setPrecisionAndApproximateFrom(o); return true; } bool Number::frac() { if(includesInfinity() || hasImaginaryPart()) return false; if(n_type == NUMBER_TYPE_RATIONAL) { if(isInteger()) { clear(); } else { mpz_tdiv_r(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); } } else { mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_frac(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else if(!isInterval()) { mpfr_frac(fl_value, fl_value, MPFR_RNDD); mpfr_frac(fu_value, fu_value, MPFR_RNDU); } else { mpfr_t testf, testu; mpfr_inits2(mpfr_get_prec(fl_value), testf, testu, NULL); mpfr_trunc(testf, fl_value); mpfr_trunc(testu, fu_value); if(!mpfr_equal_p(testf, testu)) { mpfr_set_zero(fl_value, 0); mpfr_set_ui(fu_value, 1, MPFR_RNDU); } else { mpfr_frac(testf, fl_value, MPFR_RNDU); mpfr_frac(testu, fu_value, MPFR_RNDU); if(mpfr_cmp(testf, testu) > 0) { mpfr_frac(fu_value, fl_value, MPFR_RNDU); mpfr_frac(fl_value, fu_value, MPFR_RNDD); } else { mpfr_frac(fl_value, fl_value, MPFR_RNDD); mpfr_frac(fu_value, fu_value, MPFR_RNDU); } } mpfr_clears(testf, testu, NULL); } testFloatResult(true, 2); } return true; } bool Number::rem(const Number &o) { if(includesInfinity() || o.includesInfinity()) return false; if(hasImaginaryPart() || o.hasImaginaryPart()) return false; if(o.isZero()) return false; if(isRational() && o.isRational()) { if(isInteger() && o.isInteger()) { mpz_tdiv_r(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); } else { mpq_div(r_value, r_value, o.internalRational()); mpz_tdiv_r(mpq_numref(r_value), mpq_numref(r_value), mpq_denref(r_value)); mpq_mul(r_value, r_value, o.internalRational()); } } else { // TODO: Interval too wide when o is interval return divide(o) && frac() && multiply(o); } setPrecisionAndApproximateFrom(o); return true; } bool Number::smod(const Number &o) { if(!isInteger() || !o.isInteger()) return false; mpz_t b2; mpz_init(b2); mpz_div_ui(b2, mpq_numref(o.internalRational()), 2); mpz_sub_ui(b2, b2, 1); mpz_add(mpq_numref(r_value), mpq_numref(r_value), b2); mpz_fdiv_r(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); mpz_sub(mpq_numref(r_value), mpq_numref(r_value), b2); mpz_clear(b2); setPrecisionAndApproximateFrom(o); return true; } bool Number::irem(const Number &o) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; mpz_tdiv_r(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); return true; } bool Number::irem(const Number &o, Number &q) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; q.set(1, 0); mpz_tdiv_qr(mpq_numref(q.internalRational()), mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); return true; } bool Number::iquo(const Number &o) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; mpz_tdiv_q(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); return true; } bool Number::iquo(unsigned long int i) { if(i == 0) return false; if(!isInteger()) return false; mpz_tdiv_q_ui(mpq_numref(r_value), mpq_numref(r_value), i); return true; } bool Number::iquo(const Number &o, Number &r) { if(o.isZero()) return false; if(!isInteger() || !o.isInteger()) return false; r.set(1, 0); mpz_tdiv_qr(mpq_numref(r_value), mpq_numref(r.internalRational()), mpq_numref(r_value), mpq_numref(o.internalRational())); return true; } bool Number::isIntegerDivisible(const Number &o) const { if(!isInteger() || !o.isInteger()) return false; return mpz_divisible_p(mpq_numref(r_value), mpq_numref(o.internalRational())); } bool Number::isqrt() { if(isInteger()) { if(mpz_sgn(mpq_numref(r_value)) < 0) return false; mpz_sqrt(mpq_numref(r_value), mpq_numref(r_value)); return true; } return false; } bool Number::isPerfectSquare() const { if(isInteger()) { if(mpz_sgn(mpq_numref(r_value)) < 0) return false; return mpz_perfect_square_p(mpq_numref(r_value)) != 0; } return false; } int Number::getBoolean() const { if(isPositive()) { return 1; } else if(isNonPositive()) { return 0; } return -1; } void Number::toBoolean() { setTrue(isPositive()); } void Number::setTrue(bool is_true) { if(is_true) { set(1, 0); } else { clear(); } } void Number::setFalse() { setTrue(false); } void Number::setLogicalNot() { setTrue(!isPositive()); } void Number::e(bool use_cached_number) { if(use_cached_number) { if(nr_e.isZero() || CALCULATOR->usesIntervalArithmetic() != nr_e.isInterval() || mpfr_get_prec(nr_e.internalLowerFloat()) < BIT_PRECISION) { nr_e.e(false); } set(nr_e); } else { if(n_type != NUMBER_TYPE_FLOAT) { mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); mpq_set_ui(r_value, 0, 1); } else { if(mpfr_get_prec(fu_value) < BIT_PRECISION) mpfr_set_prec(fu_value, BIT_PRECISION); if(mpfr_get_prec(fl_value) < BIT_PRECISION) mpfr_set_prec(fl_value, BIT_PRECISION); } n_type = NUMBER_TYPE_FLOAT; if(!CALCULATOR->usesIntervalArithmetic()) { mpfr_set_ui(fl_value, 1, MPFR_RNDN); mpfr_exp(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); i_precision = FROM_BIT_PRECISION(BIT_PRECISION); } else { mpfr_set_ui(fl_value, 1, MPFR_RNDD); mpfr_set_ui(fu_value, 1, MPFR_RNDU); mpfr_exp(fu_value, fu_value, MPFR_RNDU); mpfr_exp(fl_value, fl_value, MPFR_RNDD); } } b_approx = true; } void Number::pi() { if(n_type != NUMBER_TYPE_FLOAT) { mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); mpq_set_ui(r_value, 0, 1); } else { if(mpfr_get_prec(fu_value) < BIT_PRECISION) mpfr_set_prec(fu_value, BIT_PRECISION); if(mpfr_get_prec(fl_value) < BIT_PRECISION) mpfr_set_prec(fl_value, BIT_PRECISION); } n_type = NUMBER_TYPE_FLOAT; if(!CALCULATOR->usesIntervalArithmetic()) { mpfr_const_pi(fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); i_precision = FROM_BIT_PRECISION(BIT_PRECISION); } else { mpfr_const_pi(fu_value, MPFR_RNDU); mpfr_const_pi(fl_value, MPFR_RNDD); } b_approx = true; } void Number::catalan() { if(n_type != NUMBER_TYPE_FLOAT) { mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); mpq_set_ui(r_value, 0, 1); } else { if(mpfr_get_prec(fu_value) < BIT_PRECISION) mpfr_set_prec(fu_value, BIT_PRECISION); if(mpfr_get_prec(fl_value) < BIT_PRECISION) mpfr_set_prec(fl_value, BIT_PRECISION); } n_type = NUMBER_TYPE_FLOAT; if(!CALCULATOR->usesIntervalArithmetic()) { mpfr_const_catalan(fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); i_precision = FROM_BIT_PRECISION(BIT_PRECISION); } else { mpfr_const_catalan(fu_value, MPFR_RNDU); mpfr_const_catalan(fl_value, MPFR_RNDD); } b_approx = true; } void Number::euler() { if(n_type != NUMBER_TYPE_FLOAT) { mpfr_init2(fu_value, BIT_PRECISION); mpfr_init2(fl_value, BIT_PRECISION); mpq_set_ui(r_value, 0, 1); } else { if(mpfr_get_prec(fu_value) < BIT_PRECISION) mpfr_set_prec(fu_value, BIT_PRECISION); if(mpfr_get_prec(fl_value) < BIT_PRECISION) mpfr_set_prec(fl_value, BIT_PRECISION); } n_type = NUMBER_TYPE_FLOAT; if(!CALCULATOR->usesIntervalArithmetic()) { mpfr_const_euler(fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); i_precision = FROM_BIT_PRECISION(BIT_PRECISION); } else { mpfr_const_euler(fu_value, MPFR_RNDU); mpfr_const_euler(fl_value, MPFR_RNDD); } b_approx = true; } bool Number::zeta() { if(!isInteger() || !isPositive() || isOne()) { return false; } bool overflow = false; long int i = lintValue(&overflow); if(overflow) { CALCULATOR->error(true, _("Cannot handle an argument (s) that large for Riemann Zeta."), NULL); return false; } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_zeta_ui(fl_value, (unsigned long int) i, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_zeta_ui(fu_value, (unsigned long int) i, MPFR_RNDU); mpfr_zeta_ui(fl_value, (unsigned long int) i, MPFR_RNDD); } mpq_set_ui(r_value, 0, 1); n_type = NUMBER_TYPE_FLOAT; if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::gamma() { if(isPlusInfinity()) return true; if(!isReal()) return false; if(!isNonZero()) return false; Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_gamma(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { if(mpfr_sgn(fl_value) > 0) { if(mpfr_cmp_d(fl_value, 1.5) < 0) { mpfr_t f_gamma_minx; mpfr_init2(f_gamma_minx, BIT_PRECISION); mpfr_set_str(f_gamma_minx, "1.46163214496836234126265954232572132846819620400644635129598840859878644035380181024307499273372559", 10, MPFR_RNDN); if(mpfr_cmp(fl_value, f_gamma_minx) < 0) { if(mpfr_cmp(fu_value, f_gamma_minx) < 0) { mpfr_gamma(fu_value, fu_value, MPFR_RNDD); mpfr_gamma(fl_value, fl_value, MPFR_RNDU); mpfr_swap(fl_value, fu_value); } else { mpfr_gamma(fu_value, fu_value, MPFR_RNDU); mpfr_gamma(fl_value, fl_value, MPFR_RNDU); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); mpfr_set_str(fl_value, "0.88560319441088870027881590058258873320795153366990344887120016587513622741739634666479828021420359", 10, MPFR_RNDD); } } else { mpfr_gamma(fu_value, fu_value, MPFR_RNDU); mpfr_gamma(fl_value, fl_value, MPFR_RNDD); } mpfr_clear(f_gamma_minx); } else { mpfr_gamma(fu_value, fu_value, MPFR_RNDU); mpfr_gamma(fl_value, fl_value, MPFR_RNDD); } } else if(mpfr_sgn(fu_value) >= 0) { set(nr_bak); return false; } else { mpfr_t fu_test, fl_test; mpfr_init2(fu_test, BIT_PRECISION); mpfr_init2(fl_test, BIT_PRECISION); mpfr_floor(fu_test, fu_value); mpfr_floor(fl_test, fl_value); if(!mpfr_equal_p(fu_test, fl_test) || mpfr_equal_p(fl_test, fl_value)) {set(nr_bak); return false;} mpfr_gamma(fu_value, fu_value, MPFR_RNDN); mpfr_gamma(fl_value, fl_value, MPFR_RNDN); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); if(nr_bak.isInterval() && nr_bak.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("%s() lacks proper support interval arithmetic."), CALCULATOR->f_gamma->name().c_str(), NULL); mpfr_clears(fu_test, fl_test, NULL); } } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::digamma() { if(!isReal()) return false; if(!isNonZero()) return false; Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_digamma(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { if(mpfr_sgn(fl_value) > 0) { mpfr_digamma(fu_value, fu_value, MPFR_RNDU); mpfr_digamma(fl_value, fl_value, MPFR_RNDD); } else if(mpfr_sgn(fu_value) >= 0) { set(nr_bak); return false; } else { mpfr_t fu_test, fl_test; mpfr_init2(fu_test, BIT_PRECISION); mpfr_init2(fl_test, BIT_PRECISION); mpfr_floor(fu_test, fu_value); mpfr_floor(fl_test, fl_value); if(!mpfr_equal_p(fu_test, fl_test) || mpfr_equal_p(fl_test, fl_value)) {set(nr_bak); return false;} mpfr_digamma(fu_value, fu_value, MPFR_RNDU); mpfr_digamma(fl_value, fl_value, MPFR_RNDD); mpfr_clears(fu_test, fl_test, NULL); } } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::erf() { if(hasImaginaryPart()) return false; if(isPlusInfinity()) {set(1, 1, 0, true); return true;} if(isMinusInfinity()) {set(-1, 1, 0, true); return true;} Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_erf(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_erf(fu_value, fu_value, MPFR_RNDU); mpfr_erf(fl_value, fl_value, MPFR_RNDD); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::erfc() { if(hasImaginaryPart()) return false; if(isPlusInfinity()) {clear(true); return true;} if(isMinusInfinity()) {set(2, 1, 0, true); return true;} Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_erfc(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_erfc(fu_value, fu_value, MPFR_RNDD); mpfr_erfc(fl_value, fl_value, MPFR_RNDU); mpfr_swap(fu_value, fl_value); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::airy() { if(!isReal()) return false; if(!isLessThanOrEqualTo(500) || !isGreaterThanOrEqualTo(-500)) return false; Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_ai(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_ai(fl_value, fl_value, MPFR_RNDN); mpfr_ai(fu_value, fu_value, MPFR_RNDN); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); if(nr_bak.isInterval() && nr_bak.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("%s() lacks proper support interval arithmetic."), CALCULATOR->f_airy->name().c_str(), NULL); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::besselj(const Number &o) { if(hasImaginaryPart() || !o.isInteger()) return false; if(isZero()) return true; if(isInfinite()) { clear(true); return true; } if(!mpz_fits_slong_p(mpq_numref(o.internalRational()))) return false; long int n = mpz_get_si(mpq_numref(o.internalRational())); Number nr_bak(*this); if(!setToFloatingPoint()) return false; if(mpfr_get_exp(fl_value) > 2000000L) { set(nr_bak); return false; } mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_jn(fl_value, n, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_jn(fl_value, n, fl_value, MPFR_RNDN); mpfr_jn(fu_value, n, fu_value, MPFR_RNDN); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); if(nr_bak.isInterval() && nr_bak.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("%s() lacks proper support interval arithmetic."), CALCULATOR->f_besselj->name().c_str(), NULL); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::bessely(const Number &o) { if(hasImaginaryPart() || !isNonNegative() || !o.isInteger() || isZero()) return false; if(isPlusInfinity()) { clear(true); return true; } if(isMinusInfinity()) return false; if(!mpz_fits_slong_p(mpq_numref(o.internalRational()))) return false; long int n = mpz_get_si(mpq_numref(o.internalRational())); Number nr_bak(*this); if(!setToFloatingPoint()) return false; if(mpfr_get_exp(fl_value) > 2000000L) { set(nr_bak); return false; } mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_yn(fl_value, n, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_yn(fl_value, n, fl_value, MPFR_RNDN); mpfr_yn(fu_value, n, fu_value, MPFR_RNDN); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); if(nr_bak.isInterval() && nr_bak.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("%s() lacks proper support interval arithmetic."), CALCULATOR->f_bessely->name().c_str(), NULL); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::sin() { if(includesInfinity()) { if(!hasImaginaryPart() && isInterval() && (mpfr_sgn(fl_value) != mpfr_sgn(fu_value) || !mpfr_inf_p(fl_value) || !mpfr_inf_p(fu_value))) { setInterval(nr_minus_one, nr_one, true); return true; } return false; } if(isZero()) return true; if(hasImaginaryPart()) { if(hasRealPart()) { Number t1a, t1b, t2a, t2b; t1a.set(*this, false, true); t1b.set(*i_value, false, true); t2a.set(t1a); t2b.set(t1b); if(!t1a.sin() || !t1b.cosh() || !t2a.cos() || !t2b.sinh() || !t1a.multiply(t1b) || !t2a.multiply(t2b)) return false; if(!t1a.isReal() || !t2a.isReal()) return false; set(t1a, true, true); i_value->set(t2a, true, true); setPrecisionAndApproximateFrom(*i_value); return true; } else { if(!i_value->sinh()) return false; setPrecisionAndApproximateFrom(*i_value); return true; } } Number nr_bak(*this); bool do_pi = true; if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_cmp_ui(mpq_denref(r_value), 1000000L) < 0) do_pi = false; if(!setToFloatingPoint()) return false; } if(mpfr_get_exp(fl_value) > BIT_PRECISION || mpfr_get_exp(fu_value) > BIT_PRECISION) { set(nr_bak); return false; } mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { if(do_pi) { mpfr_t f_pi, f_quo; mpz_t f_int; mpz_init(f_int); mpfr_init2(f_pi, BIT_PRECISION); mpfr_init2(f_quo, BIT_PRECISION - 30); mpfr_const_pi(f_pi, MPFR_RNDN); mpfr_div(f_quo, fl_value, f_pi, MPFR_RNDN); mpfr_get_z(f_int, f_quo, MPFR_RNDD); mpfr_frac(f_quo, f_quo, MPFR_RNDN); if(mpfr_zero_p(f_quo)) { clear(true); b_approx = true; if(i_precision < 0 || FROM_BIT_PRECISION(BIT_PRECISION - 30) < i_precision) i_precision = FROM_BIT_PRECISION(BIT_PRECISION - 30); mpfr_clears(f_pi, f_quo, NULL); mpz_clear(f_int); return true; } mpfr_abs(f_quo, f_quo, MPFR_RNDN); mpfr_mul_ui(f_quo, f_quo, 2, MPFR_RNDN); mpfr_sub_ui(f_quo, f_quo, 1, MPFR_RNDN); if(mpfr_zero_p(f_quo)) { if(mpz_odd_p(f_int)) set(-1, 1, 0, true); else set(1, 1, 0, true); b_approx = true; if(i_precision < 0 || FROM_BIT_PRECISION(BIT_PRECISION - 30) < i_precision) i_precision = FROM_BIT_PRECISION(BIT_PRECISION - 30); mpfr_clears(f_pi, f_quo, NULL); mpz_clear(f_int); return true; } mpfr_clears(f_pi, f_quo, NULL); mpz_clear(f_int); } mpfr_sin(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_t fl_pi, fu_pi, fu_quo, fl_quo; mpfr_inits2(BIT_PRECISION, fl_pi, fu_pi, fl_quo, fu_quo, NULL); mpz_t fl_int, fu_int, f_diff; mpz_inits(fl_int, fu_int, f_diff, NULL); mpfr_const_pi(fl_pi, MPFR_RNDD); mpfr_const_pi(fu_pi, MPFR_RNDU); mpfr_div(fl_quo, fl_value, fu_pi, MPFR_RNDD); mpfr_div(fu_quo, fu_value, fl_pi, MPFR_RNDU); mpfr_sub_q(fl_quo, fl_quo, nr_half.internalRational(), MPFR_RNDD); mpfr_sub_q(fu_quo, fu_quo, nr_half.internalRational(), MPFR_RNDU); mpfr_get_z(fl_int, fl_quo, MPFR_RNDD); mpfr_get_z(fu_int, fu_quo, MPFR_RNDD); mpfr_sub_z(fl_quo, fl_quo, fl_int, MPFR_RNDD); mpfr_sub_z(fu_quo, fu_quo, fu_int, MPFR_RNDU); if(mpz_cmp(fl_int, fu_int) != 0) { mpz_sub(f_diff, fu_int, fl_int); if(mpz_cmp_ui(f_diff, 2) >= 0) { mpfr_set_si(fl_value, -1, MPFR_RNDD); mpfr_set_si(fu_value, 1, MPFR_RNDU); } else { if(mpz_even_p(fl_int)) { mpfr_sin(fl_value, fl_value, MPFR_RNDU); mpfr_sin(fu_value, fu_value, MPFR_RNDU); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); mpfr_set_si(fl_value, -1, MPFR_RNDD); } else { mpfr_sin(fl_value, fl_value, MPFR_RNDD); mpfr_sin(fu_value, fu_value, MPFR_RNDD); if(mpfr_cmp(fu_value, fl_value) < 0) mpfr_swap(fl_value, fu_value); mpfr_set_si(fu_value, 1, MPFR_RNDU); } } } else { if(mpz_even_p(fl_int)) { mpfr_sin(fl_value, fl_value, MPFR_RNDU); mpfr_sin(fu_value, fu_value, MPFR_RNDD); mpfr_swap(fl_value, fu_value); } else { mpfr_sin(fl_value, fl_value, MPFR_RNDD); mpfr_sin(fu_value, fu_value, MPFR_RNDU); } } mpfr_clears(fl_pi, fu_pi, fl_quo, fu_quo, NULL); mpz_clears(fl_int, fu_int, f_diff, NULL); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::asin() { if(includesInfinity()) return false; if(isZero()) return true; if(isOne()) { pi(); divide(2); return true; } if(isMinusOne()) { pi(); divide(-2); return true; } if(hasImaginaryPart() || !isFraction()) { if(b_imag) return false; if(hasImaginaryPart() && !hasRealPart()) { Number nri(*i_value); if(!nri.asinh() || !nri.multiply(nr_one_i)) return false; set(nri, true); return true; } if(isInterval(false)) { Number nr1(lowerEndPoint(true)); Number nr2(upperEndPoint(true)); if(!nr1.asin() || !nr2.asin()) return false; if(!hasImaginaryPart()) { if(!setInterval(nr1, nr2, true)) return false; return true; } Number nr; if(!nr.setInterval(nr1, nr2, true)) return false; if(isInterval(true) && imaginaryPartIsInterval()) { Number nr3(lowerEndPoint(false)); Number nr4(upperEndPoint(false)); nr3.setImaginaryPart(i_value->upperEndPoint()); nr4.setImaginaryPart(i_value->lowerEndPoint()); if(!nr3.asin() || !nr4.asin()) return false; if(!nr.setInterval(nr, nr3, true)) return false; if(!nr.setInterval(nr, nr4, true)) return false; } if(hasRealPart() && !realPartIsNonZero()) { nr1 = lowerEndPoint(true); nr2 = upperEndPoint(true); nr1.clearReal(); nr2.clearReal(); if(!nr1.asin() || !nr2.asin()) return false; if(!nr.setInterval(nr, nr1, true)) return false; if(!nr.setInterval(nr, nr2, true)) return false; } if(hasImaginaryPart() && !imaginaryPartIsNonZero()) { nr1 = lowerEndPoint(false); nr2 = upperEndPoint(false); if(!nr1.asin() || !nr2.asin()) return false; if(!nr.setInterval(nr, nr1, true)) return false; if(!nr.setInterval(nr, nr2, true)) return false; } set(nr, true); return true; } Number z_sqln(*this); Number i_z(*this); bool b_neg = false; if(hasImaginaryPart()) { b_neg = (realPartIsNegative() && !imaginaryPartIsNegative()) || (realPartIsPositive() && imaginaryPartIsPositive()); } else { b_neg = isNegative(); } if(b_neg && (!z_sqln.negate() || !i_z.negate())) return false; if(!i_z.multiply(nr_one_i)) return false; if(!z_sqln.square() || !z_sqln.negate() || !z_sqln.add(1) || !z_sqln.raise(nr_half) || !z_sqln.add(i_z) || !z_sqln.ln() || !z_sqln.multiply(nr_minus_i)) return false; if(b_neg && !z_sqln.negate()) return false; if(hasImaginaryPart() && z_sqln.isInterval(false) && z_sqln.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("Interval calculated wide."), NULL); set(z_sqln); return true; } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_asin(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_asin(fl_value, fl_value, MPFR_RNDD); mpfr_asin(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::sinh() { if(isInfinite()) return true; if(isZero()) return true; if(hasImaginaryPart()) { if(hasRealPart()) { Number t1a, t1b, t2a, t2b; t1a.set(*this, false, true); t1b.set(*i_value, false, true); t2a.set(t1a); t2b.set(t1b); if(!t1a.sinh() || !t1b.cos() || !t2a.cosh() || !t2b.sin() || !t1a.multiply(t1b) || !t2a.multiply(t2b)) return false; if(!t1a.isReal() || !t2a.isReal()) return false; set(t1a, true, true); i_value->set(t2a, true, true); setPrecisionAndApproximateFrom(*i_value); return true; } else { if(!i_value->sin()) return false; setPrecisionAndApproximateFrom(*i_value); return true; } } Number nr_bak(*this); if(!setToFloatingPoint()) return false; if(mpfr_get_exp(fl_value) > 28 || mpfr_get_exp(fu_value) > 28) { set(nr_bak); return false; } mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_sinh(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_sinh(fl_value, fl_value, MPFR_RNDD); mpfr_sinh(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::asinh() { if(isInfinite()) return true; if(isZero()) return true; if(hasImaginaryPart()) { if(!hasRealPart()) { Number inr(*i_value); if(!inr.asin() || !inr.multiply(nr_one_i)) return false; set(inr, true); return true; } if(isInterval(false)) { Number nr1(lowerEndPoint(true)); Number nr2(upperEndPoint(true)); if(!nr1.asinh() || !nr2.asinh()) return false; Number nr; if(!nr.setInterval(nr1, nr2, true)) return false; if(isInterval(true) && imaginaryPartIsInterval()) { Number nr3(lowerEndPoint(false)); Number nr4(upperEndPoint(false)); nr3.setImaginaryPart(i_value->upperEndPoint()); nr4.setImaginaryPart(i_value->lowerEndPoint()); if(!nr3.asinh() || !nr4.asinh()) return false; if(!nr.setInterval(nr, nr3, true)) return false; if(!nr.setInterval(nr, nr4, true)) return false; } if(hasRealPart() && !realPartIsNonZero()) { nr1 = lowerEndPoint(true); nr2 = upperEndPoint(true); nr1.clearReal(); nr2.clearReal(); if(!nr1.asinh() || !nr2.asinh()) return false; if(!nr.setInterval(nr, nr1, true)) return false; if(!nr.setInterval(nr, nr2, true)) return false; } if(hasImaginaryPart() && !imaginaryPartIsNonZero()) { nr1 = lowerEndPoint(false); nr2 = upperEndPoint(false); if(!nr1.asinh() || !nr2.asinh()) return false; if(!nr.setInterval(nr, nr1, true)) return false; if(!nr.setInterval(nr, nr2, true)) return false; } set(nr, true); return true; } Number z_sqln(*this); if(!z_sqln.square() || !z_sqln.add(1) || !z_sqln.raise(nr_half) || !z_sqln.add(*this)) return false; //If zero, it means that the precision is too low (since infinity is not the correct value). Happens with number less than -(10^1000)i if(z_sqln.isZero()) return false; if(!z_sqln.ln()) return false; if(hasImaginaryPart() && z_sqln.isInterval(false) && z_sqln.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("Interval calculated wide."), NULL); set(z_sqln); return true; } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_asinh(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_asinh(fl_value, fl_value, MPFR_RNDD); mpfr_asinh(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::cos() { if(includesInfinity()) { if(!hasImaginaryPart() && isInterval() && (mpfr_sgn(fl_value) != mpfr_sgn(fu_value) || !mpfr_inf_p(fl_value) || !mpfr_inf_p(fu_value))) { setInterval(nr_minus_one, nr_one, true); return true; } return false; } if(isZero()) { set(1, 1, 0, true); return true; } if(hasImaginaryPart()) { if(hasRealPart()) { Number t1a, t1b, t2a, t2b; t1a.set(*this, false, true); t1b.set(*i_value, false, true); t2a.set(t1a); t2b.set(t1b); if(!t1a.cos() || !t1b.cosh() || !t2a.sin() || !t2b.sinh() || !t1a.multiply(t1b) || !t2a.multiply(t2b) || !t2a.negate()) return false; if(!t1a.isReal() || !t2a.isReal()) return false; set(t1a, true, true); i_value->set(t2a, true, true); setPrecisionAndApproximateFrom(*i_value); testComplex(this, i_value); return true; } else { if(!i_value->cosh()) return false; set(*i_value, true, true); i_value->clear(); return true; } } Number nr_bak(*this); bool do_pi = true; if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_cmp_ui(mpq_denref(r_value), 1000000L) < 0) do_pi = false; if(!setToFloatingPoint()) return false; } if(mpfr_get_exp(fl_value) > BIT_PRECISION || mpfr_get_exp(fu_value) > BIT_PRECISION) { set(nr_bak); return false; } mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { if(do_pi) { mpfr_t f_pi, f_quo; mpz_t f_int; mpz_init(f_int); mpfr_init2(f_pi, BIT_PRECISION); mpfr_init2(f_quo, BIT_PRECISION - 30); mpfr_const_pi(f_pi, MPFR_RNDN); mpfr_div(f_quo, fl_value, f_pi, MPFR_RNDN); // ?: was MPFR_RNDF mpfr_get_z(f_int, f_quo, MPFR_RNDD); mpfr_frac(f_quo, f_quo, MPFR_RNDN); if(mpfr_zero_p(f_quo)) { if(mpz_odd_p(f_int)) set(-1, 1, 0, true); else set(1, 1, 0, true); b_approx = true; if(i_precision < 0 || FROM_BIT_PRECISION(BIT_PRECISION - 30) < i_precision) i_precision = FROM_BIT_PRECISION(BIT_PRECISION - 30); mpfr_clears(f_pi, f_quo, NULL); mpz_clear(f_int); return true; } mpfr_abs(f_quo, f_quo, MPFR_RNDN); mpfr_mul_ui(f_quo, f_quo, 2, MPFR_RNDN); mpfr_sub_ui(f_quo, f_quo, 1, MPFR_RNDN); if(mpfr_zero_p(f_quo)) { clear(true); b_approx = true; if(i_precision < 0 || FROM_BIT_PRECISION(BIT_PRECISION - 30) < i_precision) i_precision = FROM_BIT_PRECISION(BIT_PRECISION - 30); mpfr_clears(f_pi, f_quo, NULL); mpz_clear(f_int); return true; } mpfr_clears(f_pi, f_quo, NULL); mpz_clear(f_int); } mpfr_cos(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_t fl_pi, fu_pi, fu_quo, fl_quo; mpfr_inits2(BIT_PRECISION, fl_pi, fu_pi, fl_quo, fu_quo, NULL); mpz_t fl_int, fu_int, f_diff; mpz_inits(fl_int, fu_int, f_diff, NULL); mpfr_const_pi(fl_pi, MPFR_RNDD); mpfr_const_pi(fu_pi, MPFR_RNDU); mpfr_div(fl_quo, fl_value, fu_pi, MPFR_RNDD); mpfr_div(fu_quo, fu_value, fl_pi, MPFR_RNDU); mpfr_get_z(fl_int, fl_quo, MPFR_RNDD); mpfr_get_z(fu_int, fu_quo, MPFR_RNDD); mpfr_sub_z(fl_quo, fl_quo, fl_int, MPFR_RNDD); mpfr_sub_z(fu_quo, fu_quo, fu_int, MPFR_RNDU); if(mpz_cmp(fl_int, fu_int) != 0) { mpz_sub(f_diff, fu_int, fl_int); if(mpz_cmp_ui(f_diff, 2) >= 0) { mpfr_set_si(fl_value, -1, MPFR_RNDD); mpfr_set_si(fu_value, 1, MPFR_RNDU); } else { if(mpz_even_p(fl_int)) { mpfr_cos(fl_value, fl_value, MPFR_RNDU); mpfr_cos(fu_value, fu_value, MPFR_RNDU); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); mpfr_set_si(fl_value, -1, MPFR_RNDD); } else { mpfr_cos(fl_value, fl_value, MPFR_RNDD); mpfr_cos(fu_value, fu_value, MPFR_RNDD); if(mpfr_cmp(fu_value, fl_value) < 0) mpfr_swap(fl_value, fu_value); mpfr_set_si(fu_value, 1, MPFR_RNDU); } } } else { if(mpz_even_p(fl_int)) { mpfr_cos(fl_value, fl_value, MPFR_RNDU); mpfr_cos(fu_value, fu_value, MPFR_RNDD); mpfr_swap(fl_value, fu_value); } else { mpfr_cos(fl_value, fl_value, MPFR_RNDD); mpfr_cos(fu_value, fu_value, MPFR_RNDU); } } mpfr_clears(fl_pi, fu_pi, fl_quo, fu_quo, NULL); mpz_clears(fl_int, fu_int, f_diff, NULL); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::acos() { if(includesInfinity()) return false; if(isOne()) { clear(true); return true; } if(isZero()) { pi(); divide(2); return true; } if(isMinusOne()) { pi(); return true; } if(hasImaginaryPart() || !isFraction()) { if(b_imag) return false; //acos(x)=(pi-2*asin(x))/2 Number nr(*this); Number nr_pi; nr_pi.pi(); if(!nr.asin() || !nr.multiply(2) || !nr.negate() || !nr.add(nr_pi) || !nr.multiply(nr_half)) return false; set(nr); return true; } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_acos(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_acos(fl_value, fl_value, MPFR_RNDU); mpfr_acos(fu_value, fu_value, MPFR_RNDD); mpfr_swap(fl_value, fu_value); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::cosh() { if(isInfinite()) { setPlusInfinity(); return true; } if(isZero()) { set(1, 1, 0, true); return true; } if(hasImaginaryPart()) { if(hasRealPart()) { Number t1a, t1b, t2a, t2b; t1a.set(*this, false, true); t1b.set(*i_value, false, true); t2a.set(t1a); t2b.set(t1b); if(!t1a.cosh() || !t1b.cos() || !t2a.sinh() || !t2b.sin() || !t1a.multiply(t1b) || !t2a.multiply(t2b)) return false; if(!t1a.isReal() || !t2a.isReal()) return false; set(t1a, true, true); i_value->set(t2a, true, true); setPrecisionAndApproximateFrom(*i_value); testComplex(this, i_value); return true; } else { if(!i_value->cos()) return false; set(*i_value, true, true); i_value->clear(); return true; } } Number nr_bak(*this); if(!setToFloatingPoint()) return false; if(mpfr_get_exp(fl_value) > 28 || mpfr_get_exp(fu_value) > 28) { set(nr_bak); return false; } mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_cosh(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { if(mpfr_sgn(fl_value) < 0) { if(mpfr_sgn(fu_value) == 0) { mpfr_cosh(fu_value, fl_value, MPFR_RNDU); mpfr_set_ui(fl_value, 1, MPFR_RNDD); } else if(mpfr_sgn(fu_value) > 0) { mpfr_cosh(fl_value, fl_value, MPFR_RNDU); mpfr_cosh(fu_value, fu_value, MPFR_RNDD); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); mpfr_set_ui(fl_value, 1, MPFR_RNDD); } else { mpfr_cosh(fl_value, fl_value, MPFR_RNDU); mpfr_cosh(fu_value, fu_value, MPFR_RNDD); mpfr_swap(fl_value, fu_value); } } else { mpfr_cosh(fu_value, fu_value, MPFR_RNDU); if(mpfr_sgn(fl_value) == 0) mpfr_set_ui(fl_value, 1, MPFR_RNDD); else mpfr_cosh(fl_value, fl_value, MPFR_RNDD); } } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::acosh() { if(isPlusInfinity()) return true; if(isMinusInfinity()) return false; if(n_type == NUMBER_TYPE_FLOAT && (mpfr_inf_p(fl_value) && mpfr_sgn(fl_value) < 0)) return false; if(isOne()) { clear(true); return true; } if(hasImaginaryPart() || !isGreaterThanOrEqualTo(nr_one)) { if(b_imag) return false; if(isInterval(false)) { Number nr1(lowerEndPoint(true)); Number nr2(upperEndPoint(true)); if(!nr1.acosh() || !nr2.acosh()) return false; Number nr; if(!nr.setInterval(nr1, nr2, true)) return false; if(isInterval(true) && imaginaryPartIsInterval()) { Number nr3(lowerEndPoint(false)); Number nr4(upperEndPoint(false)); nr3.setImaginaryPart(i_value->upperEndPoint()); nr4.setImaginaryPart(i_value->lowerEndPoint()); if(!nr3.acosh() || !nr4.acosh()) return false; if(!nr.setInterval(nr, nr3, true)) return false; if(!nr.setInterval(nr, nr4, true)) return false; } if(hasRealPart() && !realPartIsNonZero()) { nr1 = lowerEndPoint(true); nr2 = upperEndPoint(true); nr1.clearReal(); nr2.clearReal(); if(!nr1.acosh() || !nr2.acosh()) return false; if(!nr.setInterval(nr, nr1, true)) return false; if(!nr.setInterval(nr, nr2, true)) return false; } if(hasImaginaryPart() && !imaginaryPartIsNonZero()) { nr1 = lowerEndPoint(false); nr2 = upperEndPoint(false); if(!nr1.acosh() || !nr2.acosh()) return false; Number nr_pi; nr_pi.pi(); nr1.setImaginaryPart(nr_pi); nr_pi.negate(); nr2.setImaginaryPart(nr_pi); if(!nr.setInterval(nr, nr1, true)) return false; if(!nr.setInterval(nr, nr2, true)) return false; } set(nr, true); return true; } if((CALCULATOR->usesIntervalArithmetic() || isInterval()) && !hasImaginaryPart()) { Number ipz(lowerEndPoint()), imz(ipz); if(!ipz.add(1) || !imz.subtract(1)) return false; if(!ipz.raise(nr_half) || !imz.raise(nr_half) || !ipz.multiply(imz) || !ipz.add(lowerEndPoint())) return false; Number ipz2(upperEndPoint()), imz2(ipz2); if(!ipz2.add(1) || !imz2.subtract(1)) return false; if(!ipz2.raise(nr_half) || !imz2.raise(nr_half) || !ipz2.multiply(imz2) || !ipz2.add(upperEndPoint())) return false; Number nriv; nriv.setInterval(ipz, ipz2); if(mpfr_sgn(fl_value) < 0 && mpfr_sgn(fu_value) > 0) { Number nrivi; nrivi.setInterval(nriv.imaginaryPart(), nr_one); nriv.setImaginaryPart(nrivi); } if(!nriv.ln()) return false; if(isGreaterThanOrEqualTo(nr_minus_one)) { nriv.clearReal(); } else { if(nriv.isInterval(false) && nriv.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("Interval calculated wide."), NULL); } set(nriv); return true; } Number ipz(*this), imz(*this); if(!ipz.add(1) || !imz.subtract(1)) return false; if(!ipz.raise(nr_half) || !imz.raise(nr_half) || !ipz.multiply(imz) || !ipz.add(*this) || !ipz.ln()) return false; if(hasImaginaryPart() && ipz.isInterval(false) && ipz.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("Interval calculated wide."), NULL); set(ipz); return true; } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_acosh(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_acosh(fl_value, fl_value, MPFR_RNDD); mpfr_acosh(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::tan() { if(includesInfinity()) return false; if(isZero()) return true; if(hasImaginaryPart()) { if(hasRealPart()) { Number t1a, t1b, t2a, t2b; t1a.set(*this, false, true); t1b.set(*i_value, false, true); if(!t1a.multiply(2) || !t1b.multiply(2)) return false; t2a.set(t1a); t2b.set(t1b); if(!t1a.sin() || !t1b.sinh() || !t2a.cos() || !t2b.cosh() || !t2a.add(t2b) || !t1a.divide(t2a) || !t1b.divide(t2a)) return false; if(!t1a.isReal() || !t1b.isReal()) return false; if(t1a.isInterval(false) && t1a.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("Interval calculated wide."), NULL); set(t1a, true, true); i_value->set(t1b, true, true); setPrecisionAndApproximateFrom(*i_value); testComplex(this, i_value); return true; } else { if(!i_value->tanh()) return false; setPrecisionAndApproximateFrom(*i_value); return true; } } Number nr_bak(*this); bool do_pi = true; if(n_type == NUMBER_TYPE_RATIONAL) { if(mpz_cmp_ui(mpq_denref(r_value), 1000000L) < 0) do_pi = false; if(!setToFloatingPoint()) return false; } if(mpfr_get_exp(fl_value) > BIT_PRECISION || mpfr_get_exp(fu_value) > BIT_PRECISION) { set(nr_bak); return false; } mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { if(do_pi) { mpfr_t f_pi, f_quo; mpfr_init2(f_pi, BIT_PRECISION); mpfr_init2(f_quo, BIT_PRECISION - 30); mpfr_const_pi(f_pi, MPFR_RNDN); mpfr_div(f_quo, fl_value, f_pi, MPFR_RNDN); mpfr_frac(f_quo, f_quo, MPFR_RNDN); if(mpfr_zero_p(f_quo)) { clear(true); b_approx = true; if(i_precision < 0 || FROM_BIT_PRECISION(BIT_PRECISION - 30) < i_precision) i_precision = FROM_BIT_PRECISION(BIT_PRECISION - 30); mpfr_clears(f_pi, f_quo, NULL); return true; } mpfr_clears(f_pi, f_quo, NULL); } mpfr_tan(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_t fl_pi, fu_pi, fu_quo, fl_quo, f_diff; mpfr_inits2(BIT_PRECISION, fl_pi, fu_pi, f_diff, fl_quo, fu_quo, NULL); mpfr_const_pi(fl_pi, MPFR_RNDD); mpfr_const_pi(fu_pi, MPFR_RNDU); bool b_neg1 = mpfr_sgn(fl_value) < 0; bool b_neg2 = mpfr_sgn(fu_value) < 0; mpfr_div(fl_quo, fl_value, b_neg1 ? fl_pi : fu_pi, MPFR_RNDD); mpfr_div(fu_quo, fu_value, b_neg2 ? fu_pi : fl_pi, MPFR_RNDU); mpfr_sub(f_diff, fu_quo, fl_quo, MPFR_RNDU); if(mpfr_cmp_ui(f_diff, 1) >= 0) { mpfr_clears(f_diff, fl_pi, fu_pi, fl_quo, fu_quo, NULL); set(nr_bak); return false; } mpfr_frac(fl_quo, fl_quo, MPFR_RNDD); mpfr_frac(fu_quo, fu_quo, MPFR_RNDU); if(b_neg1) mpfr_neg(fl_quo, fl_quo, MPFR_RNDU); if(b_neg2) mpfr_neg(fu_quo, fu_quo, MPFR_RNDD); int c1 = mpfr_cmp_ui_2exp(fl_quo, 1, -1); int c2 = mpfr_cmp_ui_2exp(fu_quo, 1, -1); if(b_neg1) c1 = -c1; if(b_neg2) c2 = -c2; if((c1 != c2 && c1 <= 0 && c2 >= 0) || (c1 == c2 && mpfr_cmp_ui_2exp(f_diff, 1, -1) >= 0)) { mpfr_clears(f_diff, fl_pi, fu_pi, fl_quo, fu_quo, NULL); set(nr_bak); return false; } mpfr_clears(f_diff, fl_pi, fu_pi, fl_quo, fu_quo, NULL); mpfr_tan(fl_value, fl_value, MPFR_RNDD); mpfr_tan(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::atan() { if(isZero()) return true; if(isInfinite(false)) { bool b_neg = isMinusInfinity(); pi(); divide(2); if(b_neg) negate(); return true; } if(hasImaginaryPart()) { if(hasRealPart()) { Number ipz(*this), imz(*this); if(!ipz.multiply(nr_one_i) || !imz.multiply(nr_minus_i) || !ipz.add(1) || !imz.add(1)) return false; if(!ipz.ln() || !imz.ln() || !imz.subtract(ipz) || !imz.multiply(nr_one_i) || !imz.divide(2)) return false; if(imz.isInterval(false) && imz.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("Interval calculated wide."), NULL); set(imz); return true; } else { Number nri(*i_value); if(!nri.atanh() || !nri.multiply(nr_one_i)) return false; set(nri, true); return true; } } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_atan(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_atan(fl_value, fl_value, MPFR_RNDD); mpfr_atan(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::atan2(const Number &o, bool allow_zero) { if(hasImaginaryPart() || o.hasImaginaryPart()) return false; if(isZero()) { if(allow_zero && o.isNonNegative()) { clear(); setPrecisionAndApproximateFrom(o); return true; } if(o.isZero()) return false; if(o.isPositive()) { clear(); setPrecisionAndApproximateFrom(o); return true; } } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(o.isFloatingPoint()) { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval() && !o.isInterval()) { mpfr_atan2(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { int sgn_l = mpfr_sgn(fl_value); int sgn_u = mpfr_sgn(fu_value); if(!allow_zero && !o.isNonZero() && (sgn_l != sgn_u || sgn_l == 0)) {set(nr_bak); return false;} int sgn_lo = mpfr_sgn(o.internalLowerFloat()); int sgn_uo = mpfr_sgn(o.internalUpperFloat()); if(sgn_lo < 0) { if(sgn_u >= 0) { if(sgn_l < 0) { mpfr_const_pi(fu_value, MPFR_RNDD); mpfr_neg(fu_value, fu_value, MPFR_RNDD); } else if(sgn_uo >= 0) { if(sgn_l == 0) mpfr_set_zero(fu_value, 0); else mpfr_atan2(fu_value, fl_value, o.internalUpperFloat(), MPFR_RNDD); } else { mpfr_atan2(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDD); } if(sgn_l <= 0) mpfr_const_pi(fl_value, MPFR_RNDU); else mpfr_atan2(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDU); mpfr_swap(fl_value, fu_value); } else { mpfr_atan2(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDU); mpfr_atan2(fu_value, fu_value, o.internalLowerFloat(), MPFR_RNDD); mpfr_swap(fl_value, fu_value); } } else { if(sgn_u >= 0) { if(sgn_u == 0) mpfr_set_zero(fu_value, 0); else mpfr_atan2(fu_value, fu_value, o.internalLowerFloat(), MPFR_RNDU); if(sgn_l == 0) mpfr_set_zero(fl_value, 0); else if(sgn_l < 0) mpfr_atan2(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDD); else mpfr_atan2(fl_value, fl_value, o.internalUpperFloat(), MPFR_RNDD); } else { mpfr_atan2(fl_value, fl_value, o.internalLowerFloat(), MPFR_RNDD); mpfr_atan2(fu_value, fu_value, o.internalUpperFloat(), MPFR_RNDU); } } } } else { if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_t of_value; mpfr_init2(of_value, BIT_PRECISION); if(o.isPlusInfinity()) mpfr_set_inf(of_value, 1); else if(o.isMinusInfinity()) mpfr_set_inf(of_value, -1); else mpfr_set_q(of_value, o.internalRational(), MPFR_RNDN); mpfr_atan2(fl_value, fl_value, of_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); mpfr_clear(of_value); } else { Number nr_o(o); if(!nr_o.setToFloatingPoint() || !atan2(nr_o)) return false; return true; } } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::arg() { if(!isNonZero()) return false; if(!hasImaginaryPart()) { if(isNegative()) { pi(); } else { clear(true); } return true; } if(!hasRealPart()) { bool b_neg = i_value->isNegative(); pi(); multiply(nr_half); if(b_neg) negate(); return true; } Number *i_value2 = i_value; i_value = NULL; if(!i_value2->atan2(*this)) { i_value = i_value2; return false; } set(*i_value2); delete i_value2; return true; } bool Number::tanh() { if(isPlusInfinity()) {set(1, 1, 0, true); return true;} if(isMinusInfinity()) {set(-1, 1, 0, true); return true;} if(isZero()) return true; if(hasImaginaryPart()) { if(hasRealPart()) { Number t1a, t1b, t2a, t2b; t1a.set(*this, false, true); t1b.set(*this, false); t1b.clearReal(); if(!t1a.tanh() || !t1b.tanh()) return false; t2a.set(t1a); t2b.set(t1b); if(!t1a.add(t1b) || !t2a.multiply(t2b) || !t2a.add(1) || !t1a.divide(t2a)) return false; if(t1a.isInterval(false) && t1a.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("Interval calculated wide."), NULL); set(t1a, true); return true; } else { if(!i_value->tan()) return false; setPrecisionAndApproximateFrom(*i_value); return true; } } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_tanh(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_tanh(fl_value, fl_value, MPFR_RNDD); mpfr_tanh(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::atanh() { if(isZero()) return true; if(isOne()) { if(b_imag) return false; setPlusInfinity(); return true; } if(isMinusOne()) { if(b_imag) return false; setMinusInfinity(); return true; } if(hasImaginaryPart() || !isLessThanOrEqualTo(1) || !isGreaterThanOrEqualTo(-1)) { if(b_imag) return false; if(!hasImaginaryPart()) { Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); Number i_nr; i_nr.markAsImaginaryPart(); int cmp1u = mpfr_cmp_si(fu_value, 1); int cmp1l = mpfr_cmp_si(fl_value, 1); int cmp0u = mpfr_sgn(fu_value); int cmp0l = mpfr_sgn(fl_value); int cmpm1u = mpfr_cmp_si(fu_value, -1); int cmpm1l = mpfr_cmp_si(fl_value, -1); if(cmp1u > 0) { i_nr.pi(); if(!i_nr.multiply(nr_minus_half)) {set(nr_bak); return false;} if(cmpm1l < 0) { Number nr; nr.pi(); if(!nr.multiply(nr_half) || !i_nr.setInterval(i_nr, nr)) {set(nr_bak); return false;} } else if(cmp1l <= 0) { if(!i_nr.setInterval(i_nr, nr_zero)) {set(nr_bak); return false;} } } else { i_nr.pi(); if(!i_nr.multiply(nr_half)) {set(nr_bak); return false;} if(cmp1u > 0) { Number nr; nr.pi(); if(!nr.multiply(nr_minus_half) || !i_nr.setInterval(nr, i_nr)) {set(nr_bak); return false;} } else if(cmpm1u >= 0) { if(!i_nr.setInterval(nr_zero, i_nr)) {set(nr_bak); return false;} } } if((cmp1u >= 0 && cmp1l >= 0) || (cmpm1u <= 0 && cmpm1l <= 0)) { if(!recip() || !atanh()) {set(nr_bak); return false;} } else if(cmp1u >= 0 && cmpm1l <= 0) { mpfr_set_inf(fl_value, -1); mpfr_set_inf(fu_value, 1); } else if(cmp1u <= 0) { if(cmp0u < 0) { mpfr_ui_div(fl_value, 1, fl_value, MPFR_RNDU); if(mpfr_cmp(fl_value, fu_value) > 0) { mpfr_swap(fl_value, fu_value); } } mpfr_atanh(fu_value, fu_value, MPFR_RNDU); mpfr_set_inf(fl_value, -1); } else { if(cmp0l > 0) { mpfr_ui_div(fu_value, 1, fu_value, MPFR_RNDD); if(mpfr_cmp(fu_value, fl_value) < 0) { mpfr_swap(fl_value, fu_value); } } mpfr_atanh(fl_value, fl_value, MPFR_RNDD); mpfr_set_inf(fu_value, 1); } if(!i_value) {i_value = new Number(i_nr); i_value->markAsImaginaryPart();} else i_value->set(i_nr, true); setPrecisionAndApproximateFrom(*i_value); if(!testFloatResult()) { set(nr_bak); return false; } return true; } else if(!hasRealPart()) { Number inr(*i_value); if(!inr.atan() || !inr.multiply(nr_one_i)) return false; set(inr, true); return true; } Number ipz(nr_one), imz(nr_one); if(!ipz.add(*this) || !imz.subtract(*this) || !ipz.ln() || !imz.ln() || !imz.negate() || !ipz.add(imz) || !ipz.divide(2)) return false; if(ipz.isInterval(false) && ipz.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("Interval calculated wide."), NULL); set(ipz); return true; } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { if(mpfr_cmp_si(fl_value, -1) == 0) mpfr_set_inf(fl_value, -1); else if(mpfr_cmp_si(fl_value, 1) == 0) mpfr_set_inf(fl_value, 1); else mpfr_atanh(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { if(mpfr_cmp_si(fl_value, -1) == 0) mpfr_set_inf(fl_value, -1); else if(mpfr_cmp_si(fl_value, 1) == 0) mpfr_set_inf(fl_value, 1); else mpfr_atanh(fl_value, fl_value, MPFR_RNDD); if(mpfr_cmp_si(fu_value, -1) == 0) mpfr_set_inf(fu_value, -1); else if(mpfr_cmp_si(fu_value, 1) == 0) mpfr_set_inf(fu_value, 1); else mpfr_atanh(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::ln() { if(isPlusInfinity()) return true; if(isMinusInfinity()) { n_type = NUMBER_TYPE_PLUS_INFINITY; if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->pi(); return true; } if(isOne()) { clear(true); return true; } if(isZero()) { if(b_imag) return false; setMinusInfinity(); return true; } if(hasImaginaryPart()) { Number new_i(*i_value); Number new_r(*this); Number this_r; this_r.set(*this, false, true); if(!new_i.atan2(this_r, true) || !new_r.abs() || new_i.hasImaginaryPart()) return false; if(new_r.hasImaginaryPart() || !new_r.ln()) return false; set(new_r); setImaginaryPart(new_i); testComplex(this, i_value); return true; } else if(isNonPositive()) { if(b_imag) return false; Number new_r(*this); if(!new_r.abs() || !new_r.ln()) return false; set(new_r); if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->pi(); testComplex(this, i_value); return true; } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_log(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { if(mpfr_sgn(fl_value) < 0) { if(mpfr_cmpabs(fl_value, fu_value) > 0) { mpfr_neg(fu_value, fl_value, MPFR_RNDU); } mpfr_set_inf(fl_value, -1); mpfr_log(fu_value, fu_value, MPFR_RNDU); if(!i_value) {i_value = new Number(); i_value->markAsImaginaryPart();} i_value->pi(); i_value->setInterval(nr_zero, *i_value); } else { if(mpfr_zero_p(fl_value)) mpfr_set_inf(fl_value, -1); else mpfr_log(fl_value, fl_value, MPFR_RNDD); mpfr_log(fu_value, fu_value, MPFR_RNDU); } } if(!testFloatResult(true)) { set(nr_bak); return false; } return true; } bool Number::log(const Number &o) { if(isOne() && !o.isGreaterThan(1)) { clear(true); setPrecisionAndApproximateFrom(o); return true; } if(o.isOne()) return false; if(o.isRational() && o == 2 && isReal() && isPositive()) { Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_log2(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_log2(fl_value, fl_value, MPFR_RNDD); mpfr_log2(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult(true)) { set(nr_bak); return false; } setPrecisionAndApproximateFrom(o); return true; } else if(o.isRational() && o == 10 && isReal() && isPositive()) { Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_log10(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_log10(fl_value, fl_value, MPFR_RNDD); mpfr_log10(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult(true)) { set(nr_bak); return false; } setPrecisionAndApproximateFrom(o); return true; } Number num(*this); Number den(o); if(!num.ln() || !den.ln() || !den.recip() || !num.multiply(den)) return false; if(b_imag && num.hasImaginaryPart()) return false; set(num); return true; } bool Number::exp() { if(isPlusInfinity()) return true; if(isMinusInfinity()) { clear(); return true; } if(hasImaginaryPart()) { Number e_base; e_base.e(); if(!e_base.raise(*this)) return false; set(e_base); return true; } Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_exp(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_exp(fu_value, fu_value, MPFR_RNDU); mpfr_exp(fl_value, fl_value, MPFR_RNDD); } if(!testFloatResult(true)) { set(nr_bak); return false; } return true; } bool Number::lambertW() { if(!isReal()) return false; if(isZero()) return true; if(isInterval()) { Number nr_l, nr_u; nr_l.setInternal(fl_value); nr_u.setInternal(fu_value); nr_l.intervalToPrecision(); nr_u.intervalToPrecision(); if(!nr_l.lambertW() || !nr_u.lambertW()) return false; setPrecisionAndApproximateFrom(nr_l); setPrecisionAndApproximateFrom(nr_u); return setInterval(nr_l, nr_u, true); } Number nr_bak(*this); mpfr_clear_flags(); mpfr_t x, m1_div_exp1; mpfr_inits2(BIT_PRECISION, x, m1_div_exp1, NULL); if(n_type == NUMBER_TYPE_RATIONAL) mpfr_set_q(x, r_value, MPFR_RNDN); else mpfr_set(x, fl_value, MPFR_RNDN); mpfr_set_ui(m1_div_exp1, 1, MPFR_RNDN); mpfr_exp(m1_div_exp1, m1_div_exp1, MPFR_RNDN); mpfr_ui_div(m1_div_exp1, 1, m1_div_exp1, MPFR_RNDN); mpfr_neg(m1_div_exp1, m1_div_exp1, MPFR_RNDN); int cmp = mpfr_cmp(x, m1_div_exp1); if(cmp == 0) { mpfr_clears(x, m1_div_exp1, NULL); if(!CALCULATOR->usesIntervalArithmetic()) { set(-1, 1); b_approx = true; i_precision = PRECISION; return true; } else { mpfr_set_ui(fl_value, -1, MPFR_RNDD); mpfr_set_ui(fu_value, -1, MPFR_RNDU); } } else if(cmp < 0) { mpfr_clears(x, m1_div_exp1, NULL); set(nr_bak); return false; } else { mpfr_t w; mpfr_init2(w, BIT_PRECISION); mpfr_set_zero(w, 0); cmp = mpfr_cmp_ui(x, 10); if(cmp > 0) { mpfr_log(w, x, MPFR_RNDN); mpfr_t wln; mpfr_init2(wln, BIT_PRECISION); mpfr_log(wln, w, MPFR_RNDN); mpfr_sub(w, w, wln, MPFR_RNDN); mpfr_clear(wln); } mpfr_t wPrec, wTimesExpW, wPlusOneTimesExpW, testXW, tmp1, tmp2; mpfr_inits2(BIT_PRECISION, wPrec, wTimesExpW, wPlusOneTimesExpW, testXW, tmp1, tmp2, NULL); mpfr_set_si(wPrec, -(BIT_PRECISION - 30), MPFR_RNDN); mpfr_exp2(wPrec, wPrec, MPFR_RNDN); while(true) { if(CALCULATOR->aborted() || testErrors()) { mpfr_clears(x, m1_div_exp1, w, wPrec, wTimesExpW, wPlusOneTimesExpW, testXW, tmp1, tmp2, NULL); set(nr_bak); return false; } mpfr_exp(wTimesExpW, w, MPFR_RNDN); mpfr_set(wPlusOneTimesExpW, wTimesExpW, MPFR_RNDN); mpfr_mul(wTimesExpW, wTimesExpW, w, MPFR_RNDN); mpfr_add(wPlusOneTimesExpW, wPlusOneTimesExpW, wTimesExpW, MPFR_RNDN); mpfr_sub(testXW, x, wTimesExpW, MPFR_RNDN); mpfr_div(testXW, testXW, wPlusOneTimesExpW, MPFR_RNDN); mpfr_abs(testXW, testXW, MPFR_RNDN); if(mpfr_cmp(wPrec, testXW) > 0) { break; } mpfr_sub(wTimesExpW, wTimesExpW, x, MPFR_RNDN); mpfr_add_ui(tmp1, w, 2, MPFR_RNDN); mpfr_mul(tmp2, wTimesExpW, tmp1, MPFR_RNDN); mpfr_mul_ui(tmp1, w, 2, MPFR_RNDN); mpfr_add_ui(tmp1, tmp1, 2, MPFR_RNDN); mpfr_div(tmp2, tmp2, tmp1, MPFR_RNDN); mpfr_sub(wPlusOneTimesExpW, wPlusOneTimesExpW, tmp2, MPFR_RNDN); mpfr_div(wTimesExpW, wTimesExpW, wPlusOneTimesExpW, MPFR_RNDN); mpfr_sub(w, w, wTimesExpW, MPFR_RNDN); } if(n_type == NUMBER_TYPE_RATIONAL) { mpfr_init2(fl_value, BIT_PRECISION); mpfr_init2(fu_value, BIT_PRECISION); n_type = NUMBER_TYPE_FLOAT; mpq_set_ui(r_value, 0, 1); } mpfr_set(fl_value, w, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); mpfr_clears(x, m1_div_exp1, w, wPrec, wTimesExpW, wPlusOneTimesExpW, testXW, tmp1, tmp2, NULL); if(i_precision < 0 || i_precision > PRECISION) i_precision = FROM_BIT_PRECISION(BIT_PRECISION - 30); if(CALCULATOR->usesIntervalArithmetic()) { precisionToInterval(); } } if(!testFloatResult(true)) { set(nr_bak); return false; } b_approx = true; return true; } bool Number::gcd(const Number &o) { if(!isInteger() || !o.isInteger()) { return false; } if(isZero() && o.isZero()) { clear(); return true; } mpz_gcd(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); setPrecisionAndApproximateFrom(o); return true; } bool Number::lcm(const Number &o) { if(isInteger() && o.isInteger()) { mpz_lcm(mpq_numref(r_value), mpq_numref(r_value), mpq_numref(o.internalRational())); return true; } return multiply(o); } bool Number::polylog(const Number &o) { if(isZero()) return true; if(!o.isTwo() || !isLessThanOrEqualTo(1)) return false; Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_li2(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_li2(fl_value, fl_value, MPFR_RNDD); mpfr_li2(fu_value, fu_value, MPFR_RNDU); } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::igamma(const Number &o) { #if MPFR_VERSION_MAJOR < 4 return false; #else if(!isReal() || (!o.isNonZero() && !isNonZero())) return false; Number nr_bak(*this); if(!setToFloatingPoint()) return false; Number o_float(o); if(!o_float.setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval() && !o_float.isInterval()) { mpfr_gamma_inc(fl_value, fl_value, o_float.internalLowerFloat(), MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { mpfr_gamma_inc(fl_value, fl_value, o_float.internalUpperFloat(), MPFR_RNDD); mpfr_gamma_inc(fu_value, fu_value, o_float.internalLowerFloat(), MPFR_RNDU); if(!o.isGreaterThanOrEqualTo(1) && !nr_bak.isGreaterThan(2) && nr_bak.isInterval() && nr_bak.precision(1) <= PRECISION + 20) CALCULATOR->error(false, _("%s() lacks proper support interval arithmetic."), CALCULATOR->f_igamma->name().c_str(), NULL); } if(!testFloatResult()) { set(nr_bak); return false; } return true; #endif } bool Number::expint() { if(!isReal()) return false; Number nr_bak(*this); if(!setToFloatingPoint()) return false; mpfr_clear_flags(); if(!CALCULATOR->usesIntervalArithmetic() && !isInterval()) { mpfr_eint(fl_value, fl_value, MPFR_RNDN); mpfr_set(fu_value, fl_value, MPFR_RNDN); } else { if(mpfr_sgn(fl_value) < 0) { if(mpfr_sgn(fu_value) > 0) { mpfr_eint(fl_value, fl_value, MPFR_RNDU); mpfr_eint(fu_value, fu_value, MPFR_RNDU); if(mpfr_cmp(fl_value, fu_value) > 0) mpfr_swap(fl_value, fu_value); mpfr_set_inf(fl_value, -1); } else { mpfr_eint(fl_value, fl_value, MPFR_RNDU); mpfr_eint(fu_value, fu_value, MPFR_RNDD); mpfr_swap(fl_value, fu_value); } } else { mpfr_eint(fl_value, fl_value, MPFR_RNDD); mpfr_eint(fu_value, fu_value, MPFR_RNDU); } } if(!testFloatResult()) { set(nr_bak); return false; } return true; } bool Number::logint() { if(isZero()) return true; Number nr_bak(*this); if(!ln() || !expint()) { set(nr_bak); return false; } return true; } bool Number::sinint() {return false;} bool Number::sinhint() {return false;} bool Number::cosint() {return false;} bool Number::coshint() {return false;} bool recfact(mpz_ptr ret, long int start, long int n) { long int i; if(n <= 16) { mpz_set_si(ret, start); for(i = start + 1; i < start + n; i++) mpz_mul_si(ret, ret, i); return true; } if(CALCULATOR->aborted()) return false; i = n / 2; if(!recfact(ret, start, i)) return false; mpz_t retmul; mpz_init(retmul); if(!recfact(retmul, start + i, n - i)) return false; mpz_mul(ret, ret, retmul); mpz_clear(retmul); return true; } bool recfact2(mpz_ptr ret, long int start, long int n) { long int i; if(n <= 32) { mpz_set_si(ret, start + n - 1); for(i = start + n - 3; i >= start; i -= 2) mpz_mul_si(ret, ret, i); return true; } if(CALCULATOR->aborted()) return false; i = n / 2; if(n % 2 != i % 2) i--; if(!recfact2(ret, start, i)) return false; mpz_t retmul; mpz_init(retmul); if(!recfact2(retmul, start + i, n - i)) return false; mpz_mul(ret, ret, retmul); mpz_clear(retmul); return true; } bool recfactm(mpz_ptr ret, long int start, long int n, long int m) { long int i; if(n <= 16 * m) { mpz_set_si(ret, start + n - 1); for(i = start + n - 1 - m; i >= start; i -= m) mpz_mul_si(ret, ret, i); return true; } if(CALCULATOR->aborted()) return false; i = n / 2; i -= ((i % m) - (n % m)); if(!recfactm(ret, start, i, m)) return false; mpz_t retmul; mpz_init(retmul); if(!recfactm(retmul, start + i, n - i, m)) return false; mpz_mul(ret, ret, retmul); mpz_clear(retmul); return true; } bool Number::factorial() { if(!isInteger()) { return false; } if(isNegative()) { /*if(b_imag) return false; setPlusInfinity(); return true;*/ return false; } if(isZero()) { set(1); return true; } else if(isOne()) { return true; } else if(isNegative()) { return false; } if(!mpz_fits_slong_p(mpq_numref(r_value))) return false; long int n = mpz_get_si(mpq_numref(r_value)); if(!recfact(mpq_numref(r_value), 1, n)) { mpz_set_si(mpq_numref(r_value), n); return false; } return true; } bool Number::multiFactorial(const Number &o) { if(!isInteger() || !o.isInteger() || !o.isPositive()) { return false; } if(isZero()) { set(1, 1); return true; } else if(isOne()) { return true; } else if(isNegative()) { return false; } if(!mpz_fits_slong_p(mpq_numref(r_value)) || !mpz_fits_slong_p(mpq_numref(o.internalRational()))) return false; long int n = mpz_get_si(mpq_numref(r_value)); long int m = mpz_get_si(mpq_numref(o.internalRational())); if(!recfactm(mpq_numref(r_value), 1, n, m)) { mpz_set_si(mpq_numref(r_value), n); return false; } return true; } bool Number::doubleFactorial() { if(!isInteger()) { return false; } if(isZero() || isMinusOne()) { set(1, 1); return true; } else if(isOne()) { return true; } else if(isNegative()) { return false; } if(!mpz_fits_slong_p(mpq_numref(r_value))) return false; unsigned long int n = mpz_get_si(mpq_numref(r_value)); if(!recfact2(mpq_numref(r_value), 1, n)) { mpz_set_si(mpq_numref(r_value), n); return false; } return true; } bool Number::binomial(const Number &m, const Number &k) { if(!m.isInteger() || !k.isInteger()) return false; if(m.isNegative()) { if(k.isNegative()) return false; Number m2(m); if(!m2.negate() || !m2.add(k) || !m2.add(nr_minus_one) || !binomial(m2, k)) return false; if(k.isOdd()) negate(); return true; } if(k.isNegative() || k.isGreaterThan(m)) { clear(); return true; } if(m.isZero() || m.equals(k)) { set(1, 1, 0); return true; } if(!mpz_fits_ulong_p(mpq_numref(k.internalRational()))) return false; clear(); mpz_bin_ui(mpq_numref(r_value), mpq_numref(m.internalRational()), mpz_get_ui(mpq_numref(k.internalRational()))); return true; } bool Number::factorize(vector &factors) { if(isZero() || !isInteger()) return false; if(mpz_cmp_si(mpq_numref(r_value), 1) == 0) { factors.push_back(nr_one); return true; } if(mpz_cmp_si(mpq_numref(r_value), -1) == 0) { factors.push_back(nr_minus_one); return true; } mpz_t inr, last_prime, facmax; mpz_inits(inr, last_prime, facmax, NULL); mpz_set(inr, mpq_numref(r_value)); if(mpz_sgn(inr) < 0) { mpz_neg(inr, inr); factors.push_back(nr_minus_one); } size_t prime_index = 0; bool b = true; while(b) { if(CALCULATOR->aborted()) {mpz_clears(inr, last_prime, facmax, NULL); return false;} b = false; mpz_sqrt(facmax, inr); for(; prime_index < NR_OF_PRIMES && mpz_cmp_si(facmax, PRIMES[prime_index]) >= 0; prime_index++) { if(mpz_divisible_ui_p(inr, (unsigned long int) PRIMES[prime_index])) { mpz_divexact_ui(inr, inr, (unsigned long int) PRIMES[prime_index]); Number fac(PRIMES[prime_index], 1);; factors.push_back(fac); b = true; break; } } if(prime_index == NR_OF_PRIMES) { mpz_set_si(last_prime, PRIMES[NR_OF_PRIMES - 1] + 2); prime_index++; } if(!b && prime_index > NR_OF_PRIMES) { while(!b && mpz_cmp(facmax, last_prime) >= 0) { if(CALCULATOR->aborted()) {mpz_clears(inr, last_prime, facmax, NULL); return false;} if(mpz_divisible_p(inr, last_prime)) { mpz_divexact(inr, inr, last_prime); b = true; Number fac; fac.setInternal(last_prime); factors.push_back(fac); break; } mpz_add_ui(last_prime, last_prime, 2); } } } if(mpz_cmp_si(mpq_numref(r_value), 1) != 0) { Number fac; fac.setInternal(inr); factors.push_back(fac); } mpz_clears(inr, last_prime, facmax, NULL); return true; } void Number::rand() { if(n_type != NUMBER_TYPE_FLOAT) { mpfr_inits2(BIT_PRECISION, fl_value, fu_value, NULL); mpq_set_ui(r_value, 0, 1); n_type = NUMBER_TYPE_FLOAT; } mpfr_urandom(fu_value, randstate, MPFR_RNDN); mpfr_set(fl_value, fu_value, MPFR_RNDN); b_approx = false; i_precision = -1; } void Number::intRand(const Number &ceil) { clear(); if(!ceil.isInteger() || !ceil.isPositive()) return; mpz_urandomm(mpq_numref(r_value), randstate, mpq_numref(ceil.internalRational())); } bool Number::add(const Number &o, MathOperation op) { switch(op) { case OPERATION_SUBTRACT: { return subtract(o); } case OPERATION_ADD: { return add(o); } case OPERATION_MULTIPLY: { return multiply(o); } case OPERATION_DIVIDE: { return divide(o); } case OPERATION_RAISE: { return raise(o); } case OPERATION_EXP10: { return exp10(o); } case OPERATION_BITWISE_AND: { return bitAnd(o); } case OPERATION_BITWISE_OR: { return bitOr(o); } case OPERATION_BITWISE_XOR: { return bitXor(o); } case OPERATION_LOGICAL_OR: { Number nr; ComparisonResult i1 = compare(nr); ComparisonResult i2 = o.compare(nr); if(i1 >= COMPARISON_RESULT_UNKNOWN || i1 == COMPARISON_RESULT_EQUAL_OR_LESS || i1 == COMPARISON_RESULT_NOT_EQUAL) i1 = COMPARISON_RESULT_UNKNOWN; if(i2 >= COMPARISON_RESULT_UNKNOWN || i2 == COMPARISON_RESULT_EQUAL_OR_LESS || i2 == COMPARISON_RESULT_NOT_EQUAL) i2 = COMPARISON_RESULT_UNKNOWN; if(i1 >= COMPARISON_RESULT_UNKNOWN && (i2 == COMPARISON_RESULT_UNKNOWN || i2 != COMPARISON_RESULT_LESS)) return false; if(i2 >= COMPARISON_RESULT_UNKNOWN && (i1 != COMPARISON_RESULT_LESS)) return false; setTrue(i1 == COMPARISON_RESULT_LESS || i2 == COMPARISON_RESULT_LESS); return true; } case OPERATION_LOGICAL_XOR: { Number nr; ComparisonResult i1 = compare(nr); ComparisonResult i2 = o.compare(nr); if(i1 >= COMPARISON_RESULT_UNKNOWN || i1 == COMPARISON_RESULT_EQUAL_OR_LESS || i1 == COMPARISON_RESULT_NOT_EQUAL) return false; if(i2 >= COMPARISON_RESULT_UNKNOWN || i2 == COMPARISON_RESULT_EQUAL_OR_LESS || i2 == COMPARISON_RESULT_NOT_EQUAL) return false; if(i1 == COMPARISON_RESULT_LESS) setTrue(i2 != COMPARISON_RESULT_LESS); else setTrue(i2 == COMPARISON_RESULT_LESS); return true; } case OPERATION_LOGICAL_AND: { Number nr; ComparisonResult i1 = compare(nr); ComparisonResult i2 = o.compare(nr); if(i1 >= COMPARISON_RESULT_UNKNOWN || i1 == COMPARISON_RESULT_EQUAL_OR_LESS || i1 == COMPARISON_RESULT_NOT_EQUAL) i1 = COMPARISON_RESULT_UNKNOWN; if(i2 >= COMPARISON_RESULT_UNKNOWN || i2 == COMPARISON_RESULT_EQUAL_OR_LESS || i2 == COMPARISON_RESULT_NOT_EQUAL) i2 = COMPARISON_RESULT_UNKNOWN; if(i1 >= COMPARISON_RESULT_UNKNOWN && (i2 == COMPARISON_RESULT_UNKNOWN || i2 == COMPARISON_RESULT_LESS)) return false; if(i2 >= COMPARISON_RESULT_UNKNOWN && (i1 == COMPARISON_RESULT_LESS)) return false; setTrue(i1 == COMPARISON_RESULT_LESS && i2 == COMPARISON_RESULT_LESS); return true; } case OPERATION_EQUALS: { ComparisonResult i = compare(o); if(i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_GREATER || i == COMPARISON_RESULT_EQUAL_OR_LESS) return false; setTrue(i == COMPARISON_RESULT_EQUAL); return true; } case OPERATION_GREATER: { ComparisonResult i = compare(o); switch(i) { case COMPARISON_RESULT_LESS: { setTrue(); return true; } case COMPARISON_RESULT_GREATER: {} case COMPARISON_RESULT_EQUAL_OR_GREATER: {} case COMPARISON_RESULT_EQUAL: { setFalse(); return true; } default: { return false; } } } case OPERATION_LESS: { ComparisonResult i = compare(o); switch(i) { case COMPARISON_RESULT_GREATER: { setTrue(); return true; } case COMPARISON_RESULT_LESS: {} case COMPARISON_RESULT_EQUAL_OR_LESS: {} case COMPARISON_RESULT_EQUAL: { setFalse(); return true; } default: { return false; } } } case OPERATION_EQUALS_GREATER: { ComparisonResult i = compare(o); switch(i) { case COMPARISON_RESULT_EQUAL_OR_LESS: {} case COMPARISON_RESULT_EQUAL: {} case COMPARISON_RESULT_LESS: { setTrue(); return true; } case COMPARISON_RESULT_GREATER: { setFalse(); return true; } default: { return false; } } return false; } case OPERATION_EQUALS_LESS: { ComparisonResult i = compare(o); switch(i) { case COMPARISON_RESULT_EQUAL_OR_GREATER: {} case COMPARISON_RESULT_EQUAL: {} case COMPARISON_RESULT_GREATER: { setTrue(); return true; } case COMPARISON_RESULT_LESS: { setFalse(); return true; } default: { return false; } } return false; } case OPERATION_NOT_EQUALS: { ComparisonResult i = compare(o); if(i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_GREATER || i == COMPARISON_RESULT_EQUAL_OR_LESS) return false; setTrue(i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_GREATER || i == COMPARISON_RESULT_LESS); return true; } } return false; } string Number::printNumerator(int base, bool display_sign, BaseDisplay base_display, bool lower_case) const { return format_number_string(printMPZ(mpq_numref(r_value), base, false, lower_case), base, base_display, display_sign); } string Number::printDenominator(int base, bool display_sign, BaseDisplay base_display, bool lower_case) const { return format_number_string(printMPZ(mpq_denref(r_value), base, false, lower_case), base, base_display, display_sign); } string Number::printImaginaryNumerator(int base, bool display_sign, BaseDisplay base_display, bool lower_case) const { return format_number_string(printMPZ(mpq_numref(i_value ? i_value->internalRational() : nr_zero.internalRational()), base, false, lower_case), base, base_display, display_sign); } string Number::printImaginaryDenominator(int base, bool display_sign, BaseDisplay base_display, bool lower_case) const { return format_number_string(printMPZ(mpq_denref(i_value ? i_value->internalRational() : nr_zero.internalRational()), base, false, lower_case), base, base_display, display_sign); } ostream& operator << (ostream &os, const Number &nr) { os << nr.print(); return os; } string Number::print(const PrintOptions &po, const InternalPrintStruct &ips) const { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(ips.minus) *ips.minus = false; if(ips.exp_minus) *ips.exp_minus = false; if(ips.num) *ips.num = ""; if(ips.den) *ips.den = ""; if(ips.exp) *ips.exp = ""; if(ips.re) *ips.re = ""; if(ips.im) *ips.im = ""; if(ips.iexp) *ips.iexp = 0; if(po.is_approximate && isApproximate()) *po.is_approximate = true; if((po.base == BASE_SEXAGESIMAL || po.base == BASE_TIME) && isReal()) { Number nr(*this); bool neg = nr.isNegative(); nr.setNegative(false); nr.trunc(); PrintOptions po2 = po; po2.base = 10; po2.number_fraction_format = FRACTION_FRACTIONAL; string str = nr.print(po2); if(po.base == BASE_SEXAGESIMAL) { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DEGREE, po.can_display_unicode_string_arg))) { str += SIGN_DEGREE; } else { str += "o"; } } nr = *this; nr.frac(); nr *= 60; Number nr2(nr); nr.trunc(); if(po.base == BASE_TIME) { str += ":"; if(nr.isLessThan(10)) { str += "0"; } } str += nr.printNumerator(10, false); if(po.base == BASE_SEXAGESIMAL) { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) ("′", po.can_display_unicode_string_arg))) { str += "′"; } else { str += "'"; } } nr2.frac(); if(!nr2.isZero() || po.base == BASE_SEXAGESIMAL) { nr2.multiply(60); nr = nr2; nr.trunc(); nr2.frac(); if(!nr2.isZero()) { if(po.is_approximate) *po.is_approximate = true; if(nr2.isGreaterThanOrEqualTo(nr_half)) { nr.add(1); } } if(po.base == BASE_TIME) { str += ":"; if(nr.isLessThan(10)) { str += "0"; } } str += nr.printNumerator(10, false); if(po.base == BASE_SEXAGESIMAL) { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) ("″", po.can_display_unicode_string_arg))) { str += "″"; } else { str += "\""; } } } if(ips.minus) { *ips.minus = neg; } else if(neg) { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MINUS, po.can_display_unicode_string_arg))) str.insert(0, SIGN_MINUS); else str.insert(0, "-"); } if(ips.num) *ips.num = str; return str; } string str; int base; long int min_decimals = 0; if(po.use_min_decimals && po.min_decimals > 0) min_decimals = po.min_decimals; if((int) min_decimals > po.max_decimals && po.use_max_decimals && po.max_decimals >= 0) { min_decimals = po.max_decimals; } if(po.base <= 1 && po.base != BASE_ROMAN_NUMERALS && po.base != BASE_TIME) base = 10; else if(po.base > 36 && po.base != BASE_SEXAGESIMAL) base = 36; else base = po.base; if(po.base == BASE_ROMAN_NUMERALS) { if(!isRational()) { CALCULATOR->error(false, _("Can only display rational numbers as roman numerals."), NULL); base = 10; } else if(mpz_cmpabs_ui(mpq_numref(r_value), 9999) > 0 || mpz_cmp_ui(mpq_denref(r_value), 9999) > 0) { CALCULATOR->error(false, _("Cannot display numbers greater than 9999 or less than -9999 as roman numerals."), NULL); base = 10; } } if(hasImaginaryPart()) { if(i_value->isZero()) { Number nr; nr.set(*this, false, true); return nr.print(po, ips); } bool bre = hasRealPart(); if(bre) { Number r_nr(*this); r_nr.clearImaginary(); str = r_nr.print(po, ips); if(ips.re) *ips.re = str; InternalPrintStruct ips_n = ips; bool neg = false; ips_n.minus = &neg; string str2 = i_value->print(po, ips_n); if(ips.im) *ips.im = str2; if(!po.short_multiplication && str2 != "1") { if(po.spacious) { str2 += " * "; } else { str2 += "*"; } } if(str2 == "1") str2 = "i"; else str2 += "i"; if(*ips_n.minus) { str += " - "; } else { str += " + "; } str += str2; } else { str = i_value->print(po, ips); if(ips.im) *ips.im = str; if(!po.short_multiplication && str != "1") { if(po.spacious) { str += " * "; } else { str += "*"; } } if(str == "1") str = "i"; else str += "i"; } if(ips.num) *ips.num = str; return str; } long int precision = PRECISION; if(b_approx && i_precision >= 0 && (po.preserve_precision || po.preserve_format || i_precision < PRECISION)) precision = i_precision; else if(b_approx && i_precision < 0 && po.preserve_precision && FROM_BIT_PRECISION(BIT_PRECISION) > precision) precision = FROM_BIT_PRECISION(BIT_PRECISION); else if(b_approx && i_precision < 0 && po.preserve_format && FROM_BIT_PRECISION(BIT_PRECISION) - 1 > precision) precision = FROM_BIT_PRECISION(BIT_PRECISION) - 1; if(po.restrict_to_parent_precision && ips.parent_precision >= 0 && ips.parent_precision < precision) precision = ips.parent_precision; long int precision_base = precision; if(base != 10 && base >= 2 && base <= 36) { Number precmax(10); precmax.raise(precision_base); precmax--; precmax.log(base); precmax.floor(); precision_base = precmax.lintValue(); } long int i_precision_base = precision_base; if((i_precision < 0 && FROM_BIT_PRECISION(BIT_PRECISION) > precision) || i_precision > precision) { if(i_precision < 0) i_precision_base = FROM_BIT_PRECISION(BIT_PRECISION); else i_precision_base = i_precision; if(po.restrict_to_parent_precision && ips.parent_precision >= 0 && ips.parent_precision < i_precision_base) i_precision_base = ips.parent_precision; if(base != 10 && base >= 2 && base <= 36) { Number precmax(10); precmax.raise(i_precision_base); precmax--; precmax.log(base); precmax.floor(); i_precision_base = precmax.lintValue(); } } bool approx = isApproximate() || (ips.parent_approximate && po.restrict_to_parent_precision); if(isInteger()) { long int length = mpz_sizeinbase(mpq_numref(r_value), base); if(precision_base + min_decimals + 1000 + ::abs(po.min_exp) < length && ((approx || (base == 10 && po.min_exp != 0 && (po.restrict_fraction_length || po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT))) || length > (po.base == 10 ? 1000000L : 100000L))) { Number nr(*this); if(nr.setToFloatingPoint()) { PrintOptions po2 = po; po2.interval_display = INTERVAL_DISPLAY_MIDPOINT; return nr.print(po2, ips); } } if(po.base == 2) { if(po.twos_complement && isNegative()) { Number nr; unsigned int bits = po.binary_bits; if(bits == 0) { nr = *this; nr.floor(); nr++; bits = nr.integerLength() + 1; if(bits <= 8) bits = 8; else if(bits <= 16) bits = 16; else if(bits <= 32) bits = 32; else if(bits <= 64) bits = 64; else if(bits <= 128) bits = 128; else { bits = (unsigned int) ::ceil(::log2(bits)); bits = ::pow(2, bits); } } nr = bits; nr.exp2(); nr += *this; PrintOptions po2 = po; po2.twos_complement = false; if(!nr.isInteger() && po2.number_fraction_format == FRACTION_DECIMAL) { string str = print(po2); size_t i = str.find(po2.decimalpoint()); if(i != string::npos) { po2.min_decimals = str.length() - (i + po2.decimalpoint().length()); po2.max_decimals = po2.min_decimals; po2.use_max_decimals = true; po2.use_min_decimals = true; } else { po2.max_decimals = 0; po2.use_max_decimals = true; } } po2.binary_bits = bits; return nr.print(po2, ips); } else if(po.binary_bits == 0) { Number nr(*this); nr.ceil(); unsigned int bits = nr.integerLength() + 1; if(bits <= 8) bits = 8; else if(bits <= 16) bits = 16; else if(bits <= 32) bits = 32; else if(bits <= 64) bits = 64; else if(bits <= 128) bits = 128; else { bits = (unsigned int) ::ceil(::log2(bits)); bits = ::pow(2, bits); } PrintOptions po2 = po; po2.binary_bits = bits; return print(po2, ips); } } mpz_t ivalue; mpz_init_set(ivalue, mpq_numref(r_value)); bool neg = (mpz_sgn(ivalue) < 0); bool rerun = false; bool exact = true; integer_rerun: string mpz_str = printMPZ(ivalue, base, false, po.lower_case_numbers); if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); length = mpz_str.length(); long int expo = 0; if(base == 10 && !po.preserve_format) { if(length == 1 && mpz_str[0] == '0') { expo = 0; } else if(length > 0 && (po.restrict_fraction_length || po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT)) { if(po.number_fraction_format == FRACTION_FRACTIONAL) { long int precexp = i_precision_base; if(precision < 8 && precexp > precision + 2) precexp = precision + 2; else if(precexp > precision + 3) precexp = precision + 3; if(exact && ((expo >= 0 && length - 1 < precexp) || (expo < 0 && expo > -PRECISION))) expo = 0; else expo = length - 1; } else { expo = length - 1; } } else if(length > 0) { for(long int i = length - 1; i >= 0; i--) { if(mpz_str[i] != '0') { break; } expo++; } } if(po.min_exp == EXP_PRECISION) { long int precexp = i_precision_base; if(precision < 8 && precexp > precision + 2) precexp = precision + 2; else if(precexp > precision + 3) precexp = precision + 3; if(exact && ((expo >= 0 && length - 1 < precexp) || (expo < 0 && expo > -PRECISION))) { if(precision_base >= precision) precision_base = length; expo = 0; } } else if(po.min_exp < -1) { expo -= expo % (-po.min_exp); if(expo < 0) expo = 0; } else if(po.min_exp != 0) { if((long int) expo > -po.min_exp && (long int) expo < po.min_exp) { expo = 0; } } else { expo = 0; } } long int decimals = expo; long int nondecimals = length - decimals; bool dp_added = false; if(!rerun && mpz_sgn(ivalue) != 0) { long int precision2 = precision_base; if(min_decimals > 0 && min_decimals + nondecimals > precision_base) { precision2 = min_decimals + nondecimals; if(approx && precision2 > i_precision_base) precision2 = i_precision_base; } if(po.use_max_decimals && po.max_decimals >= 0 && decimals > po.max_decimals && (!approx || po.max_decimals + nondecimals < precision2) && (base == 10 && (po.restrict_fraction_length || po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT))) { mpz_t i_rem, i_quo, i_div; mpz_inits(i_rem, i_quo, i_div, NULL); mpz_ui_pow_ui(i_div, (unsigned long int) base, (unsigned long int) -(po.max_decimals - expo)); mpz_fdiv_qr(i_quo, i_rem, ivalue, i_div); if(mpz_sgn(i_rem) != 0) { mpz_set(ivalue, i_quo); mpq_t q_rem, q_base_half; mpq_inits(q_rem, q_base_half, NULL); mpz_set(mpq_numref(q_rem), i_rem); mpz_set(mpq_denref(q_rem), i_div); mpz_set_si(mpq_numref(q_base_half), base); mpq_mul(q_rem, q_rem, q_base_half); mpz_set_ui(mpq_denref(q_base_half), 2); int i_sign = mpq_cmp(q_rem, q_base_half); if(po.round_halfway_to_even && mpz_even_p(ivalue)) { if(i_sign > 0) mpz_add_ui(ivalue, ivalue, 1); } else { if(i_sign >= 0) mpz_add_ui(ivalue, ivalue, 1); } mpq_clears(q_base_half, q_rem, NULL); mpz_mul(ivalue, ivalue, i_div); exact = false; rerun = true; mpz_clears(i_rem, i_quo, i_div, NULL); goto integer_rerun; } mpz_clears(i_rem, i_quo, i_div, NULL); } else if(precision2 < length && (approx || (base == 10 && expo != 0 && (po.restrict_fraction_length || po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT)))) { mpq_t qvalue; mpq_init(qvalue); mpz_set(mpq_numref(qvalue), ivalue); precision2 = length - precision2; long int p2_cd = precision2; mpq_t q_exp; mpq_init(q_exp); long int p2_cd_min = 10000; while(p2_cd_min >= 1000) { if(p2_cd > p2_cd_min) { mpz_ui_pow_ui(mpq_numref(q_exp), (unsigned long int) base, (unsigned long int) p2_cd_min); while(p2_cd > p2_cd_min) { mpq_div(qvalue, qvalue, q_exp); p2_cd -= p2_cd_min; if(CALCULATOR->aborted()) {mpq_clears(q_exp, qvalue, NULL); mpz_clear(ivalue); return CALCULATOR->abortedMessage();} } } p2_cd_min = p2_cd_min / 10; } mpz_ui_pow_ui(mpq_numref(q_exp), (unsigned long int) base, (unsigned long int) p2_cd); mpq_div(qvalue, qvalue, q_exp); mpz_t i_rem, i_quo; mpz_inits(i_rem, i_quo, NULL); mpz_fdiv_qr(i_quo, i_rem, mpq_numref(qvalue), mpq_denref(qvalue)); if(mpz_sgn(i_rem) != 0) { mpz_set(ivalue, i_quo); mpq_t q_rem, q_base_half; mpq_inits(q_rem, q_base_half, NULL); mpz_set(mpq_numref(q_rem), i_rem); mpz_set(mpq_denref(q_rem), mpq_denref(qvalue)); mpz_set_si(mpq_numref(q_base_half), base); mpq_mul(q_rem, q_rem, q_base_half); mpz_set_ui(mpq_denref(q_base_half), 2); int i_sign = mpq_cmp(q_rem, q_base_half); if(po.round_halfway_to_even && mpz_even_p(ivalue)) { if(i_sign > 0) mpz_add_ui(ivalue, ivalue, 1); } else { if(i_sign >= 0) mpz_add_ui(ivalue, ivalue, 1); } mpq_clears(q_base_half, q_rem, NULL); mpz_ui_pow_ui(i_quo, (unsigned long int) base, (unsigned long int) precision2); mpz_mul(ivalue, ivalue, i_quo); exact = false; rerun = true; mpz_clears(i_rem, i_quo, NULL); mpq_clears(q_exp, qvalue, NULL); goto integer_rerun; } mpz_clears(i_rem, i_quo, NULL); mpq_clears(q_exp, qvalue, NULL); } } mpz_clear(ivalue); decimals = 0; if(expo > 0) { if(po.restrict_fraction_length || po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT) { mpz_str.insert(mpz_str.length() - expo, po.decimalpoint()); dp_added = true; decimals = expo; } else { mpz_str = mpz_str.substr(0, mpz_str.length() - expo); } } if(base != BASE_ROMAN_NUMERALS && (po.restrict_fraction_length || po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT)) { int pos = mpz_str.length() - 1; for(; pos >= (int) mpz_str.length() + min_decimals - decimals; pos--) { if(mpz_str[pos] != '0') { break; } } if(pos + 1 < (int) mpz_str.length()) { decimals -= mpz_str.length() - (pos + 1); mpz_str = mpz_str.substr(0, pos + 1); } if(exact && min_decimals > decimals) { if(decimals <= 0) { mpz_str += po.decimalpoint(); dp_added = true; } while(min_decimals > decimals) { decimals++; mpz_str += "0"; } } if(mpz_str[mpz_str.length() - 1] == po.decimalpoint()[0]) { mpz_str.erase(mpz_str.end() - 1); dp_added = false; } } if(!exact && po.is_approximate) *po.is_approximate = true; if(po.show_ending_zeroes && (!exact || approx) && (!po.use_max_decimals || po.max_decimals < 0 || po.max_decimals > decimals)) { precision = precision_base; precision -= mpz_str.length(); if(dp_added) { precision += 1; } else if(precision > 0) { mpz_str += po.decimalpoint(); } for(; precision > 0 && (!po.use_max_decimals || po.max_decimals < 0 || po.max_decimals > decimals); precision--) { decimals++; mpz_str += "0"; } } if(ips.minus) *ips.minus = neg; str = format_number_string(mpz_str, base, po.base_display, !ips.minus && neg, true, po); if(expo != 0) { if(ips.iexp) *ips.iexp = expo; if(ips.exp) { if(ips.exp_minus) { *ips.exp_minus = expo < 0; if(expo < 0) expo = -expo; } *ips.exp = i2s(expo); } else { if(po.lower_case_e) str += "e"; else str += "E"; str += i2s(expo); } } if(ips.num) *ips.num = str; } else if(isPlusInfinity()) { str += "+"; if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_INFINITY, po.can_display_unicode_string_arg))) { str += SIGN_INFINITY; } else { str += _("infinity"); } } else if(isMinusInfinity()) { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MINUS, po.can_display_unicode_string_arg))) str += SIGN_MINUS; else str += "-"; if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_INFINITY, po.can_display_unicode_string_arg))) { str += SIGN_INFINITY; } else { str += _("infinity"); } } else if(n_type == NUMBER_TYPE_FLOAT) { bool rerun = false; if(base < 2 || base > 36) base = 10; mpfr_clear_flags(); mpfr_t f_diff, f_mid; if(mpfr_equal_p(fl_value, fu_value)) { if(mpfr_inf_p(fl_value)) { Number nr; if(mpfr_sgn(fl_value) < 0) nr.setMinusInfinity(); else nr.setPlusInfinity(); nr.setPrecisionAndApproximateFrom(*this); return nr.print(po, ips); } mpfr_init2(f_mid, mpfr_get_prec(fl_value)); mpfr_set(f_mid, fl_value, MPFR_RNDN); } else if(po.interval_display == INTERVAL_DISPLAY_INTERVAL) { PrintOptions po2 = po; InternalPrintStruct ips2; ips2.parent_approximate = ips.parent_approximate; ips2.parent_precision = ips.parent_precision; po2.interval_display = INTERVAL_DISPLAY_LOWER; string str1 = print(po2, ips2); po2.interval_display = INTERVAL_DISPLAY_UPPER; string str2 = print(po2, ips2); if(str1 == str2) return print(po2, ips); str = CALCULATOR->f_interval->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name; str += LEFT_PARENTHESIS; str += str1; str += po.comma(); str += SPACE; str += str2; str += RIGHT_PARENTHESIS; if(ips.minus) *ips.minus = false; if(ips.num) *ips.num = str; return str; } else if(po.interval_display == INTERVAL_DISPLAY_PLUSMINUS) { if(mpfr_inf_p(fl_value) || mpfr_inf_p(fu_value)) { PrintOptions po2 = po; po2.interval_display = INTERVAL_DISPLAY_INTERVAL; return print(po2, ips); } mpfr_t f_mid, f_diff, f_log, f_log_diff; mpfr_inits2(BIT_PRECISION, f_mid, f_diff, f_log, f_log_diff, NULL); mpfr_sub(f_diff, fu_value, fl_value, MPFR_RNDU); mpfr_div_ui(f_diff, f_diff, 2, MPFR_RNDU); mpfr_add(f_mid, fl_value, f_diff, MPFR_RNDN); if(mpfr_zero_p(f_mid)) { mpfr_set_zero(f_log, 0); } else { mpfr_abs(f_log, f_mid, MPFR_RNDN); mpfr_log10(f_log, f_log, MPFR_RNDN); mpfr_floor(f_log, f_log); } mpfr_log10(f_log_diff, f_diff, MPFR_RNDN); mpfr_floor(f_log_diff, f_log_diff); mpfr_sub(f_log_diff, f_log_diff, f_log, MPFR_RNDN); long int i_log_diff = mpfr_get_si(f_log_diff, MPFR_RNDN); if(i_log_diff > PRECISION) { PrintOptions po2 = po; po2.interval_display = INTERVAL_DISPLAY_INTERVAL; mpfr_clears(f_diff, f_mid, f_log, f_log_diff, NULL); return print(po2, ips); } PrintOptions po2 = po; long int iexp = 0; InternalPrintStruct ips2 = ips; ips2.iexp = &iexp; po2.interval_display = INTERVAL_DISPLAY_MIDPOINT; po2.min_decimals = 0; po2.use_max_decimals = false; str = print(po2, ips2); if(ips.iexp) *ips.iexp = iexp; po2.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; if(po.preserve_precision) { if(i_precision < 0) precision = FROM_BIT_PRECISION(BIT_PRECISION); else precision = i_precision; } else if(po.preserve_format) { if(i_precision < 0) precision = FROM_BIT_PRECISION(BIT_PRECISION) - 1; else precision = i_precision; } if(iexp > 0) { mpfr_ui_pow_ui(f_log, 10, iexp, MPFR_RNDN); mpfr_div(f_diff, f_diff, f_log, MPFR_RNDN); } else if(iexp < 0) { mpfr_ui_pow_ui(f_log, 10, -iexp, MPFR_RNDN); mpfr_mul(f_diff, f_diff, f_log, MPFR_RNDN); } else { long int i_log = mpfr_get_si(f_log, MPFR_RNDN); if(i_log < 0) i_log = -i_log; if(i_log + 1 > precision) precision = i_log + 1; } po2.min_exp = 0; Number nr; nr.setInternal(f_diff); precision += i_log_diff; if(precision > 0) { str += SIGN_PLUSMINUS; nr.setPrecision(precision); InternalPrintStruct ips3; ips3.parent_approximate = ips.parent_approximate; ips3.parent_precision = ips.parent_precision; str += nr.print(po2, ips3); if(iexp != 0 && !ips.exp) { if(po.lower_case_e) str += "e"; else str += "E"; str += i2s(iexp); } if(ips.depth > 0) { str.insert(0, LEFT_PARENTHESIS); str += RIGHT_PARENTHESIS; } } if(ips.num) *ips.num = str; mpfr_clears(f_diff, f_mid, f_log, f_log_diff, NULL); return str; } else if(po.interval_display == INTERVAL_DISPLAY_MIDPOINT) { if(mpfr_inf_p(fl_value) || mpfr_inf_p(fu_value)) { PrintOptions po2 = po; po2.interval_display = INTERVAL_DISPLAY_INTERVAL; return print(po2, ips); } mpfr_inits2(mpfr_get_prec(fl_value), f_diff, f_mid, NULL); mpfr_sub(f_diff, fu_value, fl_value, MPFR_RNDN); mpfr_div_ui(f_diff, f_diff, 2, MPFR_RNDN); mpfr_add(f_mid, fl_value, f_diff, MPFR_RNDN); mpfr_clear(f_diff); if(po.is_approximate) *po.is_approximate = true; } else if(po.interval_display == INTERVAL_DISPLAY_LOWER) { if(mpfr_inf_p(fl_value)) { Number nr; if(mpfr_sgn(fl_value) < 0) nr.setMinusInfinity(); else nr.setPlusInfinity(); nr.setPrecisionAndApproximateFrom(*this); return nr.print(po, ips); } mpfr_init2(f_mid, mpfr_get_prec(fl_value)); mpfr_set(f_mid, fl_value, MPFR_RNDD); } else if(po.interval_display == INTERVAL_DISPLAY_UPPER) { if(mpfr_inf_p(fu_value)) { Number nr; if(mpfr_sgn(fu_value) < 0) nr.setMinusInfinity(); else nr.setPlusInfinity(); nr.setPrecisionAndApproximateFrom(*this); return nr.print(po, ips); } mpfr_init2(f_mid, mpfr_get_prec(fu_value)); mpfr_set(f_mid, fu_value, MPFR_RNDU); } else { if(mpfr_inf_p(fl_value) || mpfr_inf_p(fu_value)) { PrintOptions po2 = po; po2.interval_display = INTERVAL_DISPLAY_INTERVAL; return print(po2, ips); } mpfr_t vl, vu, f_logl, f_base, f_log_base; mpfr_inits2(mpfr_get_prec(fl_value), f_mid, vl, vu, f_logl, f_base, f_log_base, NULL); mpfr_set_si(f_base, base, MPFR_RNDN); mpfr_log(f_log_base, f_base, MPFR_RNDN); mpq_t base_half; mpq_init(base_half); mpq_set_ui(base_half, base, 2); mpq_canonicalize(base_half); if(mpfr_sgn(fl_value) != mpfr_sgn(fu_value)) { long int ilogl = i_precision_base, ilogu = i_precision_base; if(mpfr_sgn(fl_value) < 0) { mpfr_neg(f_logl, fl_value, MPFR_RNDU); mpfr_log(f_logl, f_logl, MPFR_RNDU); mpfr_div(f_logl, f_logl, f_log_base, MPFR_RNDU); ilogl = -mpfr_get_si(f_logl, MPFR_RNDU); if(ilogl >= 0) { mpfr_ui_pow_ui(f_logl, (unsigned long int) base, (unsigned long int) ilogl + 1, MPFR_RNDU); mpfr_mul(vl, fl_value, f_logl, MPFR_RNDD); mpfr_neg(vl, vl, MPFR_RNDU); if(mpfr_cmp_q(vl, base_half) <= 0) ilogl++; } } if(mpfr_sgn(fu_value) > 0) { mpfr_log(f_logl, fu_value, MPFR_RNDU); mpfr_div(f_logl, f_logl, f_log_base, MPFR_RNDU); ilogu = -mpfr_get_si(f_logl, MPFR_RNDU); if(ilogu >= 0) { mpfr_ui_pow_ui(f_logl, (unsigned long int) base, (unsigned long int) ilogu + 1, MPFR_RNDU); mpfr_mul(vu, fu_value, f_logl, MPFR_RNDU); if(mpfr_cmp_q(vu, base_half) <= 0) ilogu++; } } mpfr_clears(vu, vl, f_logl, f_mid, f_base, f_log_base, NULL); mpq_clear(base_half); if(ilogu < ilogl) ilogl = ilogu; if(ilogl <= 0) { PrintOptions po2 = po; po2.interval_display = INTERVAL_DISPLAY_PLUSMINUS; return print(po2, ips); } else { i_precision_base = ilogl; } Number nr_zero; nr_zero.setApproximate(true); PrintOptions po2 = po; po2.max_decimals = i_precision_base - 1; po2.use_max_decimals = true; return nr_zero.print(po2, ips); } float_interval_prec_rerun: mpfr_set(vl, fl_value, MPFR_RNDN); mpfr_set(vu, fu_value, MPFR_RNDN); bool negl = (mpfr_sgn(vl) < 0); if(negl) { mpfr_neg(vl, vl, MPFR_RNDN); mpfr_neg(vu, vu, MPFR_RNDN); mpfr_swap(vl, vu); } mpfr_nextbelow(vu); mpfr_log(f_logl, vu, MPFR_RNDN); mpfr_div(f_logl, f_logl, f_log_base, MPFR_RNDN); mpfr_floor(f_logl, f_logl); if(po.use_max_decimals && po.max_decimals >= 0) { long int i_log = mpfr_get_si(f_logl, MPFR_RNDN); long int expo = 0; if(!po.preserve_format && base == 10) { expo = i_log; if(po.min_exp == EXP_PRECISION || (po.min_exp == 0 && expo > 1000000L)) { long int precexp = i_precision_base; if(precision < 8 && precexp > precision + 2) precexp = precision + 2; else if(precexp > precision + 3) precexp = precision + 3; if((expo > 0 && expo < precexp) || (expo < 0 && expo > -PRECISION)) { if(expo >= i_precision_base) i_precision_base = expo + 1; if(expo >= precision_base) precision_base = expo + 1; if(expo >= precision) precision = expo + 1; expo = 0; } } else if(po.min_exp < -1) { if(expo < 0) { int expo_rem = (-expo) % (-po.min_exp); if(expo_rem > 0) expo_rem = (-po.min_exp) - expo_rem; expo -= expo_rem; if(expo > 0) expo = 0; } else if(expo > 0) { expo -= expo % (-po.min_exp); if(expo < 0) expo = 0; } } else if(po.min_exp != 0) { if(expo > -po.min_exp && expo < po.min_exp) { expo = 0; } } else { expo = 0; } } if(i_log - expo + po.max_decimals < i_precision_base) i_precision_base = i_log - expo + po.max_decimals; } mpfr_sub_si(f_logl, f_logl, i_precision_base, MPFR_RNDN); mpfr_pow(f_logl, f_base, f_logl, MPFR_RNDN); mpfr_div(vl, vl, f_logl, MPFR_RNDU); mpfr_div(vu, vu, f_logl, MPFR_RNDD); if(mpfr_cmp(vl, vu) > 0) mpfr_swap(vl, vu); mpfr_round(vl, vl); mpfr_round(vu, vu); mpz_t ivalue; mpz_init(ivalue); mpfr_get_z(ivalue, vl, MPFR_RNDN); string str_l = printMPZ(ivalue, base, false, false); mpfr_get_z(ivalue, vu, MPFR_RNDN); string str_u = printMPZ(ivalue, base, false, false); if(str_u.length() > str_l.length()) { str_l.insert(0, str_u.length() - str_l.length(), '0'); } for(size_t i = 0; i < str_l.size(); i++) { if(str_l[i] != str_u[i]) { if(char2val(str_l[i], base) + 1 == char2val(str_u[i], base)) { i++; bool do_rerun = false; for(; i < str_l.size(); i++) { if(char2val(str_l[i], base) == base - 1) { do_rerun = true; } else if(char2val(str_l[i], base) >= base / 2) { do_rerun = true; break; } else { i--; break; } } if(do_rerun) { if(i_precision_base == 0 || i == 0) {i_precision_base = 0; break;} else if(i > (size_t) i_precision_base) i_precision_base--; else i_precision_base = i - 1; goto float_interval_prec_rerun; } } if(i == 0 || i_precision_base <= 0) { if(i_precision_base < 0) break; mpfr_mul(f_mid, vu, f_logl, MPFR_RNDN); if(mpfr_cmp_ui(f_mid, 1) >= 0) {i_precision_base = 0; break;} i_precision_base = -1; } else if(i - 1 >= (size_t) i_precision_base) i_precision_base--; else i_precision_base = i - 1; goto float_interval_prec_rerun; } else if(i == str_l.size() - 1) { i_precision_base = i + 1; } } if(i_precision_base < precision_base) precision_base = i_precision_base; if(i_precision_base <= 0) { if(negl) { mpfr_neg(vl, fl_value, MPFR_RNDN); mpfr_neg(vu, fu_value, MPFR_RNDN); } else { mpfr_set(vl, fl_value, MPFR_RNDN); mpfr_set(vu, fu_value, MPFR_RNDN); } mpfr_log(f_logl, vl, MPFR_RNDU); mpfr_div(f_logl, f_logl, f_log_base, MPFR_RNDU); long int ilogl = -mpfr_get_si(f_logl, MPFR_RNDU); if(ilogl >= 0) { mpfr_ui_pow_ui(f_logl, (unsigned long int) base, (unsigned long int) ilogl + 1, MPFR_RNDU); mpfr_mul(vl, fl_value, f_logl, MPFR_RNDD); mpfr_neg(vl, vl, MPFR_RNDU); if(mpfr_cmp_q(vl, base_half) <= 0) ilogl++; } mpfr_log(f_logl, vu, MPFR_RNDU); mpfr_div(f_logl, f_logl, f_log_base, MPFR_RNDU); long int ilogu = -mpfr_get_si(f_logl, MPFR_RNDU); if(ilogu >= 0) { mpfr_ui_pow_ui(f_logl, (unsigned long int) base, (unsigned long int) ilogu + 1, MPFR_RNDU); mpfr_mul(vu, fu_value, f_logl, MPFR_RNDU); if(mpfr_cmp_q(vu, base_half) <= 0) ilogu++; } mpfr_clears(vu, vl, f_logl, f_mid, f_base, f_log_base, NULL); mpq_clear(base_half); if(ilogu < ilogl) ilogl = ilogu; if(ilogl <= 0) { PrintOptions po2 = po; po2.interval_display = INTERVAL_DISPLAY_PLUSMINUS; return print(po2, ips); } else { i_precision_base = ilogl; } Number nr_zero; nr_zero.setApproximate(true); PrintOptions po2 = po; po2.max_decimals = i_precision_base - 1; po2.use_max_decimals = true; return nr_zero.print(po2, ips); } mpq_clear(base_half); if(precision_base <= 1) { mpfr_mul(f_mid, vu, f_logl, MPFR_RNDN); if(negl) mpfr_neg(f_mid, f_mid, MPFR_RNDN); if(mpfr_cmp_abs(f_mid, fu_value) > 0 || mpfr_cmp_abs(f_mid, fl_value) < 0) { mpfr_clears(vl, vu, f_logl, f_base, f_log_base, NULL); mpfr_clear(f_mid); PrintOptions po2 = po; po2.interval_display = INTERVAL_DISPLAY_PLUSMINUS; return print(po2, ips); } } else { mpfr_sub(f_mid, fu_value, fl_value, MPFR_RNDN); mpfr_div_ui(f_mid, f_mid, 2, MPFR_RNDN); mpfr_add(f_mid, fl_value, f_mid, MPFR_RNDN); } mpfr_clears(vl, vu, f_logl, f_base, f_log_base, NULL); if(po.is_approximate) *po.is_approximate = true; } precision = precision_base; if(mpfr_zero_p(f_mid)) { Number nr_zero; nr_zero.setApproximate(true); PrintOptions po2 = po; po2.max_decimals = i_precision_base - 1; po2.use_max_decimals = true; return nr_zero.print(po2, ips); } float_rerun: string str_bexp; bool neg_bexp = false; mpfr_t f_log, f_base, f_log_base; mpfr_inits2(mpfr_get_prec(f_mid), f_log, f_base, f_log_base, NULL); mpfr_set_si(f_base, base, MPFR_RNDN); mpfr_log(f_log_base, f_base, MPFR_RNDN); if(base != 10 && (mpfr_get_exp(f_mid) > 100000L || mpfr_get_exp(f_mid) < -100000L)) { bool b_neg = mpfr_sgn(f_mid) < 0; if(b_neg) mpfr_neg(f_mid, f_mid, MPFR_RNDN); if(base == 2) { mpfr_log2(f_log, f_mid, MPFR_RNDN); } else { mpfr_log(f_log, f_mid, MPFR_RNDN); mpfr_div(f_log, f_log, f_log_base, MPFR_RNDN); } mpfr_floor(f_log, f_log); mpz_t z_exp; mpz_init(z_exp); mpfr_get_z(z_exp, f_log, MPFR_RNDN); if(mpz_sgn(z_exp) < 0) { mpz_neg(z_exp, z_exp); neg_bexp = true; } Number nr_bexp; nr_bexp.setInternal(z_exp); PrintOptions po2 = po; po2.twos_complement = false; po2.binary_bits = 0; str_bexp = nr_bexp.print(po2); mpfr_ui_pow(f_log, base, f_log, MPFR_RNDN); mpfr_div(f_mid, f_mid, f_log, MPFR_RNDN); if(b_neg) mpfr_neg(f_mid, f_mid, MPFR_RNDN); } mpfr_t v; mpfr_init2(v, mpfr_get_prec(f_mid)); long int expo = 0; long int l10 = 0; mpfr_set(v, f_mid, MPFR_RNDN); bool neg = (mpfr_sgn(v) < 0); if(neg) mpfr_neg(v, v, MPFR_RNDN); mpfr_log(f_log, v, MPFR_RNDN); mpfr_div(f_log, f_log, f_log_base, MPFR_RNDN); mpfr_floor(f_log, f_log); long int i_log = mpfr_get_si(f_log, MPFR_RNDN); if(base == 10 && !po.preserve_format) { expo = i_log; if(po.min_exp == EXP_PRECISION || (po.min_exp == 0 && expo > 1000000L)) { long int precexp = i_precision_base; if(precision < 8 && precexp > precision + 2) precexp = precision + 2; else if(precexp > precision + 3) precexp = precision + 3; if((expo > 0 && expo < precexp) || (expo < 0 && expo > -PRECISION)) { if(expo >= i_precision_base) i_precision_base = expo + 1; if(expo >= precision_base) precision_base = expo + 1; if(expo >= precision) precision = expo + 1; expo = 0; } } else if(po.min_exp < -1) { if(expo < 0) { int expo_rem = (-expo) % (-po.min_exp); if(expo_rem > 0) expo_rem = (-po.min_exp) - expo_rem; expo -= expo_rem; if(expo > 0) expo = 0; } else if(expo > 0) { expo -= expo % (-po.min_exp); if(expo < 0) expo = 0; } } else if(po.min_exp != 0) { if(expo > -po.min_exp && expo < po.min_exp) { expo = 0; } } else { expo = 0; } } if(!rerun && i_precision_base > precision_base && min_decimals > 0) { if(min_decimals > precision - 1 - (i_log - expo)) { precision = min_decimals + 1 + (i_log - expo); if(precision > i_precision_base) precision = i_precision_base; mpfr_clears(v, f_log, f_base, f_log_base, NULL); rerun = true; goto float_rerun; } } if(expo == 0 && i_log > precision) { precision = (i_precision_base > i_log + 1) ? i_log + 1 : i_precision_base; } mpfr_sub_si(f_log, f_log, (po.use_max_decimals && po.max_decimals >= 0 && precision > po.max_decimals + i_log - expo) ? po.max_decimals + i_log - expo: precision - 1, MPFR_RNDN); l10 = expo - mpfr_get_si(f_log, MPFR_RNDN); mpfr_pow(f_log, f_base, f_log, MPFR_RNDN); if((!neg && po.interval_display == INTERVAL_DISPLAY_LOWER) || (neg && po.interval_display == INTERVAL_DISPLAY_UPPER)) { mpfr_div(v, v, f_log, MPFR_RNDU); mpfr_floor(v, v); } else if((neg && po.interval_display == INTERVAL_DISPLAY_LOWER) || (!neg && po.interval_display == INTERVAL_DISPLAY_UPPER)) { mpfr_div(v, v, f_log, MPFR_RNDD); mpfr_ceil(v, v); } else if(po.round_halfway_to_even) { mpfr_div(v, v, f_log, MPFR_RNDN); mpfr_rint(v, v, MPFR_RNDN); } else { mpfr_div(v, v, f_log, MPFR_RNDN); mpfr_round(v, v); } mpz_t ivalue; mpz_init(ivalue); mpfr_get_z(ivalue, v, MPFR_RNDN); str = printMPZ(ivalue, base, false, po.lower_case_numbers); if(l10 > 0) { l10 = str.length() - l10; if(l10 < 1) { str.insert(str.begin(), 1 - l10, '0'); l10 = 1; } str.insert(l10, po.decimalpoint()); int l2 = 0; while(str[str.length() - 1 - l2] == '0') { l2++; } if(l2 > 0 && !po.show_ending_zeroes) { if(min_decimals > 0) { int decimals = str.length() - l10 - 1; if(decimals - min_decimals < l2) l2 = decimals - min_decimals; } if(l2 > 0) str = str.substr(0, str.length() - l2); } if(str[str.length() - 1] == po.decimalpoint()[0]) { str.erase(str.end() - 1); } } else if(l10 < 0) { while(l10 < 0) { l10++; str += "0"; } } if(str.empty()) { str = "0"; } if(str[str.length() - 1] == po.decimalpoint()[0]) { str.erase(str.end() - 1); } if(!str_bexp.empty()) { PrintOptions po2 = po; po2.binary_bits = 0; str = format_number_string(str, base, po.base_display, !ips.minus && neg, true, po2); } else { str = format_number_string(str, base, po.base_display, !ips.minus && neg, true, po); } if(expo != 0) { if(ips.iexp) *ips.iexp = expo; if(ips.exp) { if(ips.exp_minus) { *ips.exp_minus = expo < 0; if(expo < 0) expo = -expo; } *ips.exp = i2s(expo); } else { if(po.lower_case_e) str += "e"; else str += "E"; str += i2s(expo); } } if(!str_bexp.empty()) { if(ips.exp) { if(ips.exp_minus) *ips.exp_minus = neg_bexp; else str_bexp.insert(0, "-"); *ips.exp = str_bexp; } else { if(po.spacious) str += " "; if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIDOT, po.can_display_unicode_string_arg))) str += SIGN_MULTIDOT; else if(po.use_unicode_signs && (po.multiplication_sign == MULTIPLICATION_SIGN_DOT || po.multiplication_sign == MULTIPLICATION_SIGN_ALTDOT) && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MIDDLEDOT, po.can_display_unicode_string_arg))) str += SIGN_MIDDLEDOT; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_X && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIPLICATION, po.can_display_unicode_string_arg))) str += SIGN_MULTIPLICATION; else str += "*"; if(po.spacious) str += " "; str += i2s(base); str += "^"; if(neg_bexp) { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MINUS, po.can_display_unicode_string_arg))) str += SIGN_MINUS; else str = "-"; } str += str_bexp; if(ips.depth > 0) { str.insert(0, "("); str += ")"; } } } if(ips.minus) *ips.minus = neg; if(ips.num) *ips.num = str; mpfr_clears(f_mid, v, f_log, f_base, f_log_base, NULL); if(po.is_approximate && mpfr_inexflag_p()) *po.is_approximate = true; testErrors(2); } else if(base != BASE_ROMAN_NUMERALS && (po.number_fraction_format == FRACTION_DECIMAL || po.number_fraction_format == FRACTION_DECIMAL_EXACT)) { long int numlength = mpz_sizeinbase(mpq_numref(r_value), base); long int denlength = mpz_sizeinbase(mpq_denref(r_value), base); if(precision_base + min_decimals + 1000 + ::abs(po.min_exp) < labs(numlength - denlength) && (approx || (po.min_exp != 0 && base == 10) || labs(numlength - denlength) > (po.base == 10 ? 1000000L : 100000L))) { Number nr(*this); if(nr.setToFloatingPoint()) { PrintOptions po2 = po; po2.interval_display = INTERVAL_DISPLAY_MIDPOINT; str = nr.print(po2, ips); return str; } } mpz_t num, d, remainder, remainder2, exp; mpz_inits(num, d, remainder, remainder2, exp, NULL); mpz_set(d, mpq_denref(r_value)); mpz_set(num, mpq_numref(r_value)); bool neg = (mpz_sgn(num) < 0); if(neg) mpz_neg(num, num); mpz_tdiv_qr(num, remainder, num, d); bool exact = (mpz_sgn(remainder) == 0); vector remainders; bool started = false; long int expo = 0; long int precision2 = precision_base; int num_sign = mpz_sgn(num); long int min_l10 = 0, max_l10 = 0; bool applied_expo = false; bool try_infinite_series = po.indicate_infinite_series && po.number_fraction_format != FRACTION_DECIMAL_EXACT && !approx && (!po.use_max_decimals || po.max_decimals < 0 || po.max_decimals >= 3); if(num_sign != 0) { str = printMPZ(num, base, false); if(CALCULATOR->aborted()) {mpz_clears(num, d, remainder, remainder2, exp, NULL); return CALCULATOR->abortedMessage();} long int length = str.length(); if(base != 10 || po.preserve_format) { expo = 0; } else { expo = length - 1; if(po.min_exp == EXP_PRECISION) { long int precexp = i_precision_base; if(precision < 8 && precexp > precision + 2) precexp = precision + 2; else if(precexp > precision + 3) precexp = precision + 3; if((expo > 0 && expo < precexp) || (expo < 0 && expo > -PRECISION)) { if(expo >= precision) precision = expo + 1; if(expo >= precision2) precision2 = expo + 1; expo = 0; } } else if(po.min_exp < -1) { expo -= expo % (-po.min_exp); if(expo < 0) expo = 0; } else if(po.min_exp != 0) { if(expo > -po.min_exp && expo < po.min_exp) { expo = 0; } } else { expo = 0; } } long int decimals = expo; long int nondecimals = length - decimals; precision2 -= length; if(po.preserve_format) { precision2 += 100; } else if(!approx && min_decimals) { min_l10 = (min_decimals + nondecimals) - length; if(min_l10 > precision2) precision2 = min_l10; } int do_div = 0; if(po.use_max_decimals && po.max_decimals >= 0 && decimals > po.max_decimals && (!approx || po.max_decimals - decimals < precision2)) { do_div = 1; } else if(precision2 < 0 && (approx || decimals > min_decimals)) { do_div = 2; } if(try_infinite_series && expo > 0 && do_div != 2) { mpz_t i_div; mpz_init(i_div); mpz_ui_pow_ui(i_div, 10, expo); mpz_mul(d, d, i_div); mpz_set(num, mpq_numref(r_value)); bool neg = (mpz_sgn(num) < 0); if(neg) mpz_neg(num, num); mpz_tdiv_qr(num, remainder, num, d); mpz_clear(i_div); exact = false; do_div = 0; precision2 = precision - nondecimals; if(min_decimals > 0) { if(precision2 < min_decimals) precision2 = min_decimals; min_l10 = min_decimals; } if(po.use_max_decimals && po.max_decimals >= 0) { if(precision2 > po.max_decimals) precision2 = po.max_decimals; max_l10 = po.max_decimals; } applied_expo = true; } else if(do_div) { mpz_t i_rem, i_quo, i_div, i_div_pre; mpz_inits(i_rem, i_quo, i_div, i_div_pre, NULL); mpz_ui_pow_ui(i_div_pre, (unsigned long int) base, do_div == 1 ? (unsigned long int) -(po.max_decimals - decimals) : (unsigned long int) -precision2); mpz_mul(i_div, i_div_pre, mpq_denref(r_value)); mpz_fdiv_qr(i_quo, i_rem, mpq_numref(r_value), i_div); if(mpz_sgn(i_rem) != 0) { mpz_set(num, i_quo); mpq_t q_rem, q_base_half; mpq_inits(q_rem, q_base_half, NULL); mpz_set(mpq_numref(q_rem), i_rem); mpz_set(mpq_denref(q_rem), i_div); mpz_set_si(mpq_numref(q_base_half), base); mpq_mul(q_rem, q_rem, q_base_half); mpz_set_ui(mpq_denref(q_base_half), 2); int i_sign = mpq_cmp(q_rem, q_base_half); if(po.round_halfway_to_even && mpz_even_p(num)) { if(i_sign > 0) mpz_add_ui(num, num, 1); } else { if(i_sign >= 0) mpz_add_ui(num, num, 1); } mpq_clears(q_base_half, q_rem, NULL); mpz_mul(num, num, i_div_pre); exact = false; if(neg) mpz_neg(num, num); } mpz_clears(i_rem, i_quo, i_div, i_div_pre, NULL); mpz_set_ui(remainder, 0); } started = true; if(!applied_expo && po.use_max_decimals && po.max_decimals >= 0 && precision2 > po.max_decimals - decimals) precision2 = po.max_decimals - decimals; } bool b_bak = false; mpz_t remainder_bak, num_bak; if(num_sign == 0 && (try_infinite_series || (po.use_max_decimals && po.max_decimals >= 0) || min_decimals > 0)) { mpz_init_set(remainder_bak, remainder); mpz_init_set(num_bak, num); b_bak = true; } bool rerun = false; int first_rem_check = 0; rational_rerun: int infinite_series = 0; long int l10 = 0; if(rerun) { mpz_set(num, num_bak); mpz_set(remainder, remainder_bak); } if(po.preserve_format) precision2 += 100; long int prec2_begin = precision2; mpz_t *remcopy; while(!exact && precision2 > 0) { if(try_infinite_series) { remcopy = new mpz_t[1]; mpz_init_set(*remcopy, remainder); } mpz_mul_si(remainder, remainder, base); mpz_tdiv_qr(remainder, remainder2, remainder, d); exact = (mpz_sgn(remainder2) == 0); if(!started) { started = (mpz_sgn(remainder) != 0); } if(started) { mpz_mul_si(num, num, base); mpz_add(num, num, remainder); } if(try_infinite_series) { if(started && first_rem_check == 0) { remainders.push_back(remcopy); } else { if(started) first_rem_check--; mpz_clear(*remcopy); free(remcopy); } } if(CALCULATOR->aborted()) { if(b_bak) mpz_clears(num_bak, remainder_bak, NULL); mpz_clears(num, d, remainder, remainder2, exp, NULL); return CALCULATOR->abortedMessage(); } l10++; mpz_set(remainder, remainder2); if(try_infinite_series && !exact && started) { for(size_t i = 0; i < remainders.size(); i++) { if(CALCULATOR->aborted()) {mpz_clears(num, d, remainder, remainder2, exp, NULL); return CALCULATOR->abortedMessage();} if(!mpz_cmp(*remainders[i], remainder)) { infinite_series = remainders.size() - i; try_infinite_series = false; long int min_prec2_diff = precision2 - (prec2_begin - min_l10); long int max_prec2_diff = precision2 - (prec2_begin - max_l10); if(infinite_series == 1) precision2 = 3; else precision2 = infinite_series + 1; if(min_l10 > 0 && precision2 < min_prec2_diff) { precision2 = min_prec2_diff; if(max_l10 > 0 && precision2 > max_prec2_diff) precision2 = max_prec2_diff; } else if(max_l10 > 0 && precision2 > max_prec2_diff) { precision2 = max_prec2_diff; infinite_series = 0; } break; } } } if(started) { precision2--; } } for(size_t i = 0; i < remainders.size(); i++) { mpz_clear(*remainders[i]); free(remainders[i]); } remainders.clear(); if(!exact && !infinite_series) { mpz_mul_si(remainder, remainder, base); mpz_tdiv_qr(remainder, remainder2, remainder, d); mpq_t q_rem, q_base_half; mpq_inits(q_rem, q_base_half, NULL); mpz_set(mpq_numref(q_rem), remainder); mpz_set_si(mpq_numref(q_base_half), base); mpz_set_ui(mpq_denref(q_base_half), 2); int i_sign = mpq_cmp(q_rem, q_base_half); if(po.round_halfway_to_even && mpz_sgn(remainder2) == 0 && mpz_even_p(num)) { if(i_sign > 0) mpz_add_ui(num, num, 1); } else { if(i_sign >= 0) mpz_add_ui(num, num, 1); } mpq_clears(q_base_half, q_rem, NULL); } if(!exact && !infinite_series && po.number_fraction_format == FRACTION_DECIMAL_EXACT && !approx) { PrintOptions po2 = po; po2.number_fraction_format = FRACTION_FRACTIONAL; po2.restrict_fraction_length = true; if(b_bak) mpz_clears(num_bak, remainder_bak, NULL); mpz_clears(num, d, remainder, remainder2, exp, NULL); return print(po2, ips); } str = printMPZ(num, base, false, po.lower_case_numbers); if(base == 10 && !rerun && !po.preserve_format && !applied_expo) { expo = str.length() - l10 - 1; if(po.min_exp == EXP_PRECISION) { long int precexp = i_precision_base; if(precision < 8 && precexp > precision + 2) precexp = precision + 2; else if(precexp > precision + 3) precexp = precision + 3; if((expo > 0 && expo < precexp) || (expo < 0 && expo > -PRECISION)) { if(expo >= precision) precision = expo + 1; if(expo >= precision2) precision2 = expo + 1; expo = 0; } } else if(po.min_exp < -1) { if(expo < 0) { int expo_rem = (-expo) % (-po.min_exp); if(expo_rem > 0) expo_rem = (-po.min_exp) - expo_rem; expo -= expo_rem; if(expo > 0) expo = 0; } else if(expo > 0) { expo -= expo % (-po.min_exp); if(expo < 0) expo = 0; } } else if(po.min_exp != 0) { if(expo > -po.min_exp && expo < po.min_exp) { expo = 0; } } else { expo = 0; } if(expo < 0 && infinite_series > 0) { first_rem_check = str.length() - l10 - expo; precision2 = precision; try_infinite_series = true; if(min_decimals > 0) { min_l10 = min_decimals + first_rem_check; if(precision2 < min_l10) precision2 = min_l10; } if(po.use_max_decimals && po.max_decimals >= 0) { max_l10 = po.max_decimals + first_rem_check; if(precision2 > max_l10) precision2 = max_l10; } rerun = true; started = false; goto rational_rerun; } } if(!rerun && num_sign == 0 && expo <= 0 && po.use_max_decimals && po.max_decimals >= 0 && l10 + expo > po.max_decimals) { precision2 = po.max_decimals + (str.length() - l10 - expo); try_infinite_series = false; rerun = true; exact = false; started = false; goto rational_rerun; } if(!rerun && !approx && !exact && num_sign == 0 && expo <= 0 && min_decimals > 0 && l10 + expo < min_decimals) { precision2 = min_decimals + (str.length() - l10 - expo); rerun = true; started = false; try_infinite_series = po.indicate_infinite_series && po.number_fraction_format != FRACTION_DECIMAL_EXACT && !approx && (!po.use_max_decimals || po.max_decimals < 0 || po.max_decimals >= 3); min_l10 = precision2; goto rational_rerun; } if(po.is_approximate && !exact && !infinite_series) *po.is_approximate = true; if(expo != 0 && !applied_expo) { l10 += expo; } while(l10 < 0) { str += '0'; l10++; } if(b_bak) mpz_clears(num_bak, remainder_bak, NULL); mpz_clears(num, d, remainder, remainder2, exp, NULL); if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(l10 > 0) { l10 = str.length() - l10; if(l10 < 1) { str.insert(str.begin(), 1 - l10, '0'); l10 = 1; } str.insert(l10, po.decimalpoint()); int l2 = 0; while(str[str.length() - 1 - l2] == '0') { l2++; } int decimals = str.length() - l10 - 1; if((!exact || approx) && po.show_ending_zeroes && (int) str.length() - precision - 1 < l2) { l2 = str.length() - precision - 1; if(po.use_max_decimals && po.max_decimals >= 0 && decimals - l2 > po.max_decimals) { l2 = decimals - po.max_decimals; } } if(l2 > 0 && !infinite_series) { if(min_decimals > 0 && (!approx || (!po.show_ending_zeroes && (int) str.length() - precision - 1 < l2))) { if(decimals - min_decimals < l2) l2 = decimals - min_decimals; if(approx && (int) str.length() - precision - 1 > l2) l2 = str.length() - precision - 1; } if(l2 > 0) str = str.substr(0, str.length() - l2); } if(str[str.length() - 1] == po.decimalpoint()[0]) { str.erase(str.end() - 1); } } int decimals = 0; if(l10 > 0) { decimals = str.length() - l10 - 1; } if(str.empty()) { str = "0"; } if(!exact && str == "0" && po.show_ending_zeroes && po.use_max_decimals && po.max_decimals >= 0 && po.max_decimals < precision) { str += po.decimalpoint(); for(; decimals < po.max_decimals; decimals++) str += '0'; } if(exact && min_decimals > decimals) { if(decimals <= 0) { str += po.decimalpoint(); decimals = 0; } for(; decimals < min_decimals; decimals++) { str += "0"; } } if(str[str.length() - 1] == po.decimalpoint()[0]) { str.erase(str.end() - 1); } if(infinite_series) { size_t i_dp = str.find(po.decimalpoint()); if(i_dp != string::npos && ((infinite_series == 1 && i_dp + po.decimalpoint().length() + 2 < str.length() - infinite_series) || (infinite_series > 1 && i_dp + po.decimalpoint().length() < str.length() - infinite_series))) { #ifdef _WIN32 str.insert(str.length() - (infinite_series == 1 ? 3 : infinite_series), " "); #else if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (" ", po.can_display_unicode_string_arg))) str.insert(str.length() - (infinite_series == 1 ? 3 : infinite_series), " "); else str.insert(str.length() - (infinite_series == 1 ? 3 : infinite_series), " "); #endif } if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) ("…", po.can_display_unicode_string_arg))) str += "…"; else str += "..."; } str = format_number_string(str, base, po.base_display, !ips.minus && neg, true, po); if(expo != 0) { if(ips.iexp) *ips.iexp = expo; if(ips.exp) { if(ips.exp_minus) { *ips.exp_minus = expo < 0; if(expo < 0) expo = -expo; } *ips.exp = i2s(expo); } else { if(po.lower_case_e) str += "e"; else str += "E"; str += i2s(expo); } } if(ips.minus) *ips.minus = neg; if(ips.num) *ips.num = str; } else { Number num, den; num.setInternal(mpq_numref(r_value)); den.setInternal(mpq_denref(r_value)); if(isApproximate()) { num.setApproximate(); den.setApproximate(); } bool approximately_displayed = false; PrintOptions po2 = po; po2.is_approximate = &approximately_displayed; str = num.print(po2, ips); if(approximately_displayed && base != BASE_ROMAN_NUMERALS) { po2 = po; po2.number_fraction_format = FRACTION_DECIMAL; return print(po2, ips); } if(ips.num) *ips.num = str; if(po.spacious) str += " "; if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION, po.can_display_unicode_string_arg))) { str += SIGN_DIVISION; } else if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION_SLASH && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION_SLASH, po.can_display_unicode_string_arg))) { str += SIGN_DIVISION_SLASH; } else { str += "/"; } if(po.spacious) str += " "; InternalPrintStruct ips_n = ips; ips_n.minus = NULL; string str2 = den.print(po2, ips_n); if(approximately_displayed && base != BASE_ROMAN_NUMERALS) { po2 = po; po2.number_fraction_format = FRACTION_DECIMAL; return print(po2, ips); } if(ips.den) *ips.den = str2; str += str2; if(po.is_approximate && approximately_displayed) *po.is_approximate = true; } return str; } libqalculate-2.8.2/libqalculate/Number.h0000644000175000017500000004103313364403533015156 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef NUMBER_H #define NUMBER_H #include #include #include /** @file */ #define EQUALS_PRECISION_DEFAULT -1 #define EQUALS_PRECISION_LOWEST -2 #define EQUALS_PRECISION_HIGHEST -3 typedef enum { NUMBER_TYPE_RATIONAL, NUMBER_TYPE_FLOAT, NUMBER_TYPE_PLUS_INFINITY, NUMBER_TYPE_MINUS_INFINITY } NumberType; typedef enum { INTEGER_TYPE_NONE, INTEGER_TYPE_SINT, INTEGER_TYPE_UINT, INTEGER_TYPE_ULONG, INTEGER_TYPE_SLONG, INTEGER_TYPE_SIZE } IntegerType; /// A number. /** * Can be rational, floating point, complex or infinite. * Has arbitrary precision (uses Calculator::precision()) and infinitely large rational numbers. * Implimented using GNU MP and MPFR. */ class Number { private: protected: void testInteger(); bool testErrors(int error_level = 1) const; bool testFloatResult(bool allow_infinite_result = true, int error_level = 1, bool test_integer = true); mpq_t r_value; mpfr_t fu_value; mpfr_t fl_value; Number *i_value; NumberType n_type; bool b_approx, b_imag; int i_precision; public: /** * Constructs a number initialized as zero. */ Number(); /** * Constructs a number parsing a text string. * * @param number Text string to read number from. * @param po Options for parsing the text string. */ Number(string number, const ParseOptions &po = default_parse_options); /** * Constructs a rational number. * * @param numerator * @param denominator * @param exp_10 */ Number(long int numerator, long int denominator = 1, long int exp_10 = 0); /** * Constructs a copy of a number. */ Number(const Number &o); virtual ~Number(); void set(string number, const ParseOptions &po = default_parse_options); void set(long int numerator, long int denominator = 1, long int exp_10 = 0, bool keep_precision = false, bool keep_imag = false); void setPlusInfinity(bool keep_precision = false, bool keep_imag = false); void setMinusInfinity(bool keep_precision = false, bool keep_imag = false); void setFloat(long double d_value); bool setInterval(const Number &nr_lower, const Number &nr_upper, bool keep_precision = false); void setInternal(const mpz_t &mpz_value, bool keep_precision = false, bool keep_imag = false); void setInternal(mpz_srcptr mpz_value, bool keep_precision = false, bool keep_imag = false); void setInternal(const mpq_t &mpq_value, bool keep_precision = false, bool keep_imag = false); void setInternal(const mpz_t &mpz_num, const mpz_t &mpz_den, bool keep_precision = false, bool keep_imag = false); void setInternal(const mpfr_t &mpfr_value, bool merge_precision = false, bool keep_imag = false); void setImaginaryPart(const Number &o); void setImaginaryPart(long int numerator, long int denominator = 1, long int exp_10 = 0); void set(const Number &o, bool merge_precision = false, bool keep_imag = false); void clear(bool keep_precision = false); void clearReal(); void clearImaginary(); const mpq_t &internalRational() const; const mpfr_t &internalUpperFloat() const; const mpfr_t &internalLowerFloat() const; mpq_t &internalRational(); mpfr_t &internalUpperFloat(); mpfr_t &internalLowerFloat(); Number *internalImaginary() const; void markAsImaginaryPart(bool is_imag = true); const NumberType &internalType() const; bool setToFloatingPoint(); void precisionToInterval(); bool intervalToPrecision(long int min_precision = 2); void intervalToMidValue(); void splitInterval(unsigned int nr_of_parts, vector &v) const; bool getCentralInteger(Number &nr_int, bool *b_multiple = NULL, vector *v = NULL) const; bool mergeInterval(const Number &o, bool set_to_overlap = false); void setUncertainty(const Number &o, bool force_interval = false); Number uncertainty() const; Number relativeUncertainty() const; double floatValue() const; /** * Converts a number to an integer. If the number does not represent an integer it will rounded using round(). * * @param[out] overflow If overflow is non-null it will be set to true if the number was to large to fit the return type. * @return Resulting integer. */ int intValue(bool *overflow = NULL) const; unsigned int uintValue(bool *overflow = NULL) const; long int lintValue(bool *overflow = NULL) const; long long int llintValue() const; unsigned long int ulintValue(bool *overflow = NULL) const; /** Returns true if the number is approximate. * * @return true if the number is approximate. */ bool isApproximate() const; /** Returns true if the number is a floating point number. * * @return true if the number has an approximate representation. */ bool isFloatingPoint() const; void setPrecisionAndApproximateFrom(const Number &o); bool isInterval(bool ignore_imag = true) const; bool imaginaryPartIsInterval() const; /** Defines the number as approximate or exact. * * @param is_approximate If the number shall be regarded as approximate. */ void setApproximate(bool is_approximate = true); /** Returns the.precision of the number. * * @return Precision of the number or -1 if the number is exact or the precision has not been set. */ int precision(int calculate_from_interval = 0) const; void setPrecision(int prec); bool isUndefined() const; /** Returns true if the number is infinity, plus infinity or minus infinity. * * @return true if the number is infinite. */ bool isInfinite(bool ignore_imag = true) const; /** Returns true if the number is plus infinity. * * @return true if the number is plus infinity. */ bool isPlusInfinity(bool ignore_imag = false) const; /** Returns true if the number is minus infinity. * * @return true if the number is minus infinity. */ bool isMinusInfinity(bool ignore_imag = false) const; bool includesInfinity(bool ignore_imag = false) const; bool includesPlusInfinity() const; bool includesMinusInfinity() const; /** Returns the real part of the number if it is complex, or a copy if it is real. * * @return true if the real part of a complex number. */ Number realPart() const; /** Returns the imaginary part as real number of the number if it is complex, or zero if it is real. * * @return true if the imaginary part of a complex number. */ Number imaginaryPart() const; Number numerator() const; Number denominator() const; Number complexNumerator() const; Number complexDenominator() const; Number lowerEndPoint(bool include_imag = false) const; Number upperEndPoint(bool include_imag = false) const; void operator = (const Number &o); void operator = (long int i); void operator -- (int); void operator ++ (int); Number operator - () const; Number operator * (const Number &o) const; Number operator / (const Number &o) const; Number operator + (const Number &o) const; Number operator - (const Number &o) const; Number operator ^ (const Number &o) const; Number operator * (long int i) const; Number operator / (long int i) const; Number operator + (long int i) const; Number operator - (long int i) const; Number operator ^ (long int i) const; Number operator && (const Number &o) const; Number operator || (const Number &o) const; Number operator ! () const; void operator *= (const Number &o); void operator /= (const Number &o); void operator += (const Number &o); void operator -= (const Number &o); void operator ^= (const Number &o); void operator *= (long int i); void operator /= (long int i); void operator += (long int i); void operator -= (long int i); void operator ^= (long int i); bool operator == (const Number &o) const; bool operator != (const Number &o) const; bool operator < (const Number &o) const; bool operator <= (const Number &o) const; bool operator > (const Number &o) const; bool operator >= (const Number &o) const; bool operator < (long int i) const; bool operator <= (long int i) const; bool operator > (long int i) const; bool operator >= (long int i) const; bool operator == (long int i) const; bool operator != (long int i) const; bool bitAnd(const Number &o); bool bitOr(const Number &o); bool bitXor(const Number &o); bool bitNot(); bool bitCmp(unsigned int bits); bool bitEqv(const Number &o); bool shiftLeft(const Number &o); bool shiftRight(const Number &o); bool shift(const Number &o); bool hasRealPart() const; bool hasImaginaryPart() const; bool isComplex() const; bool isInteger(IntegerType integer_type = INTEGER_TYPE_NONE) const; Number integer() const; bool isRational() const; bool isReal() const; bool isFraction() const; bool isZero() const; bool isNonZero() const; bool isOne() const; bool isTwo() const; bool isI() const; bool isMinusI() const; bool isMinusOne() const; bool isNegative() const; bool isNonNegative() const; bool isPositive() const; bool isNonPositive() const; bool realPartIsNegative() const; bool realPartIsNonNegative() const; bool realPartIsPositive() const; bool realPartIsNonZero() const; bool realPartIsRational() const; bool imaginaryPartIsNegative() const; bool imaginaryPartIsPositive() const; bool imaginaryPartIsNonNegative() const; bool imaginaryPartIsNonPositive() const; bool imaginaryPartIsNonZero() const; bool hasNegativeSign() const; bool hasPositiveSign() const; bool equalsZero() const; bool equals(const Number &o, bool allow_interval = false, bool allow_infinite = false) const; bool equals(long int i) const; int equalsApproximately(const Number &o, int prec) const; ComparisonResult compare(const Number &o, bool ignore_imag = false) const; ComparisonResult compareAbsolute(const Number &o, bool ignore_imag = false) const; ComparisonResult compare(long int i) const; ComparisonResult compareApproximately(const Number &o, int prec = EQUALS_PRECISION_LOWEST) const; ComparisonResult compareImaginaryParts(const Number &o) const; ComparisonResult compareRealParts(const Number &o) const; bool isGreaterThan(const Number &o) const; bool isLessThan(const Number &o) const; bool isGreaterThanOrEqualTo(const Number &o) const; bool isLessThanOrEqualTo(const Number &o) const; bool isGreaterThan(long int i) const; bool isLessThan(long int i) const; bool isGreaterThanOrEqualTo(long int i) const; bool isLessThanOrEqualTo(long int i) const; bool isEven() const; bool numeratorIsGreaterThan(long int i) const; bool numeratorIsLessThan(long int i) const; bool numeratorEquals(long int i) const; bool denominatorIsGreaterThan(long int i) const; bool denominatorIsLessThan(long int i) const; bool denominatorEquals(long int i) const; bool denominatorIsGreater(const Number &o) const; bool denominatorIsLess(const Number &o) const; bool denominatorIsEqual(const Number &o) const; bool denominatorIsEven() const; bool denominatorIsTwo() const; bool numeratorIsEven() const; bool numeratorIsOne() const; bool numeratorIsMinusOne() const; bool isOdd() const; int integerLength() const; /** Add to the number (x+o). * * @param o Number to add. * @return true if the operation was successful. */ bool add(const Number &o); bool add(long int i); /** Subtracts from to the number (x-o). * * @param o Number to subtract. * @return true if the operation was successful. */ bool subtract(const Number &o); bool subtract(long int i); /** Multiply the number (x*o). * * @param o Number to multiply with. * @return true if the operation was successful. */ bool multiply(const Number &o); bool multiply(long int i); /** Divide the number (x/o). * * @param o Number to divide by. * @return true if the operation was successful. */ bool divide(const Number &o); bool divide(long int i); /** Invert the number (1/x). * * @return true if the operation was successful. */ bool recip(); /** Raise the number (x^o). * * @param o Number to raise to. * @param try_exact If an exact solution should be tried first (might be slow). * @return true if the operation was successful. */ bool raise(const Number &o, bool try_exact = true); bool sqrt(); bool cbrt(); bool root(const Number &o); bool allroots(const Number &o, vector &roots); /** Multiply the number with a power of ten (x*10^o). * * @param o Number to raise 10 by. * @return true if the operation was successful. */ bool exp10(const Number &o); /** Multiply the number with a power of two (x*2^o). * * @param o Number to raise 2 by. * @return true if the operation was successful. */ bool exp2(const Number &o); /** Set the number to ten raised by the number (10^x). * * @return true if the operation was successful. */ bool exp10(); /** Set the number to two raised by the number (2^x). * * @return true if the operation was successful. */ bool exp2(); /** Raise the number by two (x^2). * * @return true if the operation was successful. */ bool square(); /** Negate the number (-x). * * @return true if the operation was successful. */ bool negate(); void setNegative(bool is_negative); bool abs(); bool signum(); bool round(const Number &o, bool halfway_to_even = true); bool floor(const Number &o); bool ceil(const Number &o); bool trunc(const Number &o); bool mod(const Number &o); bool isIntegerDivisible(const Number &o) const; bool isqrt(); bool isPerfectSquare() const; bool round(bool halfway_to_even = true); bool floor(); bool ceil(); bool trunc(); bool frac(); bool rem(const Number &o); bool smod(const Number &o); bool irem(const Number &o); bool irem(const Number &o, Number &q); bool iquo(const Number &o); bool iquo(unsigned long int i); bool iquo(const Number &o, Number &r); int getBoolean() const; void toBoolean(); void setTrue(bool is_true = true); void setFalse(); void setLogicalNot(); /** Set the number to e, the base of natural logarithm, calculated with the current default precision. */ void e(bool use_cached_number = true); /** Set the number to pi, Archimede's constant, calculated with the current default precision. */ void pi(); /** Set the number to Catalan's constant, calculated with the current default precision. */ void catalan(); /** Set the number to Euler's constant, calculated with the current default precision. */ void euler(); /** Set the number to Riemann's zeta with the number as integral point. The number must be an integer greater than one. * * @return true if the calculation was successful. */ bool zeta(); bool gamma(); bool digamma(); bool airy(); bool erf(); bool erfc(); bool besselj(const Number &o); bool bessely(const Number &o); bool sin(); bool asin(); bool sinh(); bool asinh(); bool cos(); bool acos(); bool cosh(); bool acosh(); bool tan(); bool atan(); bool atan2(const Number &o, bool allow_zero = false); bool arg(); bool tanh(); bool atanh(); bool ln(); bool log(const Number &o); bool exp(); bool lambertW(); bool gcd(const Number &o); bool lcm(const Number &o); bool polylog(const Number &o); bool igamma(const Number &o); bool expint(); bool logint(); bool sinint(); bool sinhint(); bool cosint(); bool coshint(); bool factorial(); bool multiFactorial(const Number &o); bool doubleFactorial(); bool binomial(const Number &m, const Number &k); bool factorize(vector &factors); void rand(); void intRand(const Number &ceil); bool add(const Number &o, MathOperation op); string printNumerator(int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) const; string printDenominator(int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) const; string printImaginaryNumerator(int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) const; string printImaginaryDenominator(int base = 10, bool display_sign = true, BaseDisplay base_display = BASE_DISPLAY_NORMAL, bool lower_case = false) const; string print(const PrintOptions &po = default_print_options, const InternalPrintStruct &ips = top_ips) const; }; ostream& operator << (ostream &os, const Number&); #endif libqalculate-2.8.2/libqalculate/QalculateDateTime.cc0000644000175000017500000025771513310147157017432 00000000000000/* Qalculate Copyright (C) 2018 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Many of the calendar conversion algorithms used here are adapted from CALENDRICA 4.0 -- Common Lisp Copyright (C) E. M. Reingold and N. Dershowitz */ #include "QalculateDateTime.h" #include "support.h" #include "util.h" #include "Calculator.h" #include "limits" #include static const char *HEBREW_MONTHS[] = {"Nisan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Marcheshvan", "Kislev", "Tevet", "Shevat", "Adar", "Adar II"}; static const char *STANDARD_MONTHS[] = {N_("January"), N_("February"), N_("March"), N_("April"), N_("May"), N_("June"), N_("July"), N_("August"), N_("September"), N_("October"), N_("November"), N_("December")}; static const char *COPTIC_MONTHS[] = {N_("Thout"), N_("Paopi"), N_("Hathor"), N_("Koiak"), N_("Tobi"), N_("Meshir"), N_("Paremhat"), N_("Parmouti"), N_("Pashons"), N_("Paoni"), N_("Epip"), N_("Mesori"), N_("Pi Kogi Enavot")}; static const char *ETHIOPIAN_MONTHS[] = {N_("Mäskäräm"), N_("ṬəqÉ™mt"), N_("Ḫədar"), N_("TaḫśaÅ›"), N_("Ṭərr"), N_("Yäkatit"), N_("Mägabit"), N_("Miyazya"), N_("GÉ™nbo"), N_("Säne"), N_("Ḥamle"), N_("Nähase"), N_("á¹–agume")}; static const char *ISLAMIC_MONTHS[] = {N_("Muḥarram"), N_("á¹¢afar"), N_("Rabī‘ al-awwal"), N_("Rabī‘ ath-thÄnÄ«"), N_("JumÄdá al-Å«lá"), N_("JumÄdá al-Äkhirah"), N_("Rajab"), N_("Sha‘bÄn"), N_("Ramaá¸Än"), N_("ShawwÄl"), N_("DhÅ« al-Qa‘dah"), N_("DhÅ« al-Ḥijjah")}; static const char *PERSIAN_MONTHS[] = {N_("Farvardin"), N_("Ordibehesht"), N_("Khordad"), N_("Tir"), N_("Mordad"), N_("Shahrivar"), N_("Mehr"), N_("Aban"), N_("Azar"), N_("Dey"), N_("Bahman"), N_("Esfand")}; static const char *INDIAN_MONTHS[] = {N_("Chaitra"), N_("VaishÄkha"), N_("JyÄ“shtha"), N_("Ä€shÄdha"), N_("ShrÄvana"), N_("Bhaadra"), N_("Ä€shwin"), N_("KÄrtika"), N_("Agrahayana"), N_("Pausha"), N_("MÄgha"), N_("Phalguna")}; static const char *CHINESE_ELEMENTS[] = {N_("Wood"), N_("Fire"), N_("Earth"), N_("Metal"), N_("Water")}; static const char *CHINESE_ANIMALS[] = {N_("Rat"), N_("Ox"), N_("Tiger"), N_("Rabbit"), N_("Dragon"), N_("Snake"), N_("Horse"), N_("Goat"), N_("Monkey"), N_("Rooster"), N_("Dog"), N_("Pig")}; static const bool has_leap_second[] = { // 30/6, 31/12 true, true, //1972 false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, false, //1980 true, false, true, false, true, false, false, false, true, false, false, false, false, true, false, false, false, true, false, true, //1990 false, false, true, false, true, false, true, false, false, true, false, false, true, false, false, true, false, false, false, false, //2000 false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, true, false, false, false, false, //2010 false, false, true, false, false, false, false, false, true, false, false, true //2016 }; #define LS_FIRST_YEAR 1972 #define LS_LAST_YEAR 2016 #define INITIAL_LS 10 #define SECONDS_PER_DAY 86400 bool isLeapYear(long int year) { return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); } int daysPerYear(long int year, int basis = 1) { switch(basis) { case 0: { return 360; } case 1: { if(isLeapYear(year)) { return 366; } else { return 365; } } case 2: { return 360; } case 3: { return 365; } case 4: { return 360; } } return -1; } int daysPerMonth(int month, long int year) { switch(month) { case 1: {} case 3: {} case 5: {} case 7: {} case 8: {} case 10: {} case 12: { return 31; } case 2: { if(isLeapYear(year)) return 29; else return 28; } default: { return 30; } } } int countLeapSeconds(const QalculateDateTime &date1, const QalculateDateTime &date2) { if(date1 > date2) return -countLeapSeconds(date2, date1); if(date1.year() > LS_LAST_YEAR) return 0; if(date2.year() < LS_FIRST_YEAR) return 0; size_t halfyear1 = 0; if(date1.year() >= LS_FIRST_YEAR) { halfyear1 = (date1.year() - LS_FIRST_YEAR) * 2; if(date1.month() > 6) halfyear1++; } size_t halfyear2 = 0; if(date2.year() >= LS_FIRST_YEAR) { halfyear2 = (date2.year() - LS_FIRST_YEAR) * 2; if(date2.month() <= 6) { if(halfyear2 == 0) return 0; halfyear2--; } } if(date1.second().isGreaterThanOrEqualTo(60) && date1.minute() == 59 && date1.hour() == 23 && ((date1.month() == 12 && date1.day() == 31) || (date1.month() == 6 && date1.day() == 30))) halfyear1++; int i_ls = 0; for(size_t i = halfyear1; i <= halfyear2 && i < sizeof(has_leap_second); i++) { if(has_leap_second[i]) { i_ls++; } } return i_ls; } QalculateDateTime nextLeapSecond(const QalculateDateTime &date) { if(date.year() > LS_LAST_YEAR) return QalculateDateTime(); size_t halfyear = 0; if(date.year() >= LS_FIRST_YEAR) { halfyear = (date.year() - LS_FIRST_YEAR) * 2; if(date.month() > 6) halfyear++; } if(date.second().isGreaterThanOrEqualTo(60) && date.minute() == 59 && date.hour() == 23 && ((date.month() == 12 && date.day() == 31) || (date.month() == 6 && date.day() == 30))) halfyear++; for(size_t i = halfyear; i < sizeof(has_leap_second); i++) { if(has_leap_second[i]) { QalculateDateTime dt; if(i % 2 == 1) dt.set(LS_FIRST_YEAR + i / 2, 12, 31); else dt.set(LS_FIRST_YEAR + i / 2, 6, 30); dt.setTime(23, 59, 60); return dt; } } return QalculateDateTime(); } QalculateDateTime prevLeapSecond(const QalculateDateTime &date) { if(date.year() < LS_FIRST_YEAR) return QalculateDateTime(); size_t halfyear = sizeof(has_leap_second); if(date.year() <= LS_LAST_YEAR) { halfyear = (date.year() - LS_FIRST_YEAR) * 2; if(date.month() <= 6) { if(halfyear == 0) return QalculateDateTime(); halfyear--; } } for(int i = halfyear; i >= 0; i--) { if(has_leap_second[(size_t) i]) { QalculateDateTime dt; if(i % 2 == 1) dt.set(LS_FIRST_YEAR + i / 2, 12, 31); else dt.set(LS_FIRST_YEAR + i / 2, 6, 30); dt.setTime(23, 59, 60); return dt; } } return QalculateDateTime(); } int dateTimeZone(time_t rawtime) { struct tm tmdate = *localtime(&rawtime); char buffer[10]; if(!strftime(buffer, 10, "%z", &tmdate)) { return 0; } string s = buffer; int h = s2i(s.substr(0, 3)); int m = s2i(s.substr(3)); return h * 60 + m; } int dateTimeZone(const QalculateDateTime &dt, bool b_utc) { struct tm tmdate; time_t rawtime; if(dt.year() > 2038) { if(isLeapYear(dt.year())) tmdate.tm_year = 136; else tmdate.tm_year = 137; } else if(dt.year() < 0) { if(isLeapYear(dt.year())) tmdate.tm_year = -1900; else tmdate.tm_year = 1 - 1900; } else { tmdate.tm_year = dt.year() - 1900; } tmdate.tm_mon = dt.month() - 1; tmdate.tm_mday = dt.day(); tmdate.tm_hour = dt.hour(); tmdate.tm_min = dt.minute(); Number nsect(dt.second()); nsect.trunc(); tmdate.tm_sec = nsect.intValue(); rawtime = mktime(&tmdate); if(rawtime == (time_t) -1 && (dt.year() != 1969 || dt.month() != 12 || dt.day() != 31)) { if(isLeapYear(dt.year())) tmdate.tm_year = 72; else tmdate.tm_year = 71; rawtime = mktime(&tmdate); } if(b_utc && (rawtime >= 0 || localtime(&rawtime))) rawtime += dateTimeZone(rawtime) * 60; if(rawtime < 0 && !localtime(&rawtime)) { if(isLeapYear(dt.year())) tmdate.tm_year = 72; else tmdate.tm_year = 71; rawtime = mktime(&tmdate); if(b_utc) rawtime += dateTimeZone(rawtime) * 60; } return dateTimeZone(rawtime); } QalculateDateTime::QalculateDateTime() : i_year(0), i_month(1), i_day(1), i_hour(0), i_min(0), b_time(false) {} QalculateDateTime::QalculateDateTime(long int initialyear, int initialmonth, int initialday) : i_year(0), i_month(1), i_day(1), i_hour(0), i_min(0), b_time(false) {set(initialyear, initialmonth, initialday);} QalculateDateTime::QalculateDateTime(const Number &initialtimestamp) : i_year(0), i_month(1), i_day(1), i_hour(0), i_min(0), b_time(false) {set(initialtimestamp);} QalculateDateTime::QalculateDateTime(string date_string) : i_year(0), i_month(1), i_day(1), i_hour(0), i_min(0), b_time(false) {set(date_string);} QalculateDateTime::QalculateDateTime(const QalculateDateTime &date) : i_year(date.year()), i_month(date.month()), i_day(date.day()), i_hour(date.hour()), i_min(date.minute()), n_sec(date.second()), b_time(date.timeIsSet()), parsed_string(date.parsed_string) {} void QalculateDateTime::setToCurrentDate() { parsed_string.clear(); struct tm tmdate; time_t rawtime; ::time(&rawtime); tmdate = *localtime(&rawtime); set(tmdate.tm_year + 1900, tmdate.tm_mon + 1, tmdate.tm_mday); } void QalculateDateTime::setToCurrentTime() { parsed_string.clear(); set(::time(NULL)); } bool QalculateDateTime::operator > (const QalculateDateTime &date2) const { if(i_year != date2.year()) return i_year > date2.year(); if(i_month != date2.month()) return i_month > date2.month(); if(i_day != date2.day()) return i_day > date2.day(); if(i_hour != date2.hour()) return i_hour > date2.hour(); if(i_min != date2.minute()) return i_min > date2.minute(); return n_sec.isGreaterThan(date2.second()); } bool QalculateDateTime::operator < (const QalculateDateTime &date2) const { if(i_year != date2.year()) return i_year < date2.year(); if(i_month != date2.month()) return i_month < date2.month(); if(i_day != date2.day()) return i_day < date2.day(); if(i_hour != date2.hour()) return i_hour < date2.hour(); if(i_min != date2.minute()) return i_min < date2.minute(); return n_sec.isLessThan(date2.second()); } bool QalculateDateTime::operator >= (const QalculateDateTime &date2) const { return !(*this < date2); } bool QalculateDateTime::operator <= (const QalculateDateTime &date2) const { return !(*this > date2); } bool QalculateDateTime::operator != (const QalculateDateTime &date2) const { return i_year != date2.year() || i_month != date2.month() || i_day > date2.day() || i_hour != date2.hour() || i_min != date2.minute() || !n_sec.equals(date2.second()); } bool QalculateDateTime::operator == (const QalculateDateTime &date2) const { return i_year == date2.year() && i_month == date2.month() && i_day == date2.day() && i_hour == date2.hour() && i_min == date2.minute() && n_sec.equals(date2.second()); } bool QalculateDateTime::isFutureDate() const { QalculateDateTime current_date; if(!b_time && i_hour == 0 && i_min == 0 && n_sec.isZero()) { current_date.setToCurrentDate(); } else { current_date.setToCurrentTime(); } return *this > current_date; } bool QalculateDateTime::isPastDate() const { QalculateDateTime current_date; if(!b_time && i_hour == 0 && i_min == 0 && n_sec.isZero()) { current_date.setToCurrentDate(); } else { current_date.setToCurrentTime(); } return *this < current_date; } bool QalculateDateTime::set(long int newyear, int newmonth, int newday) { parsed_string.clear(); if(newmonth < 1 || newmonth > 12) return false; if(newday < 1 || newday > daysPerMonth(newmonth, newyear)) return false; i_year = newyear; i_month = newmonth; i_day = newday; i_hour = 0; i_min = 0; n_sec.clear(); b_time = false; return true; } bool QalculateDateTime::set(const Number &newtimestamp) { parsed_string.clear(); if(!newtimestamp.isReal() || newtimestamp.isInterval()) return false; QalculateDateTime tmbak(*this); i_year = 1970; i_month = 1; i_day = 1; i_hour = 0; i_min = 0; n_sec.clear(); b_time = true; if(!addSeconds(newtimestamp, false, false) || !addMinutes(dateTimeZone(*this, true), false, false)) { set(tmbak); return false; } return true; } bool QalculateDateTime::set(string str) { long int newyear = 0, newmonth = 0, newday = 0; string str_bak(str); remove_blank_ends(str); if(equalsIgnoreCase(str, _("now")) || equalsIgnoreCase(str, "now")) { setToCurrentTime(); parsed_string = str_bak; return true; } else if(equalsIgnoreCase(str, _("today")) || equalsIgnoreCase(str, "today")) { setToCurrentDate(); parsed_string = str_bak; return true; } else if(equalsIgnoreCase(str, _("tomorrow")) || equalsIgnoreCase(str, "tomorrow")) { setToCurrentDate(); addDays(1); parsed_string = str_bak; return true; } else if(equalsIgnoreCase(str, _("yesterday")) || equalsIgnoreCase(str, "yesterday")) { setToCurrentDate(); addDays(-1); parsed_string = str_bak; return true; } bool b_t = false, b_tz = false; size_t i_t = str.find("T"); int newhour = 0, newmin = 0, newsec = 0; int itz = 0; if(i_t != string::npos && i_t < str.length() - 1 && is_in(NUMBERS, str[i_t + 1])) { b_t = true; string time_str = str.substr(i_t + 1); str.resize(i_t); char tzstr[10] = ""; if(sscanf(time_str.c_str(), "%2u:%2u:%2u%9s", &newhour, &newmin, &newsec, tzstr) < 3) { if(sscanf(time_str.c_str(), "%2u:%2u%9s", &newhour, &newmin, tzstr) < 2) { if(sscanf(time_str.c_str(), "%2u%2u%2u%9s", &newhour, &newmin, &newsec, tzstr) < 2) { #ifndef _WIN32 struct tm tmdate; if(strptime(time_str.c_str(), "%X", &tmdate) || strptime(time_str.c_str(), "%EX", &tmdate)) { newhour = tmdate.tm_hour; newmin = tmdate.tm_min; newsec = tmdate.tm_sec; } else { return false; } #else return false; #endif } } } string stz = tzstr; remove_blanks(stz); if(stz == "Z" || stz == "GMT" || stz == "UTC") { b_tz = true; } else if(stz.length() > 1 && (stz[0] == '-' || stz[0] == '+')) { unsigned int tzh = 0, tzm = 0; if(sscanf(stz.c_str() + sizeof(char), "%2u:%2u", &tzh, &tzm) > 0) { itz = tzh * 60 + tzm; if(str[0] == '-') itz = -itz; b_tz = true; } } } if(newhour >= 24 || newmin >= 60 || newsec > 60 || (newsec == 60 && (newhour != 23 || newmin != 59))) return false; gsub(SIGN_MINUS, MINUS, str); if(sscanf(str.c_str(), "%ld-%lu-%lu", &newyear, &newmonth, &newday) != 3) { if(sscanf(str.c_str(), "%4ld%2lu%2lu", &newyear, &newmonth, &newday) != 3) { #ifndef _WIN32 struct tm tmdate; if(strptime(str.c_str(), "%x", &tmdate) || strptime(str.c_str(), "%Ex", &tmdate)) { newyear = tmdate.tm_year + 1900; newmonth = tmdate.tm_mon + 1; newday = tmdate.tm_mday; } else { #endif if(sscanf(str.c_str(), "%ld/%ld/%ld", &newmonth, &newday, &newyear) != 3) { if(sscanf(str.c_str(), "%2ld%2lu%2lu", &newyear, &newmonth, &newday) != 3) { char c1, c2; if(sscanf(str.c_str(), "%ld%1c%ld%1c%ld", &newday, &c1, &newmonth, &c2, &newyear) != 5) { return false; } } if(newday > 31) { long int i = newday; newday = newyear; newyear = i; } if(newmonth > 12) { long int i = newday; newday = newmonth; newmonth = i; } } if(newmonth > 12) { long int i = newday; newday = newmonth; newmonth = i; } if(newday > 31) { long int i = newday; newday = newyear; newyear = i; } time_t rawtime; ::time(&rawtime); if(newyear >= 0 && newyear < 100) { if(newyear + 70 > localtime(&rawtime)->tm_year) newyear += 1900; else newyear += 2000; } } #ifndef _WIN32 } #endif } if(!set(newyear, newmonth, newday)) return false; if(b_t) { b_time = true; i_hour = newhour; i_min = newmin; n_sec = newsec; if(b_tz) { addMinutes(dateTimeZone(*this, true) - itz, false, false); } } parsed_string = str_bak; return true; } void QalculateDateTime::set(const QalculateDateTime &date) { parsed_string = date.parsed_string; i_year = date.year(); i_month = date.month(); i_day = date.day(); i_hour = date.hour(); i_min = date.minute(); n_sec = date.second(); b_time = date.timeIsSet(); } string QalculateDateTime::toISOString() const { string str = i2s(i_year); str += "-"; if(i_month < 10) { str += "0"; } str += i2s(i_month); str += "-"; if(i_day < 10) { str += "0"; } str += i2s(i_day); if(b_time || !n_sec.isZero() || i_hour != 0 || i_min != 0) { str += "T"; if(i_hour < 10) str += "0"; str += i2s(i_hour); str += ":"; if(i_min < 10) str += "0"; str += i2s(i_min); str += ":"; Number nsect(n_sec); nsect.trunc(); if(nsect.isLessThan(10)) str += "0"; str += nsect.print(); } return str; } string QalculateDateTime::toLocalString() const { if(i_year > INT_MAX || i_year < INT_MIN + 1900) return toISOString(); struct tm tmdate; tmdate.tm_year = i_year - 1900; tmdate.tm_mon = i_month - 1; tmdate.tm_mday = i_day; if(b_time || !n_sec.isZero() || i_hour != 0 || i_min != 0) { tmdate.tm_hour = i_hour; tmdate.tm_min = i_min; Number nsect(n_sec); nsect.trunc(); tmdate.tm_sec = nsect.intValue(); } else { tmdate.tm_hour = 0; tmdate.tm_min = 0; tmdate.tm_sec = 0; } char buffer[100]; if(!strftime(buffer, 100, "%xT%X", &tmdate)) { return toISOString(); } return buffer; } string QalculateDateTime::print(const PrintOptions &po) const { if(po.is_approximate && (!n_sec.isInteger() || n_sec.isApproximate())) *po.is_approximate = true; if(!n_sec.isInteger()) { Number nsec_fr(n_sec); nsec_fr.frac(); if(po.round_halfway_to_even) { Number nsec_t(n_sec); nsec_t.trunc(); if((nsec_t.isOdd() && nsec_fr.isGreaterThanOrEqualTo(nr_half)) || (nsec_t.isEven() && nsec_fr.isGreaterThan(nr_half))) { QalculateDateTime dt(*this); dt.setTime(i_hour, i_min, nsec_t); dt.addSeconds(1); return dt.print(po); } } else if(nsec_fr.isGreaterThanOrEqualTo(nr_half)) { QalculateDateTime dt(*this); Number nsec_t(n_sec); nsec_t.trunc(); dt.setTime(i_hour, i_min, nsec_t); dt.addSeconds(1); return dt.print(po); } } string str; if(po.time_zone == TIME_ZONE_LOCAL) { if(po.date_time_format == DATE_TIME_FORMAT_LOCALE) str = toLocalString(); else str = toISOString(); } else { QalculateDateTime dtz(*this); if(po.time_zone == TIME_ZONE_UTC) { dtz.addMinutes(-dateTimeZone(*this, false), false, false); } else { dtz.addMinutes(-dateTimeZone(*this, false) + po.custom_time_zone, false, false); } if(po.date_time_format == DATE_TIME_FORMAT_LOCALE) str = dtz.toLocalString(); else str = dtz.toISOString(); if(po.time_zone == TIME_ZONE_UTC) { str += "Z"; } else { if(po.custom_time_zone < 0) str += '+'; if(::abs(po.custom_time_zone) / 60 < 10) str += "0"; str += i2s(po.custom_time_zone / 60); str += ":"; if(po.custom_time_zone % 60 < 10) str += "0"; str += i2s(po.custom_time_zone % 60); } } if(po.use_unicode_signs && i_year < 0 && str.length() > 0 && str[0] == MINUS_CH && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MINUS, po.can_display_unicode_string_arg))) { str.replace(0, 1, SIGN_MINUS); } return str; } long int QalculateDateTime::year() const { return i_year; } long int QalculateDateTime::month() const { return i_month; } long int QalculateDateTime::day() const { return i_day; } long int QalculateDateTime::hour() const { return i_hour; } long int QalculateDateTime::minute() const { return i_min; } const Number &QalculateDateTime::second() const { return n_sec; } void QalculateDateTime::setYear(long int newyear) {i_year = newyear;} bool QalculateDateTime::timeIsSet() const {return b_time;} bool QalculateDateTime::setTime(long int ihour, long int imin, const Number &nsec) { parsed_string.clear(); i_hour = ihour; i_min = imin; n_sec = nsec; b_time = true; return true; } bool QalculateDateTime::addHours(const Number &nhours) { Number nmins(nhours); nmins *= 60; return addMinutes(nmins, true, true); } bool QalculateDateTime::addMinutes(const Number &nminutes, bool remove_leap_second, bool convert_to_utc) { parsed_string.clear(); if(!nminutes.isReal() || nminutes.isInterval()) return false; if(!nminutes.isInteger()) { Number newmins(nminutes); newmins.trunc(); QalculateDateTime dtbak(*this); if(!addMinutes(newmins, remove_leap_second, convert_to_utc)) return false; Number nsec(nminutes); nsec.frac(); nsec *= 60; if(!addSeconds(nsec, false, false)) { set(dtbak); return false; } return true; } QalculateDateTime dtbak(*this); if(convert_to_utc) { if(!addMinutes(-dateTimeZone(*this, false), false, false)) return false; } if(remove_leap_second && n_sec.isGreaterThanOrEqualTo(60)) { n_sec--; } Number nmins(nminutes); nmins /= 60; Number nhours(nmins); nhours.trunc(); nmins.frac(); nmins *= 60; i_min += nmins.lintValue(); if(i_min >= 60) { i_min -= 60; nhours++; } else if(i_min < 0) { i_min += 60; nhours--; } nhours /= 24; Number ndays(nhours); ndays.trunc(); nhours.frac(); nhours *= 24; i_hour = i_hour + nhours.lintValue(); if(i_hour >= 24) { i_hour -= 24; ndays++; } else if(i_hour < 0) { i_hour += 24; ndays--; } if(!addDays(ndays)) { set(dtbak); return false; } if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } return true; } bool QalculateDateTime::addDays(const Number &ndays) { parsed_string.clear(); if(!ndays.isReal() || ndays.isInterval()) return false; if(ndays.isZero()) return true; if(!ndays.isInteger()) { Number newdays(ndays); newdays.trunc(); QalculateDateTime dtbak(*this); if(!addDays(newdays)) return false; Number nmin(ndays); nmin.frac(); nmin *= 1440; if(!addMinutes(nmin, true, true)) { set(dtbak); return false; } return true; } long int newmonth = i_month, newyear = i_year; Number newnday(ndays); newnday += i_day; if(ndays.isNegative()) { bool check_aborted = newnday.isLessThan(-1000000L); while(newnday.isLessThanOrEqualTo(-14609700L)) { newnday += 14609700L; newyear -= 40000L; if(check_aborted && CALCULATOR && CALCULATOR->aborted()) return false; } while(newnday.isLessThanOrEqualTo(-146097L)) { newnday += 146097L; newyear -= 400; if(check_aborted && CALCULATOR && CALCULATOR->aborted()) return false; } while(newnday.isLessThanOrEqualTo(-daysPerYear(newmonth <= 2 ? newyear - 1 : newyear))) { newnday += daysPerYear(newmonth <= 2 ? newyear - 1 : newyear); newyear--; if(check_aborted && CALCULATOR && CALCULATOR->aborted()) return false; } while(newnday.isLessThan(1)) { newmonth--; if(newmonth < 1) { newyear--; newmonth = 12; } newnday += daysPerMonth(newmonth, newyear); } } else { bool check_aborted = newnday.isGreaterThan(1000000L); while(newnday.isGreaterThan(14609700L)) { newnday -= 14609700L; newyear += 40000; if(check_aborted && CALCULATOR && CALCULATOR->aborted()) return false; } while(newnday.isGreaterThan(146097L)) { newnday -= 146097L; newyear += 400; if(check_aborted && CALCULATOR && CALCULATOR->aborted()) return false; } while(newnday.isGreaterThan(daysPerYear(newmonth <= 2 ? newyear : newyear + 1))) { newnday -= daysPerYear(newmonth <= 2 ? newyear : newyear + 1); newyear++; if(check_aborted && CALCULATOR && CALCULATOR->aborted()) return false; } while(newnday.isGreaterThan(daysPerMonth(newmonth, newyear))) { newnday -= daysPerMonth(newmonth, newyear); newmonth++; if(newmonth > 12) { newyear++; newmonth = 1; } } } bool overflow = false; long int newday = newnday.lintValue(&overflow); if(overflow) return false; i_day = newday; i_month = newmonth; i_year = newyear; return true; } bool QalculateDateTime::addMonths(const Number &nmonths) { parsed_string.clear(); if(!nmonths.isReal() || nmonths.isInterval()) return false; if(!nmonths.isInteger()) { Number newmonths(nmonths); newmonths.trunc(); QalculateDateTime dtbak(*this); if(!addMonths(newmonths)) return false; Number nday(nmonths); nday.frac(); if(nday.isNegative()) { nday.negate(); nday *= daysPerMonth(i_month, i_year); if(nday.isGreaterThanOrEqualTo(i_day - 1)) { nday /= daysPerMonth(i_month, i_year); Number idayfrac(i_day - 1); Number secfrac(i_hour * 3600 + i_min * 60); secfrac += n_sec; secfrac /= 86400; idayfrac += secfrac; idayfrac /= daysPerMonth(i_month, i_year); nday -= idayfrac; nday *= daysPerMonth(i_month == 1 ? 12 : i_month - 1, i_year); idayfrac *= daysPerMonth(i_month, i_year); nday += idayfrac; } nday.negate(); } else { nday *= daysPerMonth(i_month, i_year); if(nday.isGreaterThanOrEqualTo(daysPerMonth(i_month, i_year) - i_day)) { nday /= daysPerMonth(i_month, i_year); Number idayfrac(daysPerMonth(i_month, i_year) - i_day); Number secfrac(i_hour * 3600 + i_min * 60); secfrac += n_sec; secfrac /= 86400; idayfrac -= secfrac; idayfrac /= daysPerMonth(i_month, i_year); nday -= idayfrac; nday *= daysPerMonth(i_month == 12 ? 1 : i_month + 1, i_year); idayfrac *= daysPerMonth(i_month, i_year); nday += idayfrac; } } if(!addDays(nday)) { set(dtbak); return false; } return true; } bool overflow = false; long int months = nmonths.lintValue(&overflow); if(overflow) return false; if(i_year > 0 && months > 0 && (unsigned long int) months / 12 + i_year > (unsigned long int) LONG_MAX) return false; if(i_year < 0 && months < 0 && (unsigned long int) (-months / 12) - i_year > (unsigned long int) LONG_MAX) return false; i_year += months / 12; i_month += months % 12; if(i_month > 12) { i_month -= 12; i_year += 1; } else if(i_month < 1) { i_month += 12; i_year -= 1; } if(i_day > daysPerMonth(i_month, i_year)) { i_day -= daysPerMonth(i_month, i_year); i_month++; if(i_month > 12) { i_month -= 12; i_year += 1; } } return true; } bool QalculateDateTime::addYears(const Number &nyears) { parsed_string.clear(); if(!nyears.isReal() || nyears.isInterval()) return false; if(!nyears.isInteger()) { Number newyears(nyears); newyears.trunc(); QalculateDateTime dtbak(*this); if(!addYears(newyears)) return false; Number nday(nyears); nday.frac(); if(nday.isZero()) return true; long int idoy = yearday(); if(nday.isNegative()) { nday.negate(); nday *= daysPerYear(i_year); if(nday.isGreaterThanOrEqualTo(idoy - 1)) { nday /= daysPerYear(i_year); Number idayfrac(idoy - 1); Number secfrac(i_hour * 3600 + i_min * 60); secfrac += n_sec; secfrac /= 86400; idayfrac += secfrac; idayfrac /= daysPerYear(i_year); nday -= idayfrac; nday *= daysPerYear(i_year - 1); idayfrac *= daysPerYear(i_year); nday += idayfrac; } nday.negate(); } else { nday *= daysPerYear(i_year); if(nday.isGreaterThanOrEqualTo(daysPerYear(i_year) - idoy)) { nday /= daysPerYear(i_year); Number idayfrac(idoy - 1); Number secfrac(i_hour * 3600 + i_min * 60); secfrac += n_sec; secfrac /= 86400; idayfrac -= secfrac; idayfrac /= daysPerYear(i_year); nday -= idayfrac; nday *= daysPerYear(i_year + 1); idayfrac *= daysPerYear(i_year); nday += idayfrac; } } if(!addDays(nday)) { set(dtbak); return false; } return true; } bool overflow = false; long int years = nyears.lintValue(&overflow); if(overflow) return false; if(i_year > 0 && years > 0 && (unsigned long int) years + i_year > (unsigned long int) LONG_MAX) return false; if(i_year < 0 && years < 0 && (unsigned long int) (-years) - i_year > (unsigned long int) LONG_MAX) return false; i_year += years; if(i_day > daysPerMonth(i_month, i_year)) { i_day -= daysPerMonth(i_month, i_year); i_month++; if(i_month > 12) { i_month -= 12; i_year += 1; } } return true; } bool QalculateDateTime::addSeconds(const Number &seconds, bool count_leap_seconds, bool convert_to_utc) { parsed_string.clear(); if(!seconds.isReal() || seconds.isInterval()) return false; if(seconds.isZero()) return true; QalculateDateTime dtbak(*this); if(convert_to_utc) { if(!addMinutes(-dateTimeZone(*this, false), false, false)) return false; } b_time = true; if(count_leap_seconds) { if(seconds.isPositive()) { Number nsum(i_hour * 3600 + i_min * 60); nsum += n_sec; nsum += seconds; if(nsum.isLessThan(SECONDS_PER_DAY)) { if(!addSeconds(seconds, false, false)) {set(dtbak); return false;} if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } return true; } } else { Number nsum(i_hour * 3600 + i_min * 60); nsum += n_sec; nsum += seconds; if(nsum.isZero()) { i_hour = 0; i_min = 0; n_sec.clear(true); if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } } else if(nsum.isPositive()) { if(!addSeconds(seconds, false, false)) {set(dtbak); return false;} if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } return true; } } Number nr_frac(n_sec); nr_frac.frac(); n_sec.trunc(); Number secnew(seconds); secnew += nr_frac; nr_frac = secnew; nr_frac.frac(); secnew.trunc(); if(secnew.isZero()) { n_sec += nr_frac; if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } return true; } if(secnew.isNegative() || nr_frac.isNegative()) { if(nr_frac.isNegative()) { nr_frac++; secnew--; } QalculateDateTime dt_nls = prevLeapSecond(*this); while(dt_nls.year() != 0) { Number n_sto = secondsTo(dt_nls, true, false); n_sto--; if(n_sto.isLessThan(secnew)) { break; } else if(n_sto.equals(secnew)) { set(dt_nls); n_sec += nr_frac; if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } return true; } set(dt_nls); n_sec--; secnew -= n_sto; secnew++; dt_nls = prevLeapSecond(*this); } secnew += nr_frac; if(!addSeconds(secnew, false, false)) {set(dtbak); return false;} if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } return true; } else { if(i_hour == 23 && i_min == 59 && n_sec == 60) { secnew--; } QalculateDateTime dt_nls = nextLeapSecond(*this); while(dt_nls.year() != 0) { Number n_sto = secondsTo(dt_nls, true, false); if(n_sto.isGreaterThan(secnew)) { break; } else if(n_sto.equals(secnew)) { set(dt_nls); n_sec += nr_frac; if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } return true; } set(dt_nls); addDays(1); i_hour = 0; i_min = 0; n_sec.clear(); secnew -= n_sto; secnew--; dt_nls = nextLeapSecond(*this); } secnew += nr_frac; if(!addSeconds(secnew, false, false)) {set(dtbak); return false;} if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } return true; } } if(!n_sec.add(seconds)) {set(dtbak); return false;} if(n_sec.isNegative()) { if(n_sec.isLessThan(-60)) { n_sec /= 60; Number nmins(n_sec); nmins.trunc(); n_sec.frac(); n_sec *= 60; if(n_sec.isNegative()) { n_sec += 60; nmins--; } if(!addMinutes(nmins, false, false)) {set(dtbak); return false;} } else { n_sec += 60; if(!addMinutes(-1, false, false)) {set(dtbak); return false;} } } else if(n_sec.isGreaterThanOrEqualTo(60)) { n_sec /= 60; Number nmins(n_sec); nmins.trunc(); n_sec.frac(); n_sec *= 60; if(!addMinutes(nmins, false, false)) {set(dtbak); return false;} } if(convert_to_utc) { if(!addMinutes(dateTimeZone(*this, true), false, false)) {set(dtbak); return false;} } return true; } bool QalculateDateTime::add(const QalculateDateTime &date) { parsed_string.clear(); QalculateDateTime dtbak(*this); if(date.timeIsSet()) b_time = true; if(!addYears(date.year()) || !addMonths(date.month()) || !addDays(date.day())) { set(dtbak); return false; } if(!date.second().isZero() || date.hour() != 0 || date.minute() != 0) { Number nsec(date.hour() * 3600 + date.minute() * 60); nsec += date.second(); if(!addSeconds(nsec, true, true)) { set(dtbak); return false; } } return true; } int QalculateDateTime::weekday() const { Number nr(daysTo(QalculateDateTime(2017, 7, 31))); if(nr.isInfinite()) return -1; nr.negate(); nr.trunc(); nr.rem(Number(7, 1)); if(nr.isNegative()) return 8 + nr.intValue(); return nr.intValue() + 1; } int QalculateDateTime::week(bool start_sunday) const { if(start_sunday) { int yday = yearday(); QalculateDateTime date1(i_year, 1, 1); int wday = date1.weekday() + 1; if(wday < 0) return -1; if(wday == 8) wday = 1; yday += (wday - 2); int week = yday / 7 + 1; if(week > 52) week = 1; return week; } if(i_month == 12 && i_day >= 29 && weekday() <= i_day - 28) { return 1; } else { QalculateDateTime date(i_year, i_month, i_day); week_rerun: int week1; int day1 = date.yearday(); QalculateDateTime date1(date.year(), 1, 1); int wday = date1.weekday(); if(wday < 0) return -1; day1 -= (8 - wday); if(wday <= 4) { week1 = 1; } else { week1 = 0; } if(day1 > 0) { day1--; week1 += day1 / 7 + 1; } if(week1 == 0) { date.set(date.year() - 1, 12, 31); goto week_rerun; } return week1; } } int QalculateDateTime::yearday() const { int yday = 0; for(long int i = 1; i < i_month; i++) { yday += daysPerMonth(i, i_year); } return yday + i_day; } Number QalculateDateTime::timestamp(bool reverse_utc) const { QalculateDateTime date(nr_zero); return date.secondsTo(*this, false, !reverse_utc); } Number QalculateDateTime::secondsTo(const QalculateDateTime &date, bool count_leap_seconds, bool convert_to_utc) const { if(convert_to_utc) { QalculateDateTime dt1(*this), dt2(date); dt1.addMinutes(-dateTimeZone(dt1, false), false, false); dt2.addMinutes(-dateTimeZone(dt2, false), false, false); return dt1.secondsTo(dt2, count_leap_seconds, false); } Number nr = daysTo(date, 1, true, !count_leap_seconds); nr *= SECONDS_PER_DAY; if(count_leap_seconds) { nr += countLeapSeconds(*this, date); } return nr; } Number QalculateDateTime::daysTo(const QalculateDateTime &date, int basis, bool date_func, bool remove_leap_seconds) const { Number nr; if(basis < 0 || basis > 4) basis = 1; bool neg = false; bool isleap = false; long int days, years; long int day1 = i_day, month1 = i_month, year1 = i_year; long int day2 = date.day(), month2 = date.month(), year2 = date.year(); Number t1(n_sec), t2(date.second()); if(remove_leap_seconds) { if(t1.isGreaterThanOrEqualTo(60)) t1--; if(t2.isGreaterThanOrEqualTo(60)) t2--; } t1 += i_hour * 3600 + i_min * 60; t2 += date.hour() * 3600 + date.minute() * 60; if(year1 > year2 || (year1 == year2 && month1 > month2) || (year1 == year2 && month1 == month2 && day1 > day2) || (basis == 1 && date_func && year1 == year2 && month1 == month2 && day1 == day2 && t1.isGreaterThan(t2))) { int year3 = year1, month3 = month1, day3 = day1; year1 = year2; month1 = month2; day1 = day2; year2 = year3; month2 = month3; day2 = day3; Number t3(t1); t1 = t2; t2 = t3; neg = true; } years = year2 - year1; days = day2 - day1; isleap = isLeapYear(year1); switch(basis) { case 0: { nr.set(years, 1, 0); nr *= 12; nr += (month2 - month1); nr *= 30; nr += days; if(date_func) { if(month1 == 2 && ((day1 == 28 && !isleap) || (day1 == 29 && isleap)) && !(month2 == month1 && day1 == day2 && year1 == year2)) { if(isleap) nr -= 1; else nr -= 2; } else if(day1 == 31 && day2 < 31) { nr++; } } else { if(month1 == 2 && month2 != 2 && year1 == year2) { if(isleap) nr -= 1; else nr -= 2; } } break; } case 1: {} case 2: {} case 3: { int month4 = month2; bool b; if(years > 0) { month4 = 12; b = true; } else { b = false; } nr.set(days, 1, 0); for(; month1 < month4 || b; month1++) { if(month1 > month4 && b) { b = false; month1 = 1; month4 = month2; if(month1 == month2) break; } if(!b) { nr += daysPerMonth(month1, year2); } else { nr += daysPerMonth(month1, year1); } } if(basis == 1 && !t1.equals(t2)) { t2 -= t1; t2 /= 86400; nr += t2; } if(years == 0) break; bool check_aborted = years > 10000L; for(year1 += 1; year1 < year2; year1++) { if(check_aborted && CALCULATOR && CALCULATOR->aborted()) { nr.setPlusInfinity(); return nr; } if(isLeapYear(year1)) nr += 366; else nr += 365; } break; } case 4: { nr.set(years, 1, 0); nr *= 12; nr += (month2 - month1); if(date_func) { if(day2 == 31 && day1 < 31) days--; if(day1 == 31 && day2 < 31) days++; } nr *= 30; nr += days; break; } } if(neg) nr.negate(); return nr; } Number QalculateDateTime::yearsTo(const QalculateDateTime &date, int basis, bool date_func, bool remove_leap_seconds) const { Number nr; if(basis < 0 || basis > 4) basis = 1; if(basis == 1) { if(date.year() == i_year) { nr.set(daysTo(date, basis, date_func)); nr.divide(daysPerYear(i_year, basis)); } else { bool neg = false; long int day1 = i_day, month1 = i_month, year1 = i_year; long int day2 = date.day(), month2 = date.month(), year2 = date.year(); Number t1(n_sec), t2(date.second()); if(remove_leap_seconds) { if(t1.isGreaterThanOrEqualTo(60)) t1--; if(t2.isGreaterThanOrEqualTo(60)) t2--; } t1 += i_hour * 3600 + i_min * 60; t2 += date.hour() * 3600 + date.minute() * 60; if(year1 > year2) { int year3 = year1, month3 = month1, day3 = day1; year1 = year2; month1 = month2; day1 = day2; year2 = year3; month2 = month3; day2 = day3; Number t3(t1); t1 = t2; t2 = t3; neg = true; } t1 /= 86400; t2 /= 86400; for(int month = 12; month > month1; month--) { nr += daysPerMonth(month, year1); } nr += daysPerMonth(month1, year1) - day1 + 1; nr -= t1; for(int month = 1; month < month2; month++) { nr += daysPerMonth(month, year2); } nr += day2 - 1; nr += t2; bool check_aborted = (year2 - year1) > 10000L; Number days_of_years; for(int year = year1; year <= year2; year++) { if(check_aborted && CALCULATOR && CALCULATOR->aborted()) { nr.setPlusInfinity(); return nr; } days_of_years += daysPerYear(year, basis); if(year != year1 && year != year2) { nr += daysPerYear(year, basis); } } days_of_years /= year2 + 1 - year1; nr /= days_of_years; if(neg) nr.negate(); } } else { nr.set(daysTo(date, basis, date_func)); nr.divide(daysPerYear(0, basis)); } return nr; } long int quotient(long int i, long int d) { i /= d; if((i < 0) != (d < 0)) i--; return i; } Number quotient(Number nr, long int d) { nr /= d; nr.floor(); return nr; } void cal_div(const Number &nr_n, long int nr_d, Number &nr_q, Number &nr_r) { nr_q = nr_n; nr_q /= nr_d; nr_q.floor(); nr_r = nr_n; nr_r.mod(nr_d); } void cal_div(const Number &nr_n, long int nr_d, Number &nr_q) { nr_q = nr_n; nr_q /= nr_d; nr_q.floor(); } void cal_div(Number &nr_n, long int nr_d) { nr_n /= nr_d; nr_n.floor(); } #define GREGORIAN_EPOCH 1 #define JULIAN_EPOCH -1 // (date_to_fixed(0, 12, 30, CALENDAR_GREGORIAN)) #define ISLAMIC_EPOCH 227015 // date_to_fixed(622, 7, 16, CALENDAR_JULIAN) #define PERSIAN_EPOCH 226896 // date_to_fixed(622, 3, 19, CALENDAR_JULIAN) #define JD_EPOCH (Number("-1721424.5")) #define EGYPTIAN_EPOCH -272787L //jd_to_fixed(1448638)) #define HEBREW_EPOCH -1373427 //date_to_fixed(-3761, 10, 7, CALENDAR_JULIAN) #define COPTIC_EPOCH 103605 #define ETHIOPIAN_EPOCH 2796 #define CHINESE_EPOCH -963099L //date_to_fixed(-2636, 2, 15, CALENDAR_GREGORIAN) #define MEAN_TROPICAL_YEAR (Number("365.242189")) #define MEAN_SIDEREAL_YEAR (Number("365.25636")) #define MEAN_SYNODIC_MONTH (Number("29.530588861")) Number jd_to_fixed(Number jd) { jd += JD_EPOCH; jd.floor(); return jd; } bool cjdn_to_date(Number J, long int &y, long int &m, long int &d, CalendarSystem ct); Number date_to_cjdn(long int j, long int m, long int d, CalendarSystem ct); bool fixed_to_date(Number date, long int &y, long int &m, long int &d, CalendarSystem ct); Number date_to_fixed(long int y, long int m, long int d, CalendarSystem ct); long int gregorian_year_from_fixed(Number date) { Number d0, n400, d1, n100, d2, n4, d3, n1, year; d0 = date; d0 -= 1; cal_div(d0, 146097, n400, d1); cal_div(d1, 36524, n100, d2); cal_div(d2, 1461, n4, d3); cal_div(d3, 365, n1); if(!n100.equals(4) && !n1.equals(4)) year = 1; else year = 0; n400 *= 400; n100 *= 100; n4 *= 4; year += n400; year += n100; year += n4; year += n1; return year.lintValue(); } Number gregorian_date_difference(long int y1, long int m1, long int d1, long int y2, long int m2, long int d2) { Number f1 = date_to_fixed(y2, m2, d2, CALENDAR_GREGORIAN); f1 -= date_to_fixed(y1, m1, d1, CALENDAR_GREGORIAN); return f1; } Number ephemeris_correction(Number tee) { tee.floor(); Number year = gregorian_year_from_fixed(tee); if(year > 2150 || year < -500) { year -= 1820; year /= 100; Number x(year); Number t, a; t = -20; a += t; x *= year; t = 32; t *= x; a += t; a /= 86400; return a; } else if(year < 500) { year /= 100; Number x(year); Number t, a; t.setFloat(10583.6L); a += t; t.setFloat(-1014.41L); t *= x; a += t; x *= year; t.setFloat(33.78311L); t *= x; a += t; x *= year; t.setFloat(-5.952053L); t *= x; a += t; x *= year; t.setFloat(-0.1798452L); t *= x; a += t; x *= year; t.setFloat(0.022174192L); t *= x; a += t; x *= year; t.setFloat(0.0090316521L); t *= x; a += t; a /= 86400; return a; } else if(year < 1600) { year -= 1000; year /= 100; Number x(year); Number t, a; t.setFloat(1574.2L); a += t; t.setFloat(-556.01L); t *= x; a += t; x *= year; t.setFloat(71.23472L); t *= x; a += t; x *= year; t.setFloat(0.319781L); t *= x; a += t; x *= year; t.setFloat(-0.8503463L); t *= x; a += t; x *= year; t.setFloat(-0.005050998L); t *= x; a += t; x *= year; t.setFloat(0.0083572073L); t *= x; a += t; a /= 86400; return a; } else if(year < 1700) { year -= 1600; Number x(year); Number t, a; t = 120; a += t; t.setFloat(-0.9808L); t *= x; a += t; x *= year; t.setFloat(-0.01532L); t *= x; a += t; x *= year; t.setFloat(0.000140272128L); t *= x; a += t; a /= 86400; return a; } else if(year < 1800) { year -= 1700; Number x(year); Number t, a; t.setFloat(8.118780842L); a += t; t.setFloat(-0.005092142L); t *= x; a += t; x *= year; t.setFloat(0.003336121L); t *= x; a += t; x *= year; t.setFloat(-0.0000266484L); t *= x; a += t; a /= 86400; return a; } else if(year < 1900) { Number c = gregorian_date_difference(1900, 1, 1, year.lintValue(), 7, 1); c /= 36525; year = c; Number x(year); Number t, a; t.setFloat(-0.000009L); a += t; t.setFloat(0.003844L); t *= x; a += t; x *= year; t.setFloat(0.083563L); t *= x; a += t; x *= year; t.setFloat(0.865736L); t *= x; a += t; x *= year; t.setFloat(4.867575L); t *= x; a += t; x *= year; t.setFloat(15.845535L); t *= x; a += t; x *= year; t.setFloat(31.332267L); t *= x; a += t; x *= year; t.setFloat(38.291999L); t *= x; a += t; x *= year; t.setFloat(28.316289L); t *= x; a += t; x *= year; t.setFloat(11.636204L); t *= x; a += t; x *= year; t.setFloat(2.043794L); t *= x; a += t; return a; } else if(year < 1987) { Number c = gregorian_date_difference(1900, 1, 1, year.lintValue(), 7, 1); c /= 36525; year = c; Number x(year); Number t, a; t.setFloat(-0.00002L); a += t; t.setFloat(0.000297L); t *= x; a += t; x *= year; t.setFloat(0.025184L); t *= x; a += t; x *= year; t.setFloat(-0.181133L); t *= x; a += t; x *= year; t.setFloat(0.553040L); t *= x; a += t; x *= year; t.setFloat(-0.861938L); t *= x; a += t; x *= year; t.setFloat(0.677066L); t *= x; a += t; x *= year; t.setFloat(-0.212591L); t *= x; a += t; return a; } else if(year < 2006) { year -= 2000; Number x(year); Number t, a; t.setFloat(63.86L); a += t; t.setFloat(0.3345L); t *= x; a += t; x *= year; t.setFloat(-0.060374L); t *= x; a += t; x *= year; t.setFloat(0.0017275L); t *= x; a += t; x *= year; t.setFloat(0.000651814L); t *= x; a += t; x *= year; t.setFloat(0.00002373599L); t *= x; a += t; a /= 86400; return a; } else if(year <= 2050) { year -= 2000; Number x(year); Number t, a; t.setFloat(62.92L); a += t; t.setFloat(0.32217L); t *= x; a += t; x *= year; t.setFloat(0.005589L); t *= x; a += t; a /= 86400; return a; } else { Number year2(year); year2 -= 1820; year2 /= 100; year2.square(); year2 *= 32; year2 -= 20; year.negate(); year += 2150; year *= Number(5628, 10000); year += year2; year /= 86400; return year; } } Number dynamical_from_universal(Number tee_rom_u) { tee_rom_u += ephemeris_correction(tee_rom_u); return tee_rom_u; } #define J2000 Number("730120.5") Number julian_centuries(Number tee) { tee = dynamical_from_universal(tee); tee -= J2000; tee /= 36525; return tee; } Number nutation(Number tee) { Number c = julian_centuries(tee); Number cap_a; Number t, x(c); t.setFloat(124.90L); cap_a += t; t.setFloat(-1934.134L); t *= x; cap_a += t; x *= c; t.setFloat(0.002063L); t *= x; cap_a += t; Number cap_b; x = c; t.setFloat(201.11L); cap_b += t; t.setFloat(72001.5377L); t *= x; cap_b += t; x *= c; t.setFloat(0.00057L); t *= x; cap_b += t; Number nr_pi; nr_pi.pi(); t.setFloat(-0.004778L); cap_a *= nr_pi; cap_a /= 180; cap_a.sin(); cap_a *= t; t.setFloat(-0.0003667L); cap_b *= nr_pi; cap_b /= 180; cap_b.sin(); cap_b *= t; cap_a += cap_b; return cap_a; } Number aberration(Number tee) { Number c = julian_centuries(tee); Number t; t.setFloat(35999.01848L); c *= t; t.setFloat(177.63L); c += t; Number nr_pi; nr_pi.pi(); c *= nr_pi; c /= 180; c.cos(); t.setFloat(0.0000974L); c *= t; t.setFloat(0.005575L); c -= t; return c; } Number solar_longitude(Number tee) { Number c = julian_centuries(tee); Number lam; lam.setFloat(282.7771834L); Number t2; t2.setFloat(36000.76953744L); t2 *= c; Number t3; long int coefficients[] = { 403406L, 195207L, 119433L, 112392L, 3891L, 2819L, 1721L, 660L, 350L, 334L, 314L, 268L, 242L, 234L, 158L, 132L, 129L, 114L, 99L, 93L, 86L, 78L, 72L, 68L, 64L, 46L, 38L, 37L, 32L, 29L, 28L, 27L, 27L, 25L, 24L, 21L, 21L, 20L, 18L, 17L, 14L, 13L, 13L, 13L, 12L, 10L, 10L, 10L, 10L, -1L }; long double multipliers[] = { 0.9287892L, 35999.1376958L, 35999.4089666L, 35998.7287385L, 71998.20261L, 71998.4403L, 36000.35726L, 71997.4812L, 32964.4678L, -19.4410L, 445267.1117L, 45036.8840L, 3.1008L, 22518.4434L, -19.9739L, 65928.9345L, 9038.0293L, 3034.7684L, 33718.148L, 3034.448L, -2280.773L, 29929.992L, 31556.493L, 149.588L, 9037.750L, 107997.405L, -4444.176L, 151.771L, 67555.316L, 31556.080L, -4561.540L, 107996.706L, 1221.655L, 62894.167L, 31437.369L, 14578.298L, -31931.757L, 34777.243L, 1221.999L, 62894.511L, -4442.039L, 107997.909L, 119.066L, 16859.071L, -4.578L, 26895.292L, -39.127L, 12297.536L, 90073.778L }; long double addends[] = { 270.54861L, 340.19128L, 63.91854L, 331.26220L, 317.843L, 86.631L, 240.052L, 310.26L, 247.23L, 260.87L, 297.82L, 343.14L, 166.79L, 81.53L, 3.50L, 132.75L, 182.95L, 162.03L, 29.8L, 266.4L, 249.2L, 157.6L, 257.8L, 185.1L, 69.9L, 8.0L, 197.1L, 250.4L, 65.3L, 162.7L, 341.5L, 291.6L, 98.5L, 146.7L, 110.0L, 5.2L, 342.6L, 230.9L, 256.1L, 45.3L, 242.9L, 115.2L, 151.8L, 285.3L, 53.3L, 126.6L, 205.7L, 85.9L, 146.1L }; Number x, y, z, nr_pi; nr_pi.pi(); for(size_t i = 0; coefficients[i] >= 0; i++) { x = coefficients[i]; y.setFloat(addends[i]); z.setFloat(multipliers[i]); z *= c; z += y; z *= nr_pi; z /= 180; z.sin(); z *= x; t3 += z; } Number t; t.setFloat(0.000005729577951308232L); t3 *= t; lam += t2; lam += t3; lam += aberration(tee); lam += nutation(tee); lam.mod(360); return lam; } Number solar_longitude_after(Number longitude, Number tee) { Number rate = MEAN_TROPICAL_YEAR; rate /= 360; Number tau(longitude); tau -= solar_longitude(tee); tau.mod(360); tau *= rate; tau += tee; Number a(tau); a -= 5; if(tee > a) a = tee; Number b(tau); b += 5; Number along = solar_longitude(a); Number blong = solar_longitude(b); Number precexp(1, 1, -5); Number long_low(longitude); long_low -= precexp; Number long_high(longitude); long_high += precexp; if(long_low < 0) long_low += 360; if(long_high > 360) long_high -= 360; Number newlong; Number test(a); while(true) { if(CALCULATOR->aborted()) return nr_zero; test = b; test -= a; test /= 2; test += a; newlong = solar_longitude(test); if(long_high < long_low) { if(newlong >= long_low || newlong <= long_high) return test; } else { if(newlong >= long_low && newlong <= long_high) return test; } if(along > blong) { if((newlong > longitude && newlong < along) || (newlong < longitude && newlong < along)) b = test; else a = test; } else { if(newlong > longitude) b = test; else a = test; } } } Number obliquity(Number tee) { Number c = julian_centuries(tee); tee.setFloat(21.448L); tee /= 60; tee += 26; tee /= 60; tee += 23; Number t, x(c); t.setFloat(-46.8150L); t /= 3600; t *= x; tee += t; x *= c; t.setFloat(-0.00059L); t /= 3600; t *= x; tee += t; x *= c; t.setFloat(0.001813L); t /= 3600; t *= x; tee += t; return tee; } Number cal_poly(Number c, size_t n, ...) { va_list ap; va_start(ap, n); Number x(1, 1, 0), t, poly; for(size_t i = 0; i < n; i++) { t.setFloat(va_arg(ap, long double)); t *= x; poly += t; x *= c; } va_end(ap); return poly; } Number equation_of_time(Number tee) { Number c = julian_centuries(tee); vector a; Number lam, anomaly, eccentricity; Number t, x(c); t.setFloat(280.46645L); lam += t; t.setFloat(36000.76983L); t *= x; lam += t; x *= c; t.setFloat(0.0003032L); t *= x; lam += t; x = c; t.setFloat(357.52910L); anomaly += t; t.setFloat(35999.05030L); t *= x; anomaly += t; x *= c; t.setFloat(-0.0001559L); t *= x; anomaly += t; x *= c; t.setFloat(-0.00000048L); t *= x; anomaly += t; x = c; t.setFloat(0.016708617L); eccentricity += t; t.setFloat(-0.000042037L); t *= x; eccentricity += t; x *= c; t.setFloat(-0.0000001236L); t *= x; eccentricity += t; Number varepsilon = obliquity(tee); Number nr_pi; nr_pi.pi(); Number y(varepsilon); y /= 2; y *= nr_pi; y /= 180; y.tan(); y.square(); Number equation(1, 2); equation /= nr_pi; Number e1(lam); e1 *= 2; e1 *= nr_pi; e1 /= 180; e1.sin(); e1 *= y; Number e2(anomaly); e2 *= nr_pi; e2 /= 180; e2.sin(); e2 *= eccentricity; Number e3(lam); e3 *= 2; e3 *= nr_pi; e3 /= 180; e3.cos(); e3 *= e2; e3 *= y; e3 *= 4; e2 *= -2; Number e4(lam); e4 *= 4; e4 *= nr_pi; e4 /= 180; e4.sin(); e4 *= y; e4 *= y; e4 /= -2; Number e5(anomaly); e5 *= 2; e5 *= nr_pi; e5 /= 180; e5.sin(); e5 *= eccentricity; e5 *= eccentricity; e5 *= -5; e5 /= 4; e1 += e2; e1 += e3; e1 += e4; e1 += e5; equation *= e1; bool b_neg = equation.isNegative(); equation.abs(); if(equation < nr_half) { if(b_neg) equation.negate(); return equation; } else { if(b_neg) return nr_minus_half; return nr_half; } } Number zone_from_longitude(Number phi) { phi /= 360; return phi; } Number universal_from_local(Number tee_ell, Number longitude) { tee_ell -= zone_from_longitude(longitude); return tee_ell; } Number local_from_apparent(Number tee, Number longitude) { tee -= equation_of_time(universal_from_local(tee, longitude)); return tee; } Number universal_from_apparent(Number tee, Number longitude) { return universal_from_local(local_from_apparent(tee, longitude), longitude); } Number universal_from_standard(Number tee_rom_s, Number zone) { tee_rom_s -= zone; return tee_rom_s; } Number standard_from_universal(Number tee_rom_u, Number zone) { tee_rom_u += zone; return tee_rom_u; } Number standard_from_local(Number tee_ell, Number longitude, Number zone) { return standard_from_universal(universal_from_local(tee_ell, longitude), zone); } Number midday2(Number date, Number longitude, Number zone) { date += nr_half; return standard_from_local(local_from_apparent(date, longitude), longitude, zone); } Number midday(Number date, Number longitude) { date += nr_half; return universal_from_apparent(date, longitude); } #define TEHRAN_LONGITUDE Number("51.42") #define TEHRAN_ZONE Number(7, 48) Number midday_in_tehran(Number date) { return midday(date, TEHRAN_LONGITUDE); } Number chinese_zone(Number tee) { tee.floor(); if(gregorian_year_from_fixed(tee) < 1929) return Number(1397, 4320); return Number(1, 3); } Number midnight_in_china(Number date) { return universal_from_standard(date, chinese_zone(date)); } Number estimate_prior_solar_longitude(Number lam, Number tee) { Number rate = MEAN_TROPICAL_YEAR; rate /= 360; Number tau = solar_longitude(tee); tau -= lam; tau.mod(360); tau *= rate; tau.negate(); tau += tee; Number cap_delta = solar_longitude(tau); cap_delta -= lam; cap_delta += 180; cap_delta.mod(360); cap_delta -= 180; cap_delta *= rate; tau -= cap_delta; if(tau < tee) return tau; return tee; } Number persian_new_year_on_or_before(Number date) { Number approx = estimate_prior_solar_longitude(nr_zero, midday_in_tehran(date)); approx.floor(); approx -= 1; Number day(approx); while(solar_longitude(midday_in_tehran(day)).isGreaterThan(2)) { if(CALCULATOR->aborted()) break; day++; } return day; } Number universal_from_dynamical(Number tee) { tee -= ephemeris_correction(tee); return tee; } Number mean_lunar_longitude(Number c) { c = cal_poly(c, 5, 218.3164477L, 481267.88123421L, -0.0015786L, 1.0L/538841.0L, -1.0L/65194000.0L); c.mod(360); return c; } Number lunar_elongation(Number c) { c = cal_poly(c, 5, 297.8501921L, 445267.1114034L, -0.0018819L, 1.0L/545868.0L, -1.0L/113065000.0L); c.mod(360); return c; } Number solar_anomaly(Number c) { c = cal_poly(c, 4, 357.5291092L, 35999.0502909L, -0.0001536L, 1.0L/24490000.0L); c.mod(360); return c; } Number lunar_anomaly(Number c) { c = cal_poly(c, 5, 134.9633964L, 477198.8675055L, 0.0087414L, 1.0L/69699.0L, -1.0L/14712000.0L); c.mod(360); return c; } Number moon_node(Number c) { c = cal_poly(c, 5, 93.2720950L, 483202.0175233L, -0.0036539L, -1.0L/3526000.0L, 1.0L/863310000.0L); c.mod(360); return c; } Number lunar_longitude(Number tee) { Number c = julian_centuries(tee); Number cap_L_prime = mean_lunar_longitude(c); Number cap_D = lunar_elongation(c); Number cap_M = solar_anomaly(c); Number cap_M_prime = lunar_anomaly(c); Number cap_F = moon_node(c); Number cap_E = cal_poly(c, 3, 1.0L, -0.002516L, -0.0000074L); Number correction; int args_lunar_elongation[] = { 0, 2, 2, 0, 0, 0, 2, 2, 2, 2, 0, 1, 0, 2, 0, 0, 4, 0, 4, 2, 2, 1, 1, 2, 2, 4, 2, 0, 2, 2, 1, 2, 0, 0, 2, 2, 2, 4, 0, 3, 2, 4, 0, 2, 2, 2, 4, 0, 4, 1, 2, 0, 1, 3, 4, 2, 0, 1, 2, -1 }; int args_solar_anomaly[] = { 0, 0, 0, 0, 1, 0, 0, -1, 0, -1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, -2, 1, 2, -2, 0, 0, -1, 0, 0, 1, -1, 2, 2, 1, -1, 0, 0, -1, 0, 1, 0, 1, 0, 0, -1, 2, 1, 0 }; int args_lunar_anomaly[] = { 1, -1, 0, 2, 0, 0, -2, -1, 1, 0, -1, 0, 1, 0, 1, 1, -1, 3, -2, -1, 0, -1, 0, 1, 2, 0, -3, -2, -1, -2, 1, 0, 2, 0, -1, 1, 0, -1, 2, -1, 1, -2, -1, -1, -2, 0, 1, 4, 0, -2, 0, 2, 1, -2, -3, 2, 1, -1, 3 }; int args_moon_node[] = { 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, -2, 2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, -2, 2, 0, 2, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, -2, -2, 0, 0, 0, 0, 0, 0, 0 }; long int sine_coeff[] = { 6288774L, 1274027L, 658314L, 213618L, -185116L, -114332L, 58793L, 57066L, 53322L, 45758L, -40923L, -34720L, -30383L, 15327L, -12528L, 10980L, 10675L, 10034L, 8548L, -7888L, -6766L, -5163L, 4987L, 4036L, 3994L, 3861L, 3665L, -2689L, -2602L, 2390L, -2348L, 2236L, -2120L, -2069L, 2048L, -1773L, -1595L, 1215L, -1110L, -892L, -810L, 759L, -713L, -700L, 691L, 596L, 549L, 537L, 520L, -487L, -399L, -381L, 351L, -340L, 330L, 327L, -323L, 299L, 294L }; Number v, w, x, x2, x3, y, z, nr_pi; nr_pi.pi(); for(size_t i = 0; args_lunar_elongation[i] >= 0; i++) { v = sine_coeff[i]; w = args_lunar_elongation[i]; x = args_solar_anomaly[i]; y = args_lunar_anomaly[i]; z = args_moon_node[i]; x2 = x; x2.abs(); x3 = cap_E; x3 ^= x2; v *= x3; w *= cap_D; x *= cap_M; y *= cap_M_prime; z *= cap_F; w += x; w += y; w += z; w *= nr_pi; w /= 180; w.sin(); v *= w; correction += v; } correction *= Number(1, 1, -6); Number venus; venus.setFloat(131.849L); venus *= c; v.setFloat(119.75L); venus += v; venus *= nr_pi; venus /= 180; venus.sin(); venus *= Number(3958, 1000000L); Number jupiter; jupiter.setFloat(479264.29L); jupiter *= c; v.setFloat(53.09L); jupiter += v; jupiter *= nr_pi; jupiter /= 180; jupiter.sin(); jupiter *= Number(318, 1000000L); Number flat_earth(cap_L_prime); flat_earth -= cap_F; flat_earth *= nr_pi; flat_earth /= 180; flat_earth.sin(); flat_earth *= Number(1962, 1000000L); Number ret(cap_L_prime); ret += correction; ret += venus; ret += jupiter; ret += flat_earth; ret += nutation(tee); ret.mod(360); return ret; } Number nth_new_moon(Number n) { Number n0(24724); Number k(n); k -= n0; Number c; c.setFloat(1236.85L); c.recip(); c *= k; Number approx = J2000; approx += cal_poly(c, 5, 5.09766L, 29.530588861L * 1236.85L, 0.00015437L, -0.000000150L, 0.00000000073L); Number cap_E = cal_poly(c, 3, 1.0L, -0.002516L, -0.0000074L); Number solar_anomaly_n = cal_poly(c, 4, 2.5534L, 1236.85L * 29.10535670L, -0.0000014L, -0.00000011L); Number lunar_anomaly_n = cal_poly(c, 5, 201.5643L, 385.81693528L * 1236.85L, 0.0107582L, 0.00001238L, -0.000000058L); Number moon_argument = cal_poly(c, 5, 160.7108L, 390.67050284L * 1236.85L, -0.0016118L, -0.00000227L, 0.000000011L); Number cap_omega = cal_poly(c, 4, 124.7746L, -1.56375588L * 1236.85L, 0.0020672L, 0.00000215L); int e_factor[] = {0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}; int solar_coeff[] = {0, 1, 0, 0, -1, 1, 2, 0, 0, 1, 0, 1, 1, -1, 2, 0, 3, 1, 0, 1, -1, -1, 1, 0}; int lunar_coeff[] = {1, 0, 2, 0, 1, 1, 0, 1, 1, 2, 3, 0, 0, 2, 1, 2, 0, 1, 2, 1, 1, 1, 3, 4}; int moon_coeff[] = {0, 0, 0, 2, 0, 0, 0, -2, 2, 0, 0, 2, -2, 0, 0, -2, 0, -2, 2, 2, 2, -2, 0, 0}; long double sine_coeff[] = { -0.40720L, 0.17241L, 0.01608L, 0.01039L, 0.00739L, -0.00514L, 0.00208L, -0.00111L, -0.00057L, 0.00056L, -0.00042L, 0.00042L, 0.00038L, -0.00024L, -0.00007L, 0.00004L, 0.00004L, 0.00003L, 0.00003L, -0.00003L, 0.00003L, -0.00002L, -0.00002L, 0.00002L}; Number v, w, x, x2, y, z, nr_pi; nr_pi.pi(); Number correction; correction.setFloat(-0.00017L); cap_omega *= nr_pi; cap_omega /= 180; cap_omega.sin(); correction *= cap_omega; for(size_t i = 0; e_factor[i] >= 0; i++) { v.setFloat(sine_coeff[i]); w = e_factor[i]; x = solar_coeff[i]; y = lunar_coeff[i]; z = moon_coeff[i]; x *= solar_anomaly_n; y *= lunar_anomaly_n; z *= moon_argument; x += y; x += z; x *= nr_pi; x /= 180; x.sin(); x2 = cap_E; x2 ^= w; v *= x2; v *= x; correction += v; } long double add_const[] = {251.88L, 251.83L, 349.42L, 84.66L, 141.74L, 207.14L, 154.84L, 34.52L, 207.19L, 291.34L, 161.72L, 239.56L, 331.55L, -1.0L}; long double add_coeff[] = {0.016321L, 26.651886L, 36.412478L, 18.206239L, 53.303771L, 2.453732L, 7.306860L, 27.261239L, 0.121824L, 1.844379L, 24.198154L, 25.513099L, 3.592518L}; long double add_factor[] = {0.000165L, 0.000164L, 0.000126L, 0.000110L, 0.000062L, 0.000060L, 0.000056L, 0.000047L, 0.000042L, 0.000040L, 0.000037L, 0.000035L, 0.000023L}; Number extra = cal_poly(c, 3, 299.77L, 132.8475848L, -0.009173L); extra *= nr_pi; extra /= 180; extra.sin(); v.setFloat(0.000325L); extra *= v; Number additional; for(size_t i = 0; add_const[i] >= 0; i++) { x.setFloat(add_const[i]); y.setFloat(add_coeff[i]); z.setFloat(add_factor[i]); y *= k; y += x; y *= nr_pi; y /= 180; y.sin(); y *= z; additional += y; } approx += correction; approx += extra; approx += additional; return universal_from_dynamical(approx); } Number lunar_phase(Number tee) { Number phi = lunar_longitude(tee); phi -= solar_longitude(tee); phi.mod(360); Number t0 = nth_new_moon(0); Number n(tee); n -= t0; n /= MEAN_SYNODIC_MONTH; n.round(); Number phi_prime(tee); phi_prime -= nth_new_moon(n); phi_prime /= MEAN_SYNODIC_MONTH; phi_prime.mod(1); phi_prime *= 360; Number test(phi); test -= phi_prime; test.abs(); if(test > 180) return phi_prime; return phi; } Number lunar_phase_at_or_after(Number phase, Number tee) { Number rate = MEAN_SYNODIC_MONTH; rate /= 360; Number tau(phase); tau -= lunar_phase(tee); tau.mod(360); tau *= rate; tau += tee; Number a(tau); a -= 5; if(tee > a) a = tee; Number b(tau); b += 5; Number aphase = lunar_phase(a); Number bphase = lunar_phase(b); Number precexp(1, 1, -5); Number phase_low(phase); phase_low -= precexp; Number phase_high(phase); phase_high += precexp; if(phase_low < 0) phase_low += 360; if(phase_high > 360) phase_high -= 360; Number newphase; Number test(a); while(true) { if(CALCULATOR->aborted()) return nr_zero; test = b; test -= a; test /= 2; test += a; newphase = lunar_phase(test); if(phase_high < phase_low) { if(newphase >= phase_low || newphase <= phase_high) return test; } else { if(newphase >= phase_low && newphase <= phase_high) return test; } if(aphase > bphase) { if((newphase > phase && newphase < aphase) || (newphase < phase && newphase < aphase)) b = test; else a = test; } else { if(newphase > phase) b = test; else a = test; } } } Number new_moon_at_or_after(Number tee) { Number t0 = nth_new_moon(0); Number phi = lunar_phase(tee); phi /= 360; Number n(tee); n -= t0; n /= MEAN_SYNODIC_MONTH; n -= phi; n.round(); while(nth_new_moon(n) < tee) { if(CALCULATOR->aborted()) break; n++; } return nth_new_moon(n); } Number new_moon_before(Number tee) { Number t0 = nth_new_moon(0); Number phi = lunar_phase(tee); phi /= 360; Number n(tee); n -= t0; n /= MEAN_SYNODIC_MONTH; n -= phi; n.round(); n--; while(nth_new_moon(n) < tee) { if(CALCULATOR->aborted()) break; n++; } n--; return nth_new_moon(n); } Number chinese_new_moon_on_or_after(Number date) { Number tee = new_moon_at_or_after(midnight_in_china(date)); Number ret = standard_from_universal(tee, chinese_zone(tee)); ret.floor(); return ret; } Number chinese_new_moon_before(Number date) { Number tee = new_moon_before(midnight_in_china(date)); Number ret = standard_from_universal(tee, chinese_zone(tee)); ret.floor(); return ret; } Number chinese_solar_longitude_on_or_after(Number lam, Number tee) { Number sun = solar_longitude_after(lam, universal_from_standard(tee, chinese_zone(tee))); return standard_from_universal(sun, chinese_zone(sun)); } Number current_major_solar_term(Number date) { Number s = solar_longitude(universal_from_standard(date, chinese_zone(date))); cal_div(s, 30); s += 2; s.mod(-12); s += 12; return s; } Number major_solar_term_on_or_after(Number date) { Number s = solar_longitude(midnight_in_china(date)); Number l(s); l /= 30; l.ceil(); l *= 30; l.mod(360); return chinese_solar_longitude_on_or_after(l, date); } Number current_minor_solar_term(Number date) { Number s = solar_longitude(universal_from_standard(date, chinese_zone(date))); s -= 15; cal_div(s, 30); s += 3; s.mod(-12); s += 12; return s; } Number minor_solar_term_on_or_after(Number date) { Number s = solar_longitude(midnight_in_china(date)); Number l(s); l -= 15; l /= 30; l.ceil(); l *= 30; l += 15; l.mod(360); return chinese_solar_longitude_on_or_after(l, date); } bool chinese_no_major_solar_term(Number date) { return current_major_solar_term(date) == current_major_solar_term(chinese_new_moon_on_or_after(date + 1)); } bool chinese_prior_leap_month(Number m_prime, Number m) { if(CALCULATOR->aborted()) return false; return m >= m_prime && (chinese_no_major_solar_term(m) || chinese_prior_leap_month(m_prime, chinese_new_moon_before(m))); } Number chinese_winter_solstice_on_or_before(Number date) { date++; Number approx = estimate_prior_solar_longitude(270, midnight_in_china(date)); approx.floor(); approx--; while(solar_longitude(midnight_in_china(approx + 1)) <= 270) { if(CALCULATOR->aborted()) break; approx++; } return approx; } Number chinese_new_year_in_sui(Number date) { Number s1 = chinese_winter_solstice_on_or_before(date); Number s2 = chinese_winter_solstice_on_or_before(s1 + 370); Number m12 = chinese_new_moon_on_or_after(s1 + 1); Number m13 = chinese_new_moon_on_or_after(m12 + 1); Number next_m11 = chinese_new_moon_before(s2 + 1); next_m11 -= m12; next_m11 /= MEAN_SYNODIC_MONTH; next_m11.round(); if(next_m11 == 12 && (chinese_no_major_solar_term(m12) || chinese_no_major_solar_term(m13))) { m13++; return chinese_new_moon_on_or_after(m13); } return m13; } Number chinese_new_year_on_or_before(Number date) { Number new_year = chinese_new_year_in_sui(date); if(date >= new_year) return new_year; date -= 180; return chinese_new_year_in_sui(date); } bool gregorian_leap_year(long int year) { return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); } bool julian_leap_year(long int year) { if(year < 0) return year % 4 == -1; return year % 4 == 0; } bool coptic_leap_year(long int year) { if(year < 0) return year % 4 == -1; return year % 4 == 2; } bool hebrew_leap_year(Number y) { y *= 7; y++; y.mod(19); return y.isLessThan(7); } long int last_month_of_hebrew_year(Number year) { if(hebrew_leap_year(year)) return 13; return 12; } bool hebrew_sabbatical_year(Number year) { year.mod(7); return year.isZero(); } Number hebrew_calendar_elapsed_days(Number year) { Number months_elapsed(year); months_elapsed *= 235; months_elapsed -= 234; cal_div(months_elapsed, 19); Number parts_elapsed(months_elapsed); parts_elapsed *= 13753; parts_elapsed += 12084; months_elapsed *= 29; cal_div(parts_elapsed, 25920); Number days(months_elapsed); days += parts_elapsed; Number days2(days); days2++; days2 *= 3; days2.mod(7); if(days2.isLessThan(3)) days++; return days; } long int hebrew_year_length_correction(Number year) { Number ny0, ny1, ny2; year--; ny0 = hebrew_calendar_elapsed_days(year); year++; ny1 = hebrew_calendar_elapsed_days(year); year++; ny2 = hebrew_calendar_elapsed_days(year); ny2 -= ny1; if(ny2 == 356) return 2; ny1 -= ny0; if(ny1 == 382) return 1; return 0; } Number hebrew_new_year(Number year) { Number d(HEBREW_EPOCH); d += hebrew_calendar_elapsed_days(year); d += hebrew_year_length_correction(year); return d; } long int days_in_hebrew_year(Number year) { Number d1(hebrew_new_year(year)); d1.negate(); year++; d1 += hebrew_new_year(year); return d1.lintValue(); } bool long_marheshvan(Number year) { long int d = days_in_hebrew_year(year); return d == 355 || d == 385; } bool short_kislev(Number year) { long int d = days_in_hebrew_year(year); return d == 353 || d == 383; } long int last_day_of_hebrew_month(Number year, Number month) { if(month == 2 || month == 4 || month == 6 || month == 10 || month == 13) return 29; if(month == 12 && !hebrew_leap_year(year)) return 29; if(month == 8 && !long_marheshvan(year)) return 29; if(month == 9 && short_kislev(year)) return 29; return 30; } Number date_to_fixed(long int y, long int m, long int d, CalendarSystem ct) { Number fixed; if(ct == CALENDAR_GREGORIAN) { Number year(y); year--; fixed = year; fixed *= 365; fixed += quotient(year, 4); fixed -= quotient(year, 100); fixed += quotient(year, 400); fixed += quotient((367 * m) - 362, 12); if(m > 2) fixed -= (gregorian_leap_year(y) ? 1 : 2); fixed += d; } else if(ct == CALENDAR_HEBREW) { fixed = hebrew_new_year(y); fixed += d - 1; if(m < 7) { long int l = last_month_of_hebrew_year(y); for(long int i = 7; i <= l; i++) fixed += last_day_of_hebrew_month(y, i); for(long int i = 1; i < m; i++) fixed += last_day_of_hebrew_month(y, i); } else { for(long int i = 7; i < m; i++) fixed += last_day_of_hebrew_month(y, i); } } else if(ct == CALENDAR_JULIAN) { Number y2(y); if(!y2.isNegative()) y2--; fixed = JULIAN_EPOCH; fixed--; fixed += y2 * 365; fixed += quotient(y2, 4); fixed += quotient((367 * m) - 362, 12); if(m > 2) fixed -= (julian_leap_year(y) ? 1 : 2); fixed += d; } else if(ct == CALENDAR_ISLAMIC) { Number year(y); fixed = ISLAMIC_EPOCH; fixed--; fixed += (year - 1) * 354; year *= 11; year += 3; cal_div(year, 30); fixed += year; fixed += (m - 1) * 29; fixed += quotient(m, 2); fixed += d; } else if(ct == CALENDAR_PERSIAN) { Number year(y); if(year.isPositive()) year--; year *= MEAN_TROPICAL_YEAR; year.floor(); year += 180; year += PERSIAN_EPOCH; fixed = persian_new_year_on_or_before(year); fixed--; if(m <= 7) fixed += 31 * (m - 1); else fixed += (30 * (m - 1)) + 6; fixed += d; } else if(ct == CALENDAR_CHINESE) { bool leap = (m > 12); if(leap) m -= 12; Number mid_year(y); mid_year -= 61; mid_year += nr_half; mid_year *= MEAN_TROPICAL_YEAR; mid_year += CHINESE_EPOCH; Number new_year = chinese_new_year_on_or_before(mid_year); new_year += (m - 1) * 29; Number p = chinese_new_moon_on_or_after(new_year); long int dy, dm, dd; fixed_to_date(p, dy, dm, dd, ct); bool dleap = (dm > 12); if(dleap) dm -= 12; if(m != dm || leap != dleap) {p++; p = chinese_new_moon_on_or_after(p);} fixed = d; fixed--; fixed += p; } else if(ct == CALENDAR_EGYPTIAN) { Number year(y); fixed = EGYPTIAN_EPOCH; fixed += (year - 1) * 365; fixed += 30 * (m - 1); fixed += d - 1; } else if(ct == CALENDAR_COPTIC) { Number year(y); fixed = COPTIC_EPOCH; fixed--; fixed += (year - 1) * 365; fixed += quotient(year, 4); fixed += 30 * (m - 1); fixed += d; } else if(ct == CALENDAR_ETHIOPIAN) { Number year(y); fixed = ETHIOPIAN_EPOCH; fixed += date_to_fixed(y, m, d, CALENDAR_COPTIC); fixed -= COPTIC_EPOCH; } else { return date_to_cjdn(y, m, d, ct) - 1721425L; } return fixed; } bool fixed_to_date(Number date, long int &y, long int &m, long int &d, CalendarSystem ct) { if(ct == CALENDAR_GREGORIAN) { Number d0, n400, d1, n100, d2, n4, d3, n1, year; d0 = date; d0 -= 1; cal_div(d0, 146097, n400, d1); cal_div(d1, 36524, n100, d2); cal_div(d2, 1461, n4, d3); cal_div(d3, 365, n1); if(!n100.equals(4) && !n1.equals(4)) year = 1; else year = 0; n400 *= 400; n100 *= 100; n4 *= 4; year += n400; year += n100; year += n4; year += n1; bool overflow = false; y = year.lintValue(&overflow); if(overflow) return false; Number prior_days(date); prior_days -= date_to_fixed(y, 1, 1, ct); if(date.isGreaterThanOrEqualTo(date_to_fixed(y, 3, 1, ct))) prior_days += gregorian_leap_year(y) ? 1 : 2; prior_days *= 12; prior_days += 373; cal_div(prior_days, 367); m = prior_days.lintValue(); date -= date_to_fixed(y, m, 1, ct); date++; d = date.lintValue(); return true; } else if(ct == CALENDAR_HEBREW) { Number approx(date); approx -= HEBREW_EPOCH; approx /= 35975351L; approx *= 98496; approx.floor(); approx++; Number year(approx); year--; while(hebrew_new_year(year).isLessThanOrEqualTo(date)) { if(CALCULATOR->aborted()) return false; year++; } year--; bool overflow = false; y = year.lintValue(&overflow); if(overflow) return false; m = 1; if(date.isLessThan(date_to_fixed(y, 1, 1, ct))) m = 7; while(date.isGreaterThan(date_to_fixed(y, m, last_day_of_hebrew_month(y, m), ct))) { if(CALCULATOR->aborted()) return false; m++; } date -= date_to_fixed(y, m, 1, ct); date++; d = date.lintValue(); return true; } else if(ct == CALENDAR_JULIAN) { Number approx(date); approx -= JULIAN_EPOCH; approx *= 4; approx += 1464; cal_div(approx, 1461); if(!approx.isPositive()) approx--; bool overflow = false; y = approx.lintValue(&overflow); if(overflow) return false; Number prior_days(date); prior_days -= date_to_fixed(y, 1, 1, ct); if(date.isGreaterThanOrEqualTo(date_to_fixed(y, 3, 1, ct))) prior_days += julian_leap_year(y) ? 1 : 2; prior_days *= 12; prior_days += 373; cal_div(prior_days, 367); m = prior_days.lintValue(); date -= date_to_fixed(y, m, 1, ct); date++; d = date.lintValue(); return true; } else if(ct == CALENDAR_ISLAMIC) { Number year(date); year -= ISLAMIC_EPOCH; year *= 30; year += 10646; cal_div(year, 10631); bool overflow = false; y = year.lintValue(&overflow); if(overflow) return false; Number prior_days(date); prior_days -= date_to_fixed(y, 1, 1, ct); prior_days *= 11; prior_days += 330; cal_div(prior_days, 325); m = prior_days.lintValue(); date -= date_to_fixed(y, m, 1, ct); date++; d = date.lintValue(); return true; } else if(ct == CALENDAR_PERSIAN) { Number new_year = persian_new_year_on_or_before(date); Number y2 = new_year; y2 -= PERSIAN_EPOCH; y2 /= MEAN_TROPICAL_YEAR; y2.round(); y2++; Number year = y2; if(y2.isNonPositive()) year--; bool overflow = false; y = year.lintValue(&overflow); if(overflow) return false; Number day_of_year(date); day_of_year -= date_to_fixed(y, 1, 1, CALENDAR_PERSIAN); day_of_year++; Number month = day_of_year; if(day_of_year <= 186) {month /= 31; month.ceil();} else {month -= 6; month /= 30; month.ceil();} m = month.lintValue(); date++; date -= date_to_fixed(y, m, 1, CALENDAR_PERSIAN); d = date.lintValue(); return true; } else if(ct == CALENDAR_CHINESE) { if(date > Number(1, 1, 8) || date < Number(-1, 1, 8)) return false; Number s1 = chinese_winter_solstice_on_or_before(date); Number s2 = chinese_winter_solstice_on_or_before(s1 + 370); Number m12 = chinese_new_moon_on_or_after(s1 + 1); Number next_m11 = chinese_new_moon_before(s2 + 1); Number m1 = chinese_new_moon_before(date + 1); Number test(next_m11); test -= m12; test /= MEAN_SYNODIC_MONTH; test.round(); bool leap_year = (test == 12); Number month(m1); month -= m12; month /= MEAN_SYNODIC_MONTH; month.round(); if(leap_year && chinese_prior_leap_month(m12, m1)) month--; month.mod(-12); month += 12; m = month.lintValue(); bool leap_month = (leap_year && chinese_no_major_solar_term(m1) && !chinese_prior_leap_month(m12, chinese_new_moon_before(m1))); if(leap_month) m += 12; Number elapsed_years(date); elapsed_years -= CHINESE_EPOCH; elapsed_years /= MEAN_TROPICAL_YEAR; elapsed_years += Number(3, 2); month /= 12; elapsed_years -= month; elapsed_years.floor(); elapsed_years += 60; //epoch of 2697 BCE Number day(date); day -= m1; day++; if(day <= 0) return false; d = day.lintValue(); bool overflow = false; y = elapsed_years.lintValue(&overflow); if(overflow) return false; return true; } else if(ct == CALENDAR_EGYPTIAN) { date -= EGYPTIAN_EPOCH; Number year(date); cal_div(year, 365); year++; bool overflow = false; y = year.lintValue(&overflow); if(overflow) return false; Number month(date); month.mod(365); cal_div(month, 30); month++; m = month.lintValue(); year--; year *= 365; month--; month *= 30; date -= year; date -= month; date++; d = date.lintValue(); return true; } else if(ct == CALENDAR_COPTIC) { Number year(date); year -= COPTIC_EPOCH; year *= 4; year += 1463; cal_div(year, 1461); bool overflow = false; y = year.lintValue(&overflow); if(overflow) return false; Number month(date); month -= date_to_fixed(y, 1, 1, ct); cal_div(month, 30); month++; m = month.lintValue(); Number day(date); day -= date_to_fixed(y, m, 1, ct); day++; d = day.lintValue(); return true; } else if(ct == CALENDAR_ETHIOPIAN) { date -= ETHIOPIAN_EPOCH; date += COPTIC_EPOCH; return fixed_to_date(date, y, m, d, CALENDAR_COPTIC); } else if(ct == CALENDAR_MILANKOVIC || ct == CALENDAR_INDIAN) { date += 1721425L; return cjdn_to_date(date, y, m, d, ct); } return false; } Number date_to_cjdn(long int j, long int m, long int d, CalendarSystem ct) { Number J; if(ct == CALENDAR_GREGORIAN) { Number c0(m); c0 -= 3; c0 /= 12; c0.floor(); Number x4(j); x4 += c0; Number x2, x3; cal_div(x4, 100, x3, x2); Number x1(m); c0 *= 12; x1 -= c0; x1 -= 3; x3 *= 146097; x3 /= 4; x3.floor(); x2 *= 36525; x2 /= 100; x2.floor(); x1 *= 153; x1 += 2; x1 /= 5; x1.floor(); J = x3; J += x2; J += x1; J += d; J += 1721119; } else if(ct == CALENDAR_MILANKOVIC) { Number c0(m); c0 -= 3; c0 /= 12; c0.floor(); Number x4(j); x4 += c0; Number x2, x3; cal_div(x4, 100, x3, x2); Number x1(m); c0 *= 12; x1 -= c0; x1 -= 3; x3 *= 328718; x3 += 6; x3 /= 9; x3.floor(); x2 *= 36525; x2 /= 100; x2.floor(); x1 *= 153; x1 += 2; x1 /= 5; x1.floor(); J = x3; J += x2; J += x1; J += d; J += 1721119; } else if(ct == CALENDAR_JULIAN) { Number c0(m); c0 -= 3; c0 /= 12; c0.floor(); Number j1(j); j1 += c0; j1 *= 1461; j1 /= 4; j1.floor(); Number j2(m); j2 *= 153; c0 *= 1836; j2 -= c0; j2 -= 457; j2 /= 5; j2.floor(); J = 1721117L; J += j1; J += j2; J += d; } else if(ct == CALENDAR_ISLAMIC) { Number x1(j); x1 *= 10631; x1 -= 10617; x1 /= 30; x1.floor(); Number x2(m); x2 *= 325; x2 -= 320; x2 /= 11; x2.floor(); J = x1; J += x2; J += d; J += 1948439L; return J; } else if(ct == CALENDAR_HEBREW) { Number c0, x1, x3, z4; c0 = 13; c0 -= m; c0 /= 7; c0.floor(); x1 = j; x1--; x1 += c0; x3 = m; x3--; z4 = d; z4--; Number c1x1, qx1, rx1, v1x1, v2x1; c1x1 = x1; c1x1 *= 235; c1x1++; c1x1 /= 19; c1x1.floor(); qx1 = c1x1; qx1 /= 1095; qx1.floor(); rx1 = c1x1; rx1.mod(1095); v1x1 = qx1; v1x1 *= 15; rx1 *= 765433L; v1x1 += rx1; v1x1 += 12084; v1x1 /= 25920; v1x1.floor(); qx1 *= 32336; v1x1 += qx1; v2x1 = v1x1; v2x1.mod(7); v2x1 *= 6; v2x1 /= 7; v2x1.floor(); v2x1.mod(2); v2x1 += v1x1; Number x1p1, c1x1p1, qx1p1, rx1p1, v1x1p1, v2x1p1; x1p1 = x1; x1p1++; c1x1p1 = x1p1; c1x1p1 *= 235; c1x1p1++; c1x1p1 /= 19; c1x1p1.floor(); qx1p1 = c1x1p1; qx1p1 /= 1095; qx1p1.floor(); rx1p1 = c1x1p1; rx1p1.mod(1095); v1x1p1 = qx1p1; v1x1p1 *= 15; rx1p1 *= 765433L; v1x1p1 += rx1p1; v1x1p1 += 12084; v1x1p1 /= 25920; v1x1p1.floor(); qx1p1 *= 32336; v1x1p1 += qx1p1; v2x1p1 = v1x1p1; v2x1p1.mod(7); v2x1p1 *= 6; v2x1p1 /= 7; v2x1p1.floor(); v2x1p1.mod(2); v2x1p1 += v1x1p1; Number x1m1, c1x1m1, qx1m1, rx1m1, v1x1m1, v2x1m1; x1m1 = x1; x1m1--; c1x1m1 = x1m1; c1x1m1 *= 235; c1x1m1++; c1x1m1 /= 19; c1x1m1.floor(); qx1m1 = c1x1m1; qx1m1 /= 1095; qx1m1.floor(); rx1m1 = c1x1m1; rx1m1.mod(1095); v1x1m1 = qx1m1; v1x1m1 *= 15; rx1m1 *= 765433L; v1x1m1 += rx1m1; v1x1m1 += 12084; v1x1m1 /= 25920; v1x1m1.floor(); qx1m1 *= 32336; v1x1m1 += qx1m1; v2x1m1 = v1x1m1; v2x1m1.mod(7); v2x1m1 *= 6; v2x1m1 /= 7; v2x1m1.floor(); v2x1m1.mod(2); v2x1m1 += v1x1m1; Number x1p2, c1x1p2, qx1p2, rx1p2, v1x1p2, v2x1p2; x1p2 = x1; x1p2 += 2; c1x1p2 = x1p2; c1x1p2 *= 235; c1x1p2++; c1x1p2 /= 19; c1x1p2.floor(); qx1p2 = c1x1p2; qx1p2 /= 1095; qx1p2.floor(); rx1p2 = c1x1p2; rx1p2.mod(1095); v1x1p2 = qx1p2; v1x1p2 *= 15; rx1p2 *= 765433L; v1x1p2 += rx1p2; v1x1p2 += 12084; v1x1p2 /= 25920; v1x1p2.floor(); qx1p2 *= 32336; v1x1p2 += qx1p2; v2x1p2 = v1x1p2; v2x1p2.mod(7); v2x1p2 *= 6; v2x1p2 /= 7; v2x1p2.floor(); v2x1p2.mod(2); v2x1p2 += v1x1p2; Number L2x1, L2x1m1, v3x1, v4x1, c2x1; L2x1 = v2x1p1; L2x1 -= v2x1; L2x1m1 = v2x1; L2x1m1 -= v2x1m1; v3x1 = L2x1; v3x1 += 19; v3x1 /= 15; v3x1.floor(); v3x1.mod(2); v3x1 *= 2; v4x1 = L2x1m1; v4x1 += 7; v4x1 /= 15; v4x1.floor(); v4x1.mod(2); c2x1 = v2x1; c2x1 += v3x1; c2x1 += v4x1; Number L2x1p1, v3x1p1, v4x1p1, c2x1p1; L2x1p1 = v2x1p2; L2x1p1 -= v2x1p1; v3x1p1 = L2x1p1; v3x1p1 += 19; v3x1p1 /= 15; v3x1p1.floor(); v3x1p1.mod(2); v3x1p1 *= 2; v4x1p1 = L2x1; v4x1p1 += 7; v4x1p1 /= 15; v4x1p1.floor(); v4x1p1.mod(2); c2x1p1 = v2x1p1; c2x1p1 += v3x1p1; c2x1p1 += v4x1p1; Number L, c8, c9, c3, c4; L = c2x1p1; L -= c2x1; c8 = L; c8 += 7; c8 /= 2; c8.floor(); c8.mod(15); c9 = 385; c9 -= L; c9 /= 2; c9.floor(); c9.mod(15); c9.negate(); Number x3a(x3), x3b(x3), x3c(x3); x3a *= 384; x3a += 7; x3a /= 13; x3a.floor(); x3b += 4; x3b /= 12; x3b.floor(); x3c += 3; x3c /= 12; x3c.floor(); c3 = x3a; c8 *= x3b; c3 += c8; c9 *= x3c; c3 += c9; J = 347821L; J += c2x1; J += c3; J += z4; } else if(ct == CALENDAR_EGYPTIAN) { j *= 365; m *= 30; J = j; J += m; J += d; J+= 1448242L; } else if(ct == CALENDAR_INDIAN) { j += 78; bool leap = gregorian_leap_year(j); J = date_to_cjdn(j, 3, leap ? 21 : 22, CALENDAR_GREGORIAN); if(m != 1) { J += leap ? 31 : 30; long int m2 = m - 2; if(m2 > 5) m2 = 5; J += m2 * 31; if(m >= 8) J += (m - 7) * 30; } J += d; J--; } else { return date_to_fixed(j, m, d, ct) + 1721425L; } return J; } bool cjdn_to_date(Number J, long int &y, long int &m, long int &d, CalendarSystem ct) { if(ct == CALENDAR_GREGORIAN) { Number x3, r3, x2, r2, x1, r1, j; J *= 4; J -= 6884477L; cal_div(J, 146097, x3, r3); r3 /= 4; r3.floor(); r3 *= 100; r3 += 99; cal_div(r3, 36525, x2, r2); r2 /= 100; r2.floor(); r2 *= 5; r2 += 2; cal_div(r2, 153, x1, r1); r1 /= 5; r1.floor(); r1++; d = r1.lintValue(); Number c0(x1); c0 += 2; c0 /= 12; c0.floor(); j = x3; j *= 100; j += x2; j += c0; bool overflow = false; y = j.lintValue(&overflow); if(overflow) return false; c0 *= -12; c0 += x1; c0 += 3; m = c0.lintValue(); return true; } else if(ct == CALENDAR_MILANKOVIC) { Number x3, r3, x2, r2, x1, r1, c0, j; J -= 1721120L; J *= 9; J += 2; cal_div(J, 328718L, x3, r3); r3 /= 9; r3.floor(); r3 *= 100; r3 += 99; cal_div(r3, 36525, x2, r2); r2 /= 100; r2.floor(); r2 *= 5; r2 += 2; cal_div(r2, 153, x1, r1); c0 = x1; c0 += 2; c0 /= 12; c0.floor(); j = x3; j *= 100; j += x2; j += c0; bool overflow = false; y = j.lintValue(&overflow); if(overflow) return false; c0 *= 12; x1 -= c0; x1 += 3; m = x1.lintValue(); r1.mod(153); r1 /= 5; r1.floor(); r1++; d = r1.lintValue(); return true; } else if(ct == CALENDAR_JULIAN) { Number y2, k2, k1, x2, x1, c0, j; y2 = J; y2 -= 1721118L; k2 = y2; k2 *= 4; k2 += 3; k1 = k2; k1.mod(1461); k1 /= 4; k1.floor(); k1 *= 5; k1 += 2; x1 = k1; x1 /= 153; x1.floor(); c0 = x1; c0 += 2; c0 /= 12; c0.floor(); j = k2; j /= 1461; j.floor(); j += c0; bool overflow = false; y = j.lintValue(&overflow); if(overflow) return false; c0 *= 12; x1 -= c0; x1 += 3; m = x1.lintValue(); k1.mod(153); k1 /= 5; k1.floor(); k1++; d = k1.lintValue(); return true; } else if(ct == CALENDAR_ISLAMIC) { Number k2, k1, j; k2 = J; k2 -= 1948440L; k2 *= 30; k2 += 15; k1 = k2; k1.mod(10631); k1 /= 30; k1.floor(); k1 *= 11; k1 += 5; j = k2; j /= 10631; j.floor(); j++; bool overflow = false; y = j.lintValue(&overflow); if(overflow) return false; k2 = k1; k2 /= 325; k2.floor(); k2++; m = k2.lintValue(); k1.mod(153); k1 /= 11; k1.floor(); k1++; d = k1.lintValue(); return true; } else if(ct == CALENDAR_EGYPTIAN) { Number y2, x2, y1, j; y2 = J; x2 = y2; x2 /= 365; x2.floor(); y1 = y2; y1.mod(365); j = x2; j++; bool overflow = false; y = j.lintValue(&overflow); if(overflow) return false; y2 = y1; y2 /= 30; y2.floor(); y2++; m = y2.lintValue(); y1.mod(30); y1++; d = y1.lintValue(); return true; } else if(ct == CALENDAR_INDIAN) { if(!cjdn_to_date(J, y, m, d, CALENDAR_GREGORIAN)) return false; bool leap = gregorian_leap_year(y); Number j(y); j -= 78; Number J0; J0 = date_to_cjdn(y, 1, 1, CALENDAR_GREGORIAN); Number yday(J); yday -= J0; if(yday.isLessThan(80)) {j--; yday += (leap ? 31 : 30) + (31 * 5) + (30 * 3) + 10 + 80;} yday -= 80; if(yday.isLessThan(leap ? 31 : 30)) { m = 1; yday++; d = yday.lintValue(); } else { Number mday(yday); mday -= (leap ? 31 : 30); if(mday.isLessThan(31 * 5)) { m = quotient(mday, 31).lintValue() + 2; mday.rem(31); mday++; d = mday.lintValue(); } else { mday -= 31 * 5; m = quotient(mday, 30).lintValue() + 7; mday.rem(30); mday++; d = mday.lintValue(); } } bool overflow = false; y = j.lintValue(&overflow); if(overflow) return false; return true; } else { J -= 1721425L; return fixed_to_date(J, y, m, d, ct); } return false; } bool calendarToDate(QalculateDateTime &date, long int y, long int m, long int d, CalendarSystem ct) { CALCULATOR->beginTemporaryStopIntervalArithmetic(); long int new_y, new_m, new_d; if(!fixed_to_date(date_to_fixed(y, m, d, ct), new_y, new_m, new_d, CALENDAR_GREGORIAN)) { CALCULATOR->endTemporaryStopIntervalArithmetic(); return false; } date.set(new_y, new_m, new_d); CALCULATOR->endTemporaryStopIntervalArithmetic(); return true; } bool dateToCalendar(const QalculateDateTime &date, long int &y, long int &m, long int &d, CalendarSystem ct) { if(ct == CALENDAR_GREGORIAN) { y = date.year(); m = date.month(); d = date.day(); return true; } CALCULATOR->beginTemporaryStopIntervalArithmetic(); if(!fixed_to_date(date_to_fixed(date.year(), date.month(), date.day(), CALENDAR_GREGORIAN), y, m, d, ct)) { CALCULATOR->endTemporaryStopIntervalArithmetic(); return false; } CALCULATOR->endTemporaryStopIntervalArithmetic(); return true; } int numberOfMonths(CalendarSystem ct) { if(ct == CALENDAR_CHINESE) return 24; if(ct == CALENDAR_HEBREW || ct == CALENDAR_COPTIC || ct == CALENDAR_EGYPTIAN || ct == CALENDAR_ETHIOPIAN) return 13; return 12; } string monthName(long int month, CalendarSystem ct, bool append_number, bool append_leap) { if(month < 1) return i2s(month); if(ct == CALENDAR_CHINESE) { if(month > 24) return i2s(month); bool leap = month > 12; if(leap) month -= 12; string str = i2s(month); if(leap && append_leap) {str += " ("; str += _("leap month"); str += ")";} return str; } if(month > 13) return i2s(month); string str; if(ct == CALENDAR_HEBREW) { str = HEBREW_MONTHS[month - 1]; } else if(ct == CALENDAR_JULIAN || ct == CALENDAR_MILANKOVIC || ct == CALENDAR_GREGORIAN) { if(month == 13) return i2s(month); str = _(STANDARD_MONTHS[month - 1]); } else if(ct == CALENDAR_COPTIC) { str = _(COPTIC_MONTHS[month - 1]); } else if(ct == CALENDAR_ETHIOPIAN) { str = _(ETHIOPIAN_MONTHS[month - 1]); } else if(ct == CALENDAR_ISLAMIC) { if(month == 13) return i2s(month); str = _(ISLAMIC_MONTHS[month - 1]); } else if(ct == CALENDAR_PERSIAN) { if(month == 13) return i2s(month); str = _(PERSIAN_MONTHS[month - 1]); } else if(ct == CALENDAR_INDIAN) { if(month == 13) return i2s(month); str = _(INDIAN_MONTHS[month - 1]); } else { return i2s(month); } if(append_number) {str += " ("; str += i2s(month); str += ")";} return str; } void chineseYearInfo(long int year, long int &cycle, long int &year_in_cycle, long int &stem, long int &branch) { cycle = (year - 1) / 60 + 1; if(year <= 0) year += ((-year / 60) + 1) * 60; year_in_cycle = ((year - 1) % 60) + 1; stem = ((year_in_cycle - 1) % 10) + 1; branch = ((year_in_cycle - 1) % 12) + 1; } long int chineseCycleYearToYear(long int cycle, long int year_in_cycle) { return ((cycle - 1) * 60) + year_in_cycle; } int chineseStemBranchToCycleYear(long int stem, long int branch) { stem = (stem + 1) / 2; stem -= (branch - 1) / 2; if(stem < 1) stem += 5; int cy = (stem - 1) * 12 + branch; if(cy < 0 || cy > 60) return 0; return cy; } string chineseStemName(long int stem) { stem = (stem + 1) / 2; if(stem < 1 || stem > 5) return empty_string; return _(CHINESE_ELEMENTS[stem - 1]); } string chineseBranchName(long int branch) { if(branch < 1 || branch > 12) return empty_string; return _(CHINESE_ANIMALS[branch - 1]); } Number solarLongitude(const QalculateDateTime &date) { CALCULATOR->beginTemporaryStopIntervalArithmetic(); Number fixed = date_to_fixed(date.year(), date.month(), date.day(), CALENDAR_GREGORIAN); Number time = date.second(); time /= 60; time += date.minute(); time -= dateTimeZone(date, false); time /= 60; time += date.hour(); time /= 24; fixed += time; Number longitude = solar_longitude(fixed); CALCULATOR->endTemporaryStopIntervalArithmetic(); longitude.setPrecision(8); return longitude; } QalculateDateTime findNextSolarLongitude(const QalculateDateTime &date, Number longitude) { CALCULATOR->beginTemporaryStopIntervalArithmetic(); Number fixed = date_to_fixed(date.year(), date.month(), date.day(), CALENDAR_GREGORIAN); Number time = date.second(); time /= 60; time += date.minute(); time -= dateTimeZone(date, false); time /= 60; time += date.hour(); time /= 24; fixed += time; fixed = solar_longitude_after(longitude, fixed); long int y, m, d; fixed_to_date(fixed, y, m, d, CALENDAR_GREGORIAN); QalculateDateTime dt(y, m, d); Number fixed2 = date_to_fixed(y, m, d, CALENDAR_GREGORIAN); dt.addMinutes(dateTimeZone(dt, true)); dt.addDays(fixed - fixed2); CALCULATOR->endTemporaryStopIntervalArithmetic(); return dt; } Number lunarPhase(const QalculateDateTime &date) { CALCULATOR->beginTemporaryStopIntervalArithmetic(); Number fixed = date_to_fixed(date.year(), date.month(), date.day(), CALENDAR_GREGORIAN); Number time = date.second(); time /= 60; time += date.minute(); time -= dateTimeZone(date, false); time /= 60; time += date.hour(); time /= 24; fixed += time; Number phase = lunar_phase(fixed); phase /= 360; CALCULATOR->endTemporaryStopIntervalArithmetic(); phase.setPrecision(8); return phase; } QalculateDateTime findNextLunarPhase(const QalculateDateTime &date, Number phase) { CALCULATOR->beginTemporaryStopIntervalArithmetic(); Number fixed = date_to_fixed(date.year(), date.month(), date.day(), CALENDAR_GREGORIAN); Number time = date.second(); time /= 60; time += date.minute(); time -= dateTimeZone(date, false); time /= 60; time += date.hour(); time /= 24; fixed += time; phase *= 360; fixed = lunar_phase_at_or_after(phase, fixed); long int y, m, d; fixed_to_date(fixed, y, m, d, CALENDAR_GREGORIAN); QalculateDateTime dt(y, m, d); Number fixed2 = date_to_fixed(y, m, d, CALENDAR_GREGORIAN); dt.addMinutes(dateTimeZone(dt, true)); dt.addDays(fixed - fixed2); CALCULATOR->endTemporaryStopIntervalArithmetic(); return dt; } libqalculate-2.8.2/libqalculate/Variable.h0000644000175000017500000004064013261605154015455 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef VARIABLE_H #define VARIABLE_H #include #include /** @file */ #define DECLARE_BUILTIN_VARIABLE(x) class x : public DynamicVariable { \ private: \ void calculate() const; \ public: \ x(); \ x(const x *variable) {set(variable);} \ ExpressionItem *copy() const {return new x(this);} \ }; /// Type assumption. /** * Each type is a subset of the type above. */ typedef enum { /// Multiplication is NOT commutative; do not use ASSUMPTION_TYPE_NONE = 0, ASSUMPTION_TYPE_NONMATRIX = 1, ASSUMPTION_TYPE_NUMBER = 2, /// im(x) != 0 ASSUMPTION_TYPE_COMPLEX = 3, ASSUMPTION_TYPE_REAL = 4, ASSUMPTION_TYPE_RATIONAL = 5, ASSUMPTION_TYPE_INTEGER = 6 } AssumptionType; /// Signedness assumption. typedef enum { /// x = ? ASSUMPTION_SIGN_UNKNOWN, /// x > 0 ASSUMPTION_SIGN_POSITIVE, /// x >= 0 ASSUMPTION_SIGN_NONNEGATIVE, /// x < 0 ASSUMPTION_SIGN_NEGATIVE, /// x <= 0 ASSUMPTION_SIGN_NONPOSITIVE, /// x != 0 ASSUMPTION_SIGN_NONZERO } AssumptionSign; /// Type of variable typedef enum { /// class Variable SUBTYPE_VARIABLE, /// class UnknownVariable SUBTYPE_UNKNOWN_VARIABLE, /// class KnownVariable SUBTYPE_KNOWN_VARIABLE } VariableSubtype; /// An assumption about an unknown mathematical value. /** Assumptions have a type and a sign. The type describes the type of the value -- if it represents a number or something else, and what type of number is represented. * The sign restricts the signedness of a number. The sign generally only applies the assumptions representing a number. * The assumption class also includes max and min values, which however are not used anywhere yet. */ class Assumptions { protected: AssumptionType i_type; AssumptionSign i_sign; Number *fmin, *fmax; bool b_incl_min, b_incl_max; public: Assumptions(); ~Assumptions(); bool isPositive(); bool isNegative(); bool isNonNegative(); bool isNonPositive(); bool isInteger(); bool isNumber(); bool isRational(); bool isReal(); bool isComplex(); bool isNonZero(); bool isNonMatrix(); bool isScalar(); AssumptionType type(); AssumptionSign sign(); void setType(AssumptionType ant); void setSign(AssumptionSign as); void setMin(const Number *nmin); void setIncludeEqualsMin(bool include_equals); bool includeEqualsMin() const; const Number *min() const; void setMax(const Number *nmax); void setIncludeEqualsMax(bool include_equals); bool includeEqualsMax() const; const Number *max() const; }; /// Abstract base class for variables. /** A variable is an alpha-numerical representation of a known or unknown value. */ class Variable : public ExpressionItem { public: Variable(string cat_, string name_, string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); Variable(); Variable(const Variable *variable); virtual ~Variable(); virtual ExpressionItem *copy() const = 0; virtual void set(const ExpressionItem *item); virtual int type() const {return TYPE_VARIABLE;} /** Returns the subtype of the variable, corresponding to which subsubclass the object belongs to. * * @returns ::VariableSubtype. */ virtual int subtype() const {return SUBTYPE_VARIABLE;} /** Returns if the variable has a known value (as oppossed to assumptions). * * @returns true if the variable is of class KnownVariable, false if UnknownVariable. */ virtual bool isKnown() const = 0; /** Returns if the variable represents a positive value. */ virtual bool representsPositive(bool = false) {return false;} virtual bool representsNegative(bool = false) {return false;} virtual bool representsNonNegative(bool = false) {return false;} virtual bool representsNonPositive(bool = false) {return false;} virtual bool representsInteger(bool = false) {return false;} virtual bool representsNonInteger(bool = false) {return false;} virtual bool representsFraction(bool = false) {return false;} virtual bool representsNumber(bool = false) {return false;} virtual bool representsRational(bool = false) {return false;} virtual bool representsReal(bool = false) {return false;} virtual bool representsNonComplex(bool b = false) {return representsReal(b);} virtual bool representsComplex(bool = false) {return false;} virtual bool representsNonZero(bool = false) {return false;} virtual bool representsEven(bool = false) {return false;} virtual bool representsOdd(bool = false) {return false;} virtual bool representsUndefined(bool = false, bool = false, bool = false) {return false;} virtual bool representsBoolean() {return false;} virtual bool representsNonMatrix() {return false;} virtual bool representsScalar() {return false;} }; /// A variable with unknown value. /** Unknown variables have an associated assumption object. */ class UnknownVariable : public Variable { protected: Assumptions *o_assumption; MathStructure *mstruct; public: /** Create an unknown. * * @param cat_ Category that the variable belongs to. * @param name_ Initial name of the variable. * @param title_ Descriptive name. * @param is_local If the variable is local/user-defined or global. * @param is_builtin If the variable is builtin and not modifiable. * @param is_active If the variable is active and can be used in expressions. */ UnknownVariable(string cat_, string name_, string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); /** Create an empty unknown variable. */ UnknownVariable(); /** Create a copy of an unknown variable. * * @param variable Unknown variable to copy. */ UnknownVariable(const UnknownVariable *variable); virtual ~UnknownVariable(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); bool isKnown() const {return false;} /** Sets the assumptions of the unknown variable. * * @param ass Assumptions. */ void setAssumptions(Assumptions *ass); void setAssumptions(const MathStructure &mvar); /** Returns the assumptions of the unknown variable. * * @returns Assumptions of the unknown variable. */ Assumptions *assumptions(); const MathStructure &interval() const; void setInterval(const MathStructure &o); virtual int subtype() const {return SUBTYPE_UNKNOWN_VARIABLE;} virtual bool representsPositive(bool = false); virtual bool representsNegative(bool = false); virtual bool representsNonNegative(bool = false); virtual bool representsNonPositive(bool = false); virtual bool representsInteger(bool = false); virtual bool representsNumber(bool = false); virtual bool representsRational(bool = false); virtual bool representsReal(bool = false); virtual bool representsNonComplex(bool = false); virtual bool representsComplex(bool = false); virtual bool representsNonZero(bool = false); virtual bool representsNonMatrix(); virtual bool representsScalar(); }; /// A variable with a known value. /** Known variables have an associated value. The value can be a simple number or a full mathematical expression. The known variable class is used both for variable values and constants. * * The value can be provided as an expression in the form of a text string or as a mathematical value in the form of an object of the MathStructure class. * The text string is parsed when needed, which saves time when loading many variable definitions which might not be used, at least not immediately. */ class KnownVariable : public Variable { protected: MathStructure *mstruct; bool b_expression; int calculated_precision; bool calculated_with_interval, calculated_with_units; string sexpression, suncertainty, sunit; public: /** Create a known variable with a value. * * @param cat_ Category that the variable belongs to. * @param name_ Initial name of the variable. * @param o Value. * @param title_ Descriptive name. * @param is_local If the variable is local/user-defined or global. * @param is_builtin If the variable is builtin and not modifiable. * @param is_active If the variable is active and can be used in expressions. */ KnownVariable(string cat_, string name_, const MathStructure &o, string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); /** Create a known variable with an text string expression. * * @param cat_ Category that the variable belongs to. * @param name_ Initial name of the variable. * @param expression_ Expression. * @param title_ Descriptive name. * @param is_local If the variable is local/user-defined or global. * @param is_builtin If the variable is builtin and not modifiable. * @param is_active If the variable is active and can be used in expressions. */ KnownVariable(string cat_, string name_, string expression_, string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); /** Create an empty known variable. Primarily for internal use. */ KnownVariable(); /** Create a copy of a known variable. * * @param variable Known variable to copy. */ KnownVariable(const KnownVariable *variable); virtual ~KnownVariable(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); bool isKnown() const {return true;} /** Returns if the variable has an text string expression instead of a value. * * @returns True if the variable has an expression instead of a value. */ virtual bool isExpression() const; /** Returns the variable's string expression or an empty string if it has not got an expression. * * @returns The variable's expression. */ virtual string expression() const; virtual string uncertainty() const; virtual string unit() const; int subtype() const {return SUBTYPE_KNOWN_VARIABLE;} /** Sets the value of the variable. If expression is set, it is cleared. * * @param o Value. */ virtual void set(const MathStructure &o); /** Sets the text string expression of the variable. The value is cleared. * * @param expression_ Expression. */ virtual void set(string expression_); virtual void setUncertainty(string standard_uncertainty); virtual void setUnit(string unit_expression); /** Returns the value of the variable. If no value is set or parsed and an expression is set, the expression is parsed and resulting value returned. * * @returns The value of the variable.. */ virtual const MathStructure &get(); virtual bool representsPositive(bool = false); virtual bool representsNegative(bool = false); virtual bool representsNonNegative(bool = false); virtual bool representsNonPositive(bool = false); virtual bool representsInteger(bool = false); virtual bool representsNonInteger(bool = false); virtual bool representsFraction(bool = false); virtual bool representsNumber(bool = false); virtual bool representsRational(bool = false); virtual bool representsReal(bool = false); virtual bool representsNonComplex(bool = false); virtual bool representsComplex(bool = false); virtual bool representsNonZero(bool = false); virtual bool representsEven(bool = false); virtual bool representsOdd(bool = false); virtual bool representsUndefined(bool = false, bool = false, bool = false); virtual bool representsBoolean(); virtual bool representsNonMatrix(); virtual bool representsScalar(); }; /// Abstract base class for variables with a value which is recalculated when the precision has changed. /** */ class DynamicVariable : public KnownVariable { protected: virtual void calculate() const = 0; bool always_recalculate; public: DynamicVariable(string cat_, string name_, string title_ = "", bool is_local = false, bool is_builtin = true, bool is_active = true); DynamicVariable(const DynamicVariable *variable); DynamicVariable(); virtual ~DynamicVariable(); ExpressionItem *copy() const = 0; void set(const ExpressionItem *item); const MathStructure &get(); void set(const MathStructure &o); void set(string expression_); /** Returns the precision of the calculated value. * * @returns Precision of the calculated value or zero if the value has not yet been calculated. */ int calculatedPrecision() const; bool calculatedWithInterval() const; virtual bool representsPositive(bool = false) {return true;} virtual bool representsNegative(bool = false) {return false;} virtual bool representsNonNegative(bool = false) {return true;} virtual bool representsNonPositive(bool = false) {return false;} virtual bool representsInteger(bool = false) {return false;} virtual bool representsNonInteger(bool = false) {return true;} virtual bool representsNumber(bool = false) {return true;} virtual bool representsRational(bool = false) {return false;} virtual bool representsReal(bool = false) {return true;} virtual bool representsComplex(bool = false) {return false;} virtual bool representsNonZero(bool = false) {return true;} virtual bool representsEven(bool = false) {return false;} virtual bool representsOdd(bool = false) {return false;} virtual bool representsUndefined(bool = false, bool = false, bool = false) {return false;} virtual bool representsBoolean() {return false;} virtual bool representsNonMatrix() {return true;} virtual bool representsScalar() {return true;} }; /// Dynamic variable for Pi DECLARE_BUILTIN_VARIABLE(PiVariable) /// Dynamic variable for e, the base of natural logarithms DECLARE_BUILTIN_VARIABLE(EVariable) /// Dynamic variable for Euler's constant DECLARE_BUILTIN_VARIABLE(EulerVariable) /// Dynamic variable for Catalan's constant DECLARE_BUILTIN_VARIABLE(CatalanVariable) /// Dynamic variable for current precision class PrecisionVariable : public DynamicVariable { private: void calculate() const; public: PrecisionVariable(); PrecisionVariable(const PrecisionVariable *variable) {set(variable);} ExpressionItem *copy() const {return new PrecisionVariable(this);} bool representsInteger(bool = false) {return true;} bool representsNonInteger(bool = false) {return false;} }; class TodayVariable : public DynamicVariable { private: void calculate() const; public: TodayVariable(); TodayVariable(const TodayVariable *variable) {set(variable);} ExpressionItem *copy() const {return new TodayVariable(this);} virtual bool representsPositive(bool = false) {return false;} virtual bool representsNonNegative(bool = false) {return false;} virtual bool representsNonInteger(bool = false) {return false;} virtual bool representsNumber(bool b = false) {return b;} virtual bool representsReal(bool b = false) {return b;} virtual bool representsNonZero(bool b = false) {return b;} }; class TomorrowVariable : public DynamicVariable { private: void calculate() const; public: TomorrowVariable(); TomorrowVariable(const TomorrowVariable *variable) {set(variable);} ExpressionItem *copy() const {return new TomorrowVariable(this);} virtual bool representsPositive(bool = false) {return false;} virtual bool representsNonNegative(bool = false) {return false;} virtual bool representsNonInteger(bool = false) {return false;} virtual bool representsNumber(bool b = false) {return b;} virtual bool representsReal(bool b = false) {return b;} virtual bool representsNonZero(bool b = false) {return b;} }; class YesterdayVariable : public DynamicVariable { private: void calculate() const; public: YesterdayVariable(); YesterdayVariable(const YesterdayVariable *variable) {set(variable);} ExpressionItem *copy() const {return new YesterdayVariable(this);} virtual bool representsPositive(bool = false) {return false;} virtual bool representsNonNegative(bool = false) {return false;} virtual bool representsNonInteger(bool = false) {return false;} virtual bool representsNumber(bool b = false) {return b;} virtual bool representsReal(bool b = false) {return b;} virtual bool representsNonZero(bool b = false) {return b;} }; class NowVariable : public DynamicVariable { private: void calculate() const; public: NowVariable(); NowVariable(const NowVariable *variable) {set(variable);} ExpressionItem *copy() const {return new NowVariable(this);} virtual bool representsPositive(bool = false) {return false;} virtual bool representsNonNegative(bool = false) {return false;} virtual bool representsNonInteger(bool = false) {return false;} virtual bool representsNumber(bool b = false) {return b;} virtual bool representsReal(bool b = false) {return b;} virtual bool representsNonZero(bool b = false) {return b;} }; #endif libqalculate-2.8.2/libqalculate/MathStructure.cc0000644000175000017500000420766313401031006016677 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016-2018 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "MathStructure.h" #include "Calculator.h" #include "Number.h" #include "Function.h" #include "Variable.h" #include "Unit.h" #include "Prefix.h" #include #include #define SWAP_CHILDREN(i1, i2) {MathStructure *swap_mstruct = v_subs[v_order[i1]]; v_subs[v_order[i1]] = v_subs[v_order[i2]]; v_subs[v_order[i2]] = swap_mstruct;} #define CHILD_TO_FRONT(i) v_order.insert(v_order.begin(), v_order[i]); v_order.erase(v_order.begin() + (i + 1)); #define SET_CHILD_MAP(i) setToChild(i + 1, true); #define SET_MAP(o) set(o, true); #define SET_MAP_NOCOPY(o) set_nocopy(o, true); #define MERGE_APPROX_AND_PREC(o) if(!b_approx && o.isApproximate()) b_approx = true; if(o.precision() > 0 && (i_precision < 1 || o.precision() < i_precision)) i_precision = o.precision(); #define CHILD_UPDATED(i) if(!b_approx && CHILD(i).isApproximate()) b_approx = true; if(CHILD(i).precision() > 0 && (i_precision < 1 || CHILD(i).precision() < i_precision)) i_precision = CHILD(i).precision(); #define CHILDREN_UPDATED for(size_t child_i = 0; child_i < SIZE; child_i++) {if(!b_approx && CHILD(child_i).isApproximate()) b_approx = true; if(CHILD(child_i).precision() > 0 && (i_precision < 1 || CHILD(child_i).precision() < i_precision)) i_precision = CHILD(child_i).precision();} #define APPEND(o) v_order.push_back(v_subs.size()); v_subs.push_back(new MathStructure(o)); if(!b_approx && o.isApproximate()) b_approx = true; if(o.precision() > 0 && (i_precision < 1 || o.precision() < i_precision)) i_precision = o.precision(); #define APPEND_NEW(o) {v_order.push_back(v_subs.size()); MathStructure *m_append_new = new MathStructure(o); v_subs.push_back(m_append_new); if(!b_approx && m_append_new->isApproximate()) b_approx = true; if(m_append_new->precision() > 0 && (i_precision < 1 || m_append_new->precision() < i_precision)) i_precision = m_append_new->precision();} #define APPEND_COPY(o) v_order.push_back(v_subs.size()); v_subs.push_back(new MathStructure(*(o))); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define APPEND_POINTER(o) v_order.push_back(v_subs.size()); v_subs.push_back(o); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define APPEND_REF(o) v_order.push_back(v_subs.size()); v_subs.push_back(o); (o)->ref(); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define PREPEND(o) v_order.insert(v_order.begin(), v_subs.size()); v_subs.push_back(new MathStructure(o)); if(!b_approx && o.isApproximate()) b_approx = true; if(o.precision() > 0 && (i_precision < 1 || o.precision() < i_precision)) i_precision = o.precision(); #define PREPEND_REF(o) v_order.insert(v_order.begin(), v_subs.size()); v_subs.push_back(o); (o)->ref(); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define INSERT_REF(o, i) v_order.insert(v_order.begin() + i, v_subs.size()); v_subs.push_back(o); (o)->ref(); if(!b_approx && (o)->isApproximate()) b_approx = true; if((o)->precision() > 0 && (i_precision < 1 || (o)->precision() < i_precision)) i_precision = (o)->precision(); #define CLEAR v_order.clear(); for(size_t i = 0; i < v_subs.size(); i++) {v_subs[i]->unref();} v_subs.clear(); //#define REDUCE(v_size) for(size_t v_index = v_size; v_index < v_order.size(); v_index++) {v_subs[v_order[v_index]]->unref(); v_subs.erase(v_subs.begin() + v_order[v_index]);} v_order.resize(v_size); #define REDUCE(v_size) {vector v_tmp; v_tmp.resize(SIZE, 0); for(size_t v_index = v_size; v_index < v_order.size(); v_index++) {v_subs[v_order[v_index]]->unref(); v_subs[v_order[v_index]] = NULL; v_tmp[v_order[v_index]] = 1;} v_order.resize(v_size); for(vector::iterator v_it = v_subs.begin(); v_it != v_subs.end();) {if(*v_it == NULL) v_it = v_subs.erase(v_it); else ++v_it;} size_t i_change = 0; for(size_t v_index = 0; v_index < v_tmp.size(); v_index++) {if(v_tmp[v_index] == 1) i_change++; v_tmp[v_index] = i_change;} for(size_t v_index = 0; v_index < v_order.size(); v_index++) v_order[v_index] -= v_tmp[v_index];} #define CHILD(v_index) (*v_subs[v_order[v_index]]) #define SIZE v_order.size() #define LAST (*v_subs[v_order[v_order.size() - 1]]) #define ERASE(v_index) v_subs[v_order[v_index]]->unref(); v_subs.erase(v_subs.begin() + v_order[v_index]); for(size_t v_index2 = 0; v_index2 < v_order.size(); v_index2++) {if(v_order[v_index2] > v_order[v_index]) v_order[v_index2]--;} v_order.erase(v_order.begin() + (v_index)); #define IS_REAL(o) (o.isNumber() && o.number().isReal()) #define IS_RATIONAL(o) (o.isNumber() && o.number().isRational()) #define IS_A_SYMBOL(o) ((o.isSymbolic() || o.isVariable() || o.isFunction()) && o.representsScalar()) #define POWER_CLEAN(o) if(o[1].isOne()) {o.setToChild(1);} else if(o[1].isZero()) {o.set(1, 1, 0);} #define VALID_ROOT(o) (o.size() == 2 && o[1].isNumber() && o[1].number().isInteger() && o[1].number().isPositive()) #define THIS_VALID_ROOT (SIZE == 2 && CHILD(1).isNumber() && CHILD(1).number().isInteger() && CHILD(1).number().isPositive()) /*void printRecursive(const MathStructure &mstruct) { std::cout << "RECURSIVE " << mstruct.print() << std::endl; for(size_t i = 0; i < mstruct.size(); i++) { std::cout << i << ": " << mstruct[i].print() << std::endl; for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { std::cout << i << "-" << i2 << ": " << mstruct[i][i2].print() << std::endl; for(size_t i3 = 0; i3 < mstruct[i][i2].size(); i3++) { std::cout << i << "-" << i2 << "-" << i3 << ": " << mstruct[i][i2][i3].print() << std::endl; for(size_t i4 = 0; i4 < mstruct[i][i2][i3].size(); i4++) { std::cout << i << "-" << i2 << "-" << i3 << "-" << i4 << ": " << mstruct[i][i2][i3][i4].print() << std::endl; for(size_t i5 = 0; i5 < mstruct[i][i2][i3][i4].size(); i5++) { std::cout << i << "-" << i2 << "-" << i3 << "-" << i4 << "-" << i5 << ": " << mstruct[i][i2][i3][i4][i5].print() << std::endl; for(size_t i6 = 0; i6 < mstruct[i][i2][i3][i4][i5].size(); i6++) { std::cout << i << "-" << i2 << "-" << i3 << "-" << i4 << "-" << i5 << "-" << i6 << ": " << mstruct[i][i2][i3][i4][i5][i6].print() << std::endl; } } } } } } }*/ string format_and_print(const MathStructure &mstruct) { MathStructure m_print(mstruct); if(CALCULATOR) { m_print.sort(CALCULATOR->messagePrintOptions()); m_print.formatsub(CALCULATOR->messagePrintOptions(), NULL, 0, true, &m_print); return m_print.print(CALCULATOR->messagePrintOptions()); } else { PrintOptions po; po.interval_display = INTERVAL_DISPLAY_PLUSMINUS; po.spell_out_logical_operators = true; po.number_fraction_format = FRACTION_FRACTIONAL; m_print.sort(po); m_print.formatsub(po, NULL, 0, true, &m_print); return m_print.print(po); } } struct sym_desc { MathStructure sym; Number deg_a; Number deg_b; Number ldeg_a; Number ldeg_b; Number max_deg; size_t max_lcnops; bool operator<(const sym_desc &x) const { if (max_deg == x.max_deg) return max_lcnops < x.max_lcnops; else return max_deg.isLessThan(x.max_deg); } }; typedef std::vector sym_desc_vec; bool polynomial_long_division(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar_pre, MathStructure &mquotient, MathStructure &mrem, const EvaluationOptions &eo, bool check_args = false, bool for_newtonraphson = false); void integer_content(const MathStructure &mpoly, Number &icontent); void interpolate(const MathStructure &gamma, const Number &xi, const MathStructure &xvar, MathStructure &minterp, const EvaluationOptions &eo); bool get_first_symbol(const MathStructure &mpoly, MathStructure &xvar); bool divide_in_z(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const sym_desc_vec &sym_stats, size_t var_i, const EvaluationOptions &eo); bool prem(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mrem, const EvaluationOptions &eo, bool check_args = true); bool sr_gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mgcd, const sym_desc_vec &sym_stats, size_t var_i, const EvaluationOptions &eo); void polynomial_smod(const MathStructure &mpoly, const Number &xi, MathStructure &msmod, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_smod = 0); bool heur_gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mgcd, const EvaluationOptions &eo, MathStructure *ca, MathStructure *cb, const sym_desc_vec &sym_stats, size_t var_i); void add_symbol(const MathStructure &mpoly, sym_desc_vec &v); void collect_symbols(const MathStructure &mpoly, sym_desc_vec &v); void add_symbol(const MathStructure &mpoly, vector &v); void collect_symbols(const MathStructure &mpoly, vector &v); void get_symbol_stats(const MathStructure &m1, const MathStructure &m2, sym_desc_vec &v); bool sqrfree(MathStructure &mpoly, const EvaluationOptions &eo); bool sqrfree(MathStructure &mpoly, const vector &symbols, const EvaluationOptions &eo); bool simplify_functions(MathStructure &mstruct, const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_var = m_undefined); bool flattenMultiplication(MathStructure &mstruct) { bool retval = false; for(size_t i = 0; i < mstruct.size();) { if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { mstruct[i][i2].ref(); mstruct.insertChild_nocopy(&mstruct[i][i2], i + i2 + 2); } mstruct.delChild(i + 1); retval = true; } else { i++; } } return retval; } bool warn_about_assumed_not_value(const MathStructure &mstruct, const MathStructure &mvalue, const EvaluationOptions &eo) { CALCULATOR->beginTemporaryStopMessages(); EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; eo2.test_comparisons = true; eo2.isolate_x = true; eo2.expand = true; eo2.approximation = APPROXIMATION_APPROXIMATE; MathStructure mnonzero(mstruct); mnonzero.add(mvalue, OPERATION_NOT_EQUALS); mnonzero.eval(eo2); if(mnonzero.isComparison() && mnonzero[0].isVariable() && !mnonzero[0].variable()->isKnown() && !((UnknownVariable*) mnonzero[0].variable())->interval().isUndefined()) { if(((UnknownVariable*) mnonzero[0].variable())->interval().containsInterval(true)) { MathStructure mbak(mnonzero); mnonzero[0] = ((UnknownVariable*) mnonzero[0].variable())->interval(); mnonzero.eval(eo2); if(mnonzero.isComparison()) mnonzero = mbak; } else { mnonzero[0] = ((UnknownVariable*) mnonzero[0].variable())->interval(); mnonzero.eval(eo2); } } if(CALCULATOR->endTemporaryStopMessages()) return false; if(mnonzero.isZero()) return false; if(mnonzero.isOne()) return true; if(mvalue.isZero() && mnonzero.isComparison() && mnonzero.comparisonType() == COMPARISON_NOT_EQUALS && mnonzero[1].isZero() && mnonzero[0].representsApproximatelyZero(true)) return false; CALCULATOR->error(false, _("Required assumption: %s."), format_and_print(mnonzero).c_str(), NULL); return true; } bool warn_about_denominators_assumed_nonzero(const MathStructure &mstruct, const EvaluationOptions &eo) { CALCULATOR->beginTemporaryStopMessages(); EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; eo2.test_comparisons = true; eo2.isolate_x = true; eo2.expand = true; eo2.approximation = APPROXIMATION_APPROXIMATE; MathStructure mnonzero(mstruct); mnonzero.add(m_zero, OPERATION_NOT_EQUALS); mnonzero.eval(eo2); if(mnonzero.isComparison() && mnonzero[0].isVariable() && !mnonzero[0].variable()->isKnown() && !((UnknownVariable*) mnonzero[0].variable())->interval().isUndefined()) { if(((UnknownVariable*) mnonzero[0].variable())->interval().containsInterval(true)) { MathStructure mbak(mnonzero); mnonzero[0] = ((UnknownVariable*) mnonzero[0].variable())->interval(); mnonzero.eval(eo2); if(mnonzero.isComparison()) mnonzero = mbak; } else { mnonzero[0] = ((UnknownVariable*) mnonzero[0].variable())->interval(); mnonzero.eval(eo2); } } if(CALCULATOR->endTemporaryStopMessages()) return false; if(mnonzero.isZero()) return false; if(mnonzero.isOne()) return true; if(mnonzero.isComparison() && mnonzero.comparisonType() == COMPARISON_NOT_EQUALS && mnonzero[1].isZero() && mnonzero[0].representsApproximatelyZero(true)) return false; CALCULATOR->error(false, _("To avoid division by zero, the following must be true: %s."), format_and_print(mnonzero).c_str(), NULL); return true; } bool warn_about_denominators_assumed_nonzero_or_positive(const MathStructure &mstruct, const MathStructure &mstruct2, const EvaluationOptions &eo) { CALCULATOR->beginTemporaryStopMessages(); EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; eo2.test_comparisons = true; eo2.isolate_x = true; eo2.expand = true; eo2.approximation = APPROXIMATION_APPROXIMATE; MathStructure mnonzero(mstruct); mnonzero.add(m_zero, OPERATION_NOT_EQUALS); MathStructure *mpos = new MathStructure(mstruct2); mpos->add(m_zero, OPERATION_EQUALS_GREATER); mnonzero.add_nocopy(mpos, OPERATION_LOGICAL_OR); mnonzero.eval(eo2); if(mnonzero.isComparison() && mnonzero[0].isVariable() && !mnonzero[0].variable()->isKnown() && !((UnknownVariable*) mnonzero[0].variable())->interval().isUndefined()) { if(((UnknownVariable*) mnonzero[0].variable())->interval().containsInterval(true)) { MathStructure mbak(mnonzero); mnonzero[0] = ((UnknownVariable*) mnonzero[0].variable())->interval(); mnonzero.eval(eo2); if(mnonzero.isComparison()) mnonzero = mbak; } else { mnonzero[0] = ((UnknownVariable*) mnonzero[0].variable())->interval(); mnonzero.eval(eo2); } } if(CALCULATOR->endTemporaryStopMessages()) return false; if(mnonzero.isZero()) return false; if(mnonzero.isOne()) return true; if(mnonzero.isComparison() && mnonzero.comparisonType() == COMPARISON_NOT_EQUALS && mnonzero[1].isZero() && mnonzero[0].representsApproximatelyZero(true)) return false; CALCULATOR->error(false, _("To avoid division by zero, the following must be true: %s."), format_and_print(mnonzero).c_str(), NULL); return true; } bool warn_about_denominators_assumed_nonzero_llgg(const MathStructure &mstruct, const MathStructure &mstruct2, const MathStructure &mstruct3, const EvaluationOptions &eo) { CALCULATOR->beginTemporaryStopMessages(); EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; eo2.test_comparisons = true; eo2.isolate_x = true; eo2.expand = true; eo2.approximation = APPROXIMATION_APPROXIMATE; MathStructure mnonzero(mstruct); mnonzero.add(m_zero, OPERATION_NOT_EQUALS); MathStructure *mpos = new MathStructure(mstruct2); mpos->add(m_zero, OPERATION_EQUALS_GREATER); MathStructure *mpos2 = new MathStructure(mstruct3); mpos2->add(m_zero, OPERATION_EQUALS_GREATER); mpos->add_nocopy(mpos2, OPERATION_LOGICAL_AND); mnonzero.add_nocopy(mpos, OPERATION_LOGICAL_OR); MathStructure *mneg = new MathStructure(mstruct2); mneg->add(m_zero, OPERATION_LESS); MathStructure *mneg2 = new MathStructure(mstruct3); mneg2->add(m_zero, OPERATION_LESS); mneg->add_nocopy(mneg2, OPERATION_LOGICAL_AND); mnonzero.add_nocopy(mneg, OPERATION_LOGICAL_OR); mnonzero.eval(eo2); if(mnonzero.isComparison() && mnonzero[0].isVariable() && !mnonzero[0].variable()->isKnown() && !((UnknownVariable*) mnonzero[0].variable())->interval().isUndefined()) { if(((UnknownVariable*) mnonzero[0].variable())->interval().containsInterval(true)) { MathStructure mbak(mnonzero); mnonzero[0] = ((UnknownVariable*) mnonzero[0].variable())->interval(); mnonzero.eval(eo2); if(mnonzero.isComparison()) mnonzero = mbak; } else { mnonzero[0] = ((UnknownVariable*) mnonzero[0].variable())->interval(); mnonzero.eval(eo2); } } if(CALCULATOR->endTemporaryStopMessages()) return false; if(mnonzero.isZero()) return false; if(mnonzero.isOne()) return true; if(mnonzero.isComparison() && mnonzero.comparisonType() == COMPARISON_NOT_EQUALS && mnonzero[1].isZero() && mnonzero[0].representsApproximatelyZero(true)) return false; CALCULATOR->error(false, _("To avoid division by zero, the following must be true: %s."), format_and_print(mnonzero).c_str(), NULL); return true; } void unnegate_sign(MathStructure &mstruct) { if(mstruct.isNumber()) { mstruct.number().negate(); } else if(mstruct.isMultiplication() && mstruct.size() > 0) { if(mstruct[0].isMinusOne()) { if(mstruct.size() > 2) { mstruct.delChild(1); } else if(mstruct.size() == 2) { mstruct.setToChild(2); } else { mstruct.set(1, 1, 0); } } else { unnegate_sign(mstruct[0]); } } } void MathStructure::mergePrecision(const MathStructure &o) {MERGE_APPROX_AND_PREC(o)} void MathStructure::mergePrecision(bool approx, int prec) { if(!b_approx && approx) setApproximate(); if(prec >= 0 && (i_precision < 0 || prec < i_precision)) { setPrecision(prec); } } void idm1(const MathStructure &mnum, bool &bfrac, bool &bint); void idm2(const MathStructure &mnum, bool &bfrac, bool &bint, Number &nr); int idm3(MathStructure &mnum, Number &nr, bool expand); void MathStructure::ref() { i_ref++; } void MathStructure::unref() { i_ref--; if(i_ref == 0) { delete this; } } size_t MathStructure::refcount() const { return i_ref; } inline void MathStructure::init() { m_type = STRUCT_NUMBER; b_approx = false; i_precision = -1; i_ref = 1; function_value = NULL; b_protected = false; o_variable = NULL; o_function = NULL; o_unit = NULL; o_prefix = NULL; o_datetime = NULL; b_parentheses = false; } MathStructure::MathStructure() { init(); } MathStructure::MathStructure(const MathStructure &o) { init(); switch(o.type()) { case STRUCT_NUMBER: { o_number.set(o.number()); break; } case STRUCT_ABORTED: {} case STRUCT_SYMBOLIC: { s_sym = o.symbol(); break; } case STRUCT_DATETIME: { o_datetime = new QalculateDateTime(*o.datetime()); break; } case STRUCT_FUNCTION: { o_function = o.function(); if(o_function) o.function()->ref(); if(o.functionValue()) function_value = new MathStructure(*o.functionValue()); break; } case STRUCT_VARIABLE: { o_variable = o.variable(); if(o_variable) o_variable->ref(); break; } case STRUCT_UNIT: { o_unit = o.unit(); o_prefix = o.prefix(); if(o_unit) o_unit->ref(); b_plural = o.isPlural(); break; } case STRUCT_COMPARISON: { ct_comp = o.comparisonType(); break; } default: {} } b_protected = o.isProtected(); for(size_t i = 0; i < o.size(); i++) { APPEND_COPY((&o[i])) } b_approx = o.isApproximate(); i_precision = o.precision(); m_type = o.type(); b_parentheses = o.inParentheses(); } MathStructure::MathStructure(long int num, long int den, long int exp10) { init(); o_number.set(num, den, exp10); } MathStructure::MathStructure(int num, int den, int exp10) { init(); o_number.set(num, den, exp10); } MathStructure::MathStructure(string sym, bool force_symbol) { init(); if(!force_symbol && sym.length() > 1) { if(sym == "undefined") { setUndefined(false); return; } o_datetime = new QalculateDateTime(); if(o_datetime->set(sym)) { m_type = STRUCT_DATETIME; return; } delete o_datetime; o_datetime = NULL; } s_sym = sym; m_type = STRUCT_SYMBOLIC; } MathStructure::MathStructure(const QalculateDateTime &o_dt) { init(); o_datetime = new QalculateDateTime(o_dt); m_type = STRUCT_DATETIME; } MathStructure::MathStructure(double float_value) { init(); o_number.setFloat(float_value); b_approx = o_number.isApproximate(); i_precision = o_number.precision(); } MathStructure::MathStructure(const MathStructure *o, ...) { init(); va_list ap; va_start(ap, o); if(o) { APPEND_COPY(o) while(true) { o = va_arg(ap, const MathStructure*); if(!o) break; APPEND_COPY(o) } } va_end(ap); m_type = STRUCT_VECTOR; } MathStructure::MathStructure(MathFunction *o, ...) { init(); va_list ap; va_start(ap, o); o_function = o; if(o_function) o_function->ref(); while(true) { const MathStructure *mstruct = va_arg(ap, const MathStructure*); if(!mstruct) break; APPEND_COPY(mstruct) } va_end(ap); m_type = STRUCT_FUNCTION; } MathStructure::MathStructure(Unit *u, Prefix *p) { init(); o_unit = u; o_prefix = p; if(o_unit) o_unit->ref(); m_type = STRUCT_UNIT; } MathStructure::MathStructure(Variable *o) { init(); o_variable = o; if(o_variable) o_variable->ref(); m_type = STRUCT_VARIABLE; } MathStructure::MathStructure(const Number &o) { init(); o_number.set(o); b_approx = o_number.isApproximate(); i_precision = o_number.precision(); } MathStructure::~MathStructure() { clear(); } void MathStructure::set(const MathStructure &o, bool merge_precision) { clear(merge_precision); switch(o.type()) { case STRUCT_NUMBER: { o_number.set(o.number()); break; } case STRUCT_ABORTED: {} case STRUCT_SYMBOLIC: { s_sym = o.symbol(); break; } case STRUCT_DATETIME: { o_datetime = new QalculateDateTime(*o.datetime()); break; } case STRUCT_FUNCTION: { o_function = o.function(); if(o_function) o.function()->ref(); if(o.functionValue()) function_value = new MathStructure(*o.functionValue()); break; } case STRUCT_VARIABLE: { o_variable = o.variable(); if(o_variable) o_variable->ref(); break; } case STRUCT_UNIT: { o_unit = o.unit(); o_prefix = o.prefix(); if(o_unit) o_unit->ref(); b_plural = o.isPlural(); break; } case STRUCT_COMPARISON: { ct_comp = o.comparisonType(); break; } default: {} } b_protected = o.isProtected(); for(size_t i = 0; i < o.size(); i++) { APPEND_COPY((&o[i])) } if(merge_precision) { MERGE_APPROX_AND_PREC(o); } else { b_approx = o.isApproximate(); i_precision = o.precision(); } b_parentheses = o.inParentheses(); m_type = o.type(); } void MathStructure::set_nocopy(MathStructure &o, bool merge_precision) { o.ref(); clear(merge_precision); switch(o.type()) { case STRUCT_NUMBER: { o_number.set(o.number()); break; } case STRUCT_ABORTED: {} case STRUCT_SYMBOLIC: { s_sym = o.symbol(); break; } case STRUCT_DATETIME: { o_datetime = new QalculateDateTime(*o.datetime()); break; } case STRUCT_FUNCTION: { o_function = o.function(); if(o_function) o_function->ref(); if(o.functionValue()) { function_value = (MathStructure*) o.functionValue(); function_value->ref(); } break; } case STRUCT_VARIABLE: { o_variable = o.variable(); if(o_variable) o_variable->ref(); break; } case STRUCT_UNIT: { o_unit = o.unit(); o_prefix = o.prefix(); if(o_unit) o_unit->ref(); b_plural = o.isPlural(); break; } case STRUCT_COMPARISON: { ct_comp = o.comparisonType(); break; } default: {} } b_protected = o.isProtected(); for(size_t i = 0; i < o.size(); i++) { APPEND_REF((&o[i])) } if(merge_precision) { MERGE_APPROX_AND_PREC(o); } else { b_approx = o.isApproximate(); i_precision = o.precision(); } b_parentheses = o.inParentheses(); m_type = o.type(); o.unref(); } void MathStructure::setToChild(size_t index, bool preserve_precision, MathStructure *mparent, size_t index_this) { if(index > 0 && index <= SIZE) { if(mparent) { CHILD(index - 1).ref(); mparent->setChild_nocopy(&CHILD(index - 1), index_this, preserve_precision); } else { set_nocopy(CHILD(index - 1), preserve_precision); } } } void MathStructure::set(long int num, long int den, long int exp10, bool preserve_precision) { clear(preserve_precision); o_number.set(num, den, exp10); if(!preserve_precision) { b_approx = false; i_precision = -1; } m_type = STRUCT_NUMBER; } void MathStructure::set(int num, int den, int exp10, bool preserve_precision) { clear(preserve_precision); o_number.set(num, den, exp10); if(!preserve_precision) { b_approx = false; i_precision = -1; } m_type = STRUCT_NUMBER; } void MathStructure::set(double float_value, bool preserve_precision) { clear(preserve_precision); o_number.setFloat(float_value); if(preserve_precision) { MERGE_APPROX_AND_PREC(o_number); } else { b_approx = o_number.isApproximate(); i_precision = o_number.precision(); } m_type = STRUCT_NUMBER; } void MathStructure::set(string sym, bool preserve_precision, bool force_symbol) { clear(preserve_precision); if(!force_symbol && sym.length() > 1) { if(sym == "undefined") { setUndefined(true); return; } o_datetime = new QalculateDateTime(); if(o_datetime->set(sym)) { m_type = STRUCT_DATETIME; return; } delete o_datetime; o_datetime = NULL; } s_sym = sym; m_type = STRUCT_SYMBOLIC; } void MathStructure::set(const QalculateDateTime &o_dt, bool preserve_precision) { clear(preserve_precision); o_datetime = new QalculateDateTime(o_dt); m_type = STRUCT_DATETIME; } void MathStructure::setVector(const MathStructure *o, ...) { clear(); va_list ap; va_start(ap, o); if(o) { APPEND_COPY(o) while(true) { o = va_arg(ap, const MathStructure*); if(!o) break; APPEND_COPY(o) } } va_end(ap); m_type = STRUCT_VECTOR; } void MathStructure::set(MathFunction *o, ...) { clear(); va_list ap; va_start(ap, o); o_function = o; if(o_function) o_function->ref(); while(true) { const MathStructure *mstruct = va_arg(ap, const MathStructure*); if(!mstruct) break; APPEND_COPY(mstruct) } va_end(ap); m_type = STRUCT_FUNCTION; } void MathStructure::set(Unit *u, Prefix *p, bool preserve_precision) { clear(preserve_precision); o_unit = u; o_prefix = p; if(o_unit) o_unit->ref(); m_type = STRUCT_UNIT; } void MathStructure::set(Variable *o, bool preserve_precision) { clear(preserve_precision); o_variable = o; if(o_variable) o_variable->ref(); m_type = STRUCT_VARIABLE; } void MathStructure::set(const Number &o, bool preserve_precision) { clear(preserve_precision); o_number.set(o); if(preserve_precision) { MERGE_APPROX_AND_PREC(o_number); } else { b_approx = o_number.isApproximate(); i_precision = o_number.precision(); } m_type = STRUCT_NUMBER; } void MathStructure::setUndefined(bool preserve_precision) { clear(preserve_precision); m_type = STRUCT_UNDEFINED; } void MathStructure::setAborted(bool preserve_precision) { clear(preserve_precision); m_type = STRUCT_ABORTED; s_sym = _("aborted"); } void MathStructure::setProtected(bool do_protect) {b_protected = do_protect;} bool MathStructure::isProtected() const {return b_protected;} void MathStructure::operator = (const MathStructure &o) {set(o);} void MathStructure::operator = (const Number &o) {set(o);} void MathStructure::operator = (int i) {set(i, 1, 0);} void MathStructure::operator = (Unit *u) {set(u);} void MathStructure::operator = (Variable *v) {set(v);} void MathStructure::operator = (string sym) {set(sym);} MathStructure MathStructure::operator - () const { MathStructure o2(*this); o2.negate(); return o2; } MathStructure MathStructure::operator * (const MathStructure &o) const { MathStructure o2(*this); o2.multiply(o); return o2; } MathStructure MathStructure::operator / (const MathStructure &o) const { MathStructure o2(*this); o2.divide(o); return o2; } MathStructure MathStructure::operator + (const MathStructure &o) const { MathStructure o2(*this); o2.add(o); return o; } MathStructure MathStructure::operator - (const MathStructure &o) const { MathStructure o2(*this); o2.subtract(o); return o2; } MathStructure MathStructure::operator ^ (const MathStructure &o) const { MathStructure o2(*this); o2.raise(o); return o2; } MathStructure MathStructure::operator && (const MathStructure &o) const { MathStructure o2(*this); o2.add(o, OPERATION_LOGICAL_AND); return o2; } MathStructure MathStructure::operator || (const MathStructure &o) const { MathStructure o2(*this); o2.add(o, OPERATION_LOGICAL_OR); return o2; } MathStructure MathStructure::operator ! () const { MathStructure o2(*this); o2.setLogicalNot(); return o2; } void MathStructure::operator *= (const MathStructure &o) {multiply(o);} void MathStructure::operator /= (const MathStructure &o) {divide(o);} void MathStructure::operator += (const MathStructure &o) {add(o);} void MathStructure::operator -= (const MathStructure &o) {subtract(o);} void MathStructure::operator ^= (const MathStructure &o) {raise(o);} void MathStructure::operator *= (const Number &o) {multiply(o);} void MathStructure::operator /= (const Number &o) {divide(o);} void MathStructure::operator += (const Number &o) {add(o);} void MathStructure::operator -= (const Number &o) {subtract(o);} void MathStructure::operator ^= (const Number &o) {raise(o);} void MathStructure::operator *= (int i) {multiply(i);} void MathStructure::operator /= (int i) {divide(i);} void MathStructure::operator += (int i) {add(i);} void MathStructure::operator -= (int i) {subtract(i);} void MathStructure::operator ^= (int i) {raise(i);} void MathStructure::operator *= (Unit *u) {multiply(u);} void MathStructure::operator /= (Unit *u) {divide(u);} void MathStructure::operator += (Unit *u) {add(u);} void MathStructure::operator -= (Unit *u) {subtract(u);} void MathStructure::operator ^= (Unit *u) {raise(u);} void MathStructure::operator *= (Variable *v) {multiply(v);} void MathStructure::operator /= (Variable *v) {divide(v);} void MathStructure::operator += (Variable *v) {add(v);} void MathStructure::operator -= (Variable *v) {subtract(v);} void MathStructure::operator ^= (Variable *v) {raise(v);} void MathStructure::operator *= (string sym) {multiply(sym);} void MathStructure::operator /= (string sym) {divide(sym);} void MathStructure::operator += (string sym) {add(sym);} void MathStructure::operator -= (string sym) {subtract(sym);} void MathStructure::operator ^= (string sym) {raise(sym);} bool MathStructure::operator == (const MathStructure &o) const {return equals(o);} bool MathStructure::operator == (const Number &o) const {return equals(o);} bool MathStructure::operator == (int i) const {return equals(i);} bool MathStructure::operator == (Unit *u) const {return equals(u);} bool MathStructure::operator == (Variable *v) const {return equals(v);} bool MathStructure::operator == (string sym) const {return equals(sym);} bool MathStructure::operator != (const MathStructure &o) const {return !equals(o);} /*MathStructure& MathStructure::CHILD(size_t v_index) const { if(v_index < v_order.size() && v_order[v_index] < v_subs.size()) return *v_subs[v_order[v_index]]; MathStructure* m = new MathStructure;//(new UnknownVariable("x","x")); m->setUndefined(true); return *m; }*/ const MathStructure &MathStructure::operator [] (size_t index) const {return CHILD(index);} MathStructure &MathStructure::operator [] (size_t index) {return CHILD(index);} MathStructure &MathStructure::last() {return LAST;} const MathStructure MathStructure::last() const {return LAST;} void MathStructure::clear(bool preserve_precision) { m_type = STRUCT_NUMBER; o_number.clear(); if(function_value) { function_value->unref(); function_value = NULL; } if(o_function) o_function->unref(); o_function = NULL; if(o_variable) o_variable->unref(); o_variable = NULL; if(o_unit) o_unit->unref(); o_unit = NULL; if(o_datetime) delete o_datetime; o_datetime = NULL; o_prefix = NULL; b_plural = false; b_protected = false; CLEAR; if(!preserve_precision) { i_precision = -1; b_approx = false; } } void MathStructure::clearVector(bool preserve_precision) { clear(preserve_precision); m_type = STRUCT_VECTOR; } void MathStructure::clearMatrix(bool preserve_precision) { clearVector(preserve_precision); MathStructure *mstruct = new MathStructure(); mstruct->clearVector(); APPEND_POINTER(mstruct); } const MathStructure *MathStructure::functionValue() const { return function_value; } const Number &MathStructure::number() const { return o_number; } Number &MathStructure::number() { return o_number; } void MathStructure::numberUpdated() { if(m_type != STRUCT_NUMBER) return; MERGE_APPROX_AND_PREC(o_number) } void MathStructure::childUpdated(size_t index, bool recursive) { if(index > SIZE || index < 1) return; if(recursive) CHILD(index - 1).childrenUpdated(true); MERGE_APPROX_AND_PREC(CHILD(index - 1)) } void MathStructure::childrenUpdated(bool recursive) { for(size_t i = 0; i < SIZE; i++) { if(recursive) CHILD(i).childrenUpdated(true); MERGE_APPROX_AND_PREC(CHILD(i)) } } const string &MathStructure::symbol() const { return s_sym; } const QalculateDateTime *MathStructure::datetime() const { return o_datetime; } QalculateDateTime *MathStructure::datetime() { return o_datetime; } ComparisonType MathStructure::comparisonType() const { return ct_comp; } void MathStructure::setComparisonType(ComparisonType comparison_type) { ct_comp = comparison_type; } void MathStructure::setType(StructureType mtype) { m_type = mtype; } Unit *MathStructure::unit() const { return o_unit; } Unit *MathStructure::unit_exp_unit() const { if(isUnit()) return o_unit; if(isPower() && CHILD(0).isUnit()) return CHILD(0).unit(); return NULL; } Prefix *MathStructure::prefix() const { return o_prefix; } Prefix *MathStructure::unit_exp_prefix() const { if(isUnit()) return o_prefix; if(isPower() && CHILD(0).isUnit()) return CHILD(0).prefix(); return NULL; } void MathStructure::setPrefix(Prefix *p) { if(isUnit()) { o_prefix = p; } } bool MathStructure::isPlural() const { return b_plural; } void MathStructure::setPlural(bool is_plural) { if(isUnit()) b_plural = is_plural; } void MathStructure::setFunction(MathFunction *f) { if(f) f->ref(); if(o_function) o_function->unref(); o_function = f; } void MathStructure::setUnit(Unit *u) { if(u) u->ref(); if(o_unit) o_unit->unref(); o_unit = u; } void MathStructure::setVariable(Variable *v) { if(v) v->ref(); if(o_variable) o_variable->unref(); o_variable = v; } MathFunction *MathStructure::function() const { return o_function; } Variable *MathStructure::variable() const { return o_variable; } bool MathStructure::isAddition() const {return m_type == STRUCT_ADDITION;} bool MathStructure::isMultiplication() const {return m_type == STRUCT_MULTIPLICATION;} bool MathStructure::isPower() const {return m_type == STRUCT_POWER;} bool MathStructure::isSymbolic() const {return m_type == STRUCT_SYMBOLIC;} bool MathStructure::isDateTime() const {return m_type == STRUCT_DATETIME;} bool MathStructure::isAborted() const {return m_type == STRUCT_ABORTED;} bool MathStructure::isEmptySymbol() const {return m_type == STRUCT_SYMBOLIC && s_sym.empty();} bool MathStructure::isVector() const {return m_type == STRUCT_VECTOR;} bool MathStructure::isMatrix() const { if(m_type != STRUCT_VECTOR || SIZE < 1) return false; for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).isVector() || (i > 0 && CHILD(i).size() != CHILD(i - 1).size())) return false; } return true; } bool MathStructure::isFunction() const {return m_type == STRUCT_FUNCTION;} bool MathStructure::isUnit() const {return m_type == STRUCT_UNIT;} bool MathStructure::isUnit_exp() const {return m_type == STRUCT_UNIT || (m_type == STRUCT_POWER && CHILD(0).isUnit());} bool MathStructure::isUnknown() const {return m_type == STRUCT_SYMBOLIC || (m_type == STRUCT_VARIABLE && o_variable && !o_variable->isKnown());} bool MathStructure::isUnknown_exp() const {return isUnknown() || (m_type == STRUCT_POWER && CHILD(0).isUnknown());} bool MathStructure::isNumber_exp() const {return m_type == STRUCT_NUMBER || (m_type == STRUCT_POWER && CHILD(0).isNumber());} bool MathStructure::isVariable() const {return m_type == STRUCT_VARIABLE;} bool MathStructure::isComparison() const {return m_type == STRUCT_COMPARISON;} bool MathStructure::isLogicalAnd() const {return m_type == STRUCT_LOGICAL_AND;} bool MathStructure::isLogicalOr() const {return m_type == STRUCT_LOGICAL_OR;} bool MathStructure::isLogicalXor() const {return m_type == STRUCT_LOGICAL_XOR;} bool MathStructure::isLogicalNot() const {return m_type == STRUCT_LOGICAL_NOT;} bool MathStructure::isBitwiseAnd() const {return m_type == STRUCT_BITWISE_AND;} bool MathStructure::isBitwiseOr() const {return m_type == STRUCT_BITWISE_OR;} bool MathStructure::isBitwiseXor() const {return m_type == STRUCT_BITWISE_XOR;} bool MathStructure::isBitwiseNot() const {return m_type == STRUCT_BITWISE_NOT;} bool MathStructure::isInverse() const {return m_type == STRUCT_INVERSE;} bool MathStructure::isDivision() const {return m_type == STRUCT_DIVISION;} bool MathStructure::isNegate() const {return m_type == STRUCT_NEGATE;} bool MathStructure::isInfinity() const {return m_type == STRUCT_NUMBER && o_number.isInfinite(true);} bool MathStructure::isUndefined() const {return m_type == STRUCT_UNDEFINED || (m_type == STRUCT_NUMBER && o_number.isUndefined()) || (m_type == STRUCT_VARIABLE && o_variable == CALCULATOR->v_undef);} bool MathStructure::isInteger() const {return m_type == STRUCT_NUMBER && o_number.isInteger();} bool MathStructure::isInfinite(bool ignore_imag) const {return m_type == STRUCT_NUMBER && o_number.isInfinite(ignore_imag);} bool MathStructure::isNumber() const {return m_type == STRUCT_NUMBER;} bool MathStructure::isZero() const {return m_type == STRUCT_NUMBER && o_number.isZero();} bool MathStructure::isApproximatelyZero() const {return m_type == STRUCT_NUMBER && !o_number.isNonZero();} bool MathStructure::isOne() const {return m_type == STRUCT_NUMBER && o_number.isOne();} bool MathStructure::isMinusOne() const {return m_type == STRUCT_NUMBER && o_number.isMinusOne();} bool MathStructure::hasNegativeSign() const { return (m_type == STRUCT_NUMBER && o_number.hasNegativeSign()) || m_type == STRUCT_NEGATE || (m_type == STRUCT_MULTIPLICATION && SIZE > 0 && CHILD(0).hasNegativeSign()); } bool MathStructure::representsBoolean() const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isOne() || o_number.isZero();} case STRUCT_VARIABLE: {return o_variable->representsBoolean();} case STRUCT_FUNCTION: {return (function_value && function_value->representsBoolean()) || o_function->representsBoolean(*this);} case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsBoolean()) return false; } return true; } case STRUCT_LOGICAL_NOT: {} case STRUCT_LOGICAL_AND: {} case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_XOR: {} case STRUCT_COMPARISON: {return true;} default: {return false;} } } bool MathStructure::representsNumber(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return !o_number.includesInfinity();} case STRUCT_VARIABLE: {return o_variable->representsNumber(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNumber();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNumber(allow_units)) || o_function->representsNumber(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_DATETIME: {return allow_units;} case STRUCT_POWER: { if(!CHILD(0).representsNonZero(allow_units) || !CHILD(1).representsNonNegative(allow_units)) return false; } case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNumber(allow_units)) return false; } return true; } default: {return false;} } } bool MathStructure::representsInteger(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isInteger();} case STRUCT_VARIABLE: {return o_variable->representsInteger(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isInteger();} case STRUCT_FUNCTION: {return (function_value && function_value->representsInteger(allow_units)) || o_function->representsInteger(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsInteger(allow_units)) return false; } return true; } case STRUCT_POWER: { return CHILD(0).representsInteger(allow_units) && CHILD(1).representsInteger(false) && CHILD(1).representsPositive(false); } default: {return false;} } } bool MathStructure::representsNonInteger(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return !o_number.isInteger();} case STRUCT_VARIABLE: {return o_variable->representsNonInteger(allow_units);} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonInteger(allow_units));} case STRUCT_UNIT: {return false;} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { return false; } case STRUCT_POWER: { return false; } default: {return false;} } } bool MathStructure::representsFraction(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isFraction();} case STRUCT_VARIABLE: {return o_variable->representsFraction(allow_units);} case STRUCT_FUNCTION: {return (function_value && function_value->representsFraction(allow_units));} case STRUCT_UNIT: {return false;} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { return false; } case STRUCT_POWER: { return false; } default: {return false;} } } bool MathStructure::representsPositive(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isPositive();} case STRUCT_VARIABLE: {return o_variable->representsPositive(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isPositive();} case STRUCT_FUNCTION: {return (function_value && function_value->representsPositive(allow_units)) || o_function->representsPositive(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsPositive(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { bool b = true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsNegative(allow_units)) { b = !b; } else if(!CHILD(i).representsPositive(allow_units)) { return false; } } return b; } case STRUCT_POWER: { return (CHILD(0).representsPositive(allow_units) && CHILD(1).representsReal(false)) || (CHILD(0).representsNonZero(allow_units) && CHILD(0).representsReal(allow_units) && CHILD(1).representsEven(false) && CHILD(1).representsInteger(false)); } default: {return false;} } } bool MathStructure::representsNegative(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isNegative();} case STRUCT_VARIABLE: {return o_variable->representsNegative(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNegative();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNegative(allow_units)) || o_function->representsNegative(*this, allow_units);} case STRUCT_UNIT: {return false;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNegative(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsNegative(allow_units)) { b = !b; } else if(!CHILD(i).representsPositive(allow_units)) { return false; } } return b; } case STRUCT_POWER: { return CHILD(1).representsInteger(false) && CHILD(1).representsOdd(false) && CHILD(0).representsNegative(allow_units); } default: {return false;} } } bool MathStructure::representsNonNegative(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isNonNegative();} case STRUCT_VARIABLE: {return o_variable->representsNonNegative(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNonNegative();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonNegative(allow_units)) || o_function->representsNonNegative(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonNegative(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { bool b = true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsNegative(allow_units)) { b = !b; } else if(!CHILD(i).representsNonNegative(allow_units)) { return false; } } return b; } case STRUCT_POWER: { return (CHILD(0).isZero() && CHILD(1).representsNonNegative(false)) || (CHILD(0).representsNonNegative(allow_units) && CHILD(1).representsReal(false)) || (CHILD(0).representsReal(allow_units) && CHILD(1).representsEven(false) && CHILD(1).representsInteger(false)); } default: {return false;} } } bool MathStructure::representsNonPositive(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isNonPositive();} case STRUCT_VARIABLE: {return o_variable->representsNonPositive(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNonPositive();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonPositive(allow_units)) || o_function->representsNonPositive(*this, allow_units);} case STRUCT_UNIT: {return false;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonPositive(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsNegative(allow_units)) { b = !b; } else if(!CHILD(i).representsPositive(allow_units)) { return false; } } return b; } case STRUCT_POWER: { return (CHILD(0).isZero() && CHILD(1).representsPositive(false)) || representsNegative(allow_units); } default: {return false;} } } bool MathStructure::representsRational(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isRational();} case STRUCT_VARIABLE: {return o_variable->representsRational(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isRational();} case STRUCT_FUNCTION: {return (function_value && function_value->representsRational(allow_units)) || o_function->representsRational(*this, allow_units);} case STRUCT_UNIT: {return false;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsRational(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsRational(allow_units)) { return false; } } return true; } case STRUCT_POWER: { return CHILD(1).representsInteger(false) && CHILD(0).representsRational(allow_units) && (CHILD(0).representsPositive(allow_units) || (CHILD(0).representsNegative(allow_units) && CHILD(1).representsEven(false) && CHILD(1).representsPositive(false))); } default: {return false;} } } bool MathStructure::representsReal(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isReal();} case STRUCT_VARIABLE: {return o_variable->representsReal(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isReal();} case STRUCT_FUNCTION: {return (function_value && function_value->representsReal(allow_units)) || o_function->representsReal(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_DATETIME: {return allow_units;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsReal(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsReal(allow_units)) { return false; } } return true; } case STRUCT_POWER: { return (CHILD(0).representsPositive(allow_units) && CHILD(1).representsReal(false)) || (CHILD(0).representsReal(allow_units) && CHILD(1).representsInteger(false) && (CHILD(1).representsPositive(false) || CHILD(0).representsNonZero(allow_units))); } default: {return false;} } } bool MathStructure::representsNonComplex(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return !o_number.hasImaginaryPart();} case STRUCT_VARIABLE: { if(o_variable->isKnown()) return ((KnownVariable*) o_variable)->get().representsNonComplex(allow_units); return o_variable->representsNonComplex(allow_units); } case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isReal();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonComplex(allow_units)) || o_function->representsNonComplex(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_DATETIME: {return allow_units;} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonComplex(allow_units)) return false; } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonComplex(allow_units)) { return false; } } return true; } case STRUCT_POWER: { return (CHILD(0).representsPositive(allow_units) && CHILD(1).representsReal(false)) || (CHILD(0).representsReal(allow_units) && CHILD(1).representsInteger(false)); } default: {return false;} } } bool MathStructure::representsComplex(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.imaginaryPartIsNonZero();} case STRUCT_VARIABLE: {return o_variable->representsComplex(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isComplex();} case STRUCT_FUNCTION: {return (function_value && function_value->representsComplex(allow_units)) || o_function->representsComplex(*this, allow_units);} case STRUCT_ADDITION: { bool c = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsComplex(allow_units)) { if(c) return false; c = true; } else if(!CHILD(i).representsReal(allow_units)) { return false; } } return c; } case STRUCT_MULTIPLICATION: { bool c = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsComplex(allow_units)) { if(c) return false; c = true; } else if(!CHILD(i).representsReal(allow_units) || !CHILD(i).representsNonZero(allow_units)) { return false; } } return c; } case STRUCT_UNIT: {return false;} case STRUCT_POWER: {return CHILD(1).isNumber() && CHILD(1).number().isRational() && !CHILD(1).number().isInteger() && CHILD(0).representsNegative();} default: {return false;} } } bool MathStructure::representsNonZero(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isNonZero();} case STRUCT_VARIABLE: {return o_variable->representsNonZero(allow_units);} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNonZero();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonZero(allow_units)) || o_function->representsNonZero(*this, allow_units);} case STRUCT_UNIT: {return allow_units;} case STRUCT_DATETIME: {return allow_units;} case STRUCT_ADDITION: { bool neg = false, started = false; for(size_t i = 0; i < SIZE; i++) { if((!started || neg) && CHILD(i).representsNegative(allow_units)) { neg = true; } else if(neg || !CHILD(i).representsPositive(allow_units)) { return false; } started = true; } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonZero(allow_units)) { return false; } } return true; } case STRUCT_POWER: { return CHILD(0).representsNonZero(allow_units) || (!CHILD(0).isApproximatelyZero() && CHILD(1).representsNonPositive()); } default: {return false;} } } bool MathStructure::representsZero(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isZero();} case STRUCT_VARIABLE: {return o_variable->isKnown() && !o_variable->representsNonZero(allow_units) && ((KnownVariable*) o_variable)->get().representsZero();} case STRUCT_FUNCTION: {return (function_value && function_value->representsZero(allow_units));} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsZero(allow_units)) { return false; } } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsZero(allow_units)) { return true; } } return false; } case STRUCT_POWER: { return CHILD(0).representsZero(allow_units) && CHILD(1).representsPositive(allow_units); } default: {return false;} } } bool MathStructure::representsApproximatelyZero(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return !o_number.isNonZero();} case STRUCT_VARIABLE: {return o_variable->isKnown() && !o_variable->representsNonZero(allow_units) && ((KnownVariable*) o_variable)->get().representsApproximatelyZero();} case STRUCT_FUNCTION: {return (function_value && function_value->representsApproximatelyZero(allow_units));} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsApproximatelyZero(allow_units)) { return false; } } return true; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsApproximatelyZero(allow_units)) { return true; } } return false; } case STRUCT_POWER: { return CHILD(0).representsApproximatelyZero(allow_units) && CHILD(1).representsPositive(allow_units); } default: {return false;} } } bool MathStructure::representsEven(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isEven();} case STRUCT_VARIABLE: {return o_variable->representsEven(allow_units);} case STRUCT_FUNCTION: {return (function_value && function_value->representsEven(allow_units)) || o_function->representsEven(*this, allow_units);} default: {return false;} } } bool MathStructure::representsOdd(bool allow_units) const { switch(m_type) { case STRUCT_NUMBER: {return o_number.isOdd();} case STRUCT_VARIABLE: {return o_variable->representsOdd(allow_units);} case STRUCT_FUNCTION: {return (function_value && function_value->representsOdd(allow_units)) || o_function->representsOdd(*this, allow_units);} default: {return false;} } } bool MathStructure::representsUndefined(bool include_childs, bool include_infinite, bool be_strict) const { switch(m_type) { case STRUCT_NUMBER: { if(include_infinite) { return o_number.includesInfinity(); } return false; } case STRUCT_UNDEFINED: {return true;} case STRUCT_VARIABLE: {return o_variable->representsUndefined(include_childs, include_infinite, be_strict);} case STRUCT_FUNCTION: {return (function_value && function_value->representsUndefined(include_childs, include_infinite, be_strict)) || o_function->representsUndefined(*this);} case STRUCT_POWER: { if(be_strict) { if((!CHILD(0).representsNonZero(true) && !CHILD(1).representsNonNegative(false)) || (CHILD(0).isInfinity() && !CHILD(1).representsNonZero(true))) { return true; } } else { if((CHILD(0).representsZero(true) && CHILD(1).representsNegative(false)) || (CHILD(0).isInfinity() && CHILD(1).representsZero(true))) { return true; } } } default: { if(include_childs) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).representsUndefined(include_childs, include_infinite, be_strict)) return true; } } return false; } } } bool MathStructure::representsNonMatrix() const { switch(m_type) { case STRUCT_VECTOR: {return !isMatrix();} case STRUCT_POWER: {return CHILD(0).representsNonMatrix();} case STRUCT_VARIABLE: {return o_variable->representsNonMatrix();} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNonMatrix();} case STRUCT_FUNCTION: {return (function_value && function_value->representsNonMatrix()) || o_function->representsNonMatrix(*this);} case STRUCT_INVERSE: {} case STRUCT_NEGATE: {} case STRUCT_DIVISION: {} case STRUCT_MULTIPLICATION: {} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsNonMatrix()) { return false; } } return true; } case STRUCT_ABORTED: { return false; } default: {} } return true; } bool MathStructure::representsScalar() const { switch(m_type) { case STRUCT_VECTOR: {return false;} case STRUCT_POWER: {return CHILD(0).representsScalar();} case STRUCT_VARIABLE: {return o_variable->representsScalar();} case STRUCT_SYMBOLIC: {return CALCULATOR->defaultAssumptions()->isNonMatrix();} case STRUCT_FUNCTION: {return (function_value && function_value->representsScalar()) || o_function->representsScalar(*this);} case STRUCT_INVERSE: {} case STRUCT_NEGATE: {} case STRUCT_DIVISION: {} case STRUCT_MULTIPLICATION: {} case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).representsScalar()) { return false; } } return true; } case STRUCT_ABORTED: { return false; } default: {} } return true; } void MathStructure::setApproximate(bool is_approx, bool recursive) { b_approx = is_approx; if(!b_approx) { i_precision = -1; } if(recursive) { if(m_type == STRUCT_NUMBER) { o_number.setApproximate(is_approx); if(i_precision < 0 || i_precision > o_number.precision()) i_precision = o_number.precision(); } for(size_t i = 0; i < SIZE; i++) { CHILD(i).setApproximate(is_approx, true); } } } bool MathStructure::isApproximate() const { return b_approx; } int MathStructure::precision() const { return i_precision; } void MathStructure::setPrecision(int prec, bool recursive) { i_precision = prec; if(i_precision > 0) b_approx = true; if(recursive) { if(m_type == STRUCT_NUMBER) { o_number.setPrecision(prec); } for(size_t i = 0; i < SIZE; i++) { CHILD(i).setPrecision(prec, true); } } } void MathStructure::transform(StructureType mtype, const MathStructure &o) { MathStructure *struct_o = new MathStructure(o); MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_POINTER(struct_o); b_parentheses = false; } void MathStructure::transform(StructureType mtype, const Number &o) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_NEW(o); b_parentheses = false; } void MathStructure::transform(StructureType mtype, int i) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_POINTER(new MathStructure(i, 1, 0)); b_parentheses = false; } void MathStructure::transform(StructureType mtype, Unit *u) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_NEW(u); b_parentheses = false; } void MathStructure::transform(StructureType mtype, Variable *v) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_NEW(v); b_parentheses = false; } void MathStructure::transform(StructureType mtype, string sym) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_NEW(sym); b_parentheses = false; } void MathStructure::transform_nocopy(StructureType mtype, MathStructure *o) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); APPEND_POINTER(o); b_parentheses = false; } void MathStructure::transform(StructureType mtype) { MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = mtype; APPEND_POINTER(struct_this); b_parentheses = false; } void MathStructure::transform(MathFunction *o) { transform(STRUCT_FUNCTION); setFunction(o); b_parentheses = false; } void MathStructure::transform(ComparisonType ctype, const MathStructure &o) { MathStructure *struct_o = new MathStructure(o); MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = STRUCT_COMPARISON; ct_comp = ctype; APPEND_POINTER(struct_this); APPEND_POINTER(struct_o); b_parentheses = false; } void transform(ComparisonType ctype, const MathStructure &o); void MathStructure::add(const MathStructure &o, MathOperation op, bool append) { switch(op) { case OPERATION_ADD: { add(o, append); break; } case OPERATION_SUBTRACT: { subtract(o, append); break; } case OPERATION_MULTIPLY: { multiply(o, append); break; } case OPERATION_DIVIDE: { divide(o, append); break; } case OPERATION_RAISE: { raise(o); break; } case OPERATION_EXP10: { MathStructure *mstruct = new MathStructure(10, 1, 0); mstruct->raise(o); multiply_nocopy(mstruct, append); break; } case OPERATION_LOGICAL_AND: { if(m_type == STRUCT_LOGICAL_AND && append) { APPEND(o); } else { transform(STRUCT_LOGICAL_AND, o); } break; } case OPERATION_LOGICAL_OR: { if(m_type == STRUCT_LOGICAL_OR && append) { APPEND(o); } else { transform(STRUCT_LOGICAL_OR, o); } break; } case OPERATION_LOGICAL_XOR: { transform(STRUCT_LOGICAL_XOR, o); break; } case OPERATION_BITWISE_AND: { if(m_type == STRUCT_BITWISE_AND && append) { APPEND(o); } else { transform(STRUCT_BITWISE_AND, o); } break; } case OPERATION_BITWISE_OR: { if(m_type == STRUCT_BITWISE_OR && append) { APPEND(o); } else { transform(STRUCT_BITWISE_OR, o); } break; } case OPERATION_BITWISE_XOR: { transform(STRUCT_BITWISE_XOR, o); break; } case OPERATION_EQUALS: {} case OPERATION_NOT_EQUALS: {} case OPERATION_GREATER: {} case OPERATION_LESS: {} case OPERATION_EQUALS_GREATER: {} case OPERATION_EQUALS_LESS: { if(append && m_type == STRUCT_COMPARISON && append) { MathStructure *o2 = new MathStructure(CHILD(1)); o2->add(o, op); transform_nocopy(STRUCT_LOGICAL_AND, o2); } else if(append && m_type == STRUCT_LOGICAL_AND && LAST.type() == STRUCT_COMPARISON) { MathStructure *o2 = new MathStructure(LAST[1]); o2->add(o, op); APPEND_POINTER(o2); } else { transform(STRUCT_COMPARISON, o); switch(op) { case OPERATION_EQUALS: {ct_comp = COMPARISON_EQUALS; break;} case OPERATION_NOT_EQUALS: {ct_comp = COMPARISON_NOT_EQUALS; break;} case OPERATION_GREATER: {ct_comp = COMPARISON_GREATER; break;} case OPERATION_LESS: {ct_comp = COMPARISON_LESS; break;} case OPERATION_EQUALS_GREATER: {ct_comp = COMPARISON_EQUALS_GREATER; break;} case OPERATION_EQUALS_LESS: {ct_comp = COMPARISON_EQUALS_LESS; break;} default: {} } } break; } default: { } } } void MathStructure::add(const MathStructure &o, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND(o); } else { transform(STRUCT_ADDITION, o); } } void MathStructure::subtract(const MathStructure &o, bool append) { MathStructure *o2 = new MathStructure(o); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(const MathStructure &o, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND(o); } else { transform(STRUCT_MULTIPLICATION, o); } } void MathStructure::divide(const MathStructure &o, bool append) { // transform(STRUCT_DIVISION, o); MathStructure *o2 = new MathStructure(o); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(const MathStructure &o) { transform(STRUCT_POWER, o); } void MathStructure::add(const Number &o, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_NEW(o); } else { transform(STRUCT_ADDITION, o); } } void MathStructure::subtract(const Number &o, bool append) { MathStructure *o2 = new MathStructure(o); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(const Number &o, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_NEW(o); } else { transform(STRUCT_MULTIPLICATION, o); } } void MathStructure::divide(const Number &o, bool append) { MathStructure *o2 = new MathStructure(o); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(const Number &o) { transform(STRUCT_POWER, o); } void MathStructure::add(int i, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_POINTER(new MathStructure(i, 1, 0)); } else { transform(STRUCT_ADDITION, i); } } void MathStructure::subtract(int i, bool append) { MathStructure *o2 = new MathStructure(i, 1, 0); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(int i, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_POINTER(new MathStructure(i, 1, 0)); } else { transform(STRUCT_MULTIPLICATION, i); } } void MathStructure::divide(int i, bool append) { MathStructure *o2 = new MathStructure(i, 1, 0); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(int i) { transform(STRUCT_POWER, i); } void MathStructure::add(Variable *v, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_NEW(v); } else { transform(STRUCT_ADDITION, v); } } void MathStructure::subtract(Variable *v, bool append) { MathStructure *o2 = new MathStructure(v); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(Variable *v, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_NEW(v); } else { transform(STRUCT_MULTIPLICATION, v); } } void MathStructure::divide(Variable *v, bool append) { MathStructure *o2 = new MathStructure(v); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(Variable *v) { transform(STRUCT_POWER, v); } void MathStructure::add(Unit *u, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_NEW(u); } else { transform(STRUCT_ADDITION, u); } } void MathStructure::subtract(Unit *u, bool append) { MathStructure *o2 = new MathStructure(u); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(Unit *u, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_NEW(u); } else { transform(STRUCT_MULTIPLICATION, u); } } void MathStructure::divide(Unit *u, bool append) { MathStructure *o2 = new MathStructure(u); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(Unit *u) { transform(STRUCT_POWER, u); } void MathStructure::add(string sym, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_NEW(sym); } else { transform(STRUCT_ADDITION, sym); } } void MathStructure::subtract(string sym, bool append) { MathStructure *o2 = new MathStructure(sym); o2->negate(); add_nocopy(o2, append); } void MathStructure::multiply(string sym, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_NEW(sym); } else { transform(STRUCT_MULTIPLICATION, sym); } } void MathStructure::divide(string sym, bool append) { MathStructure *o2 = new MathStructure(sym); o2->inverse(); multiply_nocopy(o2, append); } void MathStructure::raise(string sym) { transform(STRUCT_POWER, sym); } void MathStructure::add_nocopy(MathStructure *o, MathOperation op, bool append) { switch(op) { case OPERATION_ADD: { add_nocopy(o, append); break; } case OPERATION_SUBTRACT: { subtract_nocopy(o, append); break; } case OPERATION_MULTIPLY: { multiply_nocopy(o, append); break; } case OPERATION_DIVIDE: { divide_nocopy(o, append); break; } case OPERATION_RAISE: { raise_nocopy(o); break; } case OPERATION_EXP10: { MathStructure *mstruct = new MathStructure(10, 1, 0); mstruct->raise_nocopy(o); multiply_nocopy(mstruct, append); break; } case OPERATION_LOGICAL_AND: { if(m_type == STRUCT_LOGICAL_AND && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_LOGICAL_AND, o); } break; } case OPERATION_LOGICAL_OR: { if(m_type == STRUCT_LOGICAL_OR && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_LOGICAL_OR, o); } break; } case OPERATION_LOGICAL_XOR: { transform_nocopy(STRUCT_LOGICAL_XOR, o); break; } case OPERATION_BITWISE_AND: { if(m_type == STRUCT_BITWISE_AND && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_BITWISE_AND, o); } break; } case OPERATION_BITWISE_OR: { if(m_type == STRUCT_BITWISE_OR && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_BITWISE_OR, o); } break; } case OPERATION_BITWISE_XOR: { transform_nocopy(STRUCT_BITWISE_XOR, o); break; } case OPERATION_EQUALS: {} case OPERATION_NOT_EQUALS: {} case OPERATION_GREATER: {} case OPERATION_LESS: {} case OPERATION_EQUALS_GREATER: {} case OPERATION_EQUALS_LESS: { if(append && m_type == STRUCT_COMPARISON && append) { MathStructure *o2 = new MathStructure(CHILD(1)); o2->add_nocopy(o, op); transform_nocopy(STRUCT_LOGICAL_AND, o2); } else if(append && m_type == STRUCT_LOGICAL_AND && LAST.type() == STRUCT_COMPARISON) { MathStructure *o2 = new MathStructure(LAST[1]); o2->add_nocopy(o, op); APPEND_POINTER(o2); } else { transform_nocopy(STRUCT_COMPARISON, o); switch(op) { case OPERATION_EQUALS: {ct_comp = COMPARISON_EQUALS; break;} case OPERATION_NOT_EQUALS: {ct_comp = COMPARISON_NOT_EQUALS; break;} case OPERATION_GREATER: {ct_comp = COMPARISON_GREATER; break;} case OPERATION_LESS: {ct_comp = COMPARISON_LESS; break;} case OPERATION_EQUALS_GREATER: {ct_comp = COMPARISON_EQUALS_GREATER; break;} case OPERATION_EQUALS_LESS: {ct_comp = COMPARISON_EQUALS_LESS; break;} default: {} } } break; } default: { } } } void MathStructure::add_nocopy(MathStructure *o, bool append) { if(m_type == STRUCT_ADDITION && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_ADDITION, o); } } void MathStructure::subtract_nocopy(MathStructure *o, bool append) { o->negate(); add_nocopy(o, append); } void MathStructure::multiply_nocopy(MathStructure *o, bool append) { if(m_type == STRUCT_MULTIPLICATION && append) { APPEND_POINTER(o); } else { transform_nocopy(STRUCT_MULTIPLICATION, o); } } void MathStructure::divide_nocopy(MathStructure *o, bool append) { o->inverse(); multiply_nocopy(o, append); } void MathStructure::raise_nocopy(MathStructure *o) { transform_nocopy(STRUCT_POWER, o); } void MathStructure::negate() { //transform(STRUCT_NEGATE); MathStructure *struct_this = new MathStructure(); struct_this->set_nocopy(*this); clear(true); m_type = STRUCT_MULTIPLICATION; APPEND(m_minus_one); APPEND_POINTER(struct_this); } void MathStructure::inverse() { //transform(STRUCT_INVERSE); raise(m_minus_one); } void MathStructure::setLogicalNot() { transform(STRUCT_LOGICAL_NOT); } void MathStructure::setBitwiseNot() { transform(STRUCT_BITWISE_NOT); } bool MathStructure::equals(const MathStructure &o, bool allow_interval, bool allow_infinite) const { if(m_type != o.type()) return false; if(SIZE != o.size()) return false; switch(m_type) { case STRUCT_UNDEFINED: {return true;} case STRUCT_SYMBOLIC: {return s_sym == o.symbol();} case STRUCT_DATETIME: {return *o_datetime == *o.datetime();} case STRUCT_NUMBER: {return o_number.equals(o.number(), allow_interval, allow_infinite);} case STRUCT_VARIABLE: {return o_variable == o.variable();} case STRUCT_UNIT: { Prefix *p1 = (o_prefix == NULL || o_prefix == CALCULATOR->decimal_null_prefix || o_prefix == CALCULATOR->binary_null_prefix) ? NULL : o_prefix; Prefix *p2 = (o.prefix() == NULL || o.prefix() == CALCULATOR->decimal_null_prefix || o.prefix() == CALCULATOR->binary_null_prefix) ? NULL : o.prefix(); return o_unit == o.unit() && p1 == p2; } case STRUCT_COMPARISON: {if(ct_comp != o.comparisonType()) return false; break;} case STRUCT_FUNCTION: {if(o_function != o.function()) return false; break;} case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_XOR: {} case STRUCT_LOGICAL_AND: { if(SIZE < 1) return false; if(SIZE == 2) { return (CHILD(0) == o[0] && CHILD(1) == o[1]) || (CHILD(0) == o[1] && CHILD(1) == o[0]); } vector i2taken; for(size_t i = 0; i < SIZE; i++) { bool b = false, b2 = false; for(size_t i2 = 0; i2 < o.size(); i2++) { if(CHILD(i).equals(o[i2], allow_interval)) { b2 = true; for(size_t i3 = 0; i3 < i2taken.size(); i3++) { if(i2taken[i3] == i2) { b2 = false; } } if(b2) { b = true; i2taken.push_back(i2); break; } } } if(!b) return false; } return true; } default: {} } if(SIZE < 1) return false; for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).equals(o[i], allow_interval)) return false; } return true; } bool MathStructure::equals(const Number &o, bool allow_interval, bool allow_infinite) const { if(m_type != STRUCT_NUMBER) return false; return o_number.equals(o, allow_interval, allow_infinite); } bool MathStructure::equals(int i) const { if(m_type != STRUCT_NUMBER) return false; return o_number.equals(Number(i, 1, 0)); } bool MathStructure::equals(Unit *u) const { if(m_type != STRUCT_UNIT) return false; return o_unit == u; } bool MathStructure::equals(Variable *v) const { if(m_type != STRUCT_VARIABLE) return false; return o_variable == v; } bool MathStructure::equals(string sym) const { if(m_type != STRUCT_SYMBOLIC) return false; return s_sym == sym; } int compare_check_incompability(MathStructure *mtest) { int incomp = 0; int unit_term_count = 0; int not_unit_term_count = 0; int compat_count = 0; bool b_not_number = false; for(size_t i = 0; i < mtest->size(); i++) { if((*mtest)[i].containsType(STRUCT_UNIT, false, true, true) > 0) { unit_term_count++; for(size_t i2 = i + 1; i2 < mtest->size(); i2++) { int b_test = (*mtest)[i].isUnitCompatible((*mtest)[i2]); if(b_test == 0) { incomp = 1; } else if(b_test > 0) { compat_count++; } } if(!b_not_number && !(*mtest)[i].representsNumber(true)) { b_not_number = true; } } else if((*mtest)[i].containsRepresentativeOfType(STRUCT_UNIT, true, true) == 0) { not_unit_term_count++; } else if(!b_not_number && !(*mtest)[i].representsNumber(true)) { b_not_number = true; } } if(b_not_number && unit_term_count > 0) { incomp = -1; } else if(unit_term_count > 0) { if((long int) mtest->size() - (unit_term_count + not_unit_term_count) >= unit_term_count - compat_count + (not_unit_term_count > 0)) { incomp = -1; } else if(not_unit_term_count > 0) { incomp = 1; } } return incomp; } bool MathStructure::mergeInterval(const MathStructure &o, bool set_to_overlap) { if(isNumber() && o.isNumber()) { return o_number.mergeInterval(o.number(), set_to_overlap); } if(equals(o)) return true; if(isMultiplication() && SIZE > 1 && CHILD(0).isNumber()) { if(o.isMultiplication() && o.size() > 1) { if(SIZE == o.size() + (o[0].isNumber() ? 0 : 1)) { bool b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).equals(o[0].isNumber() ? o[i] : o[i - 1]) || !CHILD(i).representsNonNegative(true)) { b = false; break; } } if(b && o[0].isNumber()) { if(!CHILD(0).number().mergeInterval(o[0].number(), set_to_overlap)) return false; } else if(b) { if(!CHILD(0).number().mergeInterval(nr_one, set_to_overlap)) return false; } CHILD(0).numberUpdated(); CHILD_UPDATED(0); return true; } } else if(SIZE == 2 && o.equals(CHILD(1)) && o.representsNonNegative(true)) { if(!CHILD(0).number().mergeInterval(nr_one, set_to_overlap)) return false; CHILD(0).numberUpdated(); CHILD_UPDATED(0); return true; } } else if(o.isMultiplication() && o.size() == 2 && o[0].isNumber() && equals(o[1]) && representsNonNegative(true)) { Number nr(1, 1); if(!nr.mergeInterval(o[0].number(), set_to_overlap)) return false; transform(STRUCT_MULTIPLICATION); PREPEND(nr); return true; } return false; } ComparisonResult MathStructure::compare(const MathStructure &o) const { if(isNumber() && o.isNumber()) { return o_number.compare(o.number()); } if(isDateTime() && o.isDateTime()) { if(*o_datetime == *o.datetime()) return COMPARISON_RESULT_EQUAL; if(*o_datetime > *o.datetime()) return COMPARISON_RESULT_LESS; return COMPARISON_RESULT_GREATER; } if(equals(o)) return COMPARISON_RESULT_EQUAL; if(isMultiplication() && SIZE > 1 && CHILD(0).isNumber()) { if(o.isZero()) { bool b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).representsNonZero(true)) { b = false; break; } } if(b) return CHILD(0).number().compare(o.number()); } else if(o.isMultiplication() && o.size() > 1) { if(SIZE == o.size() + (o[0].isNumber() ? 0 : 1)) { bool b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).equals(o[0].isNumber() ? o[i] : o[i - 1]) || !CHILD(i).representsNonNegative(true)) { b = false; break; } } if(b && o[0].isNumber()) return CHILD(0).number().compare(o[0].number()); else if(b) return CHILD(0).number().compare(nr_one); } } else if(SIZE == 2 && o.equals(CHILD(1)) && o.representsNonNegative(true)) { return CHILD(0).number().compare(nr_one); } } else if(o.isMultiplication() && o.size() == 2 && o[0].isNumber() && equals(o[1]) && representsNonNegative(true)) { return nr_one.compare(o[0].number()); } if(o.representsReal(true) && representsComplex(true)) return COMPARISON_RESULT_NOT_EQUAL; if(representsReal(true) && o.representsComplex(true)) return COMPARISON_RESULT_NOT_EQUAL; CALCULATOR->beginTemporaryEnableIntervalArithmetic(); CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(*this); EvaluationOptions eo = default_evaluation_options; eo.approximation = APPROXIMATION_APPROXIMATE; mtest -= o; mtest.calculateFunctions(eo); mtest.calculatesub(eo, eo); CALCULATOR->endTemporaryStopMessages(); CALCULATOR->endTemporaryEnableIntervalArithmetic(); int incomp = 0; if(mtest.isAddition()) { incomp = compare_check_incompability(&mtest); } if(incomp > 0) return COMPARISON_RESULT_NOT_EQUAL; if(incomp == 0) { if(mtest.representsZero(true)) return COMPARISON_RESULT_EQUAL; if(mtest.representsPositive(true)) return COMPARISON_RESULT_LESS; if(mtest.representsNegative(true)) return COMPARISON_RESULT_GREATER; if(mtest.representsNonZero(true)) return COMPARISON_RESULT_NOT_EQUAL; if(mtest.representsNonPositive(true)) return COMPARISON_RESULT_EQUAL_OR_LESS; if(mtest.representsNonNegative(true)) return COMPARISON_RESULT_EQUAL_OR_GREATER; } else { bool a_pos = representsPositive(true); bool a_nneg = a_pos || representsNonNegative(true); bool a_neg = !a_nneg && representsNegative(true); bool a_npos = !a_pos && (a_neg || representsNonPositive(true)); bool b_pos = o.representsPositive(true); bool b_nneg = b_pos || o.representsNonNegative(true); bool b_neg = !b_nneg && o.representsNegative(true); bool b_npos = !b_pos && (b_neg || o.representsNonPositive(true)); if(a_pos && b_npos) return COMPARISON_RESULT_NOT_EQUAL; if(a_npos && b_pos) return COMPARISON_RESULT_NOT_EQUAL; if(a_nneg && b_neg) return COMPARISON_RESULT_NOT_EQUAL; if(a_neg && b_nneg) return COMPARISON_RESULT_NOT_EQUAL; } return COMPARISON_RESULT_UNKNOWN; } ComparisonResult MathStructure::compareApproximately(const MathStructure &o, const EvaluationOptions &eo2) const { if(isNumber() && o.isNumber()) { return o_number.compareApproximately(o.number()); } if(isDateTime() && o.isDateTime()) { if(*o_datetime == *o.datetime()) return COMPARISON_RESULT_EQUAL; if(*o_datetime < *o.datetime()) return COMPARISON_RESULT_LESS; return COMPARISON_RESULT_GREATER; } if(equals(o)) return COMPARISON_RESULT_EQUAL; if(isMultiplication() && SIZE > 1 && CHILD(0).isNumber()) { if(o.isZero()) { bool b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).representsNonZero(true)) { b = false; break; } } if(b) return CHILD(0).number().compareApproximately(o.number()); } else if(o.isMultiplication() && o.size() > 1) { if(SIZE == o.size() + (o[0].isNumber() ? 0 : 1)) { bool b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).equals(o[0].isNumber() ? o[i] : o[i - 1]) || !CHILD(i).representsNonNegative(true)) { b = false; break; } } if(b && o[0].isNumber()) return CHILD(0).number().compareApproximately(o[0].number()); else if(b) return CHILD(0).number().compareApproximately(nr_one); } } else if(SIZE == 2 && o.equals(CHILD(1)) && o.representsNonNegative(true)) { return CHILD(0).number().compareApproximately(nr_one); } } else if(o.isMultiplication() && o.size() == 2 && o[0].isNumber() && equals(o[1]) && representsNonNegative(true)) { return nr_one.compareApproximately(o[0].number()); } if(o.representsZero(true) && representsZero(true)) return COMPARISON_RESULT_EQUAL; if(o.representsReal(true) && representsComplex(true)) return COMPARISON_RESULT_NOT_EQUAL; if(representsReal(true) && o.representsComplex(true)) return COMPARISON_RESULT_NOT_EQUAL; CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(*this), mtest2(o); EvaluationOptions eo = eo2; eo.expand = true; eo.approximation = APPROXIMATION_APPROXIMATE; mtest.calculateFunctions(eo); mtest2.calculateFunctions(eo); mtest.calculatesub(eo, eo); mtest2.calculatesub(eo, eo); CALCULATOR->endTemporaryStopMessages(); if(mtest.equals(mtest2)) return COMPARISON_RESULT_EQUAL; if(mtest.representsZero(true) && mtest2.representsZero(true)) return COMPARISON_RESULT_EQUAL; if(mtest.isNumber() && mtest2.isNumber()) { if(mtest2.isApproximate() && o.isAddition() && o.size() > 1 && mtest.isZero() && !mtest2.isZero()) { CALCULATOR->beginTemporaryStopMessages(); mtest = *this; mtest.subtract(o[0]); mtest2 = o; mtest2.delChild(1, true); mtest.calculateFunctions(eo); mtest2.calculateFunctions(eo); mtest.calculatesub(eo, eo); mtest2.calculatesub(eo, eo); CALCULATOR->endTemporaryStopMessages(); if(mtest.isNumber() && mtest2.isNumber()) return mtest.number().compareApproximately(mtest2.number()); } else if(mtest.isApproximate() && isAddition() && SIZE > 1 && mtest2.isZero() && !mtest.isZero()) { CALCULATOR->beginTemporaryStopMessages(); mtest2 = o; mtest2.subtract(CHILD(0)); mtest = *this; mtest.delChild(1, true); mtest.calculateFunctions(eo); mtest2.calculateFunctions(eo); mtest.calculatesub(eo, eo); mtest2.calculatesub(eo, eo); CALCULATOR->endTemporaryStopMessages(); if(mtest.isNumber() && mtest2.isNumber()) return mtest.number().compareApproximately(mtest2.number()); } else { return mtest.number().compareApproximately(o.number()); } } if(mtest2.isZero() && mtest.isMultiplication() && mtest.size() > 0 && mtest[0].isNumber()) { bool b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).representsNonZero(true)) { b = false; break; } } if(b) return CHILD(0).number().compareApproximately(o.number()); } CALCULATOR->beginTemporaryStopMessages(); mtest -= o; mtest.last().last().calculateFunctions(eo); mtest.calculatesub(eo, eo); CALCULATOR->endTemporaryStopMessages(); if(mtest.representsZero(true)) return COMPARISON_RESULT_EQUAL; int incomp = 0; if(mtest.isAddition()) { incomp = compare_check_incompability(&mtest); } if(incomp > 0) return COMPARISON_RESULT_NOT_EQUAL; if(incomp == 0) { if(mtest.isZero()) return COMPARISON_RESULT_EQUAL; if(mtest.representsPositive(true)) return COMPARISON_RESULT_LESS; if(mtest.representsNegative(true)) return COMPARISON_RESULT_GREATER; if(mtest.representsNonZero(true)) return COMPARISON_RESULT_NOT_EQUAL; if(mtest.representsNonPositive(true)) return COMPARISON_RESULT_EQUAL_OR_LESS; if(mtest.representsNonNegative(true)) return COMPARISON_RESULT_EQUAL_OR_GREATER; } else { bool a_pos = representsPositive(true); bool a_nneg = a_pos || representsNonNegative(true); bool a_neg = !a_nneg && representsNegative(true); bool a_npos = !a_pos && (a_neg || representsNonPositive(true)); bool b_pos = o.representsPositive(true); bool b_nneg = b_pos || o.representsNonNegative(true); bool b_neg = !b_nneg && o.representsNegative(true); bool b_npos = !b_pos && (b_neg || o.representsNonPositive(true)); if(a_pos && b_npos) return COMPARISON_RESULT_NOT_EQUAL; if(a_npos && b_pos) return COMPARISON_RESULT_NOT_EQUAL; if(a_nneg && b_neg) return COMPARISON_RESULT_NOT_EQUAL; if(a_neg && b_nneg) return COMPARISON_RESULT_NOT_EQUAL; } return COMPARISON_RESULT_UNKNOWN; } int MathStructure::merge_addition(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool reversed) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.add(mstruct.number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } if(isZero()) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } if(mstruct.isZero()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(m_type == STRUCT_NUMBER && o_number.isInfinite()) { if(mstruct.representsReal(false)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } else if(mstruct.isNumber() && mstruct.number().isInfinite()) { if(representsReal(false)) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { clear(true); o_number = mstruct.number(); MERGE_APPROX_AND_PREC(mstruct) } return 3; } } if(representsUndefined() || mstruct.representsUndefined()) return -1; switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_ADDITION: {return 0;} case STRUCT_VECTOR: { if(SIZE == mstruct.size()) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateAdd(mstruct[i], eo, this, i); } MERGE_APPROX_AND_PREC(mstruct) return 1; } } default: { return -1; } } return -1; } case STRUCT_ADDITION: { switch(mstruct.type()) { case STRUCT_ADDITION: { for(size_t i = 0; i < mstruct.size(); i++) { if(reversed) { INSERT_REF(&mstruct[i], i) calculateAddIndex(i, eo, false); } else { APPEND_REF(&mstruct[i]); calculateAddLast(eo, false); } } MERGE_APPROX_AND_PREC(mstruct) if(SIZE == 1) { setToChild(1, false, mparent, index_this + 1); } else if(SIZE == 0) { clear(true); } else { evalSort(); } return 1; } default: { MERGE_APPROX_AND_PREC(mstruct) if(reversed) { PREPEND_REF(&mstruct); calculateAddIndex(0, eo, true, mparent, index_this); } else { APPEND_REF(&mstruct); calculateAddLast(eo, true, mparent, index_this); } return 1; } } break; } case STRUCT_MULTIPLICATION: { switch(mstruct.type()) { case STRUCT_VECTOR: {return -1;} case STRUCT_ADDITION: { return 0; } case STRUCT_MULTIPLICATION: { size_t i1 = 0, i2 = 0; bool b = true; if(CHILD(0).isNumber()) i1 = 1; if(mstruct[0].isNumber()) i2 = 1; if(SIZE - i1 == mstruct.size() - i2) { for(size_t i = i1; i < SIZE; i++) { if(CHILD(i) != mstruct[i + i2 - i1]) { b = false; break; } } if(b) { if(i1 == 0) { PREPEND(m_one); } if(i2 == 0) { CHILD(0).number()++; } else { CHILD(0).number() += mstruct[0].number(); } MERGE_APPROX_AND_PREC(mstruct) calculateMultiplyIndex(0, eo, true, mparent, index_this); return 1; } } for(size_t i2 = 0; i2 < SIZE; i2++) { if(eo.transform_trigonometric_functions && CHILD(i2).isPower() && CHILD(i2)[0].isFunction() && (CHILD(i2)[0].function() == CALCULATOR->f_cos || CHILD(i2)[0].function() == CALCULATOR->f_sin) && CHILD(i2)[0].size() == 1 && CHILD(i2)[1].isNumber() && CHILD(i2)[1].number().isTwo() && mstruct.size() > 0) { if(eo.protected_function != (CHILD(i2)[0].function() == CALCULATOR->f_sin ? CALCULATOR->f_cos : CALCULATOR->f_sin)) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][0].isFunction() && mstruct[i][0].function() == (CHILD(i2)[0].function() == CALCULATOR->f_sin ? CALCULATOR->f_cos : CALCULATOR->f_sin) && mstruct[i][0].size() == 1 && mstruct[i][1].isNumber() && mstruct[i][1].number().isTwo() && CHILD(i2)[0][0] == mstruct[i][0][0]) { MathStructure madd1(*this); MathStructure madd2(mstruct); MathStructure madd; madd1.delChild(i2 + 1, true); madd2.delChild(i + 1, true); if(CHILD(i2)[0].function() == CALCULATOR->f_sin) {madd = madd2; madd2.calculateNegate(eo);} else {madd = madd1; madd1.calculateNegate(eo);} if(madd1.calculateAdd(madd2, eo)) { SET_CHILD_MAP(i2); CHILD(0).setFunction(CALCULATOR->f_sin); calculateMultiply(madd1, eo); EvaluationOptions eo2 = eo; eo2.transform_trigonometric_functions = false; calculateAdd(madd, eo2); return 1; } } } } if(eo.protected_function != CHILD(i2)[0].function()) { bool b = false; if(mstruct[0].isNumber()) { if(CHILD(0).isNumber()) { if(mstruct.size() == SIZE - 1 && CHILD(0).number() == -mstruct[0].number()) { b = true; for(size_t i = 1; i < mstruct.size(); i++) { if(!mstruct[i].equals(CHILD(i2 > i ? i : i + 1))) {b = false; break;} } } } else if(mstruct.size() == SIZE && mstruct[0].isMinusOne()) { b = true; for(size_t i = 1; i < mstruct.size(); i++) { if(!mstruct[i].equals(CHILD(i2 >= i ? i - 1 : i))) {b = false; break;} } } } else if(mstruct.size() == SIZE - 2 && CHILD(0).isMinusOne()) { b = true; for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].equals(CHILD(i2 - 1 >= i ? i + 1 : i + 2))) {b = false; break;} } } if(b) { CHILD(i2)[0].setFunction(CHILD(i2)[0].function() == CALCULATOR->f_cos ? CALCULATOR->f_sin : CALCULATOR->f_cos); MERGE_APPROX_AND_PREC(mstruct) calculateNegate(eo, mparent, index_this); return 1; } } } else if(eo.transform_trigonometric_functions && CHILD(i2).isPower() && CHILD(i2)[0].isFunction() && (CHILD(i2)[0].function() == CALCULATOR->f_cosh || CHILD(i2)[0].function() == CALCULATOR->f_sinh) && CHILD(i2)[0].size() == 1 && CHILD(i2)[1].isNumber() && CHILD(i2)[1].number().isTwo() && mstruct.size() > 0) { if(eo.protected_function != (CHILD(i2)[0].function() == CALCULATOR->f_sinh ? CALCULATOR->f_cosh : CALCULATOR->f_sinh)) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][0].isFunction() && mstruct[i][0].function() == (CHILD(i2)[0].function() == CALCULATOR->f_sinh ? CALCULATOR->f_cosh : CALCULATOR->f_sinh) && mstruct[i][0].size() == 1 && mstruct[i][1].isNumber() && mstruct[i][1].number().isTwo() && CHILD(i2)[0][0] == mstruct[i][0][0]) { MathStructure madd1(*this); MathStructure madd2(mstruct); MathStructure madd; madd1.delChild(i2 + 1, true); madd2.delChild(i + 1, true); if(mstruct[i][0].function() == CALCULATOR->f_sinh) madd = madd1; else madd = madd2; if(madd1.calculateAdd(madd2, eo)) { SET_CHILD_MAP(i2); CHILD(0).setFunction(CALCULATOR->f_sinh); calculateMultiply(madd1, eo); EvaluationOptions eo2 = eo; eo2.transform_trigonometric_functions = false; calculateAdd(madd, eo2); return 1; } } } } if(eo.protected_function != CHILD(i2)[0].function()) { if(CHILD(i2)[0].function() == CALCULATOR->f_sinh && mstruct.size() == SIZE - 1) { for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].equals(CHILD(i2 > i ? i : i + 1))) break; if(i == mstruct.size() - 1) { CHILD(i2)[0].setFunction(CALCULATOR->f_cosh); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } else if(CHILD(i2)[0].function() == CALCULATOR->f_cosh) { bool b = false; if(mstruct[0].isNumber()) { if(CHILD(0).isNumber()) { if(mstruct.size() == SIZE - 1 && CHILD(0).number() == -mstruct[0].number()) { b = true; for(size_t i = 1; i < mstruct.size(); i++) { if(!mstruct[i].equals(CHILD(i2 > i ? i : i + 1))) {b = false; break;} } } } else if(mstruct.size() == SIZE && mstruct[0].isMinusOne()) { b = true; for(size_t i = 1; i < mstruct.size(); i++) { if(!mstruct[i].equals(CHILD(i2 >= i ? i - 1 : i))) {b = false; break;} } } } else if(mstruct.size() == SIZE - 2 && CHILD(0).isMinusOne()) { b = true; for(size_t i = 1; i < mstruct.size(); i++) { if(!mstruct[i].equals(CHILD(i2 - 1 >= i ? i + 1 : i + 2))) {b = false; break;} } } if(b) { CHILD(i2)[0].setFunction(CALCULATOR->f_sinh); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } else if(CHILD(i2).isFunction()) { if(CHILD(i2).function() == CALCULATOR->f_signum && eo.protected_function != CALCULATOR->f_signum && CHILD(i2).size() == 2 && CHILD(i2)[0].isAddition() && CHILD(i2)[0].size() == 2 && CHILD(i2)[0].representsReal(true)) { for(size_t im = 0; im < mstruct.size(); im++) { if(mstruct[im] == CHILD(i2)) { MathStructure m1(*this), m2(mstruct); m1.delChild(i2 + 1, true); m2.delChild(im + 1, true); if((m1 == CHILD(i2)[0][0] && m2 == CHILD(i2)[0][1]) || (m2 == CHILD(i2)[0][0] && m1 == CHILD(i2)[0][1])) { SET_CHILD_MAP(i2) setFunction(CALCULATOR->f_abs); ERASE(1) MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } else if(CHILD(i2).function() == CALCULATOR->f_asin || CHILD(i2).function() == CALCULATOR->f_acos) { CHILD(i2).setFunction(CHILD(i2).function() == CALCULATOR->f_asin ? CALCULATOR->f_acos : CALCULATOR->f_asin); if(equals(mstruct)) { //asin(x)+acos(x)=pi/2 delChild(i2 + 1, true); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {calculateMultiply(Number(90, 1, 0), eo); break;} case ANGLE_UNIT_GRADIANS: {calculateMultiply(Number(100, 1, 0), eo); break;} case ANGLE_UNIT_RADIANS: {calculateMultiply(CALCULATOR->v_pi, eo); calculateMultiply(nr_half, eo); break;} default: {calculateMultiply(CALCULATOR->v_pi, eo); calculateMultiply(nr_half, eo); if(CALCULATOR->getRadUnit()) {calculateMultiply(CALCULATOR->getRadUnit(), eo);} break;} } MERGE_APPROX_AND_PREC(mstruct) return 1; } CHILD(i2).setFunction(CHILD(i2).function() == CALCULATOR->f_asin ? CALCULATOR->f_acos : CALCULATOR->f_asin); } else if(CHILD(i2).function() == CALCULATOR->f_sinh || CHILD(i2).function() == CALCULATOR->f_cosh) { CHILD(i2).setFunction(CHILD(i2).function() == CALCULATOR->f_sinh ? CALCULATOR->f_cosh : CALCULATOR->f_sinh); if(equals(mstruct)) { //sinh(x)+cosh(x)=e^x MathStructure *mexp = &CHILD(i2)[0]; mexp->ref(); delChild(i2 + 1, true); MathStructure *mmul = new MathStructure(CALCULATOR->v_e); mmul->raise_nocopy(mexp); mmul->calculateRaiseExponent(eo); MERGE_APPROX_AND_PREC(mstruct) multiply_nocopy(mmul); calculateMultiplyLast(eo, true, mparent, index_this); return 1; } CHILD(i2).setFunction(CHILD(i2).function() == CALCULATOR->f_sinh ? CALCULATOR->f_cosh : CALCULATOR->f_sinh); } } } if(eo.transform_trigonometric_functions) { for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(mstruct[i2].isPower() && mstruct[i2][0].isFunction() && (mstruct[i2][0].function() == CALCULATOR->f_cos || mstruct[i2][0].function() == CALCULATOR->f_sin) && mstruct[i2][0].size() == 1 && mstruct[i2][1].isNumber() && mstruct[i2][1].number().isTwo() && SIZE > 0) { if(eo.protected_function != mstruct[i2][0].function()) { bool b = false; if(CHILD(0).isNumber()) { if(mstruct[0].isNumber()) { if(mstruct.size() - 1 == SIZE && CHILD(0).number() == -mstruct[0].number()) { b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).equals(mstruct[i2 > i ? i : i + 1])) {b = false; break;} } } } else if(mstruct.size() == SIZE && CHILD(0).isMinusOne()) { b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).equals(mstruct[i2 >= i ? i - 1 : i])) {b = false; break;} } } } else if(mstruct.size() - 2 == SIZE && mstruct[0].isMinusOne()) { b = true; for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).equals(mstruct[i2 - 1 >= i ? i + 1 : i + 2])) {b = false; break;} } } if(b) { mstruct[i2][0].setFunction(mstruct[i2][0].function() == CALCULATOR->f_cos ? CALCULATOR->f_sin : CALCULATOR->f_cos); mstruct.calculateNegate(eo); if(mparent) mparent->swapChildren(index_this + 1, index_mstruct + 1); else set_nocopy(mstruct, true); return 1; } } } else if(mstruct[i2].isPower() && mstruct[i2][0].isFunction() && (mstruct[i2][0].function() == CALCULATOR->f_cosh || mstruct[i2][0].function() == CALCULATOR->f_sinh) && mstruct[i2][0].size() == 1 && mstruct[i2][1].isNumber() && mstruct[i2][1].number().isTwo() && SIZE > 0) { if(eo.protected_function != mstruct[i2][0].function()) { if(mstruct[i2][0].function() == CALCULATOR->f_sinh && mstruct.size() - 1 == SIZE) { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).equals(mstruct[i2 > i ? i : i + 1])) break; if(i == SIZE - 1) { mstruct[i2][0].setFunction(CALCULATOR->f_cosh); if(mparent) mparent->swapChildren(index_this + 1, index_mstruct + 1); else set_nocopy(mstruct, true); return 1; } } } else if(mstruct[i2][0].function() == CALCULATOR->f_cosh) { bool b = false; if(CHILD(0).isNumber()) { if(mstruct[0].isNumber()) { if(mstruct.size() - 1 == SIZE && CHILD(0).number() == -mstruct[0].number()) { b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).equals(mstruct[i2 > i ? i : i + 1])) {b = false; break;} } } } else if(mstruct.size() == SIZE && CHILD(0).isMinusOne()) { b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).equals(mstruct[i2 >= i ? i - 1 : i])) {b = false; break;} } } } else if(mstruct.size() - 2 == SIZE && mstruct[0].isMinusOne()) { b = true; for(size_t i = 1; i < SIZE; i++) { if(!CHILD(i).equals(mstruct[i2 - 1 >= i ? i + 1 : i + 2])) {b = false; break;} } } if(b) { mstruct[i2][0].setFunction(CALCULATOR->f_sinh); if(mparent) mparent->swapChildren(index_this + 1, index_mstruct + 1); else set_nocopy(mstruct, true); return 1; } } } } } } if(!eo.combine_divisions) break; b = true; size_t divs = 0; for(; b && i1 < SIZE; i1++) { if(CHILD(i1).isPower() && CHILD(i1)[1].hasNegativeSign()) { divs++; b = false; for(; i2 < mstruct.size(); i2++) { if(mstruct[i2].isPower() && mstruct[i2][1].hasNegativeSign()) { if(mstruct[i2] == CHILD(i1)) { b = true; } i2++; break; } } } } if(b && divs > 0) { for(; i2 < mstruct.size(); i2++) { if(mstruct[i2].isPower() && mstruct[i2][1].hasNegativeSign()) { b = false; break; } } } if(b && divs > 0) { if(SIZE - divs == 0) { if(mstruct.size() - divs == 0) { calculateMultiply(nr_two, eo); } else if(mstruct.size() - divs == 1) { PREPEND(m_one); for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].isPower() || !mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); CHILD(0).add_nocopy(&mstruct[i], true); CHILD(0).calculateAddLast(eo, true, this, 0); break; } } calculateMultiplyIndex(0, eo, true, mparent, index_this); } else { for(size_t i = 0; i < mstruct.size();) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { mstruct.delChild(i + 1); } else { i++; } } PREPEND(m_one); mstruct.ref(); CHILD(0).add_nocopy(&mstruct, true); CHILD(0).calculateAddLast(eo, true, this, 0); calculateMultiplyIndex(0, eo, true, mparent, index_this); } } else if(SIZE - divs == 1) { size_t index = 0; for(; index < SIZE; index++) { if(!CHILD(index).isPower() || !CHILD(index)[1].hasNegativeSign()) { break; } } if(mstruct.size() - divs == 0) { if(IS_REAL(CHILD(index))) { CHILD(index).number()++; } else { CHILD(index).calculateAdd(m_one, eo, this, index); } calculateMultiplyIndex(index, eo, true, mparent, index_this); } else if(mstruct.size() - divs == 1) { for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].isPower() || !mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); CHILD(index).add_nocopy(&mstruct[i], true); CHILD(index).calculateAddLast(eo, true, this, index); break; } } calculateMultiplyIndex(index, eo, true, mparent, index_this); } else { for(size_t i = 0; i < mstruct.size();) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { mstruct.delChild(i + 1); } else { i++; } } mstruct.ref(); CHILD(index).add_nocopy(&mstruct, true); CHILD(index).calculateAddLast(eo, true, this, index); calculateMultiplyIndex(index, eo, true, mparent, index_this); } } else { for(size_t i = 0; i < SIZE;) { if(CHILD(i).isPower() && CHILD(i)[1].hasNegativeSign()) { ERASE(i); } else { i++; } } if(mstruct.size() - divs == 0) { calculateAdd(m_one, eo); } else if(mstruct.size() - divs == 1) { for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].isPower() || !mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); add_nocopy(&mstruct[i], true); calculateAddLast(eo); break; } } } else { MathStructure *mstruct2 = new MathStructure(); mstruct2->setType(STRUCT_MULTIPLICATION); for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].isPower() || !mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); mstruct2->addChild_nocopy(&mstruct[i]); } } add_nocopy(mstruct2, true); calculateAddLast(eo, true, mparent, index_this); } for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { mstruct[i].ref(); multiply_nocopy(&mstruct[i], true); calculateMultiplyLast(eo); } } } return 1; } break; } case STRUCT_POWER: { if(eo.combine_divisions && mstruct[1].hasNegativeSign()) { bool b = false; size_t index = 0; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isPower() && CHILD(i)[1].hasNegativeSign()) { if(b) { b = false; break; } if(mstruct == CHILD(i)) { index = i; b = true; } if(!b) break; } } if(b) { if(SIZE == 2) { if(index == 0) setToChild(2, true); else setToChild(1, true); } else { ERASE(index); } calculateAdd(m_one, eo); mstruct.ref(); multiply_nocopy(&mstruct, false); calculateMultiplyLast(eo, true, mparent, index_this); return 1; } } if(eo.transform_trigonometric_functions && SIZE == 2 && CHILD(0).isNumber() && mstruct[0].isFunction()) { if((mstruct[0].function() == CALCULATOR->f_cos || mstruct[0].function() == CALCULATOR->f_sin) && eo.protected_function != (mstruct[0].function() == CALCULATOR->f_sin ? CALCULATOR->f_cos : CALCULATOR->f_sin) && mstruct[0].size() == 1 && mstruct[1].isNumber() && mstruct[1].number().isTwo()) { if(CHILD(1).isPower() && CHILD(1)[0].isFunction() && CHILD(1)[0].function() == (mstruct[0].function() == CALCULATOR->f_sin ? CALCULATOR->f_cos : CALCULATOR->f_sin) && CHILD(1)[0].size() == 1 && CHILD(1)[1].isNumber() && CHILD(1)[1].number().isTwo() && mstruct[0][0] == CHILD(1)[0][0]) { if(CHILD(0).calculateSubtract(m_one, eo)) { add(m_one); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } else if((mstruct[0].function() == CALCULATOR->f_cosh || mstruct[0].function() == CALCULATOR->f_sinh) && eo.protected_function != (mstruct[0].function() == CALCULATOR->f_sinh ? CALCULATOR->f_cosh : CALCULATOR->f_sinh) && mstruct[0].size() == 1 && mstruct[1].isNumber() && mstruct[1].number().isTwo()) { if(CHILD(1).isPower() && CHILD(1)[0].isFunction() && CHILD(1)[0].function() == (mstruct[0].function() == CALCULATOR->f_sinh ? CALCULATOR->f_cosh : CALCULATOR->f_sinh) && CHILD(1)[0].size() == 1 && CHILD(1)[1].isNumber() && CHILD(1)[1].number().isTwo() && mstruct[0][0] == CHILD(1)[0][0]) { if(CHILD(0).calculateAdd(m_one, eo)) { add(CHILD(1)[0].function() == CALCULATOR->f_sinh ? m_one : m_minus_one); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } } default: { if(SIZE == 2 && CHILD(0).isNumber() && CHILD(1) == mstruct) { CHILD(0).number()++; MERGE_APPROX_AND_PREC(mstruct) calculateMultiplyIndex(0, eo, true, mparent, index_this); return 1; } if(eo.transform_trigonometric_functions && SIZE == 2 && CHILD(1).isPower() && CHILD(1)[0].isFunction() && CHILD(1)[0].function() != eo.protected_function && CHILD(1)[1] == nr_two && CHILD(1)[0].size() == 1) { if(mstruct.isNumber() && CHILD(0).isNumber()) { if(CHILD(1)[0].function() == CALCULATOR->f_sin && mstruct.number() == -CHILD(0).number()) { CHILD(1)[0].setFunction(CALCULATOR->f_cos); MERGE_APPROX_AND_PREC(mstruct) calculateNegate(eo, mparent, index_this); return 1; } else if(CHILD(1)[0].function() == CALCULATOR->f_cos && mstruct.number() == -CHILD(0).number()) { CHILD(1)[0].setFunction(CALCULATOR->f_sin); MERGE_APPROX_AND_PREC(mstruct) calculateNegate(eo, mparent, index_this); return 1; } else if(CHILD(1)[0].function() == CALCULATOR->f_cosh && mstruct.number() == -CHILD(0).number()) { MERGE_APPROX_AND_PREC(mstruct) CHILD(1)[0].setFunction(CALCULATOR->f_sinh); return 1; } else if(CHILD(1)[0].function() == CALCULATOR->f_sinh && mstruct == CHILD(0)) { CHILD(1)[0].setFunction(CALCULATOR->f_cosh); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } else if(eo.transform_trigonometric_functions && SIZE == 3 && CHILD(0).isMinusOne()) { size_t i = 0; if(CHILD(1).isPower() && CHILD(1)[0].isFunction() && (CHILD(1)[0].function() == CALCULATOR->f_sin || CHILD(1)[0].function() == CALCULATOR->f_cos || CHILD(1)[0].function() == CALCULATOR->f_cosh) && CHILD(1)[0].function() != eo.protected_function && CHILD(1)[1] == nr_two && CHILD(1)[0].size() == 1 && CHILD(2) == mstruct) i = 1; if(CHILD(2).isPower() && CHILD(2)[0].isFunction() && (CHILD(2)[0].function() == CALCULATOR->f_sin || CHILD(2)[0].function() == CALCULATOR->f_cos || CHILD(2)[0].function() == CALCULATOR->f_cosh) && CHILD(2)[0].function() != eo.protected_function && CHILD(2)[1] == nr_two && CHILD(2)[0].size() == 1 && CHILD(1) == mstruct) i = 2; if(i > 0) { if(CHILD(i)[0].function() == CALCULATOR->f_sin) { CHILD(i)[0].setFunction(CALCULATOR->f_cos); MERGE_APPROX_AND_PREC(mstruct) calculateNegate(eo, mparent, index_this); return 1; } else if(CHILD(i)[0].function() == CALCULATOR->f_cos) { CHILD(i)[0].setFunction(CALCULATOR->f_sin); MERGE_APPROX_AND_PREC(mstruct) calculateNegate(eo, mparent, index_this); return 1; } else if(CHILD(i)[0].function() == CALCULATOR->f_cosh) { MERGE_APPROX_AND_PREC(mstruct) CHILD(i)[0].setFunction(CALCULATOR->f_sinh); return 1; } } } if(mstruct.isDateTime() || (mstruct.isFunction() && mstruct.function() == CALCULATOR->f_signum && eo.protected_function != CALCULATOR->f_signum)) { return 0; } } } break; } case STRUCT_POWER: { if(CHILD(0).isFunction() && (CHILD(0).function() == CALCULATOR->f_cos || CHILD(0).function() == CALCULATOR->f_sin) && eo.protected_function != (CHILD(0).function() == CALCULATOR->f_sin ? CALCULATOR->f_cos : CALCULATOR->f_sin) && CHILD(0).size() == 1 && CHILD(1).isNumber() && CHILD(1).number().isTwo()) { if(eo.transform_trigonometric_functions && mstruct.isMinusOne()) { CHILD(0).setFunction(CHILD(0).function() == CALCULATOR->f_sin ? CALCULATOR->f_cos : CALCULATOR->f_sin); negate(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.isPower() && mstruct[0].isFunction() && mstruct[0].function() == (CHILD(0).function() == CALCULATOR->f_sin ? CALCULATOR->f_cos : CALCULATOR->f_sin) && mstruct[0].size() == 1 && mstruct[1].isNumber() && mstruct[1].number().isTwo() && CHILD(0)[0] == mstruct[0][0]) { // cos(x)^2+sin(x)^2=1 set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(eo.transform_trigonometric_functions && CHILD(0).isFunction() && (CHILD(0).function() == CALCULATOR->f_cosh || CHILD(0).function() == CALCULATOR->f_sinh) && eo.protected_function != (CHILD(0).function() == CALCULATOR->f_sinh ? CALCULATOR->f_cosh : CALCULATOR->f_sinh) && CHILD(0).size() == 1 && CHILD(1).isNumber() && CHILD(1).number().isTwo()) { // cosh(x)^2=sinh(x)^2+1 if(CHILD(0).function() == CALCULATOR->f_sinh && mstruct.isOne()) { CHILD(0).setFunction(CALCULATOR->f_cosh); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(CHILD(0).function() == CALCULATOR->f_cosh && mstruct.isMinusOne()) { CHILD(0).setFunction(CALCULATOR->f_sinh); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.isPower() && mstruct[0].isFunction() && mstruct[0].function() == (CHILD(0).function() == CALCULATOR->f_sinh ? CALCULATOR->f_cosh : CALCULATOR->f_sinh) && mstruct[0].size() == 1 && mstruct[1].isNumber() && mstruct[1].number().isTwo() && CHILD(0)[0] == mstruct[0][0]) { if(CHILD(0).function() == CALCULATOR->f_sinh) { multiply(nr_two); add(m_one); } else { CHILD(0).setFunction(CALCULATOR->f_sinh); multiply(nr_two); add(m_minus_one); } MERGE_APPROX_AND_PREC(mstruct) return 1; } } goto default_addition_merge; } case STRUCT_FUNCTION: { if(o_function == CALCULATOR->f_signum && mstruct.isMultiplication() && eo.protected_function != CALCULATOR->f_signum) { if(SIZE == 2 && CHILD(0).isAddition() && CHILD(0).size() == 2 && (CHILD(0)[0].isOne() || CHILD(0)[1].isOne()) && CHILD(0).representsReal(true)) { for(size_t im = 0; im < mstruct.size(); im++) { if(mstruct[im] == *this) { MathStructure m2(mstruct); m2.delChild(im + 1, true); if((CHILD(0)[0].isOne() && m2 == CHILD(0)[1]) || (CHILD(0)[1].isOne() && m2 == CHILD(0)[0])) { setFunction(CALCULATOR->f_abs); ERASE(1) MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } } else if(mstruct.isFunction() && ((o_function == CALCULATOR->f_asin && mstruct.function() == CALCULATOR->f_acos) || (o_function == CALCULATOR->f_acos && mstruct.function() == CALCULATOR->f_asin)) && eo.protected_function != CALCULATOR->f_acos && eo.protected_function != CALCULATOR->f_asin && SIZE == 1 && mstruct.size() == 1 && CHILD(0) == mstruct[0]) { //asin(x)+acos(x)=pi/2 switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {set(90, 1, 0, true); break;} case ANGLE_UNIT_GRADIANS: {set(100, 1, 0, true); break;} case ANGLE_UNIT_RADIANS: {set(CALCULATOR->v_pi, true); multiply(nr_half); calculatesub(eo, eo, true); break;} default: {set(CALCULATOR->v_pi, true); multiply(nr_half); if(CALCULATOR->getRadUnit()) {multiply(CALCULATOR->getRadUnit(), true);} calculatesub(eo, eo, true); break;} } MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.isFunction() && ((o_function == CALCULATOR->f_sinh && mstruct.function() == CALCULATOR->f_cosh) || (o_function == CALCULATOR->f_cosh && mstruct.function() == CALCULATOR->f_sinh)) && eo.protected_function != CALCULATOR->f_cosh && eo.protected_function != CALCULATOR->f_sinh && SIZE == 1 && mstruct.size() == 1 && CHILD(0) == mstruct[0]) { //sinh(x)+cosh(x)=e^x MathStructure *mexp = &CHILD(0); mexp->ref(); set(CALCULATOR->v_e, true); calculatesub(eo, eo, true); raise_nocopy(mexp); MERGE_APPROX_AND_PREC(mstruct) calculateRaiseExponent(eo, mparent, index_this); return 1; } goto default_addition_merge; } case STRUCT_DATETIME: { if(mstruct.isDateTime()) { if(o_datetime->add(*mstruct.datetime())) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isMinusOne() && mstruct[1].isDateTime() && (CALCULATOR->u_second || CALCULATOR->u_day)) { if(CALCULATOR->u_day && !mstruct[1].datetime()->timeIsSet() && !o_datetime->timeIsSet()) { Number ndays = mstruct[1].datetime()->daysTo(*o_datetime); set(ndays, true); multiply(CALCULATOR->u_day); } else { Number nsecs = mstruct[1].datetime()->secondsTo(*o_datetime, true); set(nsecs, true); multiply(CALCULATOR->u_second, true); } MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(CALCULATOR->u_second && ((mstruct.isUnit() && mstruct.unit()->baseUnit() == CALCULATOR->u_second && mstruct.unit()->baseExponent() == 1 && !mstruct.unit()->hasComplexRelationTo(CALCULATOR->u_second)) || (mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isNumber() && mstruct[0].number().isReal() && !mstruct[0].number().isInterval() && mstruct[1].isUnit() && mstruct[1].unit()->baseUnit() == CALCULATOR->u_second && mstruct[1].unit()->baseExponent() == 1 && !mstruct[1].unit()->hasComplexRelationTo(CALCULATOR->u_second)))) { MathStructure mmul(1, 1, 0); Unit *u; if(mstruct.isMultiplication()) { mmul = mstruct[0]; u = mstruct[1].unit(); } else { u = mstruct.unit(); } if(CALCULATOR->u_month && u != CALCULATOR->u_year && (u == CALCULATOR->u_month || u->isChildOf(CALCULATOR->u_month))) { if(u != CALCULATOR->u_month) { CALCULATOR->u_month->convert(u, mmul); mmul.eval(eo); } if(mmul.isNumber() && o_datetime->addMonths(mmul.number())) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(CALCULATOR->u_year && (u == CALCULATOR->u_year || u->isChildOf(CALCULATOR->u_year))) { if(u != CALCULATOR->u_year) { CALCULATOR->u_year->convert(u, mmul); mmul.eval(eo); } if(mmul.isNumber() && o_datetime->addYears(mmul.number())) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(CALCULATOR->u_day && (u == CALCULATOR->u_day || u->isChildOf(CALCULATOR->u_day))) { if(u != CALCULATOR->u_day) { CALCULATOR->u_day->convert(u, mmul); mmul.eval(eo); } if(mmul.isNumber() && o_datetime->addDays(mmul.number())) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(CALCULATOR->u_hour && (u == CALCULATOR->u_hour || u->isChildOf(CALCULATOR->u_hour))) { if(u != CALCULATOR->u_hour) { CALCULATOR->u_hour->convert(u, mmul); mmul.eval(eo); } if(mmul.isNumber() && o_datetime->addHours(mmul.number())) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(CALCULATOR->u_minute && (u == CALCULATOR->u_minute || u->isChildOf(CALCULATOR->u_minute))) { if(u != CALCULATOR->u_minute) { CALCULATOR->u_minute->convert(u, mmul); mmul.eval(eo); } if(mmul.isNumber() && o_datetime->addMinutes(mmul.number())) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } else { MathStructure mmulb(mmul); if(u != CALCULATOR->u_second) { u->convertToBaseUnit(mmul); mmul.eval(eo); } if(mmul.isNumber() && o_datetime->addSeconds(mmul.number(), true)) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } default: { default_addition_merge: switch(mstruct.type()) { case STRUCT_VECTOR: {return -1;} case STRUCT_DATETIME: {} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { return 0; } default: { if(equals(mstruct)) { multiply_nocopy(new MathStructure(2, 1, 0), true); MERGE_APPROX_AND_PREC(mstruct) calculateMultiplyLast(eo, true, mparent, index_this); return 1; } } } } } return -1; } bool reducable(const MathStructure &mnum, const MathStructure &mden, Number &nr) { switch(mnum.type()) { case STRUCT_NUMBER: {} case STRUCT_ADDITION: { break; } default: { bool reduce = true; for(size_t i = 0; i < mden.size() && reduce; i++) { switch(mden[i].type()) { case STRUCT_MULTIPLICATION: { reduce = false; for(size_t i2 = 0; i2 < mden[i].size(); i2++) { if(mnum == mden[i][i2]) { reduce = true; if(!nr.isOne() && !nr.isFraction()) nr.set(1, 1, 0); break; } else if(mden[i][i2].isPower() && mden[i][i2][1].isNumber() && mden[i][i2][1].number().isReal() && mnum == mden[i][i2][0]) { if(!mden[i][i2][1].number().isPositive()) { break; } if(mden[i][i2][1].number().isLessThan(nr)) nr = mden[i][i2][1].number(); reduce = true; break; } } break; } case STRUCT_POWER: { if(mden[i][1].isNumber() && mden[i][1].number().isReal() && mnum == mden[i][0]) { if(!mden[i][1].number().isPositive()) { reduce = false; break; } if(mden[i][1].number().isLessThan(nr)) nr = mden[i][1].number(); break; } } default: { if(mnum != mden[i]) { reduce = false; break; } if(!nr.isOne() && !nr.isFraction()) nr.set(1, 1, 0); } } } return reduce; } } return false; } void reduce(const MathStructure &mnum, MathStructure &mden, Number &nr, const EvaluationOptions &eo) { switch(mnum.type()) { case STRUCT_NUMBER: {} case STRUCT_ADDITION: { break; } default: { for(size_t i = 0; i < mden.size(); i++) { switch(mden[i].type()) { case STRUCT_MULTIPLICATION: { for(size_t i2 = 0; i2 < mden[i].size(); i2++) { if(mden[i][i2] == mnum) { if(!nr.isOne()) { MathStructure *mexp = new MathStructure(1, 1, 0); mexp->number() -= nr; mden[i][i2].raise_nocopy(mexp); mden[i][i2].calculateRaiseExponent(eo); } else { if(mden[i].size() == 1) { mden[i].set(m_one); } else { mden[i].delChild(i2 + 1); if(mden[i].size() == 1) { mden[i].setToChild(1, true, &mden, i + 1); } } } break; } else if(mden[i][i2].isPower() && mden[i][i2][1].isNumber() && mden[i][i2][1].number().isReal() && mnum.equals(mden[i][i2][0])) { mden[i][i2][1].number() -= nr; if(mden[i][i2][1].number().isOne()) { mden[i][i2].setToChild(1, true, &mden[i], i2 + 1); } else { mden[i][i2].calculateRaiseExponent(eo); } break; } } break; } case STRUCT_POWER: { if(mden[i][1].isNumber() && mden[i][1].number().isReal() && mnum.equals(mden[i][0])) { mden[i][1].number() -= nr; if(mden[i][1].number().isOne()) { mden[i].setToChild(1, true, &mden, i + 1); } else { mden[i].calculateRaiseExponent(eo, &mden, i); } break; } } default: { if(!nr.isOne()) { MathStructure *mexp = new MathStructure(1, 1, 0); mexp->number() -= nr; mden[i].raise_nocopy(mexp); mden[i].calculateRaiseExponent(eo, &mden, 1); } else { mden[i].set(m_one); } } } } mden.calculatesub(eo, eo, false); } } } bool addablePower(const MathStructure &mstruct, const EvaluationOptions &eo) { if(mstruct[0].representsNonNegative(true)) return true; if(mstruct[1].representsInteger()) return true; //return eo.allow_complex && mstruct[0].representsNegative(true) && mstruct[1].isNumber() && mstruct[1].number().isRational() && mstruct[1].number().denominatorIsEven(); return eo.allow_complex && mstruct[1].isNumber() && mstruct[1].number().isRational() && mstruct[1].number().denominatorIsEven(); } int MathStructure::merge_multiplication(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool reversed, bool do_append) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.multiply(mstruct.number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || o_number.includesInfinity() || mstruct.number().includesInfinity())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } if(mstruct.isOne()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(isOne()) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } if(m_type == STRUCT_NUMBER && o_number.isInfinite()) { if(o_number.isMinusInfinity(false)) { if(mstruct.representsPositive(false)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(mstruct.representsNegative(false)) { o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_number.isPlusInfinity(false)) { if(mstruct.representsPositive(false)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(mstruct.representsNegative(false)) { o_number.setMinusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } if(eo.approximation == APPROXIMATION_EXACT) { CALCULATOR->beginTemporaryEnableIntervalArithmetic(); CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(mstruct); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.calculateFunctions(eo2); mtest.calculatesub(eo2, eo2); CALCULATOR->endTemporaryStopMessages(); CALCULATOR->endTemporaryEnableIntervalArithmetic(); if(o_number.isMinusInfinity(false)) { if(mtest.representsPositive(false)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(mtest.representsNegative(false)) { o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_number.isPlusInfinity(false)) { if(mtest.representsPositive(false)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(mtest.representsNegative(false)) { o_number.setMinusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } else if(mstruct.isNumber() && mstruct.number().isInfinite()) { if(mstruct.number().isMinusInfinity(false)) { if(representsPositive(false)) { clear(true); o_number.setMinusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(representsNegative(false)) { clear(true); o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(mstruct.number().isPlusInfinity(false)) { if(representsPositive(false)) { clear(true); o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(representsNegative(false)) { clear(true); o_number.setMinusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } if(eo.approximation == APPROXIMATION_EXACT) { CALCULATOR->beginTemporaryEnableIntervalArithmetic(); CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(*this); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.calculateFunctions(eo2); mtest.calculatesub(eo2, eo2); CALCULATOR->endTemporaryStopMessages(); CALCULATOR->endTemporaryEnableIntervalArithmetic(); if(mstruct.number().isMinusInfinity(false)) { if(mtest.representsPositive(false)) { clear(true); o_number.setMinusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mtest.representsNegative(false)) { clear(true); o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(mstruct.number().isPlusInfinity(false)) { if(mtest.representsPositive(false)) { clear(true); o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mtest.representsNegative(false)) { clear(true); o_number.setMinusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } if(representsUndefined() || mstruct.representsUndefined()) return -1; // x/(x^2+x)=1/(x+1) const MathStructure *mnum = NULL, *mden = NULL; bool b_nonzero = false; if(eo.reduce_divisions) { if(!isNumber() && mstruct.isPower() && mstruct[0].isAddition() && mstruct[0].size() > 1 && mstruct[1].isNumber() && mstruct[1].number().isMinusOne()) { if((!isPower() || !CHILD(1).hasNegativeSign()) && representsNumber() && mstruct[0].representsNumber()) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mstruct[0].representsZero(true)) || mstruct[0].representsNonZero(true)) { b_nonzero = true; } if(b_nonzero || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mstruct[0].representsZero(true))) { mnum = this; mden = &mstruct[0]; } } } else if(!mstruct.isNumber() && isPower() && CHILD(0).isAddition() && CHILD(0).size() > 1 && CHILD(1).isNumber() && CHILD(1).number().isMinusOne()) { if((!mstruct.isPower() || !mstruct[1].hasNegativeSign()) && mstruct.representsNumber() && CHILD(0).representsNumber()) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true)) || CHILD(0).representsNonZero(true)) { b_nonzero = true; } if(b_nonzero || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true))) { mnum = &mstruct; mden = &CHILD(0); } } } } if(mnum && mden && eo.reduce_divisions) { switch(mnum->type()) { case STRUCT_ADDITION: { break; } case STRUCT_MULTIPLICATION: { Number nr; vector nrs; vector reducables; for(size_t i = 0; i < mnum->size(); i++) { switch((*mnum)[i].type()) { case STRUCT_ADDITION: {break;} case STRUCT_POWER: { if((*mnum)[i][1].isNumber() && (*mnum)[i][1].number().isReal()) { if((*mnum)[i][1].number().isPositive()) { nr.set((*mnum)[i][1].number()); if(reducable((*mnum)[i][0], *mden, nr)) { nrs.push_back(nr); reducables.push_back(i); } } break; } } default: { nr.set(1, 1, 0); if(reducable((*mnum)[i], *mden, nr)) { nrs.push_back(nr); reducables.push_back(i); } } } } if(reducables.size() > 0) { if(!b_nonzero && eo.warn_about_denominators_assumed_nonzero && !warn_about_denominators_assumed_nonzero(*mden, eo)) break; if(mnum == this) { mstruct.ref(); transform_nocopy(STRUCT_MULTIPLICATION, &mstruct); } else { transform(STRUCT_MULTIPLICATION); PREPEND_REF(&mstruct); } size_t i_erased = 0; for(size_t i = 0; i < reducables.size(); i++) { switch(CHILD(0)[reducables[i] - i_erased].type()) { case STRUCT_POWER: { if(CHILD(0)[reducables[i] - i_erased][1].isNumber() && CHILD(0)[reducables[i] - i_erased][1].number().isReal()) { reduce(CHILD(0)[reducables[i] - i_erased][0], CHILD(1)[0], nrs[i], eo); if(nrs[i] == CHILD(0)[reducables[i] - i_erased][1].number()) { CHILD(0).delChild(reducables[i] - i_erased + 1); i_erased++; } else { CHILD(0)[reducables[i] - i_erased][1].number() -= nrs[i]; if(CHILD(0)[reducables[i] - i_erased][1].number().isOne()) { CHILD(0)[reducables[i] - i_erased].setToChild(1, true, &CHILD(0), reducables[i] - i_erased + 1); } else { CHILD(0)[reducables[i] - i_erased].calculateRaiseExponent(eo); } CHILD(0).calculateMultiplyIndex(reducables[i] - i_erased, eo, true); } break; } } default: { reduce(CHILD(0)[reducables[i] - i_erased], CHILD(1)[0], nrs[i], eo); if(nrs[i].isOne()) { CHILD(0).delChild(reducables[i] - i_erased + 1); i_erased++; } else { MathStructure mexp(1, 1); mexp.number() -= nrs[i]; CHILD(0)[reducables[i] - i_erased].calculateRaise(mexp, eo); CHILD(0).calculateMultiplyIndex(reducables[i] - i_erased, eo, true); } } } } if(CHILD(0).size() == 0) { setToChild(2, true, mparent, index_this + 1); } else if(CHILD(0).size() == 1) { CHILD(0).setToChild(1, true, this, 1); calculateMultiplyIndex(0, eo, true, mparent, index_this); } else { calculateMultiplyIndex(0, eo, true, mparent, index_this); } return 1; } break; } case STRUCT_POWER: { if((*mnum)[1].isNumber() && (*mnum)[1].number().isReal()) { if((*mnum)[1].number().isPositive()) { Number nr((*mnum)[1].number()); if(reducable((*mnum)[0], *mden, nr)) { if(!b_nonzero && eo.warn_about_denominators_assumed_nonzero && !warn_about_denominators_assumed_nonzero(*mden, eo)) break; if(nr != (*mnum)[1].number()) { MathStructure mnum2((*mnum)[0]); if(mnum == this) { CHILD(1).number() -= nr; if(CHILD(1).number().isOne()) { set(mnum2); } else { calculateRaiseExponent(eo); } mstruct.ref(); transform_nocopy(STRUCT_MULTIPLICATION, &mstruct); reduce(mnum2, CHILD(1)[0], nr, eo); calculateMultiplyLast(eo); } else { transform(STRUCT_MULTIPLICATION); PREPEND(mstruct); CHILD(0)[1].number() -= nr; if(CHILD(0)[1].number().isOne()) { CHILD(0) = mnum2; } else { CHILD(0).calculateRaiseExponent(eo); } reduce(mnum2, CHILD(1)[0], nr, eo); calculateMultiplyIndex(0, eo); } } else { if(mnum == this) { MathStructure mnum2((*mnum)[0]); if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); reduce(mnum2, (*mparent)[index_this][0], nr, eo); } else { set_nocopy(mstruct, true); reduce(mnum2, CHILD(0), nr, eo); } } else { reduce((*mnum)[0], CHILD(0), nr, eo); } } return 1; } } break; } } default: { Number nr(1, 1); if(reducable(*mnum, *mden, nr)) { if(!b_nonzero && eo.warn_about_denominators_assumed_nonzero && !warn_about_denominators_assumed_nonzero(*mden, eo)) break; if(mnum == this) { MathStructure mnum2(*mnum); if(!nr.isOne()) { reduce(*mnum, mstruct[0], nr, eo); mstruct.calculateRaiseExponent(eo, mparent, index_mstruct); nr.negate(); nr++; calculateRaise(nr, eo); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo, true, mparent, index_this); } else if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); reduce(mnum2, (*mparent)[index_this][0], nr, eo); (*mparent)[index_this].calculateRaiseExponent(eo, mparent, index_this); } else { set_nocopy(mstruct, true); reduce(mnum2, CHILD(0), nr, eo); calculateRaiseExponent(eo, mparent, index_this); } } else { reduce(*mnum, CHILD(0), nr, eo); calculateRaiseExponent(eo, mparent, index_this); if(!nr.isOne()) { nr.negate(); nr++; mstruct.calculateRaise(nr, eo); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo, true, mparent, index_this); } } return 1; } } } } if(mstruct.isFunction() && eo.protected_function != mstruct.function()) { if(((mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1 && mstruct[0].isFunction() && mstruct[0].function() == CALCULATOR->f_signum && mstruct[0].size() == 2) || (mstruct.function() == CALCULATOR->f_signum && mstruct.size() == 2 && mstruct[0].isFunction() && mstruct[0].function() == CALCULATOR->f_abs && mstruct[0].size() == 1)) && (equals(mstruct[0][0]) || (isFunction() && o_function == CALCULATOR->f_abs && SIZE == 1 && CHILD(0) == mstruct[0][0]) || (isPower() && CHILD(0) == mstruct[0][0]) || (isPower() && CHILD(0).isFunction() && CHILD(0).function() == CALCULATOR->f_abs && CHILD(0).size() == 1 && CHILD(0)[0] == mstruct[0][0]))) { // sgn(abs(x))*x^y=x^y MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(mstruct.function() == CALCULATOR->f_signum && mstruct.size() == 2) { if(equals(mstruct[0]) && representsReal(true)) { // sgn(x)*x=abs(x) transform(CALCULATOR->f_abs); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(isPower() && CHILD(1).representsOdd() && mstruct[0] == CHILD(0) && CHILD(0).representsReal(true)) { //sgn(x)*x^3=abs(x)^3 CHILD(0).transform(CALCULATOR->f_abs); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(mstruct.function() == CALCULATOR->f_root && VALID_ROOT(mstruct)) { if(equals(mstruct[0]) && mstruct[0].representsReal(true) && mstruct[1].number().isOdd()) { // root(x, 3)*x=abs(x)^(1/3)*x mstruct[0].transform(STRUCT_FUNCTION); mstruct[0].setFunction(CALCULATOR->f_abs); mstruct[1].number().recip(); mstruct.setType(STRUCT_POWER); transform(STRUCT_FUNCTION); setFunction(CALCULATOR->f_abs); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if(isPower() && CHILD(1).representsOdd() && CHILD(0) == mstruct[0] && CHILD(0).representsReal(true) && mstruct[1].number().isOdd()) { // root(x, 3)*x^3=abs(x)^(1/3)*x^3 mstruct[0].transform(STRUCT_FUNCTION); mstruct[0].setFunction(CALCULATOR->f_abs); mstruct[1].number().recip(); mstruct.setType(STRUCT_POWER); CHILD(0).transform(STRUCT_FUNCTION); CHILD(0).setFunction(CALCULATOR->f_abs); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } } if(isZero()) { if(mstruct.isFunction()) { if((mstruct.function() == CALCULATOR->f_ln || mstruct.function() == CALCULATOR->f_Ei) && mstruct.size() == 1) { if(mstruct[0].representsNonZero() || warn_about_assumed_not_value(mstruct[0], m_zero, eo)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } else if(mstruct.function() == CALCULATOR->f_li && mstruct.size() == 1) { if(mstruct.representsNumber(true) || warn_about_assumed_not_value(mstruct[0], m_one, eo)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } } else if(mstruct.isPower() && mstruct[0].isFunction() && mstruct[1].representsNumber()) { if((mstruct[0].function() == CALCULATOR->f_ln || mstruct[0].function() == CALCULATOR->f_Ei) && mstruct[0].size() == 1) { if(mstruct[0][0].representsNonZero() || warn_about_assumed_not_value(mstruct[0][0], m_zero, eo)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } else if(mstruct[0].function() == CALCULATOR->f_li && mstruct[0].size() == 1) { if(mstruct[0].representsNumber(true) || warn_about_assumed_not_value(mstruct[0][0], m_one, eo)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } } } switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_ADDITION: { return 0; } case STRUCT_VECTOR: { if(isMatrix() && mstruct.isMatrix()) { if(CHILD(0).size() != mstruct.size()) { CALCULATOR->error(true, _("The second matrix must have as many rows (was %s) as the first has columns (was %s) for matrix multiplication."), i2s(mstruct.size()).c_str(), i2s(CHILD(0).size()).c_str(), NULL); return -1; } MathStructure msave(*this); size_t rows = SIZE; clearMatrix(true); resizeMatrix(rows, mstruct[0].size(), m_zero); MathStructure mtmp; for(size_t index_r = 0; index_r < SIZE; index_r++) { for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { for(size_t index = 0; index < msave[0].size(); index++) { mtmp = msave[index_r][index]; mtmp.calculateMultiply(mstruct[index][index_c], eo); CHILD(index_r)[index_c].calculateAdd(mtmp, eo, &CHILD(index_r), index_c); } } } MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(isMatrix() && mstruct.isVector()) { if(SIZE != mstruct.size() || CHILD(0).size() != 1) { CALCULATOR->error(true, _("The second matrix must have as many rows (was %s) as the first has columns (was %s) for matrix multiplication."), i2s(1).c_str(), i2s(CHILD(0).size()).c_str(), NULL); return -1; } MathStructure msave(*this); size_t rows = SIZE; clearMatrix(true); resizeMatrix(rows, mstruct.size(), m_zero); MathStructure mtmp; for(size_t index_r = 0; index_r < SIZE; index_r++) { for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { CHILD(index_r)[index_c].set(msave[index_r][0]); CHILD(index_r)[index_c].calculateMultiply(mstruct[index_c], eo); } } MERGE_APPROX_AND_PREC(mstruct) return 1; } else { if(SIZE == mstruct.size()) { for(size_t i = 0; i < SIZE; i++) { mstruct[i].ref(); CHILD(i).multiply_nocopy(&mstruct[i], true); CHILD(i).calculateMultiplyLast(eo, true); } m_type = STRUCT_ADDITION; MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } } return -1; } default: { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateMultiply(mstruct, eo); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } } } case STRUCT_ADDITION: { if(eo.expand != 0 && containsType(STRUCT_DATETIME, false, true, false) > 0) return -1; switch(mstruct.type()) { case STRUCT_ADDITION: { if(eo.expand != 0 && SIZE < 1000 && mstruct.size() < 1000 && (SIZE * mstruct.size() < (eo.expand == -1 ? 50 : 500)) && (eo.expand > -2 || (!containsInterval(true, false, false, eo.expand == -2) && !mstruct.containsInterval(true, false, false, eo.expand == -2)) || (representsNonNegative(true) && mstruct.representsNonNegative(true)))) { MathStructure msave(*this); CLEAR; for(size_t i = 0; i < mstruct.size(); i++) { if(CALCULATOR->aborted()) { set(msave); return -1; } APPEND(msave); mstruct[i].ref(); LAST.multiply_nocopy(&mstruct[i], true); if(reversed) { LAST.swapChildren(1, LAST.size()); LAST.calculateMultiplyIndex(0, eo, true, this, SIZE - 1); } else { LAST.calculateMultiplyLast(eo, true, this, SIZE - 1); } } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } else if(eo.expand <= -2 && (!mstruct.containsInterval(true, false, false, eo.expand == -2) || representsNonNegative(true))) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateMultiply(mstruct, eo, this, i); } calculatesub(eo, eo, false, mparent, index_this); return 1; } else if(eo.expand <= -2 && (!containsInterval(true, false, false, eo.expand == -2) || mstruct.representsNonNegative(true))) { return 0; } else { if(equals(mstruct)) { raise_nocopy(new MathStructure(2, 1, 0)); MERGE_APPROX_AND_PREC(mstruct) return 1; } } break; } case STRUCT_POWER: { if(mstruct[1].isNumber() && *this == mstruct[0]) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !representsZero(true)) || (mstruct[1].isNumber() && mstruct[1].number().isReal() && !mstruct[1].number().isMinusOne()) || representsNonZero(true) || mstruct[1].representsPositive() || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !representsZero(true) && warn_about_denominators_assumed_nonzero_or_positive(*this, mstruct[1], eo))) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); (*mparent)[index_this][1].number()++; (*mparent)[index_this].calculateRaiseExponent(eo, mparent, index_this); } else { set_nocopy(mstruct, true); CHILD(1).number()++; calculateRaiseExponent(eo, mparent, index_this); } return 1; } } if(eo.expand == 0 && mstruct[0].isAddition()) return -1; if(eo.combine_divisions && mstruct[1].hasNegativeSign()) { int ret; vector merged; merged.resize(SIZE, false); size_t merges = 0; MathStructure *mstruct2 = new MathStructure(mstruct); for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isOne()) ret = -1; else ret = CHILD(i).merge_multiplication(*mstruct2, eo, NULL, 0, 0, false, false); if(ret == 0) { ret = mstruct2->merge_multiplication(CHILD(i), eo, NULL, 0, 0, true, false); if(ret >= 1) { mstruct2->ref(); setChild_nocopy(mstruct2, i + 1); } } if(ret >= 1) { mstruct2->unref(); if(i + 1 != SIZE) mstruct2 = new MathStructure(mstruct); merged[i] = true; merges++; } else { if(i + 1 == SIZE) mstruct2->unref(); merged[i] = false; } } if(merges == 0) { return -1; } else if(merges == SIZE) { calculatesub(eo, eo, false, mparent, index_this); return 1; } else if(merges == SIZE - 1) { for(size_t i = 0; i < SIZE; i++) { if(!merged[i]) { mstruct.ref(); CHILD(i).multiply_nocopy(&mstruct, true); break; } } calculatesub(eo, eo, false, mparent, index_this); } else { MathStructure *mdiv = new MathStructure(); merges = 0; for(size_t i = 0; i - merges < SIZE; i++) { if(!merged[i]) { CHILD(i - merges).ref(); if(merges > 0) { (*mdiv)[0].add_nocopy(&CHILD(i - merges), merges > 1); } else { mdiv->multiply(mstruct); mdiv->setChild_nocopy(&CHILD(i - merges), 1); } ERASE(i - merges); merges++; } } add_nocopy(mdiv, true); calculatesub(eo, eo, false); } return 1; } if(eo.expand == 0 || (eo.expand < -1 && mstruct.containsInterval(true, false, false, eo.expand == -2) && !representsNonNegative(true))) return -1; } case STRUCT_MULTIPLICATION: { if(do_append && (eo.expand == 0 || (eo.expand < -1 && mstruct.containsInterval(true, false, false, eo.expand == -2) && !representsNonNegative(true)))) { transform(STRUCT_MULTIPLICATION); for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } return 1; } } default: { if(eo.expand == 0 || (eo.expand < -1 && mstruct.containsInterval(true, false, false, eo.expand == -2) && !representsNonNegative(true))) return -1; for(size_t i = 0; i < SIZE; i++) { CHILD(i).multiply(mstruct, true); if(reversed) { CHILD(i).swapChildren(1, CHILD(i).size()); CHILD(i).calculateMultiplyIndex(0, eo, true, this, i); } else { CHILD(i).calculateMultiplyLast(eo, true, this, i); } } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } } return -1; } case STRUCT_MULTIPLICATION: { switch(mstruct.type()) { case STRUCT_VECTOR: {} case STRUCT_ADDITION: { if(eo.expand == 0 || containsType(STRUCT_DATETIME, false, true, false) > 0) { if(!do_append) return -1; APPEND_REF(&mstruct); return 1; } return 0; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < mstruct.size(); i++) { if(reversed) { PREPEND_REF(&mstruct[i]); calculateMultiplyIndex(0, eo, false); } else { APPEND_REF(&mstruct[i]); calculateMultiplyLast(eo, false); } } MERGE_APPROX_AND_PREC(mstruct) if(SIZE == 1) { setToChild(1, false, mparent, index_this + 1); } else if(SIZE == 0) { clear(true); } else { evalSort(); } return 1; } case STRUCT_POWER: { if(mstruct[1].isNumber()) { if(*this == mstruct[0]) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !representsZero(true)) || (mstruct[1].isNumber() && mstruct[1].number().isReal() && !mstruct[1].number().isMinusOne()) || representsNonZero(true) || mstruct[1].representsPositive() || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !representsZero(true) && warn_about_denominators_assumed_nonzero_or_positive(*this, mstruct[1], eo))) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); (*mparent)[index_this][1].number()++; (*mparent)[index_this].calculateRaiseExponent(eo, mparent, index_this); } else { set_nocopy(mstruct, true); CHILD(1).number()++; calculateRaiseExponent(eo, mparent, index_this); } return 1; } } else { for(size_t i = 0; i < SIZE; i++) { int ret = CHILD(i).merge_multiplication(mstruct, eo, NULL, 0, 0, false, false); if(ret == 0) { ret = mstruct.merge_multiplication(CHILD(i), eo, NULL, 0, 0, true, false); if(ret >= 1) { if(ret == 2) ret = 3; else if(ret == 3) ret = 2; mstruct.ref(); setChild_nocopy(&mstruct, i + 1); } } if(ret >= 1) { if(ret != 2) calculateMultiplyIndex(i, eo, true, mparent, index_this); return 1; } } } } } default: { if(do_append) { MERGE_APPROX_AND_PREC(mstruct) if(reversed) { PREPEND_REF(&mstruct); calculateMultiplyIndex(0, eo, true, mparent, index_this); } else { APPEND_REF(&mstruct); calculateMultiplyLast(eo, true, mparent, index_this); } return 1; } } } return -1; } case STRUCT_POWER: { switch(mstruct.type()) { case STRUCT_VECTOR: {} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { return 0; } case STRUCT_POWER: { if(mstruct[0] == CHILD(0) || (CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0].isMinusOne() && CHILD(0)[1] == mstruct[0] && mstruct[1].representsEven())) { if(mstruct[0].isUnit() && mstruct[0].prefix()) CHILD(0).setPrefix(mstruct[0].prefix()); bool b = eo.allow_complex || CHILD(0).representsNonNegative(true), b2 = true, b_warn = false; if(!b) { b = CHILD(1).representsInteger() && mstruct[1].representsInteger(); } if(b) { b = false; bool b2test = false; if(IS_REAL(mstruct[1]) && IS_REAL(CHILD(1))) { if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { b2 = true; b = true; } else if(!mstruct[1].number().isMinusOne() && !CHILD(1).number().isMinusOne()) { b2 = (mstruct[1].number() + CHILD(1).number()).isNegative(); b = true; if(!b2) b2test = true; } } if(!b || b2test) { b = (!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true)) || CHILD(0).representsNonZero(true) || (CHILD(1).representsPositive() && mstruct[1].representsPositive()) || (CHILD(1).representsNegative() && mstruct[1].representsNegative()); if(!b && eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true)) { b = true; b_warn = true; } if(b2test) { b2 = b; b = true; } } } if(b) { if(IS_REAL(CHILD(1)) && IS_REAL(mstruct[1])) { if(!b2 && !do_append) return -1; if(b_warn && !warn_about_denominators_assumed_nonzero(CHILD(0), eo)) return -1; if(b2) { CHILD(1).number() += mstruct[1].number(); calculateRaiseExponent(eo, mparent, index_this); } else { if(CHILD(1).number().isNegative()) { CHILD(1).number()++; mstruct[1].number() += CHILD(1).number(); CHILD(1).number().set(-1, 1, 0); } else { mstruct[1].number()++; CHILD(1).number() += mstruct[1].number(); mstruct[1].number().set(-1, 1, 0); } MERGE_APPROX_AND_PREC(mstruct) transform(STRUCT_MULTIPLICATION); CHILD(0).calculateRaiseExponent(eo, this, 0); if(reversed) { PREPEND_REF(&mstruct); CHILD(0).calculateRaiseExponent(eo, this, 0); calculateMultiplyIndex(0, eo, true, mparent, index_this); } else { APPEND_REF(&mstruct); CHILD(1).calculateRaiseExponent(eo, this, 1); calculateMultiplyLast(eo, true, mparent, index_this); } } return 1; } else { MathStructure mstruct2(CHILD(1)); if(mstruct2.calculateAdd(mstruct[1], eo)) { if(b_warn && !warn_about_denominators_assumed_nonzero_llgg(CHILD(0), CHILD(1), mstruct[1], eo)) return -1; CHILD(1) = mstruct2; calculateRaiseExponent(eo, mparent, index_this); return 1; } } } } else if(mstruct[1] == CHILD(1)) { if(!CHILD(0).isMultiplication() && !mstruct[0].isMultiplication() && (mstruct[1].representsInteger() || CHILD(0).representsPositive(true) || mstruct[0].representsPositive(true))) { MathStructure mstruct2(CHILD(0)); if(mstruct2.calculateMultiply(mstruct[0], eo)) { CHILD(0) = mstruct2; MERGE_APPROX_AND_PREC(mstruct) calculateRaiseExponent(eo, mparent, index_this); return 1; } } else if(eo.transform_trigonometric_functions && CHILD(1).representsInteger() && CHILD(0).isFunction() && mstruct[0].isFunction() && eo.protected_function != mstruct[0].function() && eo.protected_function != CHILD(0).function() && CHILD(0).size() == 1 && mstruct[0].size() == 1 && CHILD(0)[0] == mstruct[0][0]) { if((CHILD(0).function() == CALCULATOR->f_cos && mstruct[0].function() == CALCULATOR->f_sin) || (CHILD(0).function() == CALCULATOR->f_sin && mstruct[0].function() == CALCULATOR->f_cos) || (CHILD(0).function() == CALCULATOR->f_cosh && mstruct[0].function() == CALCULATOR->f_sinh) || (CHILD(0).function() == CALCULATOR->f_sinh && mstruct[0].function() == CALCULATOR->f_cosh)) { // cos(x)^n*sin(x)^n=sin(2x)^n/2^n if(CHILD(0).function() == CALCULATOR->f_cosh) CHILD(0).setFunction(CALCULATOR->f_sinh); else if(CHILD(0).function() == CALCULATOR->f_cos) CHILD(0).setFunction(CALCULATOR->f_sin); CHILD(0)[0].calculateMultiply(nr_two, eo); CHILD(0).childUpdated(1); CHILD_UPDATED(0) MathStructure *mdiv = new MathStructure(2, 1, 0); mdiv->calculateRaise(CHILD(1), eo); mdiv->calculateInverse(eo); multiply_nocopy(mdiv); calculateMultiplyLast(eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if((CHILD(0).function() == CALCULATOR->f_tan && mstruct[0].function() == CALCULATOR->f_cos) || (CHILD(0).function() == CALCULATOR->f_cos && mstruct[0].function() == CALCULATOR->f_tan)) { // tan(x)^n*cos(x)^n=sin(x)^n CHILD(0).setFunction(CALCULATOR->f_sin); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if((CHILD(0).function() == CALCULATOR->f_tanh && mstruct[0].function() == CALCULATOR->f_cosh) || (CHILD(0).function() == CALCULATOR->f_cosh && mstruct[0].function() == CALCULATOR->f_tanh)) { // tanh(x)^n*cosh(x)^n=sinh(x)^n CHILD(0).setFunction(CALCULATOR->f_sin); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } else if(eo.transform_trigonometric_functions && CHILD(1).isInteger() && mstruct[1].isInteger() && CHILD(0).isFunction() && mstruct[0].isFunction() && eo.protected_function != mstruct[0].function() && eo.protected_function != CHILD(0).function() && mstruct[0].size() == 1 && CHILD(0).size() == 1 && CHILD(0)[0] == mstruct[0][0]) { if(CHILD(1).number().isNonNegative() != mstruct[1].number().isNonNegative()) { if(CHILD(0).function() == CALCULATOR->f_sin) { if(mstruct[0].function() == CALCULATOR->f_cos) { CHILD(0).setFunction(CALCULATOR->f_tan); mstruct[1].number() += CHILD(1).number(); if(mstruct[1].number().isZero()) { MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { mstruct[0].setFunction(CALCULATOR->f_sin); CHILD(1).number() -= mstruct[1].number(); } mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if(mstruct[0].function() == CALCULATOR->f_tan) { CHILD(0).setFunction(CALCULATOR->f_cos); mstruct[1].number() += CHILD(1).number(); if(mstruct[1].number().isZero()) { MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { mstruct[0].setFunction(CALCULATOR->f_sin); CHILD(1).number() -= mstruct[1].number(); } mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_cos) { if(mstruct[0].function() == CALCULATOR->f_sin) { mstruct[0].setFunction(CALCULATOR->f_tan); CHILD(1).number() += mstruct[1].number(); if(CHILD(1).number().isZero()) { set(mstruct, true); return 1; } else if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { CHILD(0).setFunction(CALCULATOR->f_sin); mstruct[1].number() -= CHILD(1).number(); } mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_tan) { if(mstruct[0].function() == CALCULATOR->f_sin) { mstruct[0].setFunction(CALCULATOR->f_cos); CHILD(1).number() += mstruct[1].number(); if(CHILD(1).number().isZero()) { set(mstruct, true); return 1; } else if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { CHILD(0).setFunction(CALCULATOR->f_sin); mstruct[1].number() -= CHILD(1).number(); } mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_sinh) { if(mstruct[0].function() == CALCULATOR->f_cosh) { CHILD(0).setFunction(CALCULATOR->f_tanh); mstruct[1].number() += CHILD(1).number(); if(mstruct[1].number().isZero()) { MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { mstruct[0].setFunction(CALCULATOR->f_sinh); CHILD(1).number() -= mstruct[1].number(); } mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if(mstruct[0].function() == CALCULATOR->f_tanh) { CHILD(0).setFunction(CALCULATOR->f_cosh); mstruct[1].number() += CHILD(1).number(); if(mstruct[1].number().isZero()) { MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { mstruct[0].setFunction(CALCULATOR->f_sinh); CHILD(1).number() -= mstruct[1].number(); } mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_cosh) { if(mstruct[0].function() == CALCULATOR->f_sinh) { mstruct[0].setFunction(CALCULATOR->f_tanh); CHILD(1).number() += mstruct[1].number(); if(CHILD(1).number().isZero()) { set(mstruct, true); return 1; } else if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { CHILD(0).setFunction(CALCULATOR->f_sinh); mstruct[1].number() -= CHILD(1).number(); } mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_tanh) { if(mstruct[0].function() == CALCULATOR->f_sinh) { mstruct[0].setFunction(CALCULATOR->f_cosh); CHILD(1).number() += mstruct[1].number(); if(CHILD(1).number().isZero()) { set(mstruct, true); return 1; } else if(mstruct[1].number().isPositive() == CHILD(1).number().isPositive()) { CHILD(0).setFunction(CALCULATOR->f_sinh); mstruct[1].number() -= CHILD(1).number(); } mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } } else { if((CHILD(0).function() == CALCULATOR->f_tan && mstruct[0].function() == CALCULATOR->f_cos)) { // tan(x)^n*cos(x)^m=sin(x)^n*cos(x)^(m-n) CHILD(0).setFunction(CALCULATOR->f_sin); mstruct[1].number() -= CHILD(1).number(); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if((CHILD(0).function() == CALCULATOR->f_cos && mstruct[0].function() == CALCULATOR->f_tan)) { // tan(x)^n*cos(x)^m=sin(x)^n*cos(x)^(m-n) mstruct[0].setFunction(CALCULATOR->f_sin); CHILD(1).number() -= mstruct[1].number(); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if((CHILD(0).function() == CALCULATOR->f_tanh && mstruct[0].function() == CALCULATOR->f_cosh)) { // tanh(x)^n*cosh(x)^m=sinh(x)^n*cosh(x)^(m-n) CHILD(0).setFunction(CALCULATOR->f_sinh); mstruct[1].number() -= CHILD(1).number(); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if((CHILD(0).function() == CALCULATOR->f_cosh && mstruct[0].function() == CALCULATOR->f_tanh)) { // tanh(x)^n*cosh(x)^m=sinh(x)^n*cosh(x)^(m-n) mstruct[0].setFunction(CALCULATOR->f_sinh); CHILD(1).number() -= mstruct[1].number(); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } } else if(mstruct[0].isMultiplication() && mstruct[0].size() == 2 && mstruct[0][0].isMinusOne() && mstruct[0][1] == CHILD(0) && CHILD(1).representsEven()) { return 0; } break; } case STRUCT_FUNCTION: { if(eo.protected_function != CALCULATOR->f_signum && mstruct.function() == CALCULATOR->f_signum && mstruct.size() == 2 && CHILD(0).isFunction() && CHILD(0).function() == CALCULATOR->f_abs && CHILD(0).size() == 1 && mstruct[0] == CHILD(0)[0] && CHILD(1).isNumber() && CHILD(1).number().isRational() && CHILD(1).number().numeratorIsOne() && !CHILD(1).number().denominatorIsEven() && CHILD(0)[0].representsReal(true)) { setType(STRUCT_FUNCTION); setFunction(CALCULATOR->f_root); CHILD(0).setToChild(1, true); CHILD(1).number().recip(); MERGE_APPROX_AND_PREC(mstruct) return 1; } if(eo.transform_trigonometric_functions && CHILD(0).isFunction() && CHILD(0).size() == 1 && mstruct.size() == 1 && CHILD(1).isNumber() && CHILD(1).number().isNegative() && eo.protected_function != mstruct.function() && eo.protected_function != CHILD(0).function()) { if(CHILD(0).function() == CALCULATOR->f_sin) { if(mstruct.function() == CALCULATOR->f_cos && CHILD(0)[0] == mstruct[0]) { if(CHILD(1).number().isMinusOne()) { CHILD(0).setFunction(CALCULATOR->f_tan); MERGE_APPROX_AND_PREC(mstruct) return 1; } mstruct.setFunction(CALCULATOR->f_tan); mstruct.raise(nr_minus_one); CHILD(1).number()++; mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if(mstruct.function() == CALCULATOR->f_tan && CHILD(0)[0] == mstruct[0]) { if(CHILD(1).number().isMinusOne()) { CHILD(0).setFunction(CALCULATOR->f_cos); MERGE_APPROX_AND_PREC(mstruct) return 1; } mstruct.setFunction(CALCULATOR->f_cos); mstruct.raise(nr_minus_one); CHILD(1).number()++; mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_cos) { if(mstruct.function() == CALCULATOR->f_sin && CHILD(0)[0] == mstruct[0]) { if(CHILD(1).number().isMinusOne()) { CHILD(0).setFunction(CALCULATOR->f_tan); SET_CHILD_MAP(0) MERGE_APPROX_AND_PREC(mstruct) return 1; } mstruct.setFunction(CALCULATOR->f_tan); CHILD(1).number()++; mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_tan) { if(mstruct.function() == CALCULATOR->f_sin && CHILD(0)[0] == mstruct[0]) { if(CHILD(1).number().isMinusOne()) { CHILD(0).setFunction(CALCULATOR->f_cos); SET_CHILD_MAP(0) MERGE_APPROX_AND_PREC(mstruct) return 1; } mstruct.setFunction(CALCULATOR->f_cos); CHILD(1).number()++; mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_sinh) { if(mstruct.function() == CALCULATOR->f_cosh && CHILD(0)[0] == mstruct[0]) { if(CHILD(1).number().isMinusOne()) { CHILD(0).setFunction(CALCULATOR->f_tanh); MERGE_APPROX_AND_PREC(mstruct) return 1; } mstruct.setFunction(CALCULATOR->f_tanh); mstruct.raise(nr_minus_one); CHILD(1).number()++; mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if(mstruct.function() == CALCULATOR->f_tanh && CHILD(0)[0] == mstruct[0]) { if(CHILD(1).number().isMinusOne()) { CHILD(0).setFunction(CALCULATOR->f_cosh); MERGE_APPROX_AND_PREC(mstruct) return 1; } mstruct.setFunction(CALCULATOR->f_cosh); mstruct.raise(nr_minus_one); CHILD(1).number()++; mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_cosh) { if(mstruct.function() == CALCULATOR->f_sinh && CHILD(0)[0] == mstruct[0]) { if(CHILD(1).number().isMinusOne()) { CHILD(0).setFunction(CALCULATOR->f_tanh); SET_CHILD_MAP(0) MERGE_APPROX_AND_PREC(mstruct) return 1; } mstruct.setFunction(CALCULATOR->f_tanh); CHILD(1).number()++; mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if(CHILD(0).function() == CALCULATOR->f_tanh) { if(mstruct.function() == CALCULATOR->f_sinh && CHILD(0)[0] == mstruct[0]) { if(CHILD(1).number().isMinusOne()) { CHILD(0).setFunction(CALCULATOR->f_cosh); SET_CHILD_MAP(0) MERGE_APPROX_AND_PREC(mstruct) return 1; } mstruct.setFunction(CALCULATOR->f_cosh); CHILD(1).number()++; mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } } } default: { if(!mstruct.isNumber() && CHILD(1).isNumber() && CHILD(0) == mstruct) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true)) || (CHILD(1).isNumber() && CHILD(1).number().isReal() && !CHILD(1).number().isMinusOne()) || CHILD(0).representsNonZero(true) || CHILD(1).representsPositive() || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !CHILD(0).representsZero(true) && warn_about_denominators_assumed_nonzero_or_positive(CHILD(0), CHILD(1), eo))) { CHILD(1).number()++; MERGE_APPROX_AND_PREC(mstruct) calculateRaiseExponent(eo, mparent, index_this); return 1; } } if(mstruct.isNumber() && CHILD(1).isNumber() && !CHILD(1).number().includesInfinity() && CHILD(0).isNumber() && CHILD(0).number().isRational() && !CHILD(0).number().isZero() && mstruct.number().isRational()) { if(CHILD(0).isInteger() && mstruct.number().denominator() == CHILD(0).number().numerator()) { CHILD(1).number()--; MERGE_APPROX_AND_PREC(mstruct) calculateRaiseExponent(eo); if(!mstruct.number().numeratorIsOne()) calculateMultiply(mstruct.number().numerator(), eo, mparent, index_this); return 1; } else if(mstruct.number().denominator() == CHILD(0).number().numerator() && mstruct.number().numerator() == CHILD(0).number().denominator()) { CHILD(1).number()--; MERGE_APPROX_AND_PREC(mstruct) calculateRaiseExponent(eo); return 1; } } if(mstruct.isZero() && (!eo.keep_zero_units || containsType(STRUCT_UNIT, true, true) == 0 || (CHILD(0).isUnit() && CHILD(0).unit() == CALCULATOR->u_rad) || (CHILD(0).isFunction() && CHILD(0).representsNumber(false))) && !representsUndefined(true, true, !eo.assume_denominators_nonzero) && representsNonMatrix()) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } if(CHILD(0).isFunction() && mstruct.isZero() && CHILD(1).representsNumber()) { if((CHILD(0).function() == CALCULATOR->f_ln || CHILD(0).function() == CALCULATOR->f_Ei) && SIZE == 1) { if(CHILD(0)[0].representsNonZero() || warn_about_assumed_not_value(CHILD(0)[0], m_zero, eo)) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 3; } } else if(CHILD(0).function() == CALCULATOR->f_li && SIZE == 1) { if(CHILD(0).representsNumber(true) || warn_about_assumed_not_value(CHILD(0)[0], m_one, eo)) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 3; } } } break; } } return -1; } case STRUCT_FUNCTION: { if(eo.protected_function != o_function) { if(((o_function == CALCULATOR->f_abs && SIZE == 1 && CHILD(0).isFunction() && CHILD(0).function() == CALCULATOR->f_signum && CHILD(0).size() == 2) || (o_function == CALCULATOR->f_signum && SIZE == 2 && CHILD(0).isFunction() && CHILD(0).function() == CALCULATOR->f_abs && CHILD(0).size() == 1)) && (CHILD(0)[0] == mstruct || (mstruct.isFunction() && mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1 && CHILD(0)[0] == mstruct[0]) || (mstruct.isPower() && mstruct[0] == CHILD(0)[0]) || (mstruct.isPower() && mstruct[0].isFunction() && mstruct[0].function() == CALCULATOR->f_abs && mstruct[0].size() == 1 && CHILD(0)[0] == mstruct[0][0]))) { // sgn(abs(x))*x^y=x^y if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } else if(o_function == CALCULATOR->f_abs && SIZE == 1) { if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1 && mstruct[0] == CHILD(0) && CHILD(0).representsReal(true)) { // abs(x)*abs(x)=x^2 SET_CHILD_MAP(0) MERGE_APPROX_AND_PREC(mstruct) calculateRaise(nr_two, eo); return 1; } else if(mstruct.isFunction() && eo.protected_function != mstruct.function() && mstruct.function() == CALCULATOR->f_signum && mstruct.size() == 2 && mstruct[0] == CHILD(0) && CHILD(0).representsScalar()) { // sgn(x)*abs(x)=x SET_CHILD_MAP(0) MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_function == CALCULATOR->f_signum && SIZE == 2) { if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_signum && mstruct.size() == 2 && mstruct[0] == CHILD(0) && CHILD(0).representsReal(true)) { if(mstruct[1].isOne() && CHILD(1).isOne()) { set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct[1] == CHILD(1)) { // sgn(x)*sgn(x)=sgn(abs(x)) CHILD(0).transform(CALCULATOR->f_abs); CHILD_UPDATED(0) MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(mstruct.isFunction() && eo.protected_function != mstruct.function() && mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1 && mstruct[0] == CHILD(0) && CHILD(0).representsScalar()) { // sgn(x)*abs(x)=x SET_CHILD_MAP(0) MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct == CHILD(0) && CHILD(0).representsReal(true)) { // sgn(x)*x=abs(x) setFunction(CALCULATOR->f_abs); ERASE(1) return 1; } else if(mstruct.isPower() && mstruct[1].representsOdd() && mstruct[0] == CHILD(0) && CHILD(0).representsReal(true)) { //sgn(x)*x^3=abs(x)^3 mstruct[0].transform(STRUCT_FUNCTION); mstruct[0].setFunction(CALCULATOR->f_abs); if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 1; } } else if(o_function == CALCULATOR->f_root && THIS_VALID_ROOT) { if(CHILD(0) == mstruct && CHILD(0).representsReal(true) && CHILD(1).number().isOdd()) { // root(x, 3)*x=abs(x)^(1/3)*x CHILD(0).transform(STRUCT_FUNCTION); CHILD(0).setFunction(CALCULATOR->f_abs); CHILD(1).number().recip(); m_type = STRUCT_POWER; mstruct.transform(STRUCT_FUNCTION); mstruct.setFunction(CALCULATOR->f_abs); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if(mstruct.isPower() && mstruct[1].representsOdd() && CHILD(0) == mstruct[0] && CHILD(0).representsReal(true) && CHILD(1).number().isOdd()) { // root(x, 3)*x^3=abs(x)^(1/3)*x^3 CHILD(0).transform(STRUCT_FUNCTION); CHILD(0).setFunction(CALCULATOR->f_abs); CHILD(1).number().recip(); m_type = STRUCT_POWER; mstruct[0].transform(STRUCT_FUNCTION); mstruct[0].setFunction(CALCULATOR->f_abs); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } else if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_root && VALID_ROOT(mstruct) && CHILD(0) == mstruct[0] && CHILD(0).representsReal(true) && CHILD(1).number().isOdd() && mstruct[1].number().isOdd()) { // root(x, y)*root(x, z)=abs(x)^(1/y)*abs(x)^(1/z) CHILD(0).transform(STRUCT_FUNCTION); CHILD(0).setFunction(CALCULATOR->f_abs); CHILD(1).number().recip(); m_type = STRUCT_POWER; mstruct[0].transform(STRUCT_FUNCTION); mstruct[0].setFunction(CALCULATOR->f_abs); mstruct[1].number().recip(); mstruct.setType(STRUCT_POWER); mstruct.ref(); multiply_nocopy(&mstruct); calculateMultiplyLast(eo); return 1; } } else if((o_function == CALCULATOR->f_ln || o_function == CALCULATOR->f_Ei) && SIZE == 1 && mstruct.isZero()) { if(CHILD(0).representsNonZero() || warn_about_assumed_not_value(CHILD(0), m_zero, eo)) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 3; } } else if(o_function == CALCULATOR->f_li && SIZE == 1 && mstruct.isZero()) { if(representsNumber(true) || warn_about_assumed_not_value(CHILD(0), m_one, eo)) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 3; } } else if(eo.transform_trigonometric_functions && mstruct.isFunction() && mstruct.size() == 1 && eo.protected_function != mstruct.function()) { if(o_function == CALCULATOR->f_tan && SIZE == 1) { if(mstruct.function() == CALCULATOR->f_cos && mstruct[0] == CHILD(0)) { // tan(x)*cos(x)=sin(x) setFunction(CALCULATOR->f_sin); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_function == CALCULATOR->f_cos && SIZE == 1) { if(mstruct.function() == CALCULATOR->f_tan && mstruct[0] == CHILD(0)) { // tan(x)*cos(x)=sin(x) setFunction(CALCULATOR->f_sin); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.function() == CALCULATOR->f_sin && mstruct[0] == CHILD(0)) { // cos(x)*sin(x)=sin(2x)/2 setFunction(CALCULATOR->f_sin); CHILD(0).calculateMultiply(nr_two, eo); CHILD_UPDATED(0) calculateDivide(nr_two, eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_function == CALCULATOR->f_sin && SIZE == 1) { if(mstruct.function() == CALCULATOR->f_cos && mstruct[0] == CHILD(0)) { // cos(x)*sin(x)=sin(2x)/2 setFunction(CALCULATOR->f_sin); CHILD(0).calculateMultiply(nr_two, eo); CHILD_UPDATED(0) calculateDivide(nr_two, eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_function == CALCULATOR->f_tanh && SIZE == 1) { if(mstruct.function() == CALCULATOR->f_cosh && mstruct[0] == CHILD(0)) { // tanh(x)*cosh(x)=sinh(x) setFunction(CALCULATOR->f_sinh); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_function == CALCULATOR->f_sinh && SIZE == 1) { if(mstruct.function() == CALCULATOR->f_cosh && mstruct[0] == CHILD(0)) { // cosh(x)*sinh(x)=sinh(2x)/2 setFunction(CALCULATOR->f_sinh); CHILD(0).calculateMultiply(nr_two, eo); CHILD_UPDATED(0) calculateDivide(nr_two, eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_function == CALCULATOR->f_cosh && SIZE == 1) { if(mstruct.function() == CALCULATOR->f_tanh && mstruct[0] == CHILD(0)) { // tanh(x)*cosh(x)=sinh(x) setFunction(CALCULATOR->f_sinh); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.function() == CALCULATOR->f_sinh && mstruct[0] == CHILD(0)) { // cosh(x)*sinh(x)=sinh(2x)/2 setFunction(CALCULATOR->f_sinh); CHILD(0).calculateMultiply(nr_two, eo); CHILD_UPDATED(0) calculateDivide(nr_two, eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } } default: { switch(mstruct.type()) { case STRUCT_VECTOR: {} case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: {} case STRUCT_POWER: { return 0; } case STRUCT_COMPARISON: { if(isComparison()) { mstruct.ref(); transform_nocopy(STRUCT_LOGICAL_AND, &mstruct); return 1; } } default: { if(mstruct.isZero() && (!eo.keep_zero_units || containsType(STRUCT_UNIT, false, true) <= 0 || (isUnit() && unit() == CALCULATOR->u_rad) || (isFunction() && representsNumber(false))) && !representsUndefined(true, true, !eo.assume_denominators_nonzero) && representsNonMatrix()) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 3; } if(isZero() && !mstruct.representsUndefined(true, true, !eo.assume_denominators_nonzero) && (!eo.keep_zero_units || mstruct.containsType(STRUCT_UNIT, false, true) <= 0 || (mstruct.isUnit() && mstruct.unit() == CALCULATOR->u_rad)) && mstruct.representsNonMatrix()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(equals(mstruct)) { if(mstruct.isUnit() && mstruct.prefix()) o_prefix = mstruct.prefix(); raise_nocopy(new MathStructure(2, 1, 0)); MERGE_APPROX_AND_PREC(mstruct) calculateRaiseExponent(eo, mparent, index_this); return 1; } break; } } break; } } return -1; } bool test_if_numerator_not_too_large(Number &vb, Number &ve) { if(!vb.isRational()) return false; if(!mpz_fits_slong_p(mpq_numref(ve.internalRational()))) return false; long int exp = labs(mpz_get_si(mpq_numref(ve.internalRational()))); if(vb.isRational()) { if((long long int) exp * mpz_sizeinbase(mpq_numref(vb.internalRational()), 10) <= 1000000LL && (long long int) exp * mpz_sizeinbase(mpq_denref(vb.internalRational()), 10) <= 1000000LL) return true; } return false; } bool is_negation(const MathStructure &m1, const MathStructure &m2) { if(m1.isAddition() && m2.isAddition() && m1.size() == m2.size()) { for(size_t i = 0; i < m1.size(); i++) { if(!is_negation(m1[i], m2[i])) return false; } return true; } if(m1.isNumber() && m2.isNumber()) { return m1.number() == -m2.number(); } if(m1.isMultiplication() && m1.size() > 1) { if(m1[0].isNumber()) { if(m1[0].number().isMinusOne()) { if(m1.size() == 2) return m1[1] == m2; if(m2.isMultiplication() && m2.size() == m1.size() - 1) { for(size_t i = 1; i < m1.size(); i++) { if(!m1[i].equals(m2[i - 1], true, true)) return false; } return true; } return false; } else { if(m2.isMultiplication() && m2.size() == m1.size() && m2[0].isNumber()) { for(size_t i = 1; i < m1.size(); i++) { if(!m1[i].equals(m2[i], true, true)) return false; } return m1[0].number().equals(-m2[0].number(), true, true); } return false; } } } if(m2.isMultiplication() && m2.size() > 1) { if(m2[0].isNumber()) { if(m2[0].number().isMinusOne()) { if(m2.size() == 2) return m2[1] == m1; if(m1.isMultiplication() && m1.size() == m2.size() - 1) { for(size_t i = 1; i < m2.size(); i++) { if(!m2[i].equals(m1[i - 1], true, true)) return false; } return true; } return false; } } } return false; } int MathStructure::merge_power(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { // number^number Number nr(o_number); if(nr.raise(mstruct.number(), eo.approximation < APPROXIMATION_APPROXIMATE) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || o_number.includesInfinity() || mstruct.number().includesInfinity())) { // Exponentiation succeeded without inappropriate change in approximation status if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } if(!o_number.isMinusOne() && !o_number.isOne() && mstruct.number().isRational() && !mstruct.isInteger()) { if(o_number.isNegative()) { MathStructure mtest(*this); if(mtest.number().negate() && mtest.calculateRaise(mstruct, eo)) { set(mtest); MathStructure *mmul = new MathStructure(-1, 1, 0); mmul->calculateRaise(mstruct, eo); multiply_nocopy(mmul); calculateMultiplyLast(eo); return 1; } } else { Number exp_num(mstruct.number().numerator()); if(!exp_num.isOne() && !exp_num.isMinusOne() && o_number.isPositive() && test_if_numerator_not_too_large(o_number, exp_num)) { // Try raise by exponent numerator if not very large nr = o_number; if(nr.raise(exp_num, eo.approximation < APPROXIMATION_APPROXIMATE) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || o_number.includesInfinity() || mstruct.number().includesInfinity())) { o_number = nr; numberUpdated(); nr.set(mstruct.number().denominator()); nr.recip(); calculateRaise(nr, eo, mparent, index_this); return 1; } } if(o_number.isPositive()) { Number nr_root(mstruct.number().denominator()); if(eo.split_squares && o_number.isInteger() && nr_root.isLessThanOrEqualTo(LARGEST_RAISED_PRIME_EXPONENT)) { int root = nr_root.intValue(); nr.set(1, 1, 0); bool b = true, overflow; long int val; while(b) { if(CALCULATOR->aborted()) break; b = false; overflow = false; val = o_number.lintValue(&overflow); if(overflow) { mpz_srcptr cval = mpq_numref(o_number.internalRational()); for(size_t i = 0; root == 2 ? (i < NR_OF_SQUARE_PRIMES) : (RAISED_PRIMES[root - 3][i] != 0); i++) { if(CALCULATOR->aborted()) break; if(mpz_divisible_ui_p(cval, (unsigned long int) (root == 2 ? SQUARE_PRIMES[i] : RAISED_PRIMES[root - 3][i]))) { nr *= PRIMES[i]; o_number /= (root == 2 ? SQUARE_PRIMES[i] : RAISED_PRIMES[root - 3][i]); b = true; break; } } } else { for(size_t i = 0; root == 2 ? (i < NR_OF_SQUARE_PRIMES) : (RAISED_PRIMES[root - 3][i] != 0); i++) { if(CALCULATOR->aborted()) break; if((root == 2 ? SQUARE_PRIMES[i] : RAISED_PRIMES[root - 3][i]) > val) { break; } else if(val % (root == 2 ? SQUARE_PRIMES[i] : RAISED_PRIMES[root - 3][i]) == 0) { nr *= PRIMES[i]; o_number /= (root == 2 ? SQUARE_PRIMES[i] : RAISED_PRIMES[root - 3][i]); b = true; break; } } } } if(!nr.isOne()) { transform(STRUCT_MULTIPLICATION); CHILD(0).calculateRaise(mstruct, eo, this, 0); PREPEND(nr); if(!mstruct.number().numeratorIsOne()) { CHILD(0).calculateRaise(mstruct.number().numerator(), eo, this, 0); } calculateMultiplyIndex(0, eo, true, mparent, index_this); return 1; } } if(eo.split_squares && nr_root != 2) { // partial roots, e.g. 9^(1/4)=3^(1/2) if(nr_root.isEven()) { Number nr(o_number); if(nr.sqrt() && !nr.isApproximate()) { o_number = nr; mstruct.number().multiply(2); mstruct.ref(); raise_nocopy(&mstruct); calculateRaiseExponent(eo, mparent, index_this); return 1; } } for(size_t i = 1; i < NR_OF_PRIMES; i++) { if(nr_root.isLessThanOrEqualTo(PRIMES[i])) break; if(nr_root.isIntegerDivisible(PRIMES[i])) { Number nr(o_number); if(nr.root(Number(PRIMES[i], 1)) && !nr.isApproximate()) { o_number = nr; mstruct.number().multiply(PRIMES[i]); mstruct.ref(); raise_nocopy(&mstruct); calculateRaiseExponent(eo, mparent, index_this); return 1; } } } } } } } if(o_number.isMinusOne() && mstruct.number().isRational()) { if(mstruct.number().isInteger()) { if(mstruct.number().isEven()) set(m_one, true); else set(m_minus_one, true); MERGE_APPROX_AND_PREC(mstruct) return 1; } else { Number nr_floor(mstruct.number()); nr_floor.floor(); if(mstruct.number().denominatorIsTwo()) { if(nr_floor.isEven()) set(nr_one_i, true); else set(nr_minus_i, true); MERGE_APPROX_AND_PREC(mstruct) return 1; } else { mstruct.number() -= nr_floor; mstruct.numberUpdated(); if(mstruct.number().denominator() == 3) { set(3, 1, 0, true); calculateRaise(nr_half, eo); if(nr_floor.isEven()) calculateMultiply(nr_one_i, eo); else calculateMultiply(nr_minus_i, eo); calculateMultiply(nr_half, eo); if(nr_floor.isEven() == mstruct.number().numeratorIsOne()) calculateAdd(nr_half, eo); else calculateAdd(nr_minus_half, eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.number().denominator() == 4) { if(nr_floor.isEven() == mstruct.number().numeratorIsOne()) set(1, 1, 0, true); else set(-1, 1, 0, true); if(nr_floor.isEven()) calculateAdd(nr_one_i, eo); else calculateAdd(nr_minus_i, eo); multiply(nr_two); LAST.calculateRaise(nr_minus_half, eo); calculateMultiplyLast(eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(!nr_floor.isZero()) { mstruct.ref(); raise_nocopy(&mstruct); calculateRaiseExponent(eo); if(nr_floor.isOdd()) calculateNegate(eo); return 1; } } } } if(o_number.isRational() && !o_number.isInteger() && !o_number.numeratorIsOne() && mstruct.number().isRational()) { Number num(o_number.numerator()); Number den(o_number.denominator()); set(num, true); calculateRaise(mstruct, eo); multiply(den); LAST.calculateRaise(mstruct, eo); LAST.calculateInverse(eo); calculateMultiplyLast(eo); return 1; } // If base numerator is larger than denominator, invert base and negate exponent if(o_number.isRational() && !o_number.isInteger() && !o_number.isZero() && ((o_number.isNegative() && o_number.isGreaterThan(nr_minus_one) && mstruct.number().isInteger()) || (o_number.isPositive() && o_number.isLessThan(nr_one)))) { mstruct.number().negate(); o_number.recip(); return 0; } return -1; } if(mstruct.isOne()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(isOne() && mstruct.representsNumber()) { MERGE_APPROX_AND_PREC(mstruct) return 1; } if(m_type == STRUCT_NUMBER && o_number.isInfinite(false)) { if(mstruct.representsNegative(false)) { o_number.clear(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.representsNonZero(false) && mstruct.representsPositive(false)) { if(o_number.isMinusInfinity()) { if(mstruct.representsEven(false)) { o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.representsOdd(false)) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_number.isPlusInfinity()) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } CALCULATOR->beginTemporaryEnableIntervalArithmetic(); CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(mstruct); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.calculateFunctions(eo2); mtest.calculatesub(eo2, eo2); CALCULATOR->endTemporaryStopMessages(); CALCULATOR->endTemporaryEnableIntervalArithmetic(); if(mtest.representsNegative(false)) { o_number.clear(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mtest.representsNonZero(false) && mtest.representsPositive(false)) { if(o_number.isMinusInfinity()) { if(mstruct.representsEven(false)) { o_number.setPlusInfinity(); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.representsOdd(false)) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(o_number.isPlusInfinity()) { MERGE_APPROX_AND_PREC(mstruct) return 1; } } } else if(mstruct.isNumber() && mstruct.number().isInfinite(false)) { CALCULATOR->beginTemporaryEnableIntervalArithmetic(); CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(*this); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.calculateFunctions(eo2); mtest.calculatesub(eo2, eo2); CALCULATOR->endTemporaryStopMessages(); CALCULATOR->endTemporaryEnableIntervalArithmetic(); if(mtest.isNumber()) { if(mtest.merge_power(mstruct, eo) > 0 && mtest.isNumber()) { if(mtest.number().isPlusInfinity()) { set(nr_plus_inf, true); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mtest.number().isMinusInfinity()) { set(nr_minus_inf, true); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mtest.number().isZero()) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } if(representsUndefined() || mstruct.representsUndefined()) return -1; if(isZero() && mstruct.representsPositive()) { return 1; } if(mstruct.isZero() && !representsUndefined(true, true)) { set(m_one); MERGE_APPROX_AND_PREC(mstruct) return 1; } switch(m_type) { case STRUCT_VECTOR: { if(mstruct.isNumber() && mstruct.number().isInteger()) { if(isMatrix()) { if(matrixIsSquare()) { Number nr(mstruct.number()); bool b_neg = false; if(nr.isNegative()) { nr.setNegative(false); b_neg = true; } if(!nr.isOne()) { MathStructure msave(*this); nr--; while(nr.isPositive()) { if(CALCULATOR->aborted()) { set(msave); return -1; } calculateMultiply(msave, eo); nr--; } } if(b_neg) { invertMatrix(eo); } MERGE_APPROX_AND_PREC(mstruct) return 1; } return -1; } else { if(mstruct.number().isMinusOne()) { return -1; } Number nr(mstruct.number()); if(nr.isNegative()) { nr++; } else { nr--; } MathStructure msave(*this); calculateMultiply(msave, eo); calculateRaise(nr, eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } goto default_power_merge; } case STRUCT_ADDITION: { if(mstruct.isNumber() && mstruct.number().isInteger() && containsType(STRUCT_DATETIME, false, true, false) <= 0) { if(eo.reduce_divisions && mstruct.number().isMinusOne()) { int bnum = -1, bden = -1; int inegs = 0; bool b_break = false; for(size_t i = 0; i < SIZE && !b_break; i++) { switch(CHILD(i).type()) { case STRUCT_NUMBER: { if(!CHILD(i).number().isRational() || CHILD(i).number().numeratorIsGreaterThan(1000000L) || CHILD(i).number().numeratorIsLessThan(-1000000L) || CHILD(i).number().denominatorIsGreaterThan(1000L)) { bnum = 0; bden = 0; inegs = 0; b_break = true; } if(bden != 0 && !CHILD(i).number().isInteger()) bden = 1; if(bnum != 0 && !CHILD(i).isZero()) { if(CHILD(i).number().numeratorIsOne() || CHILD(i).number().numeratorIsMinusOne()) bnum = 0; else bnum = 1; } if(CHILD(i).number().isNegative()) { inegs++; if(i == 0) inegs++; } else if(!CHILD(i).number().isZero()) inegs--; break; } case STRUCT_MULTIPLICATION: { if(CHILD(i).size() > 0 && CHILD(i)[0].isNumber()) { if(!CHILD(i)[0].number().isRational() || CHILD(i)[0].number().numeratorIsGreaterThan(1000000L) || CHILD(i)[0].number().numeratorIsLessThan(-1000000L) || CHILD(i)[0].number().denominatorIsGreaterThan(1000L)) { bnum = 0; bden = 0; inegs = 0; b_break = true; } if(bden != 0 && !CHILD(i)[0].number().isInteger()) bden = 1; if(bnum != 0 && !CHILD(i)[0].isZero()) { if(CHILD(i)[0].number().numeratorIsOne() || CHILD(i)[0].number().numeratorIsMinusOne()) bnum = 0; else bnum = 1; } if(CHILD(i)[0].number().isNegative()) { inegs++; if(i == 0) inegs++; } else if(!CHILD(i)[0].number().isZero()) inegs--; break; } } default: { bnum = 0; inegs--; break; } } } if(bden < 0) bden = 0; if(bnum < 0) bnum = 0; if(bnum || bden) { Number nr_num, nr_den(1, 1, 0); for(size_t i = 0; i < SIZE && !nr_den.isZero(); i++) { switch(CHILD(i).type()) { case STRUCT_NUMBER: { if(CHILD(i).number().isInteger()) { if(bnum && !nr_num.isOne() && !CHILD(i).number().isZero()) { if(nr_num.isZero()) nr_num = CHILD(i).number(); else nr_num.gcd(CHILD(i).number()); } } else { if(bnum && !nr_num.isOne() && !CHILD(i).number().isZero()) { if(nr_num.isZero()) nr_num = CHILD(i).number().numerator(); else nr_num.gcd(CHILD(i).number().numerator()); } if(bden) { nr_den.lcm(CHILD(i).number().denominator()); if(nr_den.isGreaterThan(1000000L)) nr_den.clear(); } } break; } case STRUCT_MULTIPLICATION: { if(CHILD(i).size() > 0 && CHILD(i)[0].isNumber()) { if(CHILD(i)[0].number().isInteger()) { if(bnum && !nr_num.isOne() && !CHILD(i)[0].number().isZero()) { if(nr_num.isZero()) nr_num = CHILD(i)[0].number(); else nr_num.gcd(CHILD(i)[0].number()); } } else { if(bnum && !nr_num.isOne() && !CHILD(i)[0].number().isZero()) { if(nr_num.isZero()) nr_num = CHILD(i)[0].number().numerator(); else nr_num.gcd(CHILD(i)[0].number().numerator()); } if(bden) { nr_den.lcm(CHILD(i)[0].number().denominator()); if(nr_den.isGreaterThan(1000000L)) nr_den.clear(); } } break; } } default: { break; } } } if(!nr_den.isZero() && (!nr_den.isOne() || !nr_num.isOne())) { Number nr(nr_den); nr.divide(nr_num); nr.setNegative(inegs > 0); for(size_t i = 0; i < SIZE; i++) { switch(CHILD(i).type()) { case STRUCT_NUMBER: { CHILD(i).number() *= nr; break; } case STRUCT_MULTIPLICATION: { if(CHILD(i).size() > 0 && CHILD(i)[0].isNumber()) { CHILD(i)[0].number() *= nr; CHILD(i).calculateMultiplyIndex(0, eo, true, this, i); break; } } default: { CHILD(i).calculateMultiply(nr, eo); } } } calculatesub(eo, eo, false); mstruct.ref(); raise_nocopy(&mstruct); calculateRaiseExponent(eo); calculateMultiply(nr, eo, mparent, index_this); return 1; } } if(inegs > 0) { for(size_t i = 0; i < SIZE; i++) { switch(CHILD(i).type()) { case STRUCT_NUMBER: {CHILD(i).number().negate(); break;} case STRUCT_MULTIPLICATION: { if(CHILD(i).size() > 0 && CHILD(i)[0].isNumber()) { CHILD(i)[0].number().negate(); CHILD(i).calculateMultiplyIndex(0, eo, true, this, i); break; } } default: { CHILD(i).calculateNegate(eo); } } } mstruct.ref(); raise_nocopy(&mstruct); negate(); return 1; } } else if(eo.expand != 0 && !mstruct.number().isZero() && (eo.expand > -2 || !containsInterval())) { bool b = true; bool neg = mstruct.number().isNegative(); Number m(mstruct.number()); m.setNegative(false); if(SIZE > 1) { if(eo.expand == -1) { switch(SIZE) { case 4: {if(m.isGreaterThan(3)) {b = false;} break;} case 3: {if(m.isGreaterThan(4)) {b = false;} break;} case 2: {if(m.isGreaterThan(10)) {b = false;} break;} default: { if(SIZE > 8 || m.isGreaterThan(2)) b = false; } } } else { b = false; long int i_pow = m.lintValue(&b); if(b || i_pow > 300) { b = false; } else { Number num_terms; if(num_terms.binomial(i_pow + (long int) SIZE - 1, (long int) SIZE - 1)) { size_t tc = countTotalChildren() / SIZE; if(tc <= 4) tc = 0; else tc -= 4; b = num_terms.isLessThanOrEqualTo(tc > 1 ? 300 / tc : 300); } } } } if(b) { if(!representsNonMatrix()) { MathStructure mthis(*this); while(!m.isOne()) { if(CALCULATOR->aborted()) { set(mthis); goto default_power_merge; } calculateMultiply(mthis, eo); m--; } } else { MathStructure mstruct1(CHILD(0)); MathStructure mstruct2(CHILD(1)); for(size_t i = 2; i < SIZE; i++) { if(CALCULATOR->aborted()) goto default_power_merge; mstruct2.add(CHILD(i), true); } Number k(1); Number p1(m); Number p2(1); p1--; Number bn; MathStructure msave(*this); CLEAR APPEND(mstruct1); CHILD(0).calculateRaise(m, eo); while(k.isLessThan(m)) { if(CALCULATOR->aborted() || !bn.binomial(m, k)) { set(msave); goto default_power_merge; } APPEND_NEW(bn); LAST.multiply(mstruct1); if(!p1.isOne()) { LAST[1].raise_nocopy(new MathStructure(p1)); LAST[1].calculateRaiseExponent(eo); } LAST.multiply(mstruct2, true); if(!p2.isOne()) { LAST[2].raise_nocopy(new MathStructure(p2)); LAST[2].calculateRaiseExponent(eo); } LAST.calculatesub(eo, eo, false); k++; p1--; p2++; } APPEND(mstruct2); LAST.calculateRaise(m, eo); calculatesub(eo, eo, false); } if(neg) calculateInverse(eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } goto default_power_merge; } case STRUCT_MULTIPLICATION: { if(mstruct.representsInteger()) { // (xy)^a=x^a*y^a for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateRaise(mstruct, eo); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } else if(!mstruct.isInfinite()) { // (-5xy)^z=5^z*x^z*(-y)^z && x >= 0 && y<0 MathStructure mnew; mnew.setType(STRUCT_MULTIPLICATION); for(size_t i = 0; i < SIZE;) { if(CHILD(i).representsNonNegative(true)) { CHILD(i).ref(); mnew.addChild_nocopy(&CHILD(i)); ERASE(i); } else if(CHILD(i).isNumber() && CHILD(i).number().isNegative() && !CHILD(i).number().isMinusOne()) { // (-5)^z=5^z*(-1)^z CHILD(i).number().negate(); mnew.addChild(CHILD(i)); CHILD(i).number().set(-1, 1, 0); i++; } else { i++; } } if(mnew.size() > 0) { if(SIZE > 0) { if(SIZE == 1) SET_CHILD_MAP(0) mnew.addChild(*this); } set_nocopy(mnew, true); for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateRaise(mstruct, eo); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false, mparent, index_this); return 1; } } goto default_power_merge; } case STRUCT_POWER: { if((eo.allow_complex && CHILD(1).representsFraction()) || (mstruct.representsInteger() && (eo.allow_complex || CHILD(0).representsInteger())) || representsNonNegative(true)) { if((((!eo.assume_denominators_nonzero || eo.warn_about_denominators_assumed_nonzero) && !CHILD(0).representsNonZero(true)) || CHILD(0).isZero()) && CHILD(1).representsNegative(true) && CHILD(1).representsNegative(true)) { if(!eo.assume_denominators_nonzero || CHILD(0).isZero() || !warn_about_denominators_assumed_nonzero(CHILD(0), eo)) break; } if(!CHILD(1).representsNonInteger() && !mstruct.representsInteger()) { if(CHILD(1).representsEven() && CHILD(0).representsReal(true)) { if(CHILD(0).representsNegative(true)) { CHILD(0).calculateNegate(eo); } else if(!CHILD(0).representsNonNegative(true)) { MathStructure mstruct_base(CHILD(0)); CHILD(0).set(CALCULATOR->f_abs, &mstruct_base, NULL); } } else if(!CHILD(1).representsOdd() && !CHILD(0).representsNonNegative(true)) { goto default_power_merge; } } mstruct.ref(); MERGE_APPROX_AND_PREC(mstruct) CHILD(1).multiply_nocopy(&mstruct, true); CHILD(1).calculateMultiplyLast(eo, true, this, 1); calculateRaiseExponent(eo, mparent, index_this); return 1; } if(mstruct.isNumber() && CHILD(0).isVariable() && CHILD(0).variable() == CALCULATOR->v_e && CHILD(1).isNumber() && CHILD(1).number().hasImaginaryPart() && !CHILD(1).number().hasRealPart() && mstruct.number().isReal()) { CALCULATOR->beginTemporaryEnableIntervalArithmetic(); CALCULATOR->beginTemporaryStopMessages(); Number nr(*CHILD(1).number().internalImaginary()); nr.add(CALCULATOR->v_pi->get().number()); nr.divide(CALCULATOR->v_pi->get().number() * 2); Number nr_u(nr.upperEndPoint()); nr = nr.lowerEndPoint(); CALCULATOR->endTemporaryEnableIntervalArithmetic(); nr_u.floor(); nr.floor(); if(!CALCULATOR->endTemporaryStopMessages() && nr == nr_u) { nr.setApproximate(false); nr *= 2; nr.negate(); nr *= nr_one_i; if(!nr.isZero()) { CHILD(1) += nr; CHILD(1).last() *= CALCULATOR->v_pi; } mstruct.ref(); CHILD(1).multiply_nocopy(&mstruct, true); CHILD(1).calculateMultiplyLast(eo, true, this, 1); calculateRaiseExponent(eo, mparent, index_this); return true; } } goto default_power_merge; } case STRUCT_VARIABLE: { if(o_variable == CALCULATOR->v_e) { if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isNumber()) { if(mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi) { if(mstruct[0].number().isI() || mstruct[0].number().isMinusI()) { //e^(i*pi)=-1 set(m_minus_one, true); return 1; } else if(mstruct[0].number().hasImaginaryPart() && !mstruct[0].number().hasRealPart() && mstruct[0].number().internalImaginary()->isRational()) { // e^(a*i*pi)=(-1)^(a) set(-1, 1, 0, true); calculateRaise(*mstruct[0].number().internalImaginary(), eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } else if(mstruct[0].number().isI() && mstruct[1].isFunction() && mstruct[1].function() == CALCULATOR->f_atan && mstruct[1].size() == 1 && !mstruct[1][0].containsUnknowns() && ((eo.expand != 0 && eo.expand > -2) || !mstruct[1][0].containsInterval(true, false, false, eo.expand == -2))) { set(mstruct[1][0], true); calculateRaise(nr_two, eo); calculateAdd(m_one, eo); calculateRaise(nr_half, eo); calculateInverse(eo); multiply(mstruct[1][0]); LAST.calculateMultiply(nr_one_i, eo); LAST.calculateAdd(m_one, eo); calculateMultiplyLast(eo); MERGE_APPROX_AND_PREC(mstruct) return true; } } else if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_ln && mstruct.size() == 1) { if(mstruct[0].representsNumber() && (eo.allow_infinite || mstruct[0].representsNonZero())) { // e^ln(x)=x; x!=0 set_nocopy(mstruct[0], true); return 1; } } } goto default_power_merge; } case STRUCT_FUNCTION: { if(eo.protected_function != o_function) { if(o_function == CALCULATOR->f_abs && SIZE == 1) { if(mstruct.representsEven() && CHILD(0).representsReal(true)) { // abs(x)^2=x^2 SET_CHILD_MAP(0); mstruct.ref(); raise_nocopy(&mstruct); calculateRaiseExponent(eo); return 1; } } else if(o_function == CALCULATOR->f_signum && CHILD(0).representsReal(true) && SIZE == 2 && ((CHILD(1).isZero() && mstruct.representsPositive()) || CHILD(1).isOne())) { if(mstruct.representsOdd()) { // sgn(x)^3=sgn(x) MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.representsEven()) { if(CHILD(1).isOne() && CHILD(0).representsReal(true)) { SET_CHILD_MAP(0) return 1; } else { // sgn(x)^2=sgn(abs(x)) CHILD(0).transform(CALCULATOR->f_abs); CHILD_UPDATED(0) MERGE_APPROX_AND_PREC(mstruct) return 1; } } } else if(o_function == CALCULATOR->f_root && THIS_VALID_ROOT) { if(mstruct.representsEven() && CHILD(0).representsReal(true) && CHILD(1).number().isOdd()) { // root(x, 3)^2=abs(x)^(3/2) CHILD(0).transform(STRUCT_FUNCTION); CHILD(0).setFunction(CALCULATOR->f_abs); CHILD(1).number().recip(); m_type = STRUCT_POWER; mstruct.ref(); raise_nocopy(&mstruct); calculateRaiseExponent(eo); return 1; } else if(mstruct.isNumber() && mstruct.number().isInteger() && !mstruct.number().isMinusOne()) { if(mstruct == CHILD(1)) { // root(x, a)^a=x SET_CHILD_MAP(0) MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(mstruct.number().isIntegerDivisible(CHILD(1).number())) { // root(x, a)^(2a)=x^2 mstruct.calculateDivide(CHILD(1).number(), eo); mstruct.ref(); SET_CHILD_MAP(0) raise_nocopy(&mstruct); return 1; } else if(CHILD(1).number().isIntegerDivisible(mstruct.number())) { // root(x, 3a)^(a)=root(x, 3) Number nr(CHILD(1).number()); if(nr.divide(mstruct.number())) { CHILD(1) = nr; CHILD_UPDATED(1) MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } } goto default_power_merge; } default: { default_power_merge: if(mstruct.isAddition()) { bool b = representsNonNegative(true); if(!b) { b = true; bool bneg = representsNegative(true); for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsInteger() && (!bneg || !eo.allow_complex || !mstruct[i].isNumber() || !mstruct[i].number().isRational() || !mstruct[i].number().denominatorIsEven())) { b = false; break; } } } if(b) { MathStructure msave(*this); clear(true); m_type = STRUCT_MULTIPLICATION; MERGE_APPROX_AND_PREC(mstruct) for(size_t i = 0; i < mstruct.size(); i++) { APPEND(msave); mstruct[i].ref(); LAST.raise_nocopy(&mstruct[i]); LAST.calculateRaiseExponent(eo); calculateMultiplyLast(eo, false); } if(SIZE == 1) { setToChild(1, false, mparent, index_this + 1); } else if(SIZE == 0) { clear(true); } else { evalSort(); } return 1; } } else if(mstruct.isMultiplication() && mstruct.size() > 1) { bool b = representsNonNegative(true); if(!b) { b = true; for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsInteger()) { b = false; break; } } } if(b) { MathStructure mthis(*this); for(size_t i = 0; i < mstruct.size(); i++) { if(i == 0) mthis.raise(mstruct[i]); if(!mstruct[i].representsReal(true) || (isZero() && !mstruct[i].representsPositive(true))) continue; if(i > 0) mthis[1] = mstruct[i]; EvaluationOptions eo2 = eo; eo2.split_squares = false; // avoid abs(x)^(2y) loop if(mthis.calculateRaiseExponent(eo2) && (!mthis.isPower() || ((!isFunction() || o_function != CALCULATOR->f_abs || SIZE != 1 || !CHILD(0).equals(mthis[0], true, true)) && (!is_negation(mthis[0], *this))))) { set(mthis); if(mstruct.size() == 2) { if(i == 0) { mstruct[1].ref(); raise_nocopy(&mstruct[1]); } else { mstruct[0].ref(); raise_nocopy(&mstruct[0]); } } else { mstruct.ref(); raise_nocopy(&mstruct); CHILD(1).delChild(i + 1); } calculateRaiseExponent(eo); MERGE_APPROX_AND_PREC(mstruct) return 1; } } } } else if(mstruct.isNumber() && mstruct.number().isRational() && !mstruct.number().isInteger() && !mstruct.number().numeratorIsOne() && !mstruct.number().numeratorIsMinusOne()) { if(representsNonNegative(true) && (m_type != STRUCT_FUNCTION || o_function != CALCULATOR->f_abs)) { if(isMultiplication() && SIZE == 2 && CHILD(0).isMinusOne() && mstruct.number().numeratorIsEven()) { bool b; if(mstruct.number().isNegative()) { MathStructure mtest(CHILD(1)); b = mtest.calculateRaise(-mstruct.number().numerator(), eo); if(b && mtest.isPower() && mtest[1] == -mstruct.number().numerator()) b = false; if(!b) break; set(mtest, true); raise(m_minus_one); CHILD(1).number() /= mstruct.number().denominator(); } else { MathStructure mtest(CHILD(1)); b = mtest.calculateRaise(mstruct.number().numerator(), eo); if(b && mtest.isPower() && mtest[1] == mstruct.number().numerator()) b = false; if(!b) break; set(mtest, true); raise(m_one); CHILD(1).number() /= mstruct.number().denominator(); } if(b) calculateRaiseExponent(eo); return 1; } bool b; if(mstruct.number().isNegative()) { b = calculateRaise(-mstruct.number().numerator(), eo); if(!b) { setToChild(1); break; } raise(m_minus_one); CHILD(1).number() /= mstruct.number().denominator(); } else { b = calculateRaise(mstruct.number().numerator(), eo); if(!b) { setToChild(1); break; } raise(m_one); CHILD(1).number() /= mstruct.number().denominator(); } if(b) calculateRaiseExponent(eo); return 1; } } break; } } return -1; } int MathStructure::merge_logical_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool) { if(equals(mstruct, true, true)) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(mstruct.representsPositive()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } if(mstruct.representsNonPositive()) { if(isZero()) return 2; clear(true); MERGE_APPROX_AND_PREC(mstruct) return 3; } if(representsPositive()) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } if(representsNonPositive()) { if(!isZero()) clear(true); MERGE_APPROX_AND_PREC(mstruct) return 2; } if(CALCULATOR->aborted()) return -1; if(eo.test_comparisons && isLogicalOr()) { if(SIZE > 50) return -1; if(mstruct.isLogicalOr()) { if(mstruct.size() * SIZE > 50) return -1; for(size_t i = 0; i < SIZE; ) { MathStructure msave(CHILD(i)); for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(i2 > 0) { insertChild(msave, i + 1); } CHILD(i).calculateLogicalAnd(mstruct[i2], eo, this, i); i++; } } } else { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculateLogicalAnd(mstruct, eo, this, i); } } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); return 1; } else if(eo.test_comparisons && mstruct.isLogicalOr()) { return 0; } else if(isComparison() && mstruct.isComparison()) { if(CHILD(0) == mstruct[0]) { ComparisonResult cr = mstruct[1].compare(CHILD(1)); ComparisonType ct1 = ct_comp, ct2 = mstruct.comparisonType(); switch(cr) { case COMPARISON_RESULT_NOT_EQUAL: { if(ct_comp == COMPARISON_EQUALS && ct2 == COMPARISON_EQUALS) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(ct_comp == COMPARISON_EQUALS && ct2 == COMPARISON_NOT_EQUALS) { MERGE_APPROX_AND_PREC(mstruct) return 2; } else if(ct_comp == COMPARISON_NOT_EQUALS && ct2 == COMPARISON_EQUALS) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } return -1; } case COMPARISON_RESULT_EQUAL: { MERGE_APPROX_AND_PREC(mstruct) if(ct_comp == ct2) return 1; if(ct_comp == COMPARISON_NOT_EQUALS) { if(ct2 == COMPARISON_LESS || ct2 == COMPARISON_EQUALS_LESS) { ct_comp = COMPARISON_LESS; if(ct2 == COMPARISON_LESS) return 3; return 1; } else if(ct2 == COMPARISON_GREATER || ct2 == COMPARISON_EQUALS_GREATER) { ct_comp = COMPARISON_GREATER; if(ct2 == COMPARISON_GREATER) return 3; return 1; } } else if(ct2 == COMPARISON_NOT_EQUALS) { if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { if(ct_comp == COMPARISON_LESS) return 2; ct_comp = COMPARISON_LESS; return 1; } else if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) { if(ct_comp == COMPARISON_GREATER) return 2; ct_comp = COMPARISON_GREATER; return 1; } } else if((ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER || ct_comp == COMPARISON_EQUALS) && (ct2 == COMPARISON_EQUALS_LESS || ct2 == COMPARISON_EQUALS_GREATER || ct2 == COMPARISON_EQUALS)) { if(ct_comp == COMPARISON_EQUALS) return 2; ct_comp = COMPARISON_EQUALS; if(ct2 == COMPARISON_EQUALS) return 3; return 1; } else if((ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) && (ct2 == COMPARISON_LESS || ct2 == COMPARISON_EQUALS_LESS)) { if(ct_comp == COMPARISON_LESS) return 2; ct_comp = COMPARISON_LESS; if(ct2 == COMPARISON_LESS) return 3; return 1; } else if((ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) && (ct2 == COMPARISON_GREATER || ct2 == COMPARISON_EQUALS_GREATER)) { if(ct_comp == COMPARISON_GREATER) return 2; ct_comp = COMPARISON_GREATER; if(ct2 == COMPARISON_GREATER) return 3; return 1; } clear(true); return 1; } case COMPARISON_RESULT_EQUAL_OR_GREATER: { switch(ct1) { case COMPARISON_GREATER: {ct1 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct1 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct1 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct1 = COMPARISON_EQUALS_GREATER; break;} default: {} } switch(ct2) { case COMPARISON_GREATER: {ct2 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct2 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct2 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct2 = COMPARISON_EQUALS_GREATER; break;} default: {} } } case COMPARISON_RESULT_EQUAL_OR_LESS: { switch(ct1) { case COMPARISON_LESS: { if(ct2 == COMPARISON_GREATER || ct2 == COMPARISON_EQUALS) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } else if(ct2 == COMPARISON_LESS || ct2 == COMPARISON_EQUALS_LESS || ct2 == COMPARISON_NOT_EQUALS) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } case COMPARISON_GREATER: { if(ct2 == COMPARISON_GREATER) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } case COMPARISON_EQUALS_LESS: { if(ct2 == COMPARISON_EQUALS_LESS) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } case COMPARISON_EQUALS_GREATER: { if(ct2 == COMPARISON_EQUALS_GREATER || ct2 == COMPARISON_EQUALS) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } case COMPARISON_EQUALS: { if(ct2 == COMPARISON_GREATER) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } break; } case COMPARISON_NOT_EQUALS: { if(ct2 == COMPARISON_GREATER) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } } break; } case COMPARISON_RESULT_GREATER: { switch(ct1) { case COMPARISON_GREATER: {ct1 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct1 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct1 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct1 = COMPARISON_EQUALS_GREATER; break;} default: {} } switch(ct2) { case COMPARISON_GREATER: {ct2 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct2 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct2 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct2 = COMPARISON_EQUALS_GREATER; break;} default: {} } } case COMPARISON_RESULT_LESS: { switch(ct1) { case COMPARISON_EQUALS: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) clear(true); return 1;} case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: {MERGE_APPROX_AND_PREC(mstruct) return 2;} default: {} } break; } case COMPARISON_NOT_EQUALS: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } default: {} } break; } case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) clear(true); return 1;} case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: {MERGE_APPROX_AND_PREC(mstruct) return 2;} } break; } case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } default: {} } break; } } break; } default: { if(!eo.test_comparisons) return -1; if(comparisonType() == COMPARISON_EQUALS && !CHILD(1).contains(mstruct[0])) { mstruct.replace(CHILD(0), CHILD(1)); if(eo.isolate_x) mstruct.isolate_x(eo, eo); mstruct.calculatesub(eo, eo, true); mstruct.ref(); add_nocopy(&mstruct, OPERATION_LOGICAL_AND); calculateLogicalAndLast(eo); return 1; } else if(mstruct.comparisonType() == COMPARISON_EQUALS && !mstruct[1].contains(CHILD(0))) { replace(mstruct[0], mstruct[1]); if(eo.isolate_x) isolate_x(eo, eo); calculatesub(eo, eo, true); mstruct.ref(); add_nocopy(&mstruct, OPERATION_LOGICAL_AND); calculateLogicalAndLast(eo); return 1; } return -1; } } } else if(comparisonType() == COMPARISON_EQUALS && !CHILD(0).isNumber() && !CHILD(0).containsInterval() && CHILD(1).isNumber() && mstruct.contains(CHILD(0))) { mstruct.replace(CHILD(0), CHILD(1)); if(eo.isolate_x) mstruct.isolate_x(eo, eo); mstruct.calculatesub(eo, eo, true); mstruct.ref(); add_nocopy(&mstruct, OPERATION_LOGICAL_AND); calculateLogicalAndLast(eo); return 1; } else if(mstruct.comparisonType() == COMPARISON_EQUALS && !mstruct[0].isNumber() && !mstruct[0].containsInterval() && mstruct[1].isNumber() && contains(mstruct[0])) { replace(mstruct[0], mstruct[1]); if(eo.isolate_x) isolate_x(eo, eo); calculatesub(eo, eo, true); mstruct.ref(); add_nocopy(&mstruct, OPERATION_LOGICAL_AND); calculateLogicalAndLast(eo); return 1; } } else if(isLogicalAnd()) { if(mstruct.isLogicalAnd()) { for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); } else { APPEND_REF(&mstruct); MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); } return 1; } else if(mstruct.isLogicalAnd()) { transform(STRUCT_LOGICAL_AND); for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); return 1; } return -1; } int MathStructure::merge_logical_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this, size_t index_mstruct, bool) { if(mstruct.representsPositive()) { if(isOne()) { MERGE_APPROX_AND_PREC(mstruct) return 2; } set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 3; } if(mstruct.representsNonPositive()) { if(representsNonPositive() && !isZero()) clear(true); MERGE_APPROX_AND_PREC(mstruct) return 2; } if(representsPositive()) { if(!isOne()) set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 2; } if(representsNonPositive()) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } if(equals(mstruct, true, true)) { return 2; } if(isLogicalAnd()) { if(mstruct.isLogicalAnd()) { if(SIZE < mstruct.size()) { bool b = true; for(size_t i = 0; i < SIZE; i++) { b = false; for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(CHILD(i) == mstruct[i2]) { b = true; break; } } if(!b) break; } if(b) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } else if(SIZE > mstruct.size()) { bool b = true; for(size_t i = 0; i < mstruct.size(); i++) { b = false; for(size_t i2 = 0; i2 < SIZE; i2++) { if(mstruct[i] == CHILD(i2)) { b = true; break; } } if(!b) break; } if(b) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } } } else { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i) == mstruct) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } } } } else if(mstruct.isLogicalAnd()) { for(size_t i = 0; i < mstruct.size(); i++) { if(equals(mstruct[i])) { MERGE_APPROX_AND_PREC(mstruct) return 2; } } } if(isComparison() && mstruct.isComparison()) { if(CHILD(0) == mstruct[0]) { ComparisonResult cr = mstruct[1].compare(CHILD(1)); ComparisonType ct1 = ct_comp, ct2 = mstruct.comparisonType(); switch(cr) { case COMPARISON_RESULT_NOT_EQUAL: { return -1; } case COMPARISON_RESULT_EQUAL: { if(ct_comp == ct2) return 1; switch(ct_comp) { case COMPARISON_EQUALS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS_LESS: {} case COMPARISON_EQUALS_GREATER: {ct_comp = ct2; MERGE_APPROX_AND_PREC(mstruct) return 3;} case COMPARISON_LESS: {ct_comp = COMPARISON_EQUALS_LESS; MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_GREATER: {ct_comp = COMPARISON_EQUALS_GREATER; MERGE_APPROX_AND_PREC(mstruct) return 1;} default: {} } break; } case COMPARISON_NOT_EQUALS: { switch(ct2) { case COMPARISON_EQUALS_LESS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_EQUALS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_LESS: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) return 2;} default: {} } break; } case COMPARISON_EQUALS_LESS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_GREATER: {} case COMPARISON_EQUALS_GREATER: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {} case COMPARISON_LESS: {MERGE_APPROX_AND_PREC(mstruct) return 2;} default: {} } break; } case COMPARISON_LESS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {ct_comp = ct2; MERGE_APPROX_AND_PREC(mstruct) return 3;} case COMPARISON_EQUALS_GREATER: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {ct_comp = COMPARISON_EQUALS_LESS; MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_GREATER: {ct_comp = COMPARISON_NOT_EQUALS; MERGE_APPROX_AND_PREC(mstruct) return 1;} default: {} } break; } case COMPARISON_EQUALS_GREATER: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_LESS: {} case COMPARISON_EQUALS_LESS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) return 2;} default: {} } break; } case COMPARISON_GREATER: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_GREATER: {ct_comp = ct2; MERGE_APPROX_AND_PREC(mstruct) return 3;} case COMPARISON_EQUALS_LESS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {ct_comp = COMPARISON_EQUALS_GREATER; MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_LESS: {ct_comp = COMPARISON_NOT_EQUALS; MERGE_APPROX_AND_PREC(mstruct) return 1;} default: {} } break; } } break; } case COMPARISON_RESULT_EQUAL_OR_GREATER: { switch(ct1) { case COMPARISON_GREATER: {ct1 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct1 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct1 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct1 = COMPARISON_EQUALS_GREATER; break;} default: {} } switch(ct2) { case COMPARISON_GREATER: {ct2 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct2 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct2 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct2 = COMPARISON_EQUALS_GREATER; break;} default: {} } } case COMPARISON_RESULT_EQUAL_OR_LESS: { switch(ct1) { case COMPARISON_LESS: { if(ct2 == COMPARISON_LESS || ct2 == COMPARISON_EQUALS_LESS || ct2 == COMPARISON_NOT_EQUALS) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } case COMPARISON_GREATER: { if(ct2 == COMPARISON_GREATER) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } case COMPARISON_EQUALS_LESS: { if(ct2 == COMPARISON_EQUALS_LESS) { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } break; } case COMPARISON_EQUALS_GREATER: { if(ct2 == COMPARISON_EQUALS_GREATER || ct2 == COMPARISON_EQUALS) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } case COMPARISON_NOT_EQUALS: { if(ct2 == COMPARISON_GREATER) { MERGE_APPROX_AND_PREC(mstruct) return 2; } break; } default: {} } break; } case COMPARISON_RESULT_GREATER: { switch(ct1) { case COMPARISON_GREATER: {ct1 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct1 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct1 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct1 = COMPARISON_EQUALS_GREATER; break;} default: {} } switch(ct2) { case COMPARISON_GREATER: {ct2 = COMPARISON_LESS; break;} case COMPARISON_EQUALS_GREATER: {ct2 = COMPARISON_EQUALS_LESS; break;} case COMPARISON_LESS: {ct2 = COMPARISON_GREATER; break;} case COMPARISON_EQUALS_LESS: {ct2 = COMPARISON_EQUALS_GREATER; break;} default: {} } } case COMPARISON_RESULT_LESS: { switch(ct1) { case COMPARISON_EQUALS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } default: {} } break; } case COMPARISON_NOT_EQUALS: { switch(ct2) { case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) return 2;} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} default: {} } break; } case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: { if(mparent) { mparent->swapChildren(index_this + 1, index_mstruct + 1); } else { set_nocopy(mstruct, true); } return 3; } default: {} } break; } case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: { switch(ct2) { case COMPARISON_NOT_EQUALS: {} case COMPARISON_EQUALS_LESS: {} case COMPARISON_LESS: {set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1;} case COMPARISON_EQUALS: {} case COMPARISON_EQUALS_GREATER: {} case COMPARISON_GREATER: {MERGE_APPROX_AND_PREC(mstruct) return 2;} } break; } } break; } default: { return -1; } } } else if(comparisonType() == COMPARISON_NOT_EQUALS && !CHILD(0).isNumber() && !CHILD(0).containsInterval() && CHILD(1).isNumber() && mstruct.contains(CHILD(0))) { mstruct.replace(CHILD(0), CHILD(1)); mstruct.calculatesub(eo, eo, true); mstruct.ref(); add_nocopy(&mstruct, OPERATION_LOGICAL_OR); calculateLogicalOrLast(eo); return 1; } else if(mstruct.comparisonType() == COMPARISON_NOT_EQUALS && !mstruct[0].isNumber() && !mstruct[0].containsInterval() && mstruct[1].isNumber() && contains(mstruct[0])) { replace(mstruct[0], mstruct[1]); calculatesub(eo, eo, true); mstruct.ref(); add_nocopy(&mstruct, OPERATION_LOGICAL_OR); calculateLogicalOrLast(eo); return 1; } } else if(isLogicalOr()) { if(mstruct.isLogicalOr()) { for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); } else { APPEND_REF(&mstruct); MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); } return 1; } else if(mstruct.isLogicalOr()) { transform(STRUCT_LOGICAL_OR); for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } MERGE_APPROX_AND_PREC(mstruct) calculatesub(eo, eo, false); return 1; } return -1; } int MathStructure::merge_logical_xor(MathStructure &mstruct, const EvaluationOptions&, MathStructure*, size_t, size_t, bool) { if(equals(mstruct)) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } bool bp1 = representsPositive(); bool bp2 = mstruct.representsPositive(); if(bp1 && bp2) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } bool bn1 = representsNonPositive(); bool bn2 = mstruct.representsNonPositive(); if(bn1 && bn2) { clear(true); MERGE_APPROX_AND_PREC(mstruct) return 1; } if((bn1 && bp2) || (bp1 && bn2)) { set(1, 1, 0, true); MERGE_APPROX_AND_PREC(mstruct) return 1; } return -1; } int MathStructure::merge_bitwise_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure*, size_t, size_t, bool) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.bitAnd(mstruct.number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || o_number.includesInfinity() || mstruct.number().includesInfinity())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_VECTOR: { if(SIZE < mstruct.size()) return 0; for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].ref(); CHILD(i).add_nocopy(&mstruct[i], OPERATION_LOGICAL_AND); CHILD(i).calculatesub(eo, eo, false); } MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { return -1; } } return -1; } case STRUCT_BITWISE_AND: { switch(mstruct.type()) { case STRUCT_VECTOR: { return -1; } case STRUCT_BITWISE_AND: { for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } calculatesub(eo, eo, false); MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { APPEND_REF(&mstruct); calculatesub(eo, eo, false); MERGE_APPROX_AND_PREC(mstruct) return 1; } } break; } default: { switch(mstruct.type()) { case STRUCT_BITWISE_AND: { return 0; } default: {} } } } return -1; } int MathStructure::merge_bitwise_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure*, size_t, size_t, bool) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.bitOr(mstruct.number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || o_number.includesInfinity() || mstruct.number().includesInfinity())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_VECTOR: { if(SIZE < mstruct.size()) return 0; for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].ref(); CHILD(i).add_nocopy(&mstruct[i], OPERATION_LOGICAL_OR); CHILD(i).calculatesub(eo, eo, false); } MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { return -1; } } return -1; } case STRUCT_BITWISE_OR: { switch(mstruct.type()) { case STRUCT_VECTOR: { return -1; } case STRUCT_BITWISE_OR: { for(size_t i = 0; i < mstruct.size(); i++) { APPEND_REF(&mstruct[i]); } calculatesub(eo, eo, false); MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { APPEND_REF(&mstruct); calculatesub(eo, eo, false); MERGE_APPROX_AND_PREC(mstruct) return 1; } } break; } default: { switch(mstruct.type()) { case STRUCT_BITWISE_OR: { return 0; } default: {} } } } return -1; } int MathStructure::merge_bitwise_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure*, size_t, size_t, bool) { if(mstruct.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.bitXor(mstruct.number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mstruct.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || o_number.includesInfinity() || mstruct.number().includesInfinity())) { if(o_number == nr) { o_number = nr; numberUpdated(); return 2; } o_number = nr; numberUpdated(); return 1; } return -1; } switch(m_type) { case STRUCT_VECTOR: { switch(mstruct.type()) { case STRUCT_VECTOR: { if(SIZE < mstruct.size()) return 0; for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].ref(); CHILD(i).add_nocopy(&mstruct[i], OPERATION_LOGICAL_XOR); CHILD(i).calculatesub(eo, eo, false); } MERGE_APPROX_AND_PREC(mstruct) return 1; } default: { return -1; } } return -1; } default: {} } return -1; } #define MERGE_RECURSE if(recursive) {\ bool large_size = (SIZE > 100); \ for(size_t i = 0; i < SIZE; i++) {\ if(large_size && CALCULATOR->aborted()) break;\ if(!CHILD(i).isNumber()) CHILD(i).calculatesub(eo, feo, true, this, i);\ }\ CHILDREN_UPDATED;\ } #define MERGE_ALL(FUNC, TRY_LABEL) size_t i2, i3 = SIZE;\ bool large_size = (i3 > 100); \ bool do_abort = false; \ for(size_t i = 0; i < SIZE - 1; i++) {\ if(large_size && CALCULATOR->aborted()) break;\ i2 = i + 1;\ TRY_LABEL:\ for(; i2 < i; i2++) {\ if(large_size && CALCULATOR->aborted()) break;\ int r = CHILD(i2).FUNC(CHILD(i), eo, this, i2, i);\ if(r == 0) {\ SWAP_CHILDREN(i2, i);\ r = CHILD(i2).FUNC(CHILD(i), eo, this, i2, i, true);\ if(r < 1) {\ SWAP_CHILDREN(i2, i);\ }\ }\ if(r >= 1) {\ ERASE(i);\ b = true;\ i3 = i;\ i = i2;\ i2 = 0;\ goto TRY_LABEL;\ }\ }\ for(i2 = i + 1; i2 < SIZE; i2++) {\ if(large_size && CALCULATOR->aborted()) break;\ int r = CHILD(i).FUNC(CHILD(i2), eo, this, i, i2);\ if(r == 0) {\ SWAP_CHILDREN(i, i2);\ r = CHILD(i).FUNC(CHILD(i2), eo, this, i, i2, true);\ if(r < 1) {\ SWAP_CHILDREN(i, i2);\ } else if(r == 2) {\ r = 3;\ } else if(r == 3) {\ r = 2;\ }\ }\ if(r >= 1) {\ ERASE(i2);\ b = true;\ if(r != 2) {\ i2 = 0;\ goto TRY_LABEL;\ }\ i2--;\ } else if(CHILD(i).isDateTime()) {\ do_abort = true;\ break;\ }\ }\ if(do_abort) break;\ if(i3 < SIZE) {\ if(i3 == SIZE - 1) break;\ i = i3;\ i3 = SIZE;\ i2 = i + 1;\ goto TRY_LABEL;\ }\ } #define MERGE_ALL2 if(SIZE == 1) {\ setToChild(1, false, mparent, index_this + 1);\ } else if(SIZE == 0) {\ clear(true);\ } else {\ evalSort();\ } bool do_simplification(MathStructure &mstruct, const EvaluationOptions &eo, bool combine_divisions = true, bool only_gcd = false, bool combine_only = false, bool recursive = true, bool limit_size = false); bool do_simplification(MathStructure &mstruct, const EvaluationOptions &eo, bool combine_divisions, bool only_gcd, bool combine_only, bool recursive, bool limit_size) { if(!eo.expand || !eo.assume_denominators_nonzero) return false; if(recursive) { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { b = do_simplification(mstruct[i], eo, combine_divisions, only_gcd || (!mstruct.isComparison() && !mstruct.isLogicalAnd() && !mstruct.isLogicalOr()), combine_only, true, limit_size) || b; if(CALCULATOR->aborted()) return b; } if(b) mstruct.calculatesub(eo, eo, false); return do_simplification(mstruct, eo, combine_divisions, only_gcd, combine_only, false, limit_size) || b; } if(mstruct.isPower() && mstruct[1].isNumber() && mstruct[1].number().isRational() && !mstruct[1].number().isInteger() && mstruct[0].isAddition() && mstruct[0].isRationalPolynomial()) { MathStructure msqrfree(mstruct[0]); if(sqrfree(msqrfree, eo) && msqrfree.isPower() && msqrfree.calculateRaise(mstruct[1], eo)) { mstruct = msqrfree; return true; } } else if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_root && VALID_ROOT(mstruct) && mstruct[0].isAddition() && mstruct[0].isRationalPolynomial()) { MathStructure msqrfree(mstruct[0]); if(sqrfree(msqrfree, eo) && msqrfree.isPower() && msqrfree[1].isInteger() && msqrfree[1].number().isPositive()) { if(msqrfree[1] == mstruct[1]) { if(msqrfree[1].number().isEven()) { if(!msqrfree[0].representsReal(true)) return false; msqrfree.delChild(2); msqrfree.setType(STRUCT_FUNCTION); msqrfree.setFunction(CALCULATOR->f_abs); mstruct = msqrfree; } else { mstruct = msqrfree[0]; } return true; } else if(msqrfree[1].number().isIntegerDivisible(mstruct[1].number())) { if(msqrfree[1].number().isEven()) { if(!msqrfree[0].representsReal(true)) return false; msqrfree[0].transform(STRUCT_FUNCTION); msqrfree[0].setFunction(CALCULATOR->f_abs); } msqrfree[1].number().divide(mstruct[1].number()); mstruct = msqrfree; mstruct.calculatesub(eo, eo, false); return true; } else if(mstruct[1].number().isIntegerDivisible(msqrfree[1].number())) { if(msqrfree[1].number().isEven()) { if(!msqrfree[0].representsReal(true)) return false; msqrfree[0].transform(STRUCT_FUNCTION); msqrfree[0].setFunction(CALCULATOR->f_abs); } Number new_root(mstruct[1].number()); new_root.divide(msqrfree[1].number()); mstruct[0] = msqrfree[0]; mstruct[1] = new_root; return true; } } } if(!mstruct.isAddition()) return false; if(combine_divisions) { MathStructure divs, nums, numleft, mleft; EvaluationOptions eo2 = eo; eo2.do_polynomial_division = false; eo2.keep_zero_units = false; // find division by polynomial for(size_t i = 0; i < mstruct.size(); i++) { if(CALCULATOR->aborted()) return false; bool b = false; if(mstruct[i].isMultiplication()) { MathStructure div, num(1, 1, 0); bool b_num = false; for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(mstruct[i][i2].isPower() && mstruct[i][i2][1].isInteger() && mstruct[i][i2][1].number().isNegative()) { bool b_rat = mstruct[i][i2][0].isRationalPolynomial(); if(!b_rat && mstruct[i][i2][0].isAddition() && mstruct[i][i2][0].size() > 1) { b_rat = true; for(size_t i3 = 0; i3 < mstruct[i][i2][0].size(); i3++) { if(!mstruct[i][i2][0][i3].representsZero(true) && !mstruct[i][i2][0][i3].isRationalPolynomial()) { b_rat = false; break; } } } if(!b_rat) { div.clear(); break; } bool b_minone = mstruct[i][i2][1].isMinusOne(); if(b_minone) { if(div.isZero()) div = mstruct[i][i2][0]; else div.multiply(mstruct[i][i2][0], true); } else { mstruct[i][i2][1].number().negate(); if(div.isZero()) div = mstruct[i][i2]; else div.multiply(mstruct[i][i2], true); mstruct[i][i2][1].number().negate(); } } else if(mstruct[i][i2].isRationalPolynomial() || mstruct[i][i2].representsZero(true)) { if(!b_num) {b_num = true; num = mstruct[i][i2];} else num.multiply(mstruct[i][i2], true); } else { div.clear(); break; } } if(!div.isZero()) { bool b_found = false; for(size_t i3 = 0; i3 < divs.size(); i3++) { if(divs[i3] == div) { if(!num.representsZero(true)) { if(num.isAddition()) { for(size_t i4 = 0; i4 < num.size(); i4++) { nums[i3].add(num[i4], true); } } else { nums[i3].add(num, true); } } b_found = true; b = true; break; } } if(!b_found && (eo.assume_denominators_nonzero || div.representsNonZero(true)) && !div.representsZero(true)) { if(!num.representsZero(true)) { divs.addChild(div); nums.addChild(num); } b = true; } } } else if(mstruct[i].isPower() && mstruct[i][1].isInteger() && mstruct[i][1].number().isNegative()) { bool b_rat = mstruct[i][0].isRationalPolynomial(); if(!b_rat && mstruct[i][0].isAddition() && mstruct[i][0].size() > 1) { b_rat = true; for(size_t i2 = 0; i2 < mstruct[i][0].size(); i2++) { if(!mstruct[i][0][i2].representsZero(true) && !mstruct[i][0].isRationalPolynomial()) { b_rat = false; break; } } } if(b_rat) { bool b_minone = mstruct[i][1].isMinusOne(); if(!b_minone) mstruct[i][1].number().negate(); bool b_found = false; for(size_t i3 = 0; i3 < divs.size(); i3++) { if((b_minone && divs[i3] == mstruct[i][0]) || (!b_minone && divs[i3] == mstruct[i])) { nums[i3].add(m_one, true); b_found = true; b = true; break; } } if(!b_found && (eo.assume_denominators_nonzero || mstruct[i][0].representsNonZero(true)) && !mstruct[i][0].representsZero(true)) { if(b_minone) divs.addChild(mstruct[i][0]); else divs.addChild(mstruct[i]); nums.addChild(m_one); b = true; } if(!b_minone) mstruct[i][1].number().negate(); } } if(!b) { if(mstruct[i].isRationalPolynomial()) numleft.addChild(mstruct[i]); else mleft.addChild(mstruct[i]); } } for(size_t i = 0; i < divs.size(); i++) { if(divs[i].isAddition()) { for(size_t i2 = 0; i2 < divs[i].size();) { if(divs[i][i2].representsZero(true)) { divs[i].delChild(i2 + 1); } else i2++; } if(divs[i].size() == 1) divs[i].setToChild(1); else if(divs[i].size() == 0) divs[i].clear(); } } if(divs.size() == 0) return false; bool b_ret = false; if(divs.size() > 1 || numleft.size() > 0) b_ret = true; /*divs.setType(STRUCT_VECTOR); nums.setType(STRUCT_VECTOR); numleft.setType(STRUCT_VECTOR); mleft.setType(STRUCT_VECTOR); cout << nums << ":" << divs << ":" << numleft << ":" << mleft << endl;*/ while(divs.size() > 0) { bool b = true; if(!divs[0].isRationalPolynomial() || !nums[0].isRationalPolynomial()) { return false; } if(!combine_only && divs[0].isAddition() && nums[0].isAddition()) { MathStructure ca, cb, mgcd; if(MathStructure::gcd(nums[0], divs[0], mgcd, eo2, &ca, &cb, false) && !mgcd.isOne() && (!cb.isAddition() || !ca.isAddition() || ca.size() + cb.size() <= nums[0].size() + divs[0].size())) { if(mgcd.representsNonZero(true) || !eo.warn_about_denominators_assumed_nonzero || warn_about_denominators_assumed_nonzero(mgcd, eo)) { if(cb.isOne()) { numleft.addChild(ca); nums.delChild(1); divs.delChild(1); b = false; } else { nums[0] = ca; divs[0] = cb; } b_ret = true; } } } if(CALCULATOR->aborted()) return false; if(b && divs.size() > 1) { if(!combine_only && divs[1].isAddition() && nums[1].isAddition()) { MathStructure ca, cb, mgcd; EvaluationOptions eo3 = eo2; eo3.transform_trigonometric_functions = false; if(MathStructure::gcd(nums[1], divs[1], mgcd, eo3, &ca, &cb, false) && !mgcd.isOne() && (!cb.isAddition() || !ca.isAddition() || ca.size() + cb.size() <= nums[1].size() + divs[1].size())) { if(mgcd.representsNonZero(true) || !eo.warn_about_denominators_assumed_nonzero || warn_about_denominators_assumed_nonzero(mgcd, eo)) { if(cb.isOne()) { numleft.addChild(ca); nums.delChild(2); divs.delChild(2); b = false; } else { nums[1] = ca; divs[1] = cb; } } } } if(CALCULATOR->aborted()) return false; if(b) { MathStructure ca, cb, mgcd; b = MathStructure::gcd(divs[0], divs[1], mgcd, eo2, &ca, &cb, false) && !mgcd.isOne(); if(CALCULATOR->aborted()) return false; bool b_merge = true; if(b) { if(limit_size && ((cb.isAddition() && ((divs[0].isAddition() && divs[0].size() * cb.size() > 200) || (nums[0].isAddition() && nums[0].size() * cb.size() > 200))) || (ca.isAddition() && nums[1].isAddition() && nums[1].size() * ca.size() > 200))) { b_merge = false; } else { if(!cb.isOne()) { divs[0].calculateMultiply(cb, eo2); nums[0].calculateMultiply(cb, eo2); } if(!ca.isOne()) { nums[1].calculateMultiply(ca, eo2); } } } else { if(limit_size && ((divs[1].isAddition() && ((divs[0].isAddition() && divs[0].size() * divs[1].size() > 200) || (nums[0].isAddition() && nums[0].size() * divs[1].size() > 200))) || (divs[0].isAddition() && nums[1].isAddition() && nums[1].size() * divs[0].size() > 200))) { b_merge = false; } else { nums[0].calculateMultiply(divs[1], eo2); nums[1].calculateMultiply(divs[0], eo2); divs[0].calculateMultiply(divs[1], eo2); } } if(b_merge) { nums[0].calculateAdd(nums[1], eo2); nums.delChild(2); divs.delChild(2); } else { size_t size_1 = 2, size_2 = 2; if(nums[0].isAddition()) size_1 += nums[0].size() - 1; if(divs[0].isAddition()) size_1 += divs[0].size() - 1; if(nums[1].isAddition()) size_2 += nums[1].size() - 1; if(divs[1].isAddition()) size_2 += divs[1].size() - 1; if(size_1 > size_2) { nums[0].calculateDivide(divs[0], eo); mleft.addChild(nums[0]); nums.delChild(1); divs.delChild(1); } else { nums[1].calculateDivide(divs[1], eo); mleft.addChild(nums[1]); nums.delChild(2); divs.delChild(2); } } } } else if(b && numleft.size() > 0) { if(limit_size && divs[0].isAddition() && numleft.size() > 0 && divs[0].size() * numleft.size() > 200) break; if(numleft.size() == 1) numleft.setToChild(1); else if(numleft.size() > 1) numleft.setType(STRUCT_ADDITION); numleft.calculateMultiply(divs[0], eo2); nums[0].calculateAdd(numleft, eo2); numleft.clear(); } else if(b) break; } if(CALCULATOR->aborted()) return false; if(!combine_only && !only_gcd && divs.size() > 0 && nums[0].isAddition() && divs[0].isAddition()) { MathStructure mquo, mrem; if(polynomial_long_division(nums[0], divs[0], m_zero, mquo, mrem, eo2, false) && !mquo.isZero() && mrem != nums[0]) { if(CALCULATOR->aborted()) return false; if(!mrem.isZero() || divs[0].representsNonZero(true) || (eo.warn_about_denominators_assumed_nonzero && !warn_about_denominators_assumed_nonzero(divs[0], eo))) { if(mrem.isZero()) { mleft.addChild(mquo); divs.clear(); b_ret = true; } else { long int point = nums[0].size(); if(mquo.isAddition()) point -= mquo.size(); else point--; if(mrem.isAddition()) point -= mrem.size(); else point--; if(point >= 0) { mleft.addChild(mquo); MathStructure ca, cb, mgcd; if(mrem.isAddition() && MathStructure::gcd(mrem, divs[0], mgcd, eo2, &ca, &cb, false) && !mgcd.isOne() && (!cb.isAddition() || !ca.isAddition() || ca.size() + cb.size() <= mrem.size() + divs[0].size())) { mrem = ca; divs[0] = cb; } mrem.calculateDivide(divs[0], eo2); mleft.addChild(mrem); divs.clear(); b_ret = true; } } } } } if(!b_ret) return false; mstruct.clear(true); if(divs.size() > 0) { mstruct = nums[0]; if(only_gcd || combine_only) { divs[0].inverse(); mstruct.multiply(divs[0], true); } else { mstruct.calculateDivide(divs[0], eo); } } for(size_t i = 0; i < mleft.size(); i++) { if(i == 0 && mstruct.isZero()) mstruct = mleft[i]; else mstruct.calculateAdd(mleft[i], eo); } for(size_t i = 0; i < numleft.size(); i++) { if(i == 0 && mstruct.isZero()) mstruct = numleft[i]; else mstruct.calculateAdd(numleft[i], eo); } return true; } MathStructure divs; // find division by polynomial for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(mstruct[i][i2].isPower() && (mstruct[i][i2][0].isAddition() || combine_divisions) && mstruct[i][i2][1].isMinusOne() && mstruct[i][i2][0].isRationalPolynomial()) { bool b_found = false; for(size_t i3 = 0; i3 < divs.size(); i3++) { if(divs[i3] == mstruct[i][i2][0]) { divs[i3].number()++; b_found = true; break; } } if(!b_found) divs.addChild(mstruct[i][i2][0]); break; } } } else if(mstruct[i].isPower() && (mstruct[i][0].isAddition() || combine_divisions) && mstruct[i][1].isMinusOne() && mstruct[i][0].isRationalPolynomial()) { bool b_found = false; for(size_t i3 = 0; i3 < divs.size(); i3++) { if(divs[i3] == mstruct[i][0]) { divs[i3].number()++; b_found = true; break; } } if(!b_found) divs.addChild(mstruct[i][0]); } } // check if denominators is zero for(size_t i = 0; i < divs.size(); ) { if((!combine_divisions && divs[i].number().isZero()) || (!eo.assume_denominators_nonzero && !divs[i].representsNonZero(true)) || divs[i].representsZero(true)) divs.delChild(i + 1); else i++; } if(divs.size() == 0) return false; // combine numerators with same denominator MathStructure nums, numleft, mleft; nums.resizeVector(divs.size(), m_zero); for(size_t i = 0; i < mstruct.size(); i++) { bool b = false; if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(mstruct[i][i2].isPower() && (mstruct[i][i2][0].isAddition() || combine_divisions) && mstruct[i][i2][1].isMinusOne() && mstruct[i][i2][0].isRationalPolynomial()) { for(size_t i3 = 0; i3 < divs.size(); i3++) { if(divs[i3] == mstruct[i][i2][0]) { if(mstruct[i].size() == 1) nums[i3].addChild(m_one); else if(mstruct[i].size() == 2) nums[i3].addChild(mstruct[i][i2 == 0 ? 1 : 0]); else {nums[i3].addChild(mstruct[i]); nums[i3][nums[i3].size() - 1].delChild(i2 + 1);} b = true; break; } } break; } } } else if(mstruct[i].isPower() && (mstruct[i][0].isAddition() || combine_divisions) && mstruct[i][1].isMinusOne() && mstruct[i][0].isRationalPolynomial()) { for(size_t i3 = 0; i3 < divs.size(); i3++) { if(divs[i3] == mstruct[i][0]) { nums[i3].addChild(m_one); b = true; break; } } } if(!b && combine_divisions) { if(mstruct[i].isRationalPolynomial()) numleft.addChild(mstruct[i]); else mleft.addChild(mstruct[i]); } } EvaluationOptions eo2 = eo; eo2.do_polynomial_division = false; eo2.keep_zero_units = false; // do polynomial division; give points to incomplete division vector points(nums.size(), -1); bool b = false, b_ready_candidate = false; for(size_t i = 0; i < divs.size(); i++) { if(CALCULATOR->aborted()) return false; if(nums[i].size() > 1 && divs[i].isAddition()) { nums[i].setType(STRUCT_ADDITION); MathStructure xvar; get_first_symbol(nums[i], xvar); if(nums[i].isRationalPolynomial() && nums[i].degree(xvar).isLessThan(100) && divs[i].degree(xvar).isLessThan(100)) { MathStructure mquo, mrem, ca, cb; if(MathStructure::gcd(nums[i], divs[i], mquo, eo2, &ca, &cb, false) && !mquo.isOne()) { if(!mquo.representsNonZero(true) && eo.warn_about_denominators_assumed_nonzero && !warn_about_denominators_assumed_nonzero(mquo, eo)) { nums[i].clear(); } else { points[i] = 1; b_ready_candidate = true; b = true; } if(ca.isOne()) { if(cb.isOne()) { nums[i].set(1, 1, 0, true); } else { nums[i] = cb; nums[i].inverse(); } } else if(cb.isOne()) { nums[i] = ca; } else { nums[i] = ca; nums[i].calculateDivide(cb, eo); } } else if(!only_gcd && polynomial_long_division(nums[i], divs[i], xvar, mquo, mrem, eo2, false) && !mquo.isZero() && mrem != nums[i]) { if(mrem.isZero() && !divs[i].representsNonZero(true) && eo.warn_about_denominators_assumed_nonzero && !warn_about_denominators_assumed_nonzero(divs[i], eo)) { nums[i].clear(); } else { long int point = 1; if(!mrem.isZero()) point = nums[i].size(); nums[i].set(mquo); if(!mrem.isZero()) { if(mquo.isAddition()) point -= mquo.size(); else point--; if(mrem.isAddition()) point -= mrem.size(); else point--; mrem.calculateDivide(divs[i], eo2); nums[i].calculateAdd(mrem, eo2); } b = true; points[i] = point; if(point >= 0) {b_ready_candidate = true;} else if(b_ready_candidate) nums[i].clear(); } } else { nums[i].clear(); } } } else { nums[i].clear(); } } if(!b) return false; if(b_ready_candidate) { // remove polynomial divisions that inrease complexity for(size_t i = 0; i < nums.size(); i++) { if(!nums[i].isZero() && points[i] < 0) nums[i].clear(); } } else { // no simplying polynomial division found; see if result can be combined with other terms b = false; for(size_t i = 0; i < nums.size(); i++) { if(!nums[i].isZero()) { if(b) { nums[i].clear(); } else { long int point = points[i]; for(size_t i2 = 0; i2 < nums[i].size(); i2++) { bool b2 = false; if(!nums[i][i2].contains(divs[i], false, false, false)) { MathStructure mtest1(mstruct), mtest2(nums[i][i2]); for(size_t i3 = 0; i3 < mtest1.size(); i3++) { if(!mtest1[i3].contains(divs[i], false, false, false)) { int ret = mtest1[i3].merge_addition(mtest2, eo); if(ret > 0) { b2 = true; point++; if(mtest1[i3].isZero()) point++; break; } if(ret == 0) ret = mtest2.merge_addition(mtest1[i3], eo); if(ret > 0) { b2 = true; point++; if(mtest2.isZero()) point++; break; } } } if(b2) break; } if(point >= 0) break; } if(point >= 0) b = true; else nums[i].clear(); } } } } if(!b) return false; // replace terms with polynomial division result for(size_t i = 0; i < mstruct.size(); ) { bool b_del = false; if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(mstruct[i][i2].isPower() && mstruct[i][i2][0].isAddition() && mstruct[i][i2][1].isMinusOne() && mstruct[i][i2][0].isRationalPolynomial()) { for(size_t i3 = 0; i3 < divs.size(); i3++) { if(divs[i3] == mstruct[i][i2][0]) { b_del = !nums[i3].isZero(); break; } } break; } } } else if(mstruct[i].isPower() && mstruct[i][0].isAddition() && mstruct[i][1].isMinusOne() && mstruct[i][0].isRationalPolynomial()) { for(size_t i3 = 0; i3 < divs.size(); i3++) { if(divs[i3] == mstruct[i][0]) { b_del = !nums[i3].isZero(); break; } } } if(b_del) mstruct.delChild(i + 1); else i++; } for(size_t i = 0; i < nums.size(); ) { if(nums[i].isZero()) { nums.delChild(i + 1); } else { nums[i].evalSort(); i++; } } if(mstruct.size() == 0 && nums.size() == 1) { mstruct.set(nums[0]); } else { for(size_t i = 0; i < nums.size(); i++) { mstruct.addChild(nums[i]); } mstruct.evalSort(); } return true; } bool fix_intervals(MathStructure &mstruct, const EvaluationOptions &eo, bool *failed = NULL, long int min_precision = 2) { if(mstruct.type() == STRUCT_NUMBER) { if(CALCULATOR->usesIntervalArithmetic()) { if(!mstruct.number().isInterval(false) && mstruct.number().precision() >= 0) { mstruct.number().precisionToInterval(); mstruct.setPrecision(-1); mstruct.numberUpdated(); return true; } } else if(mstruct.number().isInterval(false)) { if(!mstruct.number().intervalToPrecision(min_precision)) { if(failed) *failed = true; return false; } mstruct.numberUpdated(); return true; } } else if(mstruct.type() == STRUCT_FUNCTION && mstruct.function() == CALCULATOR->f_interval) { bool b = mstruct.calculateFunctions(eo, false); if(b) { fix_intervals(mstruct, eo, failed); return true; } } else { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(fix_intervals(mstruct[i], eo, failed)) { mstruct.childUpdated(i + 1); b = true; } } return b; } return false; } bool contains_zero_unit(const MathStructure &mstruct); bool contains_zero_unit(const MathStructure &mstruct) { if(mstruct.isMultiplication() && mstruct.size() > 1 && mstruct[0].isZero()) { bool b = true; for(size_t i = 1; i < mstruct.size(); i++) { if(!mstruct[i].isUnit_exp()) { b = false; break; } } if(b) return true; } for(size_t i = 0; i < mstruct.size(); i++) { if(contains_zero_unit(mstruct[i])) return true; } return false; } bool test_var_int(const MathStructure &mstruct, bool *v = NULL) { if(mstruct.isVariable() && (mstruct.variable() == CALCULATOR->v_e || mstruct.variable() == CALCULATOR->v_pi)) { if(!v) return true; if(*v) return false; else *v = true; return true; } if(mstruct.isNumber() && mstruct.number().isReal()) { if(!v) { if(mstruct.number().isInterval()) { Number nr_int(mstruct.number()); nr_int.round(); return mstruct.number() < nr_int || mstruct.number() > nr_int; } if(mstruct.isApproximate()) { Number nr_f = mstruct.number(); nr_f.floor(); Number nr_c(nr_f); nr_c++; return COMPARISON_IS_NOT_EQUAL(mstruct.number().compareApproximately(nr_f)) && COMPARISON_IS_NOT_EQUAL(mstruct.number().compareApproximately(nr_c)); } return !mstruct.number().isInterval() && !mstruct.number().isInteger(); } if(mstruct.isApproximate()) return false; return mstruct.number().isRational(); } if(mstruct.isMultiplication() || mstruct.isAddition() || (mstruct.isPower() && mstruct[1].isInteger())) { bool v2 = false; if(!v) v = &v2; for(size_t i = 0; i < mstruct.size(); i++) { if(!test_var_int(mstruct[i], v)) return false; } if(*v) return true; } return false; } bool test_non_integer(const MathStructure &mstruct, const EvaluationOptions&) { if(test_var_int(mstruct)) return true; if(!mstruct.isApproximate()) { if((mstruct.isMultiplication() || mstruct.isAddition()) && mstruct.size() >= 2 && mstruct[0].isNumber() && mstruct[0].number().isReal() && !mstruct[0].number().isInterval() && !mstruct[0].number().isInteger()) { for(size_t i = 1; i < mstruct.size(); i++) { if(!mstruct[i].representsInteger()) return false; } return true; } } return false; } bool MathStructure::calculatesub(const EvaluationOptions &eo, const EvaluationOptions &feo, bool recursive, MathStructure *mparent, size_t index_this) { if(b_protected) return false; bool b = false; switch(m_type) { case STRUCT_VARIABLE: { if(eo.calculate_variables && o_variable->isKnown()) { if((eo.approximation == APPROXIMATION_APPROXIMATE || (!o_variable->isApproximate() && !((KnownVariable*) o_variable)->get().containsInterval() && !((KnownVariable*) o_variable)->get().containsFunction(CALCULATOR->f_interval))) && !((KnownVariable*) o_variable)->get().isAborted()) { set(((KnownVariable*) o_variable)->get()); if(eo.calculate_functions) { calculateFunctions(feo); } fix_intervals(*this, feo, NULL, PRECISION); b = true; calculatesub(eo, feo, true, mparent, index_this); } } break; } case STRUCT_POWER: { if(recursive) { CHILD(0).calculatesub(eo, feo, true, this, 0); CHILD(1).calculatesub(eo, feo, true, this, 1); CHILDREN_UPDATED; } if(CHILD(0).merge_power(CHILD(1), eo) >= 1) { b = true; setToChild(1, false, mparent, index_this + 1); } break; } case STRUCT_ADDITION: { MERGE_RECURSE bool found_complex_relations = false; if(eo.sync_units && (syncUnits(false, &found_complex_relations, true, feo) || (found_complex_relations && eo.sync_complex_unit_relations))) { if(found_complex_relations && eo.sync_complex_unit_relations) { EvaluationOptions eo2 = eo; eo2.expand = -3; eo2.combine_divisions = false; for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculatesub(eo2, feo, true, this, i); CHILD(i).factorizeUnits(); } CHILDREN_UPDATED; syncUnits(true, NULL, true, feo); } unformat(eo); MERGE_RECURSE } MERGE_ALL(merge_addition, try_add) MERGE_ALL2 break; } case STRUCT_MULTIPLICATION: { MERGE_RECURSE if(eo.sync_units && syncUnits(eo.sync_complex_unit_relations, NULL, true, feo)) { unformat(eo); MERGE_RECURSE } if(representsNonMatrix()) { if(SIZE > 2 && CALCULATOR->usesIntervalArithmetic()) { int nonintervals = 0, had_interval = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isNumber()) { if(CHILD(i).number().isInterval(false)) { had_interval = true; if(nonintervals >= 2) break; } else if(nonintervals < 2) { nonintervals++; if(nonintervals == 2 && had_interval) break; } } } if(had_interval && nonintervals >= 2) evalSort(false); } MERGE_ALL(merge_multiplication, try_multiply) } else { size_t i2, i3 = SIZE; for(size_t i = 0; i < SIZE - 1; i++) { i2 = i + 1; try_multiply_matrix: bool b_matrix = !CHILD(i).representsNonMatrix(); if(i2 < i) { for(; ; i2--) { int r = CHILD(i2).merge_multiplication(CHILD(i), eo, this, i2, i); if(r == 0) { SWAP_CHILDREN(i2, i); r = CHILD(i2).merge_multiplication(CHILD(i), eo, this, i2, i, true); if(r < 1) { SWAP_CHILDREN(i2, i); } } if(r >= 1) { ERASE(i); b = true; i3 = i; i = i2; i2 = 0; goto try_multiply_matrix; } if(i2 == 0) break; if(b_matrix && !CHILD(i2).representsNonMatrix()) break; } } bool had_matrix = false; for(i2 = i + 1; i2 < SIZE; i2++) { if(had_matrix && !CHILD(i2).representsNonMatrix()) continue; int r = CHILD(i).merge_multiplication(CHILD(i2), eo, this, i, i2); if(r == 0) { SWAP_CHILDREN(i, i2); r = CHILD(i).merge_multiplication(CHILD(i2), eo, this, i, i2, true); if(r < 1) { SWAP_CHILDREN(i, i2); } else if(r == 2) { r = 3; } else if(r == 3) { r = 2; } } if(r >= 1) { ERASE(i2); b = true; if(r != 2) { i2 = 0; goto try_multiply_matrix; } i2--; } if(i == SIZE - 1) break; if(b_matrix && !CHILD(i2).representsNonMatrix()) had_matrix = true; } if(i3 < SIZE) { if(i3 == SIZE - 1) break; i = i3; i3 = SIZE; i2 = i + 1; goto try_multiply_matrix; } } } MERGE_ALL2 break; } case STRUCT_BITWISE_AND: { MERGE_RECURSE MERGE_ALL(merge_bitwise_and, try_bitand) MERGE_ALL2 break; } case STRUCT_BITWISE_OR: { MERGE_RECURSE MERGE_ALL(merge_bitwise_or, try_bitor) MERGE_ALL2 break; } case STRUCT_BITWISE_XOR: { MERGE_RECURSE MERGE_ALL(merge_bitwise_xor, try_bitxor) MERGE_ALL2 break; } case STRUCT_BITWISE_NOT: { if(recursive) { CHILD(0).calculatesub(eo, feo, true, this, 0); CHILDREN_UPDATED; } switch(CHILD(0).type()) { case STRUCT_NUMBER: { Number nr(CHILD(0).number()); if(nr.bitNot() && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || CHILD(0).number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || CHILD(0).number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || CHILD(0).number().includesInfinity())) { set(nr, true); } break; } case STRUCT_VECTOR: { SET_CHILD_MAP(0); for(size_t i = 0; i < SIZE; i++) { CHILD(i).setLogicalNot(); } break; } case STRUCT_BITWISE_NOT: { setToChild(1); setToChild(1); break; } default: {} } break; } case STRUCT_LOGICAL_AND: { if(recursive) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculatesub(eo, feo, true, this, i); CHILD_UPDATED(i) if(CHILD(i).representsNonPositive()) { clear(true); b = true; break; } } if(b) break; } MERGE_ALL(merge_logical_and, try_logand) if(SIZE == 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { set(1, 1, 0, true); } else if(CHILD(0).representsNonPositive()) { clear(true); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } } else if(SIZE == 0) { clear(true); } else { evalSort(); } break; } case STRUCT_LOGICAL_OR: { bool isResistance = false; switch (CHILD(0).type()) { case STRUCT_MULTIPLICATION: { if(CHILD(0)[1] != 0 && CHILD(0)[1].unit() && CHILD(0)[1].unit()->name().find("ohm") != string::npos) { isResistance = true; } break; } case STRUCT_UNIT: { if (CHILD(0).unit() && CHILD(0).unit()->name().find("ohm") != string::npos) { isResistance = true; } break; } default: {} } if (isResistance) { MathStructure mstruct; for (size_t i = 0; i < SIZE; i++) { MathStructure mtemp(CHILD(i)); mtemp.inverse(); mstruct += mtemp; } mstruct.inverse(); clear(); set(mstruct); break; } if(recursive) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).calculatesub(eo, feo, true, this, i); CHILD_UPDATED(i) if(CHILD(i).representsPositive()) { set(1, 1, 0, true); b = true; break; } } if(b) break; } MERGE_ALL(merge_logical_or, try_logor) if(SIZE == 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { set(1, 1, 0, true); } else if(CHILD(0).representsNonPositive()) { clear(true); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } } else if(SIZE == 0) { clear(true); } else { evalSort(); } break; } case STRUCT_LOGICAL_XOR: { if(recursive) { CHILD(0).calculatesub(eo, feo, true, this, 0); CHILD(1).calculatesub(eo, feo, true, this, 1); CHILDREN_UPDATED; } if(CHILD(0).merge_logical_xor(CHILD(1), eo) >= 1) { b = true; setToChild(1, false, mparent, index_this + 1); } break; } case STRUCT_LOGICAL_NOT: { if(recursive) { CHILD(0).calculatesub(eo, feo, true, this, 0); CHILDREN_UPDATED; } if(CHILD(0).representsPositive()) { clear(true); b = true; } else if(CHILD(0).representsNonPositive()) { set(1, 1, 0, true); b = true; } else if(CHILD(0).isLogicalNot()) { setToChild(1); setToChild(1); if(!representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { add(m_zero, OPERATION_GREATER); calculatesub(eo, feo, false); } b = true; } break; } case STRUCT_COMPARISON: { EvaluationOptions eo2 = eo; if(eo2.assume_denominators_nonzero == 1) eo2.assume_denominators_nonzero = false; if(recursive) { CHILD(0).calculatesub(eo2, feo, true, this, 0); CHILD(1).calculatesub(eo2, feo, true, this, 1); CHILDREN_UPDATED; } if(eo.sync_units && syncUnits(eo.sync_complex_unit_relations, NULL, true, feo)) { unformat(eo); if(recursive) { CHILD(0).calculatesub(eo2, feo, true, this, 0); CHILD(1).calculatesub(eo2, feo, true, this, 1); CHILDREN_UPDATED; } } if(CHILD(0).isAddition() || CHILD(1).isAddition()) { size_t i2 = 0; for(size_t i = 0; !CHILD(0).isAddition() || i < CHILD(0).size(); i++) { if(CHILD(1).isAddition()) { for(; i2 < CHILD(1).size(); i2++) { if(CHILD(0).isAddition() && CHILD(0)[i] == CHILD(1)[i2]) { CHILD(0).delChild(i + 1); CHILD(1).delChild(i2 + 1); break; } else if(!CHILD(0).isAddition() && CHILD(0) == CHILD(1)[i2]) { CHILD(0).clear(true); CHILD(1).delChild(i2 + 1); break; } } } else if(CHILD(0)[i] == CHILD(1)) { CHILD(1).clear(true); CHILD(0).delChild(i + 1); break; } if(!CHILD(0).isAddition()) break; } if(CHILD(0).isAddition()) { if(CHILD(0).size() == 1) CHILD(0).setToChild(1, true); else if(CHILD(0).size() == 0) CHILD(0).clear(true); } if(CHILD(1).isAddition()) { if(CHILD(1).size() == 1) CHILD(1).setToChild(1, true); else if(CHILD(1).size() == 0) CHILD(1).clear(true); } } if(CHILD(0).isMultiplication() && CHILD(1).isMultiplication()) { size_t i1 = 0, i2 = 0; if(CHILD(0)[0].isNumber()) i1++; if(CHILD(1)[0].isNumber()) i2++; while(i1 < CHILD(0).size() && i2 < CHILD(1).size()) { if(CHILD(0)[i1] == CHILD(1)[i2] && CHILD(0)[i1].representsPositive(true)) { CHILD(0).delChild(i1 + 1); CHILD(1).delChild(i2 + 1); } else { break; } } if(CHILD(0).size() == 1) CHILD(0).setToChild(1, true); else if(CHILD(0).size() == 0) CHILD(0).set(1, 1, 0, true); if(CHILD(1).size() == 1) CHILD(1).setToChild(1, true); else if(CHILD(1).size() == 0) CHILD(1).set(1, 1, 0, true); } if(((CHILD(0).isNumber() || (CHILD(0).isVariable() && !CHILD(0).variable()->isKnown() && ((UnknownVariable*) CHILD(0).variable())->interval().isNumber())) && (CHILD(1).isNumber() || ((CHILD(1).isVariable() && !CHILD(1).variable()->isKnown() && ((UnknownVariable*) CHILD(1).variable())->interval().isNumber())))) || (CHILD(0).isDateTime() && CHILD(1).isDateTime())) { ComparisonResult cr; if(CHILD(0).isNumber()) { if(CHILD(1).isNumber()) cr = CHILD(1).number().compareApproximately(CHILD(0).number()); else cr = ((UnknownVariable*) CHILD(1).variable())->interval().number().compareApproximately(CHILD(0).number()); } else if(CHILD(1).isNumber()) { cr = CHILD(1).number().compareApproximately(((UnknownVariable*) CHILD(0).variable())->interval().number()); } else if(CHILD(1).isVariable()) { cr = ((UnknownVariable*) CHILD(1).variable())->interval().number().compareApproximately(((UnknownVariable*) CHILD(0).variable())->interval().number()); } else { cr = CHILD(1).compare(CHILD(0)); } if(cr >= COMPARISON_RESULT_UNKNOWN) { break; } switch(ct_comp) { case COMPARISON_EQUALS: { if(cr == COMPARISON_RESULT_EQUAL) { set(1, 1, 0, true); b = true; } else if(COMPARISON_IS_NOT_EQUAL(cr)) { clear(true); b = true; } break; } case COMPARISON_NOT_EQUALS: { if(cr == COMPARISON_RESULT_EQUAL) { clear(true); b = true; } else if(COMPARISON_IS_NOT_EQUAL(cr)) { set(1, 1, 0, true); b = true; } break; } case COMPARISON_LESS: { if(cr == COMPARISON_RESULT_LESS) { set(1, 1, 0, true); b = true; } else if(cr != COMPARISON_RESULT_EQUAL_OR_LESS && cr != COMPARISON_RESULT_NOT_EQUAL) { clear(true); b = true; } break; } case COMPARISON_EQUALS_LESS: { if(COMPARISON_IS_EQUAL_OR_LESS(cr)) { set(1, 1, 0, true); b = true; } else if(cr != COMPARISON_RESULT_EQUAL_OR_GREATER && cr != COMPARISON_RESULT_NOT_EQUAL) { clear(true); b = true; } break; } case COMPARISON_GREATER: { if(cr == COMPARISON_RESULT_GREATER) { set(1, 1, 0, true); b = true; } else if(cr != COMPARISON_RESULT_EQUAL_OR_GREATER && cr != COMPARISON_RESULT_NOT_EQUAL) { clear(true); b = true; } break; } case COMPARISON_EQUALS_GREATER: { if(COMPARISON_IS_EQUAL_OR_GREATER(cr)) { set(1, 1, 0, true); b = true; } else if(cr != COMPARISON_RESULT_EQUAL_OR_LESS && cr != COMPARISON_RESULT_NOT_EQUAL) { clear(true); b = true; } break; } } break; } if(!eo.test_comparisons) { break; } if(eo2.keep_zero_units && contains_zero_unit(*this)) { eo2.keep_zero_units = false; MathStructure mtest(*this); CALCULATOR->beginTemporaryStopMessages(); mtest.calculatesub(eo2, feo, true); if(mtest.isNumber()) { CALCULATOR->endTemporaryStopMessages(true); set(mtest); b = true; break; } CALCULATOR->endTemporaryStopMessages(); } if((CHILD(0).representsUndefined() && !CHILD(1).representsUndefined(true, true, true)) || (CHILD(1).representsUndefined() && !CHILD(0).representsUndefined(true, true, true))) { if(ct_comp == COMPARISON_EQUALS) { clear(true); b = true; break; } else if(ct_comp == COMPARISON_NOT_EQUALS) { set(1, 1, 0, true); b = true; break; } } if((ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_GREATER) && CHILD(1).isZero()) { if(CHILD(0).isLogicalNot() || CHILD(0).isLogicalAnd() || CHILD(0).isLogicalOr() || CHILD(0).isLogicalXor() || CHILD(0).isComparison()) { if(ct_comp == COMPARISON_EQUALS_LESS) { ERASE(1); m_type = STRUCT_LOGICAL_NOT; calculatesub(eo, feo, false, mparent, index_this); } else { setToChild(1, false, mparent, index_this + 1); } b = true; } } else if((ct_comp == COMPARISON_EQUALS_GREATER || ct_comp == COMPARISON_LESS) && CHILD(0).isZero()) { if(CHILD(0).isLogicalNot() || CHILD(1).isLogicalAnd() || CHILD(1).isLogicalOr() || CHILD(1).isLogicalXor() || CHILD(1).isComparison()) { if(ct_comp == COMPARISON_EQUALS_GREATER) { ERASE(0); m_type = STRUCT_LOGICAL_NOT; calculatesub(eo, feo, false, mparent, index_this); } else { setToChild(2, false, mparent, index_this + 1); } b = true; } } if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { if((CHILD(0).representsReal(true) && CHILD(1).representsComplex(true)) || (CHILD(1).representsReal(true) && CHILD(0).representsComplex(true))) { if(ct_comp == COMPARISON_EQUALS) { clear(true); } else { set(1, 1, 0, true); } b = true; } else if((CHILD(0).representsZero(true) && CHILD(1).representsZero(true))) { if(ct_comp != COMPARISON_EQUALS) { clear(true); } else { set(1, 1, 0, true); } b = true; } else if(CHILD(0).isVariable() && !CHILD(0).variable()->isKnown() && CHILD(0).representsInteger() && test_non_integer(CHILD(1), eo)) { if(ct_comp == COMPARISON_EQUALS) clear(true); else set(1, 1, 0, true); b = true; } } if(b) break; if(eo.approximation == APPROXIMATION_EXACT && eo.test_comparisons > 0) { bool b_intval = CALCULATOR->usesIntervalArithmetic(); bool b_failed = false; EvaluationOptions eo3 = feo; eo2.approximation = APPROXIMATION_APPROXIMATE; eo3.approximation = APPROXIMATION_APPROXIMATE; eo2.test_comparisons = false; MathStructure mtest(*this); CALCULATOR->beginTemporaryEnableIntervalArithmetic(); if(!b_intval) fix_intervals(mtest, eo2, &b_failed); if(!b_failed) { if(mtest[0].isAddition() && mtest[0].size() > 1 && mtest[1].isZero()) { mtest[1] = mtest[0][0]; mtest[1].negate(); mtest[0].delChild(1, true); } CALCULATOR->beginTemporaryStopMessages(); mtest[0].calculateFunctions(eo3); mtest[0].calculatesub(eo2, eo3, true); mtest[1].calculateFunctions(eo3); mtest[1].calculatesub(eo2, eo3, true); CALCULATOR->endTemporaryEnableIntervalArithmetic(); mtest.childrenUpdated(); if(CALCULATOR->endTemporaryStopMessages(NULL, NULL, MESSAGE_ERROR) == 0) { eo2.approximation = eo.approximation; eo2.test_comparisons = -1; mtest.calculatesub(eo2, feo, false); if(mtest.isNumber()) { if(mtest.isZero()) clear(true); else set(1, 1, 0, true); b = true; break; } } } else { CALCULATOR->endTemporaryEnableIntervalArithmetic(); } } eo2 = eo; if(eo2.assume_denominators_nonzero == 1) eo2.assume_denominators_nonzero = false; bool mtest_new = false; MathStructure *mtest; if(!CHILD(1).isZero()) { if(!eo.isolate_x || find_x_var().isUndefined()) { CHILD(0).calculateSubtract(CHILD(1), eo2); CHILD(1).clear(); mtest = &CHILD(0); mtest->ref(); } else { mtest = new MathStructure(CHILD(0)); mtest->calculateSubtract(CHILD(1), eo2); mtest_new = true; } } else { mtest = &CHILD(0); mtest->ref(); } int incomp = 0; if(mtest->isAddition()) { mtest->evalSort(true); incomp = compare_check_incompability(mtest); } if(incomp < 0) { if(mtest_new && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { bool a_pos = CHILD(0).representsPositive(true); bool a_nneg = a_pos || CHILD(0).representsNonNegative(true); bool a_neg = !a_nneg && CHILD(0).representsNegative(true); bool a_npos = !a_pos && (a_neg || CHILD(0).representsNonPositive(true)); bool b_pos = CHILD(1).representsPositive(true); bool b_nneg = b_pos || CHILD(1).representsNonNegative(true); bool b_neg = !b_nneg && CHILD(1).representsNegative(true); bool b_npos = !b_pos && (b_neg || CHILD(1).representsNonPositive(true)); if(isApproximate()) { if((a_pos && b_neg) || (a_neg && b_pos)) { incomp = 1; } } else { if((a_pos && b_npos) || (a_npos && b_pos) || (a_nneg && b_neg) || (a_neg && b_nneg)) { incomp = 1; } } } else { mtest->unref(); break; } } switch(ct_comp) { case COMPARISON_EQUALS: { if(incomp > 0) { clear(true); b = true; } else if(mtest->representsZero(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsNonZero(true)) { clear(true); b = true; } break; } case COMPARISON_NOT_EQUALS: { if(incomp > 0) { set(1, 1, 0, true); b = true; } else if(mtest->representsNonZero(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsZero(true)) { clear(true); b = true; } break; } case COMPARISON_LESS: { if(incomp > 0) { } else if(mtest->representsNegative(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsNonNegative(true)) { clear(true); b = true; } break; } case COMPARISON_GREATER: { if(incomp > 0) { } else if(mtest->representsPositive(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsNonPositive(true)) { clear(true); b = true; } break; } case COMPARISON_EQUALS_LESS: { if(incomp > 0) { } else if(mtest->representsNonPositive(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsPositive(true)) { clear(true); b = true; } break; } case COMPARISON_EQUALS_GREATER: { if(incomp > 0) { } else if(mtest->representsNonNegative(true)) { set(1, 1, 0, true); b = true; } else if(mtest->representsNegative(true)) { clear(true); b = true; } break; } } mtest->unref(); break; } case STRUCT_FUNCTION: { if(o_function == CALCULATOR->f_abs || o_function == CALCULATOR->f_root || o_function == CALCULATOR->f_interval || o_function == CALCULATOR->f_signum || o_function == CALCULATOR->f_dirac || o_function == CALCULATOR->f_heaviside) { b = calculateFunctions(eo, false); if(b) { calculatesub(eo, feo, true, mparent, index_this); break; } } } default: { if(recursive) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).calculatesub(eo, feo, true, this, i)) b = true; } CHILDREN_UPDATED; } if(eo.sync_units && syncUnits(eo.sync_complex_unit_relations, NULL, true, feo)) { unformat(eo); if(recursive) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).calculatesub(eo, feo, true, this, i)) b = true; } CHILDREN_UPDATED; } } } } return b; } #define MERGE_INDEX(FUNC, TRY_LABEL) bool b = false;\ TRY_LABEL:\ bool large_size = SIZE > 100;\ for(size_t i = 0; i < index; i++) {\ if(large_size && CALCULATOR->aborted()) break; \ int r = CHILD(i).FUNC(CHILD(index), eo, this, i, index);\ if(r == 0) {\ SWAP_CHILDREN(i, index);\ r = CHILD(i).FUNC(CHILD(index), eo, this, i, index, true);\ if(r < 1) {\ SWAP_CHILDREN(i, index);\ } else if(r == 2) {\ r = 3;\ } else if(r == 3) {\ r = 2;\ }\ }\ if(r >= 1) {\ ERASE(index);\ if(!b && r == 2) {\ b = true;\ index = SIZE;\ break;\ } else {\ b = true;\ index = i;\ goto TRY_LABEL;\ }\ }\ }\ for(size_t i = index + 1; i < SIZE; i++) {\ if(large_size && CALCULATOR->aborted()) break; \ int r = CHILD(index).FUNC(CHILD(i), eo, this, index, i);\ if(r == 0) {\ SWAP_CHILDREN(index, i);\ r = CHILD(index).FUNC(CHILD(i), eo, this, index, i, true);\ if(r < 1) {\ SWAP_CHILDREN(index, i);\ } else if(r == 2) {\ r = 3;\ } else if(r == 3) {\ r = 2;\ }\ }\ if(r >= 1) {\ ERASE(i);\ if(!b && r == 3) {\ b = true;\ break;\ }\ b = true;\ if(r != 2) {\ goto TRY_LABEL;\ }\ i--;\ }\ } #define MERGE_INDEX2 if(b && check_size) {\ if(SIZE == 1) {\ setToChild(1, false, mparent, index_this + 1);\ } else if(SIZE == 0) {\ clear(true);\ } else {\ evalSort();\ }\ return true;\ } else {\ evalSort();\ return b;\ } bool MathStructure::calculateMergeIndex(size_t index, const EvaluationOptions &eo, const EvaluationOptions &feo, MathStructure *mparent, size_t index_this) { switch(m_type) { case STRUCT_MULTIPLICATION: { return calculateMultiplyIndex(index, eo, true, mparent, index_this); } case STRUCT_ADDITION: { return calculateAddIndex(index, eo, true, mparent, index_this); } case STRUCT_POWER: { return calculateRaiseExponent(eo, mparent, index_this); } case STRUCT_LOGICAL_AND: { return calculateLogicalAndIndex(index, eo, true, mparent, index_this); } case STRUCT_LOGICAL_OR: { return calculateLogicalOrIndex(index, eo, true, mparent, index_this); } case STRUCT_LOGICAL_XOR: { return calculateLogicalXorLast(eo, mparent, index_this); } case STRUCT_BITWISE_AND: { return calculateBitwiseAndIndex(index, eo, true, mparent, index_this); } case STRUCT_BITWISE_OR: { return calculateBitwiseOrIndex(index, eo, true, mparent, index_this); } case STRUCT_BITWISE_XOR: { return calculateBitwiseXorIndex(index, eo, true, mparent, index_this); } default: {} } return calculatesub(eo, feo, false, mparent, index_this); } bool MathStructure::calculateLogicalOrLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateLogicalOrIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateLogicalOrIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isLogicalOr()) { CALCULATOR->error(true, "calculateLogicalOrIndex() error: %s. %s", format_and_print(*this).c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_logical_or, try_logical_or_index) if(b && check_size) { if(SIZE == 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { clear(true); o_number.setTrue(); } else if(CHILD(0).representsNonPositive()) { clear(true); o_number.setFalse(); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } } else if(SIZE == 0) { clear(true); } else { evalSort(); } return true; } else { evalSort(); return false; } } bool MathStructure::calculateLogicalOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mor, OPERATION_LOGICAL_OR, true); LAST.evalSort(); return calculateLogicalOrIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateLogicalXorLast(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(!isLogicalXor()) { CALCULATOR->error(true, "calculateLogicalXorLast() error: %s. %s", format_and_print(*this).c_str(), _("This is a bug. Please report it."), NULL); return false; } if(CHILD(0).merge_logical_xor(CHILD(1), eo, this, 0, 1) >= 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { clear(true); o_number.setTrue(); } else if(CHILD(0).representsNonPositive()) { clear(true); o_number.setFalse(); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } return true; } return false; } bool MathStructure::calculateLogicalXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mxor, OPERATION_LOGICAL_XOR); LAST.evalSort(); return calculateLogicalXorLast(eo, mparent, index_this); } bool MathStructure::calculateLogicalAndLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateLogicalAndIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateLogicalAndIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isLogicalAnd()) { CALCULATOR->error(true, "calculateLogicalAndIndex() error: %s. %s", format_and_print(*this).c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_logical_and, try_logical_and_index) if(b && check_size) { if(SIZE == 1) { if(CHILD(0).representsBoolean() || (mparent && !mparent->isMultiplication() && mparent->representsBoolean())) { setToChild(1, false, mparent, index_this + 1); } else if(CHILD(0).representsPositive()) { clear(true); o_number.setTrue(); } else if(CHILD(0).representsNonPositive()) { clear(true); o_number.setFalse(); } else { APPEND(m_zero); m_type = STRUCT_COMPARISON; ct_comp = COMPARISON_GREATER; } } else if(SIZE == 0) { clear(true); } else { evalSort(); } return true; } else { evalSort(); return false; } } bool MathStructure::calculateLogicalAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mand, OPERATION_LOGICAL_AND, true); LAST.evalSort(); return calculateLogicalAndIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateInverse(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { return calculateRaise(m_minus_one, eo, mparent, index_this); } bool MathStructure::calculateNegate(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.negate() && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate())) { o_number = nr; numberUpdated(); return true; } if(!isMultiplication()) transform(STRUCT_MULTIPLICATION); PREPEND(m_minus_one); return false; } if(!isMultiplication()) transform(STRUCT_MULTIPLICATION); PREPEND(m_minus_one); return calculateMultiplyIndex(0, eo, true, mparent, index_this); } bool MathStructure::calculateBitwiseNot(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { transform(STRUCT_LOGICAL_NOT); return calculatesub(eo, eo, false, mparent, index_this); } bool MathStructure::calculateLogicalNot(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { transform(STRUCT_BITWISE_NOT); return calculatesub(eo, eo, false, mparent, index_this); } bool MathStructure::calculateRaiseExponent(const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(!isPower()) { CALCULATOR->error(true, "calculateRaiseExponent() error: %s. %s", format_and_print(*this).c_str(), _("This is a bug. Please report it."), NULL); return false; } if(CHILD(0).merge_power(CHILD(1), eo, this, 0, 1) >= 1) { setToChild(1, false, mparent, index_this + 1); return true; } return false; } bool MathStructure::calculateRaise(const MathStructure &mexp, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(mexp.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.raise(mexp.number(), eo.approximation < APPROXIMATION_APPROXIMATE) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mexp.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mexp.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || o_number.includesInfinity() || mexp.number().includesInfinity())) { o_number = nr; numberUpdated(); return true; } } raise(mexp); LAST.evalSort(); return calculateRaiseExponent(eo, mparent, index_this); } bool MathStructure::calculateBitwiseAndLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateBitwiseAndIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateBitwiseAndIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isBitwiseAnd()) { CALCULATOR->error(true, "calculateBitwiseAndIndex() error: %s. %s", format_and_print(*this).c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_bitwise_and, try_bitwise_and_index) MERGE_INDEX2 } bool MathStructure::calculateBitwiseAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mand, OPERATION_BITWISE_AND, true); LAST.evalSort(); return calculateBitwiseAndIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateBitwiseOrLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateBitwiseOrIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateBitwiseOrIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isBitwiseOr()) { CALCULATOR->error(true, "calculateBitwiseOrIndex() error: %s. %s", format_and_print(*this).c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_bitwise_or, try_bitwise_or_index) MERGE_INDEX2 } bool MathStructure::calculateBitwiseOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mor, OPERATION_BITWISE_OR, true); LAST.evalSort(); return calculateBitwiseOrIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateBitwiseXorLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateBitwiseXorIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateBitwiseXorIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isBitwiseXor()) { CALCULATOR->error(true, "calculateBitwiseXorIndex() error: %s. %s", format_and_print(*this).c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_bitwise_xor, try_bitwise_xor_index) MERGE_INDEX2 } bool MathStructure::calculateBitwiseXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { add(mxor, OPERATION_BITWISE_XOR, true); LAST.evalSort(); return calculateBitwiseXorIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateMultiplyLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateMultiplyIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateMultiplyIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isMultiplication()) { CALCULATOR->error(true, "calculateMultiplyIndex() error: %s. %s", format_and_print(*this).c_str(), _("This is a bug. Please report it."), NULL); return false; } bool b = false; try_multiply_matrix_index: bool b_matrix = !CHILD(index).representsNonMatrix(); bool large_size = (SIZE > 100); if(index > 0) { for(size_t i = index - 1; ; i--) { if(large_size && CALCULATOR->aborted()) break; int r = CHILD(i).merge_multiplication(CHILD(index), eo, this, i, index); if(r == 0) { SWAP_CHILDREN(i, index); r = CHILD(i).merge_multiplication(CHILD(index), eo, this, i, index, true); if(r < 1) { SWAP_CHILDREN(i, index); } else if(r == 2) { r = 3; } else if(r == 3) { r = 2; } } if(r >= 1) { ERASE(index); if(!b && r == 2) { b = true; index = SIZE; break; } else { b = true; index = i; goto try_multiply_matrix_index; } } if(i == 0) break; if(b_matrix && !CHILD(i).representsNonMatrix()) break; } } bool had_matrix = false; for(size_t i = index + 1; i < SIZE; i++) { if(had_matrix && !CHILD(i).representsNonMatrix()) continue; if(large_size && CALCULATOR->aborted()) break; int r = CHILD(index).merge_multiplication(CHILD(i), eo, this, index, i); if(r == 0) { SWAP_CHILDREN(index, i); r = CHILD(index).merge_multiplication(CHILD(i), eo, this, index, i, true); if(r < 1) { SWAP_CHILDREN(index, i); } else if(r == 2) { r = 3; } else if(r == 3) { r = 2; } } if(r >= 1) { ERASE(i); if(!b && r == 3) { b = true; break; } b = true; if(r != 2) { goto try_multiply_matrix_index; } i--; } if(i == SIZE - 1) break; if(b_matrix && !CHILD(i).representsNonMatrix()) had_matrix = true; } MERGE_INDEX2 } bool MathStructure::calculateMultiply(const MathStructure &mmul, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(mmul.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.multiply(mmul.number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mmul.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mmul.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || o_number.includesInfinity() || mmul.number().includesInfinity())) { o_number = nr; numberUpdated(); return true; } } multiply(mmul, true); LAST.evalSort(); return calculateMultiplyIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateDivide(const MathStructure &mdiv, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(mdiv.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.divide(mdiv.number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || mdiv.number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || o_number.isComplex() || mdiv.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || o_number.includesInfinity() || mdiv.number().includesInfinity())) { o_number = nr; numberUpdated(); return true; } } MathStructure *mmul = new MathStructure(mdiv); mmul->evalSort(); multiply_nocopy(mmul, true); LAST.calculateInverse(eo, this, SIZE - 1); return calculateMultiplyIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateAddLast(const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { return calculateAddIndex(SIZE - 1, eo, check_size, mparent, index_this); } bool MathStructure::calculateAddIndex(size_t index, const EvaluationOptions &eo, bool check_size, MathStructure *mparent, size_t index_this) { if(index >= SIZE || !isAddition()) { CALCULATOR->error(true, "calculateAddIndex() error: %s. %s", format_and_print(*this).c_str(), _("This is a bug. Please report it."), NULL); return false; } MERGE_INDEX(merge_addition, try_add_index) MERGE_INDEX2 } bool MathStructure::calculateAdd(const MathStructure &madd, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(madd.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.add(madd.number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || madd.number().isApproximate())) { o_number = nr; numberUpdated(); return true; } } add(madd, true); LAST.evalSort(); return calculateAddIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateSubtract(const MathStructure &msub, const EvaluationOptions &eo, MathStructure *mparent, size_t index_this) { if(msub.type() == STRUCT_NUMBER && m_type == STRUCT_NUMBER) { Number nr(o_number); if(nr.subtract(msub.number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || o_number.isApproximate() || msub.number().isApproximate())) { o_number = nr; numberUpdated(); return true; } } MathStructure *madd = new MathStructure(msub); madd->evalSort(); add_nocopy(madd, true); LAST.calculateNegate(eo, this, SIZE - 1); return calculateAddIndex(SIZE - 1, eo, true, mparent, index_this); } bool MathStructure::calculateFunctions(const EvaluationOptions &eo, bool recursive, bool do_unformat) { if(m_type == STRUCT_FUNCTION && o_function != eo.protected_function) { if(function_value) { function_value->unref(); function_value = NULL; } if(!o_function->testArgumentCount(SIZE)) { return false; } if(o_function->maxargs() > -1 && (long int) SIZE > o_function->maxargs()) { if(o_function->maxargs() == 1 && o_function->getArgumentDefinition(1) && o_function->getArgumentDefinition(1)->handlesVector()) { bool b = false; for(size_t i2 = 0; i2 < CHILD(0).size(); i2++) { CHILD(0)[i2].transform(o_function); if(CHILD(0)[i2].calculateFunctions(eo, recursive, do_unformat)) b = true; CHILD(0).childUpdated(i2 + 1); } SET_CHILD_MAP(0) return b; } REDUCE(o_function->maxargs()); } m_type = STRUCT_VECTOR; Argument *arg = NULL, *last_arg = NULL; int last_i = 0; for(size_t i = 0; i < SIZE; i++) { arg = o_function->getArgumentDefinition(i + 1); if(arg) { last_arg = arg; last_i = i; if(!arg->test(CHILD(i), i + 1, o_function, eo)) { if(arg->handlesVector() && CHILD(i).isVector()) { bool b = false; for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { CHILD(i)[i2].transform(o_function); for(size_t i3 = 0; i3 < SIZE; i3++) { if(i3 < i) CHILD(i)[i2].insertChild(CHILD(i3), i3 + 1); else if(i3 > i) CHILD(i)[i2].addChild(CHILD(i3)); } if(CHILD(i)[i2].calculateFunctions(eo, recursive, do_unformat)) b = true; CHILD(i).childUpdated(i2 + 1); } SET_CHILD_MAP(i); return b; } m_type = STRUCT_FUNCTION; CHILD_UPDATED(i); return false; } else { CHILD_UPDATED(i); } if(arg->handlesVector()) { if(!CHILD(i).isVector() && !CHILD(i).representsScalar()) { CHILD(i).eval(eo); CHILD_UPDATED(i); } if(CHILD(i).isVector()) { bool b = false; for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { CHILD(i)[i2].transform(o_function); for(size_t i3 = 0; i3 < SIZE; i3++) { if(i3 < i) CHILD(i)[i2].insertChild(CHILD(i3), i3 + 1); else if(i3 > i) CHILD(i)[i2].addChild(CHILD(i3)); } if(CHILD(i)[i2].calculateFunctions(eo, recursive, do_unformat)) b = true; CHILD(i).childUpdated(i2 + 1); } SET_CHILD_MAP(i); return b; } } } } if(last_arg && o_function->maxargs() < 0 && last_i >= o_function->minargs()) { for(size_t i = last_i + 1; i < SIZE; i++) { if(!last_arg->test(CHILD(i), i + 1, o_function, eo)) { m_type = STRUCT_FUNCTION; CHILD_UPDATED(i); return false; } else { CHILD_UPDATED(i); } } } if(!o_function->testCondition(*this)) { m_type = STRUCT_FUNCTION; return false; } MathStructure *mstruct = new MathStructure(); int ret = o_function->calculate(*mstruct, *this, eo); if(ret > 0) { set_nocopy(*mstruct, true); if(recursive) calculateFunctions(eo); mstruct->unref(); if(do_unformat) unformat(eo); return true; } else { if(ret < 0) { ret = -ret; if(o_function->maxargs() > 0 && ret > o_function->maxargs()) { if(mstruct->isVector()) { if(do_unformat) mstruct->unformat(eo); for(size_t arg_i = 1; arg_i <= SIZE && arg_i <= mstruct->size(); arg_i++) { mstruct->getChild(arg_i)->ref(); setChild_nocopy(mstruct->getChild(arg_i), arg_i); } } } else if(ret <= (long int) SIZE) { if(do_unformat) mstruct->unformat(eo); mstruct->ref(); setChild_nocopy(mstruct, ret); } } /*if(eo.approximation == APPROXIMATION_EXACT) { mstruct->clear(); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->beginTemporaryStopMessages(); if(o_function->calculate(*mstruct, *this, eo2) > 0) { function_value = mstruct; function_value->ref(); function_value->calculateFunctions(eo2); } if(CALCULATOR->endTemporaryStopMessages() > 0 && function_value) { function_value->unref(); function_value = NULL; } }*/ m_type = STRUCT_FUNCTION; mstruct->unref(); for(size_t i = 0; i < SIZE; i++) { arg = o_function->getArgumentDefinition(i + 1); if(arg && arg->handlesVector()) { if(!CHILD(i).isVector()) { CHILD(i).calculatesub(eo, eo, false); if(!CHILD(i).isVector()) return false; } bool b = false; for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { CHILD(i)[i2].transform(o_function); for(size_t i3 = 0; i3 < SIZE; i3++) { if(i3 < i) CHILD(i)[i2].insertChild(CHILD(i3), i3 + 1); else if(i3 > i) CHILD(i)[i2].addChild(CHILD(i3)); } if(CHILD(i)[i2].calculateFunctions(eo, recursive, do_unformat)) b = true; CHILD(i).childUpdated(i2 + 1); } SET_CHILD_MAP(i); return b; } } return false; } } bool b = false; if(recursive) { for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; if(CHILD(i).calculateFunctions(eo, recursive, do_unformat)) { CHILD_UPDATED(i); b = true; } } } return b; } int evalSortCompare(const MathStructure &mstruct1, const MathStructure &mstruct2, const MathStructure &parent, bool b_abs = false); int evalSortCompare(const MathStructure &mstruct1, const MathStructure &mstruct2, const MathStructure &parent, bool b_abs) { if(parent.isMultiplication()) { if((!mstruct1.representsNonMatrix() && !mstruct2.representsScalar()) || (!mstruct2.representsNonMatrix() && !mstruct1.representsScalar())) { return 0; } } if(b_abs || parent.isAddition()) { if(mstruct1.isMultiplication() && mstruct1.size() > 0) { size_t start = 0; while(mstruct1[start].isNumber() && mstruct1.size() > start + 1) { start++; } int i2; if(mstruct2.isMultiplication()) { if(mstruct2.size() < 1) return -1; size_t start2 = 0; while(mstruct2[start2].isNumber() && mstruct2.size() > start2 + 1) { start2++; } for(size_t i = 0; ; i++) { if(i + start2 >= mstruct2.size()) { if(i + start >= mstruct1.size()) { if(start2 == start) { for(size_t i3 = 0; i3 < start; i3++) { i2 = evalSortCompare(mstruct1[i3], mstruct2[i3], parent, b_abs); if(i2 != 0) return i2; } return 0; } if(start2 > start) return -1; } return 1; } if(i + start >= mstruct1.size()) return -1; i2 = evalSortCompare(mstruct1[i + start], mstruct2[i + start2], parent, b_abs); if(i2 != 0) return i2; } if(mstruct1.size() - start == mstruct2.size() - start2) return 0; return -1; } else { i2 = evalSortCompare(mstruct1[start], mstruct2, parent, b_abs); if(i2 != 0) return i2; if(b_abs && start == 1 && (mstruct1[0].isMinusOne() || mstruct1[0].isOne())) return 0; return 1; } } else if(mstruct2.isMultiplication() && mstruct2.size() > 0) { size_t start = 0; while(mstruct2[start].isNumber() && mstruct2.size() > start + 1) { start++; } int i2; if(mstruct1.isMultiplication()) { return 1; } else { i2 = evalSortCompare(mstruct1, mstruct2[start], parent, b_abs); if(i2 != 0) return i2; if(b_abs && start == 1 && (mstruct2[0].isMinusOne() || mstruct2[0].isOne())) return 0; return -1; } } } if(mstruct1.type() != mstruct2.type()) { if(!parent.isMultiplication()) { if(mstruct2.isNumber()) return -1; if(mstruct1.isNumber()) return 1; } if(!parent.isMultiplication() || (!mstruct1.isNumber() && !mstruct2.isNumber())) { if(mstruct2.isPower()) { int i = evalSortCompare(mstruct1, mstruct2[0], parent, b_abs); if(i == 0) { return evalSortCompare(m_one, mstruct2[1], parent, b_abs); } return i; } if(mstruct1.isPower()) { int i = evalSortCompare(mstruct1[0], mstruct2, parent, b_abs); if(i == 0) { return evalSortCompare(mstruct1[1], m_one, parent, b_abs); } return i; } } if(mstruct2.isAborted()) return -1; if(mstruct1.isAborted()) return 1; if(mstruct2.isInverse()) return -1; if(mstruct1.isInverse()) return 1; if(mstruct2.isDivision()) return -1; if(mstruct1.isDivision()) return 1; if(mstruct2.isNegate()) return -1; if(mstruct1.isNegate()) return 1; if(mstruct2.isLogicalAnd()) return -1; if(mstruct1.isLogicalAnd()) return 1; if(mstruct2.isLogicalOr()) return -1; if(mstruct1.isLogicalOr()) return 1; if(mstruct2.isLogicalXor()) return -1; if(mstruct1.isLogicalXor()) return 1; if(mstruct2.isLogicalNot()) return -1; if(mstruct1.isLogicalNot()) return 1; if(mstruct2.isComparison()) return -1; if(mstruct1.isComparison()) return 1; if(mstruct2.isBitwiseOr()) return -1; if(mstruct1.isBitwiseOr()) return 1; if(mstruct2.isBitwiseXor()) return -1; if(mstruct1.isBitwiseXor()) return 1; if(mstruct2.isBitwiseAnd()) return -1; if(mstruct1.isBitwiseAnd()) return 1; if(mstruct2.isBitwiseNot()) return -1; if(mstruct1.isBitwiseNot()) return 1; if(mstruct2.isUndefined()) return -1; if(mstruct1.isUndefined()) return 1; if(mstruct2.isFunction()) return -1; if(mstruct1.isFunction()) return 1; if(mstruct2.isAddition()) return -1; if(mstruct1.isAddition()) return 1; if(mstruct2.isMultiplication()) return -1; if(mstruct1.isMultiplication()) return 1; if(mstruct2.isPower()) return -1; if(mstruct1.isPower()) return 1; if(mstruct2.isUnit()) return -1; if(mstruct1.isUnit()) return 1; if(mstruct2.isSymbolic()) return -1; if(mstruct1.isSymbolic()) return 1; if(mstruct2.isVariable()) return -1; if(mstruct1.isVariable()) return 1; if(mstruct2.isDateTime()) return -1; if(mstruct1.isDateTime()) return 1; if(parent.isMultiplication()) { if(mstruct2.isNumber()) return -1; if(mstruct1.isNumber()) return 1; } return -1; } switch(mstruct1.type()) { case STRUCT_NUMBER: { if(CALCULATOR->aborted()) return 0; if(b_abs) { ComparisonResult cmp = mstruct1.number().compareAbsolute(mstruct2.number()); if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } if(!mstruct1.number().hasImaginaryPart() && !mstruct2.number().hasImaginaryPart()) { if(mstruct1.number().isFloatingPoint()) { if(!mstruct2.number().isFloatingPoint()) return 1; if(mstruct1.number().isInterval()) { if(!mstruct2.number().isInterval()) return 1; } else if(mstruct2.number().isInterval()) return -1; } else if(mstruct2.number().isFloatingPoint()) return -1; ComparisonResult cmp = mstruct1.number().compare(mstruct2.number()); if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } else { if(!mstruct1.number().hasRealPart()) { if(mstruct2.number().hasRealPart()) { return 1; } else { ComparisonResult cmp = mstruct1.number().compareImaginaryParts(mstruct2.number()); if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } } else if(mstruct2.number().hasRealPart()) { ComparisonResult cmp = mstruct1.number().compareRealParts(mstruct2.number()); if(cmp == COMPARISON_RESULT_EQUAL) { cmp = mstruct1.number().compareImaginaryParts(mstruct2.number()); } if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } else { return -1; } } return -1; } case STRUCT_UNIT: { if(mstruct1.unit() < mstruct2.unit()) return -1; if(mstruct1.unit() == mstruct2.unit()) return 0; return 1; } case STRUCT_SYMBOLIC: { if(mstruct1.symbol() < mstruct2.symbol()) return -1; else if(mstruct1.symbol() == mstruct2.symbol()) return 0; return 1; } case STRUCT_VARIABLE: { if(mstruct1.variable() < mstruct2.variable()) return -1; else if(mstruct1.variable() == mstruct2.variable()) return 0; return 1; } case STRUCT_FUNCTION: { if(mstruct1.function() < mstruct2.function()) return -1; if(mstruct1.function() == mstruct2.function()) { for(size_t i = 0; i < mstruct2.size(); i++) { if(i >= mstruct1.size()) { return -1; } int i2 = evalSortCompare(mstruct1[i], mstruct2[i], parent, b_abs); if(i2 != 0) return i2; } return 0; } return 1; } case STRUCT_POWER: { int i = evalSortCompare(mstruct1[0], mstruct2[0], parent, b_abs); if(i == 0) { return evalSortCompare(mstruct1[1], mstruct2[1], parent, b_abs); } return i; } default: { if(mstruct2.size() < mstruct1.size()) return -1; else if(mstruct2.size() > mstruct1.size()) return 1; int ie; for(size_t i = 0; i < mstruct1.size(); i++) { ie = evalSortCompare(mstruct1[i], mstruct2[i], parent, b_abs); if(ie != 0) { return ie; } } } } return 0; } void MathStructure::evalSort(bool recursive, bool b_abs) { if(recursive) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).evalSort(true, b_abs); } } //if(m_type != STRUCT_ADDITION && m_type != STRUCT_MULTIPLICATION && m_type != STRUCT_LOGICAL_AND && m_type != STRUCT_LOGICAL_OR && m_type != STRUCT_LOGICAL_XOR && m_type != STRUCT_BITWISE_AND && m_type != STRUCT_BITWISE_OR && m_type != STRUCT_BITWISE_XOR) return; if(m_type != STRUCT_ADDITION && m_type != STRUCT_MULTIPLICATION && m_type != STRUCT_BITWISE_AND && m_type != STRUCT_BITWISE_OR && m_type != STRUCT_BITWISE_XOR) return; if(m_type == STRUCT_ADDITION && containsType(STRUCT_DATETIME, false, true, false) > 0) return; vector sorted; sorted.reserve(SIZE); for(size_t i = 0; i < SIZE; i++) { if(i == 0) { sorted.push_back(v_order[i]); } else { if(evalSortCompare(CHILD(i), *v_subs[sorted.back()], *this, b_abs) >= 0) { sorted.push_back(v_order[i]); } else if(sorted.size() == 1) { sorted.insert(sorted.begin(), v_order[i]); } else { for(size_t i2 = sorted.size() - 2; ; i2--) { if(evalSortCompare(CHILD(i), *v_subs[sorted[i2]], *this, b_abs) >= 0) { sorted.insert(sorted.begin() + i2 + 1, v_order[i]); break; } if(i2 == 0) { sorted.insert(sorted.begin(), v_order[i]); break; } } } } } for(size_t i2 = 0; i2 < sorted.size(); i2++) { v_order[i2] = sorted[i2]; } } int sortCompare(const MathStructure &mstruct1, const MathStructure &mstruct2, const MathStructure &parent, const PrintOptions &po); int sortCompare(const MathStructure &mstruct1, const MathStructure &mstruct2, const MathStructure &parent, const PrintOptions &po) { if(parent.isMultiplication()) { if(!mstruct1.representsNonMatrix() && !mstruct2.representsNonMatrix()) { return 0; } } if(parent.isAddition() && po.sort_options.minus_last) { bool m1 = mstruct1.hasNegativeSign(), m2 = mstruct2.hasNegativeSign(); if(m1 && !m2) { return 1; } else if(m2 && !m1) { return -1; } } if(parent.isAddition() && (mstruct1.isUnit() || (mstruct1.isMultiplication() && mstruct1.size() == 2 && mstruct1[1].isUnit())) && (mstruct2.isUnit() || (mstruct2.isMultiplication() && mstruct2.size() == 2 && mstruct2[1].isUnit()))) { Unit *u1, *u2; if(mstruct1.isUnit()) u1 = mstruct1.unit(); else u1 = mstruct1[1].unit(); if(mstruct2.isUnit()) u2 = mstruct2.unit(); else u2 = mstruct2[1].unit(); if(u1->isParentOf(u2)) return 1; if(u2->isParentOf(u1)) return -1; } bool isdiv1 = false, isdiv2 = false; if(!po.negative_exponents) { if(mstruct1.isMultiplication()) { for(size_t i = 0; i < mstruct1.size(); i++) { if(mstruct1[i].isPower() && mstruct1[i][1].hasNegativeSign()) { isdiv1 = true; break; } } } else if(mstruct1.isPower() && mstruct1[1].hasNegativeSign()) { isdiv1 = true; } if(mstruct2.isMultiplication()) { for(size_t i = 0; i < mstruct2.size(); i++) { if(mstruct2[i].isPower() && mstruct2[i][1].hasNegativeSign()) { isdiv2 = true; break; } } } else if(mstruct2.isPower() && mstruct2[1].hasNegativeSign()) { isdiv2 = true; } } if(parent.isAddition() && isdiv1 == isdiv2) { if(mstruct1.isMultiplication() && mstruct1.size() > 0) { size_t start = 0; while(mstruct1[start].isNumber() && mstruct1.size() > start + 1) { start++; } int i2; if(mstruct2.isMultiplication()) { if(mstruct2.size() < 1) return -1; size_t start2 = 0; while(mstruct2[start2].isNumber() && mstruct2.size() > start2 + 1) { start2++; } for(size_t i = 0; i + start < mstruct1.size(); i++) { if(i + start2 >= mstruct2.size()) return 1; i2 = sortCompare(mstruct1[i + start], mstruct2[i + start2], parent, po); if(i2 != 0) return i2; } if(mstruct1.size() - start == mstruct2.size() - start2) return 0; if(parent.isMultiplication()) return -1; else return 1; } else { i2 = sortCompare(mstruct1[start], mstruct2, parent, po); if(i2 != 0) return i2; } } else if(mstruct2.isMultiplication() && mstruct2.size() > 0) { size_t start = 0; while(mstruct2[start].isNumber() && mstruct2.size() > start + 1) { start++; } int i2; if(mstruct1.isMultiplication()) { return 1; } else { i2 = sortCompare(mstruct1, mstruct2[start], parent, po); if(i2 != 0) return i2; } } } if(mstruct1.isVariable() && mstruct1.variable() == CALCULATOR->v_C) return 1; if(mstruct2.isVariable() && mstruct2.variable() == CALCULATOR->v_C) return -1; if(mstruct1.type() != mstruct2.type()) { if(mstruct1.isVariable() && mstruct2.isSymbolic()) { if(parent.isMultiplication()) { if(mstruct1.variable()->isKnown()) return -1; } if(mstruct1.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name < mstruct2.symbol()) return -1; else return 1; } if(mstruct2.isVariable() && mstruct1.isSymbolic()) { if(parent.isMultiplication()) { if(mstruct2.variable()->isKnown()) return 1; } if(mstruct1.symbol() < mstruct2.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name) return -1; else return 1; } if(!parent.isMultiplication() || (!mstruct1.isNumber() && !mstruct2.isNumber())) { if(mstruct2.isPower()) { int i = sortCompare(mstruct1, mstruct2[0], parent, po); if(i == 0) { return sortCompare(m_one, mstruct2[1], parent, po); } return i; } if(mstruct1.isPower()) { int i = sortCompare(mstruct1[0], mstruct2, parent, po); if(i == 0) { return sortCompare(mstruct1[1], m_one, parent, po); } return i; } } if(parent.isMultiplication()) { if(mstruct2.isUnit()) return -1; if(mstruct1.isUnit()) return 1; if(mstruct1.isAddition() && !mstruct2.isAddition() && !mstruct1.containsUnknowns() && (mstruct2.isUnknown_exp() || (mstruct2.isMultiplication() && mstruct2.containsUnknowns()))) return -1; if(mstruct2.isAddition() && !mstruct1.isAddition() && !mstruct2.containsUnknowns() && (mstruct1.isUnknown_exp() || (mstruct1.isMultiplication() && mstruct1.containsUnknowns()))) return 1; } if(mstruct2.isAborted()) return -1; if(mstruct1.isAborted()) return 1; if(mstruct2.isInverse()) return -1; if(mstruct1.isInverse()) return 1; if(mstruct2.isDivision()) return -1; if(mstruct1.isDivision()) return 1; if(mstruct2.isNegate()) return -1; if(mstruct1.isNegate()) return 1; if(mstruct2.isLogicalAnd()) return -1; if(mstruct1.isLogicalAnd()) return 1; if(mstruct2.isLogicalOr()) return -1; if(mstruct1.isLogicalOr()) return 1; if(mstruct2.isLogicalXor()) return -1; if(mstruct1.isLogicalXor()) return 1; if(mstruct2.isLogicalNot()) return -1; if(mstruct1.isLogicalNot()) return 1; if(mstruct2.isComparison()) return -1; if(mstruct1.isComparison()) return 1; if(mstruct2.isBitwiseOr()) return -1; if(mstruct1.isBitwiseOr()) return 1; if(mstruct2.isBitwiseXor()) return -1; if(mstruct1.isBitwiseXor()) return 1; if(mstruct2.isBitwiseAnd()) return -1; if(mstruct1.isBitwiseAnd()) return 1; if(mstruct2.isBitwiseNot()) return -1; if(mstruct1.isBitwiseNot()) return 1; if(mstruct2.isUndefined()) return -1; if(mstruct1.isUndefined()) return 1; if(mstruct2.isFunction()) return -1; if(mstruct1.isFunction()) return 1; if(mstruct2.isAddition()) return -1; if(mstruct1.isAddition()) return 1; if(!parent.isMultiplication()) { if(isdiv2 && mstruct2.isMultiplication()) return -1; if(isdiv1 && mstruct1.isMultiplication()) return 1; if(mstruct2.isNumber()) return -1; if(mstruct1.isNumber()) return 1; } if(mstruct2.isMultiplication()) return -1; if(mstruct1.isMultiplication()) return 1; if(mstruct2.isPower()) return -1; if(mstruct1.isPower()) return 1; if(mstruct2.isUnit()) return -1; if(mstruct1.isUnit()) return 1; if(mstruct2.isSymbolic()) return -1; if(mstruct1.isSymbolic()) return 1; if(mstruct2.isVariable()) return -1; if(mstruct1.isVariable()) return 1; if(mstruct2.isDateTime()) return -1; if(mstruct1.isDateTime()) return 1; if(parent.isMultiplication()) { if(mstruct2.isNumber()) return -1; if(mstruct1.isNumber()) return 1; } return -1; } switch(mstruct1.type()) { case STRUCT_NUMBER: { if(!mstruct1.number().hasImaginaryPart() && !mstruct2.number().hasImaginaryPart()) { ComparisonResult cmp; if(parent.isMultiplication() && mstruct2.number().isNegative() != mstruct1.number().isNegative()) cmp = mstruct2.number().compare(mstruct1.number()); else cmp = mstruct1.number().compare(mstruct2.number()); if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } else { if(!mstruct1.number().hasRealPart()) { if(mstruct2.number().hasRealPart()) { return 1; } else { ComparisonResult cmp = mstruct1.number().compareImaginaryParts(mstruct2.number()); if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } } else if(mstruct2.number().hasRealPart()) { ComparisonResult cmp = mstruct1.number().compareRealParts(mstruct2.number()); if(cmp == COMPARISON_RESULT_EQUAL) { cmp = mstruct1.number().compareImaginaryParts(mstruct2.number()); } if(cmp == COMPARISON_RESULT_LESS) return -1; else if(cmp == COMPARISON_RESULT_GREATER) return 1; return 0; } else { return -1; } } return -1; } case STRUCT_UNIT: { if(mstruct1.unit() == mstruct2.unit()) return 0; if(mstruct1.unit()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, mstruct1.isPlural(), po.use_reference_names).name < mstruct2.unit()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, mstruct2.isPlural(), po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name) return -1; return 1; } case STRUCT_SYMBOLIC: { if(mstruct1.symbol() < mstruct2.symbol()) return -1; else if(mstruct1.symbol() == mstruct2.symbol()) return 0; return 1; } case STRUCT_VARIABLE: { if(mstruct1.variable() == mstruct2.variable()) return 0; if(parent.isMultiplication()) { if(mstruct1.variable()->isKnown() && !mstruct2.variable()->isKnown()) return -1; if(!mstruct1.variable()->isKnown() && mstruct2.variable()->isKnown()) return 1; } if(mstruct1.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names).name < mstruct2.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name) return -1; return 1; } case STRUCT_FUNCTION: { if(mstruct1.function() == mstruct2.function()) { for(size_t i = 0; i < mstruct2.size(); i++) { if(i >= mstruct1.size()) { return -1; } int i2 = sortCompare(mstruct1[i], mstruct2[i], parent, po); if(i2 != 0) return i2; } return 0; } if(mstruct1.function()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names).name < mstruct2.function()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg).name) return -1; return 1; } case STRUCT_POWER: { if(!po.negative_exponents) { bool b1 = mstruct1[1].hasNegativeSign(); bool b2 = mstruct2[1].hasNegativeSign(); if(b1 && !b2) return -1; if(b2 && !b1) return 1; } int i = sortCompare(mstruct1[0], mstruct2[0], parent, po); if(i == 0) { return sortCompare(mstruct1[1], mstruct2[1], parent, po); } return i; } case STRUCT_MULTIPLICATION: { if(isdiv1 != isdiv2) { if(isdiv1) return 1; return -1; } } case STRUCT_COMPARISON: { if(mstruct1.comparisonType() != mstruct2.comparisonType()) { if(mstruct2.comparisonType() == COMPARISON_EQUALS || ((mstruct1.comparisonType() == COMPARISON_LESS || mstruct1.comparisonType() == COMPARISON_EQUALS_LESS) && (mstruct2.comparisonType() == COMPARISON_GREATER || mstruct2.comparisonType() == COMPARISON_EQUALS_GREATER))) { return 1; } if(mstruct1.comparisonType() == COMPARISON_EQUALS || ((mstruct1.comparisonType() == COMPARISON_GREATER || mstruct1.comparisonType() == COMPARISON_EQUALS_GREATER) && (mstruct2.comparisonType() == COMPARISON_LESS || mstruct2.comparisonType() == COMPARISON_EQUALS_LESS))) { return -1; } } } default: { int ie; for(size_t i = 0; i < mstruct1.size(); i++) { if(i >= mstruct2.size()) return 1; ie = sortCompare(mstruct1[i], mstruct2[i], parent, po); if(ie != 0) { return ie; } } } } return 0; } void MathStructure::sort(const PrintOptions &po, bool recursive) { if(recursive) { for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; CHILD(i).sort(po); } } if(m_type == STRUCT_COMPARISON) { if((CHILD(0).isZero() && !CHILD(1).isZero()) || (CHILD(0).isNumber() && !CHILD(1).isNumber())) { SWAP_CHILDREN(0, 1) if(ct_comp == COMPARISON_LESS) ct_comp = COMPARISON_GREATER; else if(ct_comp == COMPARISON_EQUALS_LESS) ct_comp = COMPARISON_EQUALS_GREATER; else if(ct_comp == COMPARISON_GREATER) ct_comp = COMPARISON_LESS; else if(ct_comp == COMPARISON_EQUALS_GREATER) ct_comp = COMPARISON_EQUALS_LESS; } return; } if(m_type != STRUCT_ADDITION && m_type != STRUCT_MULTIPLICATION && m_type != STRUCT_BITWISE_AND && m_type != STRUCT_BITWISE_OR && m_type != STRUCT_BITWISE_XOR && m_type != STRUCT_LOGICAL_AND && m_type != STRUCT_LOGICAL_OR) return; if(m_type == STRUCT_ADDITION && containsType(STRUCT_DATETIME, false, true, false) > 0) return; vector sorted; bool b; PrintOptions po2 = po; po2.sort_options.minus_last = po.sort_options.minus_last && SIZE == 2; //!containsUnknowns(); for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return; b = false; for(size_t i2 = 0; i2 < sorted.size(); i2++) { if(sortCompare(CHILD(i), *v_subs[sorted[i2]], *this, po2) < 0) { sorted.insert(sorted.begin() + i2, v_order[i]); b = true; break; } } if(!b) sorted.push_back(v_order[i]); } if(CALCULATOR->aborted()) return; if(m_type == STRUCT_ADDITION && SIZE > 2 && po.sort_options.minus_last && v_subs[sorted[0]]->hasNegativeSign()) { for(size_t i2 = 1; i2 < sorted.size(); i2++) { if(CALCULATOR->aborted()) return; if(!v_subs[sorted[i2]]->hasNegativeSign()) { sorted.insert(sorted.begin(), sorted[i2]); sorted.erase(sorted.begin() + (i2 + 1)); break; } } } if(CALCULATOR->aborted()) return; for(size_t i2 = 0; i2 < sorted.size(); i2++) { v_order[i2] = sorted[i2]; } } bool MathStructure::containsOpaqueContents() const { if(isFunction()) return true; if(isUnit() && o_unit->subtype() != SUBTYPE_BASE_UNIT) return true; if(isVariable() && o_variable->isKnown()) return true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsOpaqueContents()) return true; } return false; } bool MathStructure::containsAdditionPower() const { if(m_type == STRUCT_POWER && CHILD(0).isAddition()) return true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsAdditionPower()) return true; } return false; } size_t MathStructure::countTotalChildren(bool count_function_as_one) const { if((m_type == STRUCT_FUNCTION && count_function_as_one) || SIZE == 0) return 1; size_t count = 0; for(size_t i = 0; i < SIZE; i++) { count += CHILD(i).countTotalChildren() + 1; } return count; } int test_comparisons(const MathStructure &msave, MathStructure &mthis, const MathStructure &x_var, const EvaluationOptions &eo, bool sub = false); bool try_isolate_x(MathStructure &mstruct, EvaluationOptions &eo3, const EvaluationOptions &eo); bool try_isolate_x(MathStructure &mstruct, EvaluationOptions &eo3, const EvaluationOptions &eo) { if(mstruct.isProtected()) return false; if(mstruct.isComparison()) { CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(mstruct); eo3.test_comparisons = false; eo3.warn_about_denominators_assumed_nonzero = false; mtest[0].calculatesub(eo3, eo); mtest[1].calculatesub(eo3, eo); eo3.test_comparisons = eo.test_comparisons; const MathStructure *x_var2; if(eo.isolate_var) x_var2 = eo.isolate_var; else x_var2 = &mstruct.find_x_var(); if(x_var2->isUndefined() || (mtest[0] == *x_var2 && !mtest[1].contains(*x_var2))) { CALCULATOR->endTemporaryStopMessages(); return false; } if(mtest.isolate_x(eo3, eo, *x_var2, false)) { if(test_comparisons(mstruct, mtest, *x_var2, eo3) >= 0) { CALCULATOR->endTemporaryStopMessages(true); mstruct = mtest; return true; } } CALCULATOR->endTemporaryStopMessages(); } else { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(try_isolate_x(mstruct[i], eo3, eo)) b = true; } return b; } return false; } bool compare_delete(MathStructure &mnum, MathStructure &mden, bool &erase1, bool &erase2, const EvaluationOptions &eo) { erase1 = false; erase2 = false; if(mnum == mden) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mnum.representsZero(true)) || mnum.representsNonZero(true) || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mnum.representsZero(true) && warn_about_denominators_assumed_nonzero(mnum, eo))) { erase1 = true; erase2 = true; } else { if(mnum.isPower()) { mnum.setToChild(1); mden.setToChild(1); return true; } return false; } return true; } if(!mnum.isPower() && !mden.isPower()) return false; MathStructure *mbase1, *mbase2, *mexp1 = NULL, *mexp2 = NULL; if(mnum.isPower()) { if(!IS_REAL(mnum[1])) return false; mexp1 = &mnum[1]; mbase1 = &mnum[0]; } else { mbase1 = &mnum; } if(mden.isPower()) { if(!IS_REAL(mden[1])) return false; mexp2 = &mden[1]; mbase2 = &mden[0]; } else { mbase2 = &mden; } if(mbase1->equals(*mbase2)) { if(mexp1 && mexp2) { if(mexp1->number().isLessThan(mexp2->number())) { erase1 = true; mexp2->number() -= mexp1->number(); if(mexp2->isOne()) mden.setToChild(1, true); } else { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true)) || mbase2->representsNonZero(true) || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true) && warn_about_denominators_assumed_nonzero(*mbase2, eo))) { erase2 = true; mexp1->number() -= mexp2->number(); if(mexp1->isOne()) mnum.setToChild(1, true); } else { if(mexp2->number().isFraction()) return false; mexp2->number()--; mexp1->number() -= mexp2->number(); if(mexp1->isOne()) mnum.setToChild(1, true); if(mexp2->isOne()) mden.setToChild(1, true); return true; } } return true; } else if(mexp1) { if(mexp1->number().isFraction()) { erase1 = true; mbase2->raise(m_one); (*mbase2)[1].number() -= mexp1->number(); return true; } if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true)) || mbase2->representsNonZero(true) || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true) && warn_about_denominators_assumed_nonzero(*mbase2, eo))) { mexp1->number()--; erase2 = true; if(mexp1->isOne()) mnum.setToChild(1, true); return true; } return false; } else if(mexp2) { if(mexp2->number().isFraction()) { if((!eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true)) || mbase2->representsNonZero(true) || (eo.warn_about_denominators_assumed_nonzero && eo.assume_denominators_nonzero && !mbase2->representsZero(true) && warn_about_denominators_assumed_nonzero(*mbase2, eo))) { erase2 = true; mbase1->raise(m_one); (*mbase1)[1].number() -= mexp2->number(); return true; } return false; } mexp2->number()--; erase1 = true; if(mexp2->isOne()) mden.setToChild(1, true); return true; } } return false; } bool factor1(const MathStructure &mstruct, MathStructure &mnum, MathStructure &mden, const EvaluationOptions &eo) { mnum.setUndefined(); mden.setUndefined(); if(mstruct.isAddition()) { bool b_num = false, b_den = false; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(mstruct[i][i2].isPower() && mstruct[i][i2][1].hasNegativeSign()) { b_den = true; if(b_num) break; } else { b_num = true; if(b_den) break; } } } else if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { b_den = true; if(b_num) break; } else { b_num = true; if(b_den) break; } } if(b_num && b_den) { MathStructure *mden_cur = NULL; vector multi_index; for(size_t i = 0; i < mstruct.size(); i++) { if(mnum.isUndefined()) { mnum.transform(STRUCT_ADDITION); } else { mnum.addChild(m_undefined); } if(mstruct[i].isMultiplication()) { if(!mden_cur) { mden_cur = new MathStructure(); mden_cur->setUndefined(); } for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(mstruct[i][i2].isPower() && mstruct[i][i2][1].hasNegativeSign()) { if(mden_cur->isUndefined()) { if(mstruct[i][i2][1].isMinusOne()) { *mden_cur = mstruct[i][i2][0]; } else if(mstruct[i][i2][1].isNumber()) { *mden_cur = mstruct[i][i2]; (*mden_cur)[1].number().negate(); } else { *mden_cur = mstruct[i][i2]; (*mden_cur)[1][0].number().negate(); } } else { if(mstruct[i][i2][1].isMinusOne()) { mden_cur->multiply(mstruct[i][i2][0], true); } else if(mstruct[i][i2][1].isNumber()) { mden_cur->multiply(mstruct[i][i2], true); (*mden_cur)[mden_cur->size() - 1][1].number().negate(); } else { mden_cur->multiply(mstruct[i][i2], true); (*mden_cur)[mden_cur->size() - 1][1][0].number().negate(); } } } else { if(mnum[mnum.size() - 1].isUndefined()) { mnum[mnum.size() - 1] = mstruct[i][i2]; } else { mnum[mnum.size() - 1].multiply(mstruct[i][i2], true); } } } if(mnum[mnum.size() - 1].isUndefined()) mnum[mnum.size() - 1].set(1, 1, 0); if(mden_cur->isUndefined()) { multi_index.push_back(-1); } else { multi_index.push_back(mden.size()); if(mden.isUndefined()) { mden.transform(STRUCT_MULTIPLICATION); mden[mden.size() - 1].set_nocopy(*mden_cur); mden_cur->unref(); } else { mden.addChild_nocopy(mden_cur); } mden_cur = NULL; } } else if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { multi_index.push_back(mden.size()); if(mden.isUndefined()) { mden.transform(STRUCT_MULTIPLICATION); } else { mden.addChild(m_undefined); } if(mstruct[i][1].isMinusOne()) { mden[mden.size() - 1] = mstruct[i][0]; } else { mden[mden.size() - 1] = mstruct[i]; unnegate_sign(mden[mden.size() - 1][1]); } mnum[mnum.size() - 1].set(1, 1, 0); } else { multi_index.push_back(-1); mnum[mnum.size() - 1] = mstruct[i]; } } for(size_t i = 0; i < mnum.size(); i++) { if(multi_index[i] < 0 && mnum[i].isOne()) { if(mden.size() == 1) { mnum[i] = mden[0]; } else { mnum[i] = mden; } } else { for(size_t i2 = 0; i2 < mden.size(); i2++) { if((long int) i2 != multi_index[i]) { mnum[i].multiply(mden[i2], true); } } } mnum[i].calculatesub(eo, eo, false); } if(mden.size() == 1) { mden.setToChild(1); } else { mden.calculatesub(eo, eo, false); } mnum.calculatesub(eo, eo, false); } } else if(mstruct.isMultiplication()) { bool b_num = false, b_den = false; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { b_den = true; if(b_num) break; } else { b_num = true; if(b_den) break; } } if(b_den && b_num) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][1].hasNegativeSign()) { if(mden.isUndefined()) { if(mstruct[i][1].isMinusOne()) { mden = mstruct[i][0]; } else { mden = mstruct[i]; unnegate_sign(mden[1]); } } else { if(mstruct[i][1].isMinusOne()) { mden.multiply(mstruct[i][0], true); } else { mden.multiply(mstruct[i], true); unnegate_sign(mden[mden.size() - 1][1]); } } } else { if(mnum.isUndefined()) { mnum = mstruct[i]; } else { mnum.multiply(mstruct[i], true); } } } } mden.calculatesub(eo, eo, false); } if(!mnum.isUndefined() && !mden.isUndefined()) { while(true) { mnum.factorize(eo, false, false, 0, true); mnum.evalSort(true); if(mnum.isMultiplication()) { for(size_t i = 0; i < mnum.size(); ) { if(mnum[i].isPower() && mnum[i][1].hasNegativeSign()) { if(mnum[i][1].isMinusOne()) { mnum[i][0].ref(); mden.multiply_nocopy(&mnum[i][0], true); } else { mnum[i].ref(); mden.multiply_nocopy(&mnum[i], true); unnegate_sign(mden[mden.size() - 1][1]); } mden.calculateMultiplyLast(eo); mnum.delChild(i + 1); } else { i++; } } if(mnum.size() == 0) mnum.set(1, 1, 0); else if(mnum.size() == 1) mnum.setToChild(1); } mden.factorize(eo, false, false, 0, true); mden.evalSort(true); bool b = false; if(mden.isMultiplication()) { for(size_t i = 0; i < mden.size(); ) { if(mden[i].isPower() && mden[i][1].hasNegativeSign()) { MathStructure *mden_inv = new MathStructure(mden[i]); if(mden_inv->calculateInverse(eo)) { mnum.multiply_nocopy(mden_inv, true); mnum.calculateMultiplyLast(eo); mden.delChild(i + 1); b = true; } else { mden_inv->unref(); i++; } } else { i++; } } if(mden.size() == 0) mden.set(1, 1, 0); else if(mden.size() == 1) mden.setToChild(1); } if(!b) break; } bool erase1, erase2; if(mnum.isMultiplication()) { for(long int i = 0; i < (long int) mnum.size(); i++) { if(mden.isMultiplication()) { for(size_t i2 = 0; i2 < mden.size(); i2++) { if(compare_delete(mnum[i], mden[i2], erase1, erase2, eo)) { if(erase1) mnum.delChild(i + 1); if(erase2) mden.delChild(i2 + 1); i--; break; } } } else { if(compare_delete(mnum[i], mden, erase1, erase2, eo)) { if(erase1) mnum.delChild(i + 1); if(erase2) mden.set(1, 1, 0); break; } } } } else if(mden.isMultiplication()) { for(size_t i = 0; i < mden.size(); i++) { if(compare_delete(mnum, mden[i], erase1, erase2, eo)) { if(erase1) mnum.set(1, 1, 0); if(erase2) mden.delChild(i + 1); break; } } } else { if(compare_delete(mnum, mden, erase1, erase2, eo)) { if(erase1) mnum.set(1, 1, 0); if(erase2) mden.set(1, 1, 0); } } if(mnum.isMultiplication()) { if(mnum.size() == 0) mnum.set(1, 1, 0); else if(mnum.size() == 1) mnum.setToChild(1); } if(mden.isMultiplication()) { if(mden.size() == 0) mden.set(1, 1, 0); else if(mden.size() == 1) mden.setToChild(1); } return true; } return false; } bool combination_factorize(MathStructure &mstruct) { bool retval = false; switch(mstruct.type()) { case STRUCT_ADDITION: { bool b = false; // 5/y + x/y + z = (5 + x)/y + z MathStructure mstruct_units(mstruct); MathStructure mstruct_new(mstruct); for(size_t i = 0; i < mstruct_units.size(); i++) { if(mstruct_units[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct_units[i].size();) { if(!mstruct_units[i][i2].isPower() || !mstruct_units[i][i2][1].hasNegativeSign()) { mstruct_units[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_units[i].size() == 0) mstruct_units[i].setUndefined(); else if(mstruct_units[i].size() == 1) mstruct_units[i].setToChild(1); for(size_t i2 = 0; i2 < mstruct_new[i].size();) { if(mstruct_new[i][i2].isPower() && mstruct_new[i][i2][1].hasNegativeSign()) { mstruct_new[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_new[i].size() == 0) mstruct_new[i].set(1, 1, 0); else if(mstruct_new[i].size() == 1) mstruct_new[i].setToChild(1); } else if(mstruct_new[i].isPower() && mstruct_new[i][1].hasNegativeSign()) { mstruct_new[i].set(1, 1, 0); } else { mstruct_units[i].setUndefined(); } } for(size_t i = 0; i < mstruct_units.size(); i++) { if(!mstruct_units[i].isUndefined()) { for(size_t i2 = i + 1; i2 < mstruct_units.size();) { if(mstruct_units[i2] == mstruct_units[i]) { mstruct_new[i].add(mstruct_new[i2], true); mstruct_new.delChild(i2 + 1); mstruct_units.delChild(i2 + 1); b = true; } else { i2++; } } if(mstruct_new[i].isOne()) mstruct_new[i].set(mstruct_units[i]); else mstruct_new[i].multiply(mstruct_units[i], true); } } if(b) { if(mstruct_new.size() == 1) { mstruct.set(mstruct_new[0], true); } else { mstruct = mstruct_new; } b = false; retval = true; } if(!b && mstruct.isAddition()) { // 5x + pi*x + 5y + xy = (5 + pi)x + 5y + xy MathStructure mstruct_units(mstruct); MathStructure mstruct_new(mstruct); for(size_t i = 0; i < mstruct_units.size(); i++) { if(mstruct_units[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct_units[i].size();) { if(!mstruct_units[i][i2].containsType(STRUCT_UNIT, true) && !mstruct_units[i][i2].containsUnknowns()) { mstruct_units[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_units[i].size() == 0) mstruct_units[i].setUndefined(); else if(mstruct_units[i].size() == 1) mstruct_units[i].setToChild(1); for(size_t i2 = 0; i2 < mstruct_new[i].size();) { if(mstruct_new[i][i2].containsType(STRUCT_UNIT, true) || mstruct_new[i][i2].containsUnknowns()) { mstruct_new[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_new[i].size() == 0) mstruct_new[i].set(1, 1, 0); else if(mstruct_new[i].size() == 1) mstruct_new[i].setToChild(1); } else if(mstruct_units[i].containsType(STRUCT_UNIT, true) || mstruct_units[i].containsUnknowns()) { mstruct_new[i].set(1, 1, 0); } else { mstruct_units[i].setUndefined(); } } for(size_t i = 0; i < mstruct_units.size(); i++) { if(!mstruct_units[i].isUndefined()) { for(size_t i2 = i + 1; i2 < mstruct_units.size();) { if(mstruct_units[i2] == mstruct_units[i]) { mstruct_new[i].add(mstruct_new[i2], true); mstruct_new.delChild(i2 + 1); mstruct_units.delChild(i2 + 1); b = true; } else { i2++; } } if(mstruct_new[i].isOne()) mstruct_new[i].set(mstruct_units[i]); else mstruct_new[i].multiply(mstruct_units[i], true); } } if(b) { if(mstruct_new.size() == 1) mstruct.set(mstruct_new[0], true); else mstruct = mstruct_new; retval = true; } } //if(retval) return retval; } default: { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(combination_factorize(mstruct[i])) { mstruct.childUpdated(i); b = true; } } if(b) retval = true; } } return retval; } bool MathStructure::simplify(const EvaluationOptions &eo, bool unfactorize) { if(SIZE == 0) return false; if(unfactorize) { unformat(); EvaluationOptions eo2 = eo; eo2.expand = true; eo2.combine_divisions = false; eo2.sync_units = false; calculatesub(eo2, eo2); bool b = do_simplification(*this, eo2, true, false, false); return combination_factorize(*this) || b; } return combination_factorize(*this); } bool MathStructure::structure(StructuringMode structuring, const EvaluationOptions &eo, bool restore_first) { switch(structuring) { case STRUCTURING_NONE: { if(restore_first) { EvaluationOptions eo2 = eo; eo2.sync_units = false; calculatesub(eo2, eo2); } return false; } case STRUCTURING_FACTORIZE: { return factorize(eo, restore_first); } default: { return simplify(eo, restore_first); } } } void clean_multiplications(MathStructure &mstruct); void clean_multiplications(MathStructure &mstruct) { if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isMultiplication()) { size_t i2 = 0; for(; i2 < mstruct[i + i2].size(); i2++) { mstruct[i + i2][i2].ref(); mstruct.insertChild_nocopy(&mstruct[i + i2][i2], i + i2 + 1); } mstruct.delChild(i + i2 + 1); } } } for(size_t i = 0; i < mstruct.size(); i++) { clean_multiplications(mstruct[i]); } } bool containsComplexUnits(const MathStructure &mstruct) { if(mstruct.type() == STRUCT_UNIT && mstruct.unit()->hasComplexRelationTo(mstruct.unit()->baseUnit())) return true; for(size_t i = 0; i < mstruct.size(); i++) { if(containsComplexUnits(mstruct[i])) { return true; } } return false; } bool variablesContainsComplexUnits(const MathStructure &mstruct, const EvaluationOptions &eo) { if(mstruct.type() == STRUCT_VARIABLE && mstruct.variable()->isKnown() && (eo.approximation != APPROXIMATION_EXACT || !mstruct.variable()->isApproximate()) && ((KnownVariable*) mstruct.variable())->get().containsType(STRUCT_UNIT, false, true, true)) { return containsComplexUnits(((KnownVariable*) mstruct.variable())->get()); } for(size_t i = 0; i < mstruct.size(); i++) { if(variablesContainsComplexUnits(mstruct[i], eo)) { return true; } } return false; } bool expandVariablesWithUnits(MathStructure &mstruct, const EvaluationOptions &eo) { if(mstruct.type() == STRUCT_VARIABLE && mstruct.variable()->isKnown() && (eo.approximation != APPROXIMATION_EXACT || !mstruct.variable()->isApproximate()) && ((KnownVariable*) mstruct.variable())->get().containsType(STRUCT_UNIT, false, true, true) != 0) { mstruct.set(((KnownVariable*) mstruct.variable())->get()); return true; } bool retval = false; for(size_t i = 0; i < mstruct.size(); i++) { if(expandVariablesWithUnits(mstruct[i], eo)) { mstruct.childUpdated(i + 1); retval = true; } } return retval; } int limit_inf_cmp(const MathStructure &mstruct, const MathStructure &mcmp, const MathStructure &x_var) { if(mstruct.equals(mcmp)) return 0; bool b_multi1 = false, b_multi2 = false; const MathStructure *m1 = NULL, *m2 = NULL; if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].contains(x_var)) { if(!m1) { m1 = &mstruct[i]; } else { int cmp = limit_inf_cmp(mstruct[i], *m1, x_var); if(cmp > 0) { m1 = &mstruct[i]; } else if(cmp != -1) { return -2; } b_multi1 = true; } } } } else if(mstruct.contains(x_var, true)) { m1 = &mstruct; } if(mcmp.isMultiplication()) { for(size_t i = 0; i < mcmp.size(); i++) { if(mcmp[i].contains(x_var)) { if(!m2) { m2 = &mcmp[i]; } else { int cmp = limit_inf_cmp(mcmp[i], *m2, x_var); if(cmp > 0) { m2 = &mcmp[i]; } else if(cmp != -1) { return -2; } b_multi2 = true; } } } } else if(mcmp.contains(x_var, true)) { m2 = &mcmp; } if(!m1 && !m2) return 0; if(!m1) return -1; if(!m2) return 1; int itype1 = 0; int itype2 = 0; if(m1->isFunction() && m1->function() == CALCULATOR->f_gamma) itype1 = 4; else if(m1->isPower() && m1->exponent()->contains(x_var, true)) itype1 = 3; else if(m1->equals(x_var) || (m1->isPower() && m1->base()->equals(x_var) && m1->exponent()->representsPositive())) itype1 = 2; else if(m1->isFunction() && m1->function() == CALCULATOR->f_ln) itype1 = 1; else return -2; if(m2->isFunction() && m2->function() == CALCULATOR->f_gamma) itype2 = 4; else if(m2->isPower() && m2->exponent()->contains(x_var, true)) itype2 = 3; else if(m2->equals(x_var) || (m2->isPower() && m2->base()->equals(x_var) && m2->exponent()->representsPositive())) itype2 = 2; else if(m2->isFunction() && m2->function() == CALCULATOR->f_ln) itype2 = 1; else return -2; if(itype1 > itype2) return 1; if(itype2 > itype1) return -1; ComparisonResult cr = COMPARISON_RESULT_UNKNOWN; CALCULATOR->beginTemporaryEnableIntervalArithmetic(); if(itype1 == 4) { cr = m1->getChild(1)->compare(*m2->getChild(1)); } else if(itype1 == 1) { int cmp = limit_inf_cmp(*m1->getChild(1), *m2->getChild(1), x_var); if(cmp > 0) cr = COMPARISON_RESULT_LESS; else if(cmp == -1) cr = COMPARISON_RESULT_GREATER; } else if(itype1 == 3) { if(m1->exponent()->equals(*m2->exponent())) { if(m1->base()->contains(x_var, true) || m2->base()->contains(x_var, true)) { int cmp = limit_inf_cmp(*m1->base(), *m2->base(), x_var); if(cmp > 0) cr = COMPARISON_RESULT_LESS; else if(cmp == -1) cr = COMPARISON_RESULT_GREATER; } else { cr = m1->base()->compareApproximately(*m2->base()); } } else if(m1->base()->equals(*m2->base())) { int cmp = limit_inf_cmp(*m1->exponent(), *m2->exponent(), x_var); if(cmp > 0) cr = COMPARISON_RESULT_LESS; else if(cmp == -1) cr = COMPARISON_RESULT_GREATER; else if(cmp == 0) cr = m1->exponent()->compareApproximately(*m2->exponent()); } } else if(itype1 == 2) { if(m1->equals(x_var)) { if(m2->equals(x_var)) cr = COMPARISON_RESULT_EQUAL; else cr = m_one.compareApproximately(*m2->getChild(2)); } else if(m2->equals(x_var)) { cr = m1->getChild(2)->compareApproximately(m_one); } else { cr = m1->getChild(2)->compareApproximately(*m2->getChild(2)); } } CALCULATOR->endTemporaryEnableIntervalArithmetic(); if(cr == COMPARISON_RESULT_GREATER) return -1; else if(cr == COMPARISON_RESULT_LESS) return 1; else if(cr != COMPARISON_RESULT_EQUAL) return -2; if(!b_multi1 && !b_multi2) return 0; if(!b_multi1) return -1; if(!b_multi2) return 1; MathStructure mc1(mstruct), mc2(mcmp); for(size_t i = 0; i < mc1.size(); i++) { if(&mstruct[i] == m1) {mc1.delChild(i + 1, true); break;} } for(size_t i = 0; i < mc2.size(); i++) { if(&mcmp[i] == m2) {mc2.delChild(i + 1, true); break;} } return limit_inf_cmp(mc1, mc2, x_var); } bool is_limit_neg_power(const MathStructure &mstruct, const MathStructure &x_var, bool b_nil) { return mstruct.isPower() && (((!b_nil || !mstruct[1].contains(x_var, true)) && mstruct[1].representsNegative()) || (b_nil && mstruct[1].isMultiplication() && mstruct[1].size() == 2 && mstruct[1][1] == x_var && mstruct[1][0].representsNegative())); } bool limit_combine_divisions(MathStructure &mstruct, const MathStructure &x_var, const MathStructure &nr_limit) { if(mstruct.isAddition()) { bool b = false; bool b_nil = nr_limit.isInfinite(false) && nr_limit.number().isMinusInfinity(); // 5/y + x/y + z = (5 + x)/y + z for(size_t i = 0; i < mstruct.size() && !b; i++) { if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i].size() && !b; i2++) { if(is_limit_neg_power(mstruct[i][i2], x_var, b_nil)) { b = true; } } } else if(is_limit_neg_power(mstruct[i], x_var, b_nil)) { b = true; } } if(!b) return false; b = false; MathStructure mstruct_units(mstruct); MathStructure mstruct_new(mstruct); for(size_t i = 0; i < mstruct_units.size(); i++) { if(mstruct_units[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct_units[i].size();) { if(!is_limit_neg_power(mstruct_units[i][i2], x_var, b_nil)) { mstruct_units[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_units[i].size() == 0) mstruct_units[i].setUndefined(); else if(mstruct_units[i].size() == 1) mstruct_units[i].setToChild(1); for(size_t i2 = 0; i2 < mstruct_new[i].size();) { if(is_limit_neg_power(mstruct_new[i][i2], x_var, b_nil)) { mstruct_new[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_new[i].size() == 0) mstruct_new[i].set(1, 1, 0); else if(mstruct_new[i].size() == 1) mstruct_new[i].setToChild(1); } else if(is_limit_neg_power(mstruct_new[i], x_var, b_nil)) { mstruct_new[i].set(1, 1, 0); } else { mstruct_units[i].setUndefined(); } } for(size_t i = 0; i < mstruct_units.size(); i++) { if(!mstruct_units[i].isUndefined()) { for(size_t i2 = i + 1; i2 < mstruct_units.size();) { if(mstruct_units[i2] == mstruct_units[i]) { mstruct_new[i].add(mstruct_new[i2], true); mstruct_new.delChild(i2 + 1); mstruct_units.delChild(i2 + 1); b = true; } else { i2++; } } if(mstruct_new[i].isOne()) { mstruct_new[i].set(mstruct_units[i]); } else if(mstruct_units[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct_units[i].size(); i2++) { mstruct_new[i].multiply(mstruct_units[i][i2], true); } } else { mstruct_new[i].multiply(mstruct_units[i], true); } } } if(b) { if(mstruct_new.size() == 1) { mstruct.set(mstruct_new[0], true); } else { mstruct = mstruct_new; } return true; } } return false; } bool limit_combine_divisions2(MathStructure &mstruct, const MathStructure &x_var, const MathStructure &nr_limit, const EvaluationOptions &eo) { if(mstruct.isAddition()) { MathStructure mden(1, 1, 0); bool b = false; bool b_nil = nr_limit.isInfinite(false) && nr_limit.number().isMinusInfinity(); size_t i_d = 0; for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(mstruct[i2].isMultiplication()) { for(size_t i3 = 0; i3 < mstruct[i2].size(); i3++) { if(is_limit_neg_power(mstruct[i2][i3], x_var, b_nil)) { mden *= mstruct[i2][i3]; mden.last()[1].negate(); i_d++; } else if(!mstruct[i2][i3].isOne() && !mstruct[i2][i3].isMinusOne()) { b = true; } } } else if(is_limit_neg_power(mstruct[i2], x_var, b_nil)) { mden *= mstruct[i2]; mden.last()[1].negate(); i_d++; } else { b = true; } } if(mden.isOne() || !b || i_d > 10) return false; for(size_t i = 0; i < mstruct.size(); i++) { for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(i2 != i) { if(mstruct[i2].isMultiplication()) { for(size_t i3 = 0; i3 < mstruct[i2].size(); i3++) { if(is_limit_neg_power(mstruct[i2][i3], x_var, b_nil)) { mstruct[i].multiply(mstruct[i2][i3], true); mstruct[i].last()[1].negate(); } } } else if(is_limit_neg_power(mstruct[i2], x_var, b_nil)) { mstruct[i].multiply(mstruct[i2], true); mstruct[i].last()[1].negate(); } } } } for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(mstruct[i2].isMultiplication()) { for(size_t i3 = 0; i3 < mstruct[i2].size();) { if(is_limit_neg_power(mstruct[i2][i3], x_var, b_nil)) { mstruct[i2].delChild(i3 + 1); } else { i3++; } } if(mstruct[i2].size() == 0) mstruct[i2].set(1, 1, 0); else if(mstruct[i2].size() == 1) mstruct[i2].setToChild(1); } else if(is_limit_neg_power(mstruct[i2], x_var, b_nil)) { mstruct[i2].set(1, 1, 0); } } mden.calculatesub(eo, eo, true); mstruct.calculatesub(eo, eo, true); mstruct /= mden; return true; } return false; } bool contains_zero(const MathStructure &mstruct) { if(mstruct.isNumber() && !mstruct.number().isNonZero()) return true; for(size_t i = 0; i < mstruct.size(); i++) { if(contains_zero(mstruct[i])) return true; } return false; } bool limit_contains_undefined(const MathStructure &mstruct) { bool b_zero = false, b_infinity = false; if(mstruct.isPower() && mstruct[0].isNumber() && ((!mstruct[0].number().isNonZero() && mstruct[1].representsNegative()) || mstruct[1].containsInfinity(true))) return true; for(size_t i = 0; i < mstruct.size(); i++) { if(limit_contains_undefined(mstruct[i])) return true; if(contains_zero(mstruct[i])) { if(b_infinity) return true; b_zero = true; } if(mstruct[i].containsInfinity(true)) { if(b_infinity || b_zero) return true; b_infinity = true; } } return false; } bool is_plus_minus_infinity(const MathStructure &mstruct) { return mstruct.isInfinite(false) || (mstruct.isPower() && mstruct[0].isZero() && mstruct[1].representsNegative()) || (mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].representsReal() && mstruct[1].isPower() && mstruct[1][0].isZero() && mstruct[1][1].representsNegative()); } bool calculate_limit_sub(MathStructure &mstruct, const MathStructure &x_var, const MathStructure &nr_limit, const EvaluationOptions &eo, int approach_direction, Number *polydeg = NULL, int lhop_depth = 0, bool keep_inf_x = false, bool reduce_addition = true) { if(CALCULATOR->aborted()) return false; if(mstruct == x_var) { if(keep_inf_x && nr_limit.isInfinite(false)) return true; mstruct.set(nr_limit, true); return true; } if(!mstruct.contains(x_var, true)) return true; switch(mstruct.type()) { case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][0].isPower() && mstruct[i][0][0].contains(x_var, true) && !mstruct[i][0][0].representsNonPositive()) { MathStructure mtest(mstruct[i][0][0]); calculate_limit_sub(mtest, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); if(mtest.representsPositive()) { mstruct[i][0][1].calculateMultiply(mstruct[i][1], eo); mstruct[i].setToChild(1); } } } MathStructure mzero(1, 1, 0); MathStructure minfp(1, 1, 0); MathStructure mleft; vector irecalc; MathStructure mbak(mstruct); bool b_inf = false; bool b_li = nr_limit.isInfinite(false); bool b_fail = false; bool b_test_inf = b_li; for(size_t i = 0; i < mstruct.size(); i++) { bool b = false; if(!b_fail && mstruct[i].isPower() && mstruct[i][0].contains(x_var, true) && mstruct[i][1].representsNegative()) { if(mstruct[i][1].isMinusOne()) { mstruct[i].setToChild(1); } else { mstruct[i][1].calculateNegate(eo); } calculate_limit_sub(mstruct[i], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); if(mstruct[i].isZero()) { b = true; if(b_test_inf && !mbak[i][1].contains(x_var, true)) b_test_inf = false; if(minfp.isOne()) { minfp = mbak[i]; if(!b_li) { if(minfp[1].isMinusOne()) minfp.setToChild(1); else minfp[1].calculateNegate(eo); } } else { minfp.multiply(mbak[i], true); if(!b_li) { if(minfp.last()[1].isMinusOne()) minfp.last().setToChild(1); else minfp.last()[1].calculateNegate(eo); } } irecalc.push_back(i); mstruct[i].inverse(); } else if(mstruct[i].isInfinite()) { b = true; if(mzero.isOne()) { mzero = mbak[i]; if(b_li) { if(mzero[1].isMinusOne()) mzero.setToChild(1); else mzero[1].calculateNegate(eo); } } else { mzero.multiply(mbak[i], true); if(b_li) { if(mzero.last()[1].isMinusOne()) mzero.last().setToChild(1); else mzero.last()[1].calculateNegate(eo); } } mstruct[i].clear(true); } else { mstruct[i].calculateInverse(eo); } } else { calculate_limit_sub(mstruct[i], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); } if(!b_fail && !b) { if(mstruct[i].isZero()) { if(b_li && mbak[i].isPower()) { if(b_test_inf && !mbak[i][1].contains(x_var, true)) b_test_inf = false; if(mzero.isOne()) { mzero = mbak[i]; if(mzero[1].isMinusOne()) mzero.setToChild(1); else mzero[1].calculateNegate(eo); } else { mzero.multiply(mbak[i], true); if(mzero.last()[1].isMinusOne()) mzero.last().setToChild(1); else mzero.last()[1].calculateNegate(eo); } } else { b_test_inf = false; if(mzero.isOne()) { mzero = mbak[i]; if(b_li) { if(!mzero.isPower()) mzero.inverse(); else if(mzero[1].isMinusOne()) mzero.setToChild(1); else mzero[1].calculateNegate(eo); } } else { mzero.multiply(mbak[i], true); if(b_li) { if(!mzero.last().isPower()) mzero.last().inverse(); else if(mzero.last()[1].isMinusOne()) mzero.last().setToChild(1); else mzero.last()[1].calculateNegate(eo); } } } } else if(is_plus_minus_infinity(mstruct[i])) { if(mstruct[i].isInfinite()) { b_inf = true; if(minfp.isOne()) { minfp = mbak[i]; if(!b_li) { if(!minfp.isPower()) minfp.inverse(); else if(minfp[1].isMinusOne()) minfp.setToChild(1); else minfp[1].calculateNegate(eo); } } else { minfp.multiply(mbak[i], true); if(!b_li) { if(!minfp.last().isPower()) minfp.last().inverse(); else if(minfp.last()[1].isMinusOne()) minfp.last().setToChild(1); else minfp.last()[1].calculateNegate(eo); } } } else { b_test_inf = false; if(minfp.isOne()) { minfp = mbak[i]; if(!b_li) { if(!minfp.isPower()) minfp.inverse(); else if(minfp[1].isMinusOne()) minfp[1].setToChild(1); else minfp[1].calculateNegate(eo); } } else { minfp.multiply(mbak[i], true); if(!b_li) { if(!minfp.last().isPower()) minfp.last().inverse(); else if(minfp.last()[1].isMinusOne()) minfp.last().setToChild(1); else minfp.last()[1].calculateNegate(eo); } } } } else if(!mstruct[i].representsNonZero(true) || !mstruct[i].representsNumber(true)) { b_fail = true; } else { mstruct[i].ref(); mleft.addChild_nocopy(&mstruct[i]); } } } if(b_li) b_inf = !b_inf; if(b_li && b_test_inf && !mzero.isOne() && !minfp.isOne()) { MathStructure mnum(minfp); MathStructure mden(mzero); mnum.calculatesub(eo, eo, false); mden.calculatesub(eo, eo, false); MathStructure mnum_bak(mnum), mden_bak(mden); calculate_limit_sub(mnum, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, true); calculate_limit_sub(mden, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, true); if(mnum.contains(x_var, true) && mden.contains(x_var, true)) { int cmp = limit_inf_cmp(mnum, mden, x_var); if(cmp == 0) { mstruct.set(mnum); EvaluationOptions eo2 = eo; eo2.expand = false; mstruct.calculateDivide(mden, eo2); if(!mstruct.contains(x_var)) { for(size_t i = 0; i < mleft.size(); i++) { mstruct.calculateMultiply(mleft[i], eo); } break; } } MathStructure mnum_b(mnum), mden_b(mden); calculate_limit_sub(mnum, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); calculate_limit_sub(mden, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); if(mnum.isInfinite(false) && mden.isInfinite(false)) { if(cmp > 0) { if(keep_inf_x) { mstruct.set(mnum_b, true); mstruct.calculateDivide(mden_b, eo); break; } mstruct.set(mnum, true); if(mden.number().isNegative()) mstruct.calculateNegate(eo); break; } else if(cmp == -1) { mstruct.clear(true); break; } if(mnum_b.isPower() && mden_b.isPower() && mnum_b[1].contains(x_var, true) && mden_b[1].contains(x_var, true)) { bool b = true; if(mden_b[1] != mnum_b[1]) { b = false; Number npow1(1, 1, 0), npow2; MathStructure *x_p = &mnum_b[1]; if(mnum_b[1].isMultiplication() && mnum_b[1].size() == 2 && mnum_b[1][0].isNumber()) { npow1 = mnum_b[1][0].number(); x_p = &mnum_b[1][1]; } if(mden_b[1] == *x_p) npow2.set(1, 1, 0); else if(mden_b[1].isMultiplication() && mden_b[1].size() == 2 && mden_b[1][0].isNumber() && mden_b[1][1] == *x_p) npow2 = mden_b[1][0].number(); if(!npow2.isZero() && npow1.isRational() && npow2.isRational()) { if(npow1.isGreaterThan(npow2)) { npow1 /= npow2; npow2 = npow1.denominator(); npow1 = npow1.numerator(); } if(mnum.number().isMinusInfinity() && !npow1.isOne()) { if(npow2.isOne() && mden.number().isPlusInfinity()) { mden_b[0].factorize(eo, false, false, 0, false, false, NULL, m_undefined, false, true); if(mden_b[0].isPower() && mden_b[0][1].isInteger()) { mden_b[0][1].number() /= npow1; if(mden_b[0][1].number().isInteger()) { mden_b[0].calculateRaiseExponent(eo); b = true; } } } } else if(mden.number().isMinusInfinity() && !npow2.isOne()) { if(npow1.isOne() && mnum.number().isPlusInfinity()) { mnum_b[0].factorize(eo, false, false, 0, false, false, NULL, m_undefined, false, true); if(mnum_b[0].isPower() && mnum_b[0][1].isInteger()) { mnum_b[0][1].number() /= npow2; if(mnum_b[0][1].number().isInteger()) { mnum_b[0].calculateRaiseExponent(eo); mnum_b[1] = mden_b[1]; b = true; } } } } else { if(!npow1.isOne()) mnum_b[0].calculateRaise(npow1, eo); if(!npow2.isOne()) mden_b[0].calculateRaise(npow2, eo); mnum_b.childUpdated(1); mden_b.childUpdated(1); if(!npow1.isOne()) { if(&mnum_b[1] == x_p) { npow1.recip(); mnum_b[1] *= npow1; mnum_b[1].swapChildren(1, 2); } else { mnum_b[1][0].number() /= npow1; } } b = true; } } } if(b) { mstruct.set(mnum_b[0], true); mstruct /= mden_b[0]; mstruct.transform(CALCULATOR->f_ln); mstruct *= mnum_b[1]; mstruct.raise(CALCULATOR->v_e); mstruct.swapChildren(1, 2); calculate_limit_sub(mstruct, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, keep_inf_x); for(size_t i = 0; i < mleft.size(); i++) { mstruct.calculateMultiply(mleft[i], eo); } break; } } } } } if(!b_fail && lhop_depth < 5 && !mzero.isOne() && !minfp.isOne() && mzero.countTotalChildren(false) + minfp.countTotalChildren(false) < 50) { //L'Hôpital's rule MathStructure mden, mnum; for(size_t i2 = 0; i2 < 2; i2++) { if((i2 == 0) != b_inf) { mnum = mzero; mden = minfp; if(b_li) { mden.inverse(); mnum.inverse(); } } else { mnum = minfp; mden = mzero; if(!b_li) { mden.inverse(); mnum.inverse(); } } if(mnum.differentiate(x_var, eo) && !mnum.containsFunction(CALCULATOR->f_diff, true) && mden.differentiate(x_var, eo) && !mden.containsFunction(CALCULATOR->f_diff, true)) { mnum /= mden; mnum.eval(eo); calculate_limit_sub(mnum, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth + 1); if(!limit_contains_undefined(mnum)) { mstruct.set(mnum, true); for(size_t i = 0; i < mleft.size(); i++) { mstruct.calculateMultiply(mleft[i], eo); } return true; } } } } for(size_t i = 0; i < irecalc.size(); i++) { mstruct[irecalc[i]] = mbak[irecalc[i]]; calculate_limit_sub(mstruct[irecalc[i]], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); } mstruct.childrenUpdated(); mstruct.calculatesub(eo, eo, false); if(keep_inf_x && mstruct.isInfinite(false)) { mstruct = mbak; if(reduce_addition) { for(size_t i = 0; i < mstruct.size(); i++) { calculate_limit_sub(mstruct[i], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, true, reduce_addition); if(mstruct[i].isZero()) mstruct[i] = mbak[i]; } mstruct.childrenUpdated(); mstruct.calculatesub(eo, eo, false); } } break; } case STRUCT_ADDITION: { bool b = limit_combine_divisions(mstruct, x_var, nr_limit); if(mstruct.isAddition()) b = limit_combine_divisions2(mstruct, x_var, nr_limit, eo); if(b) return calculate_limit_sub(mstruct, x_var, nr_limit, eo, approach_direction, polydeg, lhop_depth); if(nr_limit.isInfinite(false)) { size_t i_cmp = 0; b = true; MathStructure mbak(mstruct); for(size_t i = 0; i < mstruct.size(); i++) { calculate_limit_sub(mstruct[i], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, true); } if(mstruct.contains(x_var, true) && (!keep_inf_x || reduce_addition)) { bool bfac = false; MathStructure mstruct_units(mstruct); MathStructure mstruct_new(mstruct); for(size_t i = 0; i < mstruct_units.size(); i++) { if(mstruct_units[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct_units[i].size();) { if(!mstruct_units[i][i2].contains(x_var, true)) { mstruct_units[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_units[i].size() == 0) mstruct_units[i].setUndefined(); else if(mstruct_units[i].size() == 1) mstruct_units[i].setToChild(1); for(size_t i2 = 0; i2 < mstruct_new[i].size();) { if(mstruct_new[i][i2].contains(x_var, true)) { mstruct_new[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_new[i].size() == 0) mstruct_new[i].set(1, 1, 0); else if(mstruct_new[i].size() == 1) mstruct_new[i].setToChild(1); } else if(mstruct_units[i].contains(x_var, true)) { mstruct_new[i].set(1, 1, 0); } else { mstruct_units[i].setUndefined(); } } for(size_t i = 0; i < mstruct_units.size(); i++) { if(!mstruct_units[i].isUndefined()) { for(size_t i2 = i + 1; i2 < mstruct_units.size(); i2++) { if(mstruct_units[i2] == mstruct_units[i]) { mstruct_new[i].add(mstruct_new[i2], true); bfac = true; } } bool bfac2 = false; MathStructure mzero(mstruct_new[i]); mzero.calculatesub(eo, eo, false); if(bfac && mzero.isZero() && lhop_depth < 5) { MathStructure mfac(mbak[i]); bool b_diff = false; calculate_limit_sub(mfac, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, true, false); if(mfac != mstruct[i]) b_diff = true; for(size_t i2 = i + 1; i2 < mstruct_units.size(); i2++) { if(mstruct_units[i2] == mstruct_units[i]) { mfac.add(mbak[i2], true); calculate_limit_sub(mfac.last(), x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, true, false); if(!b_diff && mfac.last() != mstruct[i2]) b_diff = true; bfac2 = true; } } if(bfac2) { mfac.calculatesub(eo, eo, false); if(!mfac.isAddition()) { calculate_limit_sub(mfac, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth + 1, true); mstruct_new[i].set(mfac, true); } else if(!b_diff) { bfac2 = false; } else if(mfac.size() == 2 && !mfac.containsType(STRUCT_FUNCTION)) { MathStructure mfac2(mfac); MathStructure mmul(mfac); mmul.last().calculateNegate(eo); mfac.calculateMultiply(mmul, eo); mfac.divide(mmul); calculate_limit_sub(mfac, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth + 1, true); if(limit_contains_undefined(mfac)) { mfac2.factorize(eo, false, false, 0, false, false, NULL, m_undefined, false, false); if(!mfac2.isAddition()) { calculate_limit_sub(mfac2, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth + 1, true); mstruct_new[i].set(mfac2, true); } else { bfac2 = false; } } else { mstruct_new[i].set(mfac, true); } } else { mfac.factorize(eo, false, false, 0, false, false, NULL, m_undefined, false, false); if(!mfac.isAddition()) { calculate_limit_sub(mfac, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth + 1, true); mstruct_new[i].set(mfac, true); } else if(mstruct_units[i].isFunction() && mstruct_units[i].function() == CALCULATOR->f_ln) { mstruct_new[i].clear(true); } else { bfac2 = false; } } } } if(!bfac2) { if(mstruct_new[i].isOne()) { mstruct_new[i].set(mstruct_units[i]); } else if(mstruct_units[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct_units[i].size(); i2++) { mstruct_new[i].multiply(mstruct_units[i][i2], true); } } else { mstruct_new[i].multiply(mstruct_units[i], true); } } for(size_t i2 = i + 1; i2 < mstruct_units.size(); i2++) { if(mstruct_units[i2] == mstruct_units[i]) { mstruct_units[i2].setUndefined(); mstruct_new[i2].clear(); } } } } if(bfac) { for(size_t i = 0; mstruct_new.size() > 1 && i < mstruct_new.size();) { if(mstruct_new[i].isZero()) { mstruct_new.delChild(i + 1); } else { i++; } } mstruct = mstruct_new; if(mstruct.size() == 1) { mstruct.setToChild(1, true); if(!keep_inf_x) calculate_limit_sub(mstruct, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); break; } else if(!mstruct.contains(x_var, true)) { b = false; } } for(size_t i = 0; i < mstruct.size(); i++) { if(i > 0 && mstruct[i].contains(x_var, true)) { int cmp = limit_inf_cmp(mstruct[i], mstruct[i_cmp], x_var); if(cmp > 0) { mstruct.delChild(i_cmp + 1, false); i--; i_cmp = i; } else if(cmp == -1) { mstruct.delChild(i + 1, false); i--; } else { b = false; } } } if(b) { MathStructure mbak(mstruct); for(size_t i = 0; i < mstruct.size();) { if(!mstruct[i].contains(x_var, true)) { if(mstruct[i].representsNumber()) { mstruct.delChild(i + 1, false); } else { mstruct = mbak; break; } } else { i++; } } } } if(!b || !keep_inf_x) { for(size_t i = 0; i < mstruct.size(); i++) { calculate_limit_sub(mstruct[i], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); } } mstruct.childrenUpdated(); if(mstruct.size() == 1) mstruct.setToChild(1, true); else if(!b || !keep_inf_x) mstruct.calculatesub(eo, eo, false); break; } else { for(size_t i = 0; i < mstruct.size(); i++) { calculate_limit_sub(mstruct[i], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth); } } mstruct.childrenUpdated(); mstruct.calculatesub(eo, eo, false); break; } case STRUCT_POWER: { MathStructure mbak(mstruct); calculate_limit_sub(mstruct[0], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); calculate_limit_sub(mstruct[1], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); if(is_plus_minus_infinity(mstruct[1]) && (mstruct[0].isOne() || mstruct[0].isZero()) && mbak[1].contains(x_var, true) && mbak[0].contains(x_var, true)) { mstruct.set(mbak[0], true); mstruct.transform(CALCULATOR->f_ln); mstruct *= mbak[1]; mstruct.raise(CALCULATOR->v_e); mstruct.swapChildren(1, 2); calculate_limit_sub(mstruct, x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, keep_inf_x); break; } if(mstruct[0].isFunction() && (mstruct[0].function() == CALCULATOR->f_asin || mstruct[0].function() == CALCULATOR->f_acos) && mstruct[0].size() == 1 && mstruct[0][0].isInfinite(false) && mstruct[1].representsNegative()) { mstruct.clear(true); break; } if(keep_inf_x && nr_limit.isInfinite(false) && (mstruct[0].isInfinite(false) || mstruct[1].isInfinite(false))) { MathStructure mbak2(mstruct); mstruct.calculatesub(eo, eo, false); if(mstruct.isInfinite(false)) { mstruct = mbak2; if(mstruct[0].isInfinite(false)) { mstruct[0] = mbak[0]; calculate_limit_sub(mstruct[0], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, true, reduce_addition && !mstruct[1].isInfinite(false)); } else if(mbak[0].contains(x_var, true)) { mstruct[0] = mbak[0]; } if(mstruct[1].isInfinite(false)) { mstruct[1] = mbak[1]; calculate_limit_sub(mstruct[1], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, true, false); } else if(mbak[1].contains(x_var, true)) { mstruct[1] = mbak[1]; } } } else if(mstruct[0].isNumber() && !mstruct[0].number().isNonZero() && mstruct[1].representsNegative() && mbak[0].contains(x_var, true) > 0) { bool b_test = true; int i_sgn = 0; if(mstruct[0].number().isInterval(false) && (mstruct[0].number().hasImaginaryPart() || !mstruct[1].isNumber())) { b_test = false; } if(b_test && ((mbak[0].isFunction() && mbak[0].function() == CALCULATOR->f_abs) || mstruct[1].representsEven())) { i_sgn = 1; b_test = false; } else if(b_test) { if(mstruct[0].number().isInterval(false) && !mstruct[0].number().isNonNegative() && !mstruct[0].number().isNonPositive()) { b_test = false; } else { MathStructure mpow(mbak[0]); if(mstruct[1].isMinusOne()) { MathStructure mfac(mpow); mfac.factorize(eo, false, false, 0, false, false, NULL, m_undefined, false, true); if(mfac.isPower() && mfac[1].representsEven()) { i_sgn = 1; b_test = false; } } else { mpow ^= mstruct[1]; mpow.last().calculateNegate(eo); } if(b_test) { MathStructure mdiff(mpow); if(mdiff.differentiate(x_var, eo) && !mdiff.containsFunction(CALCULATOR->f_diff, true)) { mdiff.replace(x_var, nr_limit); CALCULATOR->beginTemporaryStopMessages(); mdiff.eval(eo); if(!CALCULATOR->endTemporaryStopMessages()) { if(mdiff.representsPositive()) { b_test = false; if(approach_direction > 0) i_sgn = 1; else if(approach_direction < 0) i_sgn = -1; } else if(mdiff.representsNegative()) { b_test = false; if(approach_direction > 0) i_sgn = -1; else if(approach_direction < 0) i_sgn = 1; } } } if(b_test) { MathStructure mtestn(nr_limit); if(eo.approximation != APPROXIMATION_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mtestn.eval(eo2); } if(mtestn.isNumber() && mtestn.number().isReal()) { for(int i = 10; i < 20; i++) { if(approach_direction == 0 || (i % 2 == (approach_direction < 0))) { Number nr_test(i % 2 == 0 ? 1 : -1, 1, -(i / 2)); if(!mtestn.number().isZero()) { nr_test++; if(!nr_test.multiply(mtestn.number())) {i_sgn = 0; break;} } MathStructure mtest(mpow); mtest.replace(x_var, nr_test); CALCULATOR->beginTemporaryStopMessages(); mtest.eval(eo); if(CALCULATOR->endTemporaryStopMessages()) {i_sgn = 0; break;} int new_sgn = 0; if(mtest.representsPositive()) new_sgn = 1; else if(mtest.representsNegative()) new_sgn = -1; if(new_sgn != 0 || mtest.isNumber()) { if(new_sgn == 0 || (i_sgn != 0 && i_sgn != new_sgn)) {i_sgn = 0; break;} i_sgn = new_sgn; } } if(CALCULATOR->aborted()) {i_sgn = 0; break;} } } } } } } if(i_sgn != 0) { if(mstruct[0].number().isInterval()) { Number nr_pow = mstruct[1].number(); Number nr_high(mstruct[0].number()); if(nr_pow.negate() && nr_high.raise(nr_pow) && !nr_high.hasImaginaryPart()) { if(nr_high.isNonNegative() && i_sgn > 0) nr_high = nr_high.upperEndPoint(); else if(nr_high.isNonPositive() && i_sgn < 0) nr_high = nr_high.lowerEndPoint(); if(nr_high.isNonZero() && nr_high.recip()) { Number nr; if(i_sgn > 0) nr.setInterval(nr_high, nr_plus_inf); else if(i_sgn < 0) nr.setInterval(nr_minus_inf, nr_high); mstruct.set(nr, true); if(b_test) CALCULATOR->error(false, _("Limit for %s determined graphically."), format_and_print(mbak).c_str(), NULL); break; } } } else { if(b_test) CALCULATOR->error(false, _("Limit for %s determined graphically."), format_and_print(mbak).c_str(), NULL); if(i_sgn > 0) mstruct.set(nr_plus_inf, true); else if(i_sgn < 0) mstruct.set(nr_minus_inf, true); break; } } } mstruct.childrenUpdated(); mstruct.calculatesub(eo, eo, false); break; } case STRUCT_FUNCTION: { if(keep_inf_x && nr_limit.isInfinite(false) && mstruct.size() == 1 && (mstruct.function() == CALCULATOR->f_ln || mstruct.function() == CALCULATOR->f_gamma)) { MathStructure mbak(mstruct); calculate_limit_sub(mstruct[0], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); if(mstruct[0].isInfinite(false) && (mstruct[0].number().isPlusInfinity() || mstruct.function() == CALCULATOR->f_ln)) { mstruct[0] = mbak[0]; calculate_limit_sub(mstruct[0], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, true, mstruct.function() == CALCULATOR->f_ln && reduce_addition); break; } } else { for(size_t i = 0; i < mstruct.size(); i++) { calculate_limit_sub(mstruct[i], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false); } mstruct.childrenUpdated(); } if(approach_direction != 0 && mstruct.function() == CALCULATOR->f_gamma && mstruct.size() == 1 && mstruct[0].isInteger() && mstruct[0].number().isNonPositive()) { if((mstruct[0].number().isEven() && approach_direction < 0) || (mstruct[0].number().isOdd() && approach_direction > 0)) { mstruct.set(nr_minus_inf, true); } else { mstruct.set(nr_plus_inf, true); } break; } mstruct.calculateFunctions(eo, true); mstruct.calculatesub(eo, eo, false); break; } default: { for(size_t i = 0; i < mstruct.size(); i++) { calculate_limit_sub(mstruct[i], x_var, nr_limit, eo, approach_direction, NULL, lhop_depth, false, reduce_addition); } mstruct.childrenUpdated(); mstruct.calculatesub(eo, eo, false); } } return true; } bool replace_equal_limits(MathStructure &mstruct, const MathStructure &x_var, const MathStructure &nr_limit, const EvaluationOptions &eo, int approach_direction, bool at_top = true) { if(!nr_limit.isInfinite(false)) return false; bool b_ret = false; for(size_t i = 0; i < mstruct.size(); i++) { if(replace_equal_limits(mstruct[i], x_var, nr_limit, eo, approach_direction, false)) { mstruct.childUpdated(i + 1); b_ret = true; } } if(at_top) return b_ret; if(mstruct.isFunction() && (mstruct.function() == CALCULATOR->f_sinh || mstruct.function() == CALCULATOR->f_cosh) && mstruct.size() == 1 && mstruct.contains(x_var, true)) { MathStructure mterm1(CALCULATOR->v_e); mterm1.raise(mstruct[0]); MathStructure mterm2(mterm1); mterm2[1].negate(); mterm1 *= nr_half; mterm2 *= nr_half; mstruct = mterm1; if(mstruct.function() == CALCULATOR->f_sinh) mstruct -= mterm2; else mstruct += mterm2; return true; } return b_ret; } bool replace_equal_limits2(MathStructure &mstruct, const MathStructure &x_var, const MathStructure &nr_limit, const EvaluationOptions &eo, int approach_direction, bool at_top = true) { if(!nr_limit.isInfinite(false)) return false; bool b_ret = false; for(size_t i = 0; i < mstruct.size(); i++) { if(replace_equal_limits2(mstruct[i], x_var, nr_limit, eo, approach_direction, false)) { mstruct.childUpdated(i + 1); b_ret = true; } } if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower() && mstruct[i][1] == x_var && (nr_limit.number().isMinusInfinity() || mstruct[i][0].representsNonNegative())) { for(size_t i2 = i + 1; i2 < mstruct.size();) { if(mstruct[i2].isPower() && mstruct[i2][1] == x_var && (nr_limit.number().isMinusInfinity() || mstruct[i2][0].representsNonNegative())) { mstruct[i][0].calculateMultiply(mstruct[i2][0], eo); mstruct.delChild(i2 + 1, false); } else { i2++; } } mstruct[i].childUpdated(1); mstruct.childUpdated(i + 1); if(mstruct.size() == 1) { mstruct.setToChild(1, true); break; } } } } return b_ret; } bool replace_equal_limits3(MathStructure &mstruct, const MathStructure &x_var, const MathStructure &nr_limit, const EvaluationOptions &eo, int approach_direction, bool at_top = true) { if(!nr_limit.isInfinite(false)) return false; bool b_ret = false; for(size_t i = 0; i < mstruct.size(); i++) { if(replace_equal_limits3(mstruct[i], x_var, nr_limit, eo, approach_direction, false)) { mstruct.childUpdated(i + 1); b_ret = true; } } if(at_top) return b_ret; if(mstruct.isFunction() && (mstruct.function() == CALCULATOR->f_asinh || mstruct.function() == CALCULATOR->f_acosh) && mstruct.size() == 1 && mstruct.contains(x_var, true)) { MathStructure mtest(mstruct[0]); calculate_limit_sub(mtest, x_var, nr_limit, eo, approach_direction); if(mtest.isInfinite(false)) { if(mtest.number().isPlusInfinity()) { mstruct.setFunction(CALCULATOR->f_ln); mstruct[0] *= nr_two; return true; } else if(mstruct.function() == CALCULATOR->f_asinh) { mstruct.setFunction(CALCULATOR->f_ln); mstruct[0] *= nr_two; mstruct.negate(); return true; } } } return b_ret; } bool MathStructure::calculateLimit(const MathStructure &x_var, const MathStructure &limit, const EvaluationOptions &eo_pre, int approach_direction) { EvaluationOptions eo = eo_pre; eo.assume_denominators_nonzero = true; eo.warn_about_denominators_assumed_nonzero = false; eo.do_polynomial_division = true; UnknownVariable *var = new UnknownVariable("", format_and_print(x_var)); var->ref(); Assumptions *ass = new Assumptions(); MathStructure nr_limit(limit); if(eo.approximation != APPROXIMATION_EXACT && nr_limit.containsInterval(true, true, false, false)) { eo.approximation = APPROXIMATION_EXACT_VARIABLES; } nr_limit.eval(eo); eo.approximation = eo_pre.approximation; if(nr_limit.representsReal() || nr_limit.isInfinite()) ass->setType(ASSUMPTION_TYPE_REAL); if(nr_limit.representsPositive()) ass->setSign(ASSUMPTION_SIGN_POSITIVE); else if(nr_limit.representsNegative()) ass->setSign(ASSUMPTION_SIGN_NEGATIVE); else if(nr_limit.isZero()) { if(approach_direction < 0) ass->setSign(ASSUMPTION_SIGN_NEGATIVE); else if(approach_direction > 0) ass->setSign(ASSUMPTION_SIGN_POSITIVE); else ass->setSign(ASSUMPTION_SIGN_NONZERO); } var->setAssumptions(ass); replace(x_var, var); eval(eo); CALCULATOR->beginTemporaryStopMessages(); MathStructure mbak(*this); if(replace_equal_limits(*this, var, nr_limit, eo, approach_direction)) eval(eo); replace_equal_limits2(*this, var, nr_limit, eo, approach_direction); if(replace_equal_limits3(*this, var, nr_limit, eo, approach_direction)) { eval(eo); replace_equal_limits2(*this, var, nr_limit, eo, approach_direction); } calculate_limit_sub(*this, var, nr_limit, eo, approach_direction); if(CALCULATOR->aborted() || limit_contains_undefined(*this)) { set(mbak); replace(var, x_var); var->destroy(); CALCULATOR->endTemporaryStopMessages(); return false; } replace(var, nr_limit); var->destroy(); CALCULATOR->endTemporaryStopMessages(true); return true; } #define IS_VAR_EXP(x) ((x.isVariable() && x.variable()->isKnown()) || (x.isPower() && x[0].isVariable() && x[0].variable()->isKnown())) void factorize_variable(MathStructure &mstruct, const MathStructure &mvar, bool deg2) { if(deg2) { // ax^2+bx = (sqrt(b)*x+(a/sqrt(b))/2)^2-((a/sqrt(b))/2)^2 MathStructure a_struct, b_struct, mul_struct(1, 1, 0); for(size_t i2 = 0; i2 < mstruct.size();) { bool b = false; if(mstruct[i2] == mvar) { a_struct.set(1, 1, 0); b = true; } else if(mstruct[i2].isPower() && mstruct[i2][0] == mvar && mstruct[i2][1].isNumber() && mstruct[i2][1].number().isTwo()) { b_struct.set(1, 1, 0); b = true; } else if(mstruct[i2].isMultiplication()) { for(size_t i3 = 0; i3 < mstruct[i2].size(); i3++) { if(mstruct[i2][i3] == mvar) { a_struct = mstruct[i2]; a_struct.delChild(i3 + 1); b = true; break; } else if(mstruct[i2][i3].isPower() && mstruct[i2][i3][0] == mvar && mstruct[i2][i3][1].isNumber() && mstruct[i2][i3][1].number().isTwo()) { b_struct = mstruct[i2]; b_struct.delChild(i3 + 1); b = true; break; } } } if(b) { mstruct.delChild(i2 + 1); } else { i2++; } } if(b_struct == a_struct) { if(a_struct.isMultiplication() && a_struct.size() == 1) mul_struct = a_struct[0]; else mul_struct = a_struct; a_struct.set(1, 1, 0); b_struct.set(1, 1, 0); } else if(b_struct.isMultiplication() && a_struct.isMultiplication()) { size_t i3 = 0; for(size_t i = 0; i < a_struct.size();) { bool b = false; for(size_t i2 = i3; i2 < b_struct.size(); i2++) { if(a_struct[i] == b_struct[i2]) { i3 = i2; if(mul_struct.isOne()) mul_struct = a_struct[i]; else mul_struct.multiply(a_struct[i], true); a_struct.delChild(i + 1); b_struct.delChild(i2 + 1); b = true; break; } } if(!b) i++; } } if(a_struct.isMultiplication() && a_struct.size() == 0) a_struct.set(1, 1, 0); else if(a_struct.isMultiplication() && a_struct.size() == 1) a_struct.setToChild(1); if(b_struct.isMultiplication() && b_struct.size() == 0) b_struct.set(1, 1, 0); else if(b_struct.isMultiplication() && b_struct.size() == 1) b_struct.setToChild(1); if(!b_struct.isOne()) { b_struct.raise(nr_half); a_struct.divide(b_struct); } a_struct.multiply(nr_half); if(b_struct.isOne()) b_struct = mvar; else b_struct *= mvar; b_struct += a_struct; b_struct.raise(nr_two); a_struct.raise(nr_two); a_struct.negate(); b_struct += a_struct; if(!mul_struct.isOne()) b_struct *= mul_struct; if(mstruct.size() == 0) mstruct = b_struct; else mstruct.addChild(b_struct); } else { vector left_structs; for(size_t i2 = 0; i2 < mstruct.size();) { bool b = false; if(mstruct[i2] == mvar) { mstruct[i2].set(1, 1, 0, true); b = true; } else if(mstruct[i2].isMultiplication()) { for(size_t i3 = 0; i3 < mstruct[i2].size(); i3++) { if(mstruct[i2][i3] == mvar) { mstruct[i2].delChild(i3 + 1, true); b = true; break; } } } if(b) { i2++; } else { mstruct[i2].ref(); left_structs.push_back(&mstruct[i2]); mstruct.delChild(i2 + 1); } } mstruct.multiply(mvar); for(size_t i = 0; i < left_structs.size(); i++) { mstruct.add_nocopy(left_structs[i], true); mstruct.evalSort(false); } } } bool var_contains_interval(const MathStructure &mstruct) { if(mstruct.isNumber()) return mstruct.number().isInterval(); if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_interval) return true; if(mstruct.isVariable() && mstruct.variable()->isKnown()) return var_contains_interval(((KnownVariable*) mstruct.variable())->get()); for(size_t i = 0; i < mstruct.size(); i++) { if(var_contains_interval(mstruct[i])) return true; } return false; } bool factorize_variables(MathStructure &mstruct, const EvaluationOptions &eo) { bool b = false; if(mstruct.type() == STRUCT_ADDITION) { vector variables; vector variable_count; vector term_sgn; vector term_deg2; for(size_t i = 0; i < mstruct.size(); i++) { if(CALCULATOR->aborted()) break; if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(CALCULATOR->aborted()) break; if(IS_VAR_EXP(mstruct[i][i2])) { bool b_found = false; for(size_t i3 = 0; i3 < variables.size(); i3++) { if(variables[i3] == mstruct[i][i2]) { variable_count[i3]++; b_found = true; if(term_sgn[i3] == 1 && !mstruct[i].representsNonNegative(true)) term_sgn[i3] = 0; else if(term_sgn[i3] == -1 && !mstruct[i].representsNonPositive(true)) term_sgn[i3] = 0; break; } } if(!b_found) { variables.push_back(mstruct[i][i2]); variable_count.push_back(1); term_deg2.push_back(false); if(mstruct[i].representsNonNegative(true)) term_sgn.push_back(1); else if(mstruct[i].representsNonPositive(true)) term_sgn.push_back(-1); else term_sgn.push_back(0); } } } } else if(IS_VAR_EXP(mstruct[i])) { bool b_found = false; for(size_t i3 = 0; i3 < variables.size(); i3++) { if(variables[i3] == mstruct[i]) { variable_count[i3]++; b_found = true; if(term_sgn[i3] == 1 && !mstruct[i].representsNonNegative(true)) term_sgn[i3] = 0; else if(term_sgn[i3] == -1 && !mstruct[i].representsNonPositive(true)) term_sgn[i3] = 0; break; } } if(!b_found) { variables.push_back(mstruct[i]); variable_count.push_back(1); term_deg2.push_back(false); if(mstruct[i].representsNonNegative(true)) term_sgn.push_back(1); else if(mstruct[i].representsNonPositive(true)) term_sgn.push_back(-1); else term_sgn.push_back(0); } } } for(size_t i = 0; i < variables.size();) { bool b_erase = false; if(!var_contains_interval(variables[i])) { b_erase = true; } else if(variable_count[i] == 1 || term_sgn[i] != 0) { b_erase = true; if(!variables[i].isPower() || (variables[i][1].isNumber() && variables[i][1].number().isTwo())) { for(size_t i2 = i + 1; i2 < variables.size(); i2++) { if((variables[i].isPower() && !variables[i2].isPower() && variables[i][0] == variables[i2])|| (!variables[i].isPower() && variables[i2].isPower() && variables[i2][0] == variables[i] && variables[i2][1].isNumber() && variables[i2][1].number().isTwo())) { bool b_erase2 = false; if(variable_count[i2] == 1) { if(term_sgn[i] == 0 || term_sgn[i2] != term_sgn[i]) { if(variable_count[i] == 1) { term_deg2[i] = true; variable_count[i] = 2; term_sgn[i] = 0; if(variables[i].isPower()) variables[i].setToChild(1); } else { term_sgn[i] = 0; } b_erase = false; } b_erase2 = true; } else if(term_sgn[i2] != 0) { if(term_sgn[i] == 0 || term_sgn[i2] != term_sgn[i]) { if(variable_count[i] != 1) { term_sgn[i] = 0; b_erase = false; } term_sgn[i2] = 0; } else { b_erase2 = true; } } if(b_erase2) { variable_count.erase(variable_count.begin() + i2); variables.erase(variables.begin() + i2); term_deg2.erase(term_deg2.begin() + i2); term_sgn.erase(term_sgn.begin() + i2); } break; } } } } if(b_erase) { variable_count.erase(variable_count.begin() + i); variables.erase(variables.begin() + i); term_deg2.erase(term_deg2.begin() + i); term_sgn.erase(term_sgn.begin() + i); } else if(variable_count[i] == mstruct.size()) { factorize_variable(mstruct, variables[i], term_deg2[i]); if(CALCULATOR->aborted()) return true; factorize_variables(mstruct, eo); return true; } else { i++; } } if(variables.size() == 1) { factorize_variable(mstruct, variables[0], term_deg2[0]); if(CALCULATOR->aborted()) return true; factorize_variables(mstruct, eo); return true; } Number uncertainty; size_t u_index = 0; for(size_t i = 0; i < variables.size(); i++) { const MathStructure *v_ms; Number nr; if(variables[i].isPower()) v_ms = &((KnownVariable*) variables[i][0].variable())->get(); else v_ms = &((KnownVariable*) variables[i].variable())->get(); if(v_ms->isNumber()) nr = v_ms->number(); else if(v_ms->isMultiplication() && v_ms->size() > 0 && (*v_ms)[0].isNumber()) nr = (v_ms)[0].number(); else { MathStructure mtest(*v_ms); mtest.calculatesub(eo, eo, true); if(mtest.isNumber()) nr = mtest.number(); else if(mtest.isMultiplication() && mtest.size() > 0 && mtest[0].isNumber()) nr = mtest[0].number(); } if(nr.isInterval()) { Number u_candidate(nr.uncertainty()); if(variables[i].isPower() && variables[i][1].isNumber() && variables[i][1].number().isReal()) u_candidate.raise(variables[i][1].number()); u_candidate.multiply(variable_count[i]); if(u_candidate.isGreaterThan(uncertainty)) { uncertainty = u_candidate; u_index = i; } } } if(!uncertainty.isZero()) { factorize_variable(mstruct, variables[u_index], term_deg2[u_index]); if(CALCULATOR->aborted()) return true; factorize_variables(mstruct, eo); return true; } } for(size_t i = 0; i < mstruct.size(); i++) { if(factorize_variables(mstruct[i], eo)) { mstruct.childUpdated(i + 1); b = true; } if(CALCULATOR->aborted()) return b; } return b; } void find_interval_variables(const MathStructure &mstruct, vector &vars, vector &v_count, vector &v_prec) { if(mstruct.isVariable() && mstruct.variable()->isKnown()) { KnownVariable *v = (KnownVariable*) mstruct.variable(); int var_prec = PRECISION + 11; const MathStructure &mv = v->get(); for(size_t i = 0; i < vars.size(); i++) { if(vars[i] == v) { v_count[i]++; return; } } if(mv.isNumber()) { if(mv.number().isInterval()) var_prec = mv.number().precision(1); else if(CALCULATOR->usesIntervalArithmetic() && mv.number().precision() >= 0) var_prec = mv.number().precision(); } else if(mv.isMultiplication()) { for(size_t i = 0; i < mv.size(); i++) { if(mv[i].isNumber()) { if(mv[i].number().isInterval()) {var_prec = mv[i].number().precision(1); break;} else if(CALCULATOR->usesIntervalArithmetic() && mv[i].number().precision() >= 0) {var_prec = mv[i].number().precision(); break;} } } } if(var_prec <= (CALCULATOR->usesIntervalArithmetic() ? PRECISION + 10 : PRECISION)) { bool b = false; for(size_t i = 0; i < v_prec.size(); i++) { if(var_prec < v_prec[i]) { v_prec.insert(v_prec.begin() + i, var_prec); v_count.insert(v_count.begin() + i, 1); vars.insert(vars.begin() + i, v); b = true; break; } } if(!b) { v_prec.push_back(var_prec); v_count.push_back(1); vars.push_back(v); } } } for(size_t i = 0; i < mstruct.size(); i++) { find_interval_variables(mstruct[i], vars, v_count, v_prec); } } bool contains_not_nonzero(MathStructure &m) { if(m.isNumber() && !m.number().isNonZero()) { return true; } else if(m.isMultiplication()) { for(size_t i = 0; i < m.size(); i++) { if(contains_not_nonzero(m[i])) return true; } } return false; } bool contains_undefined(MathStructure &m, const EvaluationOptions &eo = default_evaluation_options, bool calc = false, const MathStructure &x_var = m_zero, const MathStructure &m_intval = nr_zero) { if(m.isPower() && (m[1].representsNegative() || (m[1].isNumber() && !m[1].number().isNonNegative()))) { if(calc) { m[0].replace(x_var, m_intval, true); m[0].calculatesub(eo, eo, true); } if(contains_not_nonzero(m[0])) return true; } for(size_t i = 0; i < m.size(); i++) { if(contains_undefined(m[i], eo, calc, x_var, m_intval)) return true; } return false; } bool find_interval_zeroes(const MathStructure &mstruct, MathStructure &malts, const MathStructure &mvar, const Number &nr_intval, const EvaluationOptions &eo, int depth, const Number &nr_prec, int orig_prec = 0, int is_real = -1) { if(CALCULATOR->aborted()) return false; if(depth == 0) orig_prec = nr_intval.precision(1); MathStructure mtest(mstruct); mtest.replace(mvar, nr_intval); mtest.eval(eo); if(is_real < 0) is_real = mtest.representsNonComplex(true); ComparisonResult cmp; if(is_real == 0) { MathStructure m_re(CALCULATOR->f_re, &mtest, NULL); m_re.calculateFunctions(eo); cmp = m_re.compare(m_zero); MathStructure m_im(CALCULATOR->f_im, &mtest, NULL); m_im.calculateFunctions(eo); ComparisonResult cmp2 = m_im.compare(m_zero); if(COMPARISON_IS_NOT_EQUAL(cmp) || cmp2 == COMPARISON_RESULT_EQUAL || cmp == COMPARISON_RESULT_UNKNOWN) cmp = cmp2; } else { cmp = mtest.compare(m_zero); } if(COMPARISON_IS_NOT_EQUAL(cmp)) { return true; } else if(cmp != COMPARISON_RESULT_UNKNOWN || cmp == COMPARISON_RESULT_EQUAL || contains_undefined(mtest)) { if(cmp == COMPARISON_RESULT_EQUAL || (nr_intval.precision(1) > (orig_prec > PRECISION ? orig_prec + 5 : PRECISION + 5) || (!nr_intval.isNonZero() && nr_intval.uncertainty().isLessThan(nr_prec)))) { if(cmp == COMPARISON_RESULT_EQUAL && depth <= 3) return false; if(malts.size() > 0 && (cmp = malts.last().compare(nr_intval)) != COMPARISON_RESULT_UNKNOWN && COMPARISON_MIGHT_BE_EQUAL(cmp)) { malts.last().number().setInterval(malts.last().number(), nr_intval); if(malts.last().number().precision(1) < (orig_prec > PRECISION ? orig_prec + 3 : PRECISION + 3)) { return false; } } else { malts.addChild(nr_intval); } return true; } vector splits; nr_intval.splitInterval(2, splits); for(size_t i = 0; i < splits.size(); i++) { if(!find_interval_zeroes(mstruct, malts, mvar, splits[i], eo, depth + 1, nr_prec, orig_prec, is_real)) return false; } return true; } return false; } bool contains_interval_variable(const MathStructure &m) { if(m.isVariable() && m.containsInterval(true, true, false, true)) return true; for(size_t i = 0; i < m.size(); i++) { if(contains_interval_variable(m[i])) return true; } return false; } bool function_differentiable(MathFunction *o_function) { return (o_function == CALCULATOR->f_sqrt || o_function == CALCULATOR->f_root || o_function == CALCULATOR->f_cbrt || o_function == CALCULATOR->f_ln || o_function == CALCULATOR->f_logn || o_function == CALCULATOR->f_arg || o_function == CALCULATOR->f_gamma || o_function == CALCULATOR->f_beta || o_function == CALCULATOR->f_abs || o_function == CALCULATOR->f_factorial || o_function == CALCULATOR->f_besselj || o_function == CALCULATOR->f_bessely || o_function == CALCULATOR->f_erf || o_function == CALCULATOR->f_erfc || o_function == CALCULATOR->f_li || o_function == CALCULATOR->f_Li || o_function == CALCULATOR->f_Ei || o_function == CALCULATOR->f_Si || o_function == CALCULATOR->f_Ci || o_function == CALCULATOR->f_Shi || o_function == CALCULATOR->f_Chi || o_function == CALCULATOR->f_abs || o_function == CALCULATOR->f_signum || o_function == CALCULATOR->f_heaviside || o_function == CALCULATOR->f_lambert_w || o_function == CALCULATOR->f_sinc || o_function == CALCULATOR->f_sin || o_function == CALCULATOR->f_cos || o_function == CALCULATOR->f_tan || o_function == CALCULATOR->f_asin || o_function == CALCULATOR->f_acos || o_function == CALCULATOR->f_atan || o_function == CALCULATOR->f_sinh || o_function == CALCULATOR->f_cosh || o_function == CALCULATOR->f_tanh || o_function == CALCULATOR->f_asinh || o_function == CALCULATOR->f_acosh || o_function == CALCULATOR->f_atanh); } bool calculate_differentiable_functions(MathStructure &m, const EvaluationOptions &eo, bool recursive = true, bool do_unformat = true) { if(m.isFunction() && m.function() != eo.protected_function && function_differentiable(m.function())) { return m.calculateFunctions(eo, recursive, do_unformat); } bool b = false; if(recursive) { for(size_t i = 0; i < m.size(); i++) { if(CALCULATOR->aborted()) break; if(calculate_differentiable_functions(m[i], eo, recursive, do_unformat)) { m.childUpdated(i + 1); b = true; } } } return b; } bool calculate_nondifferentiable_functions(MathStructure &m, const EvaluationOptions &eo, bool recursive = true, bool do_unformat = true) { if(m.isFunction() && m.function() != eo.protected_function) { if(!function_differentiable(m.function()) || !contains_interval_variable(m)) { if(m.calculateFunctions(eo, false, do_unformat)) { if(recursive) calculate_nondifferentiable_functions(m, eo, recursive, do_unformat); return true; } } else if(m.function() == CALCULATOR->f_abs && m.size() == 1) { EvaluationOptions eo3 = eo; eo3.split_squares = false; eo3.assume_denominators_nonzero = false; if(eo.approximation == APPROXIMATION_APPROXIMATE && !m.containsUnknowns()) eo3.approximation = APPROXIMATION_EXACT_VARIABLES; else eo3.approximation = APPROXIMATION_EXACT; m[0].calculatesub(eo3, eo); m.childUpdated(1); if(m[0].representsNegative(true)) { m.setToChild(1); m.negate(); if(recursive) calculate_nondifferentiable_functions(m, eo, recursive, do_unformat); return true; } if(m[0].representsNonNegative(true)) { m.setToChild(1); if(recursive) calculate_nondifferentiable_functions(m, eo, recursive, do_unformat); return true; } if(m[0].isMultiplication()) { m.setToChild(1); for(size_t i = 0; i < m.size(); i++) { m[i].transform(CALCULATOR->f_abs); } m.childrenUpdated(); if(recursive) calculate_nondifferentiable_functions(m, eo, recursive, do_unformat); return true; } if(eo.approximation != APPROXIMATION_EXACT) { eo3.approximation = APPROXIMATION_APPROXIMATE; MathStructure mtest(m[0]); mtest.calculatesub(eo3, eo); if(mtest.representsNegative(true)) { m.setToChild(1); m.negate(); if(recursive) calculate_nondifferentiable_functions(m, eo, recursive, do_unformat); return true; } if(mtest.representsNonNegative(true)) { m.setToChild(1); if(recursive) calculate_nondifferentiable_functions(m, eo, recursive, do_unformat); return true; } } } } bool b = false; if(recursive) { for(size_t i = 0; i < m.size(); i++) { if(CALCULATOR->aborted()) break; if(calculate_nondifferentiable_functions(m[i], eo, recursive, do_unformat)) { m.childUpdated(i + 1); b = true; } } } return b; } void remove_nonzero_mul(MathStructure &msolve, const MathStructure &u_var, const EvaluationOptions &eo) { if(!msolve.isMultiplication()) return; for(size_t i = 0; i < msolve.size();) { if(!msolve[i].contains(u_var, true)) { msolve[i].eval(eo); if(msolve[i].representsNonZero(true)) { if(msolve.size() == 2) { msolve.delChild(i + 1, true); break; } msolve.delChild(i + 1, true); } else { remove_nonzero_mul(msolve[i], u_var, eo); i++; } } else { remove_nonzero_mul(msolve[i], u_var, eo); i++; } } } extern bool create_interval(MathStructure &mstruct, const MathStructure &m1, const MathStructure &m2); void solve_intervals2(MathStructure &mstruct, vector vars, const EvaluationOptions &eo_pre) { if(vars.size() > 0) { EvaluationOptions eo = eo_pre; eo.approximation = APPROXIMATION_EXACT_VARIABLES; eo.expand = false; if(eo.calculate_functions) calculate_differentiable_functions(mstruct, eo); KnownVariable *v = vars[0]; vars.erase(vars.begin()); UnknownVariable *u_var = new UnknownVariable("", "u"); u_var->ref(); Number nr_intval; MathStructure mvar(u_var); const MathStructure &mv = v->get(); MathStructure mmul(1, 1, 0); if(mv.isMultiplication()) { for(size_t i = 0; i < mv.size(); i++) { if(mv[i].isNumber() && mv[i].number().isInterval()) { mmul = mv; mmul.delChild(i + 1, true); mvar.multiply(mmul); nr_intval = mv[i].number(); u_var->setInterval(nr_intval); break; } } } else { nr_intval = mv.number(); u_var->setInterval(mv); } MathStructure msolve(mstruct); msolve.replace(v, mvar); bool b = true; CALCULATOR->beginTemporaryStopMessages(); if(!msolve.differentiate(u_var, eo) || msolve.countTotalChildren(false) > 10000 || msolve.containsFunction(CALCULATOR->f_diff, true) || CALCULATOR->aborted()) { b = false; } MathStructure malts; malts.clearVector(); if(b) { eo.keep_zero_units = false; msolve.calculatesub(eo, eo, true); eo.approximation = APPROXIMATION_APPROXIMATE; eo.expand = eo_pre.expand; msolve.factorize(eo, false, false, 0, false, true, NULL, m_undefined, false, false, 1); remove_nonzero_mul(msolve, u_var, eo); if(contains_undefined(msolve) || msolve.countTotalChildren(false) > 1000 || msolve.containsInterval(true, true, false, true, true)) { msolve.replace(u_var, nr_intval); msolve.eval(eo); if(msolve.representsNonComplex(true)) { ComparisonResult cmp = msolve.compare(m_zero); if(COMPARISON_MIGHT_BE_EQUAL(cmp)) b = false; } else { MathStructure m_re(CALCULATOR->f_re, &msolve, NULL); m_re.calculateFunctions(eo); ComparisonResult cmp = m_re.compare(m_zero); if(COMPARISON_MIGHT_BE_EQUAL(cmp)) { b = false; } else { MathStructure m_im(CALCULATOR->f_im, &msolve, NULL); m_im.calculateFunctions(eo); ComparisonResult cmp = m_im.compare(m_zero); if(COMPARISON_MIGHT_BE_EQUAL(cmp)) b = false; } } } else { MathStructure mtest(mstruct); mtest.replace(v, u_var); mtest.calculatesub(eo, eo, true); if(contains_undefined(mtest, eo, true, u_var, mv)) { b = false; } else { Number nr_prec(1, 1, -(PRECISION + 10)); nr_prec *= nr_intval.uncertainty(); b = find_interval_zeroes(msolve, malts, u_var, nr_intval, eo, 0, nr_prec); } } eo.expand = false; eo.approximation = APPROXIMATION_EXACT_VARIABLES; eo.keep_zero_units = eo_pre.keep_zero_units; } CALCULATOR->endTemporaryStopMessages(); CALCULATOR->beginTemporaryStopMessages(); if(b) { malts.addChild(nr_intval.lowerEndPoint()); malts.addChild(nr_intval.upperEndPoint()); MathStructure mnew; for(size_t i = 0; i < malts.size(); i++) { MathStructure mlim(mstruct); if(!mmul.isOne()) malts[i] *= mmul; mlim.replace(v, malts[i]); mlim.calculatesub(eo, eo, true); vector vars2 = vars; solve_intervals2(mlim, vars2, eo_pre); if(i == 0) { mnew = mlim; } else { MathStructure mlim1(mnew); if(!create_interval(mnew, mlim1, mlim)) { eo.approximation = APPROXIMATION_APPROXIMATE; eo.expand = eo_pre.expand; mlim.eval(eo); if(!create_interval(mnew, mlim1, mlim)) { mlim1.eval(eo); eo.expand = false; eo.approximation = APPROXIMATION_EXACT_VARIABLES; if(!create_interval(mnew, mlim1, mlim)) { b = false; break; } } } } } if(b) mstruct = mnew; } CALCULATOR->endTemporaryStopMessages(b); if(!b) { CALCULATOR->error(false, _("Interval potentially calculated wide."), NULL); mstruct.replace(v, v->get()); solve_intervals2(mstruct, vars, eo_pre); } u_var->destroy(); } } KnownVariable *fix_find_interval_variable(MathStructure &mstruct) { if(mstruct.isVariable() && mstruct.variable()->isKnown()) { const MathStructure &m = ((KnownVariable*) mstruct.variable())->get(); if(contains_interval_variable(m)) return (KnownVariable*) mstruct.variable(); } for(size_t i = 0; i < mstruct.size(); i++) { KnownVariable *v = fix_find_interval_variable(mstruct[i]); if(v) return v; } return NULL; } KnownVariable *fix_find_interval_variable2(MathStructure &mstruct) { if(mstruct.isVariable() && mstruct.variable()->isKnown()) { const MathStructure &m = ((KnownVariable*) mstruct.variable())->get(); if(m.isNumber()) return NULL; if(m.isMultiplication()) { bool b_intfound = false;; for(size_t i = 0; i < m.size(); i++) { if(m[i].containsInterval(true, false, false, true)) { if(b_intfound || !m[i].isNumber()) return (KnownVariable*) mstruct.variable(); b_intfound = true; } } } else if(m.containsInterval(true, false, false, true)) { return (KnownVariable*) mstruct.variable(); } } for(size_t i = 0; i < mstruct.size(); i++) { KnownVariable *v = fix_find_interval_variable2(mstruct[i]); if(v) return v; } return NULL; } bool replace_intervals(MathStructure &m) { if(m.isNumber()) { int var_prec = 0; if(m.number().isInterval()) var_prec = m.number().precision(1); else if(CALCULATOR->usesIntervalArithmetic() && m.number().precision() >= 0) var_prec = m.number().precision(); if(var_prec <= (CALCULATOR->usesIntervalArithmetic() ? PRECISION + 10 : PRECISION)) { Variable *v = new KnownVariable("", format_and_print(m), m); v->ref(); m.set(v, true); v->destroy(); } } bool b = false; for(size_t i = 0; i < m.size(); i++) { if(replace_intervals(m[i])) { m.childUpdated(i + 1); b = true; } } return b; } void fix_interval_variable(KnownVariable *v, MathStructure &mvar) { mvar = v->get(); replace_intervals(mvar); } void solve_intervals(MathStructure &mstruct, const EvaluationOptions &eo, const EvaluationOptions &feo) { bool b = false; while(true) { KnownVariable *v = fix_find_interval_variable(mstruct); if(!v) break; b = true; MathStructure mvar; fix_interval_variable(v, mvar); mstruct.replace(v, mvar); } while(true) { KnownVariable *v = fix_find_interval_variable2(mstruct); if(!v) break; b = true; MathStructure mvar; fix_interval_variable(v, mvar); mstruct.replace(v, mvar); } if(b) { EvaluationOptions eo2 = eo; eo2.expand = false; mstruct.calculatesub(eo2, feo, true); } vector vars; vector v_count; vector v_prec; find_interval_variables(mstruct, vars, v_count, v_prec); for(size_t i = 0; i < v_count.size();) { if(v_count[i] < 2) { v_count.erase(v_count.begin() + i); v_prec.erase(v_prec.begin() + i); vars.erase(vars.begin() + i); } else { i++; } } if(mstruct.isComparison()) { mstruct[0].subtract(mstruct[1]); solve_intervals2(mstruct[0], vars, eo); mstruct[1].clear(true); return; } solve_intervals2(mstruct, vars, eo); } bool simplify_ln(MathStructure &mstruct) { bool b_ret = false; for(size_t i = 0; i < mstruct.size(); i++) { if(simplify_ln(mstruct[i])) b_ret = true; } if(mstruct.isAddition()) { size_t i_ln = (size_t) -1, i_ln_m = (size_t) -1; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isFunction() && mstruct[i].function() == CALCULATOR->f_ln && mstruct[i].size() == 1 && mstruct[i][0].isNumber() && mstruct[i][0].number().isReal()) { if(i_ln == (size_t) -1) { i_ln = i; } else { bool b = true; if(mstruct[i_ln].isMultiplication()) { if(mstruct[i_ln][1][0].number().raise(mstruct[i_ln][0].number(), true)) {mstruct[i_ln].setToChild(2, true); b_ret = true;} else b = false; } if(b && mstruct[i_ln][0].number().multiply(mstruct[i][0].number())) { mstruct.delChild(i + 1); i--; b_ret = true; } } } else if(mstruct[i].isMultiplication() && mstruct[i].size() == 2 && mstruct[i][1].isFunction() && mstruct[i][1].function() == CALCULATOR->f_ln && mstruct[i][1].size() == 1 && mstruct[i][1][0].isNumber() && mstruct[i][1][0].number().isReal() && mstruct[i][0].isInteger() && mstruct[i][0].number().isLessThan(1000) && mstruct[i][0].number().isGreaterThan(-1000)) { if(mstruct[i][0].number().isPositive()) { if(i_ln == (size_t) -1) { i_ln = i; } else { bool b = true; if(mstruct[i_ln].isMultiplication()) { if(mstruct[i_ln][1][0].number().raise(mstruct[i_ln][0].number())) {mstruct[i_ln].setToChild(2, true); b_ret = true;} else b = false; } if(b && mstruct[i][1][0].number().raise(mstruct[i][0].number(), true)) { if(mstruct[i_ln][0].number().multiply(mstruct[i][1][0].number())) { mstruct.delChild(i + 1); i--; } else { mstruct[i].setToChild(1, true); } b_ret = true; } } } else if(mstruct[i][0].number().isNegative()) { if(i_ln_m == (size_t) -1) { i_ln_m = i; } else { bool b = mstruct[i_ln_m][0].number().isMinusOne(); if(!b && mstruct[i_ln_m][1][0].number().raise(-mstruct[i_ln_m][0].number())) {mstruct[i_ln_m][0].set(m_minus_one, true); b_ret = true; b = true;} bool b_m1 = b && mstruct[i][0].number().isMinusOne(); if(b && (b_m1 || mstruct[i][1][0].number().raise(-mstruct[i][0].number(), true))) { if(mstruct[i_ln_m][1][0].number().multiply(mstruct[i][1][0].number())) { mstruct.delChild(i + 1); b_ret = true; i--; } else if(!b_m1) b_ret = true; } } } } } if(mstruct.size() == 1) mstruct.setToChild(1, true); } return b_ret; } MathStructure &MathStructure::eval(const EvaluationOptions &eo) { if(m_type == STRUCT_NUMBER) { if(eo.complex_number_form == COMPLEX_NUMBER_FORM_EXPONENTIAL) complexToExponentialForm(eo); else if(eo.complex_number_form == COMPLEX_NUMBER_FORM_POLAR) complexToPolarForm(eo); return *this; } unformat(eo); EvaluationOptions feo = eo; feo.structuring = STRUCTURING_NONE; feo.do_polynomial_division = false; feo.complex_number_form = COMPLEX_NUMBER_FORM_RECTANGULAR; EvaluationOptions eo2 = eo; eo2.structuring = STRUCTURING_NONE; eo2.expand = false; eo2.test_comparisons = false; eo2.complex_number_form = COMPLEX_NUMBER_FORM_RECTANGULAR; eo2.isolate_x = false; if(eo.approximation != APPROXIMATION_EXACT && eo.approximation != APPROXIMATION_EXACT_VARIABLES && containsInterval(true, true, false, true, true)) { if(eo.calculate_functions) calculate_nondifferentiable_functions(*this, feo); EvaluationOptions eo3 = eo2; eo3.split_squares = false; eo3.assume_denominators_nonzero = false; if(eo.approximation == APPROXIMATION_APPROXIMATE && !containsUnknowns()) eo3.approximation = APPROXIMATION_EXACT_VARIABLES; else eo3.approximation = APPROXIMATION_EXACT; calculatesub(eo3, feo); eo3.approximation = APPROXIMATION_APPROXIMATE; factorize_variables(*this, eo3); if(eo.approximation == APPROXIMATION_APPROXIMATE && !containsUnknowns()) eo3.approximation = APPROXIMATION_EXACT_VARIABLES; else eo3.approximation = APPROXIMATION_EXACT; eo3.expand = eo.expand; eo3.assume_denominators_nonzero = eo.assume_denominators_nonzero; solve_intervals(*this, eo3, feo); if(eo.calculate_functions) calculate_differentiable_functions(*this, feo); } else { if(eo.calculate_functions) calculateFunctions(feo); } if(m_type == STRUCT_NUMBER) { if(eo.complex_number_form == COMPLEX_NUMBER_FORM_EXPONENTIAL) complexToExponentialForm(eo); else if(eo.complex_number_form == COMPLEX_NUMBER_FORM_POLAR) complexToPolarForm(eo); return *this; } if(eo2.approximation == APPROXIMATION_TRY_EXACT || (eo2.approximation == APPROXIMATION_APPROXIMATE && (containsUnknowns() || containsInterval(false, true, false, false)))) { EvaluationOptions eo3 = eo2; if(eo.approximation == APPROXIMATION_APPROXIMATE && !containsUnknowns()) eo3.approximation = APPROXIMATION_EXACT_VARIABLES; else eo3.approximation = APPROXIMATION_EXACT; eo3.split_squares = false; eo3.assume_denominators_nonzero = false; calculatesub(eo3, feo); if(m_type == STRUCT_NUMBER) { if(eo.complex_number_form == COMPLEX_NUMBER_FORM_EXPONENTIAL) complexToExponentialForm(eo); else if(eo.complex_number_form == COMPLEX_NUMBER_FORM_POLAR) complexToPolarForm(eo); return *this; } if(!CALCULATOR->usesIntervalArithmetic() && eo.expand && eo.expand >= -1 && !containsType(STRUCT_COMPARISON, true, true, true)) { unformat(eo); eo3.expand = -1; calculatesub(eo3, feo); } eo3.approximation = APPROXIMATION_APPROXIMATE; factorize_variables(*this, eo3); eo2.approximation = APPROXIMATION_APPROXIMATE; } calculatesub(eo2, feo); if(m_type == STRUCT_NUMBER) { if(eo.complex_number_form == COMPLEX_NUMBER_FORM_EXPONENTIAL) complexToExponentialForm(eo); else if(eo.complex_number_form == COMPLEX_NUMBER_FORM_POLAR) complexToPolarForm(eo); return *this; } if(CALCULATOR->aborted()) return *this; eo2.sync_units = false; eo2.isolate_x = eo.isolate_x; if(eo2.isolate_x) { eo2.assume_denominators_nonzero = false; if(isolate_x(eo2, feo)) { if(CALCULATOR->aborted()) return *this; if(eo.assume_denominators_nonzero) eo2.assume_denominators_nonzero = 2; calculatesub(eo2, feo); } else { if(eo.assume_denominators_nonzero) eo2.assume_denominators_nonzero = 2; } if(CALCULATOR->aborted()) return *this; } if(eo.expand != 0 || (eo.test_comparisons && containsType(STRUCT_COMPARISON))) { eo2.test_comparisons = eo.test_comparisons; eo2.expand = eo.expand; if(eo2.expand && (!eo.test_comparisons || !containsType(STRUCT_COMPARISON))) eo2.expand = -2; bool b = eo2.test_comparisons; if(!b && isAddition()) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsType(STRUCT_ADDITION, false) == 1) { b = true; break; } } } else if(!b) { b = containsType(STRUCT_ADDITION, false) == 1; } if(b) { calculatesub(eo2, feo); if(CALCULATOR->aborted()) return *this; if(eo.do_polynomial_division) do_simplification(*this, eo2, true, eo.structuring == STRUCTURING_NONE || eo.structuring == STRUCTURING_FACTORIZE, false, true, true); if(CALCULATOR->aborted()) return *this; if(eo2.isolate_x) { eo2.assume_denominators_nonzero = false; if(isolate_x(eo2, feo)) { if(CALCULATOR->aborted()) return *this; if(eo.assume_denominators_nonzero) eo2.assume_denominators_nonzero = 2; calculatesub(eo2, feo); if(containsType(STRUCT_ADDITION, false) == 1 && eo.do_polynomial_division) do_simplification(*this, eo2, true, eo.structuring == STRUCTURING_NONE || eo.structuring == STRUCTURING_FACTORIZE, false, true, true); } else { if(eo.assume_denominators_nonzero) eo2.assume_denominators_nonzero = 2; } if(CALCULATOR->aborted()) return *this; } } } if(eo2.isolate_x && containsType(STRUCT_COMPARISON) && eo2.assume_denominators_nonzero) { eo2.assume_denominators_nonzero = 2; if(try_isolate_x(*this, eo2, feo)) { if(CALCULATOR->aborted()) return *this; calculatesub(eo2, feo); if(containsType(STRUCT_ADDITION, false) == 1 && eo.do_polynomial_division) do_simplification(*this, eo2, true, eo.structuring == STRUCTURING_NONE || eo.structuring == STRUCTURING_FACTORIZE, false, true, true); } } simplify_functions(*this, eo2, feo); if(CALCULATOR->aborted()) return *this; if(eo.structuring != STRUCTURING_NONE) simplify_ln(*this); structure(eo.structuring, eo2, false); if(eo.structuring != STRUCTURING_NONE) simplify_ln(*this); clean_multiplications(*this); if(eo.complex_number_form == COMPLEX_NUMBER_FORM_EXPONENTIAL) complexToExponentialForm(eo); else if(eo.complex_number_form == COMPLEX_NUMBER_FORM_POLAR) complexToPolarForm(eo); return *this; } bool factorize_find_multiplier(const MathStructure &mstruct, MathStructure &mnew, MathStructure &factor_mstruct, bool only_units = false) { factor_mstruct.set(m_one); switch(mstruct.type()) { case STRUCT_ADDITION: { if(!only_units) { bool bfrac = false, bint = true; idm1(mstruct, bfrac, bint); if(bfrac || bint) { Number gcd(1, 1); idm2(mstruct, bfrac, bint, gcd); if((bint || bfrac) && !gcd.isOne()) { if(bfrac) gcd.recip(); factor_mstruct.set(gcd); } } } if(mstruct.size() > 0) { size_t i = 0; const MathStructure *cur_mstruct; while(true) { if(mstruct[0].isMultiplication()) { if(i >= mstruct[0].size()) { break; } cur_mstruct = &mstruct[0][i]; } else { cur_mstruct = &mstruct[0]; } if(!cur_mstruct->containsInterval(true) && !cur_mstruct->isNumber() && (!only_units || cur_mstruct->isUnit_exp())) { const MathStructure *exp = NULL; const MathStructure *bas; if(cur_mstruct->isPower() && IS_REAL((*cur_mstruct)[1]) && !(*cur_mstruct)[0].isNumber()) { exp = cur_mstruct->exponent(); bas = cur_mstruct->base(); } else { bas = cur_mstruct; } bool b = true; for(size_t i2 = 1; i2 < mstruct.size(); i2++) { b = false; size_t i3 = 0; const MathStructure *cmp_mstruct; while(true) { if(mstruct[i2].isMultiplication()) { if(i3 >= mstruct[i2].size()) { break; } cmp_mstruct = &mstruct[i2][i3]; } else { cmp_mstruct = &mstruct[i2]; } if(cmp_mstruct->equals(*bas)) { if(exp) { exp = NULL; } b = true; break; } else if(cmp_mstruct->isPower() && IS_REAL((*cmp_mstruct)[1]) && cmp_mstruct->base()->equals(*bas)) { if(exp) { if(cmp_mstruct->exponent()->number().isLessThan(exp->number())) { exp = cmp_mstruct->exponent(); } b = true; break; } else { b = true; break; } } if(!mstruct[i2].isMultiplication()) { break; } i3++; } if(!b) break; } if(b) { if(exp) { MathStructure *mstruct = new MathStructure(*bas); mstruct->raise(*exp); if(factor_mstruct.isOne()) { factor_mstruct.set_nocopy(*mstruct); mstruct->unref(); } else { factor_mstruct.multiply_nocopy(mstruct, true); } } else { if(factor_mstruct.isOne()) factor_mstruct.set(*bas); else factor_mstruct.multiply(*bas, true); } } } if(!mstruct[0].isMultiplication()) { break; } i++; } } if(!factor_mstruct.isOne()) { if(&mstruct != &mnew) mnew.set(mstruct); MathStructure *mfactor; size_t i = 0; while(true) { if(factor_mstruct.isMultiplication()) { if(i >= factor_mstruct.size()) break; mfactor = &factor_mstruct[i]; } else { mfactor = &factor_mstruct; } for(size_t i2 = 0; i2 < mnew.size(); i2++) { switch(mnew[i2].type()) { case STRUCT_NUMBER: { if(mfactor->isNumber()) { mnew[i2].number() /= mfactor->number(); } break; } case STRUCT_POWER: { if(!IS_REAL(mnew[i2][1])) { if(mfactor->isNumber()) { mnew[i2].transform(STRUCT_MULTIPLICATION); mnew[i2].insertChild(MathStructure(1, 1, 0), 1); mnew[i2][0].number() /= mfactor->number(); } else { mnew[i2].set(m_one); } } else if(mfactor->isNumber()) { mnew[i2].transform(STRUCT_MULTIPLICATION); mnew[i2].insertChild(MathStructure(1, 1, 0), 1); mnew[i2][0].number() /= mfactor->number(); } else if(mfactor->isPower() && IS_REAL((*mfactor)[1])) { if(mfactor->equals(mnew[i2])) { mnew[i2].set(m_one); } else { mnew[i2][1].number() -= mfactor->exponent()->number(); if(mnew[i2][1].number().isOne()) { mnew[i2].setToChild(1, true); } } } else { mnew[i2][1].number() -= 1; if(mnew[i2][1].number().isOne()) { mnew[i2].setToChild(1); } else if(mnew[i2][1].number().isZero()) { mnew[i2].set(m_one); } } break; } case STRUCT_MULTIPLICATION: { bool b = true; if(mfactor->isNumber() && (mnew[i2].size() < 1 || !mnew[i2][0].isNumber())) { mnew[i2].insertChild(MathStructure(1, 1, 0), 1); } for(size_t i3 = 0; i3 < mnew[i2].size() && b; i3++) { switch(mnew[i2][i3].type()) { case STRUCT_NUMBER: { if(mfactor->isNumber()) { if(mfactor->equals(mnew[i2][i3])) { mnew[i2].delChild(i3 + 1); } else { mnew[i2][i3].number() /= mfactor->number(); } b = false; } break; } case STRUCT_POWER: { if(!IS_REAL(mnew[i2][i3][1])) { if(mfactor->equals(mnew[i2][i3])) { mnew[i2].delChild(i3 + 1); b = false; } } else if(mfactor->isPower() && IS_REAL((*mfactor)[1]) && mfactor->base()->equals(mnew[i2][i3][0])) { if(mfactor->equals(mnew[i2][i3])) { mnew[i2].delChild(i3 + 1); } else { mnew[i2][i3][1].number() -= mfactor->exponent()->number(); if(mnew[i2][i3][1].number().isOne()) { MathStructure mstruct2(mnew[i2][i3][0]); mnew[i2][i3] = mstruct2; } else if(mnew[i2][i3][1].number().isZero()) { mnew[i2].delChild(i3 + 1); } } b = false; } else if(mfactor->equals(mnew[i2][i3][0])) { if(mnew[i2][i3][1].number() == 2) { MathStructure mstruct2(mnew[i2][i3][0]); mnew[i2][i3] = mstruct2; } else if(mnew[i2][i3][1].number().isOne()) { mnew[i2].delChild(i3 + 1); } else { mnew[i2][i3][1].number() -= 1; } b = false; } break; } default: { if(mfactor->equals(mnew[i2][i3])) { mnew[i2].delChild(i3 + 1); b = false; } } } } if(mnew[i2].size() == 1) { MathStructure mstruct2(mnew[i2][0]); mnew[i2] = mstruct2; } break; } default: { if(mfactor->isNumber()) { mnew[i2].transform(STRUCT_MULTIPLICATION); mnew[i2].insertChild(MathStructure(1, 1, 0), 1); mnew[i2][0].number() /= mfactor->number(); } else { mnew[i2].set(m_one); } } } } if(factor_mstruct.isMultiplication()) { i++; } else { break; } } return true; } } default: {} } return false; } bool get_first_symbol(const MathStructure &mpoly, MathStructure &xvar) { if(IS_A_SYMBOL(mpoly) || mpoly.isUnit()) { xvar = mpoly; return true; } else if(mpoly.isAddition() || mpoly.isMultiplication()) { for(size_t i = 0; i < mpoly.size(); i++) { if(get_first_symbol(mpoly[i], xvar)) return true; } } else if(mpoly.isPower()) { return get_first_symbol(mpoly[0], xvar); } return false; } bool MathStructure::polynomialDivide(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args) { mquotient.clear(); if(CALCULATOR->aborted()) return false; if(mden.isZero()) { //division by zero return false; } if(mnum.isZero()) { mquotient.clear(); return true; } if(mden.isNumber()) { mquotient = mnum; if(mnum.isNumber()) { mquotient.number() /= mden.number(); } else { mquotient.calculateDivide(mden, eo); } return true; } else if(mnum.isNumber()) { return false; } if(mnum == mden) { mquotient.set(1, 1, 0); return true; } if(check_args && (!mnum.isRationalPolynomial() || !mden.isRationalPolynomial())) { return false; } MathStructure xvar; if(!get_first_symbol(mnum, xvar) && !get_first_symbol(mden, xvar)) return false; EvaluationOptions eo2 = eo; eo2.keep_zero_units = false; Number numdeg = mnum.degree(xvar); Number dendeg = mden.degree(xvar); MathStructure dencoeff; mden.coefficient(xvar, dendeg, dencoeff); MathStructure mrem(mnum); for(size_t i = 0; numdeg.isGreaterThanOrEqualTo(dendeg); i++) { if(i > 1000 || CALCULATOR->aborted()) { return false; } MathStructure numcoeff; mrem.coefficient(xvar, numdeg, numcoeff); numdeg -= dendeg; if(numcoeff == dencoeff) { if(numdeg.isZero()) { numcoeff.set(1, 1, 0); } else { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } } else { if(dencoeff.isNumber()) { if(numcoeff.isNumber()) { numcoeff.number() /= dencoeff.number(); } else { numcoeff.calculateDivide(dencoeff, eo2); } } else { MathStructure mcopy(numcoeff); if(!MathStructure::polynomialDivide(mcopy, dencoeff, numcoeff, eo2, false)) { return false; } } if(!numdeg.isZero() && !numcoeff.isZero()) { if(numcoeff.isOne()) { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } else { numcoeff.multiply(xvar, true); if(!numdeg.isOne()) { numcoeff[numcoeff.size() - 1].raise(numdeg); } numcoeff.calculateMultiplyLast(eo2); } } } if(mquotient.isZero()) mquotient = numcoeff; else mquotient.add(numcoeff, true); numcoeff.calculateMultiply(mden, eo2); mrem.calculateSubtract(numcoeff, eo2); if(mrem.isZero()) { return true; } numdeg = mrem.degree(xvar); } return false; } bool polynomial_divide_integers(const vector &vnum, const vector &vden, vector &vquotient) { vquotient.clear(); long int numdeg = vnum.size() - 1; long int dendeg = vden.size() - 1; Number dencoeff(vden[dendeg]); if(numdeg < dendeg) return false; vquotient.resize(numdeg - dendeg + 1, nr_zero); vector vrem = vnum; while(numdeg >= dendeg) { Number numcoeff(vrem[numdeg]); numdeg -= dendeg; if(!numcoeff.isIntegerDivisible(dencoeff)) break; numcoeff /= dencoeff; vquotient[numdeg] += numcoeff; for(size_t i = 0; i < vden.size(); i++) { vrem[numdeg + i] -= (vden[i] * numcoeff); } while(true) { if(vrem.back().isZero()) vrem.pop_back(); else break; if(vrem.size() == 0) return true; } numdeg = (long int) vrem.size() - 1; } return false; } bool divide_in_z(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const sym_desc_vec &sym_stats, size_t var_i, const EvaluationOptions &eo) { if(var_i >= sym_stats.size()) return false; mquotient.clear(); if(mden.isZero()) return false; if(mnum.isZero()) return true; if(mden.isOne()) { mquotient = mnum; return true; } if(mnum.isNumber()) { if(!mden.isNumber()) { return false; } mquotient = mnum; return mquotient.number().divide(mden.number()) && mquotient.isInteger(); } if(mnum == mden) { mquotient.set(1, 1, 0); return true; } if(mden.isPower()) { MathStructure qbar(mnum); for(Number ni(mden[1].number()); ni.isPositive(); ni--) { if(!divide_in_z(qbar, mden[0], mquotient, sym_stats, var_i, eo)) return false; qbar = mquotient; } return true; } if(mden.isMultiplication()) { MathStructure qbar(mnum); for(size_t i = 0; i < mden.size(); i++) { sym_desc_vec sym_stats2; get_symbol_stats(mnum, mden[i], sym_stats2); if(!divide_in_z(qbar, mden[i], mquotient, sym_stats2, 0, eo)) return false; qbar = mquotient; } return true; } const MathStructure &xvar = sym_stats[var_i].sym; Number numdeg = mnum.degree(xvar); Number dendeg = mden.degree(xvar); if(dendeg.isGreaterThan(numdeg)) return false; MathStructure dencoeff; MathStructure mrem(mnum); mden.coefficient(xvar, dendeg, dencoeff); while(numdeg.isGreaterThanOrEqualTo(dendeg)) { MathStructure numcoeff; mrem.coefficient(xvar, numdeg, numcoeff); MathStructure term; if(!divide_in_z(numcoeff, dencoeff, term, sym_stats, var_i + 1, eo)) break; numdeg -= dendeg; if(!numdeg.isZero() && !term.isZero()) { if(term.isOne()) { term = xvar; if(!numdeg.isOne()) { term.raise(numdeg); } } else { term.multiply(xvar, true); if(!numdeg.isOne()) { term[term.size() - 1].raise(numdeg); } term.calculateMultiplyLast(eo); } } if(mquotient.isZero()) { mquotient = term; } else { mquotient.calculateAdd(term, eo); } term.calculateMultiply(mden, eo); mrem.calculateSubtract(term, eo); if(mrem.isZero()) { return true; } numdeg = mrem.degree(xvar); } return false; } bool prem(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mrem, const EvaluationOptions &eo, bool check_args) { mrem.clear(); if(mden.isZero()) { //division by zero return false; } if(mnum.isNumber()) { if(!mden.isNumber()) { mrem = mden; } return true; } if(check_args && (!mnum.isRationalPolynomial() || !mden.isRationalPolynomial())) { return false; } mrem = mnum; MathStructure eb(mden); Number rdeg = mrem.degree(xvar); Number bdeg = eb.degree(xvar); MathStructure blcoeff; if(bdeg.isLessThanOrEqualTo(rdeg)) { eb.coefficient(xvar, bdeg, blcoeff); if(bdeg == 0) { eb.clear(); } else { MathStructure mpow(xvar); mpow.raise(bdeg); mpow.calculateRaiseExponent(eo); //POWER_CLEAN(mpow) mpow.calculateMultiply(blcoeff, eo); eb.calculateSubtract(mpow, eo); } } else { blcoeff.set(1, 1, 0); } Number delta(rdeg); delta -= bdeg; delta++; int i = 0; while(rdeg.isGreaterThanOrEqualTo(bdeg) && !mrem.isZero()) { if(CALCULATOR->aborted() || delta < i / 10) {mrem.clear(); return false;} MathStructure rlcoeff; mrem.coefficient(xvar, rdeg, rlcoeff); MathStructure term(xvar); term.raise(rdeg); term[1].number() -= bdeg; term.calculateRaiseExponent(eo); //POWER_CLEAN(term) term.calculateMultiply(rlcoeff, eo); term.calculateMultiply(eb, eo); if(rdeg == 0) { mrem = term; mrem.calculateNegate(eo); } else { if(!rdeg.isZero()) { rlcoeff.multiply(xvar, true); if(!rdeg.isOne()) { rlcoeff[rlcoeff.size() - 1].raise(rdeg); rlcoeff[rlcoeff.size() - 1].calculateRaiseExponent(eo); } rlcoeff.calculateMultiplyLast(eo); } mrem.calculateSubtract(rlcoeff, eo); mrem.calculateMultiply(blcoeff, eo); mrem.calculateSubtract(term, eo); } rdeg = mrem.degree(xvar); i++; } delta -= i; blcoeff.raise(delta); blcoeff.calculateRaiseExponent(eo); mrem.calculateMultiply(blcoeff, eo); return true; } bool sr_gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mgcd, const sym_desc_vec &sym_stats, size_t var_i, const EvaluationOptions &eo) { if(var_i >= sym_stats.size()) return false; const MathStructure &xvar = sym_stats[var_i].sym; MathStructure c, d; Number adeg = m1.degree(xvar); Number bdeg = m2.degree(xvar); Number cdeg, ddeg; if(adeg.isGreaterThanOrEqualTo(bdeg)) { c = m1; d = m2; cdeg = adeg; ddeg = bdeg; } else { c = m2; d = m1; cdeg = bdeg; ddeg = adeg; } MathStructure cont_c, cont_d; c.polynomialContent(xvar, cont_c, eo); d.polynomialContent(xvar, cont_d, eo); MathStructure gamma; if(!MathStructure::gcd(cont_c, cont_d, gamma, eo, NULL, NULL, false)) return false; mgcd = gamma; if(ddeg.isZero()) { return true; } MathStructure prim_c, prim_d; c.polynomialPrimpart(xvar, cont_c, prim_c, eo); d.polynomialPrimpart(xvar, cont_d, prim_d, eo); c = prim_c; d = prim_d; MathStructure r; MathStructure ri(1, 1, 0); MathStructure psi(1, 1, 0); Number delta(cdeg); delta -= ddeg; while(true) { if(CALCULATOR->aborted()) return false; if(!prem(c, d, xvar, r, eo, false)) return false; if(r.isZero()) { mgcd = gamma; MathStructure mprim; d.polynomialPrimpart(xvar, mprim, eo); if(CALCULATOR->aborted()) return false; mgcd.calculateMultiply(mprim, eo); return true; } c = d; cdeg = ddeg; MathStructure psi_pow(psi); psi_pow.calculateRaise(delta, eo); ri.calculateMultiply(psi_pow, eo); if(!divide_in_z(r, ri, d, sym_stats, var_i, eo)) { return false; } ddeg = d.degree(xvar); if(ddeg.isZero()) { if(r.isNumber()) { mgcd = gamma; } else { r.polynomialPrimpart(xvar, mgcd, eo); if(CALCULATOR->aborted()) return false; mgcd.calculateMultiply(gamma, eo); } return true; } c.lcoefficient(xvar, ri); if(delta.isOne()) { psi = ri; } else if(!delta.isZero()) { MathStructure ri_pow(ri); ri_pow.calculateRaise(delta, eo); MathStructure psi_pow(psi); delta--; psi_pow.calculateRaise(delta, eo); divide_in_z(ri_pow, psi_pow, psi, sym_stats, var_i + 1, eo); } delta = cdeg; delta -= ddeg; } return false; } Number MathStructure::maxCoefficient() { if(isNumber()) { Number nr(o_number); nr.abs(); return nr; } else if(isAddition()) { Number cur_max(overallCoefficient()); cur_max.abs(); for(size_t i = 0; i < SIZE; i++) { Number a(CHILD(i).overallCoefficient()); a.abs(); if(a.isGreaterThan(cur_max)) cur_max = a; } return cur_max; } else if(isMultiplication()) { Number nr(overallCoefficient()); nr.abs(); return nr; } else { return nr_one; } } void polynomial_smod(const MathStructure &mpoly, const Number &xi, MathStructure &msmod, const EvaluationOptions &eo, MathStructure *mparent, size_t index_smod) { if(mpoly.isNumber()) { msmod = mpoly; msmod.number().smod(xi); } else if(mpoly.isAddition()) { msmod.clear(); msmod.setType(STRUCT_ADDITION); msmod.resizeVector(mpoly.size(), m_zero); for(size_t i = 0; i < mpoly.size(); i++) { polynomial_smod(mpoly[i], xi, msmod[i], eo, &msmod, i); } msmod.calculatesub(eo, eo, false, mparent, index_smod); } else if(mpoly.isMultiplication()) { msmod = mpoly; if(msmod.size() > 0 && msmod[0].isNumber()) { if(!msmod[0].number().smod(xi) || msmod[0].isZero()) { msmod.clear(); } } } else { msmod = mpoly; } } void interpolate(const MathStructure &gamma, const Number &xi, const MathStructure &xvar, MathStructure &minterp, const EvaluationOptions &eo) { MathStructure e(gamma); Number rxi(xi); rxi.recip(); minterp.clear(); for(long int i = 0; !e.isZero(); i++) { MathStructure gi; polynomial_smod(e, xi, gi, eo); if(minterp.isZero() && !gi.isZero()) { minterp = gi; if(i != 0) { if(minterp.isOne()) { minterp = xvar; if(i != 1) minterp.raise(i); } else { minterp.multiply(xvar, true); if(i != 1) minterp[minterp.size() - 1].raise(i); minterp.calculateMultiplyLast(eo); } } } else if(!gi.isZero()) { minterp.add(gi, true); if(i != 0) { if(minterp[minterp.size() - 1].isOne()) { minterp[minterp.size() - 1] = xvar; if(i != 1) minterp[minterp.size() - 1].raise(i); } else { minterp[minterp.size() - 1].multiply(xvar, true); if(i != 1) minterp[minterp.size() - 1][minterp[minterp.size() - 1].size() - 1].raise(i); minterp[minterp.size() - 1].calculateMultiplyLast(eo); } } } if(!gi.isZero()) e.calculateSubtract(gi, eo); e.calculateMultiply(rxi, eo); } minterp.calculatesub(eo, eo, false); } bool heur_gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mgcd, const EvaluationOptions &eo, MathStructure *ca, MathStructure *cb, sym_desc_vec &sym_stats, size_t var_i) { if(var_i >= sym_stats.size()) return false; if(m1.isZero() || m2.isZero()) return false; if(m1.isNumber() && m2.isNumber()) { mgcd = m1; if(!mgcd.number().gcd(m2.number())) mgcd.set(1, 1, 0); if(ca) { *ca = m1; ca->number() /= mgcd.number(); } if(cb) { *cb = m2; cb->number() /= mgcd.number(); } return true; } const MathStructure &xvar = sym_stats[var_i].sym; Number nr_gc; integer_content(m1, nr_gc); Number nr_rgc; integer_content(m2, nr_rgc); nr_gc.gcd(nr_rgc); nr_rgc = nr_gc; nr_rgc.recip(); MathStructure p(m1); p.calculateMultiply(nr_rgc, eo); MathStructure q(m2); q.calculateMultiply(nr_rgc, eo); Number maxdeg(p.degree(xvar)); Number maxdeg2(q.degree(xvar)); if(maxdeg2.isGreaterThan(maxdeg)) maxdeg = maxdeg2; Number mp(p.maxCoefficient()); Number mq(q.maxCoefficient()); Number xi; if(mp.isGreaterThan(mq)) { xi = mq; } else { xi = mp; } xi *= 2; xi += 2; for(int t = 0; t < 6; t++) { if(CALCULATOR->aborted()) return false; if((maxdeg * xi.integerLength()).isGreaterThan(100000L)) { return false; } MathStructure cp, cq; MathStructure gamma; MathStructure psub(p); psub.calculateReplace(xvar, xi, eo); MathStructure qsub(q); qsub.calculateReplace(xvar, xi, eo); if(heur_gcd(psub, qsub, gamma, eo, &cp, &cq, sym_stats, var_i + 1)) { interpolate(gamma, xi, xvar, mgcd, eo); Number ig; integer_content(mgcd, ig); ig.recip(); mgcd.calculateMultiply(ig, eo); MathStructure dummy; if(divide_in_z(p, mgcd, ca ? *ca : dummy, sym_stats, var_i, eo) && divide_in_z(q, mgcd, cb ? *cb : dummy, sym_stats, var_i, eo)) { mgcd.calculateMultiply(nr_gc, eo); return true; } } Number xi2(xi); xi2.isqrt(); xi2.isqrt(); xi *= xi2; xi *= 73794L; xi.iquo(27011L); } return false; } int MathStructure::polynomialUnit(const MathStructure &xvar) const { MathStructure coeff; lcoefficient(xvar, coeff); if(coeff.hasNegativeSign()) return -1; return 1; } void integer_content(const MathStructure &mpoly, Number &icontent) { if(mpoly.isNumber()) { icontent = mpoly.number(); icontent.abs(); } else if(mpoly.isAddition()) { icontent.clear(); Number l(1, 1); for(size_t i = 0; i < mpoly.size(); i++) { if(mpoly[i].isNumber()) { if(!icontent.isOne()) { Number c = icontent; icontent = mpoly[i].number().numerator(); icontent.gcd(c); } Number l2 = l; l = mpoly[i].number().denominator(); l.lcm(l2); } else if(mpoly[i].isMultiplication()) { if(!icontent.isOne()) { Number c = icontent; icontent = mpoly[i].overallCoefficient().numerator(); icontent.gcd(c); } Number l2 = l; l = mpoly[i].overallCoefficient().denominator(); l.lcm(l2); } else { icontent.set(1, 1, 0); } } icontent /= l; } else if(mpoly.isMultiplication()) { icontent = mpoly.overallCoefficient(); icontent.abs(); } else { icontent.set(1, 1, 0); } } bool MathStructure::lcm(const MathStructure &m1, const MathStructure &m2, MathStructure &mlcm, const EvaluationOptions &eo, bool check_args) { if(m1.isNumber() && m2.isNumber()) { mlcm = m1; return mlcm.number().lcm(m2.number()); } if(check_args && (!m1.isRationalPolynomial() || !m2.isRationalPolynomial())) { return false; } MathStructure ca, cb; if(!MathStructure::gcd(m1, m2, mlcm, eo, &ca, &cb, false)) return false; mlcm.calculateMultiply(ca, eo); mlcm.calculateMultiply(cb, eo); return true; } void MathStructure::polynomialContent(const MathStructure &xvar, MathStructure &mcontent, const EvaluationOptions &eo) const { if(isZero()) { mcontent.clear(); return; } if(isNumber()) { mcontent = *this; mcontent.number().setNegative(false); return; } MathStructure c; integer_content(*this, c.number()); MathStructure r(*this); if(!c.isOne()) r.calculateDivide(c, eo); MathStructure lcoeff; r.lcoefficient(xvar, lcoeff); if(lcoeff.isInteger()) { mcontent = c; return; } Number deg(r.degree(xvar)); Number ldeg(r.ldegree(xvar)); if(deg == ldeg) { mcontent = lcoeff; if(lcoeff.polynomialUnit(xvar) == -1) { c.number().negate(); } mcontent.calculateMultiply(c, eo); return; } mcontent.clear(); MathStructure mtmp, coeff; for(Number i(ldeg); i.isLessThanOrEqualTo(deg); i++) { coefficient(xvar, i, coeff); mtmp = mcontent; if(!MathStructure::gcd(coeff, mtmp, mcontent, eo, NULL, NULL, false)) mcontent.set(1, 1, 0); if(mcontent.isOne()) break; } if(!c.isOne()) mcontent.calculateMultiply(c, eo); } void MathStructure::polynomialPrimpart(const MathStructure &xvar, MathStructure &mprim, const EvaluationOptions &eo) const { if(isZero()) { mprim.clear(); return; } if(isNumber()) { mprim.set(1, 1, 0); return; } MathStructure c; polynomialContent(xvar, c, eo); if(c.isZero()) { mprim.clear(); return; } bool b = (polynomialUnit(xvar) == -1); if(c.isNumber()) { if(b) c.number().negate(); mprim = *this; mprim.calculateDivide(c, eo); return; } if(b) c.calculateNegate(eo); MathStructure::polynomialQuotient(*this, c, xvar, mprim, eo, false); } void MathStructure::polynomialUnitContentPrimpart(const MathStructure &xvar, int &munit, MathStructure &mcontent, MathStructure &mprim, const EvaluationOptions &eo) const { if(isZero()) { munit = 1; mcontent.clear(); mprim.clear(); return; } if(isNumber()) { if(o_number.isNegative()) { munit = -1; mcontent = *this; mcontent.number().abs(); } else { munit = 1; mcontent = *this; } mprim.set(1, 1, 0); return; } munit = polynomialUnit(xvar); polynomialContent(xvar, mcontent, eo); if(mcontent.isZero()) { mprim.clear(); return; } if(mcontent.isNumber()) { mprim = *this; if(munit == -1) { Number c(mcontent.number()); c.negate(); mprim.calculateDivide(c, eo); } else { mprim.calculateDivide(mcontent, eo); } return; } if(munit == -1) { MathStructure c(mcontent); c.calculateNegate(eo); MathStructure::polynomialQuotient(*this, c, xvar, mprim, eo, false); } else { MathStructure::polynomialQuotient(*this, mcontent, xvar, mprim, eo, false); } } void MathStructure::polynomialPrimpart(const MathStructure &xvar, const MathStructure &c, MathStructure &mprim, const EvaluationOptions &eo) const { if(isZero() || c.isZero()) { mprim.clear(); return; } if(isNumber()) { mprim.set(1, 1, 0); return; } bool b = (polynomialUnit(xvar) == -1); if(c.isNumber()) { MathStructure cn(c); if(b) cn.number().negate(); mprim = *this; mprim.calculateDivide(cn, eo); return; } if(b) { MathStructure cn(c); cn.calculateNegate(eo); MathStructure::polynomialQuotient(*this, cn, xvar, mprim, eo, false); } else { MathStructure::polynomialQuotient(*this, c, xvar, mprim, eo, false); } } const Number& MathStructure::degree(const MathStructure &xvar) const { const Number *c = NULL; const MathStructure *mcur = NULL; for(size_t i = 0; ; i++) { if(isAddition()) { if(i >= SIZE) break; mcur = &CHILD(i); } else { mcur = this; } if((*mcur) == xvar) { if(!c) { c = &nr_one; } } else if(mcur->isPower() && (*mcur)[0] == xvar && (*mcur)[1].isNumber()) { if(!c || c->isLessThan((*mcur)[1].number())) { c = &(*mcur)[1].number(); } } else if(mcur->isMultiplication()) { for(size_t i2 = 0; i2 < mcur->size(); i2++) { if((*mcur)[i2] == xvar) { if(!c) { c = &nr_one; } } else if((*mcur)[i2].isPower() && (*mcur)[i2][0] == xvar && (*mcur)[i2][1].isNumber()) { if(!c || c->isLessThan((*mcur)[i2][1].number())) { c = &(*mcur)[i2][1].number(); } } } } if(!isAddition()) break; } if(!c) return nr_zero; return *c; } const Number& MathStructure::ldegree(const MathStructure &xvar) const { const Number *c = NULL; const MathStructure *mcur = NULL; for(size_t i = 0; ; i++) { if(isAddition()) { if(i >= SIZE) break; mcur = &CHILD(i); } else { mcur = this; } if((*mcur) == xvar) { c = &nr_one; } else if(mcur->isPower() && (*mcur)[0] == xvar && (*mcur)[1].isNumber()) { if(!c || c->isGreaterThan((*mcur)[1].number())) { c = &(*mcur)[1].number(); } } else if(mcur->isMultiplication()) { bool b = false; for(size_t i2 = 0; i2 < mcur->size(); i2++) { if((*mcur)[i2] == xvar) { c = &nr_one; b = true; } else if((*mcur)[i2].isPower() && (*mcur)[i2][0] == xvar && (*mcur)[i2][1].isNumber()) { if(!c || c->isGreaterThan((*mcur)[i2][1].number())) { c = &(*mcur)[i2][1].number(); } b = true; } } if(!b) return nr_zero; } else { return nr_zero; } if(!isAddition()) break; } if(!c) return nr_zero; return *c; } void MathStructure::lcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const { coefficient(xvar, degree(xvar), mcoeff); } void MathStructure::tcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const { coefficient(xvar, ldegree(xvar), mcoeff); } void MathStructure::coefficient(const MathStructure &xvar, const Number &pownr, MathStructure &mcoeff) const { const MathStructure *mcur = NULL; mcoeff.clear(); for(size_t i = 0; ; i++) { if(isAddition()) { if(i >= SIZE) break; mcur = &CHILD(i); } else { mcur = this; } if((*mcur) == xvar) { if(pownr.isOne()) { if(mcoeff.isZero()) mcoeff.set(1, 1, 0); else mcoeff.add(m_one, true); } } else if(mcur->isPower() && (*mcur)[0] == xvar && (*mcur)[1].isNumber()) { if((*mcur)[1].number() == pownr) { if(mcoeff.isZero()) mcoeff.set(1, 1, 0); else mcoeff.add(m_one, true); } } else if(mcur->isMultiplication()) { bool b = false; for(size_t i2 = 0; i2 < mcur->size(); i2++) { bool b2 = false; if((*mcur)[i2] == xvar) { b = true; if(pownr.isOne()) b2 = true; } else if((*mcur)[i2].isPower() && (*mcur)[i2][0] == xvar && (*mcur)[i2][1].isNumber()) { b = true; if((*mcur)[i2][1].number() == pownr) b2 = true; } if(b2) { if(mcoeff.isZero()) { if(mcur->size() == 1) { mcoeff.set(1, 1, 0); } else { for(size_t i3 = 0; i3 < mcur->size(); i3++) { if(i3 != i2) { if(mcoeff.isZero()) mcoeff = (*mcur)[i3]; else mcoeff.multiply((*mcur)[i3], true); } } } } else if(mcur->size() == 1) { mcoeff.add(m_one, true); } else { mcoeff.add(m_zero, true); for(size_t i3 = 0; i3 < mcur->size(); i3++) { if(i3 != i2) { if(mcoeff[mcoeff.size() - 1].isZero()) mcoeff[mcoeff.size() - 1] = (*mcur)[i3]; else mcoeff[mcoeff.size() - 1].multiply((*mcur)[i3], true); } } } break; } } if(!b && pownr.isZero()) { if(mcoeff.isZero()) mcoeff = *mcur; else mcoeff.add(*mcur, true); } } else if(pownr.isZero()) { if(mcoeff.isZero()) mcoeff = *mcur; else mcoeff.add(*mcur, true); } if(!isAddition()) break; } mcoeff.evalSort(); } bool get_multiplier(const MathStructure &mstruct, const MathStructure &xvar, MathStructure &mcoeff, size_t exclude_i = (size_t) -1) { const MathStructure *mcur = NULL; mcoeff.clear(); for(size_t i = 0; ; i++) { if(mstruct.isAddition()) { if(i == exclude_i) i++; if(i >= mstruct.size()) break; mcur = &mstruct[i]; } else { mcur = &mstruct; } if((*mcur) == xvar) { if(mcoeff.isZero()) mcoeff.set(1, 1, 0); else mcoeff.add(m_one, true); } else if(mcur->isMultiplication()) { bool b = false; for(size_t i2 = 0; i2 < mcur->size(); i2++) { if((*mcur)[i2] == xvar) { b = true; if(mcoeff.isZero()) { if(mcur->size() == 1) { mcoeff.set(1, 1, 0); } else { for(size_t i3 = 0; i3 < mcur->size(); i3++) { if(i3 != i2) { if(mcoeff.isZero()) mcoeff = (*mcur)[i3]; else mcoeff.multiply((*mcur)[i3], true); } } } } else if(mcur->size() == 1) { mcoeff.add(m_one, true); } else { mcoeff.add(m_zero, true); for(size_t i3 = 0; i3 < mcur->size(); i3++) { if(i3 != i2) { if(mcoeff[mcoeff.size() - 1].isZero()) mcoeff[mcoeff.size() - 1] = (*mcur)[i3]; else mcoeff[mcoeff.size() - 1].multiply((*mcur)[i3], true); } } } break; } else if(xvar.isMultiplication() && xvar.size() > 0 && (*mcur)[i2] == xvar[0]) { if(mcur->size() - i2 < xvar.size()) break; b = true; for(size_t i3 = 1; i3 < xvar.size(); i3++) { if((*mcur)[i2 + i3] != xvar[i3]) {b = false; break;} } if(!b) break; if(mcoeff.isZero()) { if(mcur->size() == xvar.size()) { mcoeff.set(1, 1, 0); } else { for(size_t i3 = 0; i3 < mcur->size(); i3++) { if(i3 < i2 || i3 >= i2 + xvar.size()) { if(mcoeff.isZero()) mcoeff = (*mcur)[i3]; else mcoeff.multiply((*mcur)[i3], true); } } } } else if(mcur->size() == xvar.size()) { mcoeff.add(m_one, true); } else { mcoeff.add(m_zero, true); for(size_t i3 = 0; i3 < mcur->size(); i3++) { if(i3 < i2 || i3 >= i2 + xvar.size()) { if(mcoeff[mcoeff.size() - 1].isZero()) mcoeff[mcoeff.size() - 1] = (*mcur)[i3]; else mcoeff[mcoeff.size() - 1].multiply((*mcur)[i3], true); } } } break; } } if(!b) { mcoeff.clear(); return false; } } else { mcoeff.clear(); return false; } if(!mstruct.isAddition()) break; } if(mcoeff.isZero()) return false; mcoeff.evalSort(); return true; } bool get_power(const MathStructure &mstruct, const MathStructure &xvar, MathStructure &mpow) { if(mstruct == xvar) { mpow = m_one; return true; } if(mstruct.isPower() && mstruct[0] == xvar) { mpow = mstruct[1]; return true; } for(size_t i = 0; i < mstruct.size(); i++) { if(get_power(mstruct[i], xvar, mpow)) return true; } return false; } const MathStructure *get_power_term(const MathStructure &mstruct, const MathStructure &xvar) { if(mstruct == xvar) { return &mstruct; } if(mstruct.isPower() && mstruct[0] == xvar) { return &mstruct; } for(size_t i = 0; i < mstruct.size(); i++) { const MathStructure *mterm = get_power_term(mstruct[i], xvar); if(mterm) return mterm; } return NULL; } bool MathStructure::polynomialQuotient(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args) { mquotient.clear(); if(CALCULATOR->aborted()) return false; if(mden.isZero()) { //division by zero return false; } if(mnum.isZero()) { mquotient.clear(); return true; } if(mden.isNumber() && mnum.isNumber()) { mquotient = mnum; if(IS_REAL(mden) && IS_REAL(mnum)) { mquotient.number() /= mden.number(); } else { mquotient.calculateDivide(mden, eo); } return true; } if(mnum == mden) { mquotient.set(1, 1, 0); return true; } if(check_args && (!mnum.isRationalPolynomial() || !mden.isRationalPolynomial())) { return false; } EvaluationOptions eo2 = eo; eo2.keep_zero_units = false; Number numdeg = mnum.degree(xvar); Number dendeg = mden.degree(xvar); MathStructure dencoeff; mden.coefficient(xvar, dendeg, dencoeff); MathStructure mrem(mnum); for(size_t i = 0; numdeg.isGreaterThanOrEqualTo(dendeg); i++) { if(i > 1000 || CALCULATOR->aborted()) { return false; } MathStructure numcoeff; mrem.coefficient(xvar, numdeg, numcoeff); numdeg -= dendeg; if(numcoeff == dencoeff) { if(numdeg.isZero()) { numcoeff.set(1, 1, 0); } else { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } } else { if(dencoeff.isNumber()) { if(numcoeff.isNumber()) { numcoeff.number() /= dencoeff.number(); } else { numcoeff.calculateDivide(dencoeff, eo2); } } else { MathStructure mcopy(numcoeff); if(!MathStructure::polynomialDivide(mcopy, dencoeff, numcoeff, eo2, false)) { return false; } } if(!numdeg.isZero() && !numcoeff.isZero()) { if(numcoeff.isOne()) { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } else { numcoeff.multiply(xvar, true); if(!numdeg.isOne()) { numcoeff[numcoeff.size() - 1].raise(numdeg); } numcoeff.calculateMultiplyLast(eo2); } } } if(mquotient.isZero()) mquotient = numcoeff; else mquotient.calculateAdd(numcoeff, eo2); numcoeff.calculateMultiply(mden, eo2); mrem.calculateSubtract(numcoeff, eo2); if(mrem.isZero()) break; numdeg = mrem.degree(xvar); } return true; } bool remove_zerointerval_multiplier(MathStructure &mstruct, const EvaluationOptions &eo) { if(mstruct.isAddition()) { bool b; for(size_t i = 0; i < mstruct.size(); i++) { if(remove_zerointerval_multiplier(mstruct[i], eo)) b = true; } if(b) { mstruct.calculatesub(eo, eo, false); return true; } } else if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isNumber() && !mstruct[i].number().isNonZero()) { mstruct.clear(true); return true; } } } else if(mstruct.isNumber() && !mstruct.number().isNonZero()) { mstruct.clear(true); return true; } return false; } bool contains_zerointerval_multiplier(MathStructure &mstruct) { if(mstruct.isAddition()) { for(size_t i = 0; i < mstruct.size(); i++) { if(contains_zerointerval_multiplier(mstruct[i])) return true; } } else if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isNumber() && !mstruct[i].number().isNonZero()) return true; } } else if(mstruct.isNumber() && !mstruct.number().isNonZero()) { return true; } return false; } bool polynomial_long_division(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar_pre, MathStructure &mquotient, MathStructure &mrem, const EvaluationOptions &eo, bool check_args, bool for_newtonraphson) { mquotient.clear(); mrem.clear(); if(CALCULATOR->aborted()) return false; if(mden.isZero()) { //division by zero mrem.set(mnum); return false; } if(mnum.isZero()) { mquotient.clear(); return true; } if(mden.isNumber() && mnum.isNumber()) { mquotient = mnum; if(IS_REAL(mden) && IS_REAL(mnum)) { mquotient.number() /= mden.number(); } else { mquotient.calculateDivide(mden, eo); } return true; } else if(mnum.isNumber()) { mrem.set(mnum); return false; } if(mnum == mden) { mquotient.set(1, 1, 0); return true; } mrem.set(mnum); if(check_args && (!mnum.isRationalPolynomial(true, true) || !mden.isRationalPolynomial(true, true))) { return false; } MathStructure xvar(xvar_pre); if(xvar.isZero() && !get_first_symbol(mnum, xvar) && !get_first_symbol(mden, xvar)) return false; EvaluationOptions eo2 = eo; eo2.keep_zero_units = false; eo2.do_polynomial_division = false; Number numdeg = mnum.degree(xvar); Number dendeg = mden.degree(xvar); MathStructure dencoeff; mden.coefficient(xvar, dendeg, dencoeff); for(size_t i = 0; numdeg.isGreaterThanOrEqualTo(dendeg); i++) { if(i > 10000 || CALCULATOR->aborted()) { return false; } MathStructure numcoeff; mrem.coefficient(xvar, numdeg, numcoeff); numdeg -= dendeg; if(numcoeff == dencoeff) { if(numdeg.isZero()) { numcoeff.set(1, 1, 0); } else { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } } else { if(dencoeff.isNumber()) { if(numcoeff.isNumber()) { numcoeff.number() /= dencoeff.number(); } else { numcoeff.calculateDivide(dencoeff, eo2); } } else { if(for_newtonraphson) return false; MathStructure mcopy(numcoeff); if(!MathStructure::polynomialDivide(mcopy, dencoeff, numcoeff, eo2, check_args)) { if(CALCULATOR->aborted()) return false; break; } } if(!numdeg.isZero() && !numcoeff.isZero()) { if(numcoeff.isOne()) { numcoeff = xvar; if(!numdeg.isOne()) { numcoeff.raise(numdeg); } } else { numcoeff.multiply(xvar, true); if(!numdeg.isOne()) { numcoeff[numcoeff.size() - 1].raise(numdeg); } numcoeff.calculateMultiplyLast(eo2); } } } if(mquotient.isZero()) mquotient = numcoeff; else mquotient.calculateAdd(numcoeff, eo2); numcoeff.calculateMultiply(mden, eo2); mrem.calculateSubtract(numcoeff, eo2); if(contains_zerointerval_multiplier(mquotient)) return false; if(mrem.isZero() || (for_newtonraphson && mrem.isNumber())) break; if(contains_zerointerval_multiplier(mrem)) return false; numdeg = mrem.degree(xvar); } return true; } void add_symbol(const MathStructure &mpoly, sym_desc_vec &v) { sym_desc_vec::const_iterator it = v.begin(), itend = v.end(); while (it != itend) { if(it->sym == mpoly) return; ++it; } sym_desc d; d.sym = mpoly; v.push_back(d); } void collect_symbols(const MathStructure &mpoly, sym_desc_vec &v) { if(IS_A_SYMBOL(mpoly) || mpoly.isUnit()) { add_symbol(mpoly, v); } else if(mpoly.isAddition() || mpoly.isMultiplication()) { for(size_t i = 0; i < mpoly.size(); i++) collect_symbols(mpoly[i], v); } else if(mpoly.isPower()) { collect_symbols(mpoly[0], v); } } void add_symbol(const MathStructure &mpoly, vector &v) { vector::const_iterator it = v.begin(), itend = v.end(); while (it != itend) { if(*it == mpoly) return; ++it; } v.push_back(mpoly); } void collect_symbols(const MathStructure &mpoly, vector &v) { if(IS_A_SYMBOL(mpoly)) { add_symbol(mpoly, v); } else if(mpoly.isAddition() || mpoly.isMultiplication()) { for(size_t i = 0; i < mpoly.size(); i++) collect_symbols(mpoly[i], v); } else if(mpoly.isPower()) { collect_symbols(mpoly[0], v); } } void get_symbol_stats(const MathStructure &m1, const MathStructure &m2, sym_desc_vec &v) { collect_symbols(m1, v); collect_symbols(m2, v); sym_desc_vec::iterator it = v.begin(), itend = v.end(); while (it != itend) { it->deg_a = m1.degree(it->sym); it->deg_b = m2.degree(it->sym); if(it->deg_a.isGreaterThan(it->deg_b)) { it->max_deg = it->deg_a; } else { it->max_deg = it->deg_b; } it->ldeg_a = m1.ldegree(it->sym); it->ldeg_b = m2.ldegree(it->sym); MathStructure mcoeff; m1.lcoefficient(it->sym, mcoeff); it->max_lcnops = mcoeff.size(); m2.lcoefficient(it->sym, mcoeff); if(mcoeff.size() > it->max_lcnops) it->max_lcnops = mcoeff.size(); ++it; } std::sort(v.begin(), v.end()); } bool MathStructure::gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mresult, const EvaluationOptions &eo2, MathStructure *ca, MathStructure *cb, bool check_args) { EvaluationOptions eo = eo2; eo.keep_zero_units = false; if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1, 0); if(CALCULATOR->aborted()) return false; if(m1.isOne() || m2.isOne()) { return true; } if(m1.isNumber() && m2.isNumber()) { mresult = m1; if(!mresult.number().gcd(m2.number())) mresult.set(1, 1, 0); if(ca || cb) { if(mresult.isZero()) { if(ca) ca->clear(); if(cb) cb->clear(); } else { if(ca) { *ca = m1; ca->number() /= mresult.number(); } if(cb) { *cb = m2; cb->number() /= mresult.number(); } } } return true; } if(m1 == m2) { if(ca) ca->set(1, 1, 0); if(cb) cb->set(1, 1, 0); mresult = m1; return true; } if(m1.isZero()) { if(ca) ca->clear(); if(cb) cb->set(1, 1, 0); mresult = m2; return true; } if(m2.isZero()) { if(ca) ca->set(1, 1, 0); if(cb) cb->clear(); mresult = m1; return true; } if(check_args && (!m1.isRationalPolynomial() || !m2.isRationalPolynomial())) { return false; } if(m1.isMultiplication()) { if(m2.isMultiplication() && m2.size() > m1.size()) goto factored_2; factored_1: mresult.clear(); mresult.setType(STRUCT_MULTIPLICATION); MathStructure acc_ca; acc_ca.setType(STRUCT_MULTIPLICATION); MathStructure part_2(m2); MathStructure part_ca, part_cb; for (size_t i = 0; i < m1.size(); i++) { mresult.addChild(m_zero); MathStructure::gcd(m1[i], part_2, mresult[i], eo, &part_ca, &part_cb, false); if(CALCULATOR->aborted()) return false; acc_ca.addChild(part_ca); part_2 = part_cb; } mresult.calculatesub(eo, eo, false); if(ca) { *ca = acc_ca; ca->calculatesub(eo, eo, false); } if(cb) *cb = part_2; return true; } else if(m2.isMultiplication()) { if(m1.isMultiplication() && m1.size() > m2.size()) goto factored_1; factored_2: mresult.clear(); mresult.setType(STRUCT_MULTIPLICATION); MathStructure acc_cb; acc_cb.setType(STRUCT_MULTIPLICATION); MathStructure part_1(m1); MathStructure part_ca, part_cb; for(size_t i = 0; i < m2.size(); i++) { mresult.addChild(m_zero); MathStructure::gcd(part_1, m2[i], mresult[i], eo, &part_ca, &part_cb, false); if(CALCULATOR->aborted()) return false; acc_cb.addChild(part_cb); part_1 = part_ca; } mresult.calculatesub(eo, eo, false); if(ca) *ca = part_1; if(cb) { *cb = acc_cb; cb->calculatesub(eo, eo, false); } return true; } if(m1.isPower()) { MathStructure p(m1[0]); if(m2.isPower()) { if(m1[0] == m2[0]) { if(m1[1].number().isLessThan(m2[1].number())) { if(ca) ca->set(1, 1, 0); if(cb) { *cb = m2; (*cb)[1].number() -= m1[1].number(); POWER_CLEAN((*cb)) } mresult = m1; return true; } else { if(ca) { *ca = m1; (*ca)[1].number() -= m2[1].number(); POWER_CLEAN((*ca)) } if(cb) cb->set(1, 1, 0); mresult = m2; return true; } } else { MathStructure p_co, pb_co; MathStructure p_gcd; if(!MathStructure::gcd(m1[0], m2[0], p_gcd, eo, &p_co, &pb_co, false)) return false; if(p_gcd.isOne()) { return true; } else { if(m1[1].number().isLessThan(m2[1].number())) { mresult = p_gcd; mresult.calculateRaise(m1[1], eo); mresult.multiply(m_zero, true); p_co.calculateRaise(m1[1], eo); pb_co.calculateRaise(m2[1], eo); p_gcd.raise(m2[1]); p_gcd[1].number() -= m1[1].number(); p_gcd.calculateRaiseExponent(eo); p_gcd.calculateMultiply(pb_co, eo); bool b = MathStructure::gcd(p_co, p_gcd, mresult[mresult.size() - 1], eo, ca, cb, false); mresult.calculateMultiplyLast(eo); return b; } else { mresult = p_gcd; mresult.calculateRaise(m2[1], eo); mresult.multiply(m_zero, true); p_co.calculateRaise(m1[1], eo); pb_co.calculateRaise(m2[1], eo); p_gcd.raise(m1[1]); p_gcd[1].number() -= m2[1].number(); p_gcd.calculateRaiseExponent(eo); p_gcd.calculateMultiply(p_co, eo); bool b = MathStructure::gcd(p_gcd, pb_co, mresult[mresult.size() - 1], eo, ca, cb, false); mresult.calculateMultiplyLast(eo); return b; } } } } else { if(m1[0] == m2) { if(ca) { *ca = m1; (*ca)[1].number()--; POWER_CLEAN((*ca)) } if(cb) cb->set(1, 1, 0); mresult = m2; return true; } MathStructure p_co, bpart_co; MathStructure p_gcd; if(!MathStructure::gcd(m1[0], m2, p_gcd, eo, &p_co, &bpart_co, false)) return false; if(p_gcd.isOne()) { return true; } else { mresult = p_gcd; mresult.multiply(m_zero, true); p_co.calculateRaise(m1[1], eo); p_gcd.raise(m1[1]); p_gcd[1].number()--; p_gcd.calculateRaiseExponent(eo); p_gcd.calculateMultiply(p_co, eo); bool b = MathStructure::gcd(p_gcd, bpart_co, mresult[mresult.size() - 1], eo, ca, cb, false); mresult.calculateMultiplyLast(eo); return b; } } } else if(m2.isPower()) { if(m2[0] == m1) { if(ca) ca->set(1, 1, 0); if(cb) { *cb = m2; (*cb)[1].number()--; POWER_CLEAN((*cb)) } mresult = m1; return true; } MathStructure p_co, apart_co; MathStructure p_gcd; if(!MathStructure::gcd(m1, m2[0], p_gcd, eo, &apart_co, &p_co, false)) return false; if(p_gcd.isOne()) { return true; } else { mresult = p_gcd; mresult.multiply(m_zero, true); p_co.calculateRaise(m2[1], eo); p_gcd.raise(m2[1]); p_gcd[1].number()--; p_gcd.calculateRaiseExponent(eo); p_gcd.calculateMultiply(p_co, eo); bool b = MathStructure::gcd(apart_co, p_gcd, mresult[mresult.size() - 1], eo, ca, cb, false); mresult.calculateMultiplyLast(eo); return b; } } if(IS_A_SYMBOL(m1) || m1.isUnit()) { MathStructure bex(m2); bex.calculateReplace(m1, m_zero, eo); if(!bex.isZero()) { return true; } } if(IS_A_SYMBOL(m2) || m2.isUnit()) { MathStructure aex(m1); aex.calculateReplace(m2, m_zero, eo); if(!aex.isZero()) { return true; } } sym_desc_vec sym_stats; get_symbol_stats(m1, m2, sym_stats); if(sym_stats.empty()) return false; size_t var_i = 0; const MathStructure &xvar = sym_stats[var_i].sym; Number ldeg_a(sym_stats[var_i].ldeg_a); Number ldeg_b(sym_stats[var_i].ldeg_b); Number min_ldeg; if(ldeg_a.isLessThan(ldeg_b)) { min_ldeg = ldeg_a; } else { min_ldeg = ldeg_b; } if(min_ldeg.isPositive()) { MathStructure aex(m1), bex(m2); MathStructure common(xvar); if(!min_ldeg.isOne()) common.raise(min_ldeg); aex.calculateDivide(common, eo); bex.calculateDivide(common, eo); MathStructure::gcd(aex, bex, mresult, eo, ca, cb, false); mresult.calculateMultiply(common, eo); return true; } if(sym_stats[var_i].deg_a.isZero()) { if(cb) { MathStructure c, mprim; int u; m2.polynomialUnitContentPrimpart(xvar, u, c, mprim, eo); MathStructure::gcd(m1, c, mresult, eo, ca, cb, false); if(CALCULATOR->aborted()) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1, 0); return false; } if(u == -1) { cb->calculateNegate(eo); } cb->calculateMultiply(mprim, eo); } else { MathStructure c; m2.polynomialContent(xvar, c, eo); MathStructure::gcd(m1, c, mresult, eo, ca, cb, false); } return true; } else if(sym_stats[var_i].deg_b.isZero()) { if(ca) { MathStructure c, mprim; int u; m1.polynomialUnitContentPrimpart(xvar, u, c, mprim, eo); MathStructure::gcd(c, m2, mresult, eo, ca, cb, false); if(CALCULATOR->aborted()) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1, 0); return false; } if(u == -1) { ca->calculateNegate(eo); } ca->calculateMultiply(mprim, eo); } else { MathStructure c; m1.polynomialContent(xvar, c, eo); MathStructure::gcd(c, m2, mresult, eo, ca, cb, false); } return true; } if(!heur_gcd(m1, m2, mresult, eo, ca, cb, sym_stats, var_i)) { if(!sr_gcd(m1, m2, mresult, sym_stats, var_i, eo)) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1, 0); return false; } if(!mresult.isOne()) { if(ca) { if(!MathStructure::polynomialDivide(m1, mresult, *ca, eo, false)) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1, 0); return false; } } if(cb) { if(!MathStructure::polynomialDivide(m2, mresult, *cb, eo, false)) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1, 0); return false; } } } if(CALCULATOR->aborted()) { if(ca) *ca = m1; if(cb) *cb = m2; mresult.set(1, 1, 0); return false; } } return true; } bool sqrfree_differentiate(const MathStructure &mpoly, const MathStructure &x_var, MathStructure &mdiff, const EvaluationOptions &eo) { if(mpoly == x_var) { mdiff.set(1, 1, 0); return true; } switch(mpoly.type()) { case STRUCT_ADDITION: { mdiff.clear(); mdiff.setType(STRUCT_ADDITION); for(size_t i = 0; i < mpoly.size(); i++) { mdiff.addChild(m_zero); if(!sqrfree_differentiate(mpoly[i], x_var, mdiff[i], eo)) return false; } mdiff.calculatesub(eo, eo, false); break; } case STRUCT_VARIABLE: {} case STRUCT_FUNCTION: {} case STRUCT_SYMBOLIC: {} case STRUCT_UNIT: {} case STRUCT_NUMBER: { mdiff.clear(); break; } case STRUCT_POWER: { if(mpoly[0] == x_var) { mdiff = mpoly[1]; mdiff.multiply(x_var); if(!mpoly[1].number().isTwo()) { mdiff[1].raise(mpoly[1]); mdiff[1][1].number()--; } mdiff.evalSort(true); } else { mdiff.clear(); } break; } case STRUCT_MULTIPLICATION: { if(mpoly.size() < 1) { mdiff.clear(); break; } else if(mpoly.size() < 2) { return sqrfree_differentiate(mpoly[0], x_var, mdiff, eo); } mdiff.clear(); for(size_t i = 0; i < mpoly.size(); i++) { if(mpoly[i] == x_var) { if(mpoly.size() == 2) { if(i == 0) mdiff = mpoly[1]; else mdiff = mpoly[0]; } else { mdiff.setType(STRUCT_MULTIPLICATION); for(size_t i2 = 0; i2 < mpoly.size(); i2++) { if(i2 != i) { mdiff.addChild(mpoly[i2]); } } } break; } else if(mpoly[i].isPower() && mpoly[i][0] == x_var) { mdiff = mpoly; if(mpoly[i][1].number().isTwo()) { mdiff[i].setToChild(1); } else { mdiff[i][1].number()--; } if(mdiff[0].isNumber()) { mdiff[0].number() *= mpoly[i][1].number(); } else { mdiff.insertChild(mpoly[i][1].number(), 1); } mdiff.evalSort(); break; } } break; } default: { return false; } } return true; } bool sqrfree_yun(const MathStructure &a, const MathStructure &xvar, MathStructure &factors, const EvaluationOptions &eo) { MathStructure w(a); MathStructure z; if(!sqrfree_differentiate(a, xvar, z, eo)) { return false; } MathStructure g; if(!MathStructure::gcd(w, z, g, eo)) { return false; } if(g.isOne()) { factors.addChild(a); return true; } MathStructure y; MathStructure tmp; do { tmp = w; if(!MathStructure::polynomialQuotient(tmp, g, xvar, w, eo)) { return false; } if(!MathStructure::polynomialQuotient(z, g, xvar, y, eo)) { return false; } if(!sqrfree_differentiate(w, xvar, tmp, eo)) { return false; } z = y; z.calculateSubtract(tmp, eo); if(!MathStructure::gcd(w, z, g, eo)) { return false; } factors.addChild(g); } while (!z.isZero()); return true; } bool sqrfree_simple(const MathStructure &a, const MathStructure &xvar, MathStructure &factors, const EvaluationOptions &eo) { MathStructure w(a); size_t i = 0; while(true) { MathStructure z, zmod; if(!sqrfree_differentiate(w, xvar, z, eo)) return false; polynomial_smod(z, nr_three, zmod, eo); if(z == w) { factors.addChild(w); break; } MathStructure mgcd; if(!MathStructure::gcd(w, z, mgcd, eo)) return false; if(mgcd.isOne() || mgcd == w) { factors.addChild(w); break; } MathStructure tmp(w); if(!MathStructure::polynomialQuotient(tmp, mgcd, xvar, w, eo)) return false; if(!sqrfree_simple(mgcd, xvar, factors, eo)) return false; i++; } return true; } void lcmcoeff(const MathStructure &e, const Number &l, Number &nlcm); void lcmcoeff(const MathStructure &e, const Number &l, Number &nlcm) { if(e.isNumber() && e.number().isRational()) { nlcm = e.number().denominator(); nlcm.lcm(l); } else if(e.isAddition()) { nlcm.set(1, 1, 0); for(size_t i = 0; i < e.size(); i++) { Number c(nlcm); lcmcoeff(e[i], c, nlcm); } nlcm.lcm(l); } else if(e.isMultiplication()) { nlcm.set(1, 1, 0); for(size_t i = 0; i < e.size(); i++) { Number c(nlcm); lcmcoeff(e[i], nr_one, c); nlcm *= c; } nlcm.lcm(l); } else if(e.isPower()) { if(IS_A_SYMBOL(e[0]) || e[0].isUnit()) { nlcm = l; } else { lcmcoeff(e[0], l, nlcm); nlcm ^= e[1].number(); } } else { nlcm = l; } } void lcm_of_coefficients_denominators(const MathStructure &e, Number &nlcm) { return lcmcoeff(e, nr_one, nlcm); } void multiply_lcm(const MathStructure &e, const Number &lcm, MathStructure &mmul, const EvaluationOptions &eo); void multiply_lcm(const MathStructure &e, const Number &lcm, MathStructure &mmul, const EvaluationOptions &eo) { if(e.isMultiplication()) { Number lcm_accum(1, 1); mmul.clear(); for(size_t i = 0; i < e.size(); i++) { Number op_lcm; lcmcoeff(e[i], nr_one, op_lcm); if(mmul.isZero()) { multiply_lcm(e[i], op_lcm, mmul, eo); if(mmul.isOne()) mmul.clear(); } else { mmul.multiply(m_one, true); multiply_lcm(e[i], op_lcm, mmul[mmul.size() - 1], eo); if(mmul[mmul.size() - 1].isOne()) { mmul.delChild(i + 1); if(mmul.size() == 1) mmul.setToChild(1); } } lcm_accum *= op_lcm; } Number lcm2(lcm); lcm2 /= lcm_accum; if(mmul.isZero()) { mmul = lcm2; } else if(!lcm2.isOne()) { if(mmul.size() > 0 && mmul[0].isNumber()) { mmul[0].number() *= lcm2; } else { mmul.multiply(lcm2, true); } } mmul.evalSort(); } else if(e.isAddition()) { mmul.clear(); for (size_t i = 0; i < e.size(); i++) { if(mmul.isZero()) { multiply_lcm(e[i], lcm, mmul, eo); } else { mmul.add(m_zero, true); multiply_lcm(e[i], lcm, mmul[mmul.size() - 1], eo); } } mmul.evalSort(); } else if(e.isPower()) { if(IS_A_SYMBOL(e[0]) || e[0].isUnit()) { mmul = e; if(!lcm.isOne()) { mmul *= lcm; mmul.evalSort(); } } else { mmul = e; Number lcm_exp = e[1].number(); lcm_exp.recip(); multiply_lcm(e[0], lcm ^ lcm_exp, mmul[0], eo); if(mmul[0] != e[0]) { mmul.calculatesub(eo, eo, false); } } } else if(e.isNumber()) { mmul = e; mmul.number() *= lcm; } else if(IS_A_SYMBOL(e) || e.isUnit()) { mmul = e; if(!lcm.isOne()) { mmul *= lcm; mmul.evalSort(); } } else { mmul = e; if(!lcm.isOne()) { mmul.calculateMultiply(lcm, eo); mmul.evalSort(); } } } //from GiNaC bool sqrfree(MathStructure &mpoly, const EvaluationOptions &eo) { vector symbols; collect_symbols(mpoly, symbols); return sqrfree(mpoly, symbols, eo); } bool sqrfree(MathStructure &mpoly, const vector &symbols, const EvaluationOptions &eo) { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = true; eo2.warn_about_denominators_assumed_nonzero = false; eo2.reduce_divisions = true; eo2.keep_zero_units = false; eo2.do_polynomial_division = false; eo2.sync_units = false; eo2.expand = true; eo2.calculate_functions = false; eo2.protected_function = CALCULATOR->f_signum; if(mpoly.size() == 0) { return true; } if(symbols.empty()) return true; size_t symbol_index = 0; if(symbols.size() > 1) { for(size_t i = 1; i < symbols.size(); i++) { if(mpoly.degree(symbols[symbol_index]).isGreaterThan(mpoly.degree(symbols[i]))) symbol_index = i; } } const MathStructure &xvar = symbols[symbol_index]; Number nlcm; lcm_of_coefficients_denominators(mpoly, nlcm); MathStructure tmp; multiply_lcm(mpoly, nlcm, tmp, eo2); MathStructure factors; factors.clearVector(); if(!sqrfree_yun(tmp, xvar, factors, eo2)) { factors.clearVector(); factors.addChild(tmp); } vector newsymbols; for(size_t i = 0; i < symbols.size(); i++) { if(i != symbol_index) newsymbols.push_back(symbols[i]); } if(newsymbols.size() > 0) { for(size_t i = 0; i < factors.size(); i++) { if(!sqrfree(factors[i], newsymbols, eo)) return false; } } mpoly.set(1, 1, 0); for(size_t i = 0; i < factors.size(); i++) { if(CALCULATOR->aborted()) return false; if(!factors[i].isOne()) { if(mpoly.isOne()) { mpoly = factors[i]; if(i != 0) mpoly.raise(MathStructure((long int) i + 1, 1L, 0L)); } else { mpoly.multiply(factors[i], true); mpoly[mpoly.size() - 1].raise(MathStructure((long int) i + 1, 1L, 0L)); } } } if(CALCULATOR->aborted()) return false; if(mpoly.isZero()) { CALCULATOR->error(true, "mpoly is zero: %s. %s", format_and_print(tmp).c_str(), _("This is a bug. Please report it."), NULL); return false; } MathStructure mquo; MathStructure mpoly_expand(mpoly); EvaluationOptions eo3 = eo; eo3.expand = true; mpoly_expand.calculatesub(eo3, eo3); MathStructure::polynomialQuotient(tmp, mpoly_expand, xvar, mquo, eo2); if(CALCULATOR->aborted()) return false; if(mquo.isZero()) { //CALCULATOR->error(true, "quo is zero: %s. %s", format_and_print(tmp).c_str(), _("This is a bug. Please report it."), NULL); return false; } if(newsymbols.size() > 0) { if(!sqrfree(mquo, newsymbols, eo)) return false; } if(!mquo.isOne()) { mpoly.multiply(mquo, true); } if(!nlcm.isOne()) { nlcm.recip(); mpoly.multiply(nlcm, true); } eo3.expand = false; mpoly.calculatesub(eo3, eo3, false); return true; } bool MathStructure::integerFactorize() { if(!isNumber()) return false; vector factors; if(!o_number.factorize(factors)) return false; if(factors.size() <= 1) return true; clear(true); bool b_pow = false; Number *lastnr = NULL; for(size_t i = 0; i < factors.size(); i++) { if(lastnr && factors[i] == *lastnr) { if(!b_pow) { LAST.raise(m_one); b_pow = true; } LAST[1].number()++; } else { APPEND(factors[i]); b_pow = false; } lastnr = &factors[i]; } m_type = STRUCT_MULTIPLICATION; return true; } size_t count_powers(const MathStructure &mstruct) { if(mstruct.isPower()) { if(mstruct[1].isInteger()) { bool overflow = false; int c = mstruct.number().intValue(&overflow) - 1; if(overflow) return 0; if(c < 0) return -c; return c; } } size_t c = 0; for(size_t i = 0; i < mstruct.size(); i++) { c += count_powers(mstruct[i]); } return c; } bool gather_factors(const MathStructure &mstruct, const MathStructure &x_var, MathStructure &madd, MathStructure &mmul, MathStructure &mexp, bool mexp_as_x2 = false) { madd.clear(); if(mexp_as_x2) mexp = m_zero; else mexp = m_one; mmul = m_zero; if(mstruct == x_var) { mmul = m_one; return true; } else if(mexp_as_x2 && mstruct.isPower()) { if(mstruct[1].isNumber() && mstruct[1].number().isTwo() && mstruct[0] == x_var) { mexp = m_one; return true; } } else if(!mexp_as_x2 && mstruct.isPower() && mstruct[1].isInteger() && mstruct[0] == x_var) { if(mstruct[0] == x_var) { mexp = mstruct[1]; mmul = m_one; return true; } } else if(mstruct.isMultiplication() && mstruct.size() >= 2) { bool b_x = false; bool b2 = false; size_t i_x = 0; for(size_t i = 0; i < mstruct.size(); i++) { if(!b_x && mstruct[i] == x_var) { b_x = true; i_x = i; } else if(!b_x && mexp_as_x2 && mstruct[i].isPower() && mstruct[i][1].isNumber() && mstruct[i][1].number().isTwo() && mstruct[i][0] == x_var) { b_x = true; b2 = true; i_x = i; } else if(!b_x && !mexp_as_x2 && mstruct[i].isPower() && mstruct[i][1].isInteger() && mstruct[i][0] == x_var) { b_x = true; i_x = i; mexp = mstruct[i][1]; } else if(mstruct[i].containsRepresentativeOf(x_var, true, true) != 0) { return false; } } if(!b_x) return false; if(mstruct.size() == 1) { if(b2) mexp = m_one; else mmul = m_one; } else if(mstruct.size() == 2) { if(b2) { if(i_x == 1) mexp = mstruct[0]; else mexp = mstruct[1]; } else { if(i_x == 1) mmul = mstruct[0]; else mmul = mstruct[1]; } } else { if(b2) { mexp = mstruct; mexp.delChild(i_x + 1, true); } else { mmul = mstruct; mmul.delChild(i_x + 1, true); } } return true; } else if(mstruct.isAddition()) { mmul.setType(STRUCT_ADDITION); if(mexp_as_x2) mexp.setType(STRUCT_ADDITION); madd.setType(STRUCT_ADDITION); for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i] == x_var) { if(mexp_as_x2 || mexp.isOne()) mmul.addChild(m_one); else return false; } else if(mexp_as_x2 && mstruct[i].isPower() && mstruct[i][1].isNumber() && mstruct[i][1].number().isTwo() && mstruct[i][0] == x_var) { mexp.addChild(m_one); } else if(!mexp_as_x2 && mstruct[i].isPower() && mstruct[i][1].isInteger() && mstruct[i][0] == x_var) { if(mmul.size() == 0) { mexp = mstruct[i][1]; } else if(mexp != mstruct[i][1]) { return false; } mmul.addChild(m_one); } else if(mstruct[i].isMultiplication()) { bool b_x = false; bool b2 = false; size_t i_x = 0; for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(!b_x && mstruct[i][i2] == x_var) { if(!mexp_as_x2 && !mexp.isOne()) return false; i_x = i2; b_x = true; } else if(!b_x && mexp_as_x2 && mstruct[i][i2].isPower() && mstruct[i][i2][1].isNumber() && mstruct[i][i2][1].number().isTwo() && mstruct[i][i2][0] == x_var) { b2 = true; i_x = i2; b_x = true; } else if(!b_x && !mexp_as_x2 && mstruct[i][i2].isPower() && mstruct[i][i2][1].isInteger() && mstruct[i][i2][0] == x_var) { if(mmul.size() == 0) { mexp = mstruct[i][i2][1]; } else if(mexp != mstruct[i][i2][1]) { return false; } i_x = i2; b_x = true; } else if(mstruct[i][i2].containsRepresentativeOf(x_var, true, true) != 0) { return false; } } if(b_x) { if(mstruct[i].size() == 1) { if(b2) mexp.addChild(m_one); else mmul.addChild(m_one); } else { if(b2) { mexp.addChild(mstruct[i]); mexp[mexp.size() - 1].delChild(i_x + 1, true); mexp.childUpdated(mexp.size()); } else { mmul.addChild(mstruct[i]); mmul[mmul.size() - 1].delChild(i_x + 1, true); mmul.childUpdated(mmul.size()); } } } else { madd.addChild(mstruct[i]); } } else if(mstruct[i].containsRepresentativeOf(x_var, true, true) != 0) { return false; } else { madd.addChild(mstruct[i]); } } if(mmul.size() == 0 && (!mexp_as_x2 || mexp.size() == 0)) { mmul.clear(); if(mexp_as_x2) mexp.clear(); return false; } if(mmul.size() == 0) mmul.clear(); else if(mmul.size() == 1) mmul.setToChild(1); if(mexp_as_x2) { if(mexp.size() == 0) mexp.clear(); else if(mexp.size() == 1) mexp.setToChild(1); } if(madd.size() == 0) madd.clear(); else if(madd.size() == 1) madd.setToChild(1); return true; } return false; } bool MathStructure::factorize(const EvaluationOptions &eo_pre, bool unfactorize, int term_combination_levels, int max_msecs, bool only_integers, int recursive, struct timeval *endtime_p, const MathStructure &force_factorization, bool complete_square, bool only_sqrfree, int max_factor_degree) { if(CALCULATOR->aborted()) return false; struct timeval endtime; if(max_msecs > 0 && !endtime_p) { #ifndef CLOCK_MONOTONIC gettimeofday(&endtime, NULL); #else struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); endtime.tv_sec = ts.tv_sec; endtime.tv_usec = ts.tv_nsec / 1000; #endif endtime.tv_sec += max_msecs / 1000; long int usecs = endtime.tv_usec + (long int) (max_msecs % 1000) * 1000; if(usecs >= 1000000) { usecs -= 1000000; endtime.tv_sec++; } endtime.tv_usec = usecs; max_msecs = 0; endtime_p = &endtime; } EvaluationOptions eo = eo_pre; eo.sync_units = false; eo.structuring = STRUCTURING_NONE; if(unfactorize) { unformat(); EvaluationOptions eo2 = eo; eo2.expand = true; eo2.combine_divisions = false; eo2.sync_units = false; calculatesub(eo2, eo2); do_simplification(*this, eo, true, false, true); } MathStructure mden, mnum; evalSort(true); if(term_combination_levels >= -1 && isAddition() && isRationalPolynomial()) { MathStructure msqrfree(*this); eo.protected_function = CALCULATOR->f_signum; if(sqrfree(msqrfree, eo)) { if((!only_sqrfree || msqrfree.isPower()) && !equals(msqrfree) && (!msqrfree.isMultiplication() || msqrfree.size() != 2 || (!(msqrfree[0].isNumber() && msqrfree[1].isAddition()) && !(msqrfree[1].isNumber() && msqrfree[0].isAddition())))) { MathStructure mcopy(msqrfree); EvaluationOptions eo2 = eo; eo2.expand = true; eo2.calculate_functions = false; CALCULATOR->beginTemporaryStopMessages(); mcopy.calculatesub(eo2, eo2); CALCULATOR->endTemporaryStopMessages(); if(!equals(mcopy)) { eo.protected_function = eo_pre.protected_function; if(CALCULATOR->aborted()) return false; CALCULATOR->error(true, "factorized result is wrong: %s. %s", format_and_print(msqrfree).c_str(), _("This is a bug. Please report it."), NULL); } else { eo.protected_function = eo_pre.protected_function; set(msqrfree); if(!isAddition()) { if(isMultiplication()) flattenMultiplication(*this); if(isMultiplication() && SIZE >= 2 && CHILD(0).isNumber()) { for(size_t i = 1; i < SIZE; i++) { if(CHILD(i).isNumber()) { CHILD(i).number() *= CHILD(0).number(); CHILD(0).set(CHILD(i)); delChild(i); } else if(CHILD(i).isPower() && CHILD(i)[0].isMultiplication() && CHILD(i)[0].size() >= 2 && CHILD(i)[0][0].isNumber() && CHILD(i)[0][0].number().isRational() && !CHILD(i)[0][0].number().isInteger() && CHILD(i)[1].isInteger()) { CHILD(i)[0][0].number().raise(CHILD(i)[1].number()); CHILD(0).number().multiply(CHILD(i)[0][0].number()); CHILD(i)[0].delChild(1); if(CHILD(i)[0].size() == 1) CHILD(i)[0].setToChild(1, true); } } if(SIZE > 1 && CHILD(0).isOne()) { ERASE(0); } if(SIZE == 1) SET_CHILD_MAP(0); } if(isMultiplication() && SIZE >= 2 && CHILD(0).isNumber() && CHILD(0).number().isRational() && !CHILD(0).number().isInteger()) { Number den = CHILD(0).number().denominator(); for(size_t i = 1; i < SIZE; i++) { if(CHILD(i).isAddition()) { bool b = true; for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { if(CHILD(i)[i2].isNumber()) { if(!CHILD(i)[i2].number().isIntegerDivisible(den)) {b = false; break;} } else if(CHILD(i)[i2].isMultiplication() && CHILD(i)[i2][0].isNumber()) { if(!CHILD(i)[i2][0].number().isIntegerDivisible(den)) {b = false; break;} } else { b = false; break; } } if(b) { for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { if(CHILD(i)[i2].isNumber()) { CHILD(i)[i2].number().divide(den); } else if(CHILD(i)[i2].isMultiplication()) { CHILD(i)[i2][0].number().divide(den); if(CHILD(i)[i2][0].isOne() && CHILD(i)[i2].size() > 1) { CHILD(i)[i2].delChild(1); if(CHILD(i)[i2].size() == 1) { CHILD(i)[i2].setToChild(1, true); } } } } CHILD(0).set(CHILD(0).number().numerator(), true); if(SIZE > 1 && CHILD(0).isOne()) { ERASE(0); } if(SIZE == 1) SET_CHILD_MAP(0); break; } } } } if(isMultiplication()) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isPower() && CHILD(i)[1].isInteger()) { if(CHILD(i)[0].isAddition()) { bool b = true; for(size_t i2 = 0; i2 < CHILD(i)[0].size(); i2++) { if((!CHILD(i)[0][i2].isNumber() || !CHILD(i)[0][i2].number().isNegative()) && (!CHILD(i)[0][i2].isMultiplication() || CHILD(i)[0][i2].size() < 2 || !CHILD(i)[0][i2][0].isNumber() || !CHILD(i)[0][i2][0].number().isNegative())) { b = false; break; } } if(b) { for(size_t i2 = 0; i2 < CHILD(i)[0].size(); i2++) { if(CHILD(i)[0][i2].isNumber()) { CHILD(i)[0][i2].number().negate(); } else { CHILD(i)[0][i2][0].number().negate(); if(CHILD(i)[0][i2][0].isOne() && CHILD(i)[0][i2].size() > 1) { CHILD(i)[0][i2].delChild(1); if(CHILD(i)[0][i2].size() == 1) { CHILD(i)[0][i2].setToChild(1, true); } } } } if(CHILD(i)[1].number().isOdd()) { if(CHILD(0).isNumber()) CHILD(0).number().negate(); else { PREPEND(MathStructure(-1, 1, 0)); i++; } } } } else if(CHILD(i)[0].isMultiplication() && CHILD(i)[0].size() >= 2 && CHILD(i)[0][0].isNumber() && CHILD(i)[0][0].number().isNegative()) { CHILD(i)[0][0].number().negate(); if(CHILD(i)[0][0].isOne() && CHILD(i)[0].size() > 1) { CHILD(i)[0].delChild(1); if(CHILD(i)[0].size() == 1) { CHILD(i)[0].setToChild(1, true); } } if(CHILD(i)[1].number().isOdd()) { if(CHILD(0).isNumber()) CHILD(0).number().negate(); else { PREPEND(MathStructure(-1, 1, 0)); i++; } } } } else if(CHILD(i).isAddition()) { bool b = true; for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { if((!CHILD(i)[i2].isNumber() || !CHILD(i)[i2].number().isNegative()) && (!CHILD(i)[i2].isMultiplication() || CHILD(i)[i2].size() < 2 || !CHILD(i)[i2][0].isNumber() || !CHILD(i)[i2][0].number().isNegative())) { b = false; break; } } if(b) { for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { if(CHILD(i)[i2].isNumber()) { CHILD(i)[i2].number().negate(); } else { CHILD(i)[i2][0].number().negate(); if(CHILD(i)[i2][0].isOne() && CHILD(i)[i2].size() > 1) { CHILD(i)[i2].delChild(1); if(CHILD(i)[i2].size() == 1) { CHILD(i)[i2].setToChild(1, true); } } } } if(CHILD(0).isNumber()) CHILD(0).number().negate(); else { PREPEND(MathStructure(-1, 1, 0)); i++; } } } } if(SIZE > 1 && CHILD(0).isOne()) { ERASE(0); } if(SIZE == 1) SET_CHILD_MAP(0); } if(isPower() && CHILD(1).isInteger()) { if(CHILD(0).isAddition()) { bool b = true; for(size_t i2 = 0; i2 < CHILD(0).size(); i2++) { if((!CHILD(0)[i2].isNumber() || !CHILD(0)[i2].number().isNegative()) && (!CHILD(0)[i2].isMultiplication() || CHILD(0)[i2].size() < 2 || !CHILD(0)[i2][0].isNumber() || !CHILD(0)[i2][0].number().isNegative())) { b = false; break; } } if(b) { for(size_t i2 = 0; i2 < CHILD(0).size(); i2++) { if(CHILD(0)[i2].isNumber()) { CHILD(0)[i2].number().negate(); } else { CHILD(0)[i2][0].number().negate(); if(CHILD(0)[i2][0].isOne() && CHILD(0)[i2].size() > 1) { CHILD(0)[i2].delChild(1); if(CHILD(0)[i2].size() == 1) { CHILD(0)[i2].setToChild(1, true); } } } } if(CHILD(1).number().isOdd()) { multiply(MathStructure(-1, 1, 0)); CHILD_TO_FRONT(1) } } } else if(CHILD(0).isMultiplication() && CHILD(0).size() >= 2 && CHILD(0)[0].isNumber() && CHILD(0)[0].number().isNegative()) { CHILD(0)[0].number().negate(); if(CHILD(0)[0].isOne() && CHILD(0).size() > 1) { CHILD(0).delChild(1); if(CHILD(0).size() == 1) { CHILD(0).setToChild(1, true); } } if(CHILD(1).number().isOdd()) { multiply(MathStructure(-1, 1, 0)); CHILD_TO_FRONT(1) } } } } evalSort(true); factorize(eo, false, 0, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); return true; } } } eo.protected_function = eo_pre.protected_function; } switch(type()) { case STRUCT_ADDITION: { if(CALCULATOR->aborted()) return false; if(term_combination_levels >= -1 && !only_sqrfree && max_factor_degree != 0) { if(SIZE <= 3 && SIZE > 1) { MathStructure *xvar = NULL; Number nr2(1, 1); if(CHILD(0).isPower() && CHILD(0)[0].size() == 0 && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isTwo()) { xvar = &CHILD(0)[0]; } else if(CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0].isNumber()) { if(CHILD(0)[1].isPower()) { if(CHILD(0)[1][0].size() == 0 && CHILD(0)[1][1].isNumber() && CHILD(0)[1][1].number().isTwo()) { xvar = &CHILD(0)[1][0]; nr2.set(CHILD(0)[0].number()); } } } if(xvar) { bool factorable = false; Number nr1, nr0; if(SIZE == 2 && CHILD(1).isNumber()) { factorable = true; nr0 = CHILD(1).number(); } else if(SIZE == 3 && CHILD(2).isNumber()) { nr0 = CHILD(2).number(); if(CHILD(1).isMultiplication()) { if(CHILD(1).size() == 2 && CHILD(1)[0].isNumber() && xvar->equals(CHILD(1)[1])) { nr1 = CHILD(1)[0].number(); factorable = true; } } else if(xvar->equals(CHILD(1))) { nr1.set(1, 1, 0); factorable = true; } } if(factorable) { Number nr4ac(4, 1, 0); nr4ac *= nr2; nr4ac *= nr0; Number nr2a(2, 1, 0); nr2a *= nr2; Number sqrtb24ac(nr1); sqrtb24ac.raise(nr_two); sqrtb24ac -= nr4ac; if(sqrtb24ac.isNegative()) factorable = false; MathStructure mstructb24(sqrtb24ac); if(factorable) { if(!only_integers) { if(eo.approximation == APPROXIMATION_EXACT && !sqrtb24ac.isApproximate()) { sqrtb24ac.raise(nr_half); if(sqrtb24ac.isApproximate()) { mstructb24.raise(nr_half); } else { mstructb24.set(sqrtb24ac); } } else { mstructb24.number().raise(nr_half); } } else { mstructb24.number().raise(nr_half); if((!sqrtb24ac.isApproximate() && mstructb24.number().isApproximate()) || (sqrtb24ac.isInteger() && !mstructb24.number().isInteger())) { factorable = false; } } } if(factorable) { MathStructure m1(nr1), m2(nr1); Number mul1(1, 1), mul2(1, 1); if(mstructb24.isNumber()) { m1.number() += mstructb24.number(); m1.number() /= nr2a; if(m1.number().isRational() && !m1.number().isInteger()) { mul1 = m1.number().denominator(); m1.number() *= mul1; } m2.number() -= mstructb24.number(); m2.number() /= nr2a; if(m2.number().isRational() && !m2.number().isInteger()) { mul2 = m2.number().denominator(); m2.number() *= mul2; } } else { m1.calculateAdd(mstructb24, eo); m1.calculateDivide(nr2a, eo); if(m1.isNumber()) { if(m1.number().isRational() && !m1.number().isInteger()) { mul1 = m1.number().denominator(); m1.number() *= mul1; } } else { bool bint = false, bfrac = false; idm1(m1, bfrac, bint); if(bfrac) { idm2(m1, bfrac, bint, mul1); idm3(m1, mul1, true); } } m2.calculateSubtract(mstructb24, eo); m2.calculateDivide(nr2a, eo); if(m2.isNumber()) { if(m2.number().isRational() && !m2.number().isInteger()) { mul2 = m2.number().denominator(); m2.number() *= mul2; } } else { bool bint = false, bfrac = false; idm1(m2, bfrac, bint); if(bfrac) { idm2(m2, bfrac, bint, mul2); idm3(m2, mul2, true); } } } nr2 /= mul1; nr2 /= mul2; if(m1 == m2 && mul1 == mul2) { MathStructure xvar2(*xvar); if(!mul1.isOne()) xvar2 *= mul1; set(m1); add(xvar2, true); raise(MathStructure(2, 1, 0)); if(!nr2.isOne()) { multiply(nr2); } } else { m1.add(*xvar, true); if(!mul1.isOne()) m1[m1.size() - 1] *= mul1; m2.add(*xvar, true); if(!mul2.isOne()) m2[m2.size() - 1] *= mul2; clear(true); m_type = STRUCT_MULTIPLICATION; if(!nr2.isOne()) { APPEND_NEW(nr2); } APPEND(m1); APPEND(m2); } EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); evalSort(true); return true; } } } } MathStructure *factor_mstruct = new MathStructure(1, 1, 0); MathStructure mnew; if(factorize_find_multiplier(*this, mnew, *factor_mstruct)) { mnew.factorize(eo, false, term_combination_levels, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); factor_mstruct->factorize(eo, false, 0, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); clear(true); m_type = STRUCT_MULTIPLICATION; APPEND_REF(factor_mstruct); APPEND(mnew); EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); factor_mstruct->unref(); evalSort(true); return true; } factor_mstruct->unref(); if(SIZE > 1 && CHILD(SIZE - 1).isNumber() && CHILD(SIZE - 1).number().isInteger() && max_factor_degree != 0) { MathStructure *xvar = NULL; Number qnr(1, 1); int degree = 1; bool overflow = false; int qcof = 1; if(CHILD(0).isPower() && CHILD(0)[0].size() == 0 && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isInteger() && CHILD(0)[1].number().isPositive()) { xvar = &CHILD(0)[0]; degree = CHILD(0)[1].number().intValue(&overflow); } else if(CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0].isNumber() && CHILD(0)[0].number().isInteger()) { if(CHILD(0)[1].isPower()) { if(CHILD(0)[1][0].size() == 0 && CHILD(0)[1][1].isNumber() && CHILD(0)[1][1].number().isInteger() && CHILD(0)[1][1].number().isPositive()) { xvar = &CHILD(0)[1][0]; qcof = CHILD(0)[0].number().intValue(&overflow); if(!overflow) { if(qcof < 0) qcof = -qcof; degree = CHILD(0)[1][1].number().intValue(&overflow); } } } } int pcof = 1; if(!overflow) { pcof = CHILD(SIZE - 1).number().intValue(&overflow); if(pcof < 0) pcof = -pcof; } if(xvar && !overflow && degree <= 1000 && degree > 2 && qcof != 0 && pcof != 0) { bool b = true, b2 = true; for(size_t i = 1; b && i < SIZE - 1; i++) { switch(CHILD(i).type()) { case STRUCT_NUMBER: { b = false; break; } case STRUCT_POWER: { if(!CHILD(i)[1].isNumber() || !xvar->equals(CHILD(i)[0]) || !CHILD(i)[1].number().isInteger() || !CHILD(i)[1].number().isPositive()) { b = false; } break; } case STRUCT_MULTIPLICATION: { if(!(CHILD(i).size() == 2) || !CHILD(i)[0].isNumber()) { b = false; } else if(CHILD(i)[1].isPower()) { if(!CHILD(i)[1][1].isNumber() || !xvar->equals(CHILD(i)[1][0]) || !CHILD(i)[1][1].number().isInteger() || !CHILD(i)[1][1].number().isPositive()) { b = false; } } else if(!xvar->equals(CHILD(i)[1])) { b = false; } if(b && b2 && !CHILD(i)[0].isInteger()) b2 = false; break; } default: { if(!xvar->equals(CHILD(i))) { b = false; } } } } if(b) { vector factors; factors.resize(degree + 1, Number()); factors[0] = CHILD(SIZE - 1).number(); vector ps; vector qs; vector zeroes; int curdeg = 1, prevdeg = 0; for(size_t i = 0; b && i < SIZE - 1; i++) { switch(CHILD(i).type()) { case STRUCT_POWER: { curdeg = CHILD(i)[1].number().intValue(&overflow); if(curdeg == prevdeg || curdeg > degree || (prevdeg > 0 && curdeg > prevdeg) || overflow) { b = false; } else { factors[curdeg].set(1, 1, 0); } break; } case STRUCT_MULTIPLICATION: { if(CHILD(i)[1].isPower()) { curdeg = CHILD(i)[1][1].number().intValue(&overflow); } else { curdeg = 1; } if(curdeg == prevdeg || curdeg > degree || (prevdeg > 0 && curdeg > prevdeg) || overflow) { b = false; } else { factors[curdeg] = CHILD(i)[0].number(); } break; } default: { curdeg = 1; factors[curdeg].set(1, 1, 0); } } prevdeg = curdeg; } while(b && degree > 2) { for(int i = 1; i <= 1000; i++) { if(i > pcof) break; if(pcof % i == 0) ps.push_back(i); } for(int i = 1; i <= 1000; i++) { if(i > qcof) break; if(qcof % i == 0) qs.push_back(i); } Number itest; int i2; size_t pi = 0, qi = 0; Number nrtest(ps[0], qs[0], 0); while(true) { itest.clear(); i2 = degree; while(true) { itest += factors[i2]; if(i2 == 0) break; itest *= nrtest; i2--; } if(itest.isZero()) { break; } if(nrtest.isPositive()) { nrtest.negate(); } else { qi++; if(qi == qs.size()) { qi = 0; pi++; if(pi == ps.size()) { break; } } nrtest.set(ps[pi], qs[qi], 0); } } if(itest.isZero()) { itest.clear(); i2 = degree; Number ntmp(factors[i2]); for(; i2 > 0; i2--) { itest += ntmp; ntmp = factors[i2 - 1]; factors[i2 - 1] = itest; itest *= nrtest; } degree--; nrtest.negate(); zeroes.push_back(nrtest); if(degree == 2) { break; } qcof = factors[degree].intValue(&overflow); if(!overflow) { if(qcof < 0) qcof = -qcof; pcof = factors[0].intValue(&overflow); if(!overflow) { if(pcof < 0) pcof = -pcof; } } if(overflow || qcof == 0 || pcof == 0) { break; } } else { break; } ps.clear(); qs.clear(); } if(zeroes.size() > 0) { MathStructure mleft; MathStructure mtmp; MathStructure *mcur; for(int i = degree; i >= 0; i--) { if(!factors[i].isZero()) { if(mleft.isZero()) { mcur = &mleft; } else { mleft.add(m_zero, true); mcur = &mleft[mleft.size() - 1]; } if(i > 1) { if(!factors[i].isOne()) { mcur->multiply(*xvar); (*mcur)[0].set(factors[i]); mcur = &(*mcur)[1]; } else { mcur->set(*xvar); } mtmp.set(i, 1, 0); mcur->raise(mtmp); } else if(i == 1) { if(!factors[i].isOne()) { mcur->multiply(*xvar); (*mcur)[0].set(factors[i]); } else { mcur->set(*xvar); } } else { mcur->set(factors[i]); } } } mleft.factorize(eo, false, 0, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); vector powers; vector powers_i; int dupsfound = 0; for(size_t i = 0; i < zeroes.size() - 1; i++) { while(i + 1 < zeroes.size() && zeroes[i] == zeroes[i + 1]) { dupsfound++; zeroes.erase(zeroes.begin() + (i + 1)); } if(dupsfound > 0) { powers_i.push_back(i); powers.push_back(dupsfound + 1); dupsfound = 0; } } MathStructure xvar2(*xvar); Number *nrmul; if(mleft.isMultiplication()) { set(mleft); evalSort(); if(CHILD(0).isNumber()) { nrmul = &CHILD(0).number(); } else if(CHILD(0).isMultiplication() && CHILD(0).size() > 0 && CHILD(0)[0].isNumber()) { nrmul = &CHILD(0)[0].number(); } else { PREPEND(m_one); nrmul = &CHILD(0).number(); } } else { clear(true); m_type = STRUCT_MULTIPLICATION; APPEND(m_one); APPEND(mleft); nrmul = &CHILD(0).number(); } size_t pi = 0; for(size_t i = 0; i < zeroes.size(); i++) { if(zeroes[i].isInteger()) { APPEND(xvar2); } else { APPEND(m_zero); } mcur = &CHILD(SIZE - 1); if(pi < powers_i.size() && powers_i[pi] == i) { mcur->raise(MathStructure(powers[pi], 1L, 0L)); mcur = &(*mcur)[0]; if(zeroes[i].isInteger()) { mcur->add(zeroes[i]); } else { Number nr(zeroes[i].denominator()); mcur->add(zeroes[i].numerator()); (*mcur)[0] *= xvar2; (*mcur)[0][0].number() = nr; nr.raise(powers[pi]); nrmul->divide(nr); } pi++; } else { if(zeroes[i].isInteger()) { mcur->add(zeroes[i]); } else { nrmul->divide(zeroes[i].denominator()); mcur->add(zeroes[i].numerator()); (*mcur)[0] *= xvar2; (*mcur)[0][0].number() = zeroes[i].denominator(); } } } if(CHILD(0).isNumber() && CHILD(0).number().isOne()) { ERASE(0); } else if(CHILD(0).isMultiplication() && CHILD(0).size() > 0 && CHILD(0)[0].isNumber() && CHILD(0)[0].number().isOne()) { if(CHILD(0).size() == 1) { ERASE(0); } else if(CHILD(0).size() == 2) { CHILD(0).setToChild(2, true); } else { CHILD(0).delChild(1); } } evalSort(true); Number dupspow; for(size_t i = 0; i < SIZE - 1; i++) { mcur = NULL; if(CHILD(i).isPower()) { if(CHILD(i)[0].isAddition() && CHILD(i)[1].isNumber()) { mcur = &CHILD(i)[0]; } } else if(CHILD(i).isAddition()) { mcur = &CHILD(i); } while(mcur && i + 1 < SIZE) { if(CHILD(i + 1).isPower()) { if(CHILD(i + 1)[0].isAddition() && CHILD(i + 1)[1].isNumber() && mcur->equals(CHILD(i + 1)[0])) { dupspow += CHILD(i + 1)[1].number(); } else { mcur = NULL; } } else if(CHILD(i + 1).isAddition() && mcur->equals(CHILD(i + 1))) { dupspow++; } else { mcur = NULL; } if(mcur) { ERASE(i + 1); } } if(!dupspow.isZero()) { if(CHILD(i).isPower()) { CHILD(i)[1].number() += dupspow; } else { dupspow++; CHILD(i) ^= dupspow; } dupspow.clear(); } } if(SIZE == 1) { setToChild(1, true); } else { EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); } evalSort(true); return true; } } if(b && b2 && (max_factor_degree < 0 || max_factor_degree >= 2) && degree > 3 && degree < 50) { // Kronecker method vector vnum; vnum.resize(degree + 1, nr_zero); bool overflow = false; for(size_t i = 0; b && i < SIZE; i++) { switch(CHILD(i).type()) { case STRUCT_POWER: { if(CHILD(i)[0] == *xvar && CHILD(i)[1].isInteger()) { int curdeg = CHILD(i)[1].number().intValue(&overflow); if(curdeg < 0 || overflow || curdeg > degree) b = false; else vnum[curdeg] += 1; } else { b = false; } break; } case STRUCT_MULTIPLICATION: { if(CHILD(i).size() == 2 && CHILD(i)[0].isInteger()) { long int icoeff = CHILD(i)[0].number().intValue(&overflow); if(!overflow && CHILD(i)[1].isPower() && CHILD(i)[1][0] == *xvar && CHILD(i)[1][1].isInteger()) { int curdeg = CHILD(i)[1][1].number().intValue(&overflow); if(curdeg < 0 || overflow || curdeg > degree) b = false; else vnum[curdeg] += icoeff; } else if(!overflow && CHILD(i)[1] == *xvar) { vnum[1] += icoeff; } else { b = false; } } else { b = false; } break; } default: { if(CHILD(i).isInteger()) { long int icoeff = CHILD(i).number().intValue(&overflow); if(overflow) b = false; else vnum[0] += icoeff; } else if(CHILD(i) == *xvar) { vnum[1] += 1; } else { b = false; } break; } } } long int lcoeff = vnum[degree].lintValue(); vector vs; if(b && lcoeff != 0) { degree /= 2; if(max_factor_degree > 0 && degree > max_factor_degree) degree = max_factor_degree; for(int i = 0; i <= degree; i++) { if(CALCULATOR->aborted()) return false; MathStructure mcalc(*this); mcalc.calculateReplace(*xvar, Number((i / 2 + i % 2) * (i % 2 == 0 ? -1 : 1), 1), eo); mcalc.calculatesub(eo, eo, false); if(!mcalc.isInteger()) break; bool overflow = false; int v = ::abs(mcalc.number().intValue(&overflow)); if(overflow) { if(i > 2) degree = i; else b = false; break; } vs.push_back(v); } } if(b) { vector factors0, factorsl; factors0.push_back(1); for(int i = 2; i < vs[0] / 3 && i < 1000; i++) { if(vs[0] % i == 0) factors0.push_back(i); } if(vs[0] % 3 == 0) factors0.push_back(vs[0] / 3); if(vs[0] % 2 == 0) factors0.push_back(vs[0] / 2); factors0.push_back(vs[0]); for(int i = 2; i < lcoeff / 3 && i < 1000; i++) { if(lcoeff % i == 0) factorsl.push_back(i); } factorsl.push_back(1); if(lcoeff % 3 == 0) factorsl.push_back(lcoeff / 3); if(lcoeff % 2 == 0) factorsl.push_back(lcoeff / 2); factorsl.push_back(lcoeff); long long int cmax = 500000LL / (factors0.size() * factorsl.size()); if(term_combination_levels != 0) cmax *= 10; if(degree >= 2 && cmax > 10) { vector vden; vector vquo; vden.resize(3, nr_zero); long int c0; for(size_t i = 0; i < factors0.size() * 2; i++) { c0 = factors0[i / 2]; if(i % 2 == 1) c0 = -c0; long int c2; for(size_t i2 = 0; i2 < factorsl.size(); i2++) { c2 = factorsl[i2]; long int c1max = vs[1] - c0 - c2, c1min; if(c1max < 0) {c1min = c1max; c1max = -vs[1] - c0 - c2;} else {c1min = -vs[1] - c0 - c2;} if(-(vs[2] - c0 - c2) < -(-vs[2] - c0 - c2)) { if(c1max > -(-vs[2] - c0 - c2)) c1max = -(-vs[2] - c0 - c2); if(c1min < -(vs[2] - c0 - c2)) c1min = -(vs[2] - c0 - c2); } else { if(c1max > -(vs[2] - c0 - c2)) c1max = -(vs[2] - c0 - c2); if(c1min < -(-vs[2] - c0 - c2)) c1min = -(-vs[2] - c0 - c2); } if(c1min < -cmax / 2) c1min = -cmax / 2; for(long int c1 = c1min; c1 <= c1max && c1 <= cmax / 2; c1++) { long int v1 = ::labs(c2 + c1 + c0); long int v2 = ::labs(c2 - c1 + c0); if(v1 != 0 && v2 != 0 && v1 <= vs[1] && v2 <= vs[2] && (c1 != 0 || c2 != 0) && vs[1] % v1 == 0 && vs[2] % v2 == 0) { vden[0] = c0; vden[1] = c1; vden[2] = c2; if(CALCULATOR->aborted()) return false; if(polynomial_divide_integers(vnum, vden, vquo)) { MathStructure mtest; mtest.setType(STRUCT_ADDITION); if(c2 != 0) { MathStructure *mpow = new MathStructure(); mpow->setType(STRUCT_POWER); mpow->addChild(*xvar); mpow->addChild_nocopy(new MathStructure(2, 1, 0)); if(c2 == 1) { mtest.addChild_nocopy(mpow); } else { MathStructure *mterm = new MathStructure(); mterm->setType(STRUCT_MULTIPLICATION); mterm->addChild_nocopy(new MathStructure(c2, 1L, 0L)); mterm->addChild_nocopy(mpow); mtest.addChild_nocopy(mterm); } } if(c1 == 1) { mtest.addChild(*xvar); } else if(c1 != 0) { MathStructure *mterm = new MathStructure(); mterm->setType(STRUCT_MULTIPLICATION); mterm->addChild_nocopy(new MathStructure(c1, 1L, 0L)); mterm->addChild(*xvar); mtest.addChild_nocopy(mterm); } mtest.addChild_nocopy(new MathStructure(c0, 1L, 0L)); MathStructure mthis(*this); MathStructure mquo; if(mtest.size() > 1 && polynomialDivide(mthis, mtest, mquo, eo, false)) { mquo.factorize(eo, false, 0, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); set(mquo, true); multiply(mtest, true); return true; } } } } } } } for(int i_d = 3; i_d <= degree; i_d++) { if(CALCULATOR->aborted()) return false; long int t1max = ::pow(cmax / (i_d - 1), 1.0 / (i_d - 1)); if(t1max < 1) break; if(t1max > 1000) t1max = 1000; long int c2totalmax = t1max; long int c2cur; for(int i = 0; i < i_d - 3; i++) { c2totalmax *= t1max; } vector vden; vector vquo; long int *vc = (long int*) malloc(sizeof(long int) * (i_d + 1)); vden.resize(i_d + 1, nr_zero); int in = 0; for(size_t i = 0; i < factors0.size() * 2; i++) { vc[0] = factors0[i / 2] * (i % 2 == 1 ? -1 : 1); for(size_t i2 = 0; i2 < factorsl.size(); i2++) { vc[i_d] = factorsl[i2]; for(long int c2p = 0; c2p <= c2totalmax; c2p++) { c2cur = c2p; for(int i = 2; i < i_d; i++) { vc[i] = c2cur % t1max; if(vc[i] % 2 == 1) vc[i] = -vc[i]; vc[i] = vc[i] / 2 + vc[i] % 2; c2cur /= t1max; } long int c1max = t1max / 2 + t1max % 2, c1min = -t1max / 2 - t1max % 2; for(size_t i = 1; i < vs.size(); i++) { long int vsmax = vs[i] - vc[0]; long int vsmin = -vs[i] - vc[0]; int ix = (i / 2 + i % 2) * (i % 2 == 0 ? -1 : 1); int ixi = ix; for(int i2 = 2; i2 <= i_d; i2++) { ixi *= ix; vsmax -= vc[i2] * ixi; } vsmax /= ix; vsmin /= ix; if(vsmax < vsmin) { if(c1max > vsmin) c1max = vsmin; if(c1min < vsmax) c1min = vsmax; } else { if(c1max > vsmax) c1max = vsmax; if(c1min < vsmin) c1min = vsmin; } } for(long int c1 = c1min; c1 <= c1max; c1++) { vc[1] = c1; bool b = true; for(size_t i = 1; i < vs.size(); i++) { long int v = vc[0]; int ix = (i / 2 + i % 2) * (i % 2 == 0 ? -1 : 1); int ixi = 1; for(int i2 = 1; i2 <= i_d; i2++) { ixi *= ix; v += vc[i2] * ixi; } if(v < 0) v = -v; if(v == 0 || v > vs[i] || vs[i] % v != 0) { b = false; break; } } in++; if(b) { if(CALCULATOR->aborted()) return false; for(size_t iden = 0; iden < vden.size(); iden++) { vden[iden] = vc[iden]; } if(polynomial_divide_integers(vnum, vden, vquo)) { MathStructure mtest; mtest.setType(STRUCT_ADDITION); for(int i2 = i_d; i2 >= 2; i2--) { if(vc[i2] != 0) { MathStructure *mpow = new MathStructure(); mpow->setType(STRUCT_POWER); mpow->addChild(*xvar); mpow->addChild_nocopy(new MathStructure(i2, 1, 0)); if(vc[i2] == 1) { mtest.addChild_nocopy(mpow); } else { MathStructure *mterm = new MathStructure(); mterm->setType(STRUCT_MULTIPLICATION); mterm->addChild_nocopy(new MathStructure(vc[i2], 1L, 0L)); mterm->addChild_nocopy(mpow); mtest.addChild_nocopy(mterm); } } } if(vc[1] == 1) { mtest.addChild(*xvar); } else if(vc[1] != 0) { MathStructure *mterm = new MathStructure(); mterm->setType(STRUCT_MULTIPLICATION); mterm->addChild_nocopy(new MathStructure(vc[1], 1L, 0L)); mterm->addChild(*xvar); mtest.addChild_nocopy(mterm); } mtest.addChild_nocopy(new MathStructure(vc[0], 1L, 0L)); MathStructure mthis(*this); MathStructure mquo; if(mtest.size() > 1 && polynomialDivide(mthis, mtest, mquo, eo, false)) { mquo.factorize(eo, false, 0, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); free(vc); set(mquo, true); multiply(mtest, true); return true; } } } } } } } free(vc); } } } } } if(SIZE == 2 && max_factor_degree != 0) { Number nr1(1, 1, 0), nr2(1, 1, 0); bool b = true; bool b1_neg = false, b2_neg = false; for(size_t i = 0; i < SIZE && b; i++) { b = false; if(CHILD(i).isInteger()) { b = true; if(i == 0) nr1 = CHILD(i).number(); else nr2 = CHILD(i).number(); } else if(CHILD(i).isMultiplication() && CHILD(i).size() > 1) { b = true; size_t i2 = 0; if(CHILD(i)[0].isInteger()) { if(i == 0) nr1 = CHILD(i)[0].number(); else nr2 = CHILD(i)[0].number(); i2++; } for(; i2 < CHILD(i).size(); i2++) { if(!CHILD(i)[i2].isPower() || !CHILD(i)[i2][1].isInteger() || !CHILD(i)[i2][1].number().isPositive() || !CHILD(i)[i2][1].number().isEven() || !CHILD(i)[i2][0].representsNonMatrix()) { b = false; break; } } } else if(CHILD(i).isPower() && CHILD(i)[1].isNumber() && CHILD(i)[1].number().isInteger() && CHILD(i)[1].number().isPositive() && CHILD(i)[1].number().isEven() && CHILD(i)[0].representsNonMatrix()) { b = true; } } if(b) { b1_neg = nr1.isNegative(); b2_neg = nr2.isNegative(); if(b1_neg == b2_neg) b = false; } if(b) { if(b1_neg) nr1.negate(); if(!nr1.isOne()) { b = nr1.isPerfectSquare(); if(b) nr1.isqrt(); } } if(b) { if(b2_neg) nr2.negate(); if(!nr2.isOne()) { b = nr2.isPerfectSquare(); if(b) nr2.isqrt(); } } if(b) { bool calc = false; MathStructure *mmul = new MathStructure(*this); for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isNumber()) { if(i == 0) { CHILD(i).number() = nr1; if(b1_neg) nr1.negate(); (*mmul)[i].number() = nr1; } else { CHILD(i).number() = nr2; if(b2_neg) nr2.negate(); (*mmul)[i].number() = nr2; } } else if(CHILD(i).isMultiplication() && CHILD(i).size() > 1) { b = true; size_t i2 = 0; if(CHILD(i)[0].isNumber()) { if(i == 0) { CHILD(i)[0].number() = nr1; if(b1_neg) nr1.negate(); (*mmul)[i][0].number() = nr1; } else { CHILD(i)[0].number() = nr2; if(b2_neg) nr2.negate(); (*mmul)[i][0].number() = nr2; } i2++; } for(; i2 < CHILD(i).size(); i2++) { if(CHILD(i)[i2][1].number().isTwo()) { CHILD(i)[i2].setToChild(1, true); (*mmul)[i][i2].setToChild(1, true); } else { CHILD(i)[i2][1].number().divide(2); (*mmul)[i][i2][1].number().divide(2); } CHILD(i).childUpdated(i2 + 1); (*mmul)[i].childUpdated(i2 + 1); } if(CHILD(i)[0].isOne()) CHILD(i).delChild(1, true); if((*mmul)[i][0].isOne()) (*mmul)[i].delChild(1, true); } else if(CHILD(i).isPower()) { if(CHILD(i)[1].number().isTwo()) { CHILD(i).setToChild(1, true); (*mmul)[i].setToChild(1, true); } else { CHILD(i)[1].number().divide(2); (*mmul)[i][1].number().divide(2); } } if(CHILD(i).isAddition()) calc = true; CHILD_UPDATED(i) mmul->childUpdated(i + 1); } if(calc) { calculatesub(eo, eo, false); mmul->calculatesub(eo, eo, false); } if(recursive) { factorize(eo, false, term_combination_levels, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); mmul->factorize(eo, false, term_combination_levels, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); } multiply_nocopy(mmul); evalSort(true); return true; } } //x^3-y^3=(x-y)(x^2+xy+y^2) if(max_factor_degree != 0 && SIZE == 2 && CHILD(0).isPower() && CHILD(0)[1].isNumber() && CHILD(0)[1].number() == 3 && CHILD(1).isMultiplication() && CHILD(1).size() == 2 && CHILD(1)[0].isMinusOne() && CHILD(1)[1].isPower() && CHILD(1)[1][1].isNumber() && CHILD(1)[1][1].number() == 3) { if(CHILD(0)[0].representsNonMatrix() && CHILD(1)[1][0].representsNonMatrix()) { MathStructure *m2 = new MathStructure(*this); (*m2)[0].setToChild(1, true); (*m2)[1][1].setToChild(1, true); EvaluationOptions eo2 = eo; eo2.expand = false; m2->calculatesub(eo2, eo2, false); CHILD(0)[1].set(2, 1, 0, true); CHILD(1).setToChild(2, true); CHILD(1)[1].set(2, 1, 0, true); MathStructure *m3 = new MathStructure(CHILD(0)[0]); m3->calculateMultiply(CHILD(1)[0], eo2); add_nocopy(m3, true); calculatesub(eo2, eo2, false); multiply_nocopy(m2, true); evalSort(true); return true; } } //-x^3+y^3=(-x+y)(x^2+xy+y^2) if(max_factor_degree != 0 && SIZE == 2 && CHILD(1).isPower() && CHILD(1)[1].isNumber() && CHILD(1)[1].number() == 3 && CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0].isMinusOne() && CHILD(0)[1].isPower() && CHILD(0)[1][1].isNumber() && CHILD(0)[1][1].number() == 3) { if(CHILD(1)[0].representsNonMatrix() && CHILD(0)[1][0].representsNonMatrix()) { MathStructure *m2 = new MathStructure(*this); (*m2)[1].setToChild(1, true); (*m2)[0][1].setToChild(1, true); EvaluationOptions eo2 = eo; eo2.expand = false; m2->calculatesub(eo2, eo2, false); CHILD(1)[1].set(2, 1, 0, true); CHILD(0).setToChild(2, true); CHILD(0)[1].set(2, 1, 0, true); MathStructure *m3 = new MathStructure(CHILD(0)[0]); m3->calculateMultiply(CHILD(1)[0], eo2); add_nocopy(m3, true); calculatesub(eo2, eo2, false); multiply_nocopy(m2, true); evalSort(true); return true; } } if(max_factor_degree != 0 && !only_integers && !force_factorization.isUndefined() && SIZE >= 2) { MathStructure mexp, madd, mmul; if(gather_factors(*this, force_factorization, madd, mmul, mexp) && !madd.isZero() && !mmul.isZero() && mexp.isInteger() && mexp.number().isGreaterThan(nr_two)) { if(!mmul.isOne()) madd.calculateDivide(mmul, eo); bool overflow = false; int n = mexp.number().intValue(&overflow); if(!overflow) { if(n % 4 == 0) { int i_u = 1; if(n != 4) { i_u = n / 4; } MathStructure m_sqrt2(2, 1, 0); m_sqrt2.calculateRaise(nr_half, eo); MathStructure m_sqrtb(madd); m_sqrtb.calculateRaise(nr_half, eo); MathStructure m_bfourth(madd); m_bfourth.calculateRaise(Number(1, 4), eo); m_sqrt2.calculateMultiply(m_bfourth, eo); MathStructure m_x(force_factorization); if(i_u != 1) m_x ^= i_u; m_sqrt2.calculateMultiply(m_x, eo); MathStructure *m2 = new MathStructure(force_factorization); m2->raise(Number(i_u * 2, 1)); m2->add(m_sqrtb); m2->calculateAdd(m_sqrt2, eo); set(force_factorization, true); raise(Number(i_u * 2, 1)); add(m_sqrtb); calculateSubtract(m_sqrt2, eo); multiply_nocopy(m2); } else { int i_u = 1; if(n % 2 == 0) { i_u = 2; n /= 2; } MathStructure *m2 = new MathStructure(madd); m2->calculateRaise(Number(n - 1, n), eo); for(int i = 1; i < n - 1; i++) { MathStructure *mterm = new MathStructure(madd); mterm->calculateRaise(Number(n - i - 1, n), eo); mterm->multiply(force_factorization); if(i != 1 || i_u != 1) { mterm->last().raise(Number(i * i_u, 1)); mterm->childUpdated(mterm->size()); } if(i % 2 == 1) mterm->calculateMultiply(m_minus_one, eo); m2->add_nocopy(mterm, true); } MathStructure *mterm = new MathStructure(force_factorization); mterm->raise(Number((n - 1) * i_u, 1)); m2->add_nocopy(mterm, true); mterm = new MathStructure(force_factorization); if(i_u != 1) mterm->raise(Number(i_u, 1)); set(madd, true); calculateRaise(Number(1, n), eo); add_nocopy(mterm); multiply_nocopy(m2); } if(!mmul.isOne()) multiply(mmul, true); evalSort(true); return true; } } } //-x-y = -(x+y) bool b = true; for(size_t i2 = 0; i2 < SIZE; i2++) { if((!CHILD(i2).isNumber() || !CHILD(i2).number().isNegative()) && (!CHILD(i2).isMultiplication() || CHILD(i2).size() < 2 || !CHILD(i2)[0].isNumber() || !CHILD(i2)[0].number().isNegative())) { b = false; break; } } if(b) { for(size_t i2 = 0; i2 < SIZE; i2++) { if(CHILD(i2).isNumber()) { CHILD(i2).number().negate(); } else { CHILD(i2)[0].number().negate(); if(CHILD(i2)[0].isOne() && CHILD(i2).size() > 1) { CHILD(i2).delChild(1); if(CHILD(i2).size() == 1) { CHILD(i2).setToChild(1, true); } } } } multiply(MathStructure(-1, 1, 0)); CHILD_TO_FRONT(1) } for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isMultiplication() && CHILD(i).size() > 1) { for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { if(CHILD(i)[i2].isAddition()) { for(size_t i3 = i + 1; i3 < SIZE; i3++) { if(CHILD(i3).isMultiplication() && CHILD(i3).size() > 1) { for(size_t i4 = 0; i4 < CHILD(i3).size(); i4++) { if(CHILD(i3)[i4].isAddition() && CHILD(i3)[i4] == CHILD(i)[i2]) { MathStructure *mfac = &CHILD(i)[i2]; mfac->ref(); CHILD(i).delChild(i2 + 1, true); CHILD(i3).delChild(i4 + 1, true); CHILD(i3).ref(); CHILD(i).add_nocopy(&CHILD(i3)); CHILD(i).calculateAddLast(eo); CHILD(i).multiply_nocopy(mfac); CHILD_UPDATED(i) delChild(i3, true); evalSort(true); factorize(eo, false, term_combination_levels, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); return true; } } } } if(SIZE > 2) { MathStructure mtest(*this); mtest.delChild(i + 1); if(mtest == CHILD(i)[i2]) { CHILD(i).delChild(i2 + 1, true); SET_CHILD_MAP(i); add(m_one, true); multiply(mtest); evalSort(true); factorize(eo, false, term_combination_levels, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); return true; } } } } } } } //complete the square if(max_factor_degree != 0 && (term_combination_levels != 0 || complete_square)) { if(only_integers) { if(SIZE <= 3 && SIZE > 1) { MathStructure *xvar = NULL; Number nr2(1, 1); if(CHILD(0).isPower() && CHILD(0)[0].size() == 0 && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isTwo()) { xvar = &CHILD(0)[0]; } else if(CHILD(0).isMultiplication() && CHILD(0).size() == 2 && CHILD(0)[0].isNumber()) { if(CHILD(0)[1].isPower()) { if(CHILD(0)[1][0].size() == 0 && CHILD(0)[1][1].isNumber() && CHILD(0)[1][1].number().isTwo()) { xvar = &CHILD(0)[1][0]; nr2.set(CHILD(0)[0].number()); } } } if(xvar) { bool factorable = false; Number nr1, nr0; if(SIZE == 2 && CHILD(1).isNumber()) { factorable = true; nr0 = CHILD(1).number(); } else if(SIZE == 3 && CHILD(2).isNumber()) { nr0 = CHILD(2).number(); if(CHILD(1).isMultiplication()) { if(CHILD(1).size() == 2 && CHILD(1)[0].isNumber() && xvar->equals(CHILD(1)[1])) { nr1 = CHILD(1)[0].number(); factorable = true; } } else if(xvar->equals(CHILD(1))) { nr1.set(1, 1, 0); factorable = true; } } if(factorable && !nr2.isZero() && !nr1.isZero()) { Number nrh(nr1); nrh /= 2; nrh /= nr2; if(nrh.isInteger()) { Number nrk(nrh); if(nrk.square()) { nrk *= nr2; nrk.negate(); nrk += nr0; set(MathStructure(*xvar), true); add(nrh); raise(nr_two); if(!nr2.isOne()) multiply(nr2); if(!nrk.isZero()) add(nrk); evalSort(true); return true; } } } } } } else { MathStructure m2, m1, m0; const MathStructure *xvar = NULL; if(!force_factorization.isUndefined()) { xvar = &force_factorization; } else { if(CHILD(0).isPower() && CHILD(0)[0].size() == 0 && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isTwo()) { xvar = &CHILD(0)[0]; } else if(CHILD(0).isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0).size(); i2++) { if(CHILD(0).isPower() && CHILD(0)[i2][0].size() == 0 && CHILD(0)[i2][1].isNumber() && CHILD(0)[i2][1].number().isTwo()) { xvar = &CHILD(0)[0]; } } } } if(xvar && gather_factors(*this, *xvar, m0, m1, m2, true) && !m1.isZero() && !m2.isZero()) { MathStructure *mx = new MathStructure(*xvar); set(m1, true); calculateMultiply(nr_half, eo); if(!m2.isOne()) calculateDivide(m2, eo); add_nocopy(mx); calculateAddLast(eo); raise(nr_two); if(!m2.isOne()) multiply(m2); if(!m1.isOne()) m1.calculateRaise(nr_two, eo); m1.calculateMultiply(Number(-1, 4), eo); if(!m2.isOne()) { m2.calculateInverse(eo); m1.calculateMultiply(m2, eo); } m0.calculateAdd(m1, eo); if(!m0.isZero()) add(m0); if(recursive) { CHILD(0).factorize(eo, false, 0, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); CHILD(1).factorize(eo, false, 0, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); CHILDREN_UPDATED } evalSort(true); return true; } } } //Try factorize combinations of terms if(term_combination_levels != 0 && SIZE > 2) { int start_index = rand() % SIZE; int index = start_index; int best_index = -1; int run_index = 0; int max_run_index = SIZE - 3; if(term_combination_levels < -1) { run_index = -term_combination_levels - 2; max_run_index = run_index; } else if(term_combination_levels > 0 && term_combination_levels - 1 < max_run_index) { max_run_index = term_combination_levels -1; } MathStructure mbest; do { if(CALCULATOR->aborted()) break; if(endtime_p && endtime_p->tv_sec > 0) { #ifndef CLOCK_MONOTONIC struct timeval curtime; gettimeofday(&curtime, NULL); if(curtime.tv_sec > endtime_p->tv_sec || (curtime.tv_sec == endtime_p->tv_sec && curtime.tv_usec > endtime_p->tv_usec)) { #else struct timespec curtime; clock_gettime(CLOCK_MONOTONIC, &curtime); if(curtime.tv_sec > endtime_p->tv_sec || (curtime.tv_sec == endtime_p->tv_sec && curtime.tv_nsec / 1000 > endtime_p->tv_usec)) { #endif CALCULATOR->error(false, _("Because of time constraints only a limited number of combinations of terms were tried during factorization. Repeat factorization to try other random combinations."), NULL); break; } } MathStructure mtest(*this); mtest.delChild(index + 1); if(mtest.factorize(eo, false, run_index == 0 ? 0 : -1 - run_index, 0, only_integers, false, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree)) { bool b = best_index < 0 || (mbest.isAddition() && !mtest.isAddition()); if(!b && (mtest.isAddition() == mbest.isAddition())) { b = mtest.isAddition() && (mtest.size() < mbest.size()); if(!b && (!mtest.isAddition() || mtest.size() == mbest.size())) { size_t c1 = mtest.countTotalChildren() + CHILD(index).countTotalChildren(); size_t c2 = mbest.countTotalChildren() + CHILD(best_index).countTotalChildren(); b = (c1 < c2); if(c1 == c2) { b = (count_powers(mtest) + count_powers(CHILD(index))) < (count_powers(mbest) + count_powers(CHILD(best_index))); } } } if(b) { mbest = mtest; best_index = index; if(mbest.isPower()) { break; } } } index++; if(index == (int) SIZE) index = 0; if(index == start_index) { if(best_index >= 0) { break; } run_index++; if(run_index > max_run_index) break; } } while(true); if(best_index >= 0) { mbest.add(CHILD(best_index), true); set(mbest); if(term_combination_levels >= -1 && (run_index > 0 || recursive)) { factorize(eo, false, term_combination_levels, 0, only_integers, true, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); } return true; } } } default: { if(term_combination_levels < -1) break; bool b = false; if(isComparison()) { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).factorize(eo2, false, term_combination_levels, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree)) { CHILD_UPDATED(i); b = true; } } } else if(recursive && (recursive > 1 || !isAddition())) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).factorize(eo, false, term_combination_levels, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree)) { CHILD_UPDATED(i); b = true; } } } if(b) { EvaluationOptions eo2 = eo; eo2.expand = false; calculatesub(eo2, eo2, false); evalSort(true); if(isAddition()) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isMultiplication() && CHILD(i).size() > 1) { for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { if(CHILD(i)[i2].isAddition()) { for(size_t i3 = i + 1; i3 < SIZE; i3++) { if(CHILD(i3).isMultiplication() && CHILD(i3).size() > 1) { for(size_t i4 = 0; i4 < CHILD(i3).size(); i4++) { if(CHILD(i3)[i4].isAddition() && CHILD(i3)[i4] == CHILD(i)[i2]) { MathStructure *mfac = &CHILD(i)[i2]; mfac->ref(); CHILD(i).delChild(i2 + 1, true); CHILD(i3).delChild(i4 + 1, true); CHILD(i3).ref(); CHILD(i).add_nocopy(&CHILD(i3)); CHILD(i).calculateAddLast(eo); CHILD(i).multiply_nocopy(mfac); CHILD_UPDATED(i) delChild(i3 + 1, true); evalSort(true); factorize(eo, false, term_combination_levels, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); return true; } } } } if(SIZE > 2) { MathStructure mtest(*this); mtest.delChild(i + 1); if(mtest == CHILD(i)[i2]) { CHILD(i).delChild(i2 + 1, true); SET_CHILD_MAP(i); add(m_one, true); multiply(mtest); evalSort(true); factorize(eo, false, term_combination_levels, 0, only_integers, recursive, endtime_p, force_factorization, complete_square, only_sqrfree, max_factor_degree); return true; } } } } } } } return true; } } } return false; } void MathStructure::swapChildren(size_t index1, size_t index2) { if(index1 > 0 && index2 > 0 && index1 <= SIZE && index2 <= SIZE) { SWAP_CHILDREN(index1 - 1, index2 - 1) } } void MathStructure::childToFront(size_t index) { if(index > 0 && index <= SIZE) { CHILD_TO_FRONT(index - 1) } } void MathStructure::addChild(const MathStructure &o) { APPEND(o); } void MathStructure::addChild_nocopy(MathStructure *o) { APPEND_POINTER(o); } void MathStructure::delChild(size_t index, bool check_size) { if(index > 0 && index <= SIZE) { ERASE(index - 1); if(check_size) { if(SIZE == 1) setToChild(1, true); else if(SIZE == 0) clear(true); } } } void MathStructure::insertChild(const MathStructure &o, size_t index) { if(index > 0 && index <= v_subs.size()) { v_order.insert(v_order.begin() + (index - 1), v_subs.size()); v_subs.push_back(new MathStructure(o)); CHILD_UPDATED(index - 1); } else { addChild(o); } } void MathStructure::insertChild_nocopy(MathStructure *o, size_t index) { if(index > 0 && index <= v_subs.size()) { v_order.insert(v_order.begin() + (index - 1), v_subs.size()); v_subs.push_back(o); CHILD_UPDATED(index - 1); } else { addChild_nocopy(o); } } void MathStructure::setChild(const MathStructure &o, size_t index, bool merge_precision) { if(index > 0 && index <= SIZE) { CHILD(index - 1).set(o, merge_precision); CHILD_UPDATED(index - 1); } } void MathStructure::setChild_nocopy(MathStructure *o, size_t index, bool merge_precision) { if(index > 0 && index <= SIZE) { MathStructure *o_prev = v_subs[v_order[index - 1]]; if(merge_precision) { if(!o->isApproximate() && o_prev->isApproximate()) o->setApproximate(true); if(o_prev->precision() >= 0 && (o->precision() < 0 || o_prev->precision() < o->precision())) o->setPrecision(o_prev->precision()); } o_prev->unref(); v_subs[v_order[index - 1]] = o; CHILD_UPDATED(index - 1); } } const MathStructure *MathStructure::getChild(size_t index) const { if(index > 0 && index <= v_order.size()) { return &CHILD(index - 1); } return NULL; } MathStructure *MathStructure::getChild(size_t index) { if(index > 0 && index <= v_order.size()) { return &CHILD(index - 1); } return NULL; } size_t MathStructure::countChildren() const { return SIZE; } size_t MathStructure::size() const { return SIZE; } const MathStructure *MathStructure::base() const { if(m_type == STRUCT_POWER && SIZE >= 1) { return &CHILD(0); } return NULL; } const MathStructure *MathStructure::exponent() const { if(m_type == STRUCT_POWER && SIZE >= 2) { return &CHILD(1); } return NULL; } MathStructure *MathStructure::base() { if(m_type == STRUCT_POWER && SIZE >= 1) { return &CHILD(0); } return NULL; } MathStructure *MathStructure::exponent() { if(m_type == STRUCT_POWER && SIZE >= 2) { return &CHILD(1); } return NULL; } StructureType MathStructure::type() const { return m_type; } void MathStructure::unformat(const EvaluationOptions &eo) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).unformat(eo); } switch(m_type) { case STRUCT_INVERSE: { APPEND(m_minus_one); m_type = STRUCT_POWER; break; } case STRUCT_NEGATE: { PREPEND(m_minus_one); m_type = STRUCT_MULTIPLICATION; break; } case STRUCT_DIVISION: { CHILD(1).raise(m_minus_one); m_type = STRUCT_MULTIPLICATION; break; } case STRUCT_UNIT: { if(o_prefix && !eo.keep_prefixes) { if(o_prefix == CALCULATOR->decimal_null_prefix || o_prefix == CALCULATOR->binary_null_prefix) { o_prefix = NULL; } else { Unit *u = o_unit; Prefix *p = o_prefix; set(p->value()); multiply(u); } unformat(eo); break; } else if(o_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) { set(((CompositeUnit*) o_unit)->generateMathStructure(false, eo.keep_prefixes)); unformat(eo); break; } b_plural = false; break; } default: {} } } void idm1(const MathStructure &mnum, bool &bfrac, bool &bint) { switch(mnum.type()) { case STRUCT_NUMBER: { if((!bfrac || bint) && mnum.number().isRational()) { if(!mnum.number().isInteger()) { bint = false; bfrac = true; } } else { bint = false; } break; } case STRUCT_MULTIPLICATION: { if((!bfrac || bint) && mnum.size() > 0 && mnum[0].isNumber() && mnum[0].number().isRational()) { if(!mnum[0].number().isInteger()) { bint = false; bfrac = true; } } else { bint = false; } break; } case STRUCT_ADDITION: { bool b_a = false; for(size_t i = 0; i < mnum.size() && (!bfrac || bint); i++) { if(mnum[i].isAddition()) b_a = true; else idm1(mnum[i], bfrac, bint); } if(b_a) bint = false; break; } default: { bint = false; } } } void idm2(const MathStructure &mnum, bool &bfrac, bool &bint, Number &nr) { switch(mnum.type()) { case STRUCT_NUMBER: { if(mnum.number().isRational()) { if(mnum.number().isInteger()) { if(bint) { if(mnum.number().isOne()) { bint = false; } else if(nr.isOne()) { nr = mnum.number(); } else if(nr != mnum.number()) { nr.gcd(mnum.number()); if(nr.isOne()) bint = false; } } } else { if(nr.isOne()) { nr = mnum.number().denominator(); } else { Number nden(mnum.number().denominator()); if(nr != nden) { Number ngcd(nden); ngcd.gcd(nr); nden /= ngcd; nr *= nden; } } } } break; } case STRUCT_MULTIPLICATION: { if(mnum.size() > 0 && mnum[0].isNumber() && mnum[0].number().isRational()) { if(mnum[0].number().isInteger()) { if(bint) { if(mnum[0].number().isOne()) { bint = false; } else if(nr.isOne()) { nr = mnum[0].number(); } else if(nr != mnum[0].number()) { nr.gcd(mnum[0].number()); if(nr.isOne()) bint = false; } } } else { if(nr.isOne()) { nr = mnum[0].number().denominator(); } else { Number nden(mnum[0].number().denominator()); if(nr != nden) { Number ngcd(nden); ngcd.gcd(nr); nden /= ngcd; nr *= nden; } } } } break; } case STRUCT_ADDITION: { for(size_t i = 0; i < mnum.size() && (bfrac || bint); i++) { if(!mnum[i].isAddition()) idm2(mnum[i], bfrac, bint, nr); } break; } default: {} } } int idm3(MathStructure &mnum, Number &nr, bool expand) { switch(mnum.type()) { case STRUCT_NUMBER: { mnum.number() *= nr; mnum.numberUpdated(); break; } case STRUCT_MULTIPLICATION: { if(mnum.size() > 0 && mnum[0].isNumber()) { mnum[0].number() *= nr; if(mnum[0].number().isOne() && mnum.size() != 1) { mnum.delChild(1, true); } return -1; } else if(expand) { for(size_t i = 0; i < mnum.size(); i++) { if(mnum[i].isAddition()) { idm3(mnum[i], nr, true); return -1; } } } mnum.insertChild(nr, 1); return 1; } case STRUCT_ADDITION: { if(expand) { for(size_t i = 0; i < mnum.size(); i++) { idm3(mnum[i], nr, true); } break; } } default: { mnum.transform(STRUCT_MULTIPLICATION); mnum.insertChild(nr, 1); return -1; } } return 0; } bool displays_number_exact(Number nr, const PrintOptions &po, MathStructure *top_parent) { if(po.base == BASE_ROMAN_NUMERALS) return true; InternalPrintStruct ips_n; if(top_parent && top_parent->isApproximate()) ips_n.parent_approximate = true; if(top_parent && top_parent->precision() < 0) ips_n.parent_precision = top_parent->precision(); bool approximately_displayed = false; PrintOptions po2 = po; po2.is_approximate = &approximately_displayed; nr.print(po2, ips_n); return !approximately_displayed; } int idm3_test(bool &b_fail, const MathStructure &mnum, const Number &nr, bool expand, const PrintOptions &po, MathStructure *top_parent) { switch(mnum.type()) { case STRUCT_NUMBER: { Number nr2(mnum.number()); nr2 *= nr; b_fail = !displays_number_exact(nr2, po, top_parent); break; } case STRUCT_MULTIPLICATION: { if(mnum.size() > 0 && mnum[0].isNumber()) { Number nr2(mnum[0].number()); nr2 *= nr; b_fail = !nr2.isOne() && !displays_number_exact(nr2, po, top_parent); return -1; } else if(expand) { for(size_t i = 0; i < mnum.size(); i++) { if(mnum[i].isAddition()) { idm3_test(b_fail, mnum[i], nr, true, po, top_parent); return -1; } } } b_fail = !displays_number_exact(nr, po, top_parent); return 1; } case STRUCT_ADDITION: { if(expand) { for(size_t i = 0; i < mnum.size(); i++) { idm3_test(b_fail, mnum[i], nr, true, po, top_parent); if(b_fail) break; } break; } } default: { b_fail = !displays_number_exact(nr, po, top_parent); return -1; } } return 0; } bool is_unit_multiexp(const MathStructure &mstruct) { if(mstruct.isUnit_exp()) return true; if(mstruct.isMultiplication()) { for(size_t i3 = 0; i3 < mstruct.size(); i3++) { if(!mstruct[i3].isUnit_exp()) { return false; break; } } return true; } if(mstruct.isPower() && mstruct[0].isMultiplication()) { for(size_t i3 = 0; i3 < mstruct[0].size(); i3++) { if(!mstruct[0][i3].isUnit_exp()) { return false; break; } } return true; } return false; } bool MathStructure::improve_division_multipliers(const PrintOptions &po) { switch(m_type) { case STRUCT_MULTIPLICATION: { size_t inum = 0, iden = 0; bool bfrac = false, bint = true, bdiv = false, bnonunitdiv = false; size_t index1 = 0, index2 = 0; bool dofrac = !po.negative_exponents; for(size_t i2 = 0; i2 < SIZE; i2++) { if(CHILD(i2).isPower() && CHILD(i2)[1].isMinusOne()) { if(!po.place_units_separately || !is_unit_multiexp(CHILD(i2)[0])) { if(iden == 0) index1 = i2; iden++; bdiv = true; if(!CHILD(i2)[0].isUnit()) bnonunitdiv = true; if(CHILD(i2)[0].containsType(STRUCT_ADDITION)) { dofrac = true; } } } else if(!bdiv && !po.negative_exponents && CHILD(i2).isPower() && CHILD(i2)[1].hasNegativeSign()) { if(!po.place_units_separately || !is_unit_multiexp(CHILD(i2)[0])) { if(!bdiv) index1 = i2; bdiv = true; if(!CHILD(i2)[0].isUnit()) bnonunitdiv = true; } } else { if(!po.place_units_separately || !is_unit_multiexp(CHILD(i2))) { if(inum == 0) index2 = i2; inum++; } } } if(!bdiv || !bnonunitdiv) break; if(iden > 1 && !po.negative_exponents) { size_t i2 = index1 + 1; while(i2 < SIZE) { if(CHILD(i2).isPower() && CHILD(i2)[1].isMinusOne()) { CHILD(index1)[0].multiply(CHILD(i2)[0], true); ERASE(i2); } else { i2++; } } iden = 1; } if(bint) bint = inum > 0 && iden == 1; if(inum > 0) idm1(CHILD(index2), bfrac, bint); if(iden > 0) idm1(CHILD(index1)[0], bfrac, bint); bool b = false; if(!dofrac) bfrac = false; if(bint || bfrac) { Number nr(1, 1); if(inum > 0) idm2(CHILD(index2), bfrac, bint, nr); if(iden > 0) idm2(CHILD(index1)[0], bfrac, bint, nr); if((bint || bfrac) && !nr.isOne()) { if(bint) nr.recip(); bool b_fail = false; if(inum > 1 && !CHILD(index2).isNumber()) { int i = idm3_test(b_fail, *this, nr, !po.allow_factorization, po, this); if(i >= 0 && !b_fail && iden > 0) idm3_test(b_fail, CHILD(index1)[0], nr, !po.allow_factorization, po, this); } else { if(inum != 0) idm3_test(b_fail, CHILD(index2), nr, !po.allow_factorization, po, this); if(!b_fail && iden > 0) idm3_test(b_fail, CHILD(index1)[0], nr, !po.allow_factorization, po, this); } if(b_fail) return false; b = true; if(inum == 0) { PREPEND(MathStructure(nr)); index1 += 1; } else if(inum > 1 && !CHILD(index2).isNumber()) { int i = idm3(*this, nr, !po.allow_factorization); if(i == 1) index1++; else if(i < 0) iden = 0; } else { idm3(CHILD(index2), nr, !po.allow_factorization); } if(iden > 0) { idm3(CHILD(index1)[0], nr, !po.allow_factorization); } else { MathStructure mstruct(nr); mstruct.raise(m_minus_one); insertChild(mstruct, index1); } b = true; } } /*if(!po.negative_exponents && SIZE == 2 && CHILD(1).isAddition()) { MathStructure factor_mstruct(1, 1); if(factorize_find_multiplier(CHILD(1), CHILD(1), factor_mstruct)) { transform(STRUCT_MULTIPLICATION); PREPEND(factor_mstruct); } }*/ return b; } case STRUCT_DIVISION: { bool bint = true, bfrac = false; idm1(CHILD(0), bfrac, bint); idm1(CHILD(1), bfrac, bint); if(bint || bfrac) { Number nr(1, 1); idm2(CHILD(0), bfrac, bint, nr); idm2(CHILD(1), bfrac, bint, nr); if((bint || bfrac) && !nr.isOne()) { if(bint) nr.recip(); bool b_fail = false; idm3_test(b_fail, CHILD(0), nr, !po.allow_factorization, po, this); if(b_fail) return false; idm3_test(b_fail, CHILD(1), nr, !po.allow_factorization, po, this); if(b_fail) return false; idm3(CHILD(0), nr, !po.allow_factorization); idm3(CHILD(1), nr, !po.allow_factorization); return true; } } break; } case STRUCT_INVERSE: { bool bint = false, bfrac = false; idm1(CHILD(0), bfrac, bint); if(bint || bfrac) { Number nr(1, 1); idm2(CHILD(0), bfrac, bint, nr); if((bint || bfrac) && !nr.isOne()) { bool b_fail = false; idm3_test(b_fail, CHILD(0), nr, !po.allow_factorization, po, this); if(b_fail) return false; setToChild(1, true); idm3(*this, nr, !po.allow_factorization); transform_nocopy(STRUCT_DIVISION, new MathStructure(nr)); SWAP_CHILDREN(0, 1); return true; } } break; } case STRUCT_POWER: { if(CHILD(1).isMinusOne()) { bool bint = false, bfrac = false; idm1(CHILD(0), bfrac, bint); if(bint || bfrac) { Number nr(1, 1); idm2(CHILD(0), bfrac, bint, nr); if((bint || bfrac) && !nr.isOne()) { bool b_fail = false; idm3_test(b_fail, CHILD(0), nr, !po.allow_factorization, po, this); if(b_fail) return false; idm3(CHILD(0), nr, !po.allow_factorization); transform(STRUCT_MULTIPLICATION); PREPEND(MathStructure(nr)); return true; } } break; } } default: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; if(CHILD(i).improve_division_multipliers()) b = true; } return b; } } return false; } bool use_prefix_with_unit(Unit *u, const PrintOptions &po) { if(!po.prefix && !po.use_unit_prefixes) {return u->referenceName() == "g" || u->referenceName() == "a";} if(po.prefix) return true; if(u->isCurrency()) return po.use_prefixes_for_currencies; if(po.use_prefixes_for_all_units) return true; return u->useWithPrefixesByDefault(); } bool use_prefix_with_unit(const MathStructure &mstruct, const PrintOptions &po) { if(mstruct.isUnit()) return use_prefix_with_unit(mstruct.unit(), po); if(mstruct.isUnit_exp()) return use_prefix_with_unit(mstruct[0].unit(), po); return false; } bool has_prefix(const MathStructure &mstruct) { if(mstruct.isUnit()) return mstruct.prefix() != NULL; for(size_t i = 0; i < mstruct.size(); i++) { if(has_prefix(mstruct[i])) return true; } return false; } void MathStructure::setPrefixes(const PrintOptions &po, MathStructure *parent, size_t pindex) { switch(m_type) { case STRUCT_MULTIPLICATION: { bool b = false; size_t i = SIZE, im = 0; bool b_im = false; for(size_t i2 = 0; i2 < SIZE; i2++) { if(CHILD(i2).isUnit_exp()) { if(CHILD(i2).unit_exp_prefix()) { b = false; return; } if(!b) { if(use_prefix_with_unit(CHILD(i2), po)) { b = true; if(i > i2) {i = i2; b_im = false;} } else if(i < i2) { i = i2; b_im = false; } } } else if(CHILD(i2).isPower() && CHILD(i2)[0].isMultiplication()) { for(size_t i3 = 0; i3 < CHILD(i2)[0].size(); i3++) { if(CHILD(i2)[0][i3].isUnit_exp()) { if(CHILD(i2)[0][i3].unit_exp_prefix()) { b = false; return; } if(!b) { if(use_prefix_with_unit(CHILD(i2)[0][i3], po)) { b = true; if(i > i2) { i = i2; im = i3; b_im = true; } break; } else if(i < i2 || (i == i2 && im < i3)) { i = i2; im = i3; b_im = true; } } } } } } if(b) { Number exp(1, 1); Number exp2(1, 1); bool b2 = false; MathStructure *munit = NULL, *munit2 = NULL; if(b_im) munit = &CHILD(i)[0][im]; else munit = &CHILD(i); if(CHILD(i).isPower()) { if(CHILD(i)[1].isNumber() && CHILD(i)[1].number().isInteger() && !CHILD(i)[1].number().isZero()) { if(b_im && munit->isPower()) { if((*munit)[1].isNumber() && (*munit)[1].number().isInteger() && !(*munit)[1].number().isZero()) { exp = CHILD(i)[1].number(); exp *= (*munit)[1].number(); } else { b = false; } } else { exp = CHILD(i)[1].number(); } } else { b = false; } } if(po.use_denominator_prefix && !exp.isNegative()) { for(size_t i2 = i + 1; i2 < SIZE; i2++) { if(CALCULATOR->aborted()) break; if(CHILD(i2).isPower() && CHILD(i2)[1].isNumber() && CHILD(i2)[1].number().isNegative()) { if(CHILD(i2)[0].isUnit() && use_prefix_with_unit(CHILD(i2)[0], po)) { munit2 = &CHILD(i2)[0]; if(munit2->prefix() || !CHILD(i2)[1].number().isInteger()) { break; } if(!b) { b = true; exp = CHILD(i2)[1].number(); munit = munit2; } else { b2 = true; exp2 = CHILD(i2)[1].number(); } break; } else if(CHILD(i2)[0].isMultiplication()) { bool b_break = false; for(size_t im2 = 0; im2 < CHILD(i2)[0].size(); im2++) { if(CHILD(i2)[0][im2].isUnit_exp() && use_prefix_with_unit(CHILD(i2)[0][im2], po) && (CHILD(i2)[0][im2].isUnit() || (CHILD(i2)[0][im2][1].isNumber() && (CHILD(i2)[0][im2][1].number().isPositive() || (!b && CHILD(i2)[0][im2][1].number().isNegative())) && CHILD(i2)[0][im2][1].number().isInteger()))) { Number exp_multi(1); if(CHILD(i2)[0][im2].isUnit()) { munit2 = &CHILD(i2)[0][im2]; } else { munit2 = &CHILD(i2)[0][im2][0]; exp_multi = CHILD(i2)[0][im2][1].number(); } b_break = true; if(munit2->prefix() || !CHILD(i2)[1].number().isInteger()) { break; } if(!b) { b = true; exp = CHILD(i2)[1].number(); exp *= exp_multi; i = i2; } else { b2 = true; exp2 = CHILD(i2)[1].number(); exp2 *= exp_multi; } break; } } if(b_break) break; } } } } else if(exp.isNegative() && b) { bool had_unit = false; for(size_t i2 = i + 1; i2 < SIZE; i2++) { if(CALCULATOR->aborted()) break; bool b3 = false; if(CHILD(i2).isPower() && CHILD(i2)[1].isNumber() && CHILD(i2)[1].number().isPositive()) { if(CHILD(i2)[0].isUnit()) { if(!use_prefix_with_unit(CHILD(i2)[0], po)) { had_unit = true; } else { munit2 = &CHILD(i2); if(munit2->prefix() || !CHILD(i2)[1].number().isInteger()) { break; } b3 = true; exp2 = exp; exp = CHILD(i2)[1].number(); } } else if(CHILD(i2)[0].isMultiplication()) { bool b_break = false; for(size_t im2 = 0; im2 < CHILD(i2)[0].size(); im2++) { if(CHILD(i2)[0][im2].isUnit_exp() && (CHILD(i2)[0][im2].isUnit() || (CHILD(i2)[0][im2][1].isNumber() && CHILD(i2)[0][im2][1].number().isPositive() && CHILD(i2)[0][im2][1].number().isInteger()))) { if(!use_prefix_with_unit(CHILD(i2)[0][im2], po)) { had_unit = true; } else { Number exp_multi(1); if(CHILD(i2)[0][im2].isUnit()) { munit2 = &CHILD(i2)[0][im2]; } else { munit2 = &CHILD(i2)[0][im2][0]; exp_multi = CHILD(i2)[0][im2][1].number(); } b_break = true; if(munit2->prefix() || !CHILD(i2)[1].number().isInteger()) { break; } exp2 = exp; exp = CHILD(i2)[1].number(); exp *= exp_multi; b3 = true; break; } } } if(b_break) break; } } else if(CHILD(i2).isUnit()) { if(!use_prefix_with_unit(CHILD(i2), po)) { had_unit = true; } else { if(CHILD(i2).prefix()) break; exp2 = exp; exp.set(1, 1, 0); b3 = true; munit2 = &CHILD(i2); } } if(b3) { if(po.use_denominator_prefix) { b2 = true; MathStructure *munit3 = munit; munit = munit2; munit2 = munit3; } else { munit = munit2; } had_unit = false; break; } } if(had_unit && !po.use_denominator_prefix) b = false; } Number exp10; if(b) { if(po.prefix) { if(po.prefix != CALCULATOR->decimal_null_prefix && po.prefix != CALCULATOR->binary_null_prefix) { if(munit->isUnit()) munit->setPrefix(po.prefix); else (*munit)[0].setPrefix(po.prefix); if(CHILD(0).isNumber()) { CHILD(0).number() /= po.prefix->value(exp); } else { PREPEND(po.prefix->value(exp)); CHILD(0).number().recip(); } } } else if(po.use_unit_prefixes && CHILD(0).isNumber() && exp.isInteger()) { exp10 = CHILD(0).number(); exp10.abs(); exp10.intervalToMidValue(); if(exp10.isLessThanOrEqualTo(Number(1, 1, 1000)) && exp10.isGreaterThanOrEqualTo(Number(1, 1, -1000))) { exp10.log(10); exp10.intervalToMidValue(); exp10.floor(); if(b2) { Number tmp_exp(exp10); tmp_exp.setNegative(false); Number e1(3, 1, 0); e1 *= exp; Number e2(3, 1, 0); e2 *= exp2; e2.setNegative(false); int i4 = 0; while(true) { tmp_exp -= e1; if(!tmp_exp.isPositive()) { break; } if(exp10.isNegative()) i4++; tmp_exp -= e2; if(tmp_exp.isNegative()) { break; } if(!exp10.isNegative()) i4++; } e2.setNegative(exp10.isNegative()); e2 *= i4; exp10 -= e2; } DecimalPrefix *p = CALCULATOR->getBestDecimalPrefix(exp10, exp, po.use_all_prefixes); if(p) { Number test_exp(exp10); test_exp -= p->exponent(exp); if(test_exp.isInteger()) { if((exp10.isPositive() && exp10.compare(test_exp) == COMPARISON_RESULT_LESS) || (exp10.isNegative() && exp10.compare(test_exp) == COMPARISON_RESULT_GREATER)) { CHILD(0).number() /= p->value(exp); if(munit->isUnit()) munit->setPrefix(p); else (*munit)[0].setPrefix(p); } } } } } else if(!po.use_unit_prefixes) { Prefix *p = NULL; if((munit->isUnit() && munit->unit()->referenceName() == "g") || (munit->isPower() && (*munit)[0].unit()->referenceName() == "g")) { p = CALCULATOR->getExactDecimalPrefix(3); } else if((munit->isUnit() && munit->unit()->referenceName() == "a") || (munit->isPower() && (*munit)[0].unit()->referenceName() == "a")) { p = CALCULATOR->getExactDecimalPrefix(2); } if(p) { if(munit->isUnit()) munit->setPrefix(p); else (*munit)[0].setPrefix(p); if(CHILD(0).isNumber()) { CHILD(0).number() /= p->value(exp); } else { PREPEND(p->value(exp)); CHILD(0).number().recip(); } } } if(b2 && CHILD(0).isNumber() && (po.prefix || po.use_unit_prefixes) && (po.prefix != CALCULATOR->decimal_null_prefix && po.prefix != CALCULATOR->binary_null_prefix)) { exp10 = CHILD(0).number(); exp10.abs(); exp10.intervalToMidValue(); if(exp10.isLessThanOrEqualTo(Number(1, 1, 1000)) && exp10.isGreaterThanOrEqualTo(Number(1, 1, -1000))) { exp10.log(10); exp10.intervalToMidValue(); exp10.floor(); DecimalPrefix *p = CALCULATOR->getBestDecimalPrefix(exp10, exp2, po.use_all_prefixes); if(p) { Number test_exp(exp10); test_exp -= p->exponent(exp2); if(test_exp.isInteger()) { if((exp10.isPositive() && exp10.compare(test_exp) == COMPARISON_RESULT_LESS) || (exp10.isNegative() && exp10.compare(test_exp) == COMPARISON_RESULT_GREATER)) { CHILD(0).number() /= p->value(exp2); if(munit2->isUnit()) munit2->setPrefix(p); else (*munit2)[0].setPrefix(p); } } } } } } return; } break; } case STRUCT_UNIT: { if(!o_prefix && (po.prefix && po.prefix != CALCULATOR->decimal_null_prefix && po.prefix != CALCULATOR->binary_null_prefix)) { transform(STRUCT_MULTIPLICATION, m_one); SWAP_CHILDREN(0, 1); setPrefixes(po, parent, pindex); } return; } case STRUCT_POWER: { if(CHILD(0).isUnit()) { if(CHILD(1).isNumber() && CHILD(1).number().isReal() && !CHILD(0).prefix() && !o_prefix && (po.prefix && po.prefix != CALCULATOR->decimal_null_prefix && po.prefix != CALCULATOR->binary_null_prefix)) { transform(STRUCT_MULTIPLICATION, m_one); SWAP_CHILDREN(0, 1); setPrefixes(po, parent, pindex); } return; } break; } default: {} } if(po.prefix || !has_prefix(*this)) { for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; CHILD(i).setPrefixes(po, this, i + 1); } } } bool split_unit_powers(MathStructure &mstruct); bool split_unit_powers(MathStructure &mstruct) { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(CALCULATOR->aborted()) break; if(split_unit_powers(mstruct[i])) { mstruct.childUpdated(i + 1); b = true; } } if(mstruct.isPower() && mstruct[0].isMultiplication()) { bool b2 = mstruct[1].isNumber(); for(size_t i = 0; i < mstruct[0].size(); i++) { if(mstruct[0][i].isPower() && (!b2 || !mstruct[0][i][1].isNumber())) return b; } MathStructure mpower(mstruct[1]); mstruct.setToChild(1); for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isPower()) mstruct[i][1].number() *= mpower.number(); else mstruct[i].raise(mpower); } mstruct.childrenUpdated(); return true; } return b; } void MathStructure::postFormatUnits(const PrintOptions &po, MathStructure*, size_t) { switch(m_type) { case STRUCT_DIVISION: { if(po.place_units_separately) { vector nums; bool b1 = false, b2 = false; if(CHILD(0).isMultiplication()) { for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isUnit_exp()) { nums.push_back(i); } else { b1 = true; } } b1 = b1 && !nums.empty(); } else if(CHILD(0).isUnit_exp()) { b1 = true; } vector dens; if(CHILD(1).isMultiplication()) { for(size_t i = 0; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isUnit_exp()) { dens.push_back(i); } else { b2 = true; } } b2 = b2 && !dens.empty(); } else if(CHILD(1).isUnit_exp()) { if(CHILD(0).isUnit_exp()) { b1 = false; } else { b2 = true; } } if(b2 && !b1) b1 = true; if(b1) { MathStructure num = m_undefined; if(CHILD(0).isUnit_exp()) { num = CHILD(0); CHILD(0).set(m_one); } else if(nums.size() > 0) { num = CHILD(0)[nums[0]]; for(size_t i = 1; i < nums.size(); i++) { num.multiply(CHILD(0)[nums[i]], i > 1); } for(size_t i = 0; i < nums.size(); i++) { CHILD(0).delChild(nums[i] + 1 - i); } if(CHILD(0).size() == 1) { CHILD(0).setToChild(1, true); } } MathStructure den = m_undefined; if(CHILD(1).isUnit_exp()) { den = CHILD(1); setToChild(1, true); } else if(dens.size() > 0) { den = CHILD(1)[dens[0]]; for(size_t i = 1; i < dens.size(); i++) { den.multiply(CHILD(1)[dens[i]], i > 1); } for(size_t i = 0; i < dens.size(); i++) { CHILD(1).delChild(dens[i] + 1 - i); } if(CHILD(1).size() == 1) { CHILD(1).setToChild(1, true); } } if(num.isUndefined()) { transform(STRUCT_DIVISION, den); } else { if(!den.isUndefined()) { num.transform(STRUCT_DIVISION, den); } multiply(num, false); } if(CHILD(0).isDivision()) { if(CHILD(0)[0].isMultiplication()) { if(CHILD(0)[0].size() == 1) { CHILD(0)[0].setToChild(1, true); } else if(CHILD(0)[0].size() == 0) { CHILD(0)[0] = 1; } } if(CHILD(0)[1].isMultiplication()) { if(CHILD(0)[1].size() == 1) { CHILD(0)[1].setToChild(1, true); } else if(CHILD(0)[1].size() == 0) { CHILD(0).setToChild(1, true); } } else if(CHILD(0)[1].isOne()) { CHILD(0).setToChild(1, true); } if(CHILD(0).isDivision() && CHILD(0)[1].isNumber() && CHILD(0)[0].isMultiplication() && CHILD(0)[0].size() > 1 && CHILD(0)[0][0].isNumber()) { MathStructure *msave = new MathStructure; if(CHILD(0)[0].size() == 2) { msave->set(CHILD(0)[0][1]); CHILD(0)[0].setToChild(1, true); } else { msave->set(CHILD(0)[0]); CHILD(0)[0].setToChild(1, true); msave->delChild(1); } if(isMultiplication()) { insertChild_nocopy(msave, 2); } else { CHILD(0).multiply_nocopy(msave); } } } bool do_plural = po.short_multiplication; CHILD(0).postFormatUnits(po, this, 1); CHILD_UPDATED(0); switch(CHILD(0).type()) { case STRUCT_NUMBER: { if(CHILD(0).isZero() || CHILD(0).number().isOne() || CHILD(0).number().isMinusOne() || CHILD(0).number().isFraction()) { do_plural = false; } break; } case STRUCT_DIVISION: { if(CHILD(0)[0].isNumber() && CHILD(0)[1].isNumber()) { if(CHILD(0)[0].number().isLessThanOrEqualTo(CHILD(0)[1].number())) { do_plural = false; } } break; } case STRUCT_INVERSE: { if(CHILD(0)[0].isNumber() && CHILD(0)[0].number().isGreaterThanOrEqualTo(1)) { do_plural = false; } break; } default: {} } split_unit_powers(CHILD(1)); switch(CHILD(1).type()) { case STRUCT_UNIT: { CHILD(1).setPlural(do_plural); break; } case STRUCT_POWER: { CHILD(1)[0].setPlural(do_plural); break; } case STRUCT_MULTIPLICATION: { if(po.limit_implicit_multiplication) CHILD(1)[0].setPlural(do_plural); else CHILD(1)[CHILD(1).size() - 1].setPlural(do_plural); break; } case STRUCT_DIVISION: { switch(CHILD(1)[0].type()) { case STRUCT_UNIT: { CHILD(1)[0].setPlural(do_plural); break; } case STRUCT_POWER: { CHILD(1)[0][0].setPlural(do_plural); break; } case STRUCT_MULTIPLICATION: { if(po.limit_implicit_multiplication) CHILD(1)[0][0].setPlural(do_plural); else CHILD(1)[0][CHILD(1)[0].size() - 1].setPlural(do_plural); break; } default: {} } break; } default: {} } } } else { for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; CHILD(i).postFormatUnits(po, this, i + 1); CHILD_UPDATED(i); } } break; } case STRUCT_UNIT: { b_plural = false; break; } case STRUCT_MULTIPLICATION: { if(SIZE > 1 && CHILD(1).isUnit_exp() && CHILD(0).isNumber()) { bool do_plural = po.short_multiplication && !(CHILD(0).isZero() || CHILD(0).number().isOne() || CHILD(0).number().isMinusOne() || CHILD(0).number().isFraction()); size_t i = 2; for(; i < SIZE; i++) { if(CALCULATOR->aborted()) break; if(CHILD(i).isUnit()) { CHILD(i).setPlural(false); } else if(CHILD(i).isPower() && CHILD(i)[0].isUnit()) { CHILD(i)[0].setPlural(false); } else { break; } } if(do_plural) { if(po.limit_implicit_multiplication) i = 1; else i--; if(CHILD(i).isUnit()) { CHILD(i).setPlural(true); } else { CHILD(i)[0].setPlural(true); } } } else if(SIZE > 0) { int last_unit = -1; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; if(CHILD(i).isUnit()) { CHILD(i).setPlural(false); if(!po.limit_implicit_multiplication || last_unit < 0) { last_unit = i; } } else if(CHILD(i).isPower() && CHILD(i)[0].isUnit()) { CHILD(i)[0].setPlural(false); if(!po.limit_implicit_multiplication || last_unit < 0) { last_unit = i; } } else if(last_unit >= 0) { break; } } if(po.short_multiplication && last_unit > 0) { if(CHILD(last_unit).isUnit()) { CHILD(last_unit).setPlural(true); } else { CHILD(last_unit)[0].setPlural(true); } } } break; } case STRUCT_POWER: { if(CHILD(0).isUnit()) { CHILD(0).setPlural(false); break; } } default: { for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; CHILD(i).postFormatUnits(po, this, i + 1); CHILD_UPDATED(i); } } } } bool MathStructure::factorizeUnits() { switch(m_type) { case STRUCT_ADDITION: { if(containsType(STRUCT_DATETIME, false, true, false) > 0) return false; bool b = false; MathStructure mstruct_units(*this); MathStructure mstruct_new(*this); for(size_t i = 0; i < mstruct_units.size(); i++) { if(CALCULATOR->aborted()) break; if(mstruct_units[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct_units[i].size();) { if(CALCULATOR->aborted()) break; if(!mstruct_units[i][i2].isUnit_exp()) { mstruct_units[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_units[i].size() == 0) mstruct_units[i].setUndefined(); else if(mstruct_units[i].size() == 1) mstruct_units[i].setToChild(1); for(size_t i2 = 0; i2 < mstruct_new[i].size();) { if(CALCULATOR->aborted()) break; if(mstruct_new[i][i2].isUnit_exp()) { mstruct_new[i].delChild(i2 + 1); } else { i2++; } } if(mstruct_new[i].size() == 0) mstruct_new[i].set(1, 1, 0); else if(mstruct_new[i].size() == 1) mstruct_new[i].setToChild(1); } else if(mstruct_units[i].isUnit_exp()) { mstruct_new[i].set(1, 1, 0); } else { mstruct_units[i].setUndefined(); } } for(size_t i = 0; i < mstruct_units.size(); i++) { if(CALCULATOR->aborted()) break; if(!mstruct_units[i].isUndefined()) { for(size_t i2 = i + 1; i2 < mstruct_units.size();) { if(mstruct_units[i2] == mstruct_units[i]) { mstruct_new[i].add(mstruct_new[i2], true); mstruct_new.delChild(i2 + 1); mstruct_units.delChild(i2 + 1); b = true; } else { i2++; } } if(mstruct_new[i].isOne()) mstruct_new[i].set(mstruct_units[i]); else mstruct_new[i].multiply(mstruct_units[i], true); } } if(b) { if(mstruct_new.size() == 1) set(mstruct_new[0], true); else set(mstruct_new, true); return true; } } default: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; if(CHILD(i).factorizeUnits()) { CHILD_UPDATED(i); b = true; } } return b; } } } void MathStructure::prefixCurrencies() { if(isMultiplication() && (!hasNegativeSign() || CALCULATOR->place_currency_code_before_negative)) { int index = -1; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; if(CHILD(i).isUnit_exp()) { if(CHILD(i).isUnit() && CHILD(i).unit()->isCurrency()) { if(index >= 0) { index = -1; break; } index = i; } else { index = -1; break; } } } if(index >= 0) { v_order.insert(v_order.begin(), v_order[index]); v_order.erase(v_order.begin() + (index + 1)); } } else { for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; CHILD(i).prefixCurrencies(); } } } void remove_multi_one(MathStructure &mstruct) { if(mstruct.isMultiplication() && mstruct.size() > 1) { if(mstruct[0].isOne() && !mstruct[1].isUnit_exp()) { if(mstruct.size() == 2) mstruct.setToChild(2, true); else mstruct.delChild(1); } } for(size_t i = 0; i < mstruct.size(); i++) { if(CALCULATOR->aborted()) break; remove_multi_one(mstruct[i]); } } bool unnegate_multiplier(MathStructure &mstruct, const PrintOptions &po) { if(mstruct.isMultiplication() && mstruct.size() >= 2 && mstruct[0].isNumber() && mstruct[0].number().isNegative()) { for(size_t i = 1; i < mstruct.size(); i++) { if(CALCULATOR->aborted()) break; if(mstruct[i].isAddition() || (mstruct[i].isPower() && mstruct[i][0].isAddition() && mstruct[i][1].isMinusOne())) { MathStructure *mden; if(mstruct[i].isAddition()) mden = &mstruct[i]; else mden = &mstruct[i][0]; bool b_pos = false, b_neg = false; for(size_t i2 = 0; i2 < mden->size(); i2++) { if((*mden)[i2].hasNegativeSign()) { b_neg = true; } else { b_pos = true; } if(b_neg && b_pos) break; } if(b_neg && b_pos) { for(size_t i2 = 0; i2 < mden->size(); i2++) { if((*mden)[i2].isNumber()) { (*mden)[i2].number().negate(); } else if((*mden)[i2].isMultiplication() && (*mden)[i2].size() > 0) { if((*mden)[i2][0].isNumber()) { if((*mden)[i2][0].number().isMinusOne() && (*mden)[i2].size() > 1) { if((*mden)[i2].size() == 2) (*mden)[i2].setToChild(2, true); else (*mden)[i2].delChild(1); } else (*mden)[i2][0].number().negate(); } else { (*mden)[i2].insertChild(m_minus_one, 1); } } else { (*mden)[i2].negate(); } } mden->sort(po, false); if(mstruct[0].number().isMinusOne()) { if(mstruct.size() == 2) mstruct.setToChild(2, true); else mstruct.delChild(1); } else { mstruct[0].number().negate(); } return true; } } } } bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(CALCULATOR->aborted()) break; if(unnegate_multiplier(mstruct[i], po)) { b = true; } } if(b) { mstruct.sort(po, false); return true; } return false; } void MathStructure::format(const PrintOptions &po) { if(!po.preserve_format) { if(po.place_units_separately) { factorizeUnits(); } sort(po); setPrefixes(po); unnegate_multiplier(*this, po); if(po.improve_division_multipliers) { if(improve_division_multipliers(po)) sort(po); } remove_multi_one(*this); } formatsub(po, NULL, 0, true, this); if(!po.preserve_format) { postFormatUnits(po); if(po.sort_options.prefix_currencies && po.abbreviate_names && CALCULATOR->place_currency_code_before) { prefixCurrencies(); } } } bool MathStructure::complexToExponentialForm(const EvaluationOptions &eo) { if(m_type == STRUCT_NUMBER && o_number.hasImaginaryPart()) { EvaluationOptions eo2 = eo; eo2.complex_number_form = COMPLEX_NUMBER_FORM_RECTANGULAR; MathStructure mabs(CALCULATOR->f_abs, this, NULL); MathStructure marg(CALCULATOR->f_arg, this, NULL); marg *= nr_one_i; marg.eval(eo2); set(CALCULATOR->v_e, true); raise(marg); mabs.eval(eo2); multiply(mabs); evalSort(false); return true; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).complexToExponentialForm(eo)) {b = true; CHILD_UPDATED(i);} } return b; } bool MathStructure::complexToPolarForm(const EvaluationOptions &eo) { if(m_type == STRUCT_NUMBER && o_number.hasImaginaryPart()) { MathStructure mabs(CALCULATOR->f_abs, this, NULL); MathStructure marg(CALCULATOR->f_arg, this, NULL); EvaluationOptions eo2 = eo; eo2.complex_number_form = COMPLEX_NUMBER_FORM_RECTANGULAR; mabs.eval(eo2); marg.eval(eo2); set(marg, true); transform(CALCULATOR->f_sin); multiply(nr_one_i); add_nocopy(new MathStructure(CALCULATOR->f_cos, &marg, NULL)); multiply(mabs); evalSort(true); return true; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).complexToPolarForm(eo)) {b = true; CHILD_UPDATED(i);} } return b; } void MathStructure::formatsub(const PrintOptions &po, MathStructure *parent, size_t pindex, bool recursive, MathStructure *top_parent) { if(recursive) { for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; if(i == 1 && m_type == STRUCT_POWER && po.number_fraction_format < FRACTION_FRACTIONAL && CHILD(1).isNumber() && CHILD(1).number().isRational() && !CHILD(1).number().isInteger() && CHILD(1).number().numeratorIsLessThan(10) && CHILD(1).number().numeratorIsGreaterThan(-10) && CHILD(1).number().denominatorIsLessThan(10)) { PrintOptions po2 = po; po2.number_fraction_format = FRACTION_FRACTIONAL; CHILD(i).formatsub(po2, this, i + 1, false, top_parent); } else { CHILD(i).formatsub(po, this, i + 1, true, top_parent); } CHILD_UPDATED(i); } } switch(m_type) { case STRUCT_ADDITION: { break; } case STRUCT_NEGATE: { break; } case STRUCT_DIVISION: { if(po.preserve_format) break; if(CHILD(0).isAddition() && CHILD(0).size() > 0 && CHILD(0)[0].isNegate()) { int imin = 1; for(size_t i = 1; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isNegate()) { imin++; } else { imin--; } } bool b = CHILD(1).isAddition() && CHILD(1).size() > 0 && CHILD(1)[0].isNegate(); if(b) { imin++; for(size_t i = 1; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isNegate()) { imin++; } else { imin--; } } } if(imin > 0 || (imin == 0 && parent && parent->isNegate())) { for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isNegate()) { CHILD(0)[i].setToChild(1, true); } else { CHILD(0)[i].transform(STRUCT_NEGATE); } } if(b) { for(size_t i = 0; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isNegate()) { CHILD(1)[i].setToChild(1, true); } else { CHILD(1)[i].transform(STRUCT_NEGATE); } } } else { transform(STRUCT_NEGATE); } break; } } else if(CHILD(1).isAddition() && CHILD(1).size() > 0 && CHILD(1)[0].isNegate()) { int imin = 1; for(size_t i = 1; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isNegate()) { imin++; } else { imin--; } } if(imin > 0 || (imin == 0 && parent && parent->isNegate())) { for(size_t i = 0; i < CHILD(1).size(); i++) { if(CHILD(1)[i].isNegate()) { CHILD(1)[i].setToChild(1, true); } else { CHILD(1)[i].transform(STRUCT_NEGATE); } } transform(STRUCT_NEGATE); } } break; } case STRUCT_INVERSE: { if(po.preserve_format) break; if((!parent || !parent->isMultiplication()) && CHILD(0).isAddition() && CHILD(0).size() > 0 && CHILD(0)[0].isNegate()) { int imin = 1; for(size_t i = 1; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isNegate()) { imin++; } else { imin--; } } if(imin > 0 || (imin == 0 && parent && parent->isNegate())) { for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isNegate()) { CHILD(0)[i].setToChild(1, true); } else { CHILD(0)[i].transform(STRUCT_NEGATE); } } transform(STRUCT_NEGATE); } } break; } case STRUCT_MULTIPLICATION: { if(po.preserve_format) break; if(CHILD(0).isNegate()) { if(CHILD(0)[0].isOne()) { ERASE(0); if(SIZE == 1) { setToChild(1, true); } } else { CHILD(0).setToChild(1, true); } transform(STRUCT_NEGATE); CHILD(0).formatsub(po, this, 1, false, top_parent); break; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) break; if(CHILD(i).isInverse()) { if(!po.negative_exponents || !CHILD(i)[0].isNumber()) { b = true; break; } } else if(CHILD(i).isDivision()) { if(!CHILD(i)[0].isNumber() || !CHILD(i)[1].isNumber() || (!po.negative_exponents && CHILD(i)[0].number().isOne())) { b = true; break; } } } if(b) { MathStructure *den = new MathStructure(); MathStructure *num = new MathStructure(); num->setUndefined(); short ds = 0, ns = 0; MathStructure *mnum = NULL, *mden = NULL; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isInverse()) { mden = &CHILD(i)[0]; } else if(CHILD(i).isDivision()) { mnum = &CHILD(i)[0]; mden = &CHILD(i)[1]; } else { mnum = &CHILD(i); } if(mnum && !mnum->isOne()) { if(ns > 0) { if(mnum->isMultiplication() && num->isNumber()) { for(size_t i2 = 0; i2 < mnum->size(); i2++) { num->multiply((*mnum)[i2], true); } } else { num->multiply(*mnum, ns > 1); } } else { num->set(*mnum); } ns++; mnum = NULL; } if(mden) { if(ds > 0) { if(mden->isMultiplication() && den->isNumber()) { for(size_t i2 = 0; i2 < mden->size(); i2++) { den->multiply((*mden)[i2], true); } } else { den->multiply(*mden, ds > 1); } } else { den->set(*mden); } ds++; mden = NULL; } } clear(true); m_type = STRUCT_DIVISION; if(num->isUndefined()) num->set(m_one); APPEND_POINTER(num); APPEND_POINTER(den); num->formatsub(po, this, 1, false, top_parent); den->formatsub(po, this, 2, false, top_parent); formatsub(po, parent, pindex, false, top_parent); break; } size_t index = 0; if(CHILD(0).isOne()) { index = 1; } switch(CHILD(index).type()) { case STRUCT_POWER: { if(!CHILD(index)[0].isUnit_exp()) { break; } } case STRUCT_UNIT: { if(index == 0) { if(!parent || (!parent->isPower() && !parent->isMultiplication() && !parent->isInverse() && (!parent->isDivision() || pindex != 2))) { PREPEND(m_one); } } break; } default: { if(index == 1) { ERASE(0); if(SIZE == 1) { setToChild(1, true); } } } } break; } case STRUCT_UNIT: { if(po.preserve_format) break; if(!parent || (!parent->isPower() && !parent->isMultiplication() && !parent->isInverse() && !(parent->isDivision() && pindex == 2))) { multiply(m_one); SWAP_CHILDREN(0, 1); } break; } case STRUCT_POWER: { if(po.preserve_format) break; if(!po.negative_exponents && CHILD(1).isNegate() && (!CHILD(0).isVector() || !CHILD(1).isMinusOne())) { if(CHILD(1)[0].isOne()) { m_type = STRUCT_INVERSE; ERASE(1); } else { CHILD(1).setToChild(1, true); transform(STRUCT_INVERSE); } formatsub(po, parent, pindex, true, top_parent); break; } else if(po.halfexp_to_sqrt && ((CHILD(1).isDivision() && CHILD(1)[0].isNumber() && CHILD(1)[0].number().isInteger() && CHILD(1)[1].isNumber() && CHILD(1)[1].number().isTwo() && ((!po.negative_exponents && (CHILD(0).countChildren() == 0 || CHILD(0).isFunction())) || CHILD(1)[0].isOne())) || (CHILD(1).isNumber() && CHILD(1).number().denominatorIsTwo() && ((!po.negative_exponents && (CHILD(0).countChildren() == 0 || CHILD(0).isFunction())) || CHILD(1).number().numeratorIsOne())) || (CHILD(1).isInverse() && CHILD(1)[0].isNumber() && CHILD(1)[0].number() == 2))) { if(CHILD(1).isInverse() || (CHILD(1).isDivision() && CHILD(1)[0].number().isOne()) || (CHILD(1).isNumber() && CHILD(1).number().numeratorIsOne())) { m_type = STRUCT_FUNCTION; ERASE(1) setFunction(CALCULATOR->f_sqrt); } else { if(CHILD(1).isNumber()) { CHILD(1).number() -= nr_half; } else { Number nr = CHILD(1)[0].number(); nr /= CHILD(1)[1].number(); nr.floor(); CHILD(1).set(nr); } if(CHILD(1).number().isOne()) { setToChild(1, true); if(parent && parent->isMultiplication()) { parent->insertChild(MathStructure(CALCULATOR->f_sqrt, this, NULL), pindex + 1); } else { multiply(MathStructure(CALCULATOR->f_sqrt, this, NULL)); } } else { if(parent && parent->isMultiplication()) { parent->insertChild(MathStructure(CALCULATOR->f_sqrt, &CHILD(0), NULL), pindex + 1); } else { multiply(MathStructure(CALCULATOR->f_sqrt, &CHILD(0), NULL)); } } } formatsub(po, parent, pindex, false, top_parent); break; } else if(po.exp_to_root && CHILD(0).representsNonNegative(true) && ((CHILD(1).isDivision() && CHILD(1)[0].isNumber() && CHILD(1)[0].number().isInteger() && CHILD(1)[1].isNumber() && CHILD(1)[1].number().isGreaterThan(1) && CHILD(1)[1].number().isLessThan(10) && ((!po.negative_exponents && (CHILD(0).countChildren() == 0 || CHILD(0).isFunction())) || CHILD(1)[0].isOne())) || (CHILD(1).isNumber() && CHILD(1).number().isRational() && !CHILD(1).number().isInteger() && CHILD(1).number().denominatorIsLessThan(10) && ((!po.negative_exponents && (CHILD(0).countChildren() == 0 || CHILD(0).isFunction())) || CHILD(1).number().numeratorIsOne())) || (CHILD(1).isInverse() && CHILD(1)[0].isNumber() && CHILD(1)[0].number().isInteger() && CHILD(1)[0].number().isPositive() && CHILD(1)[0].number().isLessThan(10)))) { Number nr_int, nr_num, nr_den; if(CHILD(1).isNumber()) { nr_num = CHILD(1).number().numerator(); nr_den = CHILD(1).number().denominator(); } else if(CHILD(1).isDivision()) { nr_num.set(CHILD(1)[0].number()); nr_den.set(CHILD(1)[1].number()); } else if(CHILD(1).isInverse()) { nr_num.set(1, 1, 0); nr_den.set(CHILD(1)[0].number()); } if(!nr_num.isOne() && (nr_num - 1).isIntegerDivisible(nr_den)) { nr_int = nr_num; nr_int--; nr_int.divide(nr_den); nr_num = 1; } MathStructure mbase(CHILD(0)); CHILD(1) = nr_den; m_type = STRUCT_FUNCTION; setFunction(CALCULATOR->f_root); formatsub(po, parent, pindex, false, top_parent); if(!nr_num.isOne()) { raise(nr_num); formatsub(po, parent, pindex, false, top_parent); } if(!nr_int.isZero()) { if(!nr_int.isOne()) mbase.raise(nr_int); multiply(mbase); sort(po); formatsub(po, parent, pindex, false, top_parent); } break; } if(CHILD(0).isUnit_exp() && (!parent || (!parent->isPower() && !parent->isMultiplication() && !parent->isInverse() && !(parent->isDivision() && pindex == 2)))) { multiply(m_one); SWAP_CHILDREN(0, 1); } break; } case STRUCT_FUNCTION: { if(po.preserve_format) break; if(o_function == CALCULATOR->f_root && SIZE == 2 && CHILD(1) == 3) { ERASE(1) setFunction(CALCULATOR->f_cbrt); } break; } case STRUCT_VARIABLE: { if(o_variable == CALCULATOR->v_pinf || o_variable == CALCULATOR->v_minf) { set(((KnownVariable*) o_variable)->get()); } break; } case STRUCT_NUMBER: { if(o_number.isNegative() || ((parent || po.interval_display != INTERVAL_DISPLAY_SIGNIFICANT_DIGITS) && o_number.isInterval() && o_number.isNonPositive())) { if((po.base != 2 || !po.twos_complement || !o_number.isInteger()) && (!o_number.isMinusInfinity() || (parent && parent->isAddition()))) { o_number.negate(); transform(STRUCT_NEGATE); formatsub(po, parent, pindex, true, top_parent); } } else if(po.number_fraction_format == FRACTION_COMBINED && po.base != BASE_SEXAGESIMAL && po.base != BASE_TIME && o_number.isRational() && !o_number.isInteger()) { if(o_number.isFraction()) { Number num(o_number.numerator()); Number den(o_number.denominator()); clear(true); if(num.isOne()) { m_type = STRUCT_INVERSE; } else { m_type = STRUCT_DIVISION; APPEND_NEW(num); } APPEND_NEW(den); } else { Number frac(o_number); frac.frac(); MathStructure *num = new MathStructure(frac.numerator()); num->transform(STRUCT_DIVISION, frac.denominator()); o_number.trunc(); add_nocopy(num); } } else if((po.number_fraction_format == FRACTION_FRACTIONAL || po.base == BASE_ROMAN_NUMERALS || po.number_fraction_format == FRACTION_DECIMAL_EXACT) && po.base != BASE_SEXAGESIMAL && po.base != BASE_TIME && o_number.isRational() && !o_number.isInteger() && !o_number.isApproximate()) { InternalPrintStruct ips_n; if(isApproximate() || (top_parent && top_parent->isApproximate())) ips_n.parent_approximate = true; ips_n.parent_precision = precision(); if(top_parent && top_parent->precision() < 0 && top_parent->precision() < ips_n.parent_precision) ips_n.parent_precision = top_parent->precision(); Number num(o_number.numerator()); Number den(o_number.denominator()); if(isApproximate()) { num.setApproximate(); den.setApproximate(); } bool approximately_displayed = false; PrintOptions po2 = po; po2.is_approximate = &approximately_displayed; num.print(po2, ips_n); if(!approximately_displayed || po.base == BASE_ROMAN_NUMERALS) { den.print(po2, ips_n); if(!approximately_displayed || po.base == BASE_ROMAN_NUMERALS) { clear(true); if(num.isOne()) { m_type = STRUCT_INVERSE; } else { m_type = STRUCT_DIVISION; APPEND_NEW(num); } APPEND_NEW(den); } } } else if(o_number.hasImaginaryPart()) { if(o_number.hasRealPart()) { Number re(o_number.realPart()); Number im(o_number.imaginaryPart()); MathStructure *mstruct = new MathStructure(im); if(im.isOne()) { mstruct->set(CALCULATOR->v_i); } else { mstruct->multiply_nocopy(new MathStructure(CALCULATOR->v_i)); } o_number = re; add_nocopy(mstruct); formatsub(po, parent, pindex, true, top_parent); } else { Number im(o_number.imaginaryPart()); if(im.isOne()) { set(CALCULATOR->v_i, true); } else if(im.isMinusOne()) { set(CALCULATOR->v_i, true); transform(STRUCT_NEGATE); } else { o_number = im; multiply_nocopy(new MathStructure(CALCULATOR->v_i)); } formatsub(po, parent, pindex, true, top_parent); } } break; } default: {} } } int namelen(const MathStructure &mstruct, const PrintOptions &po, const InternalPrintStruct&, bool *abbreviated = NULL) { const string *str; switch(mstruct.type()) { case STRUCT_FUNCTION: { const ExpressionName *ename = &mstruct.function()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); str = &ename->name; if(abbreviated) *abbreviated = ename->abbreviation; break; } case STRUCT_VARIABLE: { const ExpressionName *ename = &mstruct.variable()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); str = &ename->name; if(abbreviated) *abbreviated = ename->abbreviation; break; } case STRUCT_ABORTED: {} case STRUCT_SYMBOLIC: { str = &mstruct.symbol(); if(abbreviated) *abbreviated = false; break; } case STRUCT_UNIT: { const ExpressionName *ename = &mstruct.unit()->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, mstruct.isPlural(), po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); str = &ename->name; if(abbreviated) *abbreviated = ename->abbreviation; break; } default: {if(abbreviated) *abbreviated = false; return 0;} } if(text_length_is_one(*str)) return 1; return str->length(); } bool MathStructure::needsParenthesis(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool flat_division, bool) const { switch(parent.type()) { case STRUCT_MULTIPLICATION: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return flat_division && (index < parent.size() || po.excessive_parenthesis);} case STRUCT_INVERSE: {return flat_division;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return po.excessive_parenthesis;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return po.excessive_parenthesis;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return o_number.isInfinite() || (o_number.hasImaginaryPart() && o_number.hasRealPart());} case STRUCT_VARIABLE: {return false;} case STRUCT_ABORTED: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return po.excessive_parenthesis;} case STRUCT_DATETIME: {return false;} default: {return true;} } } case STRUCT_INVERSE: {} case STRUCT_DIVISION: { switch(m_type) { case STRUCT_MULTIPLICATION: {return flat_division || po.excessive_parenthesis;} case STRUCT_DIVISION: {return flat_division || po.excessive_parenthesis;} case STRUCT_INVERSE: {return flat_division || po.excessive_parenthesis;} case STRUCT_ADDITION: {return flat_division || po.excessive_parenthesis;} case STRUCT_POWER: {return flat_division && po.excessive_parenthesis;} case STRUCT_NEGATE: {return flat_division && po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return flat_division || po.excessive_parenthesis;} case STRUCT_BITWISE_OR: {return flat_division || po.excessive_parenthesis;} case STRUCT_BITWISE_XOR: {return flat_division || po.excessive_parenthesis;} case STRUCT_BITWISE_NOT: {return flat_division && po.excessive_parenthesis;} case STRUCT_LOGICAL_AND: {return flat_division || po.excessive_parenthesis;} case STRUCT_LOGICAL_OR: {return flat_division || po.excessive_parenthesis;} case STRUCT_LOGICAL_XOR: {return flat_division || po.excessive_parenthesis;} case STRUCT_LOGICAL_NOT: {return flat_division && po.excessive_parenthesis;} case STRUCT_COMPARISON: {return flat_division || po.excessive_parenthesis;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return (flat_division || po.excessive_parenthesis) && (o_number.isInfinite() || o_number.hasImaginaryPart());} case STRUCT_VARIABLE: {return false;} case STRUCT_ABORTED: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} case STRUCT_DATETIME: {return false;} default: {return true;} } } case STRUCT_ADDITION: { switch(m_type) { case STRUCT_MULTIPLICATION: {return po.excessive_parenthesis;} case STRUCT_DIVISION: {return flat_division && po.excessive_parenthesis;} case STRUCT_INVERSE: {return flat_division && po.excessive_parenthesis;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return index > 1 || po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return false;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return false;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return o_number.isInfinite();} case STRUCT_VARIABLE: {return false;} case STRUCT_ABORTED: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} case STRUCT_DATETIME: {return false;} default: {return true;} } } case STRUCT_POWER: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return index == 1 || flat_division || po.excessive_parenthesis;} case STRUCT_INVERSE: {return index == 1 || flat_division || po.excessive_parenthesis;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return true;} case STRUCT_NEGATE: {return index == 1 || CHILD(0).needsParenthesis(po, ips, parent, index, flat_division);} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return index == 1 || po.excessive_parenthesis;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return index == 1 || po.excessive_parenthesis;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return o_number.isInfinite() || o_number.hasImaginaryPart();} case STRUCT_VARIABLE: {return false;} case STRUCT_ABORTED: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_NEGATE: { switch(m_type) { case STRUCT_MULTIPLICATION: {return po.excessive_parenthesis;} case STRUCT_DIVISION: {return po.excessive_parenthesis;} case STRUCT_INVERSE: {return flat_division && po.excessive_parenthesis;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return true;} case STRUCT_NEGATE: {return true;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return po.excessive_parenthesis;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return po.excessive_parenthesis;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return o_number.isInfinite() || (o_number.hasImaginaryPart() && o_number.hasRealPart());} case STRUCT_VARIABLE: {return false;} case STRUCT_ABORTED: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_AND: {} case STRUCT_LOGICAL_XOR: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return flat_division;} case STRUCT_INVERSE: {return flat_division;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return false;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return false;} case STRUCT_COMPARISON: {return false;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return po.excessive_parenthesis && o_number.isInfinite();} case STRUCT_VARIABLE: {return false;} case STRUCT_ABORTED: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} case STRUCT_DATETIME: {return false;} default: {return true;} } } case STRUCT_BITWISE_AND: {} case STRUCT_BITWISE_OR: {} case STRUCT_BITWISE_XOR: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return flat_division;} case STRUCT_INVERSE: {return flat_division;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return false;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return false;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return po.excessive_parenthesis && o_number.isInfinite();} case STRUCT_VARIABLE: {return false;} case STRUCT_ABORTED: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} default: {return true;} } } case STRUCT_COMPARISON: { switch(m_type) { case STRUCT_MULTIPLICATION: {return po.excessive_parenthesis;} case STRUCT_DIVISION: {return flat_division && po.excessive_parenthesis;} case STRUCT_INVERSE: {return flat_division && po.excessive_parenthesis;} case STRUCT_ADDITION: {return po.excessive_parenthesis;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return false;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return false;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return false;} case STRUCT_VECTOR: {return false;} case STRUCT_NUMBER: {return po.excessive_parenthesis && o_number.isInfinite();} case STRUCT_VARIABLE: {return false;} case STRUCT_ABORTED: {return false;} case STRUCT_SYMBOLIC: {return false;} case STRUCT_UNIT: {return false;} case STRUCT_UNDEFINED: {return false;} case STRUCT_DATETIME: {return false;} default: {return true;} } } case STRUCT_LOGICAL_NOT: {} case STRUCT_BITWISE_NOT: { switch(m_type) { case STRUCT_MULTIPLICATION: {return true;} case STRUCT_DIVISION: {return true;} case STRUCT_INVERSE: {return true;} case STRUCT_ADDITION: {return true;} case STRUCT_POWER: {return po.excessive_parenthesis;} case STRUCT_NEGATE: {return po.excessive_parenthesis;} case STRUCT_BITWISE_AND: {return true;} case STRUCT_BITWISE_OR: {return true;} case STRUCT_BITWISE_XOR: {return true;} case STRUCT_BITWISE_NOT: {return true;} case STRUCT_LOGICAL_AND: {return true;} case STRUCT_LOGICAL_OR: {return true;} case STRUCT_LOGICAL_XOR: {return true;} case STRUCT_LOGICAL_NOT: {return true;} case STRUCT_COMPARISON: {return true;} case STRUCT_FUNCTION: {return po.excessive_parenthesis;} case STRUCT_VECTOR: {return po.excessive_parenthesis;} case STRUCT_NUMBER: {return po.excessive_parenthesis;} case STRUCT_VARIABLE: {return po.excessive_parenthesis;} case STRUCT_ABORTED: {return po.excessive_parenthesis;} case STRUCT_SYMBOLIC: {return po.excessive_parenthesis;} case STRUCT_UNIT: {return po.excessive_parenthesis;} case STRUCT_UNDEFINED: {return po.excessive_parenthesis;} default: {return true;} } } case STRUCT_FUNCTION: { return false; } case STRUCT_VECTOR: { return false; } default: { return true; } } } int MathStructure::neededMultiplicationSign(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool par, bool par_prev, bool flat_division, bool flat_power) const { if(!po.short_multiplication) return MULTIPLICATION_SIGN_OPERATOR; if(index <= 1) return MULTIPLICATION_SIGN_NONE; if(par_prev && par) return MULTIPLICATION_SIGN_NONE; if(par_prev) { if(isUnit_exp()) return MULTIPLICATION_SIGN_SPACE; if(isUnknown_exp()) { if(isSymbolic() || (isPower() && CHILD(0).isSymbolic())) return MULTIPLICATION_SIGN_SPACE; return (namelen(isPower() ? CHILD(0) : *this, po, ips, NULL) > 1 ? MULTIPLICATION_SIGN_SPACE : MULTIPLICATION_SIGN_NONE); } if(isMultiplication() && SIZE > 0) { if(CHILD(0).isUnit_exp()) return MULTIPLICATION_SIGN_SPACE; if(CHILD(0).isUnknown_exp()) { if(CHILD(0).isSymbolic() || (CHILD(0).isPower() && CHILD(0)[0].isSymbolic())) return MULTIPLICATION_SIGN_SPACE; return (namelen(CHILD(0).isPower() ? CHILD(0)[0] : CHILD(0), po, ips, NULL) > 1 ? MULTIPLICATION_SIGN_SPACE : MULTIPLICATION_SIGN_NONE); } } else if(isDivision()) { for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).isUnit_exp()) { return MULTIPLICATION_SIGN_OPERATOR; } } return MULTIPLICATION_SIGN_SPACE; } return MULTIPLICATION_SIGN_OPERATOR; } int t = parent[index - 2].type(); if(flat_power && t == STRUCT_POWER) return MULTIPLICATION_SIGN_OPERATOR; if(par && t == STRUCT_POWER) return MULTIPLICATION_SIGN_SPACE; if(par) return MULTIPLICATION_SIGN_NONE; bool abbr_prev = false, abbr_this = false; int namelen_this = namelen(*this, po, ips, &abbr_this); int namelen_prev = namelen(parent[index - 2], po, ips, &abbr_prev); switch(t) { case STRUCT_MULTIPLICATION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_INVERSE: {} case STRUCT_DIVISION: {if(flat_division) return MULTIPLICATION_SIGN_OPERATOR; return MULTIPLICATION_SIGN_SPACE;} case STRUCT_ADDITION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_POWER: {if(flat_power) return MULTIPLICATION_SIGN_OPERATOR; break;} case STRUCT_NEGATE: {break;} case STRUCT_BITWISE_AND: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_OR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_XOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_NOT: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_AND: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_OR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_XOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_NOT: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_COMPARISON: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_FUNCTION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_VECTOR: {break;} case STRUCT_NUMBER: {break;} case STRUCT_VARIABLE: {break;} case STRUCT_ABORTED: {break;} case STRUCT_SYMBOLIC: {break;} case STRUCT_UNIT: { if(m_type == STRUCT_UNIT) { if(!po.limit_implicit_multiplication && !abbr_prev && !abbr_this) { return MULTIPLICATION_SIGN_SPACE; } if(po.place_units_separately) { return MULTIPLICATION_SIGN_OPERATOR_SHORT; } else { return MULTIPLICATION_SIGN_OPERATOR; } } else if(m_type == STRUCT_NUMBER) { if(namelen_prev > 1) { return MULTIPLICATION_SIGN_SPACE; } else { return MULTIPLICATION_SIGN_NONE; } } //return MULTIPLICATION_SIGN_SPACE; } case STRUCT_UNDEFINED: {break;} default: {return MULTIPLICATION_SIGN_OPERATOR;} } switch(m_type) { case STRUCT_MULTIPLICATION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_INVERSE: {} case STRUCT_DIVISION: {return MULTIPLICATION_SIGN_SPACE;} case STRUCT_ADDITION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_POWER: {return CHILD(0).neededMultiplicationSign(po, ips, parent, index, par, par_prev, flat_division, flat_power);} case STRUCT_NEGATE: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_AND: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_OR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_XOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_BITWISE_NOT: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_AND: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_OR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_XOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_LOGICAL_NOT: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_COMPARISON: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_FUNCTION: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_VECTOR: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_NUMBER: {return MULTIPLICATION_SIGN_OPERATOR;} case STRUCT_ABORTED: {} case STRUCT_VARIABLE: {} case STRUCT_SYMBOLIC: { if(po.limit_implicit_multiplication && t != STRUCT_NUMBER) return MULTIPLICATION_SIGN_OPERATOR; if(t != STRUCT_NUMBER && ((namelen_prev > 1 || namelen_this > 1) || equals(parent[index - 2]))) return MULTIPLICATION_SIGN_OPERATOR; if(namelen_this > 1 || (m_type == STRUCT_SYMBOLIC && !po.allow_non_usable)) return MULTIPLICATION_SIGN_SPACE; return MULTIPLICATION_SIGN_NONE; } case STRUCT_UNIT: { if(t == STRUCT_POWER && parent[index - 2][0].isUnit_exp()) { return MULTIPLICATION_SIGN_NONE; } return MULTIPLICATION_SIGN_SPACE; } case STRUCT_UNDEFINED: {return MULTIPLICATION_SIGN_OPERATOR;} default: {return MULTIPLICATION_SIGN_OPERATOR;} } } ostream& operator << (ostream &os, const MathStructure &mstruct) { os << format_and_print(mstruct); return os; } string MathStructure::print(const PrintOptions &po, const InternalPrintStruct &ips) const { if(ips.depth == 0 && po.is_approximate) *po.is_approximate = false; string print_str; InternalPrintStruct ips_n = ips; if(isApproximate()) ips_n.parent_approximate = true; if(precision() >= 0 && (ips_n.parent_precision < 0 || precision() < ips_n.parent_precision)) ips_n.parent_precision = precision(); switch(m_type) { case STRUCT_NUMBER: { print_str = o_number.print(po, ips_n); break; } case STRUCT_ABORTED: {} case STRUCT_SYMBOLIC: { if(po.allow_non_usable) { print_str = s_sym; } else { if((text_length_is_one(s_sym) && s_sym.find("\'") == string::npos) || s_sym.find("\"") != string::npos) { print_str = "\'"; print_str += s_sym; print_str += "\'"; } else { print_str = "\""; print_str += s_sym; print_str += "\""; } } break; } case STRUCT_DATETIME: { print_str = "\""; print_str += o_datetime->print(po); print_str += "\""; break; } case STRUCT_ADDITION: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(i > 0) { if(CHILD(i).type() == STRUCT_NEGATE) { if(po.spacious) print_str += " "; if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MINUS, po.can_display_unicode_string_arg))) print_str += SIGN_MINUS; else print_str += "-"; if(po.spacious) print_str += " "; ips_n.wrap = CHILD(i)[0].needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i)[0].print(po, ips_n); } else { if(po.spacious) print_str += " "; print_str += "+"; if(po.spacious) print_str += " "; ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } } else { ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } } break; } case STRUCT_NEGATE: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MINUS, po.can_display_unicode_string_arg))) print_str += SIGN_MINUS; else print_str = "-"; ips_n.depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str += CHILD(0).print(po, ips_n); break; } case STRUCT_MULTIPLICATION: { ips_n.depth++; bool par_prev = false; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); if(!po.short_multiplication && i > 0) { if(po.spacious) print_str += " "; if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIDOT, po.can_display_unicode_string_arg))) print_str += SIGN_MULTIDOT; else if(po.use_unicode_signs && (po.multiplication_sign == MULTIPLICATION_SIGN_DOT || po.multiplication_sign == MULTIPLICATION_SIGN_ALTDOT) && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MIDDLEDOT, po.can_display_unicode_string_arg))) print_str += SIGN_MIDDLEDOT; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_X && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIPLICATION, po.can_display_unicode_string_arg))) print_str += SIGN_MULTIPLICATION; else print_str += "*"; if(po.spacious) print_str += " "; } else if(i > 0) { switch(CHILD(i).neededMultiplicationSign(po, ips_n, *this, i + 1, ips_n.wrap || (CHILD(i).isPower() && CHILD(i)[0].needsParenthesis(po, ips_n, CHILD(i), 1, true, true)), par_prev, true, true)) { case MULTIPLICATION_SIGN_SPACE: {print_str += " "; break;} case MULTIPLICATION_SIGN_OPERATOR: { if(po.spacious) { if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIDOT, po.can_display_unicode_string_arg))) print_str += " " SIGN_MULTIDOT " "; else if(po.use_unicode_signs && (po.multiplication_sign == MULTIPLICATION_SIGN_DOT || po.multiplication_sign == MULTIPLICATION_SIGN_ALTDOT) && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MIDDLEDOT, po.can_display_unicode_string_arg))) print_str += " " SIGN_MIDDLEDOT " "; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_X && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIPLICATION, po.can_display_unicode_string_arg))) print_str += " " SIGN_MULTIPLICATION " "; else print_str += " * "; break; } } case MULTIPLICATION_SIGN_OPERATOR_SHORT: { if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_DOT && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIDOT, po.can_display_unicode_string_arg))) print_str += SIGN_MULTIDOT; else if(po.use_unicode_signs && (po.multiplication_sign == MULTIPLICATION_SIGN_DOT || po.multiplication_sign == MULTIPLICATION_SIGN_ALTDOT) && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MIDDLEDOT, po.can_display_unicode_string_arg))) print_str += SIGN_MIDDLEDOT; else if(po.use_unicode_signs && po.multiplication_sign == MULTIPLICATION_SIGN_X && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_MULTIPLICATION, po.can_display_unicode_string_arg))) print_str += SIGN_MULTIPLICATION; else print_str += "*"; break; } } } print_str += CHILD(i).print(po, ips_n); par_prev = ips_n.wrap; } break; } case STRUCT_INVERSE: { print_str = "1"; if(po.spacious) print_str += " "; if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION, po.can_display_unicode_string_arg))) { print_str += SIGN_DIVISION; } else if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION_SLASH && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION_SLASH, po.can_display_unicode_string_arg))) { print_str += SIGN_DIVISION_SLASH; } else { print_str += "/"; } if(po.spacious) print_str += " "; ips_n.depth++; ips_n.division_depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str += CHILD(0).print(po, ips_n); break; } case STRUCT_DIVISION: { ips_n.depth++; ips_n.division_depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str = CHILD(0).print(po, ips_n); if(po.spacious) print_str += " "; if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION, po.can_display_unicode_string_arg))) { print_str += SIGN_DIVISION; } else if(po.use_unicode_signs && po.division_sign == DIVISION_SIGN_DIVISION_SLASH && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_DIVISION_SLASH, po.can_display_unicode_string_arg))) { print_str += SIGN_DIVISION_SLASH; } else { print_str += "/"; } if(po.spacious) print_str += " "; ips_n.wrap = CHILD(1).needsParenthesis(po, ips_n, *this, 2, true, true); print_str += CHILD(1).print(po, ips_n); break; } case STRUCT_POWER: { ips_n.depth++; ips_n.power_depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str = CHILD(0).print(po, ips_n); print_str += "^"; ips_n.wrap = CHILD(1).needsParenthesis(po, ips_n, *this, 2, true, true); PrintOptions po2 = po; po2.show_ending_zeroes = false; print_str += CHILD(1).print(po2, ips_n); break; } case STRUCT_COMPARISON: { ips_n.depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str = CHILD(0).print(po, ips_n); if(po.spacious) print_str += " "; switch(ct_comp) { case COMPARISON_EQUALS: { if(po.use_unicode_signs && po.interval_display != INTERVAL_DISPLAY_INTERVAL && isApproximate() && containsInterval() && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_ALMOST_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_ALMOST_EQUAL; else print_str += "="; break; } case COMPARISON_NOT_EQUALS: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_NOT_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_NOT_EQUAL; else print_str += "!="; break; } case COMPARISON_GREATER: {print_str += ">"; break;} case COMPARISON_LESS: {print_str += "<"; break;} case COMPARISON_EQUALS_GREATER: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_GREATER_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_GREATER_OR_EQUAL; else print_str += ">="; break; } case COMPARISON_EQUALS_LESS: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_LESS_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_LESS_OR_EQUAL; else print_str += "<="; break; } } if(po.spacious) print_str += " "; ips_n.wrap = CHILD(1).needsParenthesis(po, ips_n, *this, 2, true, true); print_str += CHILD(1).print(po, ips_n); break; } case STRUCT_BITWISE_AND: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(i > 0) { if(po.spacious) print_str += " "; print_str += "&"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_BITWISE_OR: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(i > 0) { if(po.spacious) print_str += " "; print_str += "|"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_BITWISE_XOR: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(i > 0) { if(po.spacious) print_str += " "; print_str += "XOR"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_BITWISE_NOT: { print_str = "~"; ips_n.depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str += CHILD(0).print(po, ips_n); break; } case STRUCT_LOGICAL_AND: { ips_n.depth++; if(!po.preserve_format && SIZE == 2 && CHILD(0).isComparison() && CHILD(1).isComparison() && CHILD(0).comparisonType() != COMPARISON_EQUALS && CHILD(0).comparisonType() != COMPARISON_NOT_EQUALS && CHILD(1).comparisonType() != COMPARISON_EQUALS && CHILD(1).comparisonType() != COMPARISON_NOT_EQUALS && CHILD(0)[0] == CHILD(1)[0]) { ips_n.wrap = CHILD(0)[1].needsParenthesis(po, ips_n, CHILD(0), 2, true, true); print_str += CHILD(0)[1].print(po, ips_n); if(po.spacious) print_str += " "; switch(CHILD(0).comparisonType()) { case COMPARISON_LESS: {print_str += ">"; break;} case COMPARISON_GREATER: {print_str += "<"; break;} case COMPARISON_EQUALS_LESS: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_GREATER_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_GREATER_OR_EQUAL; else print_str += ">="; break; } case COMPARISON_EQUALS_GREATER: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_LESS_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_LESS_OR_EQUAL; else print_str += "<="; break; } default: {} } if(po.spacious) print_str += " "; ips_n.wrap = CHILD(0)[0].needsParenthesis(po, ips_n, CHILD(0), 1, true, true); print_str += CHILD(0)[0].print(po, ips_n); if(po.spacious) print_str += " "; switch(CHILD(1).comparisonType()) { case COMPARISON_GREATER: {print_str += ">"; break;} case COMPARISON_LESS: {print_str += "<"; break;} case COMPARISON_EQUALS_GREATER: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_GREATER_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_GREATER_OR_EQUAL; else print_str += ">="; break; } case COMPARISON_EQUALS_LESS: { if(po.use_unicode_signs && (!po.can_display_unicode_string_function || (*po.can_display_unicode_string_function) (SIGN_LESS_OR_EQUAL, po.can_display_unicode_string_arg))) print_str += SIGN_LESS_OR_EQUAL; else print_str += "<="; break; } default: {} } if(po.spacious) print_str += " "; ips_n.wrap = CHILD(1)[1].needsParenthesis(po, ips_n, CHILD(1), 2, true, true); print_str += CHILD(1)[1].print(po, ips_n); break; } for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(i > 0) { if(po.spacious) print_str += " "; if(po.spell_out_logical_operators) print_str += _("and"); else print_str += "&&"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_LOGICAL_OR: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(i > 0) { if(po.spacious) print_str += " "; if(po.spell_out_logical_operators) print_str += _("or"); else print_str += "||"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_LOGICAL_XOR: { ips_n.depth++; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(i > 0) { if(po.spacious) print_str += " "; print_str += "XOR"; if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } break; } case STRUCT_LOGICAL_NOT: { print_str = "!"; ips_n.depth++; ips_n.wrap = CHILD(0).needsParenthesis(po, ips_n, *this, 1, true, true); print_str += CHILD(0).print(po, ips_n); break; } case STRUCT_VECTOR: { ips_n.depth++; print_str = "["; for(size_t i = 0; i < SIZE; i++) { if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(i > 0) { print_str += po.comma(); if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } print_str += "]"; break; } case STRUCT_UNIT: { const ExpressionName *ename = &o_unit->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, b_plural, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); if(o_prefix) print_str += o_prefix->name(po.abbreviate_names && ename->abbreviation, po.use_unicode_signs, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); print_str += ename->name; if(po.hide_underscore_spaces && !ename->suffix) { gsub("_", " ", print_str); } break; } case STRUCT_VARIABLE: { const ExpressionName *ename = &o_variable->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); print_str += ename->name; if(po.hide_underscore_spaces && !ename->suffix) { gsub("_", " ", print_str); } break; } case STRUCT_FUNCTION: { ips_n.depth++; const ExpressionName *ename = &o_function->preferredDisplayName(po.abbreviate_names, po.use_unicode_signs, false, po.use_reference_names, po.can_display_unicode_string_function, po.can_display_unicode_string_arg); print_str += ename->name; if(po.hide_underscore_spaces && !ename->suffix) { gsub("_", " ", print_str); } print_str += "("; for(size_t i = 0; i < SIZE; i++) { if(i == 1 && (o_function == CALCULATOR->f_signum || o_function == CALCULATOR->f_lambert_w) && CHILD(1).isZero()) break; if(CALCULATOR->aborted()) return CALCULATOR->abortedMessage(); if(i > 0) { print_str += po.comma(); if(po.spacious) print_str += " "; } ips_n.wrap = CHILD(i).needsParenthesis(po, ips_n, *this, i + 1, true, true); print_str += CHILD(i).print(po, ips_n); } print_str += ")"; break; } case STRUCT_UNDEFINED: { print_str = _("undefined"); break; } } if(CALCULATOR->aborted()) print_str = CALCULATOR->abortedMessage(); if(ips.wrap) { print_str.insert(0, "("); print_str += ")"; } return print_str; } MathStructure &MathStructure::flattenVector(MathStructure &mstruct) const { if(!isVector()) { mstruct = *this; return mstruct; } MathStructure mstruct2; mstruct.clearVector(); for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isVector()) { CHILD(i).flattenVector(mstruct2); for(size_t i2 = 0; i2 < mstruct2.size(); i2++) { mstruct.addChild(mstruct2[i2]); } } else { mstruct.addChild(CHILD(i)); } } return mstruct; } bool MathStructure::rankVector(bool ascending) { vector ranked; vector ranked_equals_prev; bool b; for(size_t index = 0; index < SIZE; index++) { b = false; for(size_t i = 0; i < ranked.size(); i++) { if(CALCULATOR->aborted()) return false; ComparisonResult cmp = CHILD(index).compare(CHILD(ranked[i])); if(COMPARISON_NOT_FULLY_KNOWN(cmp)) { CALCULATOR->error(true, _("Unsolvable comparison at element %s when trying to rank vector."), i2s(index).c_str(), NULL); return false; } if((ascending && cmp == COMPARISON_RESULT_GREATER) || cmp == COMPARISON_RESULT_EQUAL || (!ascending && cmp == COMPARISON_RESULT_LESS)) { if(cmp == COMPARISON_RESULT_EQUAL) { ranked.insert(ranked.begin() + i + 1, index); ranked_equals_prev.insert(ranked_equals_prev.begin() + i + 1, true); } else { ranked.insert(ranked.begin() + i, index); ranked_equals_prev.insert(ranked_equals_prev.begin() + i, false); } b = true; break; } } if(!b) { ranked.push_back(index); ranked_equals_prev.push_back(false); } } int n_rep = 0; for(long int i = (long int) ranked.size() - 1; i >= 0; i--) { if(CALCULATOR->aborted()) return false; if(ranked_equals_prev[i]) { n_rep++; } else { if(n_rep) { MathStructure v(i + 1 + n_rep, 1L, 0L); v += i + 1; v *= MathStructure(1, 2, 0); for(; n_rep >= 0; n_rep--) { CHILD(ranked[i + n_rep]) = v; } } else { CHILD(ranked[i]).set(i + 1, 1L, 0L); } n_rep = 0; } } return true; } bool MathStructure::sortVector(bool ascending) { vector ranked_mstructs; bool b; for(size_t index = 0; index < SIZE; index++) { b = false; for(size_t i = 0; i < ranked_mstructs.size(); i++) { if(CALCULATOR->aborted()) return false; ComparisonResult cmp = CHILD(index).compare(*v_subs[ranked_mstructs[i]]); if(COMPARISON_MIGHT_BE_LESS_OR_GREATER(cmp)) { CALCULATOR->error(true, _("Unsolvable comparison at element %s when trying to sort vector."), i2s(index).c_str(), NULL); return false; } if((ascending && COMPARISON_IS_EQUAL_OR_GREATER(cmp)) || (!ascending && COMPARISON_IS_EQUAL_OR_LESS(cmp))) { ranked_mstructs.insert(ranked_mstructs.begin() + i, v_order[index]); b = true; break; } } if(!b) { ranked_mstructs.push_back(v_order[index]); } } v_order = ranked_mstructs; return true; } MathStructure &MathStructure::getRange(int start, int end, MathStructure &mstruct) const { if(!isVector()) { if(start > 1) { mstruct.clear(); return mstruct; } else { mstruct = *this; return mstruct; } } if(start < 1) start = 1; else if(start > (long int) SIZE) { mstruct.clear(); return mstruct; } if(end < (int) 1 || end > (long int) SIZE) end = SIZE; else if(end < start) end = start; mstruct.clearVector(); for(; start <= end; start++) { mstruct.addChild(CHILD(start - 1)); } return mstruct; } void MathStructure::resizeVector(size_t i, const MathStructure &mfill) { if(i > SIZE) { while(i > SIZE) { APPEND(mfill); } } else if(i < SIZE) { REDUCE(i) } } size_t MathStructure::rows() const { if(m_type != STRUCT_VECTOR || SIZE == 0 || (SIZE == 1 && (!CHILD(0).isVector() || CHILD(0).size() == 0))) return 0; return SIZE; } size_t MathStructure::columns() const { if(m_type != STRUCT_VECTOR || SIZE == 0 || !CHILD(0).isVector()) return 0; return CHILD(0).size(); } const MathStructure *MathStructure::getElement(size_t row, size_t column) const { if(row == 0 || column == 0 || row > rows() || column > columns()) return NULL; if(CHILD(row - 1).size() < column) return NULL; return &CHILD(row - 1)[column - 1]; } MathStructure *MathStructure::getElement(size_t row, size_t column) { if(row == 0 || column == 0 || row > rows() || column > columns()) return NULL; if(CHILD(row - 1).size() < column) return NULL; return &CHILD(row - 1)[column - 1]; } MathStructure &MathStructure::getArea(size_t r1, size_t c1, size_t r2, size_t c2, MathStructure &mstruct) const { size_t r = rows(); size_t c = columns(); if(r1 < 1) r1 = 1; else if(r1 > r) r1 = r; if(c1 < 1) c1 = 1; else if(c1 > c) c1 = c; if(r2 < 1 || r2 > r) r2 = r; else if(r2 < r1) r2 = r1; if(c2 < 1 || c2 > c) c2 = c; else if(c2 < c1) c2 = c1; mstruct.clearMatrix(); mstruct.resizeMatrix(r2 - r1 + 1, c2 - c1 + 1, m_undefined); for(size_t index_r = r1; index_r <= r2; index_r++) { for(size_t index_c = c1; index_c <= c2; index_c++) { mstruct[index_r - r1][index_c - c1] = CHILD(index_r - 1)[index_c - 1]; } } return mstruct; } MathStructure &MathStructure::rowToVector(size_t r, MathStructure &mstruct) const { if(r > rows()) { mstruct = m_undefined; return mstruct; } if(r < 1) r = 1; mstruct = CHILD(r - 1); return mstruct; } MathStructure &MathStructure::columnToVector(size_t c, MathStructure &mstruct) const { if(c > columns()) { mstruct = m_undefined; return mstruct; } if(c < 1) c = 1; mstruct.clearVector(); for(size_t i = 0; i < SIZE; i++) { mstruct.addChild(CHILD(i)[c - 1]); } return mstruct; } MathStructure &MathStructure::matrixToVector(MathStructure &mstruct) const { if(!isVector()) { mstruct = *this; return mstruct; } mstruct.clearVector(); for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isVector()) { for(size_t i2 = 0; i2 < CHILD(i).size(); i2++) { mstruct.addChild(CHILD(i)[i2]); } } else { mstruct.addChild(CHILD(i)); } } return mstruct; } void MathStructure::setElement(const MathStructure &mstruct, size_t row, size_t column) { if(row > rows() || column > columns() || row < 1 || column < 1) return; CHILD(row - 1)[column - 1] = mstruct; CHILD(row - 1).childUpdated(column); CHILD_UPDATED(row - 1); } void MathStructure::addRows(size_t r, const MathStructure &mfill) { if(r == 0) return; size_t cols = columns(); MathStructure mstruct; mstruct.clearVector(); mstruct.resizeVector(cols, mfill); for(size_t i = 0; i < r; i++) { APPEND(mstruct); } } void MathStructure::addColumns(size_t c, const MathStructure &mfill) { if(c == 0) return; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isVector()) { for(size_t i2 = 0; i2 < c; i2++) { CHILD(i).addChild(mfill); } } } CHILDREN_UPDATED; } void MathStructure::addRow(const MathStructure &mfill) { addRows(1, mfill); } void MathStructure::addColumn(const MathStructure &mfill) { addColumns(1, mfill); } void MathStructure::resizeMatrix(size_t r, size_t c, const MathStructure &mfill) { if(r > SIZE) { addRows(r - SIZE, mfill); } else if(r != SIZE) { REDUCE(r); } size_t cols = columns(); if(c > cols) { addColumns(c - cols, mfill); } else if(c != cols) { for(size_t i = 0; i < SIZE; i++) { CHILD(i).resizeVector(c, mfill); } } } bool MathStructure::matrixIsSquare() const { return rows() == columns(); } bool MathStructure::isNumericMatrix() const { if(!isMatrix()) return false; for(size_t index_r = 0; index_r < SIZE; index_r++) { for(size_t index_c = 0; index_c < CHILD(index_r).size(); index_c++) { if(!CHILD(index_r)[index_c].isNumber() || CHILD(index_r)[index_c].isInfinity()) return false; } } return true; } //from GiNaC int MathStructure::pivot(size_t ro, size_t co, bool symbolic) { size_t k = ro; if(symbolic) { while((k < SIZE) && (CHILD(k)[co].isZero())) ++k; } else { size_t kmax = k + 1; Number mmax(CHILD(kmax)[co].number()); mmax.abs(); while(kmax < SIZE) { if(CHILD(kmax)[co].number().isNegative()) { Number ntmp(CHILD(kmax)[co].number()); ntmp.negate(); if(ntmp.isGreaterThan(mmax)) { mmax = ntmp; k = kmax; } } else if(CHILD(kmax)[co].number().isGreaterThan(mmax)) { mmax = CHILD(kmax)[co].number(); k = kmax; } ++kmax; } if(!mmax.isZero()) k = kmax; } if(k == SIZE) return -1; if(k == ro) return 0; SWAP_CHILDREN(ro, k) return k; } //from GiNaC void determinant_minor(const MathStructure &mtrx, MathStructure &mdet, const EvaluationOptions &eo) { size_t n = mtrx.size(); if(n == 1) { mdet = mtrx[0][0]; return; } if(n == 2) { mdet = mtrx[0][0]; mdet.calculateMultiply(mtrx[1][1], eo); mdet.add(mtrx[1][0], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[0][1], eo); mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); return; } if(n == 3) { mdet = mtrx[0][0]; mdet.calculateMultiply(mtrx[1][1], eo); mdet.calculateMultiply(mtrx[2][2], eo); mdet.add(mtrx[0][0], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][2], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][1], eo); mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); mdet.add(mtrx[0][1], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][0], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][2], eo); mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); mdet.add(mtrx[0][2], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][0], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][1], eo); mdet.calculateAddLast(eo); mdet.add(mtrx[0][1], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][2], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][0], eo); mdet.calculateAddLast(eo); mdet.add(mtrx[0][2], true); mdet[mdet.size() - 1].calculateMultiply(mtrx[1][1], eo); mdet[mdet.size() - 1].calculateMultiply(mtrx[2][0], eo); mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); return; } std::vector Pkey; Pkey.reserve(n); std::vector Mkey; Mkey.reserve(n - 1); typedef std::map, class MathStructure> Rmap; typedef std::map, class MathStructure>::value_type Rmap_value; Rmap A; Rmap B; for(size_t r = 0; r < n; ++r) { Pkey.erase(Pkey.begin(), Pkey.end()); Pkey.push_back(r); A.insert(Rmap_value(Pkey, mtrx[r][n - 1])); } for(long int c = n - 2; c >= 0; --c) { Pkey.erase(Pkey.begin(), Pkey.end()); Mkey.erase(Mkey.begin(), Mkey.end()); for(size_t i = 0; i < n - c; ++i) Pkey.push_back(i); size_t fc = 0; do { mdet.clear(); for(size_t r = 0; r < n - c; ++r) { if (mtrx[Pkey[r]][c].isZero()) continue; Mkey.erase(Mkey.begin(), Mkey.end()); for(size_t i = 0; i < n - c; ++i) { if(i != r) Mkey.push_back(Pkey[i]); } mdet.add(mtrx[Pkey[r]][c], true); mdet[mdet.size() - 1].calculateMultiply(A[Mkey], eo); if(r % 2) mdet[mdet.size() - 1].calculateNegate(eo); mdet.calculateAddLast(eo); } if(!mdet.isZero()) B.insert(Rmap_value(Pkey, mdet)); for(fc = n - c; fc > 0; --fc) { ++Pkey[fc-1]; if(Pkey[fc - 1] < fc + c) break; } if(fc < n - c && fc > 0) { for(size_t j = fc; j < n - c; ++j) Pkey[j] = Pkey[j - 1] + 1; } } while(fc); A = B; B.clear(); } return; } //from GiNaC int MathStructure::gaussianElimination(const EvaluationOptions &eo, bool det) { if(!isMatrix()) return 0; bool isnumeric = isNumericMatrix(); size_t m = rows(); size_t n = columns(); int sign = 1; size_t r0 = 0; for(size_t c0 = 0; c0 < n && r0 < m - 1; ++c0) { int indx = pivot(r0, c0, true); if(indx == -1) { sign = 0; if(det) return 0; } if(indx >= 0) { if(indx > 0) sign = -sign; for(size_t r2 = r0 + 1; r2 < m; ++r2) { if(!CHILD(r2)[c0].isZero()) { if(isnumeric) { Number piv(CHILD(r2)[c0].number()); piv /= CHILD(r0)[c0].number(); for(size_t c = c0 + 1; c < n; ++c) { CHILD(r2)[c].number() -= piv * CHILD(r0)[c].number(); } } else { MathStructure piv(CHILD(r2)[c0]); piv.calculateDivide(CHILD(r0)[c0], eo); for(size_t c = c0 + 1; c < n; ++c) { CHILD(r2)[c].add(piv, true); CHILD(r2)[c][CHILD(r2)[c].size() - 1].calculateMultiply(CHILD(r0)[c], eo); CHILD(r2)[c][CHILD(r2)[c].size() - 1].calculateNegate(eo); CHILD(r2)[c].calculateAddLast(eo); } } } for(size_t c = r0; c <= c0; ++c) CHILD(r2)[c].clear(); } if(det) { for(size_t c = r0 + 1; c < n; ++c) CHILD(r0)[c].clear(); } ++r0; } } for(size_t r = r0 + 1; r < m; ++r) { for(size_t c = 0; c < n; ++c) CHILD(r)[c].clear(); } return sign; } //from GiNaC template int permutation_sign(It first, It last) { if (first == last) return 0; --last; if (first == last) return 0; It flag = first; int sign = 1; do { It i = last, other = last; --other; bool swapped = false; while (i != first) { if (*i < *other) { std::iter_swap(other, i); flag = other; swapped = true; sign = -sign; } else if (!(*other < *i)) return 0; --i; --other; } if (!swapped) return sign; ++flag; if (flag == last) return sign; first = flag; i = first; other = first; ++other; swapped = false; while (i != last) { if (*other < *i) { std::iter_swap(i, other); flag = other; swapped = true; sign = -sign; } else if (!(*i < *other)) return 0; ++i; ++other; } if (!swapped) return sign; last = flag; --last; } while (first != last); return sign; } //from GiNaC MathStructure &MathStructure::determinant(MathStructure &mstruct, const EvaluationOptions &eo) const { if(!matrixIsSquare()) { CALCULATOR->error(true, _("The determinant can only be calculated for square matrices."), NULL); mstruct = m_undefined; return mstruct; } if(SIZE == 1) { mstruct = CHILD(0)[0]; } else if(isNumericMatrix()) { mstruct.set(1, 1, 0); MathStructure mtmp(*this); int sign = mtmp.gaussianElimination(eo, true); for(size_t d = 0; d < SIZE; ++d) { mstruct.number() *= mtmp[d][d].number(); } mstruct.number() *= sign; } else { typedef std::pair sizet_pair; std::vector c_zeros; for(size_t c = 0; c < CHILD(0).size(); ++c) { size_t acc = 0; for(size_t r = 0; r < SIZE; ++r) { if(CHILD(r)[c].isZero()) ++acc; } c_zeros.push_back(sizet_pair(acc, c)); } std::sort(c_zeros.begin(), c_zeros.end()); std::vector pre_sort; for(std::vector::const_iterator i = c_zeros.begin(); i != c_zeros.end(); ++i) { pre_sort.push_back(i->second); } std::vector pre_sort_test(pre_sort); int sign = permutation_sign(pre_sort_test.begin(), pre_sort_test.end()); MathStructure result; result.clearMatrix(); result.resizeMatrix(SIZE, CHILD(0).size(), m_zero); size_t c = 0; for(std::vector::const_iterator i = pre_sort.begin(); i != pre_sort.end(); ++i,++c) { for(size_t r = 0; r < SIZE; ++r) result[r][c] = CHILD(r)[(*i)]; } mstruct.clear(); determinant_minor(result, mstruct, eo); if(sign != 1) { mstruct.calculateMultiply(sign, eo); } } mstruct.mergePrecision(*this); return mstruct; } MathStructure &MathStructure::permanent(MathStructure &mstruct, const EvaluationOptions &eo) const { if(!matrixIsSquare()) { CALCULATOR->error(true, _("The permanent can only be calculated for square matrices."), NULL); mstruct = m_undefined; return mstruct; } if(b_approx) mstruct.setApproximate(); mstruct.setPrecision(i_precision); if(SIZE == 1) { if(CHILD(0).size() >= 1) { mstruct = CHILD(0)[0]; } } else if(SIZE == 2) { mstruct = CHILD(0)[0]; if(IS_REAL(mstruct) && IS_REAL(CHILD(1)[1])) { mstruct.number() *= CHILD(1)[1].number(); } else { mstruct.calculateMultiply(CHILD(1)[1], eo); } if(IS_REAL(mstruct) && IS_REAL(CHILD(1)[0]) && IS_REAL(CHILD(0)[1])) { mstruct.number() += CHILD(1)[0].number() * CHILD(0)[1].number(); } else { MathStructure mtmp = CHILD(1)[0]; mtmp.calculateMultiply(CHILD(0)[1], eo); mstruct.calculateAdd(mtmp, eo); } } else { MathStructure mtrx; mtrx.clearMatrix(); mtrx.resizeMatrix(SIZE - 1, CHILD(0).size() - 1, m_undefined); for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { for(size_t index_r2 = 1; index_r2 < SIZE; index_r2++) { for(size_t index_c2 = 0; index_c2 < CHILD(index_r2).size(); index_c2++) { if(index_c2 > index_c) { mtrx.setElement(CHILD(index_r2)[index_c2], index_r2, index_c2); } else if(index_c2 < index_c) { mtrx.setElement(CHILD(index_r2)[index_c2], index_r2, index_c2 + 1); } } } MathStructure mdet; mtrx.permanent(mdet, eo); if(IS_REAL(mdet) && IS_REAL(CHILD(0)[index_c])) { mdet.number() *= CHILD(0)[index_c].number(); } else { mdet.calculateMultiply(CHILD(0)[index_c], eo); } if(IS_REAL(mdet) && IS_REAL(mstruct)) { mstruct.number() += mdet.number(); } else { mstruct.calculateAdd(mdet, eo); } } } return mstruct; } void MathStructure::setToIdentityMatrix(size_t n) { clearMatrix(); resizeMatrix(n, n, m_zero); for(size_t i = 0; i < n; i++) { CHILD(i)[i] = m_one; } } MathStructure &MathStructure::getIdentityMatrix(MathStructure &mstruct) const { mstruct.setToIdentityMatrix(columns()); return mstruct; } //modified algorithm from eigenmath bool MathStructure::invertMatrix(const EvaluationOptions &eo) { if(!matrixIsSquare()) return false; if(isNumericMatrix()) { int d, i, j, n = SIZE; MathStructure idstruct; Number mtmp; idstruct.setToIdentityMatrix(n); MathStructure mtrx(*this); for(d = 0; d < n; d++) { if(mtrx[d][d].isZero()) { for (i = d + 1; i < n; i++) { if(!mtrx[i][d].isZero()) break; } if(i == n) { CALCULATOR->error(true, _("Inverse of singular matrix."), NULL); return false; } mtrx[i].ref(); mtrx[d].ref(); MathStructure *mptr = &mtrx[d]; mtrx.setChild_nocopy(&mtrx[i], d + 1); mtrx.setChild_nocopy(mptr, i + 1); idstruct[i].ref(); idstruct[d].ref(); mptr = &idstruct[d]; idstruct.setChild_nocopy(&idstruct[i], d + 1); idstruct.setChild_nocopy(mptr, i + 1); } mtmp = mtrx[d][d].number(); mtmp.recip(); for(j = 0; j < n; j++) { if(j > d) { mtrx[d][j].number() *= mtmp; } idstruct[d][j].number() *= mtmp; } for(i = 0; i < n; i++) { if(i == d) continue; mtmp = mtrx[i][d].number(); mtmp.negate(); for(j = 0; j < n; j++) { if(j > d) { mtrx[i][j].number() += mtrx[d][j].number() * mtmp; } idstruct[i][j].number() += idstruct[d][j].number() * mtmp; } } } set_nocopy(idstruct); MERGE_APPROX_AND_PREC(idstruct) } else { MathStructure *mstruct = new MathStructure(); determinant(*mstruct, eo); mstruct->calculateInverse(eo); adjointMatrix(eo); multiply_nocopy(mstruct, true); calculateMultiplyLast(eo); } return true; } bool MathStructure::adjointMatrix(const EvaluationOptions &eo) { if(!matrixIsSquare()) return false; MathStructure msave(*this); for(size_t index_r = 0; index_r < SIZE; index_r++) { for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { msave.cofactor(index_r + 1, index_c + 1, CHILD(index_r)[index_c], eo); } } transposeMatrix(); return true; } bool MathStructure::transposeMatrix() { MathStructure msave(*this); resizeMatrix(CHILD(0).size(), SIZE, m_undefined); for(size_t index_r = 0; index_r < SIZE; index_r++) { for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { CHILD(index_r)[index_c] = msave[index_c][index_r]; } } return true; } MathStructure &MathStructure::cofactor(size_t r, size_t c, MathStructure &mstruct, const EvaluationOptions &eo) const { if(r < 1) r = 1; if(c < 1) c = 1; if(r > SIZE || c > CHILD(0).size()) { mstruct = m_undefined; return mstruct; } r--; c--; mstruct.clearMatrix(); mstruct.resizeMatrix(SIZE - 1, CHILD(0).size() - 1, m_undefined); for(size_t index_r = 0; index_r < SIZE; index_r++) { if(index_r != r) { for(size_t index_c = 0; index_c < CHILD(0).size(); index_c++) { if(index_c > c) { if(index_r > r) { mstruct[index_r - 1][index_c - 1] = CHILD(index_r)[index_c]; } else { mstruct[index_r][index_c - 1] = CHILD(index_r)[index_c]; } } else if(index_c < c) { if(index_r > r) { mstruct[index_r - 1][index_c] = CHILD(index_r)[index_c]; } else { mstruct[index_r][index_c] = CHILD(index_r)[index_c]; } } } } } MathStructure mstruct2; mstruct = mstruct.determinant(mstruct2, eo); if((r + c) % 2 == 1) { mstruct.calculateNegate(eo); } return mstruct; } void gatherInformation(const MathStructure &mstruct, vector &base_units, vector &alias_units) { switch(mstruct.type()) { case STRUCT_UNIT: { switch(mstruct.unit()->subtype()) { case SUBTYPE_BASE_UNIT: { for(size_t i = 0; i < base_units.size(); i++) { if(base_units[i] == mstruct.unit()) { return; } } base_units.push_back(mstruct.unit()); break; } case SUBTYPE_ALIAS_UNIT: { for(size_t i = 0; i < alias_units.size(); i++) { if(alias_units[i] == mstruct.unit()) { return; } } alias_units.push_back((AliasUnit*) (mstruct.unit())); break; } case SUBTYPE_COMPOSITE_UNIT: { gatherInformation(((CompositeUnit*) (mstruct.unit()))->generateMathStructure(), base_units, alias_units); break; } } break; } case STRUCT_FUNCTION: { for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct.function()->getArgumentDefinition(i + 1) || mstruct.function()->getArgumentDefinition(i + 1)->type() != ARGUMENT_TYPE_ANGLE) { gatherInformation(mstruct[i], base_units, alias_units); } } break; } default: { for(size_t i = 0; i < mstruct.size(); i++) { gatherInformation(mstruct[i], base_units, alias_units); } break; } } } int MathStructure::isUnitCompatible(const MathStructure &mstruct) const { if(!isMultiplication() && mstruct.isMultiplication()) return mstruct.isUnitCompatible(*this); int b1 = mstruct.containsRepresentativeOfType(STRUCT_UNIT, true, true); int b2 = containsRepresentativeOfType(STRUCT_UNIT, true, true); if(b1 < 0 || b2 < 0) return -1; if(b1 != b2) return false; if(!b1) return true; if(isMultiplication()) { size_t unit_count1 = 0, unit_count2 = 0; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isUnit_exp()) unit_count1++; else if(CHILD(i).containsRepresentativeOfType(STRUCT_UNIT, true, true) != 0) return -1; } if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isUnit_exp()) unit_count2++; else if(mstruct[i].containsRepresentativeOfType(STRUCT_UNIT, true, true) != 0) return -1; } } else if(mstruct.isUnit_exp()) { if(unit_count1 > 1) return false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isUnit_exp()) return CHILD(1) == mstruct; } } else { return -1; } if(unit_count1 != unit_count2) return false; size_t i2 = 0; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isUnit_exp()) { for(; i2 < mstruct.size(); i2++) { if(mstruct[i2].isUnit_exp()) { if(CHILD(i) != mstruct[i2]) return false; i2++; break; } } } } } else if(isUnit_exp()) { if(mstruct.isUnit_exp()) return equals(mstruct); } return -1; } bool MathStructure::syncUnits(bool sync_complex_relations, bool *found_complex_relations, bool calculate_new_functions, const EvaluationOptions &feo) { if(SIZE == 0) return false; vector base_units; vector alias_units; vector composite_units; gatherInformation(*this, base_units, alias_units); if(alias_units.empty() || base_units.size() + alias_units.size() == 1) return false; CompositeUnit *cu; bool b = false, do_erase = false; for(size_t i = 0; i < alias_units.size(); ) { do_erase = false; if(alias_units[i]->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { b = false; cu = (CompositeUnit*) alias_units[i]->baseUnit(); for(size_t i2 = 0; i2 < base_units.size(); i2++) { if(cu->containsRelativeTo(base_units[i2])) { for(size_t i3 = 0; i3 < composite_units.size(); i3++) { if(composite_units[i3] == cu) { b = true; break; } } if(!b) composite_units.push_back(cu); do_erase = true; break; } } for(size_t i2 = 0; !do_erase && i2 < alias_units.size(); i2++) { if(i != i2 && alias_units[i2]->baseUnit() != cu && cu->containsRelativeTo(alias_units[i2])) { for(size_t i3 = 0; i3 < composite_units.size(); i3++) { if(composite_units[i3] == cu) { b = true; break; } } if(!b) composite_units.push_back(cu); do_erase = true; break; } } } if(do_erase) { alias_units.erase(alias_units.begin() + i); for(int i2 = 1; i2 <= (int) cu->countUnits(); i2++) { b = false; Unit *cub = cu->get(i2); switch(cub->subtype()) { case SUBTYPE_BASE_UNIT: { for(size_t i3 = 0; i3 < base_units.size(); i3++) { if(base_units[i3] == cub) { b = true; break; } } if(!b) base_units.push_back(cub); break; } case SUBTYPE_ALIAS_UNIT: { for(size_t i3 = 0; i3 < alias_units.size(); i3++) { if(alias_units[i3] == cub) { b = true; break; } } if(!b) alias_units.push_back((AliasUnit*) cub); break; } case SUBTYPE_COMPOSITE_UNIT: { gatherInformation(((CompositeUnit*) cub)->generateMathStructure(), base_units, alias_units); break; } } } i = 0; } else { i++; } } for(size_t i = 0; i < alias_units.size();) { do_erase = false; for(size_t i2 = 0; i2 < alias_units.size(); i2++) { if(i != i2 && alias_units[i]->baseUnit() == alias_units[i2]->baseUnit()) { if(alias_units[i2]->isParentOf(alias_units[i])) { do_erase = true; break; } else if(!alias_units[i]->isParentOf(alias_units[i2])) { b = false; for(size_t i3 = 0; i3 < base_units.size(); i3++) { if(base_units[i3] == alias_units[i2]->firstBaseUnit()) { b = true; break; } } if(!b) base_units.push_back((Unit*) alias_units[i]->baseUnit()); do_erase = true; break; } } } if(do_erase) { alias_units.erase(alias_units.begin() + i); i = 0; } else { i++; } } for(size_t i = 0; i < alias_units.size();) { do_erase = false; if(alias_units[i]->baseUnit()->subtype() == SUBTYPE_BASE_UNIT) { for(size_t i2 = 0; i2 < base_units.size(); i2++) { if(alias_units[i]->baseUnit() == base_units[i2]) { do_erase = true; break; } } } if(do_erase) { alias_units.erase(alias_units.begin() + i); i = 0; } else { i++; } } b = false; bool fcr = false; for(size_t i = 0; i < composite_units.size(); i++) { if(convert(composite_units[i], sync_complex_relations, &fcr, calculate_new_functions, feo)) b = true; } if(dissolveAllCompositeUnits()) b = true; for(size_t i = 0; i < base_units.size(); i++) { if(convert(base_units[i], sync_complex_relations, &fcr, calculate_new_functions, feo)) b = true; } for(size_t i = 0; i < alias_units.size(); i++) { if(convert(alias_units[i], sync_complex_relations, &fcr, calculate_new_functions, feo)) b = true; } if(sync_complex_relations && fcr) CALCULATOR->error(false, _("Calculations involving conversion of units without proportional linear relationship (e.g. with multiple temperature units), might give unexpected results and is not recommended."), NULL); if(fcr && found_complex_relations) *found_complex_relations = fcr; return b; } bool MathStructure::testDissolveCompositeUnit(Unit *u) { if(m_type == STRUCT_UNIT) { if(o_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) o_unit)->containsRelativeTo(u)) { set(((CompositeUnit*) o_unit)->generateMathStructure()); return true; } } else if(o_unit->subtype() == SUBTYPE_ALIAS_UNIT && o_unit->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) (o_unit->baseUnit()))->containsRelativeTo(u)) { convert(o_unit->baseUnit()); convert(u); return true; } } } return false; } bool test_dissolve_cu(MathStructure &mstruct, Unit *u, bool convert_complex_relations, bool *found_complex_relations, bool calculate_new_functions, const EvaluationOptions &feo, Prefix *new_prefix = NULL) { if(mstruct.isUnit()) { if(mstruct.unit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) mstruct.unit())->containsRelativeTo(u)) { mstruct.set(((CompositeUnit*) mstruct.unit())->generateMathStructure()); return true; } } else if(mstruct.unit()->subtype() == SUBTYPE_ALIAS_UNIT && mstruct.unit()->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) (mstruct.unit()->baseUnit()))->containsRelativeTo(u)) { mstruct.convert(mstruct.unit()->baseUnit(), convert_complex_relations, found_complex_relations, calculate_new_functions, feo); mstruct.convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); return true; } } } return false; } bool MathStructure::testCompositeUnit(Unit *u) { if(m_type == STRUCT_UNIT) { if(o_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) o_unit)->containsRelativeTo(u)) { return true; } } else if(o_unit->subtype() == SUBTYPE_ALIAS_UNIT && o_unit->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) (o_unit->baseUnit()))->containsRelativeTo(u)) { return true; } } } return false; } bool MathStructure::dissolveAllCompositeUnits() { switch(m_type) { case STRUCT_UNIT: { if(o_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) { set(((CompositeUnit*) o_unit)->generateMathStructure()); return true; } break; } default: { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).dissolveAllCompositeUnits()) { CHILD_UPDATED(i); b = true; } } return b; } } return false; } bool MathStructure::setPrefixForUnit(Unit *u, Prefix *new_prefix) { if(m_type == STRUCT_UNIT && o_unit == u) { if(o_prefix != new_prefix) { Number new_value(1, 1); if(o_prefix) new_value = o_prefix->value(); if(new_prefix) new_value.divide(new_prefix->value()); o_prefix = new_prefix; multiply(new_value); return true; } return false; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).setPrefixForUnit(u, new_prefix)) { CHILD_UPDATED(i); b = true; } } return b; } bool searchSubMultiplicationsForComplexRelations(Unit *u, const MathStructure &mstruct) { int b_c = -1; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isUnit_exp()) { if((mstruct[i].isUnit() && u->hasComplexRelationTo(mstruct[i].unit())) || (mstruct[i].isPower() && u->hasComplexRelationTo(mstruct[i][0].unit()))) { return true; } } else if(b_c == -1 && mstruct[i].isMultiplication()) { b_c = -3; } } if(b_c == -3) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isMultiplication() && searchSubMultiplicationsForComplexRelations(u, mstruct[i])) return true; } } return false; } bool MathStructure::convertToBaseUnits(bool convert_complex_relations, bool *found_complex_relations, bool calculate_new_functions, const EvaluationOptions &feo) { if(m_type == STRUCT_UNIT) { if(o_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) { set(((CompositeUnit*) o_unit)->generateMathStructure()); convertToBaseUnits(convert_complex_relations, found_complex_relations, calculate_new_functions, feo); return true; } else if(o_unit->subtype() == SUBTYPE_ALIAS_UNIT) { AliasUnit *au = (AliasUnit*) o_unit; if(au->hasComplexRelationTo(au->baseUnit())) { if(found_complex_relations) *found_complex_relations = true; if(!convert_complex_relations) { if(!au->hasComplexExpression()) { MathStructure mstruct_old(*this); if(convert(au->firstBaseUnit(), false, NULL, calculate_new_functions, feo) && !equals(mstruct_old)) { convertToBaseUnits(false, NULL, calculate_new_functions, feo); return true; } } return false; } } if(convert(au->baseUnit(), convert_complex_relations, found_complex_relations, calculate_new_functions, feo)) { convertToBaseUnits(convert_complex_relations, found_complex_relations, calculate_new_functions, feo); return true; } } return false; } else if(m_type == STRUCT_MULTIPLICATION && (convert_complex_relations || found_complex_relations)) { AliasUnit *complex_au = NULL; if(convert_complex_relations && convertToBaseUnits(false, NULL, calculate_new_functions, feo)) { return true; } for(size_t i = 0; i < SIZE; i++) { if(SIZE > 100 && CALCULATOR->aborted()) return false; if(CHILD(i).isUnit_exp() && CHILD(i).unit_exp_unit()->subtype() == SUBTYPE_ALIAS_UNIT) { AliasUnit *au = (AliasUnit*) CHILD(i).unit_exp_unit(); if(au && au->hasComplexRelationTo(au->baseUnit())) { if(found_complex_relations) { *found_complex_relations = true; } if(convert_complex_relations) { if(complex_au) { complex_au = NULL; convert_complex_relations = false; break; } else { complex_au = au; } } else { break; } } } } if(convert_complex_relations && complex_au) { MathStructure mstruct_old(*this); if(convert(complex_au->firstBaseUnit(), true, NULL, calculate_new_functions, feo)) { return true; } } } else if(m_type == STRUCT_FUNCTION) { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(SIZE > 100 && CALCULATOR->aborted()) return b; if((!o_function->getArgumentDefinition(i + 1) || o_function->getArgumentDefinition(i + 1)->type() != ARGUMENT_TYPE_ANGLE) && CHILD(i).convertToBaseUnits(convert_complex_relations, found_complex_relations, calculate_new_functions, feo)) { CHILD_UPDATED(i); b = true; } } return b; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(SIZE > 100 && CALCULATOR->aborted()) return b; if(CHILD(i).convertToBaseUnits(convert_complex_relations, found_complex_relations, calculate_new_functions, feo)) { CHILD_UPDATED(i); b = true; } } return b; } bool MathStructure::convert(Unit *u, bool convert_complex_relations, bool *found_complex_relations, bool calculate_new_functions, const EvaluationOptions &feo, Prefix *new_prefix) { if(m_type == STRUCT_ADDITION && containsType(STRUCT_DATETIME, false, true, false) > 0) return false; bool b = false; if(m_type == STRUCT_UNIT && o_unit == u) { if((new_prefix || o_prefix) && o_prefix != new_prefix) { Number new_value(1, 1); if(o_prefix) new_value = o_prefix->value(); if(new_prefix) new_value.divide(new_prefix->value()); o_prefix = new_prefix; multiply(new_value); return true; } return false; } if(u->subtype() == SUBTYPE_COMPOSITE_UNIT && !(m_type == STRUCT_UNIT && o_unit->baseUnit() == u)) { return convert(((CompositeUnit*) u)->generateMathStructure(false, true), convert_complex_relations, found_complex_relations, calculate_new_functions, feo); } if(m_type == STRUCT_UNIT) { if(u->hasComplexRelationTo(o_unit)) { if(found_complex_relations) *found_complex_relations = true; if(!convert_complex_relations) return false; } if(o_unit->baseUnit() != u->baseUnit() && test_dissolve_cu(*this, u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix)) { convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); return true; } MathStructure *exp = new MathStructure(1, 1, 0); MathStructure *mstruct = new MathStructure(1, 1, 0); if(o_prefix) { mstruct->set(o_prefix->value()); } if(u->convert(o_unit, *mstruct, *exp)) { o_unit = u; o_prefix = new_prefix; if(new_prefix) { divide(new_prefix->value()); } if(!exp->isOne()) { if(calculate_new_functions) exp->calculateFunctions(feo, true, false); raise_nocopy(exp); } else { exp->unref(); } if(!mstruct->isOne()) { if(calculate_new_functions) mstruct->calculateFunctions(feo, true, false); multiply_nocopy(mstruct); } else { mstruct->unref(); } return true; } else { exp->unref(); mstruct->unref(); return false; } } else { if(convert_complex_relations || found_complex_relations) { if(m_type == STRUCT_MULTIPLICATION) { long int b_c = -1; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isUnit_exp()) { Unit *u2 = CHILD(i).isPower() ? CHILD(i)[0].unit() : CHILD(i).unit(); if(u->hasComplexRelationTo(u2)) { if(found_complex_relations) *found_complex_relations = true; b_c = i; break; } } else if(CHILD(i).isMultiplication()) { b_c = -3; } } if(b_c == -3) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isMultiplication()) { if(searchSubMultiplicationsForComplexRelations(u, CHILD(i))) { if(!convert_complex_relations) { *found_complex_relations = true; break; } flattenMultiplication(*this); return convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); } } } } if(convert_complex_relations && b_c >= 0) { if(flattenMultiplication(*this)) return convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); MathStructure mstruct(1, 1); MathStructure mstruct2(1, 1); if(SIZE == 2) { if(b_c == 0) mstruct = CHILD(1); else mstruct = CHILD(0); if(mstruct.isUnit_exp()) { mstruct2 = mstruct; mstruct.set(1, 1, 0); } } else if(SIZE > 2) { mstruct = *this; size_t nr_of_del = 0; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isUnit_exp()) { mstruct.delChild(i + 1 - nr_of_del); nr_of_del++; if((long int) i != b_c) { if(mstruct2.isOne()) mstruct2 = CHILD(i); else mstruct2.multiply(CHILD(i), true); } } } if(mstruct.size() == 1) mstruct.setToChild(1); else if(mstruct.size() == 0) mstruct.set(1, 1, 0); } MathStructure exp(1, 1); Unit *u2; bool b_p = false; if(CHILD(b_c).isPower()) { if(CHILD(b_c)[0].unit()->baseUnit() != u->baseUnit()) { if(CHILD(b_c)[0].unit()->subtype() != SUBTYPE_BASE_UNIT && (CHILD(b_c)[0].unit()->subtype() != SUBTYPE_ALIAS_UNIT || ((AliasUnit*) CHILD(b_c)[0].unit())->firstBaseUnit()->subtype() != SUBTYPE_COMPOSITE_UNIT)) { convertToBaseUnits(convert_complex_relations, found_complex_relations, calculate_new_functions, feo); } else { return false; } convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); return true; } exp = CHILD(b_c)[1]; u2 = CHILD(b_c)[0].unit(); if(CHILD(b_c)[0].prefix()) b_p = true; } else { if(CHILD(b_c).unit()->baseUnit() != u->baseUnit()) { if(CHILD(b_c).unit()->subtype() != SUBTYPE_BASE_UNIT && (CHILD(b_c).unit()->subtype() != SUBTYPE_ALIAS_UNIT || ((AliasUnit*) CHILD(b_c).unit())->firstBaseUnit()->subtype() != SUBTYPE_COMPOSITE_UNIT)) { convertToBaseUnits(convert_complex_relations, found_complex_relations, calculate_new_functions, feo); } else { return false; } convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); return true; } u2 = CHILD(b_c).unit(); if(CHILD(b_c).prefix()) b_p = true; } size_t efc = 0, mfc = 0; if(calculate_new_functions) { efc = exp.countFunctions(); mfc = mstruct.countFunctions(); } if(u->convert(u2, mstruct, exp)) { if(b_p) { unformat(); return convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); } set(u); if(!exp.isOne()) { if(calculate_new_functions && exp.countFunctions() > efc) exp.calculateFunctions(feo, true, false); raise(exp); } if(!mstruct2.isOne()) { multiply(mstruct2); } if(!mstruct.isOne()) { if(calculate_new_functions && mstruct.countFunctions() > mfc) mstruct.calculateFunctions(feo, true, false); multiply(mstruct); } return true; } return false; } } else if(m_type == STRUCT_POWER) { if(CHILD(0).isUnit() && u->hasComplexRelationTo(CHILD(0).unit())) { if(found_complex_relations) *found_complex_relations = true; if(convert_complex_relations) { if(CHILD(0).unit()->baseUnit() != u->baseUnit()) { if(CHILD(0).unit()->subtype() != SUBTYPE_BASE_UNIT && (CHILD(0).unit()->subtype() != SUBTYPE_ALIAS_UNIT || ((AliasUnit*) CHILD(0).unit())->firstBaseUnit()->subtype() != SUBTYPE_COMPOSITE_UNIT)) { convertToBaseUnits(convert_complex_relations, found_complex_relations, calculate_new_functions, feo); } else { return false; } convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix); return true; } MathStructure exp(CHILD(1)); MathStructure mstruct(1, 1); if(CHILD(0).prefix()) { mstruct.set(CHILD(0).prefix()->value()); mstruct.raise(exp); } size_t efc = 0; if(calculate_new_functions) { efc = exp.countFunctions(); } if(u->convert(CHILD(0).unit(), mstruct, exp)) { set(u); if(!exp.isOne()) { if(calculate_new_functions && exp.countFunctions() > efc) exp.calculateFunctions(feo, true, false); raise(exp); } if(!mstruct.isOne()) { if(calculate_new_functions) mstruct.calculateFunctions(feo, true, false); multiply(mstruct); } return true; } return false; } } } /*if(m_type == STRUCT_MULTIPLICATION || m_type == STRUCT_POWER) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).convert(u, false, found_complex_relations, calculate_new_functions, feo, new_prefix)) { CHILD_UPDATED(i); b = true; } } return b; }*/ } if(m_type == STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { if(SIZE > 100 && CALCULATOR->aborted()) return b; if((!o_function->getArgumentDefinition(i + 1) || o_function->getArgumentDefinition(i + 1)->type() != ARGUMENT_TYPE_ANGLE) && CHILD(i).convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix)) { CHILD_UPDATED(i); b = true; } } return b; } for(size_t i = 0; i < SIZE; i++) { if(SIZE > 100 && CALCULATOR->aborted()) return b; if(CHILD(i).convert(u, convert_complex_relations, found_complex_relations, calculate_new_functions, feo, new_prefix)) { CHILD_UPDATED(i); b = true; } } return b; } return b; } bool MathStructure::convert(const MathStructure unit_mstruct, bool convert_complex_relations, bool *found_complex_relations, bool calculate_new_functions, const EvaluationOptions &feo) { bool b = false; if(unit_mstruct.type() == STRUCT_UNIT) { if(convert(unit_mstruct.unit(), convert_complex_relations, found_complex_relations, calculate_new_functions, feo, feo.keep_prefixes ? unit_mstruct.prefix() : NULL)) b = true; } else { for(size_t i = 0; i < unit_mstruct.size(); i++) { if(convert(unit_mstruct[i], convert_complex_relations, found_complex_relations, calculate_new_functions, feo)) b = true; } } return b; } int MathStructure::contains(const MathStructure &mstruct, bool structural_only, bool check_variables, bool check_functions, bool loose_equals) const { if(mstruct.isUnit() && mstruct.prefix() == NULL && m_type == STRUCT_UNIT) return mstruct.unit() == o_unit; if(equals(mstruct, loose_equals, loose_equals)) return 1; if(structural_only) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).contains(mstruct, structural_only, check_variables, check_functions, loose_equals)) return 1; } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().contains(mstruct, structural_only, check_variables, check_functions, loose_equals); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->contains(mstruct, structural_only, check_variables, check_functions, loose_equals); } } } else { int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).contains(mstruct, structural_only, check_variables, check_functions, loose_equals); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().contains(mstruct, structural_only, check_variables, check_functions, loose_equals); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->contains(mstruct, structural_only, check_variables, check_functions, loose_equals); } return -1; } else if(isAborted()) { return -1; } return ret; } return 0; } size_t MathStructure::countOccurrences(const MathStructure &mstruct) const { if(mstruct.isUnit() && mstruct.prefix() == NULL && m_type == STRUCT_UNIT && mstruct.unit() == o_unit) return 1; if(equals(mstruct, true, true)) return 1; size_t i_occ = 0; for(size_t i = 0; i < SIZE; i++) { i_occ += CHILD(i).countOccurrences(mstruct); } return i_occ; } int MathStructure::containsFunction(MathFunction *f, bool structural_only, bool check_variables, bool check_functions) const { if(m_type == STRUCT_FUNCTION && o_function == f) return 1; if(structural_only) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsFunction(f, structural_only, check_variables, check_functions)) return 1; } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsFunction(f, structural_only, check_variables, check_functions); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsFunction(f, structural_only, check_variables, check_functions); } } } else { int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsFunction(f, structural_only, check_variables, check_functions); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsFunction(f, structural_only, check_variables, check_functions); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsFunction(f, structural_only, check_variables, check_functions); } return -1; } else if(isAborted()) { return -1; } return ret; } return 0; } int contains_interval_var(const MathStructure &m, bool structural_only, bool check_variables, bool check_functions, bool ignore_high_precision_interval, bool include_interval_function) { if(m.type() == STRUCT_NUMBER) { if(m.number().isInterval(false)) { if(ignore_high_precision_interval) { if(m.number().precision(true) > (CALCULATOR->usesIntervalArithmetic() ? PRECISION + 10 : PRECISION)) return 0; } return 1; } else if(CALCULATOR->usesIntervalArithmetic() && m.number().precision() >= 0) { if(ignore_high_precision_interval) { if(m.number().precision() > PRECISION + 10) return 0; } return 1; } } if(include_interval_function && m.type() == STRUCT_FUNCTION && m.function() == CALCULATOR->f_interval) return 1; if(structural_only) { for(size_t i = 0; i < m.size(); i++) { if(contains_interval_var(m[i], structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function)) return 1; } if(m.type() == STRUCT_VARIABLE && check_variables && m.variable()->isKnown()) { return contains_interval_var(((KnownVariable*) m.variable())->get(), structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); } else if(m.type() == STRUCT_FUNCTION && check_functions) { if(m.functionValue()) { return contains_interval_var(*m.functionValue(), structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); } } } else { int ret = 0; if(m.type() != STRUCT_FUNCTION) { for(size_t i = 0; i < m.size(); i++) { int retval = contains_interval_var(m[i], structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(m.type() == STRUCT_VARIABLE && check_variables && m.variable()->isKnown()) { return contains_interval_var(((KnownVariable*) m.variable())->get(), structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); } else if(m.type() == STRUCT_FUNCTION && check_functions) { if(m.functionValue()) { return contains_interval_var(*m.functionValue(), structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); } return -1; } else if(m.isAborted()) { return -1; } return ret; } return 0; } int MathStructure::containsInterval(bool structural_only, bool check_variables, bool check_functions, bool ignore_high_precision_interval, bool include_interval_function) const { if(m_type == STRUCT_NUMBER && o_number.isInterval(false)) { if(ignore_high_precision_interval) { if(o_number.precision(true) > PRECISION + 10) return 0; } return 1; } if(include_interval_function && m_type == STRUCT_FUNCTION && o_function == CALCULATOR->f_interval) return 1; if(structural_only) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsInterval(structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function)) return 1; } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return contains_interval_var(((KnownVariable*) o_variable)->get(), structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsInterval(structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); } } } else { int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsInterval(structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return contains_interval_var(((KnownVariable*) o_variable)->get(), structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsInterval(structural_only, check_variables, check_functions, ignore_high_precision_interval, include_interval_function); } return -1; } else if(isAborted()) { return -1; } return ret; } return 0; } int MathStructure::containsInfinity(bool structural_only, bool check_variables, bool check_functions) const { if(m_type == STRUCT_NUMBER && o_number.includesInfinity(false)) { return 1; } if(structural_only) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsInfinity(structural_only, check_variables, check_functions)) return 1; } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsInfinity(structural_only, check_variables, check_functions); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsInfinity(structural_only, check_variables, check_functions); } } } else { int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsInfinity(structural_only, check_variables, check_functions); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsInfinity(structural_only, check_variables, check_functions); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsInfinity(structural_only, check_variables, check_functions); } return -1; } else if(isAborted()) { return -1; } return ret; } return 0; } int MathStructure::containsRepresentativeOf(const MathStructure &mstruct, bool check_variables, bool check_functions) const { if(equals(mstruct)) return 1; int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsRepresentativeOf(mstruct, check_variables, check_functions); if(retval == 1) return 1; else if(retval < 0) ret = retval; } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsRepresentativeOf(mstruct, check_variables, check_functions); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsRepresentativeOf(mstruct, check_variables, check_functions); } } } if(m_type == STRUCT_VARIABLE && check_variables && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsRepresentativeOf(mstruct, check_variables, check_functions); } else if(m_type == STRUCT_FUNCTION && check_functions) { if(function_value) { return function_value->containsRepresentativeOf(mstruct, check_variables, check_functions); } if(!mstruct.isNumber() && (o_function->isBuiltin() || representsNumber())) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsRepresentativeOf(mstruct, check_variables, check_functions); if(retval != 0) return -1; } return 0; } return -1; } else if(isAborted()) { return -1; } return ret; } int MathStructure::containsType(StructureType mtype, bool structural_only, bool check_variables, bool check_functions) const { if(m_type == mtype) return 1; if(structural_only) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsType(mtype, true, check_variables, check_functions)) return 1; } if(check_variables && m_type == STRUCT_VARIABLE && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsType(mtype, false, check_variables, check_functions); } else if(check_functions && m_type == STRUCT_FUNCTION) { if(function_value) { return function_value->containsType(mtype, false, check_variables, check_functions); } } return 0; } else { int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsType(mtype, false, check_variables, check_functions); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(check_variables && m_type == STRUCT_VARIABLE && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsType(mtype, false, check_variables, check_functions); } else if(check_functions && m_type == STRUCT_FUNCTION) { if(function_value) { return function_value->containsType(mtype, false, check_variables, check_functions); } return -1; } else if(isAborted()) { return -1; } return ret; } } int MathStructure::containsRepresentativeOfType(StructureType mtype, bool check_variables, bool check_functions) const { if(m_type == mtype) return 1; int ret = 0; if(m_type != STRUCT_FUNCTION) { for(size_t i = 0; i < SIZE; i++) { int retval = CHILD(i).containsRepresentativeOfType(mtype, check_variables, check_functions); if(retval == 1) return 1; else if(retval < 0) ret = retval; } } if(check_variables && m_type == STRUCT_VARIABLE && o_variable->isKnown()) { return ((KnownVariable*) o_variable)->get().containsRepresentativeOfType(mtype, check_variables, check_functions); } else if(check_functions && m_type == STRUCT_FUNCTION) { if(function_value) { return function_value->containsRepresentativeOfType(mtype, check_variables, check_functions); } } if(m_type == STRUCT_SYMBOLIC || m_type == STRUCT_VARIABLE || m_type == STRUCT_FUNCTION || m_type == STRUCT_ABORTED) { if(representsNumber(false)) { if(mtype == STRUCT_UNIT) return -1; return mtype == STRUCT_NUMBER; } else { return -1; } } return ret; } bool MathStructure::containsUnknowns() const { if(isUnknown()) return true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsUnknowns()) return true; } return false; } bool MathStructure::containsDivision() const { if(m_type == STRUCT_DIVISION || m_type == STRUCT_INVERSE || (m_type == STRUCT_POWER && CHILD(1).hasNegativeSign())) return true; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).containsDivision()) return true; } return false; } size_t MathStructure::countFunctions(bool count_subfunctions) const { size_t c = 0; if(isFunction()) { if(!count_subfunctions) return 1; c = 1; } for(size_t i = 0; i < SIZE; i++) { c += CHILD(i).countFunctions(); } return c; } void MathStructure::findAllUnknowns(MathStructure &unknowns_vector) { if(!unknowns_vector.isVector()) unknowns_vector.clearVector(); switch(m_type) { case STRUCT_VARIABLE: { if(o_variable->isKnown()) { break; } } case STRUCT_SYMBOLIC: { bool b = false; for(size_t i = 0; i < unknowns_vector.size(); i++) { if(equals(unknowns_vector[i])) { b = true; break; } } if(!b) unknowns_vector.addChild(*this); break; } default: { for(size_t i = 0; i < SIZE; i++) { CHILD(i).findAllUnknowns(unknowns_vector); } } } } bool MathStructure::replace(const MathStructure &mfrom, const MathStructure &mto, bool once_only) { if(b_protected) b_protected = false; if(equals(mfrom, true, true)) { set(mto); return true; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).replace(mfrom, mto, once_only)) { b = true; CHILD_UPDATED(i); if(once_only) return true; } } return b; } bool MathStructure::calculateReplace(const MathStructure &mfrom, const MathStructure &mto, const EvaluationOptions &eo) { if(equals(mfrom, true, true)) { set(mto); return true; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).calculateReplace(mfrom, mto, eo)) { b = true; CHILD_UPDATED(i); } } if(b) { calculatesub(eo, eo, false); } return b; } bool MathStructure::replace(const MathStructure &mfrom1, const MathStructure &mto1, const MathStructure &mfrom2, const MathStructure &mto2) { if(equals(mfrom1, true, true)) { set(mto1); return true; } if(equals(mfrom2, true, true)) { set(mto2); return true; } bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).replace(mfrom1, mto1, mfrom2, mto2)) { b = true; CHILD_UPDATED(i); } } return b; } bool MathStructure::removeType(StructureType mtype) { if(m_type == mtype || (m_type == STRUCT_POWER && CHILD(0).type() == mtype)) { set(1); return true; } bool b = false; if(m_type == STRUCT_MULTIPLICATION) { for(long int i = 0; i < (long int) SIZE; i++) { if(CHILD(i).removeType(mtype)) { if(CHILD(i).isOne()) { ERASE(i); i--; } else { CHILD_UPDATED(i); } b = true; } } if(SIZE == 0) { set(1); } else if(SIZE == 1) { setToChild(1, true); } } else { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).removeType(mtype)) { b = true; CHILD_UPDATED(i); } } } return b; } MathStructure MathStructure::generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector, const EvaluationOptions &eo) const { if(steps < 1) { steps = 1; } MathStructure x_value(min); MathStructure y_value; MathStructure y_vector; y_vector.clearVector(); if(steps > 1000000) { CALCULATOR->error(true, _("Too many data points"), NULL); return y_vector; } MathStructure step(max); step.calculateSubtract(min, eo); step.calculateDivide(steps - 1, eo); if(!step.isNumber() || step.number().isNegative()) { CALCULATOR->error(true, _("The selected min and max do not result in a positive, finite number of data points"), NULL); return y_vector; } y_vector.resizeVector(steps, m_zero); if(x_vector) x_vector->resizeVector(steps, m_zero); for(int i = 0; i < steps; i++) { if(x_vector) { (*x_vector)[i] = x_value; } y_value = *this; y_value.replace(x_mstruct, x_value); y_value.eval(eo); y_vector[i] = y_value; if(x_value.isNumber()) x_value.number().add(step.number()); else x_value.calculateAdd(step, eo); if(CALCULATOR->aborted()) { y_vector.resizeVector(i, m_zero); if(x_vector) x_vector->resizeVector(i, m_zero); return y_vector; } } return y_vector; } MathStructure MathStructure::generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector, const EvaluationOptions &eo) const { MathStructure x_value(min); MathStructure y_value; MathStructure y_vector; y_vector.clearVector(); if(min != max) { MathStructure mtest(max); mtest.calculateSubtract(min, eo); if(!step.isZero()) mtest.calculateDivide(step, eo); if(step.isZero() || !mtest.isNumber() || mtest.number().isNegative()) { CALCULATOR->error(true, _("The selected min, max and step size do not result in a positive, finite number of data points"), NULL); return y_vector; } else if(mtest.number().isGreaterThan(1000000)) { CALCULATOR->error(true, _("Too many data points"), NULL); return y_vector; } mtest.number().round(); unsigned int steps = mtest.number().uintValue(); y_vector.resizeVector(steps, m_zero); if(x_vector) x_vector->resizeVector(steps, m_zero); } ComparisonResult cr = max.compare(x_value); size_t i = 0; while(COMPARISON_IS_EQUAL_OR_LESS(cr)) { if(x_vector) { if(i >= x_vector->size()) x_vector->addChild(x_value); else (*x_vector)[i] = x_value; } y_value = *this; y_value.replace(x_mstruct, x_value); y_value.eval(eo); if(i >= y_vector.size()) y_vector.addChild(y_value); else y_vector[i] = y_value; if(x_value.isNumber()) x_value.number().add(step.number()); else x_value.calculateAdd(step, eo); cr = max.compare(x_value); if(CALCULATOR->aborted()) { y_vector.resizeVector(i, m_zero); if(x_vector) x_vector->resizeVector(i, m_zero); return y_vector; } i++; } y_vector.resizeVector(i, m_zero); if(x_vector) x_vector->resizeVector(i, m_zero); return y_vector; } MathStructure MathStructure::generateVector(MathStructure x_mstruct, const MathStructure &x_vector, const EvaluationOptions &eo) const { MathStructure y_value; MathStructure y_vector; y_vector.clearVector(); for(size_t i = 1; i <= x_vector.countChildren(); i++) { if(CALCULATOR->aborted()) { y_vector.clearVector(); return y_vector; } y_value = *this; y_value.replace(x_mstruct, x_vector.getChild(i)); y_value.eval(eo); y_vector.addChild(y_value); } return y_vector; } void remove_zero_mul(MathStructure &m); void remove_zero_mul(MathStructure &m) { if(m.isMultiplication()) { for(size_t i = 0; i < m.size(); i++) { if(m[i].isZero()) { m.clear(true); return; } } } for(size_t i = 0; i < m.size(); i++) { remove_zero_mul(m[i]); } } bool MathStructure::differentiate(const MathStructure &x_var, const EvaluationOptions &eo) { if(CALCULATOR->aborted()) { transform(CALCULATOR->f_diff); addChild(x_var); addChild(m_one); return false; } if(equals(x_var)) { set(m_one); return true; } switch(m_type) { case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).differentiate(x_var, eo)) { CHILD_UPDATED(i); } } break; } case STRUCT_LOGICAL_AND: { bool b = true; for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).isComparison()) {b = false; break;} } if(b) { MathStructure mtest(*this); mtest.setType(STRUCT_MULTIPLICATION); if(mtest.differentiate(x_var, eo) && mtest.containsFunction(CALCULATOR->f_diff, true) <= 0) { set(mtest); break; } } } case STRUCT_BITWISE_AND: {} case STRUCT_BITWISE_OR: {} case STRUCT_BITWISE_XOR: {} case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_XOR: { if(containsRepresentativeOf(x_var, true, true) != 0) { transform(CALCULATOR->f_diff); addChild(x_var); addChild(m_one); return false; } clear(true); break; } case STRUCT_COMPARISON: { if(containsRepresentativeOf(x_var, true, true) != 0) { if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER || ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { if(!CHILD(1).isZero()) CHILD(0) -= CHILD(1); SET_CHILD_MAP(0) if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_LESS) negate(); MathStructure mstruct(*this); MathStructure mstruct2(*this); transform(CALCULATOR->f_heaviside); transform(CALCULATOR->f_dirac); mstruct2.transform(CALCULATOR->f_dirac); multiply(mstruct2); if(ct_comp == COMPARISON_EQUALS_GREATER || ct_comp == COMPARISON_EQUALS_LESS) multiply_nocopy(new MathStructure(2, 1, 0)); else multiply_nocopy(new MathStructure(-2, 1, 0)); mstruct.differentiate(x_var, eo); multiply(mstruct); return true; } transform(CALCULATOR->f_diff); addChild(x_var); addChild(m_one); return false; } } case STRUCT_UNIT: {} case STRUCT_NUMBER: { clear(true); break; } case STRUCT_POWER: { if(SIZE < 1) { clear(true); break; } else if(SIZE < 2) { setToChild(1, true); return differentiate(x_var, eo); } bool x_in_base = CHILD(0).containsRepresentativeOf(x_var, true, true) != 0; bool x_in_exp = CHILD(1).containsRepresentativeOf(x_var, true, true) != 0; if(x_in_base && !x_in_exp) { MathStructure exp_mstruct(CHILD(1)); MathStructure base_mstruct(CHILD(0)); if(!CHILD(1).isNumber() || !CHILD(1).number().add(-1)) CHILD(1) += m_minus_one; multiply(exp_mstruct); base_mstruct.differentiate(x_var, eo); multiply(base_mstruct); } else if(!x_in_base && x_in_exp) { MathStructure exp_mstruct(CHILD(1)); MathStructure mstruct(CALCULATOR->f_ln, &CHILD(0), NULL); multiply(mstruct); exp_mstruct.differentiate(x_var, eo); multiply(exp_mstruct); } else if(x_in_base && x_in_exp) { MathStructure exp_mstruct(CHILD(1)); MathStructure base_mstruct(CHILD(0)); exp_mstruct.differentiate(x_var, eo); base_mstruct.differentiate(x_var, eo); base_mstruct /= CHILD(0); base_mstruct *= CHILD(1); MathStructure mstruct(CALCULATOR->f_ln, &CHILD(0), NULL); mstruct *= exp_mstruct; mstruct += base_mstruct; multiply(mstruct); } else { clear(true); } break; } case STRUCT_FUNCTION: { if(o_function == CALCULATOR->f_sqrt && SIZE == 1) { if(CHILD(0).containsRepresentativeOf(x_var, true, true) != 0) { MathStructure base_mstruct(CHILD(0)); raise(m_minus_one); multiply(nr_half); base_mstruct.differentiate(x_var, eo); multiply(base_mstruct); } else { clear(true); } } else if(o_function == CALCULATOR->f_root && THIS_VALID_ROOT) { if(CHILD(0).containsRepresentativeOf(x_var, true, true) != 0) { MathStructure base_mstruct(CHILD(0)); MathStructure mexp(CHILD(1)); mexp.negate(); mexp += m_one; raise(mexp); divide(CHILD(0)[1]); base_mstruct.differentiate(x_var, eo); multiply(base_mstruct); } else { clear(true); } } else if(o_function == CALCULATOR->f_cbrt && SIZE == 1) { MathStructure base_mstruct(CHILD(0)); raise(Number(-2, 1, 0)); divide(nr_three); base_mstruct.differentiate(x_var, eo); multiply(base_mstruct); } else if(o_function == CALCULATOR->f_ln && SIZE == 1) { MathStructure mstruct(CHILD(0)); setToChild(1, true); inverse(); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_logn && SIZE == 2) { MathStructure mstruct(CALCULATOR->f_ln, &CHILD(1), NULL); setFunction(CALCULATOR->f_ln); ERASE(1) divide(mstruct); return differentiate(x_var, eo); } else if(o_function == CALCULATOR->f_beta && SIZE == 2) { MathStructure mstruct(CHILD(0)); setToChild(1, true); inverse(); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_arg && SIZE == 1) { MathStructure mstruct(CHILD(0)); setFunction(CALCULATOR->f_dirac); mstruct.differentiate(x_var, eo); multiply(mstruct); multiply(CALCULATOR->v_pi); negate(); } else if(o_function == CALCULATOR->f_gamma && SIZE == 1) { MathStructure mstruct(CHILD(0)); MathStructure mstruct2(*this); mstruct2.setFunction(CALCULATOR->f_digamma); multiply(mstruct2); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_factorial && SIZE == 1) { MathStructure mstruct(CHILD(0)); CHILD(0) += m_one; MathStructure mstruct2(*this); mstruct2.setFunction(CALCULATOR->f_digamma); multiply(mstruct2); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_besselj && SIZE == 2 && CHILD(0).isInteger()) { MathStructure mstruct(CHILD(1)); MathStructure mstruct2(*this); CHILD(0) += m_minus_one; mstruct2[0] += m_one; subtract(mstruct2); mstruct.differentiate(x_var, eo); multiply(mstruct); multiply(nr_half); } else if(o_function == CALCULATOR->f_bessely && SIZE == 2 && CHILD(0).isInteger()) { MathStructure mstruct(CHILD(1)); MathStructure mstruct2(*this); CHILD(0) += m_minus_one; mstruct2[0] += m_one; subtract(mstruct2); mstruct.differentiate(x_var, eo); multiply(mstruct); multiply(nr_half); } else if(o_function == CALCULATOR->f_erf && SIZE == 1) { MathStructure mdiff(CHILD(0)); MathStructure mexp(CHILD(0)); mexp ^= nr_two; mexp.negate(); set(CALCULATOR->v_e, true); raise(mexp); multiply(nr_two); multiply(CALCULATOR->v_pi); LAST ^= Number(-1, 2); mdiff.differentiate(x_var, eo); multiply(mdiff); } else if(o_function == CALCULATOR->f_erfc && SIZE == 1) { MathStructure mdiff(CHILD(0)); MathStructure mexp(CHILD(0)); mexp ^= nr_two; mexp.negate(); set(CALCULATOR->v_e, true); raise(mexp); multiply(Number(-2, 1)); multiply(CALCULATOR->v_pi); LAST ^= Number(-1, 2); mdiff.differentiate(x_var, eo); multiply(mdiff); } else if(o_function == CALCULATOR->f_li && SIZE == 1) { setFunction(CALCULATOR->f_ln); MathStructure mstruct(CHILD(0)); inverse(); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_Li && SIZE == 2) { CHILD(0) += m_minus_one; MathStructure mstruct(CHILD(1)); divide(mstruct); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_Ei && SIZE == 1) { MathStructure mexp(CALCULATOR->v_e); mexp ^= CHILD(0); MathStructure mdiff(CHILD(0)); mdiff.differentiate(x_var, eo); mexp *= mdiff; setToChild(1, true); inverse(); multiply(mexp); } else if(o_function == CALCULATOR->f_Si && SIZE == 1) { setFunction(CALCULATOR->f_sin); MathStructure marg(CHILD(0)); MathStructure mdiff(CHILD(0)); mdiff.differentiate(x_var, eo); divide(marg); multiply(mdiff); } else if(o_function == CALCULATOR->f_Ci && SIZE == 1) { setFunction(CALCULATOR->f_cos); MathStructure marg(CHILD(0)); MathStructure mdiff(CHILD(0)); mdiff.differentiate(x_var, eo); divide(marg); multiply(mdiff); } else if(o_function == CALCULATOR->f_Shi && SIZE == 1) { setFunction(CALCULATOR->f_sinh); MathStructure marg(CHILD(0)); MathStructure mdiff(CHILD(0)); mdiff.differentiate(x_var, eo); divide(marg); multiply(mdiff); } else if(o_function == CALCULATOR->f_Chi && SIZE == 1) { setFunction(CALCULATOR->f_cosh); MathStructure marg(CHILD(0)); MathStructure mdiff(CHILD(0)); mdiff.differentiate(x_var, eo); divide(marg); multiply(mdiff); } else if(o_function == CALCULATOR->f_abs && SIZE == 1) { MathStructure mstruct(CHILD(0)); inverse(); multiply(mstruct); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_signum && SIZE == 2) { MathStructure mstruct(CHILD(0)); ERASE(1) setFunction(CALCULATOR->f_dirac); multiply_nocopy(new MathStructure(2, 1, 0)); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_heaviside && SIZE == 1) { MathStructure mstruct(CHILD(0)); setFunction(CALCULATOR->f_dirac); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_lambert_w && (SIZE == 1 || (SIZE == 2 && CHILD(1).isZero()))) { MathStructure *mstruct = new MathStructure(*this); MathStructure *mstruct2 = new MathStructure(CHILD(0)); mstruct->add(m_one); mstruct->multiply(CHILD(0)); mstruct2->differentiate(x_var, eo); multiply_nocopy(mstruct2); divide_nocopy(mstruct); } else if(o_function == CALCULATOR->f_sin && SIZE == 1) { setFunction(CALCULATOR->f_cos); MathStructure mstruct(CHILD(0)); mstruct.calculateDivide(CALCULATOR->getRadUnit(), eo); if(mstruct != x_var) { mstruct.differentiate(x_var, eo); multiply(mstruct); } } else if(o_function == CALCULATOR->f_cos && SIZE == 1) { setFunction(CALCULATOR->f_sin); MathStructure mstruct(CHILD(0)); negate(); mstruct.calculateDivide(CALCULATOR->getRadUnit(), eo); if(mstruct != x_var) { mstruct.differentiate(x_var, eo); multiply(mstruct); } } else if(o_function == CALCULATOR->f_tan && SIZE == 1) { setFunction(CALCULATOR->f_tan); MathStructure mstruct(CHILD(0)); raise(2); add(nr_one); mstruct.differentiate(x_var, eo); multiply(mstruct, true); if(CALCULATOR->getRadUnit()) divide(CALCULATOR->getRadUnit()); } else if(o_function == CALCULATOR->f_sinh && SIZE == 1) { setFunction(CALCULATOR->f_cosh); MathStructure mstruct(CHILD(0)); mstruct.differentiate(x_var, eo); multiply(mstruct); } else if(o_function == CALCULATOR->f_cosh && SIZE == 1) { setFunction(CALCULATOR->f_sinh); MathStructure mstruct(CHILD(0)); mstruct.differentiate(x_var, eo); multiply(mstruct, true); } else if(o_function == CALCULATOR->f_tanh && SIZE == 1) { setFunction(CALCULATOR->f_tanh); MathStructure mstruct(CHILD(0)); raise(2); negate(); add(nr_one); mstruct.differentiate(x_var, eo); multiply(mstruct, true); } else if(o_function == CALCULATOR->f_asin && SIZE == 1) { MathStructure mstruct(CHILD(0)); mstruct.differentiate(x_var, eo); SET_CHILD_MAP(0); raise(2); negate(); add(m_one); raise(Number(-1, 2)); multiply(mstruct); } else if(o_function == CALCULATOR->f_acos && SIZE == 1) { MathStructure mstruct(CHILD(0)); mstruct.differentiate(x_var, eo); SET_CHILD_MAP(0); raise(2); negate(); add(m_one); raise(Number(-1, 2)); negate(); multiply(mstruct); } else if(o_function == CALCULATOR->f_atan && SIZE == 1) { MathStructure mstruct(CHILD(0)); mstruct.differentiate(x_var, eo); SET_CHILD_MAP(0); raise(2); add(m_one); raise(m_minus_one); multiply(mstruct); } else if(o_function == CALCULATOR->f_asinh && SIZE == 1) { MathStructure mstruct(CHILD(0)); mstruct.differentiate(x_var, eo); SET_CHILD_MAP(0); raise(2); add(m_one); raise(Number(-1, 2)); multiply(mstruct); } else if(o_function == CALCULATOR->f_acosh && SIZE == 1) { MathStructure mstruct(CHILD(0)); mstruct.differentiate(x_var, eo); SET_CHILD_MAP(0); MathStructure mfac(*this); add(m_minus_one); raise(Number(-1, 2)); mfac.add(m_one); mfac.raise(Number(-1, 2)); multiply(mfac); multiply(mstruct); } else if(o_function == CALCULATOR->f_atanh && SIZE == 1) { MathStructure mstruct(CHILD(0)); mstruct.differentiate(x_var, eo); SET_CHILD_MAP(0); raise(2); negate(); add(m_one); raise(m_minus_one); multiply(mstruct); } else if(o_function == CALCULATOR->f_sinc && SIZE == 1) { // diff(x)*(cos(x)/x-sin(x)/x^2) MathStructure m_cos(CALCULATOR->f_cos, &CHILD(0), NULL); if(CALCULATOR->getRadUnit()) m_cos[0].multiply(CALCULATOR->getRadUnit()); m_cos.divide(CHILD(0)); MathStructure m_sin(CALCULATOR->f_sin, &CHILD(0), NULL); if(CALCULATOR->getRadUnit()) m_sin[0].multiply(CALCULATOR->getRadUnit()); MathStructure mstruct(CHILD(0)); mstruct.raise(Number(-2, 1, 0)); m_sin.multiply(mstruct); MathStructure mdiff(CHILD(0)); mdiff.differentiate(x_var, eo); set(m_sin); negate(); add(m_cos); multiply(mdiff); } else if(o_function == CALCULATOR->f_integrate && CHILD(1) == x_var && (SIZE == 2 || (SIZE == 4 && CHILD(2).isUndefined() && CHILD(3).isUndefined()))) { SET_CHILD_MAP(0); } else if(o_function == CALCULATOR->f_diff && SIZE == 3 && CHILD(1) == x_var) { CHILD(2) += m_one; } else if(o_function == CALCULATOR->f_diff && SIZE == 2 && CHILD(1) == x_var) { APPEND(MathStructure(2, 1, 0)); } else if(o_function == CALCULATOR->f_diff && SIZE == 1 && x_var == (Variable*) CALCULATOR->v_x) { APPEND(x_var); APPEND(MathStructure(2, 1, 0)); } else { if(!eo.calculate_functions || !calculateFunctions(eo)) { transform(CALCULATOR->f_diff); addChild(x_var); addChild(m_one); return false; } else { EvaluationOptions eo2 = eo; eo2.calculate_functions = false; return differentiate(x_var, eo2); } } break; } case STRUCT_MULTIPLICATION: { MathStructure mstruct, vstruct; size_t idiv = 0; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isPower() && CHILD(i)[1].isNumber() && CHILD(i)[1].number().isNegative()) { if(idiv == 0) { if(CHILD(i)[1].isMinusOne()) { vstruct = CHILD(i)[0]; } else { vstruct = CHILD(i); vstruct[1].number().negate(); } } else { if(CHILD(i)[1].isMinusOne()) { vstruct.multiply(CHILD(i)[0], true); } else { vstruct.multiply(CHILD(i), true); vstruct[vstruct.size() - 1][1].number().negate(); } } idiv++; } } if(idiv == SIZE) { set(-1, 1); MathStructure mdiv(vstruct); mdiv ^= MathStructure(2, 1, 0); mdiv.inverse(); multiply(mdiv); MathStructure diff_u(vstruct); diff_u.differentiate(x_var, eo); multiply(diff_u, true); break; } else if(idiv > 0) { idiv = 0; for(size_t i = 0; i < SIZE; i++) { if(!CHILD(i).isPower() || !CHILD(i)[1].isNumber() || !CHILD(i)[1].number().isNegative()) { if(idiv == 0) { mstruct = CHILD(i); } else { mstruct.multiply(CHILD(i), true); } idiv++; } } MathStructure mdiv(vstruct); mdiv ^= MathStructure(2, 1, 0); MathStructure diff_v(vstruct); diff_v.differentiate(x_var, eo); MathStructure diff_u(mstruct); diff_u.differentiate(x_var, eo); vstruct *= diff_u; mstruct *= diff_v; set_nocopy(vstruct, true); subtract(mstruct); divide(mdiv); break; } if(SIZE > 2) { mstruct.set(*this); mstruct.delChild(mstruct.size()); MathStructure mstruct2(LAST); MathStructure mstruct3(mstruct); mstruct.differentiate(x_var, eo); mstruct2.differentiate(x_var, eo); mstruct *= LAST; mstruct2 *= mstruct3; set(mstruct, true); add(mstruct2); } else { mstruct = CHILD(0); MathStructure mstruct2(CHILD(1)); mstruct.differentiate(x_var, eo); mstruct2.differentiate(x_var, eo); mstruct *= CHILD(1); mstruct2 *= CHILD(0); set(mstruct, true); add(mstruct2); } break; } case STRUCT_SYMBOLIC: { if(representsNumber(true)) { clear(true); } else { transform(CALCULATOR->f_diff); addChild(x_var); addChild(m_one); return false; } break; } case STRUCT_VARIABLE: { if(eo.calculate_variables && o_variable->isKnown()) { if(eo.approximation != APPROXIMATION_EXACT || !o_variable->isApproximate()) { set(((KnownVariable*) o_variable)->get(), true); return differentiate(x_var, eo); } else if(containsRepresentativeOf(x_var, true, true) != 0) { transform(CALCULATOR->f_diff); addChild(x_var); addChild(m_one); return false; } } if(representsNumber(true)) { clear(true); break; } } default: { transform(CALCULATOR->f_diff); addChild(x_var); addChild(m_one); return false; } } remove_zero_mul(*this); return true; } bool integrate_info(const MathStructure &mstruct, const MathStructure &x_var, MathStructure &madd, MathStructure &mmul, MathStructure &mexp, bool radunit = false, bool mexp_as_x2 = false, bool mexp_as_fx = false) { if(radunit && mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[1] == CALCULATOR->getRadUnit()) return integrate_info(mstruct[0], x_var, madd, mmul, mexp, false, mexp_as_x2, mexp_as_fx); madd.clear(); if(mexp_as_x2 || mexp_as_fx) mexp = m_zero; else mexp = m_one; mmul = m_zero; if(!mexp_as_fx && mstruct == x_var) { if(radunit) return false; mmul = m_one; return true; } else if(mexp_as_x2 && mstruct.isPower()) { if(radunit) return false; if(mstruct[1].isNumber() && mstruct[1].number().isTwo() && mstruct[0] == x_var) { mexp = m_one; return true; } } else if(!mexp_as_fx && !mexp_as_x2 && mstruct.isPower() && mstruct[1].containsRepresentativeOf(x_var, true, true) == 0) { if(radunit) return false; if(mstruct[0] == x_var) { mexp = mstruct[1]; mmul = m_one; return true; } } else if(mstruct.isMultiplication() && mstruct.size() >= 2) { bool b_x = false; bool b_rad = false; bool b2 = false; size_t i_x = 0, i_rad = 0; for(size_t i = 0; i < mstruct.size(); i++) { if(!b_x && !mexp_as_fx && mstruct[i] == x_var) { b_x = true; i_x = i; } else if(!b_x && mexp_as_x2 && mstruct[i].isPower() && mstruct[i][1].isNumber() && mstruct[i][1].number().isTwo() && mstruct[i][0] == x_var) { b_x = true; b2 = true; i_x = i; } else if(!b_x && !mexp_as_fx && !mexp_as_x2 && mstruct[i].isPower() && mstruct[i][0] == x_var && mstruct[i][1].containsRepresentativeOf(x_var, true, true) == 0) { b_x = true; i_x = i; mexp = mstruct[i][1]; } else if(mstruct[i].containsRepresentativeOf(x_var, true, true) != 0) { if(!b_x && mexp_as_fx && (mexp.isZero() || mexp == mstruct[i])) { mexp = mstruct[i]; b_x = true; i_x = i; } else { return false; } } else if(!b_rad && radunit && mstruct[i] == CALCULATOR->getRadUnit()) { b_rad = true; i_rad = i; } } if(!b_x || (radunit && !b_rad)) return false; if(mstruct.size() == 1 || (radunit && mstruct.size() == 2)) { if(b2) mexp = m_one; else mmul = m_one; } else if(mstruct.size() == 2) { if(b2) { if(i_x == 1) mexp = mstruct[0]; else mexp = mstruct[1]; } else { if(i_x == 1) mmul = mstruct[0]; else mmul = mstruct[1]; } } else if(radunit && mstruct.size() == 3) { if((i_x == 1 && i_rad == 2) || (i_x == 2 && i_rad == 1)) { if(b2) mexp = mstruct[0]; else mmul = mstruct[0]; } else if((i_x == 0 && i_rad == 2) || (i_x == 2 && i_rad == 0)) { if(b2) mexp = mstruct[1]; else mmul = mstruct[1]; } else { if(b2) mexp = mstruct[2]; else mmul = mstruct[2]; } } else { if(b2) { mexp = mstruct; mexp.delChild(i_x + 1, true); if(radunit) { mexp.delChild(i_rad < i_x ? i_rad + 1 : i_rad, true); } } else { mmul = mstruct; mmul.delChild(i_x + 1, true); if(radunit) { mmul.delChild(i_rad < i_x ? i_rad + 1 : i_rad, true); } } } return true; } else if(mstruct.isAddition()) { mmul.setType(STRUCT_ADDITION); if(mexp_as_x2) mexp.setType(STRUCT_ADDITION); madd.setType(STRUCT_ADDITION); for(size_t i = 0; i < mstruct.size(); i++) { if(!mexp_as_fx && mstruct[i] == x_var) { if(mexp_as_x2 || mexp.isOne()) mmul.addChild(m_one); else return false; } else if(mexp_as_x2 && mstruct[i].isPower() && mstruct[i][1].isNumber() && mstruct[i][1].number().isTwo() && mstruct[i][0] == x_var) { mexp.addChild(m_one); } else if(!mexp_as_fx && !mexp_as_x2 && mstruct[i].isPower() && mstruct[i][0] == x_var && mstruct[i][1].containsRepresentativeOf(x_var, true, true) == 0) { if(mmul.size() == 0) { mexp = mstruct[i][1]; } else if(mexp != mstruct[i][1]) { return false; } mmul.addChild(m_one); } else if(mstruct[i].isMultiplication()) { bool b_x = false; bool b_rad = false; bool b2 = false; size_t i_x = 0, i_rad = 0; for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(!b_x && !mexp_as_fx && mstruct[i][i2] == x_var) { if(!mexp_as_x2 && !mexp.isOne()) return false; i_x = i2; b_x = true; } else if(!b_x && mexp_as_x2 && mstruct[i][i2].isPower() && mstruct[i][i2][1].isNumber() && mstruct[i][i2][1].number().isTwo() && mstruct[i][i2][0] == x_var) { b2 = true; i_x = i2; b_x = true; } else if(!b_x && !mexp_as_fx && !mexp_as_x2 && mstruct[i][i2].isPower() && mstruct[i][i2][0] == x_var && mstruct[i][i2][1].containsRepresentativeOf(x_var, true, true) == 0) { if(mmul.size() == 0) { mexp = mstruct[i][i2][1]; } else if(mexp != mstruct[i][i2][1]) { return false; } i_x = i2; b_x = true; } else if(mstruct[i][i2].containsRepresentativeOf(x_var, true, true) != 0) { if(!b_x && mexp_as_fx && (mexp.isZero() || mexp == mstruct[i][i2])) { mexp = mstruct[i][i2]; i_x = i2; b_x = true; } else { return false; } } else if(!b_rad && radunit && mstruct[i][i2] == CALCULATOR->getRadUnit()) { b_rad = true; i_rad = i2; } } if(radunit && !b_rad) return false; if(b_x) { if(mstruct[i].size() == 1) { if(b2) mexp.addChild(m_one); else mmul.addChild(m_one); } else if(radunit && mstruct[i].size() == 2) { if(b2) mexp.addChild(m_one); else mmul.addChild(m_one); } else { if(b2) { mexp.addChild(mstruct[i]); mexp[mexp.size() - 1].delChild(i_x + 1, true); if(radunit) mexp[mexp.size() - 1].delChild(i_rad < i_x ? i_rad + 1 : i_rad, true); mexp.childUpdated(mexp.size()); } else { mmul.addChild(mstruct[i]); mmul[mmul.size() - 1].delChild(i_x + 1, true); if(radunit) mmul[mmul.size() - 1].delChild(i_rad < i_x ? i_rad + 1 : i_rad, true); mmul.childUpdated(mmul.size()); } } } else { madd.addChild(mstruct[i]); if(radunit) { madd[madd.size() - 1].delChild(i_rad + 1, true); } } } else if(radunit && mstruct[i] == CALCULATOR->getRadUnit()) { madd.addChild(mstruct[i]); } else if(radunit || mstruct[i].containsRepresentativeOf(x_var, true, true) != 0) { if(!radunit && mexp_as_fx && (mexp.isZero() || mexp == mstruct[i])) { mexp = mstruct[i]; mmul.addChild(m_one); } else { return false; } } else { madd.addChild(mstruct[i]); } } if(mmul.size() == 0 && (!mexp_as_x2 || mexp.size() == 0)) { mmul.clear(); if(mexp_as_x2) mexp.clear(); return false; } if(mmul.size() == 0) mmul.clear(); else if(mmul.size() == 1) mmul.setToChild(1); if(mexp_as_x2) { if(mexp.size() == 0) mexp.clear(); else if(mexp.size() == 1) mexp.setToChild(1); } if(madd.size() == 0) madd.clear(); else if(madd.size() == 1) madd.setToChild(1); return true; } else if(!radunit && mexp_as_fx && mstruct.contains(x_var, true)) { mexp = mstruct; mmul = m_one; return true; } return false; } bool test_absln_comp_cmplx(const MathStructure &mstruct) { if(mstruct.number().isComplex() && (!mstruct.number().hasRealPart() || mstruct.number().hasPositiveSign()) && mstruct.number().internalImaginary()->isPositive()) return true; if(mstruct.isPower() && mstruct[1].isNumber() && mstruct[1].number().numeratorIsOne() && mstruct[0].representsNonComplex(true)) return true; if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsNonNegative(true)) { if(!test_absln_comp_cmplx(mstruct[i])) { return false; } } } return true; } else if(mstruct.isAddition()) { for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsNonNegative(true)) { if(!test_absln_comp_cmplx(mstruct[i])) { return false; } } } return true; } return false; } bool transform_absln(MathStructure &mstruct, int use_abs, bool definite_integral, const MathStructure &x_var, const EvaluationOptions &eo) { if(use_abs != 0 && (mstruct.representsNonComplex(true) || test_absln_comp_cmplx(mstruct))) { if(mstruct.representsNonPositive(true)) { mstruct.negate(); mstruct.transform(CALCULATOR->f_ln); } else if(!mstruct.representsNonNegative(true)) { mstruct ^= nr_two; mstruct.transform(CALCULATOR->f_ln); mstruct /= nr_two; } else { mstruct.transform(CALCULATOR->f_ln); } } else if(use_abs != 0 && !mstruct.representsComplex(true)) { if(definite_integral) use_abs = -1; CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(mstruct); EvaluationOptions eo2 = eo; eo2.expand = true; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.eval(eo2); CALCULATOR->endTemporaryStopMessages(); if(mtest.representsNonComplex(true) || test_absln_comp_cmplx(mtest)) { if(mstruct.representsNonPositive(true)) { mstruct.negate(); mstruct.transform(CALCULATOR->f_ln); } else if(!mtest.representsNonNegative(true)) { mstruct ^= nr_two; mstruct.transform(CALCULATOR->f_ln); mstruct /= nr_two; } else { mstruct.transform(CALCULATOR->f_ln); } } else if(mtest.representsComplex(true)) { mstruct.transform(CALCULATOR->f_ln); } else { if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { CALCULATOR->beginTemporaryStopMessages(); KnownVariable *var = new KnownVariable("", format_and_print(x_var), ((UnknownVariable*) x_var.variable())->interval()); var->ref(); mtest.replace(x_var, var); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.eval(eo2); CALCULATOR->endTemporaryStopMessages(); if(mtest.representsNonComplex(true) || test_absln_comp_cmplx(mtest)) { if(mstruct.representsNonPositive(true)) { mstruct.negate(); mstruct.transform(CALCULATOR->f_ln); } else if(!mtest.representsNonNegative(true)) { mstruct ^= nr_two; mstruct.transform(CALCULATOR->f_ln); mstruct /= nr_two; } else { mstruct.transform(CALCULATOR->f_ln); } } else if(!mtest.representsComplex(true)) { if(use_abs > 0) { CALCULATOR->error(false, "Integral assumed real", NULL); mstruct ^= nr_two; mstruct.transform(CALCULATOR->f_ln); mstruct /= nr_two; } else { MathStructure marg(CALCULATOR->f_arg, &mstruct, NULL); marg *= nr_one_i; mstruct.transform(CALCULATOR->f_abs); mstruct.transform(CALCULATOR->f_ln); mstruct += marg; } } else { mstruct.transform(CALCULATOR->f_ln); } var->destroy(); } else if(use_abs < 0) { MathStructure marg(CALCULATOR->f_arg, &mstruct, NULL); marg *= nr_one_i; mstruct.transform(CALCULATOR->f_abs); mstruct.transform(CALCULATOR->f_ln); mstruct += marg; } else { CALCULATOR->error(false, "Integral assumed real", NULL); mstruct ^= nr_two; mstruct.transform(CALCULATOR->f_ln); mstruct /= nr_two; } } } else { mstruct.transform(CALCULATOR->f_ln); } return true; } bool test_real(MathStructure &mstruct, int use_abs, bool definite_integral, const MathStructure &x_var, const EvaluationOptions &eo) { if(use_abs != 0 && mstruct.representsNonComplex(true)) { return true; } else if(use_abs != 0 && !mstruct.representsComplex(true)) { MathStructure m_interval(m_undefined); if(x_var.isVariable() && !x_var.variable()->isKnown()) m_interval = ((UnknownVariable*) x_var.variable())->interval(); if(definite_integral) use_abs = -1; CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(mstruct); EvaluationOptions eo2 = eo; eo2.expand = true; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.eval(eo2); CALCULATOR->endTemporaryStopMessages(); if(mtest.representsNonComplex(true)) { return true; } else if(mtest.representsComplex(true)) { return false; } else { if(!m_interval.isUndefined()) { CALCULATOR->beginTemporaryStopMessages(); mtest.replace(x_var, m_interval); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.eval(eo2); CALCULATOR->endTemporaryStopMessages(); if((use_abs > 0 && !mtest.representsComplex(true)) || (use_abs < 0 && mtest.representsNonComplex(true))) { if(use_abs > 0 && !mtest.representsNonComplex(true)) CALCULATOR->error(false, "Integral assumed real", NULL); return true; } else { return false; } } else if(use_abs < 0) { return false; } else { CALCULATOR->error(false, "Integral assumed real", NULL); return true; } } } return false; } int integrate_function(MathStructure &mstruct, const MathStructure &x_var, const EvaluationOptions &eo, const MathStructure &mpow, const MathStructure &mfac, const MathStructure &mpowadd, const MathStructure &mpowmul, int use_abs, bool definite_integral, int max_part_depth, vector *parent_parts) { if(!mpowadd.isZero() || !mpowmul.isOne()) { if(!mfac.isOne() || !mpow.isMinusOne()) return false; if((mstruct.function() == CALCULATOR->f_sin || mstruct.function() == CALCULATOR->f_cos || mstruct.function() == CALCULATOR->f_sinh || mstruct.function() == CALCULATOR->f_cosh || mstruct.function() == CALCULATOR->f_ln) && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(integrate_info(mstruct[0], x_var, madd, mmul, mexp, (mstruct.function() == CALCULATOR->f_sin || mstruct.function() == CALCULATOR->f_cos))) { if(mexp.isOne()) { if(mstruct.function() == CALCULATOR->f_sin) { //1/(d*sin(ax+b)+c)=(2 atan((c*tan((a x + b)/2)+d)/sqrt(c^2-d^2)))/(a*sqrt(c^2-d^2)) mstruct.setFunction(CALCULATOR->f_tan); mstruct[0] *= nr_half; mstruct *= mpowadd; if(!mpowmul.isOne()) mstruct += mpowmul; MathStructure msqrtc2md2(mpowadd); msqrtc2md2 ^= nr_two; if(!mpowmul.isOne()) { MathStructure mmpowmul2(mpowmul); mmpowmul2 ^= nr_two; mmpowmul2.negate(); msqrtc2md2 += mmpowmul2; } msqrtc2md2 ^= Number(-1, 2, 0); mstruct *= msqrtc2md2; mstruct.transform(CALCULATOR->f_atan); mstruct *= msqrtc2md2; if(!mmul.isOne()) mstruct /= mmul; mstruct *= nr_two; return true; } else if(mstruct.function() == CALCULATOR->f_cos) { //1/(d*cos(ax+b)+c)=-(2*atanh(((c-d)*tan((a x + b)/2))/sqrt(d^2-c^2)))/(a*sqrt(d^2-c^2)) mstruct.setFunction(CALCULATOR->f_tan); mstruct[0] *= nr_half; mstruct *= mpowadd; if(!mpowmul.isOne()) { mstruct.last() -= mpowmul; mstruct.childUpdated(mstruct.size()); } MathStructure msqrtc2md2(mpowadd); msqrtc2md2 ^= nr_two; msqrtc2md2.negate(); if(!mpowmul.isOne()) { MathStructure mmpowmul2(mpowmul); mmpowmul2 ^= nr_two; msqrtc2md2 += mmpowmul2; } msqrtc2md2 ^= Number(-1, 2, 0); mstruct *= msqrtc2md2; mstruct.transform(CALCULATOR->f_atanh); mstruct *= msqrtc2md2; if(!mmul.isOne()) mstruct /= mmul; mstruct *= Number(-2, 1); return true; } else if(mstruct.function() == CALCULATOR->f_sinh) { //1/(d*sinh(ax+b)+c)=(2 atan((-c*tan((a x + b)/2)+d)/sqrt(-c^2-d^2)))/(a*sqrt(-c^2-d^2)) mstruct.setFunction(CALCULATOR->f_tanh); mstruct[0] *= nr_half; mstruct *= mpowadd; mstruct.negate(); if(!mpowmul.isOne()) mstruct += mpowmul; MathStructure msqrtc2md2(mpowadd); msqrtc2md2 ^= nr_two; msqrtc2md2.negate(); if(!mpowmul.isOne()) { MathStructure mmpowmul2(mpowmul); mmpowmul2 ^= nr_two; mmpowmul2.negate(); msqrtc2md2 += mmpowmul2; } msqrtc2md2 ^= Number(-1, 2, 0); mstruct *= msqrtc2md2; mstruct.transform(CALCULATOR->f_atan); mstruct *= msqrtc2md2; if(!mmul.isOne()) mstruct /= mmul; mstruct *= nr_two; return true; } else if(mstruct.function() == CALCULATOR->f_cosh) { //1/(d*cos(ax+b)+c)=-(2*atan(((c-d)*tanh((a x + b)/2))/sqrt(d^2-c^2)))/(a*sqrt(d^2-c^2)) mstruct.setFunction(CALCULATOR->f_tanh); mstruct[0] *= nr_half; mstruct *= mpowadd; if(!mpowmul.isOne()) { mstruct.last() -= mpowmul; mstruct.childUpdated(mstruct.size()); } MathStructure msqrtc2md2(mpowadd); msqrtc2md2 ^= nr_two; msqrtc2md2.negate(); if(!mpowmul.isOne()) { MathStructure mmpowmul2(mpowmul); mmpowmul2 ^= nr_two; msqrtc2md2 += mmpowmul2; } msqrtc2md2 ^= Number(-1, 2, 0); mstruct *= msqrtc2md2; mstruct.transform(CALCULATOR->f_atan); mstruct *= msqrtc2md2; if(!mmul.isOne()) mstruct /= mmul; mstruct *= Number(-2, 1); return true; } else if(mstruct.function() == CALCULATOR->f_ln) { //1/(d*ln(ax+b)+c)=(e^(-c/d)*Ei(c/d+ln(ax+b)))/(a*d) MathStructure mpadm(mpowadd); if(!mpowmul.isOne()) mpadm /= mpowmul; mstruct += mpadm; mstruct.transform(CALCULATOR->f_Ei); mpadm.negate(); mstruct *= CALCULATOR->v_e; mstruct.last() ^= mpadm; mstruct.childUpdated(mstruct.size()); if(!mmul.isOne()) mstruct /= mmul; if(!mpowmul.isOne()) mstruct /= mpowmul; return true; } } else if(mstruct.function() == CALCULATOR->f_ln && madd.isZero()) { //1/(d*ln(ax^b)+c)=(x*(ax^b)^(-1/b)*e^(-c/(bd))*Ei((c+d*ln(ax^b))/(bd)))/(bd) MathStructure mem(mexp); if(!mpowmul.isOne()) mem *= mpowmul; mem.inverse(); MathStructure marg(mstruct[0]); mexp.inverse(); mexp.negate(); marg ^= mexp; MathStructure mexpe(CALCULATOR->v_e); if(!mpowadd.isZero()) { MathStructure mepow(mpowadd); mepow.negate(); mepow *= mem; mexpe ^= mepow; } if(!mpowmul.isOne()) mstruct *= mpowmul; if(!mpowadd.isZero()) mstruct += mpowadd; mstruct *= mem; mstruct.transform(CALCULATOR->f_Ei); if(!mpowadd.isZero()) mstruct *= mexpe; mstruct *= marg; mstruct *= x_var; mstruct *= mem; return true; } } } return false; } if(mstruct.function() == CALCULATOR->f_ln && mstruct.size() == 1) { if(mstruct[0].isFunction() && mstruct[0].function() == CALCULATOR->f_abs && mstruct[0].size() == 1 && mpow.isOne() && mfac.isOne() && mstruct[0][0].representsNonComplex(true)) { MathStructure mexp, mmul, madd; if(integrate_info(mstruct[0][0], x_var, madd, mmul, mexp) && mexp.isOne()) { MathStructure marg(mstruct[0][0]); MathStructure ln_x(CALCULATOR->f_ln, &marg, NULL); MathStructure ln_mx(ln_x); ln_mx[0].negate(); MathStructure sgn_x(ln_x); sgn_x.setFunction(CALCULATOR->f_signum); sgn_x.addChild(m_zero); mstruct = ln_x; mstruct -= ln_mx; mstruct *= sgn_x; mstruct += ln_mx; mstruct += ln_x; mstruct -= nr_two; mstruct *= marg; mstruct *= nr_half; if(!mmul.isOne()) mstruct /= mmul; return true; } } MathStructure mexp, mmul, madd; if(integrate_info(mstruct[0], x_var, madd, mmul, mexp, false, false, true) && (mexp == x_var || (mexp.isPower() && mexp[0] == x_var) || (mpow.isOne() && madd.isZero() && mexp.isFunction() && mexp.function() == CALCULATOR->f_root && VALID_ROOT(mexp) && mexp[0] == x_var) || (mpow.isOne() && madd.isZero() && mexp.isPower() && mexp[1].isInteger() && mexp[0].isFunction() && mexp[0].function() == CALCULATOR->f_root && VALID_ROOT(mexp[0]) && mexp[0][0] == x_var))) { bool b_root = false; if(mexp == x_var) mexp.set(1, 1, 0); else if(mexp.isPower() && mexp[0] == x_var) mexp.setToChild(2); else if(mexp.isPower()) {mexp[0].setToChild(2); mexp[0].number().recip(); mexp[0].number() *= mexp[1].number(); mexp.setToChild(1); b_root = true;} else {mexp.setToChild(2); mexp.number().recip(); b_root = true;} if(mfac.isOne() && (mexp.isOne() || madd.isZero())) { if(mpow.isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-1)) { if(mpow.isOne()) { if(madd.isZero()) { mstruct -= mexp; mstruct.multiply(x_var); return true; } mstruct.multiply(mstruct[0]); MathStructure mmulx(mmul); mmulx *= x_var; mstruct.subtract(mmulx); mstruct.divide(mmul); return true; } else if(mpow.number().isTwo()) { MathStructure marg(mstruct[0]); MathStructure mterm2(mstruct); mstruct ^= mpow; mterm2 *= Number(-2, 1); if(mexp.isOne()) { mterm2 += nr_two; } else { mterm2 *= mexp; mterm2 += mexp; mterm2.last() ^= nr_two; mterm2.last() *= nr_two; } mstruct += mterm2; if(madd.isZero()) { mstruct.multiply(x_var); } else { mstruct *= marg; if(!mmul.isOne()) mstruct /= mmul; } return true; } else if(mpow.number().isMinusOne()) { if(mexp.isOne()) { mstruct.setFunction(CALCULATOR->f_li); if(!mmul.isOne()) mstruct /= mmul; return true; } } else { unsigned long int n = mpow.number().uintValue(); MathStructure marg(mstruct[0]); Number nfac(mpow.number()); nfac.factorial(); for(size_t i = 0; i <= n; i++) { MathStructure mterm(CALCULATOR->f_ln, &marg, NULL); mterm ^= Number(i); mterm *= nfac; Number ifac(i); ifac.factorial(); mterm /= ifac; MathStructure m1pow(mexp); m1pow.negate(); m1pow ^= Number(n - i); mterm *= m1pow; if(i == 0) mstruct = mterm; else mstruct += mterm; } if(madd.isZero()) { mstruct.multiply(x_var); } else { mstruct *= marg; if(!mmul.isOne()) mstruct /= mmul; } return true; } } } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mfacexp.isMinusOne()) { if(mpow.isMinusOne()) { if(mexp.isOne() && madd.isZero()) { mstruct.transform(CALCULATOR->f_ln); return true; } } else if(madd.isZero()) { MathStructure mpowp1(mpow); mpowp1 += m_one; mstruct ^= mpowp1; mstruct /= mpowp1; if(!mexp.isOne()) mstruct /= mexp; return true; } else if(mpow.isOne()) { MathStructure m_axcb(x_var); if(!mexp.isOne()) m_axcb ^= mexp; if(!mmul.isOne()) m_axcb *= mmul; if(!madd.isZero()) m_axcb /= madd; mstruct *= m_axcb; mstruct.last().negate(); mstruct.last().transform(CALCULATOR->f_ln); MathStructure mterm2(m_axcb); mterm2 += m_one; mterm2.transform(CALCULATOR->f_Li); mterm2.insertChild(nr_two, 1); mstruct += mterm2; if(!mexp.isOne()) mstruct /= mexp; return true; } } else if(madd.isZero()) { if(mpow.isOne()) { mfacexp += m_one; mstruct *= mfacexp; mstruct -= mexp; mstruct *= x_var; mstruct.last() ^= mfacexp; mfacexp ^= Number(-2, 1); mstruct *= mfacexp; mstruct.childrenUpdated(); return true; } else if(mpow.isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-100)) { if(mpow.isMinusOne()) { if(mexp.isOne()) { MathStructure mmulfac(mmul); if(!mmul.isOne()) { mmulfac *= x_var; mmulfac ^= mfacexp; mmulfac[1].negate(); mmulfac *= x_var; mmulfac.last() ^= mfacexp; mmulfac.childrenUpdated(true); } mfacexp += m_one; mstruct *= mfacexp; mstruct.transform(CALCULATOR->f_Ei); if(!mmul.isOne()) { mstruct *= mmulfac; mstruct /= mmul; } return true; } else { MathStructure mepow(mstruct); mfacexp += m_one; mstruct *= mfacexp; mstruct /= mexp; mstruct.transform(CALCULATOR->f_Ei); mepow.negate(); mepow += x_var; mepow.last().transform(CALCULATOR->f_ln); mepow.last() *= mexp; mepow *= mfacexp; mepow /= mexp; MathStructure memul(CALCULATOR->v_e); memul ^= mepow; mstruct *= memul; mstruct /= mexp; return true; } } else if(mpow.number().isNegative()) { if(mexp.isOne()) { MathStructure mpowp1(mpow); mpowp1 += m_one; MathStructure mpowp1n(mpowp1); mpowp1n.negate(); MathStructure mterm(mstruct); mstruct ^= mpowp1; mstruct *= x_var; mstruct.last() ^= mfacexp; if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mfacexp += m_one; mstruct *= mfacexp; mstruct /= mpowp1n; mterm ^= mpowp1; mterm *= x_var; mterm.last() ^= mfacexp; mterm /= mpowp1n; mstruct -= mterm; mstruct.childrenUpdated(true); return true; } } else { MathStructure mterm(mstruct); mstruct ^= mpow; mstruct.last() += nr_minus_one; mstruct *= x_var; mstruct.last() ^= mfacexp; if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct *= mpow; mfacexp += m_one; mstruct /= mfacexp; mstruct.negate(); mstruct *= mexp; mterm ^= mpow; mterm *= x_var; mterm.last() ^= mfacexp; mterm /= mfacexp; mstruct += mterm; mstruct.childrenUpdated(true); return true; } } } else if(mfac == x_var && mexp.isOne()) { if(mpow.isOne()) { MathStructure mterm2(x_var); if(!mmul.isOne()) mterm2 *= mmul; mterm2 += madd; mterm2.last() *= Number(-2, 1); mterm2 *= x_var; if(!mmul.isOne()) mterm2 /= mmul; mterm2 *= Number(-1, 4); MathStructure marg(x_var); if(!mmul.isOne()) marg *= mmul; marg += madd; mstruct *= marg; marg.last() *= nr_minus_one; mstruct *= marg; if(!mmul.isOne()) { mstruct *= mmul; mstruct.last() ^= Number(-2, 1); } mstruct *= nr_half; mstruct += mterm2; mstruct.childrenUpdated(true); return true; } } } else if(!b_root && mfac.isFunction() && mfac.function() == CALCULATOR->f_ln && mfac.size() == 1 && madd.isZero() && mpow.isOne()) { MathStructure mexp2, mmul2, madd2; if(integrate_info(mfac[0], x_var, madd2, mmul2, mexp2) && madd2.isZero()) { MathStructure mterm2(mfac); mterm2.negate(); mterm2 += nr_two; if(!mexp2.isOne()) { mterm2.last() *= mexp2; mterm2.childUpdated(mterm2.size()); } if(!mexp.isOne()) mterm2 *= mexp; mstruct *= mfac; if(!mexp2.isOne()) { mstruct.last() -= mexp2; mstruct.childUpdated(mstruct.size()); } mstruct += mterm2; mstruct *= x_var; return true; } } } } else if(mstruct.function() == CALCULATOR->f_lambert_w && (mstruct.size() == 1 || (mstruct.size() == 2 && mstruct[1].isZero())) && mstruct[0] == x_var) { if(mpow.isOne() && mfac.isOne()) { MathStructure *mthis = new MathStructure(mstruct); mstruct.subtract(m_one); mthis->inverse(); mstruct.add_nocopy(mthis); mstruct.multiply(x_var); return true; } return false; } else if(mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1) { if(mstruct[0].representsNonComplex(true) && mpow.representsNonComplex(true)) { if(mpow.isOne()) { MathStructure minteg(x_var); if(!mfac.isOne()) minteg *= mfac; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct.setFunction(CALCULATOR->f_signum); mstruct.addChild(m_one); mstruct *= minteg; return true; } if(mfac.isOne()) { MathStructure mexp, mmul, madd; if(integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { MathStructure marg(mstruct[0]); mstruct.setFunction(CALCULATOR->f_signum); mstruct.addChild(m_zero); MathStructure mterm2(mstruct); MathStructure mpowp1(mpow); mpowp1 += m_one; marg ^= mpowp1; mstruct += m_one; mstruct *= marg; marg[0].negate(); mterm2 += nr_minus_one; mterm2 *= marg; mstruct += mterm2; if(!mmul.isOne()) mstruct /= mmul; mstruct /= mpowp1; mstruct *= nr_half; return true; } } } } else if(mstruct.function() == CALCULATOR->f_signum && mstruct.size() == 2) { if(mstruct[0].representsNonComplex(true) && mpow.isNumber() && mpow.number().isRational() && mpow.number().isPositive()) { MathStructure minteg(x_var); if(!mfac.isOne()) { minteg = mfac; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; } if(!mpow.number().isInteger()) { MathStructure mmul(-1, 1, 0); Number nr_frac(mpow.number()); Number nr_int(mpow.number()); nr_frac.frac(); nr_int.trunc(); mmul ^= nr_frac; if(nr_int.isEven()) mmul += nr_minus_one; else mmul += m_one; mstruct *= mmul; mstruct -= mmul[0]; if(nr_int.isEven()) mstruct += nr_minus_one; else mstruct += m_one; if(nr_int.isEven()) mstruct.negate(); mstruct /= nr_two; } else if(mpow.number().isEven()) { mstruct ^= nr_two; mstruct += nr_three; mstruct *= Number(1, 4); } mstruct *= minteg; return true; } } else if(mstruct.function() == CALCULATOR->f_dirac && mstruct.size() == 1 && mstruct[0].representsNonComplex(true)) { MathStructure mexp, mmul, madd; if(mpow.isOne() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac == x_var && madd.representsNonZero()) { mstruct.setFunction(CALCULATOR->f_heaviside); if(!mmul.isOne()) { mmul ^= nr_two; mstruct /= mmul; } mstruct *= madd; mstruct.negate(); return true; } else if(mfac.isPower() && mfac[0] == x_var && madd.representsNonZero()) { mstruct.setFunction(CALCULATOR->f_heaviside); madd.negate(); madd ^= mfac[1]; mstruct *= madd; if(mmul.isOne()) { mexp = mfac[1]; mexp += m_one; mexp.negate(); mmul ^= mexp; mstruct *= mmul; } return true; } else if(mfac.isOne()) { mstruct.setFunction(CALCULATOR->f_heaviside); if(!mmul.isOne()) mstruct /= mmul; return true; } } return false; } else if(mstruct.function() == CALCULATOR->f_arg && mstruct.size() == 1 && mstruct[0].representsNonComplex(true)) { MathStructure mexp, mmul, madd; if(mpow.representsPositive() && integrate_info(mstruct[0], x_var, madd, mmul, mexp)) { MathStructure minteg(x_var); if(!mfac.isOne()) { minteg = mfac; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; } mstruct.setFunction(CALCULATOR->f_signum); mstruct += nr_minus_one; mstruct *= CALCULATOR->v_pi; if(!mpow.isOne()) { mstruct.last() ^= mpow; mstruct.childUpdated(mstruct.size()); } mstruct *= Number(-1, 2); mstruct *= minteg; return true; } return false; } else if(mstruct.function() == CALCULATOR->f_heaviside && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isOne() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac.isOne()) { if(mmul.representsNonNegative()) { MathStructure mfacn(x_var); if(!madd.isZero()) { if(!mmul.isOne()) madd /= mmul; mfacn += madd; } mstruct *= mfacn; return true; } else if(mmul.representsNegative()) { if(madd.isZero()) { mstruct[0] = x_var; mstruct *= x_var; mstruct.negate(); mstruct += x_var; return true; } mstruct.setToChild(1); mmul.negate(); madd.negate(); mstruct /= mmul; MathStructure mfacn(x_var); mfacn *= mmul; mfacn += madd; mfacn.transform(CALCULATOR->f_heaviside); mstruct *= mfacn; mstruct += x_var; return true; } } } return false; } else if(mstruct.function() == CALCULATOR->f_sin && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-2) && !mpow.isZero() && integrate_info(mstruct[0], x_var, madd, mmul, mexp, true)) { if(mfac.isOne() && mexp.isOne()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_cos); mstruct.multiply(m_minus_one); if(!mmul.isOne()) mstruct.divide(mmul); } else if(mpow.number().isTwo()) { if(!madd.isZero()) { mstruct[0] = x_var; mstruct[0] *= CALCULATOR->getRadUnit(); } mstruct[0] *= nr_two; mstruct /= 4; if(madd.isZero() && !mmul.isOne()) mstruct /= mmul; mstruct.negate(); MathStructure xhalf(x_var); xhalf *= nr_half; mstruct += xhalf; if(!madd.isZero()) { MathStructure marg(x_var); if(!mmul.isOne()) marg *= mmul; marg += madd; mstruct.replace(x_var, marg); if(!mmul.isOne()) mstruct.divide(mmul); } } else if(mpow.number().isMinusOne()) { MathStructure mcot(mstruct); mcot.setFunction(CALCULATOR->f_tan); mcot.inverse(); mstruct.inverse(); mstruct += mcot; if(!transform_absln(mstruct, use_abs, definite_integral, x_var, eo)) return -1; if(!mmul.isOne()) mstruct.divide(mmul); mstruct.negate(); } else if(mpow.number() == -2) { mstruct.setFunction(CALCULATOR->f_tan); mstruct.inverse(); mstruct.negate(); if(!mmul.isOne()) mstruct.divide(mmul); } else { MathStructure mbak(mstruct); MathStructure nm1(mpow); nm1 += nr_minus_one; mstruct ^= nm1; MathStructure mcos(mbak); mcos.setFunction(CALCULATOR->f_cos); mstruct *= mcos; mstruct.negate(); mmul *= mpow; mstruct /= mmul; MathStructure minteg(mbak); MathStructure nm2(mpow); nm2 += Number(-2, 1); minteg ^= nm2; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; minteg *= nm1; minteg /= mpow; mstruct += minteg; } return true; } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mfacexp.isMinusOne() && !mexp.isZero()) { if(madd.isZero()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_Si); if(!mexp.isOne()) mstruct /= mexp; return true; } else if(mpow.number().isTwo()) { mstruct[0] *= nr_two; mstruct.setFunction(CALCULATOR->f_Ci); if(!mexp.isOne()) mstruct /= mexp; mstruct.negate(); mstruct += x_var; if(transform_absln(mstruct.last(), use_abs, definite_integral, x_var, eo)) return -1; mstruct *= nr_half; return true; } else if(mpow.number() == 3) { mstruct.setFunction(CALCULATOR->f_Si); MathStructure mterm2(mstruct); mstruct[0] *= nr_three; mterm2 *= Number(-3, 1); mstruct += mterm2; if(!mexp.isOne()) mstruct /= mexp; mstruct *= Number(-1, 4); return true; } } else if(mpow.isOne()) { MathStructure mterm2; mstruct = x_var; if(!mexp.isOne()) mstruct ^= mexp; if(!mmul.isOne()) mstruct *= mmul; if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); mstruct.transform(CALCULATOR->f_Si); if(CALCULATOR->getRadUnit()) madd *= CALCULATOR->getRadUnit(); mstruct *= MathStructure(CALCULATOR->f_cos, &madd, NULL); mterm2 = x_var; if(!mexp.isOne()) mterm2 ^= mexp; if(!mmul.isOne()) mterm2 *= mmul; if(CALCULATOR->getRadUnit()) mterm2 *= CALCULATOR->getRadUnit(); mterm2.transform(CALCULATOR->f_Ci); mterm2 *= MathStructure(CALCULATOR->f_sin, &madd, NULL); mstruct += mterm2; if(!mexp.isOne()) mstruct /= mexp; return true; } } else if(mexp.isOne() && mpow.isOne()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct); mterm2.setFunction(CALCULATOR->f_cos); mterm2 *= x_var; if(!mmul.isOne()) { mterm2 /= mmul; mmul ^= nr_two; mstruct /= mmul; } mstruct -= mterm2; return true; } else if(mfacexp.isInteger() && mfacexp.number().isPositive() && mfacexp.number().isLessThan(100)) { mstruct.setFunction(CALCULATOR->f_cos); MathStructure mterm2(mstruct); mterm2 *= x_var; mterm2.last() ^= mfacexp; mterm2.childUpdated(mterm2.size()); if(!mmul.isOne()) mterm2 /= mmul; mstruct *= x_var; mstruct.last() ^= mfacexp; mstruct.childUpdated(mstruct.size()); mstruct.last().last() += nr_minus_one; if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct *= mfacexp; if(!mmul.isOne()) mstruct /= mmul; mstruct -= mterm2; return true; } else if(madd.isZero() && mfacexp.isInteger() && mfacexp.number().isNegative() && mfacexp.number().isGreaterThan(-100)) { mfacexp += m_one; MathStructure mterm2(mstruct); mterm2 *= x_var; mterm2.last() ^= mfacexp; mterm2.childUpdated(mterm2.size()); mterm2 /= mfacexp; mstruct.setFunction(CALCULATOR->f_cos); mstruct *= x_var; mstruct.last() ^= mfacexp; mstruct.childUpdated(mstruct.size()); if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct /= mfacexp; mstruct.negate(); if(!mmul.isOne()) mstruct *= mmul; mstruct += mterm2; return true; } } else if(mexp.isOne() && mpow.number().isTwo()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct); MathStructure mterm3(x_var); mterm3 ^= nr_two; mterm3 *= Number(1, 4); mterm2[0] *= nr_two; mterm2 *= x_var; if(!mmul.isOne()) mterm2 /= mmul; mterm2 *= Number(-1, 4); mstruct.setFunction(CALCULATOR->f_cos); mstruct[0] *= nr_two; if(!mmul.isOne()) { mmul ^= nr_two; mstruct /= mmul; } mstruct *= Number(-1, 8); mstruct += mterm2; mstruct += mterm3; mstruct.childrenUpdated(true); return true; } else if(mfacexp.number().isTwo()) { MathStructure mterm2(mstruct); MathStructure mterm3(x_var); mterm3 ^= nr_three; mterm3 *= Number(1, 6); mterm2[0] *= nr_two; MathStructure mterm21(1, 8, 0); if(!mmul.isOne()) { mterm21 *= mmul; mterm21.last() ^= Number(-3, 1); } MathStructure mterm22(x_var); mterm22 ^= 2; if(!mmul.isOne()) mterm22 /= mmul; mterm22 *= Number(-1, 4); mterm21 += mterm22; mterm2 *= mterm21; mstruct.setFunction(CALCULATOR->f_cos); mstruct[0] *= nr_two; mstruct *= x_var; if(!mmul.isOne()) { mmul ^= nr_two; mstruct /= mmul; } mstruct *= Number(-1, 4); mstruct += mterm2; mstruct += mterm3; mstruct.childrenUpdated(true); return true; } } } else if(mexp.isOne() && mfac.isFunction()) { if(mfac.function() == CALCULATOR->f_sin && mfac.size() == 1 && mpow.isOne()) { MathStructure mexpf, mmulf, maddf; if(integrate_info(mfac[0], x_var, maddf, mmulf, mexpf, true) && mexpf.isOne() && mmul != mmulf) { MathStructure mterm2(mstruct); mterm2[0] += mfac[0]; mstruct[0] -= mfac[0]; MathStructure mden1(mmul); mden1 -= mmulf; mden1 *= nr_two; MathStructure mden2(mmul); mden2 += mmulf; mden2 *= nr_two; mterm2 /= mden2; mstruct /= mden1; mstruct -= mterm2; return true; } } else if(mfac.function() == CALCULATOR->f_cos && mfac.size() == 1) { if(mstruct[0] == mfac[0]) { UnknownVariable *var = new UnknownVariable("", format_and_print(mstruct)); var->ref(); MathStructure mtest(var); if(!mpow.isOne()) mtest ^= mpow; CALCULATOR->beginTemporaryStopMessages(); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(mstruct); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(mstruct); } if(mtest.integrate(var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); mtest.replace(var, mstruct); var->destroy(); mstruct = mtest; return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } else if(mpow.isOne()) { MathStructure mexpf, mmulf, maddf; if(integrate_info(mfac[0], x_var, maddf, mmulf, mexpf, true) && mexpf.isOne()) { if(mmul != mmulf) { mstruct.setFunction(CALCULATOR->f_cos); MathStructure mterm2(mstruct); mterm2[0] += mfac[0]; mstruct[0] -= mfac[0]; MathStructure mden1(mmul); mden1 -= mmulf; mden1 *= nr_two; MathStructure mden2(mmul); mden2 += mmulf; mden2 *= nr_two; mterm2 /= mden2; mstruct /= mden1; mstruct.negate(); mstruct -= mterm2; return true; } else if(madd == maddf) { mstruct ^= nr_two; if(!mmul.isOne()) mstruct /= mmul; mstruct *= nr_half; return true; } else { MathStructure mterm2(mfac); mterm2[0].add(mstruct[0]); mterm2.childUpdated(1); if(!mmul.isOne()) mterm2 /= mmul; mterm2 *= Number(-1, 4); mstruct[0] = maddf; mstruct[0] -= madd; mstruct[0] *= CALCULATOR->getRadUnit(); mstruct.childUpdated(1); mstruct *= x_var; mstruct *= Number(-1, 2); mstruct += mterm2; return true; } } } } } } } else if(mstruct.function() == CALCULATOR->f_cos && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-2) && !mpow.isZero() && integrate_info(mstruct[0], x_var, madd, mmul, mexp, true)) { if(mfac.isOne() && mexp.isOne()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_sin); if(!mmul.isOne()) mstruct.divide(mmul); } else if(mpow.number().isTwo()) { mstruct.setFunction(CALCULATOR->f_sin); if(!madd.isZero()) { mstruct[0] = x_var; mstruct[0] *= CALCULATOR->getRadUnit(); } mstruct[0] *= nr_two; mstruct /= 4; if(madd.isZero() && !mmul.isOne()) mstruct /= mmul; MathStructure xhalf(x_var); xhalf *= nr_half; mstruct += xhalf; if(!madd.isZero()) { MathStructure marg(x_var); if(!mmul.isOne()) marg *= mmul; marg += madd; mstruct.replace(x_var, marg); if(!mmul.isOne()) mstruct.divide(mmul); } } else if(mpow.number().isMinusOne()) { MathStructure mtan(mstruct); mtan.setFunction(CALCULATOR->f_tan); mstruct.inverse(); mstruct += mtan; if(!transform_absln(mstruct, use_abs, definite_integral, x_var, eo)) return -1; if(!mmul.isOne()) mstruct.divide(mmul); } else if(mpow.number() == -2) { mstruct.setFunction(CALCULATOR->f_tan); if(!mmul.isOne()) mstruct.divide(mmul); } else { MathStructure mbak(mstruct); MathStructure nm1(mpow); nm1 += nr_minus_one; mstruct ^= nm1; MathStructure msin(mbak); msin.setFunction(CALCULATOR->f_sin); mstruct *= msin; mmul *= mpow; mstruct /= mmul; MathStructure minteg(mbak); MathStructure nm2(mpow); nm2 += Number(-2, 1); minteg ^= nm2; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; minteg *= nm1; minteg /= mpow; mstruct += minteg; } return true; } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mfacexp.isMinusOne() && !mexp.isZero()) { if(madd.isZero()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_Ci); if(!mexp.isOne()) mstruct /= mexp; return true; } else if(mpow.number().isTwo()) { mstruct[0] *= nr_two; mstruct.setFunction(CALCULATOR->f_Ci); if(!mexp.isOne()) mstruct /= mexp; mstruct += x_var; mstruct.last().transform(CALCULATOR->f_ln); mstruct *= nr_half; return true; } else if(mpow.number() == 3) { mstruct.setFunction(CALCULATOR->f_Ci); MathStructure mterm2(mstruct); mstruct[0] *= nr_three; mterm2 *= Number(3, 1); mstruct += mterm2; if(!mexp.isOne()) mstruct /= mexp; mstruct *= Number(1, 4); return true; } } else if(mpow.isOne()) { MathStructure mterm2; mstruct = x_var; if(!mexp.isOne()) mstruct ^= mexp; if(!mmul.isOne()) mstruct *= mmul; if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); mstruct.transform(CALCULATOR->f_Ci); if(CALCULATOR->getRadUnit()) madd *= CALCULATOR->getRadUnit(); mstruct *= MathStructure(CALCULATOR->f_cos, &madd, NULL); mterm2 = x_var; if(!mexp.isOne()) mterm2 ^= mexp; if(!mmul.isOne()) mterm2 *= mmul; if(CALCULATOR->getRadUnit()) mterm2 *= CALCULATOR->getRadUnit(); mterm2.transform(CALCULATOR->f_Si); mterm2 *= MathStructure(CALCULATOR->f_sin, &madd, NULL); mstruct -= mterm2; if(!mexp.isOne()) mstruct /= mexp; return true; } } else if(mexp.isOne() && mpow.isOne()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct); mterm2.setFunction(CALCULATOR->f_sin); mterm2 *= x_var; if(!mmul.isOne()) { mterm2 /= mmul; mmul ^= nr_two; mstruct /= mmul; } mstruct += mterm2; return true; } else if(mfacexp.isInteger() && mfacexp.number().isPositive() && mfacexp.number().isLessThan(100)) { mstruct.setFunction(CALCULATOR->f_sin); MathStructure mterm2(mstruct); mterm2 *= x_var; mterm2.last() ^= mfacexp; if(!mmul.isOne()) mterm2 /= mmul; mstruct *= x_var; mstruct.last() ^= mfacexp; mstruct.last().last() += nr_minus_one; if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct *= mfacexp; if(!mmul.isOne()) mstruct /= mmul; mstruct.negate(); mstruct += mterm2; mstruct.childrenUpdated(true); return true; } else if(madd.isZero() && mfacexp.isInteger() && mfacexp.number().isNegative() && mfacexp.number().isGreaterThan(-100)) { mfacexp += m_one; MathStructure mterm2(mstruct); mterm2 *= x_var; mterm2.last() ^= mfacexp; mterm2.childUpdated(mterm2.size()); mterm2 /= mfacexp; mstruct.setFunction(CALCULATOR->f_sin); mstruct *= x_var; mstruct.last() ^= mfacexp; mstruct.childUpdated(mstruct.size()); if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct /= mfacexp; if(!mmul.isOne()) mstruct *= mmul; mstruct += mterm2; return true; } } else if(mexp.isOne() && mpow.number().isTwo()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct); mterm2.setFunction(CALCULATOR->f_sin); MathStructure mterm3(x_var); mterm3 ^= nr_two; mterm3 *= Number(1, 4); mterm2[0] *= nr_two; mterm2 *= x_var; if(!mmul.isOne()) mterm2 /= mmul; mterm2 *= Number(1, 4); mstruct[0] *= nr_two; if(!mmul.isOne()) { mmul ^= nr_two; mstruct /= mmul; } mstruct *= Number(1, 8); mstruct += mterm2; mstruct += mterm3; return true; } else if(mfacexp.number().isTwo()) { MathStructure mterm2(mstruct); mterm2.setFunction(CALCULATOR->f_sin); MathStructure mterm3(x_var); mterm3 ^= nr_three; mterm3 *= Number(1, 6); mterm2[0] *= nr_two; MathStructure mterm21(-1, 8, 0); if(!mmul.isOne()) { mterm21 *= mmul; mterm21.last() ^= Number(-3, 1); } MathStructure mterm22(x_var); mterm22 ^= 2; if(!mmul.isOne()) mterm22 /= mmul; mterm22 *= Number(1, 4); mterm21 += mterm22; mterm2 *= mterm21; mstruct[0] *= nr_two; mstruct *= x_var; if(!mmul.isOne()) { mmul ^= nr_two; mstruct /= mmul; } mstruct *= Number(1, 4); mstruct += mterm2; mstruct += mterm3; mstruct.childrenUpdated(true); return true; } } } else if(mexp.isOne() && mfac.isFunction()) { if(mfac.function() == CALCULATOR->f_cos && mfac.size() == 1 && mpow.isOne()) { MathStructure mexpf, mmulf, maddf; if(integrate_info(mfac[0], x_var, maddf, mmulf, mexpf, true) && mexpf.isOne() && mmulf != mmul) { mstruct.setFunction(CALCULATOR->f_sin); MathStructure mterm2(mstruct); mterm2[0] += mfac[0]; mstruct[0] -= mfac[0]; MathStructure mden1(mmul); mden1 -= mmulf; mden1 *= nr_two; MathStructure mden2(mmul); mden2 += mmulf; mden2 *= nr_two; mterm2 /= mden2; mstruct /= mden1; mstruct += mterm2; mstruct.childrenUpdated(true); return true; } } else if(mfac.function() == CALCULATOR->f_sin && mfac.size() == 1) { if(mstruct[0] == mfac[0]) { UnknownVariable *var = new UnknownVariable("", format_and_print(mstruct)); var->ref(); MathStructure mtest(var); if(!mpow.isOne()) mtest ^= mpow; mtest.negate(); CALCULATOR->beginTemporaryStopMessages(); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(mstruct); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(mstruct); } if(mtest.integrate(var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); mtest.replace(var, mstruct); var->destroy(); mstruct = mtest; return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } } } } else if(mstruct.function() == CALCULATOR->f_tan && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mfac.isOne() && mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-1) && !mpow.isZero() && integrate_info(mstruct[0], x_var, madd, mmul, mexp, true) && mexp.isOne()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_cos); if(!transform_absln(mstruct, use_abs, definite_integral, x_var, eo)) return -1; mstruct.negate(); if(!mmul.isOne()) mstruct.divide(mmul); } else if(mpow.number().isMinusOne()) { mstruct.setFunction(CALCULATOR->f_sin); if(!transform_absln(mstruct, use_abs, definite_integral, x_var, eo)) return -1; if(!mmul.isOne()) mstruct.divide(mmul); } else if(mpow.number().isTwo()) { MathStructure marg(x_var); if(!mmul.isOne()) marg *= mmul; marg += madd; mstruct -= marg; if(!mmul.isOne()) mstruct.divide(mmul); } else { MathStructure minteg(mstruct); MathStructure nm1(mpow); nm1 += nr_minus_one; mstruct ^= nm1; mmul *= nm1; mstruct /= mmul; MathStructure nm2(mpow); nm2 += Number(-2, 1); minteg ^= nm2; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct -= minteg; } return true; } } else if(mstruct.function() == CALCULATOR->f_asin && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-1) && !mpow.isZero() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac.isOne()) { if(mpow.isOne()) { MathStructure marg(mstruct[0]); if(!madd.isZero()) mstruct[0] = x_var; mstruct.multiply(x_var); MathStructure mterm(x_var); mterm ^= nr_two; if(madd.isZero() && !mmul.isOne()) { MathStructure mmul2(mmul); mmul2 ^= nr_two; mterm *= mmul2; } mterm.negate(); mterm += m_one; mterm ^= nr_half; if(madd.isZero() && !mmul.isOne()) mterm /= mmul; mstruct.add(mterm); if(!madd.isZero()) { mstruct.replace(x_var, marg); if(!mmul.isOne()) mstruct.divide(mmul); } return true; } } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mpow.isOne()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct[0]); mterm2 ^= nr_two; mterm2.negate(); mterm2 += m_one; mterm2 ^= nr_half; MathStructure mfac2(x_var); if(!mmul.isOne()) mfac2 *= mmul; if(!madd.isZero()) { mfac2 += madd; mfac2.last() *= Number(-3, 1); } mterm2 *= mfac2; MathStructure mfac1(x_var); mfac1 ^= nr_two; if(!mmul.isOne()) { mfac1 *= mmul; mfac1.last() ^= nr_two; } mfac1 *= nr_two; if(!madd.isZero()) { mfac1 += madd; mfac1.last() ^= nr_two; mfac1.last() *= Number(-2, 1); } mfac1 += nr_minus_one; mstruct *= mfac1; mstruct += mterm2; if(!mmul.isOne()) { mstruct *= mmul; mstruct.last() ^= Number(-2, 1); } mstruct *= Number(1, 4); return true; } } } } } else if(mstruct.function() == CALCULATOR->f_acos && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-1) && !mpow.isZero() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac.isOne()) { if(mpow.isOne()) { MathStructure marg(mstruct[0]); if(!madd.isZero()) mstruct[0] = x_var; mstruct.multiply(x_var); MathStructure mterm(x_var); mterm ^= nr_two; if(madd.isZero() && !mmul.isOne()) { MathStructure mmul2(mmul); mmul2 ^= nr_two; mterm *= mmul2; } mterm.negate(); mterm += m_one; mterm ^= nr_half; if(madd.isZero() && !mmul.isOne()) mterm /= mmul; mstruct.subtract(mterm); if(!madd.isZero()) { mstruct.replace(x_var, marg); if(!mmul.isOne()) mstruct.divide(mmul); } return true; } } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mpow.isOne()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct[0]); MathStructure mterm3(mstruct); mterm2 ^= nr_two; mterm2.negate(); mterm2 += m_one; mterm2 ^= nr_half; MathStructure mfac2(x_var); if(!mmul.isOne()) { mfac2 *= mmul; } mfac2.negate(); if(!madd.isZero()) { mfac2 += madd; mfac2.last() *= nr_three; } mterm2 *= mfac2; mterm3.setFunction(CALCULATOR->f_asin); MathStructure mfac3(1, 1, 0); if(!madd.isZero()) { mfac3 += madd; mfac3.last() ^= nr_two; mfac3.last() *= nr_two; } mterm3 *= mfac3; mstruct *= x_var; mstruct.last() ^= nr_two; if(!mmul.isOne()) { mstruct *= mmul; mstruct.last() ^= nr_two; } mstruct *= nr_two; mstruct += mterm2; mstruct += mterm3; if(!mmul.isOne()) { mstruct *= mmul; mstruct.last() ^= Number(-2, 1); } mstruct *= Number(1, 4); return true; } } } } } else if(mstruct.function() == CALCULATOR->f_atan && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isOne() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac.isOne()) { MathStructure marg(mstruct[0]); mstruct.multiply(marg); MathStructure mterm(marg); mterm ^= nr_two; mterm += m_one; if(!transform_absln(mterm, use_abs, definite_integral, x_var, eo)) return -1; mterm *= nr_half; mstruct.subtract(mterm); if(!mmul.isOne()) mstruct.divide(mmul); return true; } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mfacexp.isMinusOne() && madd.isZero()) { mstruct.setFunction(CALCULATOR->f_Li); mstruct.insertChild(nr_two, 1); MathStructure mterm(mstruct); mstruct[1] *= nr_minus_i; mterm[1] *= nr_one_i; mterm.negate(); mstruct += mterm; mstruct *= nr_one_i; mstruct *= nr_half; return true; } } } } else if(mstruct.function() == CALCULATOR->f_sinh && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-1) && !mpow.isZero() && integrate_info(mstruct[0], x_var, madd, mmul, mexp)) { if(mfac.isOne() && mexp.isOne()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_cosh); if(!mmul.isOne()) mstruct.divide(mmul); } else if(mpow.number().isTwo()) { MathStructure marg(mstruct[0]); if(!madd.isZero()) mstruct[0] = x_var; mstruct[0] *= nr_two; mstruct /= 4; if(madd.isZero() && !mmul.isOne()) mstruct /= mmul; MathStructure xhalf(x_var); xhalf *= nr_half; mstruct -= xhalf; if(!madd.isZero()) { mstruct.replace(x_var, marg); if(!mmul.isOne()) mstruct.divide(mmul); } } else if(mpow.number().isMinusOne()) { mstruct.setFunction(CALCULATOR->f_tanh); mstruct[0] *= nr_half; if(!transform_absln(mstruct, use_abs, definite_integral, x_var, eo)) return -1; if(!mmul.isOne()) mstruct.divide(mmul); } else { MathStructure mbak(mstruct); MathStructure nm1(mpow); nm1 += nr_minus_one; mstruct ^= nm1; MathStructure mcos(mbak); mcos.setFunction(CALCULATOR->f_cosh); mstruct *= mcos; mmul *= mpow; mstruct /= mmul; MathStructure minteg(mbak); MathStructure nm2(mpow); nm2 += Number(-2, 1); minteg ^= nm2; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; minteg *= nm1; minteg /= mpow; mstruct -= minteg; } return true; } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mfacexp.isMinusOne() && !mexp.isZero()) { if(madd.isZero()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_Shi); if(!mexp.isOne()) mstruct /= mexp; return true; } else if(mpow.number().isTwo()) { mstruct[0] *= nr_two; mstruct.setFunction(CALCULATOR->f_Chi); if(!mexp.isOne()) mstruct /= mexp; mstruct += x_var; mstruct.last().transform(CALCULATOR->f_ln); mstruct.last().negate(); mstruct *= nr_half; return true; } else if(mpow.number() == 3) { mstruct.setFunction(CALCULATOR->f_Shi); MathStructure mterm2(mstruct); mstruct[0] *= nr_three; mterm2 *= Number(-3, 1); mstruct += mterm2; if(!mexp.isOne()) mstruct /= mexp; mstruct *= Number(1, 4); return true; } } else if(mpow.isOne()) { MathStructure mterm2; mstruct = x_var; if(!mexp.isOne()) mstruct ^= mexp; if(!mmul.isOne()) mstruct *= mmul; mstruct.transform(CALCULATOR->f_Shi); mstruct *= MathStructure(CALCULATOR->f_cosh, &madd, NULL); mterm2 = x_var; if(!mexp.isOne()) mterm2 ^= mexp; if(!mmul.isOne()) mterm2 *= mmul; mterm2.transform(CALCULATOR->f_Chi); mterm2 *= MathStructure(CALCULATOR->f_sinh, &madd, NULL); mstruct += mterm2; if(!mexp.isOne()) mstruct /= mexp; return true; } } else if(mexp.isOne() && mpow.isOne()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct); mterm2.setFunction(CALCULATOR->f_cosh); mterm2 *= x_var; if(!mmul.isOne()) { mterm2 /= mmul; mmul ^= nr_two; mstruct /= mmul; } mstruct.negate(); mstruct += mterm2; return true; } else if(mfacexp.isInteger() && mfacexp.number().isPositive() && mfacexp.number().isLessThan(100)) { mstruct.setFunction(CALCULATOR->f_cosh); MathStructure mterm2(mstruct); mterm2 *= x_var; mterm2.last() ^= mfacexp; if(!mmul.isOne()) mterm2 /= mmul; mstruct *= x_var; mstruct.last() ^= mfacexp; mstruct.last().last() += nr_minus_one; if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct *= mfacexp; if(!mmul.isOne()) mstruct /= mmul; mstruct.negate(); mstruct += mterm2; mstruct.childrenUpdated(true); return true; } else if(madd.isZero() && mfacexp.isInteger() && mfacexp.number().isNegative() && mfacexp.number().isGreaterThan(-100)) { mfacexp += m_one; MathStructure mterm2(mstruct); mterm2 *= x_var; mterm2.last() ^= mfacexp; mterm2.childUpdated(mterm2.size()); mterm2 /= mfacexp; mstruct.setFunction(CALCULATOR->f_cosh); mstruct *= x_var; mstruct.last() ^= mfacexp; mstruct.childUpdated(mstruct.size()); if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct /= mfacexp; mstruct.negate(); if(!mmul.isOne()) mstruct *= mmul; mstruct += mterm2; return true; } } } else if(mfac.isFunction() && mexp.isOne()) { if(mfac.function() == CALCULATOR->f_sinh && mfac.size() == 1 && mpow.isOne()) { MathStructure mexpf, mmulf, maddf; if(integrate_info(mfac[0], x_var, maddf, mmulf, mexpf) && mexpf.isOne() && mmul != mmulf) { MathStructure mterm2(mstruct); mterm2[0] += mfac[0]; mstruct[0] -= mfac[0]; MathStructure mden1(mmul); mden1 -= mmulf; mden1 *= nr_two; MathStructure mden2(mmul); mden2 += mmulf; mden2 *= nr_two; mterm2 /= mden2; mstruct /= mden1; mstruct.negate(); mstruct += mterm2; return true; } } else if(mfac.function() == CALCULATOR->f_cosh && mfac.size() == 1) { if(mstruct[0] == mfac[0]) { UnknownVariable *var = new UnknownVariable("", format_and_print(mstruct)); var->ref(); MathStructure mtest(var); if(!mpow.isOne()) mtest ^= mpow; CALCULATOR->beginTemporaryStopMessages(); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(mstruct); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(mstruct); } if(mtest.integrate(var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); mtest.replace(var, mstruct); var->destroy(); mstruct = mtest; return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } } } } else if(mstruct.function() == CALCULATOR->f_cosh && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-1) && !mpow.isZero()&& integrate_info(mstruct[0], x_var, madd, mmul, mexp)) { if(mfac.isOne() && mexp.isOne()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_sinh); if(!mmul.isOne()) mstruct.divide(mmul); } else if(mpow.number().isTwo()) { MathStructure marg(mstruct[0]); if(!madd.isZero()) mstruct[0] = x_var; mstruct.setFunction(CALCULATOR->f_sinh); mstruct[0] *= nr_two; mstruct /= 4; if(madd.isZero() && !mmul.isOne()) mstruct /= mmul; MathStructure xhalf(x_var); xhalf *= nr_half; mstruct += xhalf; if(!madd.isZero()) { mstruct.replace(x_var, marg); if(!mmul.isOne()) mstruct.divide(mmul); } } else if(mpow.number().isMinusOne()) { mstruct.setFunction(CALCULATOR->f_sinh); mstruct.transform(STRUCT_FUNCTION); mstruct.setFunction(CALCULATOR->f_atan); if(!mmul.isOne()) mstruct.divide(mmul); } else { MathStructure mbak(mstruct); MathStructure nm1(mpow); nm1 += nr_minus_one; mstruct ^= nm1; MathStructure msin(mbak); msin.setFunction(CALCULATOR->f_sinh); mstruct *= msin; mmul *= mpow; mstruct /= mmul; MathStructure minteg(mbak); MathStructure nm2(mpow); nm2 += Number(-2, 1); minteg ^= nm2; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; minteg *= nm1; minteg /= mpow; mstruct += minteg; } return true; } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mfacexp.isMinusOne() && !mexp.isZero()) { if(madd.isZero()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_Chi); if(!mexp.isOne()) mstruct /= mexp; return true; } else if(mpow.number().isTwo()) { mstruct[0] *= nr_two; mstruct.setFunction(CALCULATOR->f_Chi); if(!mexp.isOne()) mstruct /= mexp; mstruct += x_var; mstruct.last().transform(CALCULATOR->f_ln); mstruct *= nr_half; return true; } else if(mpow.number() == 3) { mstruct.setFunction(CALCULATOR->f_Chi); MathStructure mterm2(mstruct); mstruct[0] *= nr_three; mterm2 *= nr_three; mstruct += mterm2; if(!mexp.isOne()) mstruct /= mexp; mstruct *= Number(1, 4); return true; } } else if(mpow.isOne()) { MathStructure mterm2; mstruct = x_var; if(!mexp.isOne()) mstruct ^= mexp; if(!mmul.isOne()) mstruct *= mmul; mstruct.transform(CALCULATOR->f_Shi); mstruct *= MathStructure(CALCULATOR->f_sinh, &madd, NULL); mterm2 = x_var; if(!mexp.isOne()) mterm2 ^= mexp; if(!mmul.isOne()) mterm2 *= mmul; mterm2.transform(CALCULATOR->f_Chi); mterm2 *= MathStructure(CALCULATOR->f_cosh, &madd, NULL); mstruct += mterm2; if(!mexp.isOne()) mstruct /= mexp; return true; } } else if(mexp.isOne() && mpow.isOne()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct); mterm2.setFunction(CALCULATOR->f_sinh); mterm2 *= x_var; if(!mmul.isOne()) { mterm2 /= mmul; mmul ^= nr_two; mstruct /= mmul; } mstruct.negate(); mstruct += mterm2; return true; } else if(mfacexp.isInteger() && mfacexp.number().isPositive() && mfacexp.number().isLessThan(100)) { mstruct.setFunction(CALCULATOR->f_sinh); MathStructure mterm2(mstruct); mterm2 *= x_var; mterm2.last() ^= mfacexp; if(!mmul.isOne()) mterm2 /= mmul; mstruct *= x_var; mstruct.last() ^= mfacexp; mstruct.last().last() += nr_minus_one; if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct *= mfacexp; if(!mmul.isOne()) mstruct /= mmul; mstruct.negate(); mstruct += mterm2; mstruct.childrenUpdated(true); return true; } else if(madd.isZero() && mfacexp.isInteger() && mfacexp.number().isNegative() && mfacexp.number().isGreaterThan(-100)) { mfacexp += m_one; MathStructure mterm2(mstruct); mterm2 *= x_var; mterm2.last() ^= mfacexp; mterm2.childUpdated(mterm2.size()); mterm2 /= mfacexp; mstruct.setFunction(CALCULATOR->f_sinh); mstruct *= x_var; mstruct.last() ^= mfacexp; mstruct.childUpdated(mstruct.size()); if(mstruct.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct /= mfacexp; mstruct.negate(); if(!mmul.isOne()) mstruct *= mmul; mstruct += mterm2; return true; } } } else if(mfac.isFunction() && mexp.isOne()) { if(mfac.function() == CALCULATOR->f_cosh && mfac.size() == 1 && !mpow.isOne()) { MathStructure mexpf, mmulf, maddf; if(integrate_info(mfac[0], x_var, maddf, mmulf, mexpf) && mexpf.isOne() && mmulf != mmul) { mstruct.setFunction(CALCULATOR->f_sinh); MathStructure mterm2(mstruct); mterm2[0] += mfac[0]; mstruct[0] -= mfac[0]; MathStructure mden1(mmul); mden1 -= mmulf; mden1 *= nr_two; MathStructure mden2(mmul); mden2 += mmulf; mden2 *= nr_two; mterm2 /= mden2; mstruct /= mden1; mstruct += mterm2; mstruct.childrenUpdated(true); return true; } } else if(mfac.function() == CALCULATOR->f_sinh && mfac.size() == 1) { if(mstruct[0] == mfac[0]) { UnknownVariable *var = new UnknownVariable("", format_and_print(mstruct)); var->ref(); MathStructure mtest(var); if(!mpow.isOne()) mtest ^= mpow; CALCULATOR->beginTemporaryStopMessages(); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(mstruct); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(mstruct); } if(mtest.integrate(var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); mtest.replace(var, mstruct); var->destroy(); mstruct = mtest; return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } } } } else if(mstruct.function() == CALCULATOR->f_tanh && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mfac.isOne() && mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(10) && mpow.number().isGreaterThanOrEqualTo(-1) && !mpow.isZero() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mpow.isOne()) { mstruct.setFunction(CALCULATOR->f_cosh); mstruct.transform(STRUCT_FUNCTION); mstruct.setFunction(CALCULATOR->f_ln); if(!mmul.isOne()) mstruct.divide(mmul); } else if(mpow.number().isTwo()) { MathStructure marg(mstruct[0]); if(!madd.isZero()) mstruct[0] = x_var; if(madd.isZero() && !mmul.isOne()) mstruct /= mmul; mstruct.negate(); mstruct += x_var; if(!madd.isZero()) { mstruct.replace(x_var, marg); if(!mmul.isOne()) mstruct.divide(mmul); } } else if(mpow.number().isMinusOne()) { mstruct.setFunction(CALCULATOR->f_sinh); if(!transform_absln(mstruct, use_abs, definite_integral, x_var, eo)) return -1; if(!mmul.isOne()) mstruct.divide(mmul); } else { MathStructure minteg(mstruct); MathStructure nm1(mpow); nm1 += nr_minus_one; mstruct ^= nm1; mmul *= nm1; mstruct /= mmul; mstruct.negate(); MathStructure nm2(mpow); nm2 += Number(-2, 1); minteg ^= nm2; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) return -1; mstruct += minteg; } return true; } } else if(mstruct.function() == CALCULATOR->f_asinh && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-1) && !mpow.isZero() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac.isOne()) { if(mpow.isOne()) { MathStructure marg(mstruct[0]); if(!madd.isZero()) mstruct[0] = x_var; mstruct.multiply(x_var); MathStructure mterm(x_var); mterm ^= nr_two; if(madd.isZero() && !mmul.isOne()) { MathStructure mmul2(mmul); mmul2 ^= nr_two; mterm *= mmul2; } mterm += m_one; mterm ^= nr_half; if(madd.isZero() && !mmul.isOne()) mterm /= mmul; mstruct.subtract(mterm); if(!madd.isZero()) { mstruct.replace(x_var, marg); if(!mmul.isOne()) mstruct.divide(mmul); } return true; } } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mpow.isOne()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct[0]); mterm2 ^= nr_two; mterm2 += m_one; mterm2 ^= nr_half; MathStructure mfac2(x_var); if(!mmul.isOne()) mfac2 *= mmul; mfac2.negate(); if(!madd.isZero()) { mfac2 += madd; mfac2.last() *= nr_three; } mterm2 *= mfac2; MathStructure mfac1(x_var); mfac1 ^= nr_two; if(!mmul.isOne()) { mfac1 *= mmul; mfac1.last() ^= nr_two; } mfac1 *= nr_two; if(!madd.isZero()) { mfac1 += madd; mfac1.last() ^= nr_two; mfac1.last() *= Number(-2, 1); } mfac1 += m_one; mstruct *= mfac1; mstruct += mterm2; if(!mmul.isOne()) { mstruct *= mmul; mstruct.last() ^= Number(-2, 1); } mstruct *= Number(1, 4); return true; } } } } } else if(mstruct.function() == CALCULATOR->f_acosh && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isNumber() && mpow.number().isInteger() && mpow.number().isLessThanOrEqualTo(100) && mpow.number().isGreaterThanOrEqualTo(-1) && !mpow.isZero() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac.isOne()) { if(mpow.isOne()) { MathStructure marg(mstruct[0]); if(!madd.isZero()) mstruct[0] = x_var; MathStructure mterm(mstruct[0]); MathStructure msqrt2(mstruct[0]); mstruct.multiply(x_var); mterm += m_one; mterm ^= nr_half; msqrt2 += m_minus_one; msqrt2 ^= nr_half; mterm *= msqrt2; if(madd.isZero() && !mmul.isOne()) { mterm /= mmul; } mstruct.subtract(mterm); if(!madd.isZero()) { mstruct.replace(x_var, marg); if(!mmul.isOne()) mstruct.divide(mmul); } return true; } } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mpow.isOne()) { if(mfacexp.isOne()) { MathStructure mterm2(mstruct[0]); MathStructure mterm2b(mstruct[0]); mterm2 += nr_minus_one; mterm2 ^= nr_half; mterm2b += m_one; mterm2b ^= nr_half; mterm2 *= mterm2b; MathStructure mfac2(x_var); if(!mmul.isOne()) { mfac2 *= mmul; } mfac2.negate(); if(!madd.isZero()) { mfac2 += madd; mfac2.last() *= nr_three; } mterm2 *= mfac2; MathStructure mfac1(x_var); mfac1 ^= nr_two; if(!mmul.isOne()) { mfac1 *= mmul; mfac1.last() ^= nr_two; } mfac1 *= nr_two; if(!madd.isZero()) { mfac1 += madd; mfac1.last() ^= nr_two; mfac1.last() *= Number(-2, 1); } mfac1 += nr_minus_one; mstruct *= mfac1; mstruct += mterm2; if(!mmul.isOne()) { mstruct *= mmul; mstruct.last() ^= Number(-2, 1); } mstruct *= Number(1, 4); return true; } } } } } else if(mstruct.function() == CALCULATOR->f_atanh && mstruct.size() == 1) { MathStructure mexp, mmul, madd; if(mpow.isOne() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac.isOne()) { MathStructure marg(mstruct[0]); mstruct.multiply(marg); mstruct.setFunction(CALCULATOR->f_cos); MathStructure mterm(marg); mterm ^= nr_two; mterm.negate(); mterm += m_one; if(!transform_absln(mterm, use_abs, definite_integral, x_var, eo)) return -1; mterm *= nr_half; mstruct.add(mterm); if(!mmul.isOne()) mstruct.divide(mmul); return true; } else if(mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure mfacexp(1, 1, 0); if(mfac != x_var) mfacexp = mfac[1]; if(mfacexp.isMinusOne() && madd.isZero()) { mstruct.setFunction(CALCULATOR->f_Li); mstruct.insertChild(nr_two, 1); MathStructure mterm(mstruct); mterm[1].negate(); mterm.negate(); mstruct += mterm; mstruct *= nr_half; return true; } } } } else if(mstruct.function() == CALCULATOR->f_root && VALID_ROOT(mstruct)) { MathStructure madd, mmul, mexp; if(mpow.isOne() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac.isOne()) { MathStructure np1(mstruct[1]); mstruct.multiply(mstruct[0]); np1.inverse(); np1 += m_one; if(!mmul.isOne()) np1 *= mmul; mstruct.divide(np1); return true; } else if(mfac == x_var) { MathStructure nm1(mstruct[1]); nm1.inverse(); nm1 += m_one; MathStructure mnum(x_var); mnum *= nm1; if(!mmul.isOne()) mnum *= mmul; if(!madd.isZero()) mnum -= madd; MathStructure mden(mstruct[1]); mden.inverse(); mden += nr_two; mden *= nm1; if(!mmul.isOne()) { mden *= mmul; mden.last() ^= nr_two; } mstruct.multiply(mstruct[0]); mstruct *= mnum; mstruct /= mden; return true; } } } else if(mstruct.function() == CALCULATOR->f_erfc && mstruct.size() == 1) { MathStructure mtest(mstruct); mtest.setFunction(CALCULATOR->f_erf); mtest.negate(); mtest += m_one; if(!mpow.isOne()) mtest ^= mpow; if(!mfac.isOne()) mtest *= mfac; CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth - 1, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate, true) <= 0) { CALCULATOR->endTemporaryStopMessages(true); mstruct = mtest; return true; } CALCULATOR->endTemporaryStopMessages(); } else if(mstruct.function() == CALCULATOR->f_erf && mstruct.size() == 1) { MathStructure madd, mmul, mexp; if(mpow.isOne() && mfac.isOne() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { MathStructure mterm2(CALCULATOR->v_e); mterm2 ^= mstruct[0]; mterm2.last() ^= nr_two; mterm2.last().negate(); mterm2 *= CALCULATOR->v_pi; mterm2.last() ^= Number(-1, 2); if(!mmul.isOne()) mterm2 /= mmul; if(madd.isZero()) { mstruct *= x_var; } else { mstruct *= madd; if(!mmul.isOne()) { mstruct.last() /= mmul; mstruct.childrenUpdated(); } mstruct.last() += x_var; } mstruct += mterm2; return true; } } else if(mstruct.function() == CALCULATOR->f_digamma && mstruct.size() == 1) { MathStructure madd, mmul, mexp; if(mpow.isOne() && mfac.isOne() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { mstruct.setFunction(CALCULATOR->f_gamma); if(!transform_absln(mstruct, use_abs, definite_integral, x_var, eo)) return -1; if(!mmul.isOne()) mstruct /= mmul; return true; } } else if(mstruct.function() == CALCULATOR->f_li && mstruct.size() == 1) { MathStructure madd, mmul, mexp; if(mpow.isOne() && integrate_info(mstruct[0], x_var, madd, mmul, mexp) && mexp.isOne()) { if(mfac.isOne()) { MathStructure mEi(mstruct); mstruct *= mEi[0]; mEi.setFunction(CALCULATOR->f_ln); mEi *= nr_two; mEi.transform(CALCULATOR->f_Ei); mstruct -= mEi; if(!mmul.isOne()) mstruct /= mmul; return true; } else if(madd.isZero() && mfac.isPower() && mfac[0] == x_var && mfac[1].isMinusOne()) { MathStructure mln(mstruct); mln.setFunction(CALCULATOR->f_ln); mstruct *= mln; mstruct -= mln[0]; return true; } } } else if(mstruct.function() == CALCULATOR->f_diff && mstruct.size() == 3 && mstruct[1] == x_var) { if(!mpow.isOne() || !mfac.isOne()) return false; if(mstruct[2].isOne()) { mstruct.setToChild(1, true); } else { mstruct[2] += m_minus_one; } return true; } else if(mstruct.function() == CALCULATOR->f_diff && mstruct.size() == 2 && mstruct[1] == x_var) { if(!mpow.isOne() || !mfac.isOne()) return false; mstruct.setToChild(1, true); return true; } else { return false; } if(mstruct.size() == 0) return false; bool by_parts_tested = false; if(mfac.isOne() && (mstruct.function() == CALCULATOR->f_ln || mstruct.function() == CALCULATOR->f_asin || mstruct.function() == CALCULATOR->f_acos || mstruct.function() == CALCULATOR->f_atan || mstruct.function() == CALCULATOR->f_asinh || mstruct.function() == CALCULATOR->f_acosh || mstruct.function() == CALCULATOR->f_atanh)) { by_parts_tested = true; //integrate by parts if(max_part_depth > 0) { MathStructure minteg(mstruct); minteg ^= mpow; CALCULATOR->beginTemporaryStopMessages(); if(minteg.differentiate(x_var, eo) && minteg.containsFunction(CALCULATOR->f_diff, true) <= 0) { minteg *= x_var; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth - 1, parent_parts) > 0 && minteg.containsFunction(CALCULATOR->f_integrate, true) <= 0) { CALCULATOR->endTemporaryStopMessages(true); mstruct ^= mpow; mstruct.multiply(x_var); mstruct.subtract(minteg); return true; } } CALCULATOR->endTemporaryStopMessages(); } } MathStructure madd, mmul, mexp; if(integrate_info(mstruct[0], x_var, madd, mmul, mexp, false, false, true) && !mexp.isZero()) { if(mfac.isOne() && (mexp.isPower() && mexp[0] == x_var && mexp[1].isNumber() && !mexp[1].number().isInteger() && mexp[1].number().isRational())) { Number num(mexp[1].number().numerator()); Number den(mexp[1].number().denominator()); if(num.isPositive() || num.isMinusOne()) { MathStructure morig(x_var); if(num.isNegative()) den.negate(); Number den_inv(den); den_inv.recip(); morig ^= den_inv; UnknownVariable *var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(morig) + RIGHT_PARENTHESIS); var->ref(); Number den_m1(den); den_m1--; MathStructure mtest(var); if(!num.isOne() && !num.isMinusOne()) mtest ^= num; if(!mmul.isOne()) mtest *= mmul; if(!madd.isZero()) mtest += madd; mtest.transform(mstruct.function()); if(!mpow.isOne()) mtest ^= mpow; mtest *= var; if(!den_m1.isOne()) { mtest.last() ^= den_m1; mtest.childUpdated(mtest.size()); } if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(morig); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(morig); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate) <= 0) { CALCULATOR->endTemporaryStopMessages(true); mstruct.set(mtest, true); mstruct.replace(var, morig); mstruct.multiply(den); var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } else if((mfac.isOne() || mfac == x_var || (mfac.isPower() && mfac[0] == x_var && mfac[1].isInteger())) && (mexp.isPower() && mexp[0] != x_var && mexp[1].isNumber())) { MathStructure madd2, mmul2, mexp2; if(integrate_info(mexp[0], x_var, madd2, mmul2, mexp2) && (!madd.isZero() || mexp != x_var) && mexp2.isOne()) { UnknownVariable *var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(mexp[0]) + RIGHT_PARENTHESIS); var->ref(); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(mexp[0]); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(mexp[0]); } MathStructure mtest(var); mtest ^= mexp[1]; if(!mmul.isOne()) mtest *= mmul; if(!madd.isZero()) mtest += madd; mtest.transform(mstruct.function()); if(!mpow.isOne()) mtest ^= mpow; if(!mfac.isOne()) { mtest *= var; if(!madd2.isZero()) { mtest.last() -= madd2; mtest.childUpdated(mtest.size()); } if(mfac.isPower()) { mtest.last() ^= mfac[1]; mtest.childUpdated(mtest.size()); } } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate) <= 0) { CALCULATOR->endTemporaryStopMessages(true); mstruct.set(mtest, true); mstruct.replace(var, mexp[0]); if(!mmul2.isOne()) { mstruct /= mmul2; if(!mfac.isOne()) { if(mfac.isPower()) mmul2 ^= mfac[1]; mstruct /= mmul2; } } var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } } if(mstruct[0].isAddition()) { bool b = true; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].containsType(STRUCT_ADDITION, true) == 1) { b = false; break; } } if(b) { MathStructure mtest(mstruct); if(mtest[0].factorize(eo, false, 0, 0, false, false, NULL, x_var, true, true)) { if(integrate_function(mtest, x_var, eo, mpow, mfac, mpowadd, mpowmul, use_abs, definite_integral, max_part_depth, parent_parts)) { mstruct = mtest; return true; } } } } if(!mfac.isOne()) return false; MathStructure *m_func = NULL, *m_pow = NULL; if(mstruct[0].isFunction() && mstruct[0].contains(x_var, true) > 0) { m_func = &mstruct[0]; } else if(mstruct[0].isPower() && mstruct[0][0].isFunction() && mstruct[0][0].contains(x_var, true) > 0) { m_func = &mstruct[0][0]; } else if(mstruct[0].isPower() && mstruct[0][1].contains(x_var, true) > 0) { m_pow = &mstruct[0]; } else if(mstruct[0].isMultiplication()) { for(size_t i = 0; i < mstruct[0].size(); i++) { if(mstruct[0][i].isFunction() && mstruct[0][i].contains(x_var, true) > 0) { m_func = &mstruct[0][i]; } else if(mstruct[0][i].isPower() && mstruct[0][i][0].isFunction() && mstruct[0][i][0].contains(x_var, true) > 0) { m_func = &mstruct[0][i][0]; } else if(mstruct[0][i].isPower() && mstruct[0][i][1].contains(x_var, true) > 0) { m_pow = &mstruct[0][i]; } } } else if(mstruct[0].isAddition()) { for(size_t i2 = 0; i2 < mstruct[0].size(); i2++) { if(mstruct[0][i2].isFunction() && mstruct[0][i2].contains(x_var, true) > 0) { m_func = &mstruct[0][i2]; } else if(mstruct[0][i2].isPower() && mstruct[0][i2][0].isFunction() && mstruct[0][i2][0].contains(x_var, true) > 0) { m_func = &mstruct[0][i2][0]; } else if(mstruct[0][i2].isPower() && mstruct[0][i2][1].contains(x_var, true) > 0) { m_pow = &mstruct[0][i2]; } else if(mstruct[0][i2].isMultiplication()) { for(size_t i = 0; i < mstruct[0][i2].size(); i++) { if(mstruct[0][i2][i].isFunction() && mstruct[0][i2][i].contains(x_var, true) > 0) { m_func = &mstruct[0][i2][i]; } else if(mstruct[0][i2][i].isPower() && mstruct[0][i2][i][0].isFunction() && mstruct[0][i2][i][0].contains(x_var, true) > 0) { m_func = &mstruct[0][i2][i][0]; } else if(mstruct[0][i2][i].isPower() && mstruct[0][i2][i][1].contains(x_var, true) > 0) { m_pow = &mstruct[0][i2][i]; } } } } } if(m_func && m_pow) return false; if(m_func) { if((m_func->function() == CALCULATOR->f_ln || m_func->function() == CALCULATOR->f_asin || m_func->function() == CALCULATOR->f_acos || m_func->function() == CALCULATOR->f_asinh || m_func->function() == CALCULATOR->f_acosh) && m_func->size() == 1 && integrate_info((*m_func)[0], x_var, madd, mmul, mexp) && mexp.isOne()) { MathStructure m_orig(*m_func); UnknownVariable *var = new UnknownVariable("", format_and_print(m_orig)); var->ref(); MathStructure mtest(mstruct); mtest[0].replace(m_orig, var, (*m_func)[0].containsInterval()); if(mtest[0].containsRepresentativeOf(x_var, true, true) == 0) { if(m_func->function() == CALCULATOR->f_ln) { MathStructure m_epow(CALCULATOR->v_e); m_epow ^= var; mtest *= m_epow; } else if(m_func->function() == CALCULATOR->f_asin) { MathStructure m_cos(var); if(CALCULATOR->getRadUnit()) m_cos *= CALCULATOR->getRadUnit(); m_cos.transform(CALCULATOR->f_cos); mtest *= m_cos; } else if(m_func->function() == CALCULATOR->f_acos) { MathStructure m_sin(var); if(CALCULATOR->getRadUnit()) m_sin *= CALCULATOR->getRadUnit(); m_sin.transform(CALCULATOR->f_sin); mtest *= m_sin; mmul.negate(); } else if(m_func->function() == CALCULATOR->f_asinh) { MathStructure m_cos(var); m_cos.transform(CALCULATOR->f_cosh); mtest *= m_cos; } else if(m_func->function() == CALCULATOR->f_acosh) { MathStructure m_sin(var); m_sin.transform(CALCULATOR->f_sinh); mtest *= m_sin; } if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(m_orig); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(m_orig); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate) <= 0) { CALCULATOR->endTemporaryStopMessages(true); mstruct.set(mtest, true); mstruct.replace(var, m_orig); if(!mmul.isOne()) mstruct /= mmul; var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); } var->destroy(); } } if(m_pow) { if((*m_pow)[0].containsRepresentativeOf(x_var, true, true) == 0 && integrate_info((*m_pow)[1], x_var, madd, mmul, mexp) && mexp.isOne()) { MathStructure m_orig(*m_pow); UnknownVariable *var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(m_orig) + RIGHT_PARENTHESIS); var->ref(); MathStructure mtest(mstruct); mtest[0].replace(m_orig, var, m_pow->containsInterval()); if(mtest[0].containsRepresentativeOf(x_var, true, true) == 0) { if(!mpow.isOne()) mtest ^= mpow; mtest /= var; if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(m_orig); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(m_orig); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate) <= 0) { CALCULATOR->endTemporaryStopMessages(true); mstruct.set(mtest, true); mstruct.replace(var, m_orig); MathStructure m_ln(CALCULATOR->f_ln, &m_orig[0], NULL); mstruct /= m_ln; if(!mmul.isOne()) mstruct /= mmul; var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); } var->destroy(); } } if(!by_parts_tested && mstruct[0].function() != CALCULATOR->f_sin && mstruct[0].function() != CALCULATOR->f_cos && mstruct[0].function() != CALCULATOR->f_tan && mstruct[0].function() != CALCULATOR->f_sinh && mstruct[0].function() != CALCULATOR->f_cosh && mstruct[0].function() != CALCULATOR->f_tanh) { //integrate by parts if(max_part_depth > 0) { MathStructure minteg(mstruct); minteg ^= mpow; CALCULATOR->beginTemporaryStopMessages(); if(minteg.differentiate(x_var, eo) && minteg.containsFunction(CALCULATOR->f_diff, true) <= 0) { minteg *= x_var; if(minteg.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth - 1, parent_parts) > 0 && minteg.containsFunction(CALCULATOR->f_integrate, true) <= 0) { CALCULATOR->endTemporaryStopMessages(true); mstruct ^= mpow; mstruct.multiply(x_var); mstruct.subtract(minteg); return true; } } CALCULATOR->endTemporaryStopMessages(); } } return false; } #define CANNOT_INTEGRATE {MathStructure minteg(CALCULATOR->f_integrate, this, &x_var, &m_undefined, &m_undefined, NULL); set(minteg); return false;} #define CANNOT_INTEGRATE_INTERVAL {MathStructure minteg(CALCULATOR->f_integrate, this, &x_var, &m_undefined, &m_undefined, NULL); set(minteg); return -1;} bool MathStructure::decomposeFractions(const MathStructure &x_var, const EvaluationOptions &eo) { MathStructure mtest2; bool b = false; int mmul_i = 0; if(isPower()) { if(CHILD(1).isMinusOne() && CHILD(0).isMultiplication() && CHILD(0).size() >= 2) { mtest2 = CHILD(0); b = true; } } else if(isMultiplication() && SIZE == 2) { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isPower() && CHILD(i)[1].isMinusOne() && (CHILD(i)[0].isPower() || CHILD(i)[0].isMultiplication())) { mtest2 = CHILD(i)[0]; b = true; } else if(CHILD(i) == x_var) { mmul_i = 1; } else if(CHILD(i).isPower() && CHILD(i)[0] == x_var && CHILD(i)[1].isInteger() && CHILD(i)[1].number().isPositive() && CHILD(i)[1].number().isLessThan(100)) { mmul_i = CHILD(i)[1].number().intValue(); } } if(mmul_i == 0) b = false; } if(b) { if(!mtest2.isMultiplication()) mtest2.transform(STRUCT_MULTIPLICATION); MathStructure mfacs, mnew; mnew.setType(STRUCT_ADDITION); mfacs.setType(STRUCT_ADDITION); vector i_degrees; i_degrees.resize(mtest2.size(), 1); for(size_t i = 0; i < mtest2.size() && b; i++) { MathStructure mfactor = mtest2[i]; if(mtest2[i].isPower()) { if(!mtest2[i][1].isInteger() || !mtest2[i][1].number().isPositive() || mtest2[i][1].isOne() || mtest2[i][1].number().isGreaterThan(100)) { b = false; break; } mfactor = mtest2[i][0]; } if(mfactor.isAddition()) { bool b2 = false; for(size_t i2 = 0; i2 < mfactor.size() && b; i2++) { if(mfactor[i2].isMultiplication()) { bool b_x = false; for(size_t i3 = 0; i3 < mfactor[i2].size() && b; i3++) { if(!b_x && mfactor[i2][i3].isPower() && mfactor[i2][i3][0] == x_var) { if(!mfactor[i2][i3][1].isInteger() || !mfactor[i2][i3][1].number().isPositive() || mfactor[i2][i3][1].isOne() || mfactor[i2][i3][1].number().isGreaterThan(100)) { b = false; } else if(mfactor[i2][i3][1].number().intValue() > i_degrees[i]) { i_degrees[i] = mfactor[i2][i3][1].number().intValue(); } b_x = true; } else if(!b_x && mfactor[i2][i3] == x_var) { b_x = true; } else if(mfactor[i2][i3].containsRepresentativeOf(x_var, true, true) != 0) { b = false; } } if(!b_x) b2 = true; } else if(mfactor[i2].isPower() && mfactor[i2][0] == x_var) { if(!mfactor[i2][1].isInteger() || !mfactor[i2][1].number().isPositive() || mfactor[i2][1].isOne() || mfactor[i2][1].number().isGreaterThan(100)) { b = false; } else if(mfactor[i2][1].number().intValue() > i_degrees[i]) { i_degrees[i] = mfactor[i2][1].number().intValue(); } } else if(mfactor[i2] == x_var) { } else if(mfactor[i2].containsRepresentativeOf(x_var, true, true) != 0) { b = false; } else { b2 = true; } } if(!b2) b = false; } else if(mfactor != x_var) { b = false; } } MathStructure mtest3, mnums3; mnums3.clearVector(); mtest3.clearVector(); if(b) { UnknownVariable *var = new UnknownVariable("", string("a")); var->setAssumptions(new Assumptions()); var->ref(); MathStructure mvar(var); for(size_t i = 0; i < mtest2.size(); i++) { if(i_degrees[i] == 1) { MathStructure mnum(1, 1, 0); if(mtest2.size() != 1) { mnum = mtest2; mnum.delChild(i + 1, true); } MathStructure mx(mtest2[i]); mx.transform(COMPARISON_EQUALS, m_zero); mx.replace(x_var, mvar); mx.isolate_x(eo, mvar); mx.calculatesub(eo, eo, true); if(mx.isLogicalOr()) mx.setToChild(1); if(!mx.isComparison() || mx.comparisonType() != COMPARISON_EQUALS || mx[0] != var) {b = false; break;} mx.setToChild(2); if(mtest2.size() != 1) { mfacs.addChild(mnum); mnum.replace(x_var, mx); mnum.inverse(); } if(mmul_i > 0) { mx ^= Number(mmul_i, 1); if(mtest2.size() == 1) mnum = mx; else mnum *= mx; } mnum.calculatesub(eo, eo, true); if(mtest2.size() == 1) mfacs.addChild(mnum); else mfacs.last() *= mnum; mnums3.addChild(mnum); mtest3.addChild(mtest2[i]); } } var->destroy(); } if(b) { vector vars; bool b_solve = false; for(size_t i = 0; i < mtest2.size(); i++) { if(mtest2[i].isPower()) { int i_exp = mtest2[i][1].number().intValue(); for(int i_exp_n = mtest2[i][1].number().intValue() - (i_degrees[i] == 1 ? 1 : 0); i_exp_n > 0; i_exp_n--) { if(i_exp_n == 1) { mtest3.addChild(mtest2[i][0]); } else { mtest3.addChild(mtest2[i]); if(i_exp_n != i_exp) mtest3.last()[1].number() = i_exp_n; } if(i_exp == i_exp_n) { if(mtest2.size() > 1) { mfacs.addChild(mtest2); mfacs.last().delChild(i + 1, true); } } else { mfacs.addChild(mtest2); if(i_exp - i_exp_n == 1) mfacs.last()[i].setToChild(1); else mfacs.last()[i][1].number() = i_exp - i_exp_n; } if(i_degrees[i] == 1) { UnknownVariable *var = new UnknownVariable("", string("a") + i2s(mtest3.size())); var->setAssumptions(new Assumptions()); var->ref(); mnums3.addChild_nocopy(new MathStructure(var)); vars.push_back(var); } else { mnums3.addChild_nocopy(new MathStructure()); mnums3.last().setType(STRUCT_ADDITION); for(int i2 = 1; i2 <= i_degrees[i]; i2++) { UnknownVariable *var = new UnknownVariable("", string("a") + i2s(mtest3.size()) + i2s(i2)); var->setAssumptions(new Assumptions()); var->ref(); if(i2 == 1) { mnums3.last().addChild_nocopy(new MathStructure(var)); } else { mnums3.last().addChild_nocopy(new MathStructure(var)); mnums3.last().last() *= x_var; if(i2 > 2) mnums3.last().last().last() ^= Number(i2 - 1, 1); } vars.push_back(var); } } if(i_exp != i_exp_n || mtest2.size() > 1) mfacs.last() *= mnums3.last(); else mfacs.addChild(mnums3.last()); b_solve = true; } } else if(i_degrees[i] > 1) { mtest3.addChild(mtest2[i]); if(mtest2.size() > 1) { mfacs.addChild(mtest2); mfacs.last().delChild(i + 1, true); } mnums3.addChild_nocopy(new MathStructure()); mnums3.last().setType(STRUCT_ADDITION); for(int i2 = 1; i2 <= i_degrees[i]; i2++) { UnknownVariable *var = new UnknownVariable("", string("a") + i2s(mtest3.size()) + i2s(i2)); var->setAssumptions(new Assumptions()); if(i2 == 1) { mnums3.last().addChild_nocopy(new MathStructure(var)); } else { mnums3.last().addChild_nocopy(new MathStructure(var)); mnums3.last().last() *= x_var; if(i2 > 2) mnums3.last().last().last() ^= Number(i2 - 1, 1); } var->ref(); vars.push_back(var); } if(mtest2.size() > 1) mfacs.last() *= mnums3.last(); else mfacs.addChild(mnums3.last()); b_solve = true; } } if(b_solve) { mfacs.childrenUpdated(true); MathStructure mfac_expand(mfacs); mfac_expand.calculatesub(eo, eo, true); size_t i_degree = 0; if(mfac_expand.isAddition()) { i_degree = mfac_expand.degree(x_var).uintValue(); if(i_degree >= 100 || i_degree <= 0) b = false; } if(i_degree == 0) b = false; if(b) { MathStructure m_eqs; m_eqs.resizeVector(i_degree + 1, m_zero); for(size_t i = 0; i < m_eqs.size(); i++) { for(size_t i2 = 0; i2 < mfac_expand.size();) { bool b_add = false; if(i == 0) { if(!mfac_expand[i2].contains(x_var)) b_add = true; } else { if(mfac_expand[i2].isMultiplication() && mfac_expand[i2].size() >= 2) { for(size_t i3 = 0; i3 < mfac_expand[i2].size(); i3++) { if(i == 1 && mfac_expand[i2][i3] == x_var) b_add = true; else if(i > 1 && mfac_expand[i2][i3].isPower() && mfac_expand[i2][i3][0] == x_var && mfac_expand[i2][i3][1] == i) b_add = true; if(b_add) { mfac_expand[i2].delChild(i3 + 1, true); break; } } } else { if(i == 1 && mfac_expand[i2] == x_var) b_add = true; else if(i > 1 && mfac_expand[i2].isPower() && mfac_expand[i2][0] == x_var && mfac_expand[i2][1] == i) b_add = true; if(b_add) mfac_expand[i2].set(1, 1, 0); } } if(b_add) { if(m_eqs[i].isZero()) m_eqs[i] = mfac_expand[i2]; else m_eqs[i].add(mfac_expand[i2], true); mfac_expand.delChild(i2 + 1); } else { i2++; } } } if(mfac_expand.size() == 0 && m_eqs.size() >= vars.size()) { for(size_t i = 0; i < m_eqs.size(); i++) { if(!m_eqs[i].isZero()) { m_eqs[i].transform(COMPARISON_EQUALS, i == (size_t) mmul_i ? m_one : m_zero); } } for(size_t i = 0; i < m_eqs.size();) { if(m_eqs[i].isZero()) { m_eqs.delChild(i + 1); if(i == (size_t) mmul_i) b = false; } else { i++; } } if(b) { MathStructure vars_m; vars_m.clearVector(); for(size_t i = 0; i < vars.size(); i++) { vars_m.addChild_nocopy(new MathStructure(vars[i])); } for(size_t i = 0; i < m_eqs.size() && b; i++) { for(size_t i2 = 0; i2 < vars_m.size(); i2++) { if(m_eqs[i].isComparison() && m_eqs[i][0].contains(vars_m[i2], true)) { m_eqs[i].isolate_x(eo, vars_m[i2]); m_eqs[i].calculatesub(eo, eo, true); if(m_eqs[i].isLogicalOr()) m_eqs[i].setToChild(1); if(m_eqs[i].isComparison() && m_eqs[i].comparisonType() == COMPARISON_EQUALS && m_eqs[i][0] == vars_m[i2]) { for(size_t i3 = 0; i3 < m_eqs.size(); i3++) { if(i3 != i) { m_eqs[i3][0].calculateReplace(vars_m[i2], m_eqs[i][1], eo); m_eqs[i3][1].calculateReplace(vars_m[i2], m_eqs[i][1], eo); } } vars_m.delChild(i2 + 1); } else { b = false; } break; } } } for(size_t i = 0; i < m_eqs.size();) { m_eqs[i].calculatesub(eo, eo); if(m_eqs[i].isZero()) {b = false; break;} if(m_eqs[i].isOne()) m_eqs.delChild(i + 1); else i++; } if(b && vars_m.size() == 0) { for(size_t i = 0; i < vars.size(); i++) { for(size_t i2 = 0; i2 < m_eqs.size(); i2++) { if(m_eqs[i2][0] == vars[i]) { mnums3.replace(vars[i], m_eqs[i2][1]); break; } } } } else { b = false; } } } else { b = false; } } } for(size_t i = 0; i < vars.size(); i++) { vars[i]->destroy(); } if(b) { for(size_t i = 0; i < mnums3.size(); i++) { mnums3.calculatesub(eo, eo, true); if(!mnums3[i].isZero()) { if(mnums3[i].isOne()) { mnew.addChild(mtest3[i]); mnew.last().inverse(); } else { mnew.addChild(mnums3[i]); mnew.last() /= mtest3[i]; } } } } if(b) { if(mnew.size() == 0) mnew.clear(); else if(mnew.size() == 1) mnew.setToChild(1); mnew.childrenUpdated(); if(equals(mnew, true)) return false; set(mnew, true); return true; } } } return false; } bool expand_partial_fractions(MathStructure &m, const EvaluationOptions &eo, bool do_simplify = true) { MathStructure mtest(m); if(do_simplify) { mtest.simplify(eo); mtest.calculatesub(eo, eo, true); } if(mtest.isPower() && mtest[1].representsNegative()) { MathStructure x_var = mtest[0].find_x_var(); if(!x_var.isUndefined() && mtest[0].factorize(eo, false, 0, 0, false, false, NULL, x_var)) { if(mtest.decomposeFractions(x_var, eo) && mtest.isAddition()) { m = mtest; return true; } } } else if(mtest.isMultiplication()) { for(size_t i = 0; i < mtest.size(); i++) { if(mtest[i].isPower() && mtest[i][1].isMinusOne() && mtest[i][0].isAddition()) { MathStructure x_var = mtest[i][0].find_x_var(); if(!x_var.isUndefined()) { MathStructure mfac(mtest); mfac.delChild(i + 1, true); bool b_poly = true; if(mfac.contains(x_var, true)) { MathStructure mquo, mrem; b_poly = polynomial_long_division(mfac, mtest[i][0], x_var, mquo, mrem, eo, true); if(b_poly && !mquo.isZero()) { MathStructure m = mquo; if(!mrem.isZero()) { m += mrem; m.last() *= mtest[i]; m.childrenUpdated(); } expand_partial_fractions(m, eo, false); return true; } } if(b_poly && mtest[i][0].factorize(eo, false, 0, 0, false, false, NULL, x_var)) { MathStructure mmul(1, 1, 0); while(mtest[i][0].isMultiplication() && mtest[i][0].size() >= 2 && !mtest[i][0][0].containsRepresentativeOf(x_var, true)) { if(mmul.isOne()) { mmul = mtest[i][0][0]; mmul.calculateInverse(eo); } else { mmul *= mtest[i][0][0]; mmul.last().calculateInverse(eo); mmul.calculateMultiplyLast(eo); } mtest[i][0].delChild(1, true); } for(size_t i2 = 0; i2 < mtest.size();) { if(i2 != i && !mtest[i2].containsRepresentativeOf(x_var, true)) { if(mmul.isOne()) { mmul = mtest[i2]; } else { mmul.calculateMultiply(mtest[i2], eo); } if(mtest.size() == 2) { mtest.setToChild(i + 1, true); break; } else { mtest.delChild(i2 + 1); if(i2 < i) i--; } } else { i2++; } } if(mtest.decomposeFractions(x_var, eo) && mtest.isAddition()) { m = mtest; if(!mmul.isOne()) { for(size_t i2 = 0; i2 < m.size(); i2++) { m[i2].calculateMultiply(mmul, eo); } } return true; } } } } } } else { bool b = false; for(size_t i = 0; i < mtest.size(); i++) { if(expand_partial_fractions(mtest[i], eo, false)) { b = true; } } if(b) { m = mtest; m.calculatesub(eo, eo, false); return true; } } return false; } bool MathStructure::expandPartialFractions(const EvaluationOptions &eo) { return expand_partial_fractions(*this, eo, true); } int contains_unsolved_integrate(const MathStructure &mstruct, MathStructure *this_mstruct, MathStructure *parent_parts); int contains_unsolved_integrate(const MathStructure &mstruct, MathStructure *this_mstruct, vector *parent_parts) { if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_integrate) { if(this_mstruct->equals(mstruct[0], true)) return 3; for(size_t i = 0; i < parent_parts->size(); i++) { if(mstruct[0].equals(*(*parent_parts)[i], true)) return 2; } return 1; } int ret = 0; for(size_t i = 0; i < mstruct.size(); i++) { int ret_i = contains_unsolved_integrate(mstruct[i], this_mstruct, parent_parts); if(ret_i == 1) { return 1; } else if(ret_i > ret) { ret = ret_i; } } return ret; } bool fix_abs_x(MathStructure &mstruct, const MathStructure &x_var) { bool b = false; if(mstruct.isFunction() && mstruct.size() == 1 && mstruct[0].isFunction() && mstruct[0].function() == CALCULATOR->f_abs && mstruct[0].size() == 1) { if((mstruct.function() == CALCULATOR->f_sin || mstruct.function() == CALCULATOR->f_tan || mstruct.function() == CALCULATOR->f_sinh || mstruct.function() == CALCULATOR->f_tanh || mstruct.function() == CALCULATOR->f_asin || mstruct.function() == CALCULATOR->f_atan || mstruct.function() == CALCULATOR->f_asinh || mstruct.function() == CALCULATOR->f_atanh) && mstruct[0][0].representsNonComplex(true)) { mstruct[0].setToChild(1, true); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->f_signum, &mstruct[0], &m_zero, NULL)); mstruct.evalSort(false); b = true; } else if((mstruct.function() == CALCULATOR->f_cos || mstruct.function() == CALCULATOR->f_cosh) && mstruct[0][0].representsNonComplex(true)) { mstruct[0].setToChild(1, true); b = true; } else if(mstruct.function() == CALCULATOR->f_ln && (mstruct[0][0].representsNonComplex(true) || test_absln_comp_cmplx(mstruct[0][0]))) { mstruct[0].setToChild(1, true); mstruct[0] ^= nr_two; mstruct /= nr_two; b = true; } } for(size_t i = 0; i < mstruct.size(); i++) { if(fix_abs_x(mstruct[i], x_var)) b = true; } return b; } MathStructure *find_abs_x(MathStructure &mstruct, const MathStructure &x_var, const MathStructure *parent = NULL, int level = 0) { if(mstruct.isFunction()) { if(((mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1) || (mstruct.function() == CALCULATOR->f_root && VALID_ROOT(mstruct) && mstruct[1].number().isOdd())) && mstruct[0].contains(x_var, true) > 0 && mstruct[0].representsNonComplex(true)) { return &mstruct[0]; } if((!parent || parent->isMultiplication() || parent->isAddition()) && level <= 2 && mstruct.function() == CALCULATOR->f_ln && mstruct.size() == 1) { if((mstruct[0].isFunction() && mstruct[0].function() == CALCULATOR->f_root) || (mstruct[0].isPower() && mstruct[0][1].isInteger() && mstruct[0][0].isFunction() && mstruct[0][0].function() == CALCULATOR->f_root)) return NULL; if(mstruct[0].isMultiplication() && mstruct[0].size() == 2 && ((mstruct[0][1].isFunction() && mstruct[0][1].function() == CALCULATOR->f_root) || (mstruct[0][1].isPower() && mstruct[0][1][1].isInteger() && mstruct[0][1][0].isFunction() && mstruct[0][1][0].function() == CALCULATOR->f_root))) return NULL; } } for(size_t i = 0; i < mstruct.size(); i++) { MathStructure *m = find_abs_x(mstruct[i], x_var, &mstruct, level + 1); if(m) return m; } return NULL; } bool fix_sgn_x(MathStructure &mstruct, const MathStructure &x_var, const EvaluationOptions &eo) { if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_signum && mstruct.size() == 2) { MathStructure mtest(mstruct); KnownVariable *var = new KnownVariable("", format_and_print(x_var), ((UnknownVariable*) x_var.variable())->interval()); var->ref(); mtest.replace(x_var, var); CALCULATOR->beginTemporaryStopMessages(); mtest.eval(eo); var->destroy(); if(!CALCULATOR->endTemporaryStopMessages() && !mtest.isFunction()) { mstruct.set(mtest); return true; } } bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(fix_sgn_x(mstruct[i], x_var, eo)) b = true; } return b; } bool replace_abs_x(MathStructure &mstruct, const MathStructure &marg, bool b_minus, const MathStructure *parent = NULL, int level = 0) { if(mstruct.isFunction()) { if(mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1 && mstruct[0].equals(marg, true)) { mstruct.setToChild(1); if(b_minus) mstruct.negate(); return true; } else if(mstruct.function() == CALCULATOR->f_root && VALID_ROOT(mstruct) && mstruct[1].number().isOdd() && mstruct[0].equals(marg, true)) { if(b_minus) mstruct[0].negate(); mstruct[1].number().recip(); mstruct.setType(STRUCT_POWER); mstruct.childrenUpdated(); if(b_minus) mstruct.negate(); return true; } if((!parent || parent->isMultiplication() || parent->isAddition()) && level <= 2 && mstruct.function() == CALCULATOR->f_ln && mstruct.size() == 1) { if((mstruct[0].isFunction() && mstruct[0].function() == CALCULATOR->f_root) || (mstruct[0].isPower() && mstruct[0][1].isInteger() && mstruct[0][0].isFunction() && mstruct[0][0].function() == CALCULATOR->f_root)) return false; if(mstruct[0].isMultiplication() && mstruct[0].size() == 2 && ((mstruct[0][1].isFunction() && mstruct[0][1].function() == CALCULATOR->f_root) || (mstruct[0][1].isPower() && mstruct[0][1][1].isInteger() && mstruct[0][1][0].isFunction() && mstruct[0][1][0].function() == CALCULATOR->f_root))) return false; } } if(mstruct.isPower() && mstruct[1].isInteger() && mstruct[1].number().isOdd() && mstruct[0].isFunction() && mstruct[0].function() == CALCULATOR->f_root && VALID_ROOT(mstruct[0]) && mstruct[0][1].number().isOdd() && mstruct[0][0].equals(marg, true)) { mstruct[1].number().divide(mstruct[0][1].number()); mstruct[0].setToChild(1, true); if(mstruct[1].number().isOne()) mstruct.setToChild(1, true); if(b_minus) mstruct[0].negate(); mstruct.childrenUpdated(); if(b_minus) mstruct.negate(); return true; } bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(replace_abs_x(mstruct[i], marg, b_minus, &mstruct, level + 1)) { mstruct.childUpdated(i + 1); b = true; } } return b; } bool test_sign_zero(const MathStructure &m, const MathStructure &x_var, const MathStructure &mzero, const EvaluationOptions &eo) { if(m.contains(x_var, true) <= 0) return false; if(m.isMultiplication()) { for(size_t i = 0; i < m.size(); i++) { if(m[i].isPower() && m[i][1].representsNegative() && test_sign_zero(m[i][0], x_var, mzero, eo)) return true; } } CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(m); mtest.replace(x_var, mzero); mtest.transform(COMPARISON_EQUALS, m_zero); mtest.eval(eo); return !CALCULATOR->endTemporaryStopMessages() && mtest.isOne(); } bool try_sign(MathStructure &m1, MathStructure &m2, const MathStructure &marg, const MathStructure &x_var, const MathStructure &mzero, const EvaluationOptions &eo, bool *test_zero = NULL) { if(m1.equals(m2, true)) return true; if(m1.isNumber() && m1.number().isReal() && m2.isNumber() && m2.number().isReal()) { m2.number().negate(); if(m1.number().equals(m2.number(), true)) { m2.number().negate(); if(!test_sign_zero(m1, x_var, mzero, eo)) { if(!test_zero) return false; *test_zero = true; } if(!test_zero || !(*test_zero)) m1 *= MathStructure(CALCULATOR->f_signum, &marg, &m_zero, NULL); return true; } m2.number().negate(); return false; } if(m1.type() != m2.type()) { if((m1.isMultiplication() && m1.size() == 2 && m1[0].isMinusOne() && try_sign(m1[1], m2, marg, x_var, mzero, eo)) || (m2.isMultiplication() && m2.size() == 2 && m2[0].isMinusOne() && try_sign(m1, m2[1], marg, x_var, mzero, eo))) { if(!test_sign_zero(m1, x_var, mzero, eo)) { if(!test_zero) return false; *test_zero = true; } if(!test_zero || !(*test_zero)) m1 *= MathStructure(CALCULATOR->f_signum, &marg, &m_zero, NULL); return true; } return false; } if(m1.size() == 0) return false; if(m1.size() != m2.size()) { if(m1.isMultiplication() && ((m1.size() == m2.size() + 1 && m1[0].isMinusOne()) || (m2.size() == m1.size() + 1 && m2[0].isMinusOne()))) { if(m1.size() > m2.size()) { for(size_t i = 0; i < m2.size(); i++) { if(!try_sign(m1[i + 1], m2[i], marg, x_var, mzero, eo)) return false; } } else { for(size_t i = 0; i < m1.size(); i++) { if(!try_sign(m1[i], m2[i + 1], marg, x_var, mzero, eo)) return false; } } if(!test_sign_zero(m1, x_var, mzero, eo)) { if(!test_zero) return false; *test_zero = true; } if(!test_zero || !(*test_zero)) m1 *= MathStructure(CALCULATOR->f_signum, &marg, &m_zero, NULL); return true; } return false; } if(m1.isFunction() && m1.function() != m2.function()) return false; if(m1.isComparison() && m1.comparisonType() != m2.comparisonType()) return false; if(m1.isMultiplication() && m1.size() > 1 && m1[0].isNumber() && !m1[0].equals(m2[0], true)) { if(!m1[0].isNumber()) return false; m2[0].number().negate(); if(m1[0].number().equals(m2[0].number(), true)) { m2[0].number().negate(); for(size_t i = 1; i < m1.size(); i++) { if(!try_sign(m1[i], m2[i], marg, x_var, mzero, eo)) return false; } if(!test_sign_zero(m1, x_var, mzero, eo)) { if(!test_zero) return false; *test_zero = true; } if(!test_zero || !(*test_zero)) m1 *= MathStructure(CALCULATOR->f_signum, &marg, &m_zero, NULL); return true; } m2[0].number().negate(); return false; }/* else if(m1.isPower()) { bool b_tz = false; if(!try_sign(m1[0], m2[0], marg, x_var, mzero, eo, &b_tz) || b_tz) return false; if(!try_sign(m1[1], m2[1], marg, x_var, mzero, eo, &b_tz)) return false; if(b_tz && (test_sign_zero(m1[1], x_var, mzero, eo) || !test_sign_zero(m1[0], x_var, mzero, eo))) return false; return true; }*/ bool b_tz = false; bool b_equal = false; for(size_t i = 0; i < m1.size(); i++) { if(!b_equal && m1.isAddition() && m1[i].equals(m2[i], true)) b_equal = true; else if(!try_sign(m1[i], m2[i], marg, x_var, mzero, eo, m1.isAddition() ? &b_tz : NULL)) return false; if(b_tz && b_equal) break; } if(b_tz) { if(!test_sign_zero(m1, x_var, mzero, eo)) { if(!test_zero) return false; *test_zero = true; } if(!test_zero || !(*test_zero)) m1 *= MathStructure(CALCULATOR->f_signum, &marg, &m_zero, NULL); } return true; } int MathStructure::integrate(const MathStructure &x_var, const EvaluationOptions &eo_pre, bool simplify_first, int use_abs, bool definite_integral, bool try_abs, int max_part_depth, vector *parent_parts) { if(CALCULATOR->aborted()) CANNOT_INTEGRATE EvaluationOptions eo = eo_pre; eo.protected_function = CALCULATOR->f_integrate; EvaluationOptions eo2 = eo; eo2.expand = true; eo2.combine_divisions = false; eo2.sync_units = false; EvaluationOptions eo_t = eo; eo_t.approximation = APPROXIMATION_TRY_EXACT; if(simplify_first) { unformat(); calculateFunctions(eo2); calculatesub(eo2, eo2); if(CALCULATOR->aborted()) CANNOT_INTEGRATE } bool recalc = false; if(fix_abs_x(*this, x_var)) recalc = true; MathStructure *mfound = NULL; if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { if(fix_sgn_x(*this, x_var, eo_t)) recalc = true; while(true) { mfound = find_abs_x(*this, x_var); if(mfound) { MathStructure m_interval(*mfound); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); CALCULATOR->beginTemporaryStopMessages(); m_interval.eval(eo_t); if(!CALCULATOR->endTemporaryStopMessages()) break; if(m_interval.representsNonNegative(true)) { replace_abs_x(*this, MathStructure(*mfound), false); recalc = true; } else if(m_interval.representsNegative(true)) { replace_abs_x(*this, MathStructure(*mfound), true); recalc = true; } else { break; } } else { break; } } } if(recalc) calculatesub(eo2, eo2); if(equals(x_var)) { raise(2); multiply(MathStructure(1, 2, 0)); return true; } if(containsRepresentativeOf(x_var, true, true) == 0) { multiply(x_var); return true; } mfound = find_abs_x(*this, x_var); if(try_abs && mfound) { MathStructure mtest(*this); MathStructure mtest_m(mtest); if(!replace_abs_x(mtest, *mfound, false) || !replace_abs_x(mtest_m, *mfound, true)) CANNOT_INTEGRATE eo_t.isolate_x = true; eo_t.isolate_var = &x_var; CALCULATOR->beginTemporaryStopMessages(); MathStructure mpos(*mfound); mpos.transform(COMPARISON_EQUALS_GREATER, m_zero); mpos.eval(eo_t); UnknownVariable *var_p = NULL, *var_m = NULL; if(!CALCULATOR->endTemporaryStopMessages() && mpos.isComparison() && (mpos.comparisonType() == COMPARISON_EQUALS_GREATER || mpos.comparisonType() == COMPARISON_EQUALS_LESS) && mpos[0] == x_var && mpos[1].isNumber()) { var_p = new UnknownVariable("", format_and_print(x_var)); var_m = new UnknownVariable("", format_and_print(x_var)); var_p->ref(); var_m->ref(); Number nr_interval_p, nr_interval_m; if(x_var.isVariable() && !x_var.variable()->isKnown() && ((UnknownVariable*) x_var.variable())->interval().isNumber() && ((UnknownVariable*) x_var.variable())->interval().number().isInterval() && ((UnknownVariable*) x_var.variable())->interval().number().isReal() && ((UnknownVariable*) x_var.variable())->interval().number().upperEndPoint().isGreaterThanOrEqualTo(mpos[1].number()) && ((UnknownVariable*) x_var.variable())->interval().number().lowerEndPoint().isLessThanOrEqualTo(mpos[1].number())) { if(mpos.comparisonType() == COMPARISON_EQUALS_GREATER) { nr_interval_p.setInterval(mpos[1].number(), ((UnknownVariable*) x_var.variable())->interval().number().upperEndPoint()); nr_interval_m.setInterval(((UnknownVariable*) x_var.variable())->interval().number().lowerEndPoint(), mpos[1].number()); } else { nr_interval_m.setInterval(mpos[1].number(), ((UnknownVariable*) x_var.variable())->interval().number().upperEndPoint()); nr_interval_p.setInterval(((UnknownVariable*) x_var.variable())->interval().number().lowerEndPoint(), mpos[1].number()); } } else { if(mpos.comparisonType() == COMPARISON_EQUALS_GREATER) { nr_interval_p.setInterval(mpos[1].number(), nr_plus_inf); nr_interval_m.setInterval(nr_minus_inf, mpos[1].number()); } else { nr_interval_m.setInterval(mpos[1].number(), nr_plus_inf); nr_interval_p.setInterval(nr_minus_inf, mpos[1].number()); } } var_p->setInterval(nr_interval_p); var_m->setInterval(nr_interval_m); mtest.replace(x_var, var_p); mtest_m.replace(x_var, var_m); } int bint1 = mtest.integrate(var_p ? var_p : x_var, eo, true, use_abs, true, definite_integral, max_part_depth, parent_parts); if(var_p) { mtest.replace(var_p, x_var); var_p->destroy(); } if(bint1 <= 0 || mtest.containsFunction(CALCULATOR->f_integrate, true) > 0) { if(var_m) var_m->destroy(); if(bint1 < 0) CANNOT_INTEGRATE_INTERVAL CANNOT_INTEGRATE; } int bint2 = mtest_m.integrate(var_m ? var_m : x_var, eo, true, use_abs, false, definite_integral, max_part_depth, parent_parts); if(var_m) { mtest_m.replace(var_m, x_var); var_m->destroy(); } if(bint2 < 0) CANNOT_INTEGRATE_INTERVAL if(bint2 == 0 || mtest_m.containsFunction(CALCULATOR->f_integrate, true) > 0) CANNOT_INTEGRATE; MathStructure m1(mtest), m2(mtest_m); CALCULATOR->beginTemporaryStopMessages(); MathStructure mzero(*mfound); mzero.transform(COMPARISON_EQUALS, m_zero); mzero.eval(eo_t); if(!CALCULATOR->endTemporaryStopMessages() && mzero.isComparison() && mzero.comparisonType() == COMPARISON_EQUALS && mzero[0] == x_var) { mzero.setToChild(2); CALCULATOR->beginTemporaryStopMessages(); m1.calculatesub(eo2, eo2, true); m2.calculatesub(eo2, eo2, true); m1.evalSort(true, true); m2.evalSort(true, true); eo_t.test_comparisons = true; eo_t.isolate_x = false; eo_t.isolate_var = NULL; if(try_sign(m1, m2, *mfound, x_var, mzero, eo_t)) { set(m1, true); CALCULATOR->endTemporaryStopMessages(true); return true; } CALCULATOR->endTemporaryStopMessages(); } MathStructure mcmp(*mfound); mcmp.transform(COMPARISON_EQUALS_GREATER, m_zero); set(mtest); multiply(mcmp); mcmp.setComparisonType(COMPARISON_LESS); mtest_m *= mcmp; add(mtest_m); /*eo2.test_comparisons = true; calculatesub(eo2, eo2, true);*/ return true; } switch(m_type) { case STRUCT_ADDITION: { bool b = false; MathStructure mbak(*this); for(size_t i = 0; i < SIZE; i++) { int bint = CHILD(i).integrate(x_var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts); if(bint < 0) { set(mbak); CANNOT_INTEGRATE_INTERVAL } if(bint > 0) b = true; CHILD_UPDATED(i); } if(!b) return false; break; } case STRUCT_UNIT: {} case STRUCT_NUMBER: { multiply(x_var); break; } case STRUCT_POWER: { if(CHILD(1).isNumber() || CHILD(1).containsRepresentativeOf(x_var, true, true) == 0) { bool b_minusone = (CHILD(1).isNumber() && CHILD(1).number().isMinusOne()); MathStructure madd, mmul, mmul2, mexp; if(CHILD(0).isFunction()) { MathStructure mbase(CHILD(0)); int bint = integrate_function(mbase, x_var, eo, CHILD(1), m_one, m_zero, m_one, use_abs, definite_integral, max_part_depth, parent_parts); if(bint < 0) CANNOT_INTEGRATE_INTERVAL if(bint) { set(mbase, true); return true; } } else if(integrate_info(CHILD(0), x_var, madd, mmul, mmul2, false, true)) { if(mmul2.isZero()) { if(madd.isZero() && mmul.isOne()) { if(b_minusone) { if(!transform_absln(CHILD(0), use_abs, definite_integral, x_var, eo)) CANNOT_INTEGRATE_INTERVAL SET_CHILD_MAP(0); } else { CHILD(1) += m_one; MathStructure mstruct(CHILD(1)); divide(mstruct); } return true; } else if(b_minusone) { if(!transform_absln(CHILD(0), use_abs, definite_integral, x_var, eo)) CANNOT_INTEGRATE_INTERVAL SET_CHILD_MAP(0); if(!mmul.isOne()) divide(mmul); return true; } else { mexp = CHILD(1); mexp += m_one; SET_CHILD_MAP(0); raise(mexp); if(!mmul.isOne()) mexp *= mmul; divide(mexp); return true; } } else if(mmul.isZero() && !madd.isZero() && CHILD(1).number().denominatorIsTwo()) { MathStructure mmulsqrt2(mmul2); if(!mmul2.isOne()) mmulsqrt2 ^= nr_half; Number num(CHILD(1).number().numerator()); if(num.isOne()) { MathStructure mthis(*this); add(x_var); if(!mmul2.isOne()) LAST *= mmulsqrt2; if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mthis); CANNOT_INTEGRATE_INTERVAL} multiply(madd); mthis *= x_var; if(!mmul2.isOne()) mthis *= mmulsqrt2; add(mthis); multiply(nr_half); if(!mmul2.isOne()) divide(mmulsqrt2); childrenUpdated(true); return true; } else if(num == 3) { MathStructure mterm3(*this); CHILD(1).number().set(1, 2, 0, true); MathStructure mterm2(*this); add(x_var); if(!mmul2.isOne()) LAST *= mmulsqrt2; if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mterm3); CANNOT_INTEGRATE_INTERVAL} multiply(madd); LAST ^= nr_two; multiply(Number(3, 8, 0), true); mterm2 *= x_var; if(!mmul2.isOne()) mterm2 *= mmulsqrt2; mterm2 *= madd; mterm2 *= Number(3, 8, 0); mterm3 *= x_var; if(!mmul2.isOne()) mterm3 *= mmulsqrt2; mterm3 *= Number(1, 4, 0); add(mterm2); add(mterm3); if(!mmul2.isOne()) divide(mmulsqrt2); return true; } else if(num == 5) { CHILD(1).number().set(1, 2, 0, true); MathStructure mterm2(*this); MathStructure mterm3(*this); MathStructure mterm4(*this); multiply(x_var); LAST ^= Number(5, 1); if(!mmul2.isOne()) { multiply(mmul2, true); LAST ^= nr_two; } multiply(Number(1, 6), true); if(!mmul2.isOne()) mterm2 *= mmulsqrt2; mterm2 += x_var; if(!mmul2.isOne()) mterm2[mterm2.size() - 1] *= mmul2; if(!transform_absln(mterm2, use_abs, definite_integral, x_var, eo)) {set(mterm3); CANNOT_INTEGRATE_INTERVAL} mterm2 *= madd; mterm2.last() ^= nr_three; if(!mmul2.isOne()) mterm2 /= mmulsqrt2; mterm2 *= Number(5, 16); mterm3 *= x_var; mterm3 *= madd; mterm3.last() ^= nr_two; mterm3 *= Number(11, 16); mterm4 *= x_var; mterm4.last() ^= nr_three; mterm4 *= madd; if(!mmul2.isOne()) mterm4 *= mmul2; mterm4 *= Number(13, 24); add(mterm2); add(mterm3); add(mterm4); childrenUpdated(true); return true; } else if(num.isMinusOne()) { MathStructure mbak(*this); CHILD(1).number().set(1, 2, 0, true); if(!mmul2.isOne()) multiply(mmulsqrt2); add(x_var); if(!mmul2.isOne()) LAST.multiply(mmul2); if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} if(!mmul2.isOne()) divide(mmulsqrt2); return true; } else if(num == -3) { CHILD(1).number().set(-1, 2, 0, true); madd.inverse(); multiply(madd); multiply(x_var); return true; } } else if(CHILD(1).isMinusOne()) { MathStructure m4acmb2(madd); m4acmb2 *= mmul2; m4acmb2 *= Number(4, 1); m4acmb2 += mmul; m4acmb2.last() ^= nr_two; m4acmb2.last().negate(); m4acmb2.calculatesub(eo, eo, true); if(!m4acmb2.representsNonZero(true)) { if(m4acmb2.isZero()) { set(x_var, true); multiply(mmul2); multiply(nr_two, true); add(mmul); inverse(); multiply(Number(-2, 1)); return true; } else if(!warn_about_denominators_assumed_nonzero(m4acmb2, eo)) { CANNOT_INTEGRATE } } if(m4acmb2.representsNegative(true)) { MathStructure mbak(*this); MathStructure m2axpb(x_var); m2axpb *= mmul2; m2axpb *= nr_two; m2axpb += mmul; MathStructure mb2m4ac(madd); mb2m4ac *= mmul2; mb2m4ac *= Number(-4, 1); mb2m4ac += mmul; mb2m4ac.last() ^= nr_two; mb2m4ac ^= nr_half; set(m2axpb); subtract(mb2m4ac); multiply(m2axpb); LAST += mb2m4ac; LAST ^= nr_minus_one; if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} divide(mb2m4ac); return true; } m4acmb2 ^= Number(-1, 2); set(x_var, true); multiply(mmul2); multiply(nr_two, true); add(mmul); multiply(m4acmb2); transform(CALCULATOR->f_atan); multiply(nr_two); multiply(m4acmb2, true); return true; } else if(CHILD(1).isInteger() && CHILD(1).number().isNegative()) { MathStructure m2nm3(CHILD(1)); m2nm3 *= nr_two; m2nm3 += Number(3, 1); CHILD(1).number()++; MathStructure mnp1(CHILD(1)); mnp1.number().negate(); mnp1.number().recip(); MathStructure mthis(*this); if(integrate(x_var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) CANNOT_INTEGRATE_INTERVAL MathStructure m4acmb2(madd); m4acmb2 *= mmul2; m4acmb2 *= Number(4, 1); m4acmb2 += mmul; m4acmb2.last() ^= nr_two; m4acmb2.last().negate(); m4acmb2.inverse(); MathStructure mfac1(mmul2); mfac1 *= Number(-2, 1); mfac1 *= m2nm3; mfac1 *= mnp1; mfac1 *= m4acmb2; multiply(mfac1); MathStructure mterm2(x_var); mterm2 *= mmul2; mterm2 *= nr_two; mterm2 += mmul; mterm2 *= m4acmb2; mterm2 *= mthis; mterm2 *= mnp1; add(mterm2); return true; } } else if(integrate_info(CHILD(0), x_var, madd, mmul, mexp, false, false) && mexp.isNumber() && !mexp.number().isOne()) { if(CHILD(1).isMinusOne() && mexp.number().isNegative() && mexp.number().isInteger()) { if(!madd.isZero()) { Number nexp(mexp.number()); nexp.negate(); MathStructure mtest(x_var); mtest ^= nexp; mtest *= madd; mtest += mmul; mtest.inverse(); mtest *= x_var; mtest.last() ^= nexp; CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate) <= 0) { CALCULATOR->endTemporaryStopMessages(true); set(mtest, true); return true; } CALCULATOR->endTemporaryStopMessages(); } } else if(mexp.number().isRational() && !mexp.number().isInteger()) { Number num(mexp.number().numerator()); Number den(mexp.number().denominator()); MathStructure morig(x_var); Number den_inv(den); den_inv.recip(); morig ^= den_inv; UnknownVariable *var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(morig) + RIGHT_PARENTHESIS); var->ref(); Number den_m1(den); den_m1--; MathStructure mtest(var); if(!num.isOne()) mtest ^= num; if(!mmul.isOne()) mtest *= mmul; mtest += madd; mtest ^= CHILD(1); mtest *= var; if(!den_m1.isOne()) mtest.last() ^= den_m1; if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(morig); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(morig); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate) <= 0) { CALCULATOR->endTemporaryStopMessages(true); set(mtest, true); replace(var, morig); multiply(den); var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } else if(integrate_info(CHILD(0), x_var, madd, mmul, mexp, false, false, true) && !madd.isZero()) { if(mexp.isFunction()) { MathStructure mfunc(mexp); int bint = integrate_function(mfunc, x_var, eo, CHILD(1), m_one, madd, mmul, use_abs, definite_integral, max_part_depth, parent_parts); if(bint < 0) CANNOT_INTEGRATE_INTERVAL if(bint) { set(mfunc, true); return true; } } else if(mexp.isPower() && mexp[1].containsRepresentativeOf(x_var, true, true) == 0) { MathStructure mbase(mexp[0]); if(integrate_info(mbase, x_var, madd, mmul, mexp, false, false) && mexp.isOne() && (!madd.isZero() || !mmul.isOne())) { MathStructure mtest(*this); UnknownVariable *var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(mbase) + RIGHT_PARENTHESIS); var->ref(); mtest.replace(mbase, var, mbase.containsInterval()); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(mbase); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(mbase); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate) <= 0) { CALCULATOR->endTemporaryStopMessages(true); set(mtest, true); replace(var, mbase); if(!mmul.isOne()) divide(mmul); var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } } if(CHILD(0).isAddition()) { MathStructure mtest(*this); if(mtest[0].factorize(eo, false, 0, 0, false, false, NULL, x_var)) { mmul = m_one; while(mtest[0].isMultiplication() && mtest[0].size() >= 2 && mtest[0][0].containsRepresentativeOf(x_var, true, true) == 0) { if(mmul.isOne()) mmul = mtest[0][0]; else mmul *= mtest[0][0]; mtest[0].delChild(1, true); } if(!mmul.isOne()) { mmul ^= mtest[1]; } MathStructure mtest2(mtest); if(mtest2.decomposeFractions(x_var, eo) && mtest2.isAddition()) { bool b = true; CALCULATOR->beginTemporaryStopMessages(); for(size_t i = 0; i < mtest2.size(); i++) { if(mtest2[i].integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) <= 0) { b = false; break; } } CALCULATOR->endTemporaryStopMessages(b); if(b) { set(mtest2, true); if(!mmul.isOne()) multiply(mmul); return true; } } MathStructure mmul2(1, 1, 0); if(mtest[0].isMultiplication() && mtest[0].size() >= 2 && !mtest[0][0].isAddition()) { mmul2 = mtest[0][0]; mmul2.calculateInverse(eo2); mtest[0].delChild(1, true); } if(mtest[0].isPower()) { mtest[1].calculateMultiply(mtest[0][1], eo2); mtest[0].setToChild(1); } if(!mmul2.isOne()) { mtest *= mmul2; mtest.evalSort(false); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(x_var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); set(mtest, true); if(!mmul.isOne()) multiply(mmul); return true; } CALCULATOR->endTemporaryStopMessages(); } if(b_minusone) { MathStructure mmul2; if(integrate_info(CHILD(0), x_var, madd, mmul, mmul2, false, true) && (!mmul2.isZero() && (!madd.isZero() || !mmul.isZero()))) { if(mmul.isZero()) { if(!mmul2.isOne()) { madd /= mmul2; } madd ^= nr_half; set(x_var); divide(madd); transform(STRUCT_FUNCTION); setFunction(CALCULATOR->f_atan); divide(madd); if(!mmul2.isOne()) divide(mmul2); return true; } else { MathStructure acmb2(4, 1, 0); acmb2 *= mmul2; acmb2 *= madd; MathStructure b2(mmul); b2 ^= nr_two; acmb2 -= b2; acmb2 ^= nr_half; set(2, 1, 0, true); multiply(mmul2); multiply(x_var); add(mmul); divide(acmb2); transform(STRUCT_FUNCTION); setFunction(CALCULATOR->f_atan); multiply(nr_two); divide(acmb2); return true; } } } } } else if((CHILD(0).isNumber() && !CHILD(0).number().isOne()) || (!CHILD(0).isNumber() && CHILD(0).containsRepresentativeOf(x_var, true, true) == 0)) { MathStructure madd, mmul, mexp; if(integrate_info(CHILD(1), x_var, madd, mmul, mexp)) { if(mexp.isOne()) { if(CHILD(0) == CALCULATOR->v_e) { if(!mmul.isOne()) divide(mmul); return true; } else if(CHILD(0).isNumber() || warn_about_assumed_not_value(CHILD(0), m_one, eo)) { MathStructure mmulfac(CHILD(0)); mmulfac.transform(CALCULATOR->f_ln); if(!mmul.isOne()) mmulfac *= mmul; divide(mmulfac); return true; } } else if(madd.isZero()) { if(mexp.number().isRational() && !mexp.isInteger()) { Number num(mexp.number().numerator()); Number den(mexp.number().denominator()); MathStructure morig(x_var); Number den_inv(den); den_inv.recip(); morig ^= den_inv; UnknownVariable *var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(morig) + RIGHT_PARENTHESIS); var->ref(); MathStructure mvar(var); if(!num.isOne()) mvar ^= num; MathStructure mtest(CHILD(0)); mtest ^= mvar; if(!mmul.isOne()) { mtest.last() *= mmul; mtest.childUpdated(mtest.size()); } mtest *= mvar; if(num.isNegative()) mtest.last().last().number().negate(); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(morig); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(morig); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate) <= 0) { CALCULATOR->endTemporaryStopMessages(true); set(mtest, true); replace(var, morig); multiply(den); var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } //integrate(a^(bx^c)) = -igamma(1/c, -b*ln(a)*x^c)/(c(-1)^(1/c)*b^(1/c)*ln(a)^(1/c)) MathStructure mbase(CHILD(0)); MathStructure mexpinv(mexp); mexpinv.inverse(); MathStructure marg2(mbase); marg2.transform(CALCULATOR->f_ln); marg2 *= x_var; marg2.last() ^= mexp; marg2 *= mmul; marg2.negate(); set(CALCULATOR->f_igamma, &mexpinv, &marg2, NULL); divide(mexp); mexpinv.negate(); multiply(m_minus_one); LAST ^= mexpinv; multiply(mmul); LAST ^= mexpinv; multiply(mbase); LAST.transform(CALCULATOR->f_ln); LAST ^= mexpinv; negate(); return true; } } } CANNOT_INTEGRATE } case STRUCT_FUNCTION: { MathStructure mfunc(*this); int bint = integrate_function(mfunc, x_var, eo, m_one, m_one, m_zero, m_one, use_abs, definite_integral, max_part_depth, parent_parts); if(bint < 0) CANNOT_INTEGRATE_INTERVAL if(!bint) CANNOT_INTEGRATE set(mfunc, true); break; } case STRUCT_MULTIPLICATION: { MathStructure mstruct; bool b = false; for(size_t i = 0; i < SIZE;) { if(CHILD(i).containsRepresentativeOf(x_var, true, true) == 0) { if(b) { mstruct *= CHILD(i); } else { mstruct = CHILD(i); b = true; } ERASE(i); } else { i++; } } if(b) { if(SIZE == 1) { setToChild(1, true); } else if(SIZE == 0) { set(mstruct, true); break; } if(integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) { multiply(mstruct); CANNOT_INTEGRATE_INTERVAL } multiply(mstruct); break; } else if(SIZE == 2) { if(CHILD(0) != x_var && (CHILD(1) == x_var || (CHILD(1).isPower() && CHILD(1)[0] == x_var))) SWAP_CHILDREN(0, 1); if(CHILD(1).isPower() && CHILD(1)[1].containsRepresentativeOf(x_var, true, true) == 0) { MathStructure madd, mmul, mmul2; MathStructure mexp(CHILD(1)[1]); if(integrate_info(CHILD(1)[0], x_var, madd, mmul, mmul2, false, true)) { if(mmul2.isZero() && mexp.isNumber()) { if(CHILD(0) == x_var) { MathStructure mbak(*this); SET_CHILD_MAP(1) SET_CHILD_MAP(0) if(mexp.number().isMinusOne()) { MathStructure mterm(x_var); if(!mmul.isOne()) mterm /= mmul; if(!madd.isZero()) { if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} multiply(madd); if(!mmul.isOne()) { MathStructure a2(mmul); a2 ^= nr_two; divide(a2); } negate(); add(mterm); } else { set(mterm, true); } } else if(mexp.number() == -2) { MathStructure mterm(*this); if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} MathStructure a2(mmul); if(!mmul.isOne()) { a2 ^= nr_two; divide(a2); } if(!madd.isZero()) { if(!mmul.isOne()) mterm *= a2; mterm.inverse(); mterm *= madd; } add(mterm); } else if(mexp.number().isNegative()) { MathStructure onemn(1, 1, 0); onemn += mexp; MathStructure nm1(mexp); nm1.negate(); MathStructure nm2(nm1); nm1 += nr_minus_one; nm2 += Number(-2, 1); raise(nm1); multiply(nm2); multiply(nm1); if(!mmul.isOne()) { MathStructure a2(mmul); a2 ^= nr_two; multiply(a2); } inverse(); MathStructure mnum(x_var); mnum *= onemn; if(!mmul.isOne()) mnum *= mmul; if(!madd.isZero()) mnum -= madd; multiply(mnum); } else { MathStructure nm1(mexp); nm1 += m_one; raise(nm1); MathStructure mnum(x_var); mnum *= nm1; if(!mmul.isOne()) mnum *= mmul; mnum -= madd; MathStructure mden(mexp); mden += nr_two; mden *= nm1; if(!mmul.isOne()) { mden *= mmul; mden.last() ^= nr_two; } multiply(mnum); divide(mden); return true; } return true; } else if(CHILD(0).isPower() && CHILD(0)[0] == x_var && CHILD(0)[1] == nr_two) { MathStructure mbak(*this); SET_CHILD_MAP(1) SET_CHILD_MAP(0) if(mexp.number().isMinusOne()) { MathStructure mterm(x_var); mterm ^= nr_two; if(!mmul.isOne()) mterm *= mmul; if(!madd.isZero()) { MathStructure mtwobx(-2 ,1, 0); mtwobx *= madd; mtwobx *= x_var; mterm += mtwobx; } if(!mmul.isOne()) { MathStructure a2(mmul); a2 ^= nr_two; a2 *= nr_two; mterm /= a2; } else { mterm /= nr_two; } if(!madd.isZero()) { if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} MathStructure b2(madd); b2 ^= nr_two; multiply(b2); if(!mmul.isOne()) { MathStructure a3(mmul); a3 ^= nr_three; divide(a3); } add(mterm); } else { set(mterm, true); } } else if(mexp.number() == -2) { MathStructure mterm1(x_var); if(!mmul.isOne()) mterm1 *= mmul; if(!madd.isZero()) { MathStructure mterm2(*this); if(!transform_absln(mterm2, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} mterm2 *= madd; mterm2 *= -2; MathStructure mterm3(*this); mterm3.inverse(); madd ^= nr_two; mterm3 *= madd; mterm3.negate(); set(mterm1); add(mterm2); add(mterm3); } else { set(mterm1); } if(!mmul.isOne()) { MathStructure a3(mmul); a3 ^= nr_three; divide(a3); } } else if(mexp.number() == -3) { if(!madd.isZero()) { MathStructure mterm2(*this); mterm2.inverse(); mterm2 *= madd; mterm2 *= nr_two; MathStructure mterm3(*this); mterm3 ^= nr_two; mterm3 *= nr_two; mterm3.inverse(); madd ^= nr_two; mterm3 *= madd; mterm3.negate(); if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} add(mterm2); add(mterm3); } else { if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} } if(!mmul.isOne()) { MathStructure a3(mmul); a3 ^= nr_three; divide(a3); } } else { MathStructure mterm2(*this); MathStructure mterm3(*this); raise(nr_three); CHILD(1) += mexp; MathStructure mden(mexp); mden += nr_three; divide(mden); if(!madd.isZero()) { mterm2 ^= nr_two; mterm2[1] += mexp; mterm2 *= madd; mterm2 *= -2; mden = mexp; mden += nr_two; mterm2 /= mden; mterm3 ^= m_one; mterm3[1] += mexp; madd ^= nr_two; mterm3 *= madd; mden = mexp; mden += m_one; mterm3 /= mden; add(mterm2); add(mterm3); } if(!mmul.isOne()) { MathStructure a3(mmul); a3 ^= nr_three; divide(a3); } } return true; } else if(CHILD(0).isPower() && CHILD(0)[0] == x_var && CHILD(0)[1] == nr_minus_one && !madd.isZero()) { if(mexp.number().isMinusOne()) { MathStructure mbak(*this); SET_CHILD_MAP(1) SET_CHILD_MAP(0) divide(x_var); if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} divide(madd); negate(); return true; } } else if(CHILD(0).isPower() && CHILD(0)[0] == x_var && CHILD(0)[1] == -2 && !madd.isZero()) { if(mexp.number().isMinusOne()) { MathStructure mbak(*this); SET_CHILD_MAP(1) SET_CHILD_MAP(0) divide(x_var); if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} MathStructure madd2(madd); madd2 ^= nr_two; divide(madd2); if(!mmul.isOne()) multiply(mmul); madd *= x_var; madd.inverse(); subtract(madd); return true; } else if(mexp.number() == -2) { MathStructure mbak(*this); SET_CHILD_MAP(1) SET_CHILD_MAP(0) MathStructure mterm2(madd); mterm2 ^= nr_two; MathStructure mterm3(mterm2); mterm2 *= *this; mterm2.inverse(); divide(x_var); if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} MathStructure madd3(madd); madd3 ^= nr_three; divide(madd3); multiply(Number(-2, 1, 0)); mterm3 *= x_var; if(!mmul.isOne()) mterm3 *= mmul; mterm3.inverse(); add(mterm2); add(mterm3); mmul.negate(); multiply(mmul); return true; } } } else if(mmul.isZero() && !madd.isZero() && mexp.isNumber() && mexp.number().denominatorIsTwo()) { Number num(mexp.number()); if(CHILD(0) == x_var) { num.add(1); SET_CHILD_MAP(1) SET_CHILD_MAP(0) raise(num); num.multiply(2); num.recip(); multiply(num); if(!mmul2.isOne()) divide(mmul2); return true; } else if(CHILD(0).isPower() && CHILD(0)[0] == x_var && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isInteger()) { if(CHILD(0)[1].number() == 2) { if(num == nr_half) { MathStructure mbak(*this); SET_CHILD_MAP(1) MathStructure mterm2(*this); if(!mmul2.isOne()) { mterm2 *= mmul2; mterm2.last() ^= nr_half; } mterm2 += x_var; if(!mmul2.isOne()) mterm2.last() *= mmul2; if(!transform_absln(mterm2, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} mterm2.multiply(madd); mterm2.last() ^= nr_two; multiply(x_var); if(!mmul2.isOne()) { multiply(mmul2); LAST ^= nr_half; } multiply(x_var); LAST ^= nr_two; if(!mmul2.isOne()) LAST *= mmul2; LAST *= nr_two; LAST += madd; subtract(mterm2); multiply(Number(1, 8)); if(!mmul2.isOne()) { multiply(mmul2); LAST ^= Number(-3, 2); } return true; } } else if(CHILD(0)[1].number() == -1) { if(num == nr_minus_half) { MathStructure mbak(*this); SET_CHILD_MAP(1) SET_CHILD_MAP(0) raise(nr_half); multiply(madd); LAST ^= nr_half; add(madd); transform(CALCULATOR->f_ln); negate(); add(x_var); if(!transform_absln(LAST, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} multiply(madd); LAST ^= nr_minus_half; return true; } else if(num == nr_half) { MathStructure mbak(*this); SET_CHILD_MAP(1) MathStructure mterm2(*this); mterm2 *= madd; mterm2.last() ^= nr_half; mterm2 += madd; mterm2.transform(CALCULATOR->f_ln); mterm2 *= madd; mterm2.last() ^= nr_half; MathStructure mterm3(x_var); if(!transform_absln(mterm3, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} mterm3 *= madd; mterm3.last() ^= nr_half; subtract(mterm2); add(mterm3); return true; } } } } else if(mmul2.isZero()) { if(CHILD(0) == x_var) { SET_CHILD_MAP(1) CHILD(1) += m_one; MathStructure mnum(x_var); mnum *= CHILD(1); if(!mmul.isOne()) mnum *= mmul; mnum -= madd; MathStructure mden(CHILD(1)[0]); mden += nr_two; mden *= CHILD(1); if(!mmul.isOne()) { mden *= mmul; mden[mden.size() - 1] ^= nr_two; } multiply(mnum); divide(mden); return true; } } else if(mexp.isMinusOne() && CHILD(0) == x_var) { MathStructure mbak(*this); SET_CHILD_MAP(1) MathStructure mterm2(CHILD(0)); if(integrate(x_var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) CANNOT_INTEGRATE_INTERVAL multiply(mmul); divide(mmul2); multiply(Number(-1, 2)); if(!transform_absln(mterm2, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} mterm2 /= mmul2; mterm2 *= nr_half; add(mterm2); return true; } else if(mexp.isMinusOne() && CHILD(0).isPower() && CHILD(0)[0] == x_var && CHILD(0)[1].isMinusOne()) { MathStructure mbak(*this); SET_CHILD_MAP(1) MathStructure mterm2(CHILD(0)); if(integrate(x_var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) CANNOT_INTEGRATE_INTERVAL multiply(mmul); divide(madd); multiply(Number(-1, 2)); mterm2.inverse(); mterm2 *= x_var; mterm2.last() ^= nr_two; if(!transform_absln(mterm2, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} mterm2 /= madd; mterm2 *= nr_half; add(mterm2); return true; } else if(mexp.isInteger() && mexp.number().isNegative() && CHILD(0) == x_var) { MathStructure mbak(*this); SET_CHILD_MAP(1) MathStructure m2nm3(CHILD(1)); m2nm3 *= nr_two; m2nm3 += Number(3, 1); CHILD(1).number()++; MathStructure mnp1(CHILD(1)); mnp1.number().negate(); mnp1.number().recip(); MathStructure mthis(*this); if(integrate(x_var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) {set(mbak); CANNOT_INTEGRATE_INTERVAL} MathStructure m4acmb2(madd); m4acmb2 *= mmul2; m4acmb2 *= Number(4, 1); m4acmb2 += mmul; m4acmb2.last() ^= nr_two; m4acmb2.last().negate(); m4acmb2.inverse(); MathStructure mfac1(mmul); mfac1 *= m2nm3; mfac1 *= mnp1; mfac1 *= m4acmb2; multiply(mfac1); MathStructure mterm2(x_var); mterm2 *= mmul; mterm2 += madd; mterm2.last() *= nr_two; mterm2 *= m4acmb2; mterm2 *= mthis; mterm2 *= mnp1; subtract(mterm2); return true; } } if(CHILD(0) == x_var || (CHILD(0).isPower() && CHILD(0)[0] == x_var && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isRational())) { Number nexp(1, 1, 0); if(CHILD(0).isPower()) nexp = CHILD(0)[1].number(); MathStructure madd, mmul, mpow; if(integrate_info(CHILD(1)[0], x_var, madd, mmul, mpow, false, false, true) && mpow.isPower()) { if(mpow[0] == x_var) { mpow.setToChild(2); if(mpow.isNumber() && mpow.number().isRational() & !mpow.number().isOne()) { if(!nexp.isOne() && mpow.isInteger()) { if(mexp.isMinusOne() && nexp.isMinusOne()) { MathStructure mbak(*this); if(mpow.number().isNegative()) { set(x_var, true); mpow.number().negate(); raise(mpow); multiply(madd); if(!mmul.isOne()) add(mmul); if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} divide(mpow); if(!mmul.isOne()) divide(mmul); } else { SET_CHILD_MAP(1) SET_CHILD_MAP(0) if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} add(x_var); if(!transform_absln(LAST, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} LAST *= mpow; LAST.negate(); negate(); divide(mpow); divide(madd); } return true; } Number mpowmexp(mpow.number()); mpowmexp -= nexp; if(mpowmexp.isOne()) { if(mexp.isMinusOne()) { MathStructure mbak(*this); if(mpow.number().isNegative()) { set(x_var, true); mpow.number().negate(); raise(mpow); multiply(madd); if(!mmul.isOne()) add(mmul); if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} divide(mpow); divide(madd); add(x_var); if(!transform_absln(LAST, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} LAST.negate(); divide(mpow); divide(madd); negate(); } else { SET_CHILD_MAP(1) SET_CHILD_MAP(0) if(!transform_absln(*this, use_abs, definite_integral, x_var, eo)) {set(mbak); CANNOT_INTEGRATE_INTERVAL} divide(mpow); if(!mmul.isOne()) divide(mmul); } } else { SET_CHILD_MAP(1) MathStructure mden(CHILD(1)); CHILD(1) += m_one; mden *= mpow; if(!mmul.isOne()) mden *= mmul; mden += mpow; if(!mmul.isOne()) mden.last() *= mmul; divide(mden); } return true; } } for(int i = 1; i <= 3; i++) { if(i > 1 && (!mpow.isInteger() || !mpow.number().isIntegerDivisible(i) || mpow.number() == i)) break; UnknownVariable *var = NULL; MathStructure m_replace(x_var); MathStructure mtest(CHILD(1)); Number new_pow(nexp); b = false; if(i == 1) { m_replace ^= mpow; var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(m_replace) + RIGHT_PARENTHESIS); mtest.replace(m_replace, var); new_pow++; new_pow -= mpow.number(); new_pow /= mpow.number(); b = true; } else if(i == 2) { new_pow = nexp; new_pow++; new_pow -= 2; new_pow /= 2; if(new_pow.isInteger()) { b = true; m_replace ^= nr_two; var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(m_replace) + RIGHT_PARENTHESIS); MathStructure m_prev(x_var), m_new(var); m_prev ^= mpow; m_new ^= mpow; m_new[1].number() /= 2; mtest.replace(m_prev, m_new); } } else if(i == 3) { new_pow++; new_pow -= 3; new_pow /= 3; if(new_pow.isInteger()) { b = true; m_replace ^= nr_three; var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(m_replace) + RIGHT_PARENTHESIS); MathStructure m_prev(x_var), m_new(var); m_prev ^= mpow; m_new ^= mpow; m_new[1].number() /= 3; mtest.replace(m_prev, m_new); } } if(b) { var->ref(); if(!new_pow.isZero()) { mtest *= var; mtest.swapChildren(1, mtest.size()); if(!new_pow.isOne()) mtest[0] ^= new_pow; } CALCULATOR->beginTemporaryStopMessages(); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(m_replace); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(m_replace); } if(mtest.integrate(var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); mtest.replace(var, m_replace); set(mtest, true); divide(m_replace[1]); var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } } } else if(nexp.isInteger() && !madd.isZero() && mpow[1].containsRepresentativeOf(x_var, true, true) == 0) { MathStructure mbase(mpow[0]); if(integrate_info(mbase, x_var, madd, mmul, mpow, false, false) && mpow.isOne() && (!madd.isZero() || !mmul.isOne())) { MathStructure mtest(CHILD(1)); UnknownVariable *var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(mbase) + RIGHT_PARENTHESIS); var->ref(); mtest.replace(mbase, var, mbase.containsInterval()); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(mbase); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(mbase); } mtest *= var; if(!madd.isZero()) { mtest.last() -= madd; mtest.childUpdated(mtest.size()); } if(!nexp.isOne()) { mtest.last() ^= nexp; mtest.childUpdated(mtest.size()); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0 && mtest.containsFunction(CALCULATOR->f_integrate) <= 0) { CALCULATOR->endTemporaryStopMessages(true); set(mtest, true); replace(var, mbase); if(!mmul.isOne()) { nexp++; if(!nexp.isOne()) mmul ^= nexp; divide(mmul); } var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } } } if(CHILD(1)[1].number().isMinusOne() && CHILD(1)[0].isMultiplication() && CHILD(1)[0].size() == 2 && CHILD(1)[0][0].isAddition() && CHILD(1)[0][1].isAddition() && (CHILD(0) == x_var || (CHILD(0).isPower() && CHILD(0)[0] == x_var && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isTwo()))) { MathStructure madd1, mmul1, mexp1; if(integrate_info(CHILD(1)[0][0], x_var, madd1, mmul1, mexp1) && mexp1.isOne()) { MathStructure madd2, mexp2; if(integrate_info(CHILD(1)[0][1], x_var, madd2, mmul2, mexp2) && mexp2.isOne()) { MathStructure mnum1, mnum2, mx1(madd2), mx2(madd1); mx1.negate(); if(!mmul2.isOne()) mx1 /= mmul2; mnum1 = mx1; if(!mmul1.isOne()) mx1 *= mmul1; mx1 += madd1; mnum1 /= mx1; mx2.negate(); if(!mmul1.isOne()) mx2 /= mmul1; mnum2 = mx2; if(!mmul2.isOne()) mx2 *= mmul2; mx2 += madd2; mnum2 /= mx2; mnum2 /= CHILD(1)[0][0]; mnum1 /= CHILD(1)[0][1]; if(CHILD(0) != x_var) { mnum1 *= x_var; mnum2 *= x_var; } mnum2 += mnum1; CALCULATOR->beginTemporaryStopMessages(); if(mnum2.integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); set(mnum2, true); return true; } CALCULATOR->endTemporaryStopMessages(); } } } if(CHILD(1)[0].isAddition()) { bool b_poly = false; if(CHILD(1)[1].isMinusOne()) { MathStructure mquo, mrem; b_poly = polynomial_long_division(CHILD(0), CHILD(1)[0], x_var, mquo, mrem, eo, true); if(b_poly && !mquo.isZero()) { MathStructure mtest(mquo); if(!mrem.isZero()) { mtest += mrem; mtest.last() *= CHILD(1); mtest.childrenUpdated(); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(x_var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); set(mtest, true); return true; } CALCULATOR->endTemporaryStopMessages(); } } MathStructure mtest(*this); if(mtest[1][0].factorize(eo, false, 0, 0, false, false, NULL, x_var)) { mmul = m_one; while(mtest[1][0].isMultiplication() && mtest[1][0].size() >= 2 && mtest[1][0][0].containsRepresentativeOf(x_var, true, true) == 0) { if(mmul.isOne()) mmul = mtest[1][0][0]; else mmul *= mtest[1][0][0]; mtest[1][0].delChild(1, true); } if(!mmul.isOne()) { mmul ^= CHILD(1)[1]; } if(b_poly) { MathStructure mtest2(mtest); if(mtest2.decomposeFractions(x_var, eo)) { if(mtest2.isAddition()) { bool b = true; CALCULATOR->beginTemporaryStopMessages(); for(size_t i = 0; i < mtest2.size(); i++) { if(mtest2[i].integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) <= 0) { b = false; break; } } CALCULATOR->endTemporaryStopMessages(b); if(b) { set(mtest2, true); if(!mmul.isOne()) multiply(mmul); return true; } } } else { mtest2 = mtest[1]; if(mtest2.decomposeFractions(x_var, eo) && mtest2.isAddition()) { if(mtest2.isAddition()) { bool b = true; CALCULATOR->beginTemporaryStopMessages(); for(size_t i = 0; i < mtest2.size(); i++) { mtest2[i] *= mtest[0]; if(mtest2[i].integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) <= 0) { b = false; break; } } CALCULATOR->endTemporaryStopMessages(b); if(b) { set(mtest2, true); if(!mmul.isOne()) multiply(mmul); return true; } } } } } mmul2 = m_one; if(mtest[1][0].isMultiplication() && mtest[1][0].size() >= 2 && !mtest[1][0][0].isAddition()) { mmul2 = mtest[1][0][0]; mmul2.calculateInverse(eo2); mtest[1][0].delChild(1, true); } if(mtest[1][0].isPower()) { mtest[1][1].calculateMultiply(mtest[1][0][1], eo2); mtest[1][0].setToChild(1); } if(!mmul2.isOne()) { mtest *= mmul2; mtest.evalSort(false); } CALCULATOR->beginTemporaryStopMessages(); if(mtest.integrate(x_var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); set(mtest); if(!mmul.isOne()) multiply(mmul); return true; } CALCULATOR->endTemporaryStopMessages(); } if(CHILD(1)[1].number().isMinusOne() && CHILD(0) == x_var) { if(integrate_info(CHILD(1)[0], x_var, madd, mmul, mmul2, false, true) && !mmul2.isZero() && mmul.isZero() && !madd.isZero()) { SET_CHILD_MAP(1) SET_CHILD_MAP(0) transform(STRUCT_FUNCTION); setFunction(CALCULATOR->f_ln); mmul2 *= Number(-2, 1); multiply(mmul2); return true; } } } } else if(CHILD(1).isPower() && ((CHILD(1)[0].isNumber() && !CHILD(1)[0].number().isOne()) || (!CHILD(1)[0].isNumber() && CHILD(1)[0].containsRepresentativeOf(x_var, true, true) == 0))) { MathStructure mexp(1, 1, 0); if(CHILD(0).isPower() && CHILD(0)[0] == x_var && CHILD(0)[1].isInteger()) mexp = CHILD(0)[1]; else if(CHILD(0) != x_var) CANNOT_INTEGRATE; MathStructure madd, mmul, mpow; if(integrate_info(CHILD(1)[1], x_var, madd, mmul, mpow, false, false) && mpow.isInteger()) { bool b_e = CHILD(1)[0] == CALCULATOR->v_e; if(b_e || CHILD(1)[0].isNumber() || warn_about_assumed_not_value(CHILD(1)[0], m_one, eo)) { if(mpow.isOne()) { SET_CHILD_MAP(1) if(!b_e) { if(mmul.isOne()) { mmul = CHILD(0); mmul.transform(CALCULATOR->f_ln); } else { MathStructure lnbase(CALCULATOR->f_ln, &CHILD(0), NULL); mmul *= lnbase; } } if(mexp.isOne()) { MathStructure mmulfac(x_var); if(!mmul.isOne()) mmulfac *= mmul; mmulfac += nr_minus_one; multiply(mmulfac); if(!mmul.isOne()) { mmul ^= Number(-2, 1);; multiply(mmul); } } else if(mexp.number().isTwo()) { MathStructure mmulfac(x_var); mmulfac ^= nr_two; if(!mmul.isOne()) mmulfac /= mmul; mmulfac += x_var; mmulfac.last() *= Number(-2, 1); if(!mmul.isOne()) { mmulfac.last() *= mmul; mmulfac.last().last() ^= Number(-2, 1); } mmulfac += nr_two; if(!mmul.isOne()) { mmulfac.last() *= mmul; mmulfac.last().last() ^= Number(-3, 1); } mmulfac.childrenUpdated(true); multiply(mmulfac); } else if(mexp.isMinusOne()) { set(x_var, true); if(!mmul.isOne()) multiply(mmul); transform(CALCULATOR->f_Ei); } else if(mexp.number().isNegative()) { MathStructure mterm2(*this); mexp += m_one; multiply(x_var); LAST ^= mexp; CHILDREN_UPDATED if(integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) CANNOT_INTEGRATE_INTERVAL if(!mmul.isOne()) multiply(mmul); mterm2 *= x_var; mterm2.last() ^= mexp; mterm2.childrenUpdated(); subtract(mterm2); mexp.negate(); divide(mexp); } else { MathStructure mterm2(*this); multiply(x_var); LAST ^= mexp; LAST[1] += nr_minus_one; LAST.childUpdated(2); CHILDREN_UPDATED if(integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts) < 0) CANNOT_INTEGRATE_INTERVAL multiply(mexp); if(!mmul.isOne()) divide(mmul); negate(); mterm2 *= x_var; mterm2.last() ^= mexp; mterm2.childrenUpdated(); if(!mmul.isOne()) mterm2.divide(mmul); add(mterm2); } return true; } else { Number mpowmexp(mpow.number()); mpowmexp -= mexp.number(); if(mpowmexp.isOne()) { SET_CHILD_MAP(1) MathStructure malog(CALCULATOR->f_ln, &CHILD(0), NULL); divide(mpow); if(!mmul.isOne()) divide(mmul); if(!b_e) divide(malog); return true; } else if(mexp.isMinusOne() && mpow.number().isPositive()) { MathStructure malog; if(b_e) { malog = x_var; malog ^= mpow; } else { malog.set(CALCULATOR->f_ln, &CHILD(1)[0], NULL); malog *= x_var; malog.last() ^= mpow; } if(!mmul.isOne()) malog *= mmul; malog.transform(CALCULATOR->f_Ei); if(madd.isZero()) { set(malog, true); } else { SET_CHILD_MAP(1) SET_CHILD_MAP(0) raise(madd); multiply(malog); } divide(mpow); return true; } } } } } } if(SIZE >= 2) { for(size_t i = 0; i < SIZE; i++) { if((CHILD(i).isFunction() && CHILD(i).function() == CALCULATOR->f_signum) || (CHILD(i).isPower() && CHILD(i)[0].isFunction() && CHILD(i)[0].function() == CALCULATOR->f_signum)) { MathStructure mfunc(CHILD(i).isPower() ? CHILD(i)[0] : CHILD(i)); MathStructure mmul(*this); mmul.delChild(i + 1, true); CALCULATOR->beginTemporaryStopMessages(); int bint = integrate_function(mfunc, x_var, eo, CHILD(i).isPower() ? CHILD(i)[1] : m_one, mmul, m_zero, m_one, use_abs, definite_integral, max_part_depth, parent_parts); CALCULATOR->endTemporaryStopMessages(bint > 0); if(bint < 0) CANNOT_INTEGRATE_INTERVAL if(bint) { set(mfunc, true); return true; } } } for(size_t i = 0; i < SIZE; i++) { if((CHILD(i).isFunction() && CHILD(i).function() != CALCULATOR->f_signum) || (CHILD(i).isPower() && CHILD(i)[0].isFunction() && CHILD(i)[0].function() != CALCULATOR->f_signum)) { MathStructure mfunc(CHILD(i).isPower() ? CHILD(i)[0] : CHILD(i)); MathStructure mmul(*this); mmul.delChild(i + 1, true); CALCULATOR->beginTemporaryStopMessages(); int bint = integrate_function(mfunc, x_var, eo, CHILD(i).isPower() ? CHILD(i)[1] : m_one, mmul, m_zero, m_one, use_abs, definite_integral, max_part_depth, parent_parts); CALCULATOR->endTemporaryStopMessages(bint > 0); if(bint < 0) CANNOT_INTEGRATE_INTERVAL if(bint) { set(mfunc, true); return true; } } } if(CHILD(0) == x_var || (CHILD(0).isPower() && CHILD(0)[0] == x_var && CHILD(0)[1].isNumber() && CHILD(0)[1].number().isRational())) { Number nexp(1, 1, 0); if(CHILD(0).isPower()) nexp = CHILD(0)[1].number(); MathStructure mpow(1, 1, 0); bool b = true; MathStructure madd, mmul, mpown; for(size_t i = 1; i < SIZE; i++) { if(CHILD(i).isFunction() && CHILD(i).size() >= 1) { if(!integrate_info(CHILD(i)[0], x_var, madd, mmul, mpown, false, false) || !mpown.isNumber() || !mpown.number().isRational() || mpown.number().isOne() || (!mpow.isOne() && mpow != mpown)) { b = false; break; } mpow = mpown; } else if(CHILD(i).isPower() && CHILD(i)[1].containsRepresentativeOf(x_var, true, true) == 0) { if((CHILD(i)[0].isFunction() && CHILD(i)[0].size() == 1)) { if(!integrate_info(CHILD(i)[0][0], x_var, madd, mmul, mpown, false, false)) {b = false; break;} } else if(integrate_info(CHILD(i)[0], x_var, madd, mmul, mpown, false, false, true)) { if(mpown.isPower() && mpown[0] == x_var) { mpown.setToChild(2); if(SIZE == 2 && mpown.isInteger()) {b = false; break;} } else if(mpown.isFunction() && mpown.size() >= 1) { MathStructure marg(mpown[0]); if(!integrate_info(marg, x_var, madd, mmul, mpown, false, false)) {b = false; break; } } else { b = false; break; } } else { b = false; break; } if(!mpown.isNumber() || !mpown.number().isRational() || mpown.number().isOne() || (!mpow.isOne() && mpow != mpown)) { b = false; break; } mpow = mpown; } else if(CHILD(i).isPower() && CHILD(i)[0].containsRepresentativeOf(x_var, true, true) == 0) { if(!integrate_info(CHILD(i)[1], x_var, madd, mmul, mpown, false, false) || !mpown.isNumber() || !mpown.number().isRational() || mpown.number().isOne() || (!mpow.isOne() && mpow != mpown)) { b = false; break; } mpow = mpown; } else { b = false; break; } } if(b) { for(int i = 1; i <= 3; i++) { if(!mpow.isInteger()) { if(i > 2) break; } else if(i > 1 && (!mpow.number().isIntegerDivisible(i) || mpow.number() == i)) { break; } if(CALCULATOR->aborted()) CANNOT_INTEGRATE UnknownVariable *var = NULL; MathStructure m_replace(x_var); MathStructure mtest(*this); mtest.delChild(1, true); Number new_pow(nexp); b = false; if(i == 1) { m_replace ^= mpow; var = new UnknownVariable("", ""); mtest.replace(m_replace, var); new_pow++; new_pow -= mpow.number(); new_pow /= mpow.number(); b = true; } else if(i == 2) { if(!mpow.number().isInteger()) { Number nden = mpow.number().denominator(); nden.recip(); nden--; nden.negate(); new_pow = nexp; new_pow += nden; new_pow *= mpow.number().denominator(); if(new_pow.isInteger()) { b = true; m_replace ^= mpow.number().denominator(); m_replace[1].number().recip(); var = new UnknownVariable("", ""); MathStructure m_prev(x_var), m_new(var); m_prev ^= mpow; if(!mpow.number().numeratorIsOne()) m_new ^= mpow.number().numerator(); mtest.replace(m_prev, m_new); } } else { new_pow = nexp; new_pow++; new_pow -= 2; new_pow /= 2; if(new_pow.isInteger()) { b = true; m_replace ^= nr_two; var = new UnknownVariable("", ""); MathStructure m_prev(x_var), m_new(var); m_prev ^= mpow; m_new ^= mpow; m_new[1].number() /= 2; mtest.replace(m_prev, m_new); } } } else if(i == 3) { new_pow++; new_pow -= 3; new_pow /= 3; if(new_pow.isInteger()) { b = true; m_replace ^= nr_three; var = new UnknownVariable("", ""); MathStructure m_prev(x_var), m_new(var); m_prev ^= mpow; m_new ^= mpow; m_new[1].number() /= 3; mtest.replace(m_prev, m_new); } } if(b) { var->ref(); if(!new_pow.isZero()) { mtest *= var; mtest.swapChildren(1, mtest.size()); if(!new_pow.isOne()) mtest[0] ^= new_pow; } CALCULATOR->beginTemporaryStopMessages(); var->setName(string(LEFT_PARENTHESIS) + format_and_print(m_replace) + RIGHT_PARENTHESIS); if(x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined()) { MathStructure m_interval(m_replace); m_interval.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); var->setInterval(m_interval); } else { var->setInterval(m_replace); } if(mtest.integrate(var, eo, false, use_abs, definite_integral, true, max_part_depth, parent_parts) > 0) { CALCULATOR->endTemporaryStopMessages(true); mtest.replace(var, m_replace); set(mtest, true); if(m_replace.isPower()) divide(m_replace[1]); var->destroy(); return true; } CALCULATOR->endTemporaryStopMessages(); var->destroy(); } } } } vector parent_parts_pre; if(parent_parts) { for(size_t i = 0; i < parent_parts->size(); i++) { if(equals(*(*parent_parts)[i], true)) CANNOT_INTEGRATE } } else { parent_parts = &parent_parts_pre; } size_t pp_size = parent_parts->size(); bool b = false; for(size_t i = 0; !b && max_part_depth > 0 && (i < SIZE || (SIZE == 3 && i < SIZE * 2)) && SIZE < 10; i++) { if(CALCULATOR->aborted()) CANNOT_INTEGRATE CALCULATOR->beginTemporaryStopMessages(); // integration by parts MathStructure mstruct_u; MathStructure mstruct_v; MathStructure minteg_v; if(SIZE == 3 && i >= 3) { mstruct_v = CHILD(i - 3); mstruct_u = *this; mstruct_u.delChild(i - 2); } else { mstruct_u = CHILD(i); if(SIZE == 2 && i == 0) mstruct_v = CHILD(1); else if(SIZE == 2 && i == 1) mstruct_v = CHILD(0); else {mstruct_v = *this; mstruct_v.delChild(i + 1);} } MathStructure mdiff_u(mstruct_u); if(mdiff_u.differentiate(x_var, eo2) && mdiff_u.containsFunction(CALCULATOR->f_diff, true) <= 0) { mdiff_u.calculateFunctions(eo2); minteg_v = mstruct_v; if(minteg_v.integrate(x_var, eo, false, use_abs, definite_integral, true, 0, parent_parts) > 0) { parent_parts->push_back(this); MathStructure minteg_2(minteg_v); if(!mdiff_u.isOne()) minteg_2 *= mdiff_u; minteg_2.calculateFunctions(eo2); minteg_2.calculatesub(eo2, eo2, true); if(minteg_2.countTotalChildren() < 100 && minteg_2.integrate(x_var, eo, false, use_abs, definite_integral, true, max_part_depth - 1, parent_parts) > 0) { int cui = contains_unsolved_integrate(minteg_2, this, parent_parts); if(cui == 3) { MathStructure mfunc(CALCULATOR->f_integrate, this, &x_var, &m_undefined, &m_undefined, NULL); UnknownVariable *var = new UnknownVariable("", format_and_print(mfunc)); var->setAssumptions(mfunc); MathStructure mvar(var); minteg_2.replace(mfunc, mvar); MathStructure msolve(mstruct_u); msolve.multiply(minteg_v); msolve.calculatesub(eo2, eo2, true); msolve.subtract(minteg_2); msolve.calculatesub(eo2, eo2, true); MathStructure msolve_d(msolve); if(msolve_d.differentiate(mvar, eo2) && COMPARISON_IS_NOT_EQUAL(msolve_d.compareApproximately(m_one, eo2))) { msolve.transform(COMPARISON_EQUALS, mvar); msolve.isolate_x(eo2, mvar); if(msolve.isComparison() && msolve.comparisonType() == COMPARISON_EQUALS && msolve[0] == mvar && msolve[1].contains(mvar, true) <= 0) { b = true; set(msolve[1], true); } } } else if(cui != 1) { set(mstruct_u); multiply(minteg_v); subtract(minteg_2); b = true; } } parent_parts->pop_back(); } } CALCULATOR->endTemporaryStopMessages(b); } while(parent_parts->size() > pp_size) parent_parts->pop_back(); if(b) return true; } CANNOT_INTEGRATE break; } case STRUCT_SYMBOLIC: { if(representsNumber(true)) { multiply(x_var); } else { CANNOT_INTEGRATE } break; } case STRUCT_VARIABLE: { if(eo.calculate_variables && o_variable->isKnown()) { if(eo.approximation != APPROXIMATION_EXACT || !o_variable->isApproximate()) { set(((KnownVariable*) o_variable)->get(), true); return integrate(x_var, eo, true, use_abs, definite_integral, true, max_part_depth, parent_parts); } else if(containsRepresentativeOf(x_var, true, true) != 0) { CANNOT_INTEGRATE } } if(representsNumber(true)) { multiply(x_var); break; } } default: { CANNOT_INTEGRATE } } return true; } const MathStructure &MathStructure::find_x_var() const { if(isSymbolic()) { return *this; } else if(isVariable()) { if(o_variable->isKnown()) return m_undefined; return *this; } const MathStructure *mstruct; const MathStructure *x_mstruct = &m_undefined; for(size_t i = 0; i < SIZE; i++) { mstruct = &CHILD(i).find_x_var(); if(mstruct->isVariable()) { if(mstruct->variable() == CALCULATOR->v_x) { return *mstruct; } else if(!x_mstruct->isVariable()) { x_mstruct = mstruct; } else if(mstruct->variable() == CALCULATOR->v_y) { x_mstruct = mstruct; } else if(mstruct->variable() == CALCULATOR->v_z && x_mstruct->variable() != CALCULATOR->v_y) { x_mstruct = mstruct; } } else if(mstruct->isSymbolic()) { if(!x_mstruct->isVariable() && !x_mstruct->isSymbolic()) { x_mstruct = mstruct; } } } return *x_mstruct; } bool isUnit_multi(const MathStructure &mstruct) { if(!mstruct.isMultiplication() || mstruct.size() == 0) return false; for(size_t i = 0; i < mstruct.size(); i++) { if((i > 0 || !mstruct[i].isNumber()) && !mstruct[i].isUnit_exp()) return false; } return true; } int test_comparisons(const MathStructure &msave, MathStructure &mthis, const MathStructure &x_var, const EvaluationOptions &eo, bool sub) { if(mthis.isComparison() && mthis[0] == x_var) { MathStructure mtest; EvaluationOptions eo2 = eo; eo2.calculate_functions = false; eo2.isolate_x = false; eo2.test_comparisons = true; eo2.warn_about_denominators_assumed_nonzero = false; eo2.assume_denominators_nonzero = false; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest = mthis; mtest.eval(eo2); if(mtest.isComparison()) { mtest = msave; mtest.replace(x_var, mthis[1]); if(CALCULATOR->usesIntervalArithmetic()) { MathStructure mtest2(mtest[0]); if(!mtest[1].isZero()) { mtest2.subtract(mtest[1]); } CALCULATOR->beginTemporaryStopMessages(); mtest2.eval(eo2); if(CALCULATOR->endTemporaryStopMessages() > 0) { if(!sub) mthis = msave; return -1; } if(mtest2.isNumber()) { if(!mtest2.number().isNonZero()) return 1; else if(mtest2.number().isInterval() || mtest2.number().isRational()) {mthis.clear(); return 0;} } else if(mtest2.isUnit_exp()) { mthis.clear(); return 0; } else if(isUnit_multi(mtest2)) { if(!mtest2[0].isNumber()) {mthis.clear(); return 0;} if(!mtest2[0].number().isNonZero()) return 1; else if(mtest2[0].number().isInterval() || mtest2[0].number().isRational()) {mthis.clear(); return 0;} } } CALCULATOR->beginTemporaryStopMessages(); if(mtest[1].isZero() && mtest[0].isAddition() && mtest[0].size() > 1) { mtest[1].subtract(mtest[0][0]); mtest[0].delChild(1, true); } mtest.eval(eo2); if(CALCULATOR->endTemporaryStopMessages() > 0) { if(!sub) mthis = msave; return -1; } if(mtest.isNumber()) { if(mtest.number().getBoolean() == 1) { return 1; } else if(mtest.number().getBoolean() == 0) { mthis.clear(); return 0; } } } else { mthis = mtest; if(mtest.isNumber()) { if(mtest.number().getBoolean() == 0) { return 0; } } return 1; } if(!sub) mthis = msave; return -1; } if(mthis.isLogicalOr() || mthis.isLogicalAnd()) { for(size_t i = 0; i < mthis.size(); i++) { if(test_comparisons(msave, mthis[i], x_var, eo, true) < 0) { mthis = msave; return -1; } } return 1; } if(sub) return 1; else return -1; } bool isx_deabsify(MathStructure &mstruct); bool isx_deabsify(MathStructure &mstruct) { switch(mstruct.type()) { case STRUCT_FUNCTION: { if(mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1 && mstruct[0].representsNonComplex(true)) { mstruct.setToChild(1, true); return true; } break; } case STRUCT_POWER: { if(mstruct[1].isMinusOne()) { return isx_deabsify(mstruct[0]); } break; } case STRUCT_MULTIPLICATION: { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(isx_deabsify(mstruct[i])) b = true; } return b; } default: {} } return false; } int newton_raphson(const MathStructure &mstruct, MathStructure &x_value, const MathStructure &x_var, const EvaluationOptions &eo) { if(mstruct == x_var) { x_value = m_zero; return 1; } if(!mstruct.isAddition()) return -1; if(mstruct.size() == 2) { if(mstruct[1] == x_var && mstruct[0].isNumber() && mstruct[0].number().isReal()) { x_value = mstruct[0]; x_value.number().negate(); return 1; } if(mstruct[0] == x_var && mstruct[1].isNumber() && mstruct[1].number().isReal()) { x_value = mstruct[1]; x_value.number().negate(); return 1; } } Number nr; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i] != x_var) { switch(mstruct[i].type()) { case STRUCT_NUMBER: {nr = mstruct[i].number(); break;} case STRUCT_MULTIPLICATION: { if(mstruct[i].size() == 2 && mstruct[i][0].isNumber() && (mstruct[i][1] == x_var || (mstruct[i][1].isPower() && mstruct[i][1][0] == x_var && mstruct[i][1][1].isNumber() && mstruct[i][1][1].number().isInteger() && mstruct[i][1][1].number().isPositive()))) { break; } return -1; } case STRUCT_POWER: { if(mstruct[i][0] == x_var && mstruct[i][1].isNumber() && mstruct[i][1].number().isInteger() && mstruct[i][1].number().isPositive()) { break; } } default: {return -1;} } } } MathStructure mdiff(mstruct); if(!mdiff.differentiate(x_var, eo)) return -1; MathStructure minit(mstruct); minit.divide(mdiff); minit.negate(); minit.add(x_var); minit.eval(eo); Number nr_target_high(1, 1, -(PRECISION) - 10); Number nr_target_low(1, 1, 0); nr_target_low -= nr_target_high; nr_target_high++; MathStructure mguess(2, 1, 0); Number ndeg(mstruct.degree(x_var)); bool overflow = false; int ideg = ndeg.intValue(&overflow); if(overflow || ideg > 100) return -1; nr.negate(); if(!nr.isZero()) { bool b_neg = nr.isNegative(); if(b_neg) nr.negate(); if(nr.root(ndeg)) { if(ndeg.isOdd() && b_neg) nr.negate(); mguess = nr; } else { nr = mguess.number(); } } else { nr = mguess.number(); } for(int i = 0; i < 100 + PRECISION + ideg * 2; i++) { if(CALCULATOR->aborted()) return -1; MathStructure mtest(minit); mtest.replace(x_var, mguess); mtest.eval(eo); Number nrdiv(mguess.number()); if(!mtest.isNumber() || !nrdiv.divide(mtest.number())) { return -1; } if(nrdiv.isLessThan(nr_target_high) && nrdiv.isGreaterThan(nr_target_low)) { if(CALCULATOR->usesIntervalArithmetic()) { if(!x_value.number().setInterval(mguess.number(), mtest.number())) return -1; } else { x_value = mtest; if(x_value.number().precision() < 0 || x_value.number().precision() > PRECISION + 10) x_value.number().setPrecision(PRECISION + 10); } x_value.numberUpdated(); return 1; } mguess = mtest; } nr.negate(); mguess = nr; for(int i = 0; i < 100 + PRECISION + ideg * 2; i++) { if(CALCULATOR->aborted()) return -1; MathStructure mtest(minit); mtest.replace(x_var, mguess); mtest.eval(eo); Number nrdiv(mguess.number()); if(!mtest.isNumber() || !nrdiv.divide(mtest.number())) { return -1; } if(nrdiv.isLessThan(nr_target_high) && nrdiv.isGreaterThan(nr_target_low)) { if(CALCULATOR->usesIntervalArithmetic()) { if(!x_value.number().setInterval(mguess.number(), mtest.number())) return -1; } else { x_value = mtest; if(x_value.number().precision() < 0 || x_value.number().precision() > PRECISION + 10) x_value.number().setPrecision(PRECISION + 10); } x_value.numberUpdated(); return 1; } mguess = mtest; } return 0; } int find_interval_precision(const MathStructure &mstruct); int find_interval_precision(const MathStructure &mstruct) { if(mstruct.isNumber()) { return mstruct.number().precision(1); } int iv_prec = -1; for(size_t i = 0; i < mstruct.size(); i++) { if(iv_prec > -1) { if(find_interval_precision(mstruct[i]) > -1) return 0; } else { iv_prec = find_interval_precision(mstruct[i]); } } return iv_prec; } MathStructure *find_abs_sgn(MathStructure &mstruct, const MathStructure &x_var); MathStructure *find_abs_sgn(MathStructure &mstruct, const MathStructure &x_var) { switch(mstruct.type()) { case STRUCT_FUNCTION: { if(((mstruct.function() == CALCULATOR->f_abs && mstruct.size() == 1) || (mstruct.function() == CALCULATOR->f_signum && mstruct.size() == 2)) && mstruct[0].contains(x_var, false) && mstruct[0].representsNonComplex()) { return &mstruct; } break; } case STRUCT_POWER: { return find_abs_sgn(mstruct[0], x_var); } case STRUCT_ADDITION: {} case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < mstruct.size(); i++) { MathStructure *m = find_abs_sgn(mstruct[i], x_var); if(m) return m; } break; } default: {break;} } return NULL; } bool is_units_with_multiplier(const MathStructure &mstruct) { if(!mstruct.isMultiplication() || mstruct.size() == 0 || !mstruct[0].isNumber()) return false; for(size_t i = 1; i < mstruct.size(); i++) { if(!mstruct[i].isUnit_exp()) return false; } return true; } bool fix_n_multiple(MathStructure &mstruct, const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_var) { bool b_ret = false; if(mstruct.isComparison()) { if(mstruct.comparisonType() == COMPARISON_EQUALS && x_var.isVariable() && !x_var.variable()->isKnown() && !((UnknownVariable*) x_var.variable())->interval().isUndefined() && mstruct[1].contains(CALCULATOR->v_n)) { MathStructure mtest(mstruct); mtest.replace(x_var, ((UnknownVariable*) x_var.variable())->interval()); EvaluationOptions eo2 = eo; EvaluationOptions feo2 = feo; if(eo.approximation == APPROXIMATION_EXACT) { eo2.approximation = APPROXIMATION_TRY_EXACT; feo2.approximation = APPROXIMATION_TRY_EXACT; } CALCULATOR->beginTemporaryEnableIntervalArithmetic(); CALCULATOR->beginTemporaryStopMessages(); mtest.calculateFunctions(feo2); if(mtest.isolate_x(eo2, feo2, CALCULATOR->v_n)) { if(CALCULATOR->endTemporaryStopMessages() == 0) { if(mtest.isZero()) { mstruct.clear(true); b_ret = true; } else if(mtest.isComparison() && mtest.comparisonType() == COMPARISON_EQUALS && mtest[0] == CALCULATOR->v_n && mtest[1].isNumber()) { if(mtest[1].number().isInteger()) { mstruct.calculateReplace(CALCULATOR->v_n, mtest[1], eo); b_ret = true; } else if(mtest[1].number().isInterval()) { Number nr_int; bool b_multiple = false; if(mtest[1].number().getCentralInteger(nr_int, &b_multiple)) { mstruct.calculateReplace(CALCULATOR->v_n, nr_int, eo); b_ret = true; } else if(!b_multiple) { mstruct.clear(true); b_ret = true; } } else { mstruct.clear(true); b_ret = true; } } } } else { CALCULATOR->endTemporaryStopMessages(); } CALCULATOR->endTemporaryEnableIntervalArithmetic(); } } else { for(size_t i = 0; i < mstruct.size(); i++) { if(fix_n_multiple(mstruct[i], eo, feo, x_var)) { mstruct.childUpdated(i + 1); b_ret = true; } } if(b_ret) mstruct.calculatesub(eo, feo, false); } return b_ret; } bool MathStructure::isolate_x_sub(const EvaluationOptions &eo, EvaluationOptions &eo2, const MathStructure &x_var, MathStructure *morig) { if(!isComparison()) { cout << "isolate_x_sub: " << *this << " is not a comparison." << endl; return false; } if(CHILD(0) == x_var) return false; if(contains(x_var, true) <= 0) return false; if(CALCULATOR->aborted()) return false; switch(CHILD(0).type()) { case STRUCT_ADDITION: { bool b = false; // x+y=z => x=z-y for(size_t i = 0; i < CHILD(0).size(); i++) { if(!CHILD(0)[i].contains(x_var)) { CHILD(0)[i].calculateNegate(eo2); CHILD(0)[i].ref(); CHILD(1).add_nocopy(&CHILD(0)[i], true); CHILD(1).calculateAddLast(eo2); CHILD(0).delChild(i + 1); b = true; } } if(b) { CHILD_UPDATED(0); CHILD_UPDATED(1); if(CHILD(0).size() == 1) { CHILD(0).setToChild(1, true); } else if(CHILD(0).size() == 0) { CHILD(0).clear(true); } isolate_x_sub(eo, eo2, x_var, morig); return true; } if(CALCULATOR->aborted()) return false; // ax^(2n)+bx^n=c if(CHILD(0).size() >= 2 && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { bool sqpow = false, nopow = false; MathStructure mstruct_a, mstruct_b, mpow_a, mpow_b; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i] == x_var || (CHILD(0)[i].isPower() && CHILD(0)[i][0] == x_var)) { b = false; const MathStructure *mexp = &m_one; if(CHILD(0)[i] != x_var) mexp = &CHILD(0)[i][1]; if(nopow) { if(*mexp == mpow_b) { mstruct_b.add(m_one, true); b = true; } else if(!sqpow) { MathStructure mtest(*mexp); mtest.calculateMultiply(nr_half, eo); if(mtest == mpow_b) { mpow_a = *mexp; mstruct_a.set(m_one, true); b = true; } else { mtest = *mexp; mtest.calculateMultiply(nr_two, eo); if(mtest == mpow_b) { mpow_a = mpow_b; mpow_b = *mexp; mstruct_a = mstruct_b; mstruct_b.set(m_one, true); b = true; } } if(b) sqpow = true; } else if(*mexp == mpow_a) { mstruct_a.add(m_one, true); b = true; } } else if(sqpow) { if(*mexp == mpow_a) { mstruct_a.add(m_one, true); b = true; } else { MathStructure mtest(*mexp); mtest.calculateMultiply(nr_two, eo); if(mtest == mpow_a) { mpow_b = *mexp; mstruct_b.set(m_one, true); b = true; } else { mtest = *mexp; mtest.calculateMultiply(nr_half, eo); if(mtest == mpow_a) { mpow_b = mpow_a; mpow_a = *mexp; mstruct_b = mstruct_a; mstruct_a.set(m_one, true); b = true; } } if(b) nopow = true; } } else { if(mexp->isOne()) { mpow_b = *mexp; nopow = true; mstruct_b.set(m_one); } else { mpow_a = *mexp; sqpow = true; mstruct_a.set(m_one); } b = true; } if(!b) { sqpow = false; nopow = false; break; } } else if(CHILD(0)[i].isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2] == x_var || (CHILD(0)[i][i2].isPower() && CHILD(0)[i][i2][0] == x_var)) { b = false; const MathStructure *mexp = &m_one; if(CHILD(0)[i][i2] != x_var) mexp = &CHILD(0)[i][i2][1]; if(nopow) { if(*mexp == mpow_b) { MathStructure *madd = new MathStructure(CHILD(0)[i]); madd->delChild(i2 + 1, true); mstruct_b.add_nocopy(madd, true); b = true; } else if(!sqpow) { MathStructure mtest(*mexp); mtest.calculateMultiply(nr_half, eo); if(mtest == mpow_b) { mpow_a = *mexp; mstruct_a = CHILD(0)[i]; mstruct_a.delChild(i2 + 1, true); b = true; } else { mtest = *mexp; mtest.calculateMultiply(nr_two, eo); if(mtest == mpow_b) { mpow_a = mpow_b; mpow_b = *mexp; mstruct_a = mstruct_b; mstruct_b = CHILD(0)[i]; mstruct_b.delChild(i2 + 1, true); b = true; } } if(b) sqpow = true; } else if(*mexp == mpow_a) { MathStructure *madd = new MathStructure(CHILD(0)[i]); madd->delChild(i2 + 1, true); mstruct_a.add_nocopy(madd, true); b = true; } } else if(sqpow) { if(*mexp == mpow_a) { MathStructure *madd = new MathStructure(CHILD(0)[i]); madd->delChild(i2 + 1, true); mstruct_a.add_nocopy(madd, true); b = true; } else { MathStructure mtest(*mexp); mtest.calculateMultiply(nr_two, eo); if(mtest == mpow_a) { mpow_b = *mexp; mstruct_b.add(m_one, true); mstruct_b = CHILD(0)[i]; mstruct_b.delChild(i2 + 1, true); b = true; } else { mtest = *mexp; mtest.calculateMultiply(nr_half, eo); if(mtest == mpow_a) { mpow_b = mpow_a; mpow_a = *mexp; mstruct_b = mstruct_a; mstruct_a = CHILD(0)[i]; mstruct_a.delChild(i2 + 1, true); b = true; } } if(b) nopow = true; } } else { if(mexp->isOne()) { mpow_b = *mexp; nopow = true; mstruct_b = CHILD(0)[i]; mstruct_b.delChild(i2 + 1, true); } else { mpow_a = *mexp; sqpow = true; mstruct_a = CHILD(0)[i]; mstruct_a.delChild(i2 + 1, true); } b = true; } if(!b) { sqpow = false; nopow = false; break; } } else if(CHILD(0)[i][i2].contains(x_var)) { sqpow = false; nopow = false; break; } } if(!sqpow && !nopow) break; } else { sqpow = false; nopow = false; break; } } b = false; if(sqpow && nopow && !mstruct_a.representsZero(true)) { b = mstruct_a.representsNonZero(true); if(!b && eo2.approximation == APPROXIMATION_EXACT) { MathStructure mtest(mstruct_a); mtest.add(m_zero, OPERATION_NOT_EQUALS); EvaluationOptions eo3 = eo2; eo3.test_comparisons = true; mtest.calculatesub(eo3, eo, false); b = mtest.isOne(); } } if(b) { int a_iv = find_interval_precision(mstruct_a); int b_iv = find_interval_precision(mstruct_b); int c_iv = find_interval_precision(CHILD(1)); if(a_iv >= 0 && (c_iv < 0 || c_iv > a_iv) && CHILD(1).representsNonZero()) { //x=(-2c)/(b+/-sqrt(b^2-4ac)) MathStructure mbak(*this); bool stop_iv = false; if(c_iv >= 0 && c_iv <= PRECISION) { stop_iv = true; } else if(b_iv >= 0) { MathStructure mstruct_bl; MathStructure mstruct_bu; stop_iv = true; if(mstruct_b.isNumber() && mstruct_b.number().isNonZero() && !mstruct_b.number().hasImaginaryPart()) { mstruct_bl = mstruct_b.number().lowerEndPoint(); mstruct_bu = mstruct_b.number().upperEndPoint(); stop_iv = false; } else if(is_units_with_multiplier(mstruct_b) && mstruct_b[0].number().isNonZero() && !mstruct_b[0].number().hasImaginaryPart()) { mstruct_bl = mstruct_b; mstruct_bl[0].number() = mstruct_b[0].number().lowerEndPoint(); mstruct_bu = mstruct_b; mstruct_bu[0].number() = mstruct_b[0].number().upperEndPoint(); stop_iv = false; } if(!stop_iv) { // Lower b+sqrt(b^2-4ac) MathStructure b2l(mstruct_bl); b2l.calculateRaise(nr_two, eo2); MathStructure ac(4, 1); ac.calculateMultiply(mstruct_a, eo2); ac.calculateMultiply(CHILD(1), eo2); b2l.calculateAdd(ac, eo2); b2l.calculateRaise(nr_half, eo2); MathStructure mstruct_1l(mstruct_bl); mstruct_1l.calculateAdd(b2l, eo2); // Upper -b+sqrt(b^2-4ac) MathStructure b2u(mstruct_bu); b2u.calculateRaise(nr_two, eo2); b2u.calculateAdd(ac, eo2); b2u.calculateRaise(nr_half, eo2); MathStructure mstruct_1u(mstruct_bu); mstruct_1u.calculateAdd(b2u, eo2); MathStructure mstruct_1(mstruct_1l); mstruct_1.transform(STRUCT_FUNCTION, mstruct_1u); mstruct_1.setFunction(CALCULATOR->f_interval); mstruct_1.calculateFunctions(eo, false); // Lower -b-sqrt(b^2-4ac) MathStructure mstruct_2l(mstruct_bl); mstruct_2l.calculateSubtract(b2l, eo2); // Upper -b-sqrt(b^2-4ac) MathStructure mstruct_2u(mstruct_bu); mstruct_2u.calculateSubtract(b2u, eo2); MathStructure mstruct_2(mstruct_2l); mstruct_2.transform(STRUCT_FUNCTION, mstruct_2u); mstruct_2.setFunction(CALCULATOR->f_interval); mstruct_2.calculateFunctions(eo, false); MathStructure mstruct_c(CHILD(1)); mstruct_c.calculateMultiply(nr_two, eo2); mstruct_1.calculateInverse(eo2); mstruct_2.calculateInverse(eo2); mstruct_1.calculateMultiply(mstruct_c, eo2); mstruct_2.calculateMultiply(mstruct_c, eo2); CHILD(0) = x_var; if(!mpow_b.isOne()) {CHILD(0) ^= mpow_b; CHILD_UPDATED(0);} if(mstruct_1 == mstruct_2) { CHILD(1) = mstruct_1; isolate_x_sub(eo, eo2, x_var, morig); } else { CHILD(1) = mstruct_1; MathStructure *mchild2 = new MathStructure(CHILD(0)); isolate_x_sub(eo, eo2, x_var, morig); mchild2->transform(STRUCT_COMPARISON, mstruct_2); mchild2->setComparisonType(ct_comp); mchild2->isolate_x_sub(eo, eo2, x_var, morig); if(ct_comp == COMPARISON_NOT_EQUALS) { transform_nocopy(STRUCT_LOGICAL_AND, mchild2); } else { transform_nocopy(STRUCT_LOGICAL_OR, mchild2); } calculatesub(eo2, eo, false); } CHILDREN_UPDATED return true; } } if(b && stop_iv) { CALCULATOR->beginTemporaryStopIntervalArithmetic(); bool failed = false; fix_intervals(*this, eo2, &failed); if(failed) { set(mbak); CALCULATOR->endTemporaryStopIntervalArithmetic(); b = false; } } if(b) { MathStructure b2(mstruct_b); b2.calculateRaise(nr_two, eo2); MathStructure ac(4, 1); ac.calculateMultiply(mstruct_a, eo2); ac.calculateMultiply(CHILD(1), eo2); b2.calculateAdd(ac, eo2); b2.calculateRaise(nr_half, eo2); MathStructure mstruct_1(mstruct_b); mstruct_1.calculateAdd(b2, eo2); MathStructure mstruct_2(mstruct_b); mstruct_2.calculateSubtract(b2, eo2); MathStructure mstruct_c(CHILD(1)); mstruct_c.calculateMultiply(nr_two, eo2); mstruct_1.calculateInverse(eo2); mstruct_2.calculateInverse(eo2); mstruct_1.calculateMultiply(mstruct_c, eo2); mstruct_2.calculateMultiply(mstruct_c, eo2); CHILD(0) = x_var; if(!mpow_b.isOne()) {CHILD(0) ^= mpow_b; CHILD_UPDATED(0);} if(mstruct_1 == mstruct_2) { CHILD(1) = mstruct_1; isolate_x_sub(eo, eo2, x_var, morig); } else { CHILD(1) = mstruct_1; MathStructure *mchild2 = new MathStructure(CHILD(0)); isolate_x_sub(eo, eo2, x_var, morig); mchild2->transform(STRUCT_COMPARISON, mstruct_2); mchild2->setComparisonType(ct_comp); mchild2->isolate_x_sub(eo, eo2, x_var, morig); if(ct_comp == COMPARISON_NOT_EQUALS) { transform_nocopy(STRUCT_LOGICAL_AND, mchild2); } else { transform_nocopy(STRUCT_LOGICAL_OR, mchild2); } calculatesub(eo2, eo, false); } CHILDREN_UPDATED; if(stop_iv) { CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); } return true; } } else if(CHILD(1).isZero()) { // x=0 || x=-a/b || (a=0 && b=0) ComparisonType ct = ct_comp; CHILD(0) = x_var; if(!mpow_b.isOne()) {CHILD(0) ^= mpow_b; CHILD_UPDATED(0);} MathStructure *mchild2 = new MathStructure(CHILD(0)); CHILD(1) = mstruct_b; CHILD(1).calculateDivide(mstruct_a, eo2); CHILD(1).calculateNegate(eo2); isolate_x_sub(eo, eo2, x_var, morig); if(!mstruct_a.representsNonZero()) { MathStructure *mtest = new MathStructure(mstruct_a); mtest->transform(ct == COMPARISON_NOT_EQUALS ? COMPARISON_EQUALS : COMPARISON_NOT_EQUALS, m_zero); mtest->calculatesub(eo2, eo, false); transform_nocopy(ct == COMPARISON_NOT_EQUALS ? STRUCT_LOGICAL_OR : STRUCT_LOGICAL_AND, mtest); calculatesub(eo2, eo, false); } mchild2->transform(ct, m_zero); mchild2->isolate_x_sub(eo, eo2, x_var, morig); transform_nocopy(ct == COMPARISON_NOT_EQUALS ? STRUCT_LOGICAL_AND : STRUCT_LOGICAL_OR, mchild2); if(!mstruct_b.representsNonZero() && !mstruct_a.representsNonZero()) { MathStructure *mchild3a = new MathStructure(mstruct_a); mchild3a->transform(ct, m_zero); MathStructure *mchild3b = new MathStructure(mstruct_b); mchild3b->transform(ct, m_zero); mchild3a->transform_nocopy(ct == COMPARISON_NOT_EQUALS ? STRUCT_LOGICAL_OR : STRUCT_LOGICAL_AND, mchild3b); mchild3a->calculatesub(eo2, eo, false); add_nocopy(mchild3a, ct == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); } calculatesub(eo2, eo, false); return true; } else { // x=(-b+/-sqrt(b^2-4ac))/(2a) MathStructure mbak(*this); bool stop_iv = false; if(a_iv >= 0 && a_iv <= PRECISION) { stop_iv = true; } else if(b_iv >= 0) { MathStructure mstruct_bl; MathStructure mstruct_bu; stop_iv = true; if(mstruct_b.isNumber() && mstruct_b.number().isNonZero() && !mstruct_b.number().hasImaginaryPart()) { mstruct_bl = mstruct_b.number().lowerEndPoint(); mstruct_bu = mstruct_b.number().upperEndPoint(); stop_iv = false; } else if(is_units_with_multiplier(mstruct_b) && mstruct_b[0].number().isNonZero() && !mstruct_b[0].number().hasImaginaryPart()) { mstruct_bl = mstruct_b; mstruct_bl[0].number() = mstruct_b[0].number().lowerEndPoint(); mstruct_bu = mstruct_b; mstruct_bu[0].number() = mstruct_b[0].number().upperEndPoint(); stop_iv = false; } if(!stop_iv) { // Lower -b+sqrt(b^2-4ac) MathStructure b2l(mstruct_bl); b2l.calculateRaise(nr_two, eo2); MathStructure ac(4, 1); ac.calculateMultiply(mstruct_a, eo2); ac.calculateMultiply(CHILD(1), eo2); b2l.calculateAdd(ac, eo2); b2l.calculateRaise(nr_half, eo2); mstruct_bl.calculateNegate(eo2); MathStructure mstruct_1l(mstruct_bl); mstruct_1l.calculateAdd(b2l, eo2); // Upper -b+sqrt(b^2-4ac) MathStructure b2u(mstruct_bu); b2u.calculateRaise(nr_two, eo2); b2u.calculateAdd(ac, eo2); b2u.calculateRaise(nr_half, eo2); mstruct_bu.calculateNegate(eo2); MathStructure mstruct_1u(mstruct_bu); mstruct_1u.calculateAdd(b2u, eo2); MathStructure mstruct_1(mstruct_1l); mstruct_1.transform(STRUCT_FUNCTION, mstruct_1u); mstruct_1.setFunction(CALCULATOR->f_interval); mstruct_1.calculateFunctions(eo, false); // Lower -b-sqrt(b^2-4ac) MathStructure mstruct_2l(mstruct_bl); mstruct_2l.calculateSubtract(b2l, eo2); // Upper -b-sqrt(b^2-4ac) MathStructure mstruct_2u(mstruct_bu); mstruct_2u.calculateSubtract(b2u, eo2); MathStructure mstruct_2(mstruct_2l); mstruct_2.transform(STRUCT_FUNCTION, mstruct_2u); mstruct_2.setFunction(CALCULATOR->f_interval); mstruct_2.calculateFunctions(eo, false); mstruct_a.calculateMultiply(nr_two, eo2); mstruct_a.calculateInverse(eo2); mstruct_1.calculateMultiply(mstruct_a, eo2); mstruct_2.calculateMultiply(mstruct_a, eo2); CHILD(0) = x_var; if(!mpow_b.isOne()) {CHILD(0) ^= mpow_b; CHILD_UPDATED(0);} if(mstruct_1 == mstruct_2) { CHILD(1) = mstruct_1; isolate_x_sub(eo, eo2, x_var, morig); } else { CHILD(1) = mstruct_1; MathStructure *mchild2 = new MathStructure(CHILD(0)); isolate_x_sub(eo, eo2, x_var, morig); mchild2->transform(STRUCT_COMPARISON, mstruct_2); mchild2->setComparisonType(ct_comp); mchild2->isolate_x_sub(eo, eo2, x_var, morig); if(ct_comp == COMPARISON_NOT_EQUALS) { transform_nocopy(STRUCT_LOGICAL_AND, mchild2); } else { transform_nocopy(STRUCT_LOGICAL_OR, mchild2); } calculatesub(eo2, eo, false); } CHILDREN_UPDATED return true; } } if(b && stop_iv) { CALCULATOR->beginTemporaryStopIntervalArithmetic(); bool failed = false; fix_intervals(*this, eo2, &failed); if(failed) { set(mbak); CALCULATOR->endTemporaryStopIntervalArithmetic(); b = false; } } if(b) { MathStructure b2(mstruct_b); b2.calculateRaise(nr_two, eo2); MathStructure ac(4, 1); ac.calculateMultiply(mstruct_a, eo2); ac.calculateMultiply(CHILD(1), eo2); b2.calculateAdd(ac, eo2); b2.calculateRaise(nr_half, eo2); mstruct_b.calculateNegate(eo2); MathStructure mstruct_1(mstruct_b); mstruct_1.calculateAdd(b2, eo2); MathStructure mstruct_2(mstruct_b); mstruct_2.calculateSubtract(b2, eo2); mstruct_a.calculateMultiply(nr_two, eo2); mstruct_a.calculateInverse(eo2); mstruct_1.calculateMultiply(mstruct_a, eo2); mstruct_2.calculateMultiply(mstruct_a, eo2); CHILD(0) = x_var; if(!mpow_b.isOne()) {CHILD(0) ^= mpow_b; CHILD_UPDATED(0);} if(mstruct_1 == mstruct_2) { CHILD(1) = mstruct_1; isolate_x_sub(eo, eo2, x_var, morig); } else { CHILD(1) = mstruct_1; MathStructure *mchild2 = new MathStructure(CHILD(0)); isolate_x_sub(eo, eo2, x_var, morig); mchild2->transform(STRUCT_COMPARISON, mstruct_2); mchild2->setComparisonType(ct_comp); mchild2->isolate_x_sub(eo, eo2, x_var, morig); if(ct_comp == COMPARISON_NOT_EQUALS) { transform_nocopy(STRUCT_LOGICAL_AND, mchild2); } else { transform_nocopy(STRUCT_LOGICAL_OR, mchild2); } calculatesub(eo2, eo, false); } CHILDREN_UPDATED; if(stop_iv) { CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); } return true; } } } } if(CALCULATOR->aborted()) return false; // a*b^x+cx=0 => -lambertw(a*log(b)/c)/log(b) // a*b^x+cx=d => (d*log(b)-c*lambertw(a*b^(d/c)*log(b)/c))/(c*log(b)) if((ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) && CHILD(0).size() > 1) { size_t i_px = 0, i_mpx = 0; MathStructure *mvar = NULL, *m_b_p; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2].isPower() && CHILD(0)[i][i2][1].contains(x_var) && !CHILD(0)[i][i2][0].contains(x_var)) { mvar = &CHILD(0)[i][i2][1]; m_b_p = &CHILD(0)[i][i2][0]; i_px = i; i_mpx = i2; break; } } if(mvar) break; } else if(CHILD(0)[i].isPower() && CHILD(0)[i][1].contains(x_var) && !CHILD(0)[i][0].contains(x_var)) { mvar = &CHILD(0)[i][1]; m_b_p = &CHILD(0)[i][0]; i_px = i; break; } } if(mvar) { MathStructure m_b(*m_b_p); if((mvar->isAddition() || mvar->isMultiplication()) && m_b.representsPositive()) { MathStructure *mvar2 = NULL; if(mvar->isMultiplication()) { for(size_t i = 0; i < mvar->size(); i++) { if((*mvar)[i].contains(x_var)) {mvar2 = &(*mvar)[i]; break;} } } else if(mvar->isAddition()) { for(size_t i = 0; i < mvar->size(); i++) { if((*mvar)[i].contains(x_var)) { mvar2 = &(*mvar)[i]; if(mvar->isMultiplication()) { for(size_t i2 = 0; i < mvar2->size(); i2++) { if((*mvar2)[i2].contains(x_var)) {mvar2 = &(*mvar2)[i2]; break;} } } break; } } } if(mvar2) { MathStructure m_b_exp; if(get_multiplier(*mvar, *mvar2, m_b_exp) && m_b.representsReal() && !m_b.contains(x_var)) { m_b ^= m_b_exp; mvar = mvar2; } else { mvar = NULL; } } } MathStructure m_c; if(mvar && get_multiplier(CHILD(0), *mvar, m_c, i_px) && m_c.representsNonZero()) { MathStructure mlogb(CALCULATOR->f_ln, &m_b, NULL); if(mlogb.calculateFunctions(eo)) mlogb.calculatesub(eo2, eo, true); MathStructure *marg = NULL; if(mlogb.representsNonZero()) { marg = new MathStructure(mlogb); if(CHILD(0)[i_px].isMultiplication()) { marg->multiply(CHILD(0)[i_px]); marg->last().delChild(i_mpx + 1, true); if(!marg->last().representsNonZero()) {marg->unref(); marg = NULL;} else marg->calculateMultiplyLast(eo2); } } if(marg) { if(!CHILD(1).isZero()) { marg->multiply(m_b); marg->last().raise(CHILD(1)); if(!m_c.isOne()) marg->last().last().calculateDivide(m_c, eo2); marg->last().calculateRaiseExponent(eo2); marg->calculateMultiplyLast(eo2); } if(!m_c.isOne()) marg->calculateDivide(m_c, eo2); } if(marg && mvar->representsNonComplex() && m_b.representsPositive()) { if(marg->representsComplex()) { marg->unref(); if(ct_comp == COMPARISON_EQUALS) clear(true); else set(1, 1, 0, true); return 1; } MathStructure *mreq1 = NULL; MathStructure *marg2 = NULL; MathStructure *mreq2 = NULL; if(!marg->representsNonNegative()) { mreq1 = new MathStructure(*marg); mreq2 = new MathStructure(*marg); marg2 = new MathStructure(*marg); marg2->transform(CALCULATOR->f_lambert_w); marg2->addChild(m_minus_one); if(marg2->calculateFunctions(eo)) marg2->calculatesub(eo2, eo, true); marg2->calculateNegate(eo2); if(CHILD(1).isZero()) { marg2->calculateDivide(mlogb, eo2); } else { if(!m_c.isOne()) marg->calculateMultiply(m_c, eo2); marg2->add(CHILD(1)); marg2->last().calculateMultiply(mlogb, eo); marg2->calculateAddLast(eo2); marg2->calculateDivide(mlogb, eo2); if(!m_c.isOne()) marg->calculateDivide(m_c, eo2); } mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, CALCULATOR->v_e); mreq1->last().calculateRaise(m_minus_one, eo2); mreq1->last().calculateNegate(eo2); mreq1->childUpdated(2); mreq1->isolate_x(eo2, eo); mreq2->transform(ct_comp == COMPARISON_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, m_zero); mreq2->isolate_x(eo2, eo); marg2->transform(ct_comp, *mvar); marg2->swapChildren(1, 2); marg2->isolate_x_sub(eo, eo2, x_var, morig); marg2->add(*mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); marg2->add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); marg2->calculatesub(eo2, eo, false); } marg->transform(CALCULATOR->f_lambert_w); marg->addChild(m_zero); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); marg->calculateNegate(eo2); if(CHILD(1).isZero()) { marg->calculateDivide(mlogb, eo2); } else { if(!m_c.isOne()) marg->calculateMultiply(m_c, eo2); marg->add(CHILD(1)); marg->last().calculateMultiply(mlogb, eo); marg->calculateAddLast(eo2); marg->calculateDivide(mlogb, eo2); if(!m_c.isOne()) marg->calculateDivide(m_c, eo2); } setChild_nocopy(marg, 2, true); mvar->ref(); CHILD(0).clear(true); setChild_nocopy(mvar, 1, true); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); if(mreq1) { add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } if(marg2) { add_nocopy(marg2, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } return true; } else if(marg) { marg->transform(CALCULATOR->f_lambert_w); marg->addChild(CALCULATOR->v_n); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); marg->calculateNegate(eo2); if(CHILD(1).isZero()) { marg->calculateDivide(mlogb, eo2); } else { if(!m_c.isOne()) marg->calculateMultiply(m_c, eo2); marg->add(CHILD(1)); marg->last().calculateMultiply(mlogb, eo); marg->calculateAddLast(eo2); marg->calculateDivide(mlogb, eo2); if(!m_c.isOne()) marg->calculateDivide(m_c, eo2); } setChild_nocopy(marg, 2, true); mvar->ref(); CHILD(0).clear(true); setChild_nocopy(mvar, 1, true); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); return true; } } } if(i_px == 0) { // a^(2x)+a^x, a^(-x)+a^x MathStructure *mvar1 = NULL, *mvar2 = NULL; b = true; for(size_t i = 0; i < CHILD(0).size() && b; i++) { b = false; if(CHILD(0)[i].isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(!b && CHILD(0)[i][i2].isPower() && CHILD(0)[i][i2][1].contains(x_var) && !CHILD(0)[i][i2][0].contains(x_var)) { if(mvar2) { if(mvar1->equals(CHILD(0)[i][i2]) || mvar2->equals(CHILD(0)[i][i2])) { b = true; } } else if(mvar1) { if(!mvar1->equals(CHILD(0)[i][i2])) { mvar2 = &CHILD(0)[i][i2]; } b = true; } else { mvar1 = &CHILD(0)[i][i2]; b = true; } if(!b) break; } else if(CHILD(0)[i][i2].contains(x_var)) { b = false; break; } } } else if(CHILD(0)[i].isPower() && CHILD(0)[i][1].contains(x_var) && !CHILD(0)[i][0].contains(x_var)) { if(mvar2) { if(mvar1->equals(CHILD(0)[i]) || mvar2->equals(CHILD(0)[i])) { b = true; } } else if(mvar1) { if(!mvar1->equals(CHILD(0)[i])) { mvar2 = &CHILD(0)[i]; } b = true; } else { mvar1 = &CHILD(0)[i]; b = true; } } } if(b && mvar2 && mvar1->base()->representsPositive()) { bool b_two = false, b_m_one = false; if(mvar1->base()->equals(*mvar2->base())) { MathStructure m1m2((*mvar1)[1]); m1m2.calculateMultiply(nr_two, eo2); if(m1m2.equals((*mvar2)[1])) { b_two = true; MathStructure *mtmp = mvar2; mvar2 = mvar1; mvar1 = mtmp; } if(!b_two && !b_m_one) { MathStructure m1mm1((*mvar1)[1]); m1mm1.calculateMultiply(nr_minus_one, eo2); if(m1mm1.equals((*mvar2)[1])) { b_m_one = true; MathStructure *mtmp = mvar2; mvar2 = mvar1; mvar1 = mtmp; } } if(!b_two && !b_m_one) { MathStructure m2m2((*mvar2)[1]); m2m2.calculateMultiply(nr_two, eo2); if(m2m2.equals((*mvar1)[1])) { b_two = true; } } if(!b_two && !b_m_one) { MathStructure m2mm1((*mvar2)[1]); m2mm1.calculateMultiply(nr_minus_one, eo2); if(m2mm1.equals((*mvar1)[1])) { b_m_one = true; } } } else if(mvar1->base()->isNumber() && mvar2->base()->isNumber() && !mvar1->base()->number().isInterval() && !mvar2->base()->number().isInterval()) { if(mvar1->base()->number() < mvar2->base()->number()) { if(mvar2->base()->number() == (mvar1->base()->number() ^ 2)) { b_two = true; } else if(mvar1->base()->number() == (mvar2->base()->number() ^ -1)) { b_m_one = true; MathStructure *mtmp = mvar2; mvar2 = mvar1; mvar1 = mtmp; } } else { if(mvar1->base()->number() == (mvar2->base()->number() ^ 2)) { b_two = true; MathStructure *mtmp = mvar2; mvar2 = mvar1; mvar1 = mtmp; } else if(mvar2->base()->number() == (mvar1->base()->number() ^ -1)) { b_m_one = true; } } } if(b_two || b_m_one) { MathStructure mv(*mvar1); MathStructure mv2(*mvar2); UnknownVariable *var = new UnknownVariable("", format_and_print(mv)); var->setInterval(mv); var->ref(); MathStructure u_var(var); replace(mv, u_var); MathStructure u_var2(var); u_var2.raise(b_two ? nr_two : nr_minus_one); replace(mv2, u_var2); b = isolate_x_sub(eo, eo2, u_var); calculateReplace(u_var, mv, eo2); var->destroy(); if(b) isolate_x(eo, eo2, x_var); return b; } } } if(CHILD(0).containsFunction(CALCULATOR->f_ln)) { // x+ln(x)=lambertw(x) MathStructure *mln = NULL; mvar = NULL; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isMultiplication()) { MathStructure *mln2 = NULL; for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2].contains(x_var)) { if(!mln2 && CHILD(0)[i][i2].isFunction() && CHILD(0)[i][i2].function() == CALCULATOR->f_ln && CHILD(0)[i][i2].size() == 1) { mln2 = &CHILD(0)[i][i2]; } else { mln2 = NULL; break; } } } if(mln2) { if(mln) { if(*mln2 != *mln) { if(!mvar) mvar = &CHILD(0)[i]; } } else { mln = mln2; } } else if(!mvar) { mvar = &CHILD(0)[i]; } } else if(!mln && CHILD(0)[i].isFunction() && CHILD(0)[i].function() == CALCULATOR->f_ln && CHILD(0)[i].size() == 1) { mln = &CHILD(0)[i]; } else if(!mvar) { mvar = &CHILD(0)[i]; } } if(mvar && mln) { MathStructure mx(1, 1, 0); MathStructure mmul2; if(mvar->isMultiplication()) { for(size_t i = 0; i < mvar->size(); i++) { if((*mvar)[i].contains(x_var)) { if(mx.isOne()) mx = (*mvar)[i]; else mx.multiply((*mvar)[i], true); } } } else { mx = *mvar; } if(!mx.isOne() && !get_multiplier((*mln)[0], mx, mmul2)) { mx = m_one; } if(!mx.isOne()) { MathStructure mbak(*this); MathStructure mlns; MathStructure mmul1; mlns.setType(STRUCT_ADDITION); bool b_mul = false; for(size_t i = 0; i < CHILD(0).size();) { if(&CHILD(0)[i] == mln || CHILD(0)[i] == *mln) { if(&CHILD(0)[i] != mln) b_mul = true; CHILD(0)[i].ref(); mlns.addChild_nocopy(&CHILD(0)[i]); CHILD(0).delChild(i + 1); } else if(CHILD(0)[i].isMultiplication()) { b = false; for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2] == *mln) { CHILD(0)[i].ref(); mlns.addChild_nocopy(&CHILD(0)[i]); CHILD(0).delChild(i + 1); b = true; b_mul = true; break; } } if(!b) i++; } else { i++; } } if(CHILD(0).size() == 1) CHILD(0).setToChild(1, true); if(!get_multiplier(CHILD(0), mx, mmul1)) { mx = m_one; } if(!mx.isOne()) { if(mlns.size() == 0) { mx = m_one; } else if(b_mul) { MathStructure mmul3; MathStructure mln2(*mln); if(!get_multiplier(mlns, mln2, mmul3)) { mx = m_one; } else if(!mmul3.isOne()) { mmul1.calculateDivide(mmul3, eo2); CHILD(1).calculateDivide(mmul3, eo2); } } } if(!mx.isOne() && mmul1.representsNonZero() && mmul2.representsNonZero() && !mmul2.contains(x_var)) { MathStructure *marg; if(!CHILD(1).isZero()) { marg = new MathStructure(CALCULATOR->v_e); marg->calculateRaise(CHILD(1), eo2); if(!mmul1.isOne()) marg->calculateMultiply(mmul1, eo2); } else { marg = new MathStructure(mmul1); } if(!mmul2.isOne()) marg->calculateDivide(mmul2, eo2); MathStructure *mreq1 = NULL; if(mx.representsNonComplex() && !marg->representsNonNegative()) { mreq1 = new MathStructure(*marg); mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, CALCULATOR->v_e); mreq1->last().calculateRaise(m_minus_one, eo2); mreq1->last().calculateNegate(eo2); mreq1->childUpdated(2); mreq1->isolate_x(eo2, eo); } marg->transform(CALCULATOR->f_lambert_w); marg->addChild(m_zero); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); CHILD(0).set(mx, true); setChild_nocopy(marg, 2); if(!mmul1.isOne()) CHILD(1).calculateDivide(mmul1, eo2); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); if(mreq1) { add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } return true; } set(mbak); } } } if(CHILD(0).containsFunction(CALCULATOR->f_cosh) && CHILD(0).containsFunction(CALCULATOR->f_sinh)) { // a*cosh(x) + b*cosh(x) MathStructure *marg = NULL, *m_cosh = NULL, *m_sinh = NULL; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isMultiplication()) { bool b_found = false; for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2].contains(x_var)) { if(!b_found && CHILD(0)[i][i2].isFunction() && (CHILD(0)[i][i2].function() == CALCULATOR->f_cosh || CHILD(0)[i][i2].function() == CALCULATOR->f_sinh) && CHILD(0)[i][i2].size() == 1 && (!marg || marg->equals(CHILD(0)[i][i2][0]))) { if(!marg) marg = &CHILD(0)[i][i2][0]; if(CHILD(0)[i][i2].function() == CALCULATOR->f_cosh) m_cosh = &CHILD(0)[i][i2]; else m_sinh = &CHILD(0)[i][i2]; b_found = true; } else { b_found = false; break; } } } if(!b_found) { marg = NULL; break; } } else if(CHILD(0)[i].isFunction() && (CHILD(0)[i].function() == CALCULATOR->f_cosh || CHILD(0)[i].function() == CALCULATOR->f_sinh) && CHILD(0)[i].size() == 1 && (!marg || marg->equals(CHILD(0)[i][0]))) { if(!marg) marg = &CHILD(0)[i][0]; if(CHILD(0)[i].function() == CALCULATOR->f_cosh) m_cosh = &CHILD(0)[i]; else m_sinh = &CHILD(0)[i]; } else { marg = NULL; break; } } if(marg && m_cosh && m_sinh) { MathStructure mtest(*this); EvaluationOptions eo3 = eo; eo3.approximation = APPROXIMATION_EXACT; MathStructure m_ex(CALCULATOR->v_e); m_ex.raise(*marg); MathStructure m_emx(m_ex); m_emx.last().calculateMultiply(nr_minus_one, eo2); m_ex *= nr_half; m_emx *= nr_half; m_ex.swapChildren(1, 2); m_emx.swapChildren(1, 2); MathStructure mr_sinh(m_ex); mr_sinh.calculateSubtract(m_emx, eo3); MathStructure mr_cosh(m_ex); mr_cosh.calculateAdd(m_emx, eo3); mtest.calculateReplace(*m_sinh, mr_sinh, eo3); mtest.calculateReplace(*m_cosh, mr_cosh, eo3); if(mtest.isolate_x_sub(eo, eo3, x_var, morig)) { if(eo2.approximation != APPROXIMATION_EXACT) mtest.calculatesub(eo2, eo, true); set(mtest); return true; } } } } // x+x^(1/a)=b => x=(b-x)^a if(eo2.expand && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) && CHILD(0).size() <= 10 && CHILD(0).size() > 1) { int i_root = 0; size_t root_index = 0; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CALCULATOR->aborted()) return false; if(CHILD(0)[i].isPower()) { if(CHILD(0)[i][1].isNumber() && !CHILD(0)[i][1].isInteger() && CHILD(0)[i][1].number().numeratorIsOne() && CHILD(0)[i][1].number().denominatorIsLessThan(10)) { if(i_root) { if(i_root != CHILD(0)[i][1].number().denominator().intValue()) { i_root = 0; break; } } else { i_root = CHILD(0)[i][1].number().denominator().intValue(); root_index = i; } } else if(!CHILD(0)[i][1].isNumber() || !CHILD(0)[i][1].number().isInteger()) { i_root = 0; break; } } else if(CHILD(0)[i].isFunction() && CHILD(0)[i].function() == CALCULATOR->f_root) { if(VALID_ROOT(CHILD(0)[i]) && CHILD(0)[i][1].number().isLessThan(10)) { if(i_root) { if(i_root != CHILD(0)[i][1].number().intValue()) { i_root = 0; break; } } else { i_root = CHILD(0)[i][1].number().intValue(); root_index = i; } } else { i_root = 0; break; } } else if(CHILD(0)[i].isMultiplication()) { bool b_break = false; for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2].contains(x_var)) { if(CHILD(0)[i][i2].isPower()) { if(CHILD(0)[i][i2][1].isNumber() && !CHILD(0)[i][i2][1].number().isInteger() && CHILD(0)[i][i2][1].number().numeratorIsOne() && CHILD(0)[i][i2][1].number().denominatorIsLessThan(10)) { if(i_root) { if(i_root != CHILD(0)[i][i2][1].number().denominator().intValue()) { i_root = 0; b_break = true; break; } } else { i_root = CHILD(0)[i][i2][1].number().denominator().intValue(); root_index = i; } } else if(!CHILD(0)[i][i2][1].isNumber() || !CHILD(0)[i][i2][1].number().isInteger()) { i_root = 0; b_break = true; break; } } else if(CHILD(0)[i][i2].isFunction() && CHILD(0)[i][i2].function() == CALCULATOR->f_root) { if(VALID_ROOT(CHILD(0)[i][i2]) && CHILD(0)[i][i2][1].number().isLessThan(10)) { if(i_root) { if(i_root != CHILD(0)[i][i2][1].number().intValue()) { i_root = 0; b_break = true; break; } } else { i_root = CHILD(0)[i][i2][1].number().intValue(); root_index = i; } } else { i_root = 0; b_break = true; break; } } } } if(b_break) break; } } if(i_root) { MathStructure mtest(*this); MathStructure msub; if(mtest[0].size() == 2) { msub = mtest[0][root_index == 0 ? 1 : 0]; } else { msub = mtest[0]; msub.delChild(root_index + 1); } mtest[0].setToChild(root_index + 1); mtest[1].calculateSubtract(msub, eo2); if(mtest[0].calculateRaise(i_root, eo2) && mtest[1].calculateRaise(i_root, eo2)) { mtest.childrenUpdated(); if(mtest.isolate_x(eo2, eo, x_var)) { if(test_comparisons(*this, mtest, x_var, eo) >= 0) { set(mtest); return true; } } } } } // x+y/x=z => x*x+y=z*x MathStructure mdiv; mdiv.setUndefined(); MathStructure mdiv_inv; bool b_multiple_div = false; for(size_t i = 0; i < CHILD(0).size() && !b_multiple_div; i++) { if(CALCULATOR->aborted()) return false; if(CHILD(0)[i].isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2].isPower() && CHILD(0)[i][i2][1].isNumber() && CHILD(0)[i][i2][1].number().isReal() && CHILD(0)[i][i2][1].number().isNegative()) { if(!mdiv.isUndefined()) b_multiple_div = true; else mdiv = CHILD(0)[i][i2]; break; } } } else if(CHILD(0)[i].isPower() && CHILD(0)[i][1].isNumber() && CHILD(0)[i][1].number().isReal() && CHILD(0)[i][1].number().isNegative()) { if(!mdiv.isUndefined()) b_multiple_div = true; else mdiv = CHILD(0)[i]; } } if(!mdiv.isUndefined() && countTotalChildren() > 200) mdiv.setUndefined(); if(!mdiv.isUndefined() && b_multiple_div && mdiv.containsInterval()) { MathStructure mbak(*this); CALCULATOR->beginTemporaryStopIntervalArithmetic(); bool failed = false; fix_intervals(*this, eo2, &failed); if(!failed && isolate_x_sub(eo, eo2, x_var, morig)) { CALCULATOR->endTemporaryStopIntervalArithmetic(); if((CALCULATOR->usesIntervalArithmetic() && eo.approximation != APPROXIMATION_EXACT) || mbak.containsInterval()) CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); return true; } CALCULATOR->endTemporaryStopIntervalArithmetic(); set(mbak); } else if(!mdiv.isUndefined()) { if(mdiv[1].isMinusOne()) { mdiv_inv = mdiv[0]; } else { mdiv_inv = mdiv; mdiv_inv[1].number().negate(); } EvaluationOptions eo3 = eo2; eo3.expand = true; bool b2 = false; for(size_t i3 = 0; i3 < CHILD(0).size(); i3++) { bool b = false; if(!b2 || !mdiv.containsInterval()) { if(CHILD(0)[i3].isPower() && CHILD(0)[i3].equals(mdiv, true)) { CHILD(0)[i3].set(1, 1, 0, true); b = true; } else if(CHILD(0)[i3].isMultiplication()) { for(size_t i4 = 0; i4 < CHILD(0)[i3].size(); i4++) { if(CHILD(0)[i3][i4].isPower() && CHILD(0)[i3][i4].equals(mdiv, true)) { b = true; CHILD(0)[i3].delChild(i4 + 1); if(CHILD(0)[i3].size() == 0) CHILD(0)[i3].set(1, 1, 0, true); else if(CHILD(0)[i3].size() == 1) CHILD(0)[i3].setToChild(1, true); break; } } } } if(!b) { CHILD(0)[i3].calculateMultiply(mdiv_inv, eo3); } else { b2 = true; } } CHILD(0).childrenUpdated(); CHILD(0).evalSort(); CHILD(0).calculatesub(eo2, eo, false); CHILD(1).calculateMultiply(mdiv_inv, eo3); CHILDREN_UPDATED if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { bool not_equals = ct_comp == COMPARISON_NOT_EQUALS; isolate_x(eo, eo2, x_var, morig); if(!mdiv[0].representsNonZero(true)) { MathStructure *mtest = new MathStructure(mdiv[0]); mtest->add(m_zero, not_equals ? OPERATION_EQUALS : OPERATION_NOT_EQUALS); mtest->isolate_x_sub(eo, eo2, x_var); add_nocopy(mtest, not_equals ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } } else { MathStructure *malt = new MathStructure(*this); if(ct_comp == COMPARISON_EQUALS_GREATER) { ct_comp = COMPARISON_EQUALS_LESS; } else if(ct_comp == COMPARISON_GREATER) { ct_comp = COMPARISON_LESS; } else if(ct_comp == COMPARISON_EQUALS_LESS) { ct_comp = COMPARISON_EQUALS_GREATER; } else if(ct_comp == COMPARISON_LESS) { ct_comp = COMPARISON_GREATER; } isolate_x(eo, eo2, x_var, morig); MathStructure *mtest = new MathStructure(mdiv); mtest->add(m_zero, OPERATION_LESS); MathStructure *mtest_alt = new MathStructure(*mtest); mtest_alt->setComparisonType(COMPARISON_GREATER); mtest->isolate_x_sub(eo, eo2, x_var); add_nocopy(mtest, OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); malt->isolate_x(eo, eo2, x_var, morig); mtest_alt->isolate_x_sub(eo, eo2, x_var); malt->add_nocopy(mtest_alt, OPERATION_LOGICAL_AND); malt->calculatesub(eo2, eo, false); add_nocopy(malt, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); return true; } return true; } // x^a+x^(b/c)=d => x^(1/c)^(a*c)+x^(1/c)^b=d; f(x)^a+f(x)^b=c => u^a+u^b=c MathStructure mbase; b = true; Number nr_root; bool b_f_root = false; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CALCULATOR->aborted()) return false; if(!mbase.isZero() && CHILD(0)[i] == mbase) { } else if(CHILD(0)[i].isPower() && CHILD(0)[i][1].isNumber() && CHILD(0)[i][1].number().isPositive() && CHILD(0)[i][1].number().isRational()) { if(CHILD(0)[i][0].isFunction() && CHILD(0)[i][0].function() == CALCULATOR->f_root && VALID_ROOT(CHILD(0)[i][0])) { if(mbase.isZero()) mbase = CHILD(0)[i][0][0]; else if(mbase != CHILD(0)[i][0][0]) {b = false; break;} if(!nr_root.isZero()) { if(!b_f_root) {b = false; break;} nr_root.lcm(CHILD(0)[i][0][1].number()); } else { nr_root = CHILD(0)[i][0][1].number(); } b_f_root = true; } else { if(mbase.isZero()) mbase = CHILD(0)[i][0]; else if(mbase != CHILD(0)[i][0]) {b = false; break;} if(!CHILD(0)[i][1].number().isInteger()) { if(b_f_root) {b = false; break;} if(!nr_root.isZero()) { nr_root.lcm(CHILD(0)[i][1].number().denominator()); } else { nr_root = CHILD(0)[i][1].number().denominator(); } } } } else if(CHILD(0)[i].isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(!mbase.isZero() && CHILD(0)[i][i2] == mbase) { } else if(CHILD(0)[i][i2].isPower() && CHILD(0)[i][i2][1].isNumber() && CHILD(0)[i][i2][1].number().isPositive() && CHILD(0)[i][i2][1].number().isRational()) { if(CHILD(0)[i][i2][0].isFunction() && CHILD(0)[i][i2][0].function() == CALCULATOR->f_root && VALID_ROOT(CHILD(0)[i][i2][0])) { if(mbase.isZero()) mbase = CHILD(0)[i][i2][0][0]; else if(mbase != CHILD(0)[i][i2][0][0]) {b = false; break;} if(!nr_root.isZero()) { if(!b_f_root) {b = false; break;} nr_root.lcm(CHILD(0)[i][i2][0][1].number()); } else { nr_root = CHILD(0)[i][i2][0][1].number(); } b_f_root = true; } else { if(mbase.isZero()) mbase = CHILD(0)[i][i2][0]; else if(mbase != CHILD(0)[i][i2][0]) {b = false; break;} if(!CHILD(0)[i][i2][1].number().isInteger()) { if(b_f_root) {b = false; break;} if(!nr_root.isZero()) { nr_root.lcm(CHILD(0)[i][i2][1].number().denominator()); } else { nr_root = CHILD(0)[i][i2][1].number().denominator(); } } } } else if(CHILD(0)[i][i2].isFunction() && CHILD(0)[i][i2].function() == CALCULATOR->f_root && VALID_ROOT(CHILD(0)[i][i2])) { if(mbase.isZero()) mbase = CHILD(0)[i][i2][0]; else if(mbase != CHILD(0)[i][i2][0]) {b = false; break;} if(!nr_root.isZero()) { if(!b_f_root) {b = false; break;} nr_root.lcm(CHILD(0)[i][i2][1].number()); } else { nr_root = CHILD(0)[i][i2][1].number(); } b_f_root = true; } else if(CHILD(0)[i][i2].isNumber() && !CHILD(0)[i][i2].number().isZero()) { } else if(mbase.isZero()) { mbase = CHILD(0)[i][i2]; } else { b = false; break; } } if(!b) break; } else if(CHILD(0)[i].isFunction() && CHILD(0)[i].function() == CALCULATOR->f_root && VALID_ROOT(CHILD(0)[i])) { if(mbase.isZero()) mbase = CHILD(0)[i][0]; else if(mbase != CHILD(0)[i][0]) {b = false; break;} if(!nr_root.isZero()) { if(!b_f_root) {b = false; break;} nr_root.lcm(CHILD(0)[i][1].number()); } else { nr_root = CHILD(0)[i][1].number(); } b_f_root = true; } else if(mbase.isZero()) { mbase = CHILD(0)[i]; } else { b = false; break; } } if(b && !mbase.isZero() && nr_root.isLessThan(100)) { MathStructure mvar(mbase); if(!nr_root.isZero()) { if(b_f_root) { MathStructure mroot(nr_root); mvar.set(CALCULATOR->f_root, &mbase, &mroot, NULL); } else { Number nr_pow(nr_root); nr_pow.recip(); mvar.raise(nr_pow); } } UnknownVariable *var = NULL; if(mvar != x_var) { var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(mvar) + RIGHT_PARENTHESIS); var->setInterval(mvar); var->ref(); } if(!nr_root.isZero()) { MathStructure mbak(*this); for(size_t i = 0; i < CHILD(0).size(); i++) { if(CALCULATOR->aborted()) {set(mbak); return false;} if(CHILD(0)[i] == mbase) { CHILD(0)[i] = var; CHILD(0)[i].raise(nr_root); } else if(CHILD(0)[i].isPower() && CHILD(0)[i][1].isNumber()) { if(CHILD(0)[i][0].isFunction() && CHILD(0)[i][0].function() == CALCULATOR->f_root && CHILD(0)[i][0] != mbase) { CHILD(0)[i][1].number().multiply(nr_root); CHILD(0)[i][1].number().divide(CHILD(0)[i][0][1].number()); if(CHILD(0)[i][1].isOne()) CHILD(0)[i] = var; else CHILD(0)[i][0] = var; } else if(CHILD(0)[i][0] == mbase) { CHILD(0)[i][1].number().multiply(nr_root); if(CHILD(0)[i][1].isOne()) CHILD(0)[i] = var; else CHILD(0)[i][0] = var; } else { // should not happen } } else if(CHILD(0)[i].isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2] == mbase) { CHILD(0)[i][i2] = var; CHILD(0)[i][i2].raise(nr_root); } else if(CHILD(0)[i][i2].isPower() && CHILD(0)[i][i2][1].isNumber()) { if(CHILD(0)[i][i2][0].isFunction() && CHILD(0)[i][i2][0].function() == CALCULATOR->f_root && CHILD(0)[i][i2][0] != mbase) { CHILD(0)[i][i2][1].number().multiply(nr_root); CHILD(0)[i][i2][1].number().divide(CHILD(0)[i][i2][0][1].number()); if(CHILD(0)[i][i2][1].isOne()) CHILD(0)[i][i2] = var; else CHILD(0)[i][i2][0] = var; } else if(CHILD(0)[i][i2][0] == mbase) { CHILD(0)[i][i2][1].number().multiply(nr_root); if(CHILD(0)[i][i2][1].isOne()) CHILD(0)[i][i2] = var; else CHILD(0)[i][i2][0] = var; } else { // should not happen } } else if(CHILD(0)[i][i2].isFunction() && CHILD(0)[i][i2].function() == CALCULATOR->f_root) { Number nr_pow(nr_root); nr_pow.divide(CHILD(0)[i][i2][1].number()); CHILD(0)[i][i2][1] = nr_pow; CHILD(0)[i][i2][0] = var; CHILD(0)[i][i2].setType(STRUCT_POWER); } else if(CHILD(0)[i][i2].isNumber() && !CHILD(0)[i][i2].number().isZero()) { } else { // should not happen } } } else if(CHILD(0)[i].isFunction() && CHILD(0)[i].function() == CALCULATOR->f_root) { Number nr_pow(nr_root); nr_pow.divide(CHILD(0)[i][1].number()); CHILD(0)[i][1] = nr_pow; CHILD(0)[i][0] = var; CHILD(0)[i].setType(STRUCT_POWER); } else { // should not happen } } MathStructure u_var(var); replace(mvar, u_var); CHILD(0).calculatesub(eo2, eo2, true); CHILD_UPDATED(0) b = isolate_x_sub(eo, eo2, u_var); calculateReplace(u_var, mvar, eo2); var->destroy(); if(b) isolate_x(eo, eo2, x_var); return b; } else if(mvar != x_var) { MathStructure u_var(var); replace(mvar, u_var); CHILD(0).calculatesub(eo2, eo2, true); CHILD_UPDATED(0) b = isolate_x_sub(eo, eo2, u_var); calculateReplace(u_var, mvar, eo2); var->destroy(); if(b) isolate_x(eo, eo2, x_var); return b; } } if(!eo2.expand) break; // Try factorization if(!morig || !equals(*morig)) { MathStructure mtest(*this); if(!mtest[1].isZero()) { mtest[0].calculateSubtract(CHILD(1), eo2); mtest[1].clear(); mtest.childrenUpdated(); } b = eo2.do_polynomial_division && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) && do_simplification(mtest[0], eo, true, true, false, false, true); if(b && mtest[0].isMultiplication() && mtest[0].size() == 2 && mtest[0][1].isPower() && mtest[0][1][1].representsNegative()) { MathStructure mreq(mtest); mtest[0].setToChild(1, true); mtest.childUpdated(1); eo2.do_polynomial_division = false; if(mtest.isolate_x_sub(eo, eo2, x_var, this)) { mreq.setComparisonType(ct_comp == COMPARISON_EQUALS ? COMPARISON_NOT_EQUALS : COMPARISON_EQUALS); mreq[0].setToChild(2, true); mreq[0][1].calculateNegate(eo2); mreq[0].calculateRaiseExponent(eo2); mreq.childUpdated(1); mreq.isolate_x_sub(eo, eo2, x_var, this); mtest.add(mreq, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR); mtest.calculatesub(eo2, eo, false); set_nocopy(mtest); return true; } } else { if(b) { mtest = *this; if(!mtest[1].isZero()) { mtest[0].calculateSubtract(CHILD(1), eo2); mtest[1].clear(); mtest.childrenUpdated(); } } if(mtest[0].factorize(eo2, false, false, 0, false, false, NULL, m_undefined, false, false, 3) && !(mtest[0].isMultiplication() && mtest[0].size() == 2 && ((mtest[0][0].isNumber() && mtest[0][1].isAddition()) || mtest[0][0] == CHILD(1) || mtest[0][1] == CHILD(1)))) { mtest.childUpdated(1); if(mtest.isolate_x_sub(eo, eo2, x_var, this)) { set_nocopy(mtest); return true; } } } } // ax^3+bx^2+cx=d if(CHILD(0).size() >= 2 && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { bool cbpow = false, sqpow = false, nopow = false; MathStructure mstruct_a, mstruct_b, mstruct_c; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CALCULATOR->aborted()) return false; if(CHILD(0)[i].isPower() && CHILD(0)[i][0] == x_var && CHILD(0)[i][1].isNumber() && CHILD(0)[i][1].number() == 3) { if(cbpow) mstruct_a.add(m_one, true); else {cbpow = true; mstruct_a.set(m_one);} } else if(CHILD(0)[i].isPower() && CHILD(0)[i][0] == x_var && CHILD(0)[i][1].isNumber() && CHILD(0)[i][1].number() == 2) { if(sqpow) mstruct_b.add(m_one, true); else {sqpow = true; mstruct_b.set(m_one);} } else if(CHILD(0)[i] == x_var) { if(nopow) mstruct_c.add(m_one, true); else {nopow = true; mstruct_c.set(m_one);} } else if(CHILD(0)[i].isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0)[i].size(); i2++) { if(CHILD(0)[i][i2] == x_var) { if(nopow) { MathStructure *madd = new MathStructure(CHILD(0)[i]); madd->delChild(i2 + 1, true); mstruct_c.add_nocopy(madd, true); } else { nopow = true; mstruct_c = CHILD(0)[i]; mstruct_c.delChild(i2 + 1, true); } } else if(CHILD(0)[i][i2].isPower() && CHILD(0)[i][i2][0] == x_var && CHILD(0)[i][i2][1].isNumber() && CHILD(0)[i][i2][1].number() == 2) { if(sqpow) { MathStructure *madd = new MathStructure(CHILD(0)[i]); madd->delChild(i2 + 1, true); mstruct_b.add_nocopy(madd, true); } else { sqpow = true; mstruct_b = CHILD(0)[i]; mstruct_b.delChild(i2 + 1, true); } } else if(CHILD(0)[i][i2].isPower() && CHILD(0)[i][i2][0] == x_var && CHILD(0)[i][i2][1].isNumber() && CHILD(0)[i][i2][1].number() == 3) { if(cbpow) { MathStructure *madd = new MathStructure(CHILD(0)[i]); madd->delChild(i2 + 1, true); mstruct_a.add_nocopy(madd, true); } else { cbpow = true; mstruct_a = CHILD(0)[i]; mstruct_a.delChild(i2 + 1, true); } } else if(CHILD(0)[i][i2].contains(x_var)) { cbpow = false; sqpow = false; nopow = false; break; } } if(!cbpow && !sqpow && !nopow) break; } else { cbpow = false; sqpow = false; nopow = false; break; } } bool b = false; if(cbpow && (nopow || sqpow) && !mstruct_a.representsZero(true)) { b = mstruct_a.representsNonZero(true); if(!b && eo2.approximation == APPROXIMATION_EXACT) { MathStructure mtest(mstruct_a); mtest.add(m_zero, OPERATION_NOT_EQUALS); EvaluationOptions eo3 = eo2; eo3.test_comparisons = true; mtest.calculatesub(eo3, eo, false); b = mtest.isOne(); } } if(b) { MathStructure mbak(*this); CALCULATOR->beginTemporaryStopIntervalArithmetic(); bool failed = false; fix_intervals(*this, eo2, &failed); if(failed) { set(mbak); CALCULATOR->endTemporaryStopIntervalArithmetic(); } else { EvaluationOptions eo3 = eo2; eo3.keep_zero_units = false; MathStructure mstruct_d(CHILD(1)); mstruct_d.calculateNegate(eo2); // 18abcd - 4b^3*d + b^2*c^2 - 4a*c^3 - 27a^2*d^2 MathStructure mdelta(18, 1, 0); mdelta.multiply(mstruct_a); mdelta.multiply(mstruct_b, true); mdelta.multiply(mstruct_c, true); mdelta.multiply(mstruct_d, true); MathStructure *mdelta_b = new MathStructure(mstruct_b); mdelta_b->raise(nr_three); mdelta_b->multiply(Number(-4, 1, 0)); mdelta_b->multiply(mstruct_d); MathStructure *mdelta_c = new MathStructure(mstruct_b); mdelta_c->raise(nr_two); MathStructure *mdelta_c2 = new MathStructure(mstruct_c); mdelta_c2->raise(nr_two); mdelta_c->multiply_nocopy(mdelta_c2); MathStructure *mdelta_d = new MathStructure(mstruct_c); mdelta_d->raise(nr_three); mdelta_d->multiply(Number(-4, 1, 0)); mdelta_d->multiply(mstruct_a, true); MathStructure *mdelta_e = new MathStructure(mstruct_a); mdelta_e->raise(nr_two); MathStructure *mdelta_e2 = new MathStructure(mstruct_d); mdelta_e2->raise(nr_two); mdelta_e->multiply_nocopy(mdelta_e2); mdelta_e->multiply(Number(-27, 1, 0)); mdelta.add_nocopy(mdelta_b); mdelta.add_nocopy(mdelta_c, true); mdelta.add_nocopy(mdelta_d, true); mdelta.add_nocopy(mdelta_e, true); mdelta.calculatesub(eo3, eo); if(CALCULATOR->aborted()) {CALCULATOR->endTemporaryStopIntervalArithmetic(); set(mbak); return false;} int b_zero = -1; int b_real = -1; if(mdelta.representsNonZero(true)) b_zero = 0; else if(mdelta.representsZero(true)) b_zero = 1; if(b_zero == 0) { if(mdelta.representsPositive(true)) { b_real = 1; } else if(mdelta.representsNegative(true)) { b_real = 0; } } else if(b_zero < 0) { ComparisonResult cr = mdelta.compareApproximately(m_zero, eo); if(cr == COMPARISON_RESULT_EQUAL) { b_zero = 1; } else if(COMPARISON_IS_NOT_EQUAL(cr)) { if(cr == COMPARISON_RESULT_LESS) b_real = 0; else if(cr == COMPARISON_RESULT_GREATER) b_real = 1; b_zero = 0; } } if(b_real < 0 && mdelta.representsComplex(true)) b_real = -2; if(b_real == -1) b_zero = -1; MathStructure mdelta0; int b0_zero = -1; if(CALCULATOR->aborted()) {CALCULATOR->endTemporaryStopIntervalArithmetic(); set(mbak); return false;} if(b_zero >= 0) { // b^2 - 3ac mdelta0 = mstruct_b; mdelta0.raise(nr_two); MathStructure *mdelta0_b = new MathStructure(-3, 1, 0); mdelta0_b->multiply(mstruct_a); mdelta0_b->multiply(mstruct_c, true); mdelta0.add_nocopy(mdelta0_b); mdelta0.calculatesub(eo3, eo, true); if(mdelta0.representsNonZero(true)) b0_zero = 0; else if(mdelta0.representsZero(true)) b0_zero = 1; else { ComparisonResult cr = mdelta0.compareApproximately(m_zero, eo); if(cr == COMPARISON_RESULT_EQUAL) { b0_zero = 1; } else if(COMPARISON_IS_NOT_EQUAL(cr)) { b0_zero = 0; } } } if(CALCULATOR->aborted()) {CALCULATOR->endTemporaryStopIntervalArithmetic(); set(mbak); return false;} if(b_zero == 1) { if(b0_zero == 1) { // -b/(3a) CHILD(0) = x_var; CHILD(1).set(-1, 3); CHILD(1).calculateMultiply(mstruct_b, eo3); CHILD(1).calculateDivide(mstruct_a, eo3); CHILDREN_UPDATED; CALCULATOR->endTemporaryStopIntervalArithmetic(); if((CALCULATOR->usesIntervalArithmetic() && eo.approximation != APPROXIMATION_EXACT) || mbak.containsInterval()) CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); return true; } else if(b0_zero == 0) { MathStructure *malt1 = new MathStructure(x_var); malt1->transform(STRUCT_COMPARISON, m_zero); malt1->setComparisonType(comparisonType()); MathStructure *malt2 = new MathStructure(*malt1); // (9ad - bc) / (2*delta0) (*malt1)[1].set(9, 1, 0); (*malt1)[1].calculateMultiply(mstruct_a, eo3); (*malt1)[1].calculateMultiply(mstruct_d, eo3); MathStructure *malt1_2b = new MathStructure(-1, 1, 0); malt1_2b->calculateMultiply(mstruct_b, eo3); malt1_2b->calculateMultiply(mstruct_c, eo3); (*malt1)[1].add_nocopy(malt1_2b); (*malt1)[1].calculateAddLast(eo3); (*malt1)[1].calculateDivide(nr_two, eo3); (*malt1)[1].calculateDivide(mdelta0, eo3); // (4abc - 9a^2*d - b^3) / (a*delta0) (*malt2)[1].set(4, 1, 0); (*malt2)[1].calculateMultiply(mstruct_a, eo3); (*malt2)[1].calculateMultiply(mstruct_b, eo3); (*malt2)[1].calculateMultiply(mstruct_c, eo3); MathStructure *malt2_2b = new MathStructure(mstruct_a); malt2_2b->calculateRaise(nr_two, eo3); malt2_2b->calculateMultiply(Number(-9, 1, 0), eo3); malt2_2b->calculateMultiply(mstruct_d, eo3); (*malt2)[1].add_nocopy(malt2_2b); (*malt2)[1].calculateAddLast(eo3); MathStructure *malt2_2c = new MathStructure(mstruct_b); malt2_2c->calculateRaise(nr_three, eo3); malt2_2c->calculateNegate(eo3); (*malt2)[1].add_nocopy(malt2_2c); (*malt2)[1].calculateAddLast(eo3); (*malt2)[1].calculateDivide(mstruct_a, eo3); (*malt2)[1].calculateDivide(mdelta0, eo3); if(ct_comp == COMPARISON_NOT_EQUALS) { clear(true); setType(STRUCT_LOGICAL_AND); } else { clear(true); setType(STRUCT_LOGICAL_OR); } malt1->childUpdated(2); malt2->childUpdated(2); addChild_nocopy(malt1); addChild_nocopy(malt2); calculatesub(eo2, eo, false); CALCULATOR->endTemporaryStopIntervalArithmetic(); if((CALCULATOR->usesIntervalArithmetic() && eo.approximation != APPROXIMATION_EXACT) || mbak.containsInterval()) CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); return true; } } if(CALCULATOR->aborted()) {CALCULATOR->endTemporaryStopIntervalArithmetic(); return false;} MathStructure mdelta1; bool b_neg = false; if(b_zero == 0 && b0_zero >= 0) { // 2b^3 - 9abc + 27a^2*d mdelta1 = mstruct_b; mdelta1.raise(nr_three); mdelta1.multiply(nr_two); MathStructure *mdelta1_b = new MathStructure(-9, 1, 0); mdelta1_b->multiply(mstruct_a); mdelta1_b->multiply(mstruct_b, true); mdelta1_b->multiply(mstruct_c, true); MathStructure *mdelta1_c = new MathStructure(mstruct_a); mdelta1_c->raise(nr_two); mdelta1_c->multiply(Number(27, 1, 0)); mdelta1_c->multiply(mstruct_d, true); mdelta1.add_nocopy(mdelta1_b); mdelta1.add_nocopy(mdelta1_c, true); mdelta1.calculatesub(eo3, eo, true); if(b0_zero == 1) { if(mdelta1.representsNegative(true)) { b_neg = true; } else if(!mdelta1.representsPositive(true)) { if(mdelta1.representsZero(true)) { // -b/(3a) CHILD(0) = x_var; CHILD(1).set(-1, 3); CHILD(1).calculateMultiply(mstruct_b, eo3); CHILD(1).calculateDivide(mstruct_a, eo3); CHILDREN_UPDATED; CALCULATOR->endTemporaryStopIntervalArithmetic(); if((CALCULATOR->usesIntervalArithmetic() && eo.approximation != APPROXIMATION_EXACT) || mbak.containsInterval()) CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); return true; } ComparisonResult cr = mdelta1.compareApproximately(m_zero, eo); if(cr == COMPARISON_RESULT_EQUAL) { // -b/(3a) CHILD(0) = x_var; CHILD(1).set(-1, 3); CHILD(1).calculateMultiply(mstruct_b, eo3); CHILD(1).calculateDivide(mstruct_a, eo3); CHILDREN_UPDATED; CALCULATOR->endTemporaryStopIntervalArithmetic(); if((CALCULATOR->usesIntervalArithmetic() && eo.approximation != APPROXIMATION_EXACT) || mbak.containsInterval()) CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); return true; } else if(cr == COMPARISON_RESULT_LESS) { b_neg = true; } else if(cr != COMPARISON_RESULT_GREATER) { b_zero = -1; } } } } if(b_zero == 0 && b0_zero == 0) { // ((delta1 +-sqrt(delta1^2-4*delta0^3))/2)^(1/3) MathStructure mC; MathStructure *md0_43 = new MathStructure(mdelta0); md0_43->raise(nr_three); md0_43->multiply(Number(-4, 1, 0)); MathStructure *md1_2 = new MathStructure(mdelta1); md1_2->raise(nr_two); md1_2->add_nocopy(md0_43); md1_2->raise(nr_half); if(b_neg) md1_2->calculateNegate(eo3); md1_2->calculatesub(eo3, eo, true); if(CALCULATOR->aborted()) {CALCULATOR->endTemporaryStopIntervalArithmetic(); set(mbak); return false;} mC = mdelta1; mC.add_nocopy(md1_2); mC.calculateAddLast(eo3); mC.calculateDivide(nr_two, eo3); if(b_real == 0 && x_var.representsReal(true)) { if(!mC.representsComplex(true)) { mC.transform(STRUCT_FUNCTION); mC.addChild(nr_three); mC.setFunction(CALCULATOR->f_root); if(mC.calculateFunctions(eo)) mC.calculatesub(eo2, eo, true); // x = -1/(3a)*(b + C + delta0/C) CHILD(0) = x_var; CHILD(1).set(-1, 3, 0); CHILD(1).calculateDivide(mstruct_a, eo3); MathStructure *malt1_2b = new MathStructure(mdelta0); malt1_2b->calculateDivide(mC, eo3); malt1_2b->calculateAdd(mC, eo3); malt1_2b->calculateAdd(mstruct_b, eo3); CHILD(1).multiply_nocopy(malt1_2b); CHILD(1).calculateMultiplyLast(eo3); CHILDREN_UPDATED; CALCULATOR->endTemporaryStopIntervalArithmetic(); if((CALCULATOR->usesIntervalArithmetic() && eo.approximation != APPROXIMATION_EXACT) || mbak.containsInterval()) CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); return true; } } else if(eo3.allow_complex) { if(mC.representsNegative(true)) { mC.calculateNegate(eo3); mC.calculateRaise(Number(1, 3, 0), eo3); mC.calculateNegate(eo3); } else { mC.calculateRaise(Number(1, 3, 0), eo3); } // x = -1/(3a)*(b + C + delta0/C) MathStructure *malt1 = new MathStructure(x_var); malt1->transform(STRUCT_COMPARISON, Number(-1, 3, 0)); malt1->setComparisonType(comparisonType()); (*malt1)[1].calculateDivide(mstruct_a, eo3); MathStructure *malt2 = new MathStructure(*malt1); MathStructure *malt3 = new MathStructure(*malt1); MathStructure *malt1_2b = new MathStructure(mdelta0); malt1_2b->calculateDivide(mC, eo3); malt1_2b->calculateAdd(mC, eo3); malt1_2b->calculateAdd(mstruct_b, eo3); (*malt1)[1].multiply_nocopy(malt1_2b); (*malt1)[1].calculateMultiplyLast(eo3); MathStructure cbrt_mul(nr_three); cbrt_mul.calculateRaise(nr_half, eo3); cbrt_mul.calculateMultiply(nr_one_i, eo3); MathStructure cbrt_mul2(cbrt_mul); cbrt_mul.calculateMultiply(nr_half, eo3); cbrt_mul.calculateAdd(Number(-1, 2, 0), eo3); cbrt_mul2.calculateMultiply(Number(-1, 2, 0), eo3); cbrt_mul2.calculateAdd(Number(-1, 2, 0), eo3); MathStructure mC2(mC); mC2.calculateMultiply(cbrt_mul, eo3); MathStructure mC3(mC); mC3.calculateMultiply(cbrt_mul2, eo3); MathStructure *malt2_2b = new MathStructure(mdelta0); malt2_2b->calculateDivide(mC2, eo3); malt2_2b->calculateAdd(mC2, eo3); malt2_2b->calculateAdd(mstruct_b, eo3); (*malt2)[1].multiply_nocopy(malt2_2b); (*malt2)[1].calculateMultiplyLast(eo3); MathStructure *malt3_2b = new MathStructure(mdelta0); malt3_2b->calculateDivide(mC3, eo3); malt3_2b->calculateAdd(mC3, eo3); malt3_2b->calculateAdd(mstruct_b, eo3); (*malt3)[1].multiply_nocopy(malt3_2b); (*malt3)[1].calculateMultiplyLast(eo3); if(b_real == 1) { if((*malt1)[1].isNumber()) { (*malt1)[1].number().clearImaginary(); } else if((*malt1)[1].isMultiplication() && (*malt1)[1][0].isNumber()) { bool b = true; for(size_t i = 1; i < (*malt1)[1].size(); i++) { if(!(*malt1)[1][i].representsReal(true)) { b = false; break; } } if(b) (*malt1)[1][0].number().clearImaginary(); } if((*malt2)[1].isNumber()) { (*malt2)[1].number().clearImaginary(); } else if((*malt2)[1].isMultiplication() && (*malt2)[1][0].isNumber()) { bool b = true; for(size_t i = 1; i < (*malt2)[1].size(); i++) { if(!(*malt2)[1][i].representsReal(true)) { b = false; break; } } if(b) (*malt2)[1][0].number().clearImaginary(); } if((*malt3)[1].isNumber()) { (*malt3)[1].number().clearImaginary(); } else if((*malt3)[1].isMultiplication() && (*malt3)[1][0].isNumber()) { bool b = true; for(size_t i = 1; i < (*malt3)[1].size(); i++) { if(!(*malt3)[1][i].representsReal(true)) { b = false; break; } } if(b) (*malt3)[1][0].number().clearImaginary(); } } if(b_real < 1 || !x_var.representsReal(true) || (!(*malt1)[1].representsComplex(true) && !(*malt2)[1].representsComplex(true) && !(*malt3)[1].representsComplex(true))) { if(ct_comp == COMPARISON_NOT_EQUALS) { clear(true); setType(STRUCT_LOGICAL_AND); } else { clear(true); setType(STRUCT_LOGICAL_OR); } malt1->childUpdated(2); malt2->childUpdated(2); malt3->childUpdated(2); addChild_nocopy(malt1); addChild_nocopy(malt2); addChild_nocopy(malt3); calculatesub(eo2, eo, false); CALCULATOR->endTemporaryStopIntervalArithmetic(); if((CALCULATOR->usesIntervalArithmetic() && eo.approximation != APPROXIMATION_EXACT) || mbak.containsInterval()) CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); return true; } } } CALCULATOR->endTemporaryStopIntervalArithmetic(); } } } // abs(x)+x=a => -x+x=a || x+x=a; sgn(x)+x=a => -1+x=a || 0+x=a || 1+x=a if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { MathStructure *m = find_abs_sgn(CHILD(0), x_var); if(m && m->function() == CALCULATOR->f_abs) { MathStructure mabs(*m); ComparisonType cmp_type = ct_comp; MathStructure *malt = new MathStructure(*this); MathStructure mabs_minus(mabs[0]); mabs_minus.calculateNegate(eo2); (*malt)[0].replace(mabs, mabs_minus, mabs.containsInterval()); (*malt)[0].calculatesub(eo2, eo, true); malt->childUpdated(1); MathStructure *mcheck = new MathStructure(mabs[0]); mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_EQUALS_GREATER : OPERATION_LESS); mcheck->isolate_x_sub(eo, eo2, x_var); malt->isolate_x_sub(eo, eo2, x_var); malt->add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); malt->calculatesub(eo2, eo, false); mcheck = new MathStructure(mabs[0]); CHILD(0).replace(mabs, mabs[0], mabs.containsInterval()); CHILD(0).calculatesub(eo2, eo, true); CHILD_UPDATED(0) mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LESS : OPERATION_EQUALS_GREATER); mcheck->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var); add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); add_nocopy(malt, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); calculatesub(eo2, eo, false); return true; } else if(m && m->function() == CALCULATOR->f_signum) { MathStructure mabs(*m); ComparisonType cmp_type = ct_comp; MathStructure *malt = new MathStructure(*this); (*malt)[0].replace(mabs, m_minus_one, mabs.containsInterval()); (*malt)[0].calculatesub(eo2, eo, true); malt->childUpdated(1); MathStructure *mcheck = new MathStructure(mabs[0]); mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? ((*m)[1].isMinusOne() ? OPERATION_GREATER : OPERATION_EQUALS_GREATER) : ((*m)[1].isMinusOne() ? OPERATION_EQUALS_LESS : OPERATION_LESS)); mcheck->isolate_x_sub(eo, eo2, x_var); malt->isolate_x_sub(eo, eo2, x_var); malt->add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); malt->calculatesub(eo2, eo, false); MathStructure *malt0 = NULL; if(!(*m)[1].isOne() && !(*m)[1].isMinusOne()) { malt0 = new MathStructure(*this); (*malt0)[0].replace(mabs, (*m)[1], mabs.containsInterval()); (*malt0)[0].calculatesub(eo2, eo, true); malt0->childUpdated(1); mcheck = new MathStructure(mabs[0]); mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_NOT_EQUALS : OPERATION_EQUALS); mcheck->isolate_x_sub(eo, eo2, x_var); malt0->isolate_x_sub(eo, eo2, x_var); malt0->add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); malt0->calculatesub(eo2, eo, false); } mcheck = new MathStructure(mabs[0]); CHILD(0).replace(mabs, m_one, mabs.containsInterval()); CHILD(0).calculatesub(eo2, eo, true); CHILD_UPDATED(0) mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? ((*m)[1].isOne() ? OPERATION_LESS : OPERATION_EQUALS_LESS) : ((*m)[1].isOne() ? OPERATION_EQUALS_GREATER : OPERATION_GREATER)); mcheck->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var); add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); add_nocopy(malt, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); if(malt0) add_nocopy(malt0, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); calculatesub(eo2, eo, false); return true; } } // Use newton raphson to calculate approximate solution for polynomial MathStructure x_value; if((ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) && CHILD(1).isNumber() && eo.approximation != APPROXIMATION_EXACT && !x_var.representsComplex(true)) { MathStructure mtest(CHILD(0)); if(!CHILD(0).isZero()) mtest.calculateSubtract(CHILD(1), eo2); CALCULATOR->beginTemporaryStopIntervalArithmetic(); bool failed = false; fix_intervals(mtest, eo2, &failed); if(failed) { CALCULATOR->endTemporaryStopIntervalArithmetic(); } else { MathStructure mbak(*this); int ret = -1; EvaluationOptions eo3 = eo2; eo3.approximation = APPROXIMATION_APPROXIMATE; if(ct_comp == COMPARISON_EQUALS) clear(true); else set(1, 1, 0, true); while((ret = newton_raphson(mtest, x_value, x_var, eo3)) > 0) { if(isNumber()) { set(x_var, true); transform(STRUCT_COMPARISON, x_value); setComparisonType(mbak.comparisonType()); } else { if(isComparison()) transform(mbak.comparisonType() == COMPARISON_NOT_EQUALS ? STRUCT_LOGICAL_AND : STRUCT_LOGICAL_OR); MathStructure *mnew = new MathStructure(x_var); mnew->transform(STRUCT_COMPARISON, x_value); mnew->setComparisonType(mbak.comparisonType()); addChild_nocopy(mnew); } MathStructure mdiv(x_var); mdiv.calculateSubtract(x_value, eo3); MathStructure mtestcopy(mtest); MathStructure mrem; if(!polynomial_long_division(mtestcopy, mdiv, x_var, mtest, mrem, eo3, false, true) || !mrem.isNumber()) { ret = -1; break; } if(!mtest.contains(x_var)) break; } CALCULATOR->endTemporaryStopIntervalArithmetic(); if(ret < 0) { set(mbak); } else { if(!x_var.representsReal()) CALCULATOR->error(false, _("Not all complex roots were calculated for %s."), format_and_print(mbak).c_str(), NULL); if((CALCULATOR->usesIntervalArithmetic() && eo.approximation != APPROXIMATION_EXACT) || mbak.containsInterval()) CALCULATOR->error(false, _("Interval arithmetic was disabled during calculation of %s."), format_and_print(mbak).c_str(), NULL); fix_intervals(*this, eo2); return true; } } } // Try factorization if((!morig || !equals(*morig)) && !CHILD(1).isZero()) { MathStructure mtest(*this); if(mtest[0].factorize(eo2, false, false, 0, false, false, NULL, m_undefined, false, false, 3) && !(mtest[0].isMultiplication() && mtest[0].size() == 2 && (mtest[0][0].isNumber() || mtest[0][0] == CHILD(1) || mtest[0][1] == CHILD(1)))) { mtest.childUpdated(1); if(mtest.isolate_x_sub(eo, eo2, x_var, this)) { set_nocopy(mtest); return true; } } } break; } case STRUCT_MULTIPLICATION: { if(!representsNonMatrix()) return false; //x*y=0 => x=0 || y=0 if(CHILD(1).isZero()) { if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { vector checktype; bool bdoit = false; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CALCULATOR->aborted()) return false; if(CHILD(0)[i].isPower() && !CHILD(0)[i][1].representsNonNegative()) { if(CHILD(0)[i][1].representsNegative()) { checktype.push_back(1); } else { checktype.push_back(2); bdoit = true; } } else { checktype.push_back(0); bdoit = true; } } if(!bdoit) break; MathStructure *mcheckpowers = NULL; ComparisonType ct = ct_comp; setToChild(1); if(ct == COMPARISON_NOT_EQUALS) { setType(STRUCT_LOGICAL_AND); } else { setType(STRUCT_LOGICAL_OR); } MathStructure mbak(*this); for(size_t i = 0; i < SIZE;) { if(CALCULATOR->aborted()) { set(mbak); if(mcheckpowers) mcheckpowers->unref(); return false; } if(checktype[i] > 0) { MathStructure *mcheck = new MathStructure(CHILD(i)[0]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add(m_zero, OPERATION_EQUALS); else mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck->isolate_x_sub(eo, eo2, x_var); if(checktype[i] == 2) { MathStructure *mexpcheck = new MathStructure(CHILD(i)[1]); if(ct_comp == COMPARISON_NOT_EQUALS) mexpcheck->add(m_zero, OPERATION_LESS); else mexpcheck->add(m_zero, OPERATION_EQUALS_GREATER); mexpcheck->isolate_x_sub(eo, eo2, x_var); if(ct_comp == COMPARISON_NOT_EQUALS) mexpcheck->add_nocopy(mcheck, OPERATION_LOGICAL_AND, true); else mexpcheck->add_nocopy(mcheck, OPERATION_LOGICAL_OR, true); mexpcheck->calculatesub(eo2, eo, false); mcheck = mexpcheck; } if(mcheckpowers) { if(ct_comp == COMPARISON_NOT_EQUALS) mcheckpowers->add_nocopy(mcheck, OPERATION_LOGICAL_OR, true); else mcheckpowers->add_nocopy(mcheck, OPERATION_LOGICAL_AND, true); } else { mcheckpowers = mcheck; } } if(checktype[i] == 1) { ERASE(i) checktype.erase(checktype.begin() + i); } else { CHILD(i).transform(STRUCT_COMPARISON, m_zero); CHILD(i).setComparisonType(ct); CHILD(i).isolate_x_sub(eo, eo2, x_var); CHILD_UPDATED(i) i++; } } if(SIZE == 1) setToChild(1); else if(SIZE == 0) clear(true); else calculatesub(eo2, eo, false); if(mcheckpowers) { mcheckpowers->calculatesub(eo2, eo, false); if(ct_comp == COMPARISON_NOT_EQUALS) add_nocopy(mcheckpowers, OPERATION_LOGICAL_OR, true); else add_nocopy(mcheckpowers, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) calculatesub(eo2, eo, false); } return true; } else if(CHILD(0).size() >= 2) { MathStructure mless1(CHILD(0)[0]); MathStructure mless2; if(CHILD(0).size() == 2) { mless2 = CHILD(0)[1]; } else { mless2 = CHILD(0); mless2.delChild(1); } int checktype1 = 0, checktype2 = 0; MathStructure *mcheck1 = NULL, *mcheck2 = NULL; if(mless1.isPower() && !mless1[1].representsNonNegative()) { if(mless1[1].representsNegative()) { checktype1 = 1; } else if(ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER) { checktype1 = 2; mcheck1 = new MathStructure(mless1[1]); mcheck1->add(m_zero, OPERATION_EQUALS_GREATER); mcheck1->isolate_x_sub(eo, eo2, x_var); MathStructure *mcheck = new MathStructure(mless1[0]); mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck->isolate_x_sub(eo, eo2, x_var); mcheck1->add_nocopy(mcheck, OPERATION_LOGICAL_OR); mcheck1->calculatesub(eo2, eo, false); } } if(mless2.isPower() && !mless2[1].representsNonNegative()) { if(mless2[1].representsNegative()) { checktype2 = 1; } else if(ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER) { checktype2 = 2; mcheck2 = new MathStructure(mless2[1]); mcheck2->add(m_zero, OPERATION_EQUALS_GREATER); mcheck2->isolate_x_sub(eo, eo2, x_var); MathStructure *mcheck = new MathStructure(mless2[0]); mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck->isolate_x_sub(eo, eo2, x_var); mcheck2->add_nocopy(mcheck, OPERATION_LOGICAL_OR); mcheck2->calculatesub(eo2, eo, false); } } mless1.transform(STRUCT_COMPARISON, m_zero); if(checktype1 != 1 && (ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER)) { mless1.setComparisonType(COMPARISON_EQUALS_LESS); } else { mless1.setComparisonType(COMPARISON_LESS); } mless1.isolate_x_sub(eo, eo2, x_var); mless2.transform(STRUCT_COMPARISON, m_zero); mless2.setComparisonType(COMPARISON_LESS); if(checktype2 != 1 && (ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER)) { mless2.setComparisonType(COMPARISON_EQUALS_LESS); } else { mless2.setComparisonType(COMPARISON_LESS); } mless2.isolate_x_sub(eo, eo2, x_var); MathStructure mgreater1(CHILD(0)[0]); mgreater1.transform(STRUCT_COMPARISON, m_zero); if(checktype1 != 1 && (ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER)) { mgreater1.setComparisonType(COMPARISON_EQUALS_GREATER); } else { mgreater1.setComparisonType(COMPARISON_GREATER); } mgreater1.isolate_x_sub(eo, eo2, x_var); MathStructure mgreater2; if(CHILD(0).size() == 2) { mgreater2 = CHILD(0)[1]; } else { mgreater2 = CHILD(0); mgreater2.delChild(1); } mgreater2.transform(STRUCT_COMPARISON, m_zero); if(checktype2 != 1 && (ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_EQUALS_GREATER)) { mgreater2.setComparisonType(COMPARISON_EQUALS_GREATER); } else { mgreater2.setComparisonType(COMPARISON_GREATER); } mgreater2.isolate_x_sub(eo, eo2, x_var); clear(); if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { set(mless1); transform(STRUCT_LOGICAL_AND, mgreater2); calculatesub(eo2, eo, false); transform(STRUCT_LOGICAL_OR, mless2); CHILD(1).transform(STRUCT_LOGICAL_AND, mgreater1); CHILD(1).calculatesub(eo2, eo, false); CHILD_UPDATED(1) calculatesub(eo2, eo, false); } else { set(mless1); transform(STRUCT_LOGICAL_AND, mless2); calculatesub(eo2, eo, false); transform(STRUCT_LOGICAL_OR, mgreater1); CHILD(1).transform(STRUCT_LOGICAL_AND, mgreater2); CHILD(1).calculatesub(eo2, eo, false); CHILD_UPDATED(1) calculatesub(eo2, eo, false); } if(checktype1 == 2) { add_nocopy(mcheck1, OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); } if(checktype2 == 2) { add_nocopy(mcheck2, OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); } return true; } } // x/(x+a)=b => x=b(x+a) for(size_t i = 0; i < CHILD(0).size(); i++) { if(CALCULATOR->aborted()) return false; if(CHILD(0)[i].isPower() && CHILD(0)[i][1].isNumber() && CHILD(0)[i][1].number().isNegative() && CHILD(0)[i][1].number().isReal()) { MathStructure *mtest; if(CHILD(0)[i][1].number().isMinusOne()) { CHILD(1).multiply(CHILD(0)[i][0]); mtest = new MathStructure(CHILD(0)[i][0]); } else { CHILD(0)[i][1].number().negate(); CHILD(1).multiply(CHILD(0)[i]); mtest = new MathStructure(CHILD(0)[i]); } CHILD(0).delChild(i + 1); if(CHILD(0).size() == 1) CHILD(0).setToChild(1); CHILD(0).calculateSubtract(CHILD(1), eo); ComparisonType cmp_type = ct_comp; CHILD(1).clear(); CHILDREN_UPDATED if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { isolate_x_sub(eo, eo2, x_var, morig); mtest->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_EQUALS : OPERATION_NOT_EQUALS); mtest->isolate_x_sub(eo, eo2, x_var); add_nocopy(mtest, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); return true; } else { MathStructure *malt = new MathStructure(*this); if(ct_comp == COMPARISON_EQUALS_GREATER) { ct_comp = COMPARISON_EQUALS_LESS; } else if(ct_comp == COMPARISON_GREATER) { ct_comp = COMPARISON_LESS; } else if(ct_comp == COMPARISON_EQUALS_LESS) { ct_comp = COMPARISON_EQUALS_GREATER; } else if(ct_comp == COMPARISON_LESS) { ct_comp = COMPARISON_GREATER; } isolate_x_sub(eo, eo2, x_var, morig); mtest->add(m_zero, OPERATION_LESS); MathStructure *mtest_alt = new MathStructure(*mtest); mtest_alt->setComparisonType(COMPARISON_GREATER); mtest->isolate_x_sub(eo, eo2, x_var); add_nocopy(mtest, OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); malt->isolate_x_sub(eo, eo2, x_var, morig); mtest_alt->isolate_x_sub(eo, eo2, x_var); malt->add_nocopy(mtest_alt, OPERATION_LOGICAL_AND); malt->calculatesub(eo2, eo, false); add_nocopy(malt, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); return true; } } } bool b = false; int zero1; if(CHILD(1).isZero()) zero1 = 1; else if(CHILD(1).representsNonZero(true)) zero1 = 0; else zero1 = 2; MathStructure *mcheckmulti = NULL, *mtryzero = NULL, *mchecknegative = NULL, *mchecknonzeropow = NULL; MathStructure mchild2(CHILD(1)); MathStructure mbak(*this); ComparisonType ct_orig = ct_comp; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CALCULATOR->aborted()) { set(mbak); if(mcheckmulti) mcheckmulti->unref(); if(mtryzero) mcheckmulti->unref(); if(mchecknegative) mcheckmulti->unref(); if(mchecknonzeropow) mcheckmulti->unref(); return false; } if(!CHILD(0)[i].contains(x_var)) { bool nonzero = false; if(CHILD(0)[i].isPower() && !CHILD(0)[i][1].representsNonNegative(true) && !CHILD(0)[i][0].representsNonZero(true)) { MathStructure *mcheck = new MathStructure(CHILD(0)[i][0]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add(m_zero, OPERATION_EQUALS); else mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck->isolate_x(eo2, eo); if(CHILD(0)[i][1].representsNegative(true)) { nonzero = true; } else { MathStructure *mcheckor = new MathStructure(CHILD(0)[i][1]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheckor->add(m_zero, OPERATION_EQUALS_LESS); else mcheckor->add(m_zero, OPERATION_EQUALS_GREATER); mcheckor->isolate_x(eo2, eo); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add_nocopy(mcheckor, OPERATION_LOGICAL_AND); else mcheck->add_nocopy(mcheckor, OPERATION_LOGICAL_OR); mcheck->calculatesub(eo2, eo, false); } if(mchecknonzeropow) { if(ct_comp == COMPARISON_NOT_EQUALS) mchecknonzeropow->add_nocopy(mcheck, OPERATION_LOGICAL_OR); else mchecknonzeropow->add_nocopy(mcheck, OPERATION_LOGICAL_AND); } else { mchecknonzeropow = mcheck; } } if(!nonzero && !CHILD(0)[i].representsNonZero(true)) { if(zero1 != 1 && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { MathStructure *mcheck = new MathStructure(CHILD(0)[i]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add(m_zero, OPERATION_EQUALS); else mcheck->add(m_zero, OPERATION_NOT_EQUALS); mcheck->isolate_x(eo2, eo); if(mcheckmulti) { if(ct_comp == COMPARISON_NOT_EQUALS) mcheckmulti->add_nocopy(mcheck, OPERATION_LOGICAL_OR); else mcheckmulti->add_nocopy(mcheck, OPERATION_LOGICAL_AND); } else { mcheckmulti = mcheck; } } if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(!mtryzero) { mtryzero = new MathStructure(CHILD(0)[i]); mtryzero->add(m_zero, OPERATION_EQUALS); mtryzero->isolate_x(eo2, eo); MathStructure *mcheck = new MathStructure(mchild2); switch(ct_orig) { case COMPARISON_LESS: {mcheck->add(m_zero, OPERATION_GREATER); break;} case COMPARISON_GREATER: {mcheck->add(m_zero, OPERATION_LESS); break;} case COMPARISON_EQUALS_LESS: {mcheck->add(m_zero, OPERATION_EQUALS_GREATER); break;} case COMPARISON_EQUALS_GREATER: {mcheck->add(m_zero, OPERATION_EQUALS_LESS); break;} default: {} } mcheck->isolate_x(eo2, eo); mtryzero->add_nocopy(mcheck, OPERATION_LOGICAL_AND); } else { MathStructure *mcheck = new MathStructure(CHILD(0)[i]); mcheck->add(m_zero, OPERATION_EQUALS); mcheck->isolate_x(eo2, eo); (*mtryzero)[0].add_nocopy(mcheck, OPERATION_LOGICAL_OR); mtryzero[0].calculateLogicalOrLast(eo2); } } else if(zero1 > 0) { MathStructure *mcheck = new MathStructure(CHILD(0)[i]); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck->add(m_zero, OPERATION_NOT_EQUALS); else mcheck->add(m_zero, OPERATION_EQUALS); mcheck->isolate_x(eo2, eo); if(zero1 == 2) { MathStructure *mcheck2 = new MathStructure(mchild2); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck2->add(m_zero, OPERATION_NOT_EQUALS); else mcheck2->add(m_zero, OPERATION_EQUALS); mcheck2->isolate_x(eo2, eo); if(ct_comp == COMPARISON_NOT_EQUALS) mcheck2->add_nocopy(mcheck, OPERATION_LOGICAL_OR); else mcheck2->add_nocopy(mcheck, OPERATION_LOGICAL_AND); mcheck2->calculatesub(eo2, eo, false); mcheck = mcheck2; } if(mtryzero) { if(ct_comp == COMPARISON_NOT_EQUALS) mtryzero->add_nocopy(mcheck, OPERATION_LOGICAL_AND); else mtryzero->add_nocopy(mcheck, OPERATION_LOGICAL_OR); } else { mtryzero = mcheck; } } } if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(CHILD(0)[i].representsNegative()) { switch(ct_comp) { case COMPARISON_LESS: {ct_comp = COMPARISON_GREATER; break;} case COMPARISON_GREATER: {ct_comp = COMPARISON_LESS; break;} case COMPARISON_EQUALS_LESS: {ct_comp = COMPARISON_EQUALS_GREATER; break;} case COMPARISON_EQUALS_GREATER: {ct_comp = COMPARISON_EQUALS_LESS; break;} default: {} } } else if(!CHILD(0)[i].representsNonNegative()) { if(mchecknegative) { mchecknegative->multiply(CHILD(0)[i]); } else { mchecknegative = new MathStructure(CHILD(0)[i]); } } } if(zero1 != 1) { CHILD(1).calculateDivide(CHILD(0)[i], eo2); CHILD_UPDATED(1); } CHILD(0).delChild(i + 1); b = true; } } if(!b && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) && CHILD(0).size() >= 2) { // a*x*b^(c*x)=d => x=lambertw(c*d*ln(b)/a)/(c*ln(b)) if(CALCULATOR->aborted()) { set(mbak); if(mcheckmulti) mcheckmulti->unref(); if(mtryzero) mcheckmulti->unref(); if(mchecknegative) mcheckmulti->unref(); if(mchecknonzeropow) mcheckmulti->unref(); return false; } size_t i_px = 0, i_mpx = 0; MathStructure *mvar = NULL; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i].isPower() && CHILD(0)[i][1].contains(x_var) && !CHILD(0)[i][0].contains(x_var)) { if(CHILD(0)[i][1].isMultiplication()) { for(size_t i2 = 0; i2 < CHILD(0)[i][1].size(); i2++) { if(CHILD(0)[i][1][i2].contains(x_var)) { if(mvar) { mvar = NULL; break; } else { mvar = &CHILD(0)[i][1][i2]; i_mpx = i2; i_px = i; } } } } else { mvar = &CHILD(0)[i][1]; i_px = i; } break; } } if(mvar) { size_t i_x = 0; bool found_mvar = false; for(size_t i = 0; i < CHILD(0).size(); i++) { if(i != i_px) { if(CHILD(0)[i].contains(x_var)) { if(!found_mvar && CHILD(0)[i].equals(*mvar)) { found_mvar = true; i_x = i; } else { found_mvar = false; break; } } } } if(found_mvar) { MathStructure mln(CALCULATOR->f_ln, &CHILD(0)[i_px][0], NULL); if(mln.calculateFunctions(eo)) mln.calculatesub(eo2, eo, true); MathStructure *marg = NULL; MathStructure m_c(1, 1, 0); if(mln.representsNonZero()) { marg = new MathStructure(mln); if(CHILD(0)[i_px][1].isMultiplication()) { m_c = CHILD(0)[i_px][1]; m_c.delChild(i_mpx + 1, true); } if(!m_c.representsNonZero()) {marg->unref(); marg = NULL;} else if(!m_c.isOne()) marg->calculateMultiply(m_c, eo2); } if(marg) { marg->calculateMultiply(CHILD(1), eo2); if(CHILD(0).size() > 2) { marg->multiply(CHILD(0)); marg->last().delChild(i_x + 1); marg->last().delChild(i_px + (i_px < i_x ? 1 : 0), true); if(!marg->last().representsNonZero()) { marg->unref(); marg = NULL; } else { marg->last().calculateRaise(nr_minus_one, eo2); marg->calculateMultiplyLast(eo2); } } } if(marg && mvar->representsNonComplex() && CHILD(0)[i_px][0].representsPositive()) { if(mcheckmulti) mcheckmulti->unref(); if(mtryzero) mcheckmulti->unref(); if(mchecknegative) mcheckmulti->unref(); if(mchecknonzeropow) mcheckmulti->unref(); if(marg->representsComplex()) { marg->unref(); if(ct_comp == COMPARISON_EQUALS) clear(true); else set(1, 1, 0, true); return 1; } MathStructure *mreq1 = NULL; MathStructure *marg2 = NULL; MathStructure *mreq2 = NULL; if(!marg->representsNonNegative()) { mreq1 = new MathStructure(*marg); mreq2 = new MathStructure(*marg); marg2 = new MathStructure(*marg); marg2->transform(CALCULATOR->f_lambert_w); marg2->addChild(m_minus_one); if(marg2->calculateFunctions(eo)) marg2->calculatesub(eo2, eo, true); if(!m_c.isOne()) marg2->calculateDivide(m_c, eo2); marg2->calculateDivide(mln, eo2); mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, CALCULATOR->v_e); mreq1->last().calculateRaise(m_minus_one, eo2); mreq1->last().calculateNegate(eo2); mreq1->childUpdated(2); mreq1->isolate_x(eo2, eo); mreq2->transform(ct_comp == COMPARISON_EQUALS ? COMPARISON_EQUALS_LESS : COMPARISON_GREATER, m_zero); mreq2->isolate_x(eo2, eo); marg2->transform(ct_comp, *mvar); marg2->swapChildren(1, 2); marg2->isolate_x_sub(eo, eo2, x_var, morig); marg2->add(*mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); marg2->add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); marg2->calculatesub(eo2, eo, false); } marg->transform(CALCULATOR->f_lambert_w); marg->addChild(m_zero); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); if(!m_c.isOne()) marg->calculateDivide(m_c, eo2); marg->calculateDivide(mln, eo2); setChild_nocopy(marg, 2, true); mvar->ref(); CHILD(0).clear(true); setChild_nocopy(mvar, 1, true); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); if(mreq1) { add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } if(marg2) { add_nocopy(marg2, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } return true; } else if(marg) { if(mcheckmulti) mcheckmulti->unref(); if(mtryzero) mcheckmulti->unref(); if(mchecknegative) mcheckmulti->unref(); if(mchecknonzeropow) mcheckmulti->unref(); marg->transform(CALCULATOR->f_lambert_w); marg->addChild(CALCULATOR->v_n); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); if(!m_c.isOne()) marg->calculateDivide(m_c, eo2); marg->calculateDivide(mln, eo2); setChild_nocopy(marg, 2, true); mvar->ref(); CHILD(0).clear(true); setChild_nocopy(mvar, 1, true); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); return true; } } } if(CHILD(0).size() == 2) { // x*ln(x)=a => e^lambertw(a) bool b_swap = false; if(CHILD(0)[0].isFunction() && CHILD(0)[0].function() == CALCULATOR->f_ln && CHILD(0)[0].size() == 1) { CHILD(0).swapChildren(1, 2); b_swap = true; } if(CHILD(0)[1].isFunction() && CHILD(0)[1].function() == CALCULATOR->f_ln && CHILD(0)[1].size() == 1) { MathStructure mmul(1, 1, 0), mexp(1, 1, 0); mvar = NULL; if(CHILD(0)[0] == CHILD(0)[1][0]) { mvar = &CHILD(0)[0]; } else if(CHILD(0)[0].isPower() && CHILD(0)[0][0] == CHILD(0)[1][0]) { mexp = CHILD(0)[0][1]; mvar = &CHILD(0)[0][0]; } else { if(get_multiplier(CHILD(0)[1][0], CHILD(0)[0], mmul)) { mvar = &CHILD(0)[0]; } else if(CHILD(0)[0].isPower() && get_multiplier(CHILD(0)[1][0], CHILD(0)[0][0], mmul)) { mexp = CHILD(0)[0][1]; mvar = &CHILD(0)[0][0]; } } if(mvar && mexp.isInteger() && (mexp.number().isOne() || mexp.number().isTwo()) && mmul.representsNonZero() && !mmul.contains(x_var)) { if(mcheckmulti) mcheckmulti->unref(); if(mtryzero) mcheckmulti->unref(); if(mchecknegative) mcheckmulti->unref(); if(mchecknonzeropow) mcheckmulti->unref(); MathStructure *marg; if(mexp.isOne() || mmul.isOne()) { marg = new MathStructure(CHILD(1)); if(!mmul.isOne()) marg->calculateMultiply(mmul, eo2); else if(!mexp.isOne()) marg->calculateMultiply(mexp, eo2); } else { marg = new MathStructure(mmul); marg->calculateRaise(mexp, eo2); marg->calculateMultiply(CHILD(1), eo2); marg->calculateMultiply(mexp, eo2); } if(mvar->representsNonComplex()) { MathStructure *mreq1 = NULL; MathStructure *marg2 = NULL; MathStructure *mreq2 = NULL; if(!marg->representsPositive()) { mreq1 = new MathStructure(*marg); mreq2 = new MathStructure(*marg); marg2 = new MathStructure(*marg); marg2->transform(CALCULATOR->f_lambert_w); marg2->addChild(m_minus_one); if(marg2->calculateFunctions(eo)) marg2->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg2->calculateDivide(mexp, eo2); marg2->transform(STRUCT_POWER); marg2->insertChild(CALCULATOR->v_e, 1); (*marg2)[0].calculatesub(eo2, eo, true); marg2->calculateRaiseExponent(eo2); if(!mmul.isOne()) marg2->calculateDivide(mmul, eo2); mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, CALCULATOR->v_e); mreq1->last().calculateRaise(m_minus_one, eo2); mreq1->last().calculateNegate(eo2); mreq1->childUpdated(2); mreq1->isolate_x(eo2, eo); mreq2->transform(ct_comp == COMPARISON_EQUALS ? COMPARISON_EQUALS_LESS : COMPARISON_GREATER, m_zero); mreq2->isolate_x(eo2, eo); marg2->transform(ct_comp, *mvar); marg2->swapChildren(1, 2); marg2->isolate_x_sub(eo, eo2, x_var, morig); marg2->add(*mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); marg2->add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); marg2->calculatesub(eo2, eo, false); } marg->transform(CALCULATOR->f_lambert_w); marg->addChild(m_zero); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg->calculateDivide(mexp, eo2); CHILD(0).setToChild(1, true); if(!mexp.isOne()) CHILD(0).setToChild(1, true); CHILD(1).set(CALCULATOR->v_e); CHILD(1).raise_nocopy(marg); CHILD(1).calculateRaiseExponent(eo2); if(!mmul.isOne()) CHILD(1).calculateDivide(mmul, eo2); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); if(mreq1) { add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } if(marg2) { add_nocopy(marg2, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } } else { if(!mexp.isOne()) marg->calculateMultiply(mexp, eo2); if(!mmul.isOne()) marg->calculateDivide(mmul, eo2); MathStructure *marg2 = new MathStructure(*marg); MathStructure *marg3 = new MathStructure(*marg); marg2->transform(CALCULATOR->f_lambert_w); marg2->addChild(m_minus_one); if(marg2->calculateFunctions(eo)) marg2->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg2->calculateDivide(mexp, eo2); marg2->transform(STRUCT_POWER); marg2->insertChild(CALCULATOR->v_e, 1); (*marg2)[0].calculatesub(eo2, eo, true); marg2->calculateRaiseExponent(eo2); if(!mmul.isOne()) marg2->calculateDivide(mmul, eo2); marg3->transform(CALCULATOR->f_lambert_w); marg3->addChild(m_one); if(marg3->calculateFunctions(eo)) marg3->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg3->calculateDivide(mexp, eo2); marg3->transform(STRUCT_POWER); marg3->insertChild(CALCULATOR->v_e, 1); (*marg3)[0].calculatesub(eo2, eo, true); marg3->calculateRaiseExponent(eo2); if(!mmul.isOne()) marg3->calculateDivide(mmul, eo2); marg2->transform(ct_comp, *mvar); marg2->swapChildren(1, 2); marg2->isolate_x_sub(eo, eo2, x_var, morig); marg3->transform(ct_comp, *mvar); marg3->swapChildren(1, 2); marg3->isolate_x_sub(eo, eo2, x_var, morig); marg->transform(CALCULATOR->f_lambert_w); marg->addChild(m_zero); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg->calculateDivide(mexp, eo2); CHILD(0).setToChild(1, true); if(!mexp.isOne()) CHILD(0).setToChild(1, true); CHILD(1).set(CALCULATOR->v_e); CHILD(1).raise_nocopy(marg); CHILD(1).calculateRaiseExponent(eo2); if(!mmul.isOne()) CHILD(1).calculateDivide(mmul, eo2); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(marg2, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); add_nocopy(marg3, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); } return true; } } if(b_swap) CHILD(0).swapChildren(1, 2); } } if(b) { if(CHILD(0).size() == 1) { CHILD(0).setToChild(1); } if((ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) && CHILD(1).contains(x_var)) { CHILD(0).calculateSubtract(CHILD(1), eo2); CHILD(1).clear(); } if(mchecknegative) { MathStructure *mneg = new MathStructure(*this); switch(ct_comp) { case COMPARISON_LESS: {mneg->setComparisonType(COMPARISON_GREATER); break;} case COMPARISON_GREATER: {mneg->setComparisonType(COMPARISON_LESS); break;} case COMPARISON_EQUALS_LESS: {mneg->setComparisonType(COMPARISON_EQUALS_GREATER); break;} case COMPARISON_EQUALS_GREATER: {mneg->setComparisonType(COMPARISON_EQUALS_LESS); break;} default: {} } isolate_x_sub(eo, eo2, x_var, morig); //mneg->isolate_x_sub(eo, eo2, x_var); mchecknegative->add(m_zero, OPERATION_GREATER); add(*mchecknegative, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) calculatesub(eo2, eo, false); //LAST.isolate_x(eo2, eo); mchecknegative->setComparisonType(COMPARISON_LESS); mchecknegative->isolate_x(eo2, eo); mneg->add_nocopy(mchecknegative, OPERATION_LOGICAL_AND, true); mneg->calculatesub(eo2, eo, false); add_nocopy(mneg, OPERATION_LOGICAL_OR, true); calculatesub(eo2, eo, false); } else { isolate_x_sub(eo, eo2, x_var, morig); } if(mcheckmulti) { mcheckmulti->calculatesub(eo2, eo, false); if(ct_comp == COMPARISON_NOT_EQUALS) { add_nocopy(mcheckmulti, OPERATION_LOGICAL_OR, true); } else { add_nocopy(mcheckmulti, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) } calculatesub(eo2, eo, false); } if(mchecknonzeropow) { mchecknonzeropow->calculatesub(eo2, eo, false); if(ct_comp == COMPARISON_NOT_EQUALS) { add_nocopy(mchecknonzeropow, OPERATION_LOGICAL_OR, true); } else { add_nocopy(mchecknonzeropow, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) } calculatesub(eo2, eo, false); } if(mtryzero) { mtryzero->calculatesub(eo2, eo, false); if(ct_comp == COMPARISON_NOT_EQUALS) { add_nocopy(mtryzero, OPERATION_LOGICAL_AND, true); SWAP_CHILDREN(0, SIZE - 1) } else { add_nocopy(mtryzero, OPERATION_LOGICAL_OR, true); } calculatesub(eo2, eo, false); } return true; } if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { // x*(x+a)^(1/b)=c => (x*(x+a)^(1/b))^b=c^b Number nrexp; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CALCULATOR->aborted()) return false; if(CHILD(0)[i].isPower() && CHILD(0)[i][1].isNumber() && CHILD(0)[i][1].number().isRational()) { if(!CHILD(0)[i][1].number().isInteger()) { if(nrexp.isZero()) nrexp = CHILD(0)[i][1].number().denominator(); else nrexp.lcm(CHILD(0)[i][1].number().denominator()); } } else if(CHILD(0)[i].isFunction() && CHILD(0)[i].function() == CALCULATOR->f_root && VALID_ROOT(CHILD(0)[i])) { if(nrexp.isZero()) nrexp = CHILD(0)[i][1].number(); else nrexp.lcm(CHILD(0)[i][1].number()); } else if(CHILD(0)[i] != x_var && !(CHILD(0)[i].isFunction() && CHILD(0)[i].function() == CALCULATOR->f_abs && CHILD(0)[i].size() == 1 && CHILD(0)[i][0].representsReal(true))) { nrexp.clear(); break; } } if(!nrexp.isZero()) { MathStructure mtest(*this); if(mtest[0].calculateRaise(nrexp, eo2)) { mtest[1].calculateRaise(nrexp, eo2); mtest.childrenUpdated(); if(mtest.isolate_x(eo2, eo, x_var)) { if(test_comparisons(*this, mtest, x_var, eo) >= 0) { set(mtest); return true; } } } } } if(!eo2.expand) break; // abs(x)*x=a => -x*x=a || x*x=a; sgn(x)*x=a => -1*x=a || 0*x=a || 1*x=a if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { MathStructure *m = find_abs_sgn(CHILD(0), x_var); if(m && m->function() == CALCULATOR->f_abs) { MathStructure mabs(*m); ComparisonType cmp_type = ct_comp; MathStructure *malt = new MathStructure(*this); MathStructure mabs_minus(mabs[0]); mabs_minus.calculateNegate(eo2); (*malt)[0].replace(mabs, mabs_minus, mabs.containsInterval()); (*malt)[0].calculatesub(eo2, eo, true); MathStructure *mcheck = new MathStructure(mabs[0]); mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_EQUALS_GREATER : OPERATION_LESS); mcheck->isolate_x_sub(eo, eo2, x_var); malt->isolate_x_sub(eo, eo2, x_var); malt->add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); malt->calculatesub(eo2, eo, false); mcheck = new MathStructure(mabs[0]); CHILD(0).replace(mabs, mabs[0], mabs.containsInterval()); CHILD(0).calculatesub(eo2, eo, true); mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LESS : OPERATION_EQUALS_GREATER); mcheck->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var); add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); add_nocopy(malt, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); calculatesub(eo2, eo, false); return true; } else if(m && m->function() == CALCULATOR->f_signum) { MathStructure mabs(*m); ComparisonType cmp_type = ct_comp; MathStructure *malt = new MathStructure(*this); (*malt)[0].replace(mabs, m_minus_one, mabs.containsInterval()); (*malt)[0].calculatesub(eo2, eo, true); MathStructure *mcheck = new MathStructure(mabs[0]); mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_EQUALS_GREATER : OPERATION_LESS); mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? ((*m)[1].isMinusOne() ? OPERATION_GREATER : OPERATION_EQUALS_GREATER) : ((*m)[1].isMinusOne() ? OPERATION_EQUALS_LESS : OPERATION_LESS)); mcheck->isolate_x_sub(eo, eo2, x_var); malt->isolate_x_sub(eo, eo2, x_var); malt->add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); malt->calculatesub(eo2, eo, false); MathStructure *malt0 = NULL; if(!(*m)[1].isOne() && !(*m)[1].isMinusOne()) { malt0 = new MathStructure(*this); (*malt0)[0].replace(mabs, (*m)[1], mabs.containsInterval()); (*malt0)[0].calculatesub(eo2, eo, true); mcheck = new MathStructure(mabs[0]); mcheck->add((*m)[1], cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_NOT_EQUALS : OPERATION_EQUALS); mcheck->isolate_x_sub(eo, eo2, x_var); malt0->isolate_x_sub(eo, eo2, x_var); malt0->add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); malt0->calculatesub(eo2, eo, false); } mcheck = new MathStructure(mabs[0]); CHILD(0).replace(mabs, m_one, mabs.containsInterval()); CHILD(0).calculatesub(eo2, eo, true); mcheck->add(m_zero, cmp_type == COMPARISON_NOT_EQUALS ? ((*m)[1].isOne() ? OPERATION_LESS : OPERATION_EQUALS_LESS) : ((*m)[1].isOne() ? OPERATION_EQUALS_GREATER : OPERATION_GREATER)); mcheck->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var); add_nocopy(mcheck, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); add_nocopy(malt, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); if(malt0) add_nocopy(malt0, cmp_type == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); calculatesub(eo2, eo, false); return true; } } // Try factorization if(!CHILD(1).isZero() && (!morig || !equals(*morig))) { MathStructure mtest(*this); mtest[0].calculateSubtract(CHILD(1), eo2); mtest[1].clear(); mtest.childrenUpdated(); if(mtest[0].factorize(eo2, false, false, 0, false, false, NULL, m_undefined, false, false, 3) && !(mtest[0].isMultiplication() && mtest[0].size() == 2 && (mtest[0][0].isNumber() || mtest[0][0] == CHILD(1) || mtest[0][1] == CHILD(1)))) { mtest.childUpdated(1); if(mtest.isolate_x_sub(eo, eo2, x_var, this)) { set_nocopy(mtest); return true; } } } break; } case STRUCT_POWER: { if(CHILD(0)[0].contains(x_var)) { if(CHILD(0)[1].contains(x_var)) { if((ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) && CHILD(1).representsNonZero()) { // x^(a*x)=b => x=e^(lambertw(ln(x)/a)) MathStructure mmul(1, 1, 0); const MathStructure *mvar = get_power_term(CHILD(0)[1], CHILD(0)[0]); if(!mvar || !get_multiplier(CHILD(0)[1], *mvar, mmul) || mmul.contains(x_var) || !mmul.representsNonZero()) return false; MathStructure mexp(1, 1, 0); if(mvar->isPower() && *mvar != CHILD(0)[0]) mexp = (*mvar)[1]; if(!mexp.representsPositive()) return false; if(mmul.isOne() && mexp.isOne() && CHILD(0)[0].representsNonComplex()) { if(CHILD(1).number().isInteger()) { if(CHILD(1).number().isOne()) { CHILD(0).setToChild(1, true); return true; } else if(CHILD(1).number().isMinusOne()) { CHILD(0).setToChild(1, true); return true; } else if(CHILD(1).number() == 4) { CHILD(1).set(2, 1, 0, true); CHILD(0).setToChild(1, true); return true; } else if(CHILD(1).number() == 27) { CHILD(1).set(3, 1, 0, true); CHILD(0).setToChild(1, true); return true; } else if(CHILD(1).number() == 256) { CHILD(1).set(4, 1, 0, true); CHILD(0).setToChild(1, true); return true; } else if(CHILD(1).number() == 3125) { CHILD(1).set(5, 1, 0, true); CHILD(0).setToChild(1, true); return true; } else if(CHILD(1).number() == 46656) { CHILD(1).set(6, 1, 0, true); CHILD(0).setToChild(1, true); return true; } else if(CHILD(1).number() == 823543) { CHILD(1).set(7, 1, 0, true); CHILD(0).setToChild(1, true); return true; } } else if(CHILD(1).number().numeratorIsOne()) { Number nr_den = CHILD(1).number().denominator(); if(nr_den == 4) { CHILD(1).set(-2, 1, 0, true); CHILD(0).setToChild(1, true); return true; } else if(nr_den == 256) { CHILD(1).set(-4, 1, 0, true); CHILD(0).setToChild(1, true); return true; } else if(nr_den == 46656) { CHILD(1).set(-6, 1, 0, true); CHILD(0).setToChild(1, true); return true; } } else if(CHILD(1).number().numeratorIsMinusOne()) { Number nr_den = CHILD(1).number().denominator(); if(nr_den == 27) { CHILD(1).set(-3, 1, 0, true); CHILD(0).setToChild(1, true); return true; } else if(nr_den == 3125) { CHILD(1).set(-5, 1, 0, true); CHILD(0).setToChild(1, true); return true; } else if(nr_den == 823543) { CHILD(1).set(-7, 1, 0, true); CHILD(0).setToChild(1, true); return true; } } } MathStructure *marg = new MathStructure(CALCULATOR->f_ln, &CHILD(1), NULL); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); if(CHILD(1).representsPositive() && CHILD(0)[0].representsNonComplex()) { if(!mexp.isOne()) marg->calculateMultiply(mexp, eo2); if(!mmul.isOne()) marg->calculateDivide(mmul, eo2); MathStructure *mreq1 = NULL; MathStructure *marg2 = NULL; MathStructure *mreq2 = NULL; if(!marg->representsNonNegative()) { mreq1 = new MathStructure(*marg); mreq2 = new MathStructure(*marg); marg2 = new MathStructure(*marg); marg2->transform(CALCULATOR->f_lambert_w); marg2->addChild(m_minus_one); if(marg2->calculateFunctions(eo)) marg2->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg2->calculateDivide(mexp, eo2); marg2->transform(STRUCT_POWER); marg2->insertChild(CALCULATOR->v_e, 1); (*marg2)[0].calculatesub(eo2, eo, true); marg2->calculateRaiseExponent(eo2); mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, CALCULATOR->v_e); mreq1->last().calculateRaise(m_minus_one, eo2); mreq1->last().calculateNegate(eo2); mreq1->childUpdated(2); mreq1->isolate_x(eo2, eo); mreq2->transform(ct_comp == COMPARISON_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, m_zero); mreq2->isolate_x(eo2, eo); marg2->transform(ct_comp, CHILD(0)[0]); marg2->swapChildren(1, 2); marg2->isolate_x_sub(eo, eo2, x_var, morig); marg2->add(*mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); marg2->add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); marg2->calculatesub(eo2, eo, false); } marg->transform(CALCULATOR->f_lambert_w); marg->addChild(m_zero); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg->calculateDivide(mexp, eo2); CHILD(0).setToChild(1, true); CHILD(1).set(CALCULATOR->v_e); CHILD(1).raise_nocopy(marg); CHILD(1).calculateRaiseExponent(eo2); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); if(mreq1) { add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } if(marg2) { add_nocopy(marg2, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } } else { marg->add(nr_one_i); marg->last().multiply(nr_two); marg->last().multiply(CALCULATOR->v_pi, true); marg->last().multiply(CALCULATOR->v_n, true); marg->evalSort(true); MathStructure *mreq1 = new MathStructure(*marg); if(!mexp.isOne()) marg->calculateMultiply(mexp, eo2); if(!mmul.isOne()) marg->calculateDivide(mmul, eo2); MathStructure *marg2 = new MathStructure(*marg); MathStructure *marg3 = new MathStructure(*marg); marg2->transform(CALCULATOR->f_lambert_w); marg2->addChild(m_minus_one); if(marg2->calculateFunctions(eo)) marg2->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg2->calculateDivide(mexp, eo2); marg2->transform(STRUCT_POWER); marg2->insertChild(CALCULATOR->v_e, 1); (*marg2)[0].calculatesub(eo2, eo, true); marg2->calculateRaiseExponent(eo2); marg3->transform(CALCULATOR->f_lambert_w); marg3->addChild(m_one); if(marg3->calculateFunctions(eo)) marg3->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg3->calculateDivide(mexp, eo2); marg3->transform(STRUCT_POWER); marg3->insertChild(CALCULATOR->v_e, 1); (*marg3)[0].calculatesub(eo2, eo, true); marg3->calculateRaiseExponent(eo2); mreq1->transform(ct_comp == COMPARISON_EQUALS ? COMPARISON_NOT_EQUALS : COMPARISON_EQUALS, m_zero); mreq1->isolate_x(eo2, eo); MathStructure *mreq2 = new MathStructure(*mreq1); marg2->transform(ct_comp, CHILD(0)[0]); marg2->swapChildren(1, 2); marg2->isolate_x_sub(eo, eo2, x_var, morig); marg2->add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); marg2->calculatesub(eo2, eo, false); marg3->transform(ct_comp, CHILD(0)[0]); marg3->swapChildren(1, 2); marg3->isolate_x_sub(eo, eo2, x_var, morig); marg3->add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); marg3->calculatesub(eo2, eo, false); marg->transform(CALCULATOR->f_lambert_w); marg->addChild(m_zero); if(marg->calculateFunctions(eo)) marg->calculatesub(eo2, eo, true); if(!mexp.isOne()) marg->calculateDivide(mexp, eo2); CHILD(0).setToChild(1, true); CHILD(1).set(CALCULATOR->v_e); CHILD(1).raise_nocopy(marg); CHILD(1).calculateRaiseExponent(eo2); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(marg2, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); add_nocopy(marg3, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); } return true; } } else if(CHILD(0)[1].isNumber() && CHILD(0)[1].number().isRational()) { // x^a=b if(!CHILD(0)[1].number().isInteger() && !CHILD(0)[1].number().isFraction() && !CHILD(0).representsNonComplex(true)) { MathStructure mvar(CHILD(0)[0]); mvar.raise(CHILD(0)[1].number().numerator()); UnknownVariable *var = new UnknownVariable("", string(LEFT_PARENTHESIS) + format_and_print(mvar) + RIGHT_PARENTHESIS); var->setInterval(mvar); var->ref(); MathStructure mu(var); MathStructure mtest(mu); mtest.raise(CHILD(0)[1]); mtest[1].number().divide(CHILD(0)[1].number().numerator()); mtest.transform(ct_comp, CHILD(1)); if(mtest.isolate_x_sub(eo, eo2, mu)) { mtest.replace(mu, mvar); if(mtest.isolate_x(eo2, eo, x_var) && test_comparisons(*this, mtest, x_var, eo) >= 0) { var->destroy(); set(mtest, true); return true; } } var->destroy(); return false; } bool b_neg = CHILD(0)[1].number().isNegative(); bool b_nonzero = !CHILD(1).isZero() && CHILD(1).representsNonZero(true); if(b_neg && CHILD(1).isZero()) { if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { CHILD(0).setToChild(1); CHILD(1) = nr_plus_inf; CHILDREN_UPDATED MathStructure *malt = new MathStructure(*this); (*malt)[1] = nr_minus_inf; isolate_x_sub(eo, eo2, x_var, morig); malt->isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(malt, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR); calculatesub(eo, eo2, false); return true; } if(CHILD(0)[1].number().isInteger() && CHILD(0)[1].number().isEven()) { if(ct_comp == COMPARISON_EQUALS_LESS) { clear(true); return true; } ct_comp = COMPARISON_NOT_EQUALS; CHILD(1).clear(true); CHILD(0).setToChild(1); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); return true; } if(ct_comp == COMPARISON_EQUALS_GREATER) { ct_comp = COMPARISON_GREATER; } else if(ct_comp == COMPARISON_EQUALS_LESS) { ct_comp = COMPARISON_LESS; } CHILD(1).clear(true); CHILD(0).setToChild(1); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); return true; } else if(CHILD(1).isZero()) { if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS && CHILD(0)[1].number().isInteger() && CHILD(0)[1].number().isEven()) { if(ct_comp == COMPARISON_LESS) { clear(true); return true; } if(ct_comp == COMPARISON_EQUALS_LESS) { ct_comp = COMPARISON_EQUALS; CHILD(0).setToChild(1); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); return true; } if(ct_comp == COMPARISON_EQUALS_GREATER) { set(1, 1, 0, true); return true; } CHILD(0).setToChild(1); MathStructure *mneg = new MathStructure(*this); if(ct_comp == COMPARISON_GREATER) mneg->setComparisonType(COMPARISON_LESS); mneg->isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(mneg, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); } else { CHILD(0).setToChild(1); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); } return true; } else if(b_neg && ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(CHILD(0)[1].number().isMinusOne()) { CHILD(0).setToChild(1); } else { CHILD(0)[1].number().negate(); } MathStructure *mtest = new MathStructure(CHILD(0)); CHILD(1).set(1, 1, 0); CHILDREN_UPDATED MathStructure *malt = new MathStructure(*this); if(ct_comp == COMPARISON_EQUALS_GREATER) { ct_comp = COMPARISON_EQUALS_LESS; } else if(ct_comp == COMPARISON_GREATER) { ct_comp = COMPARISON_LESS; } else if(ct_comp == COMPARISON_EQUALS_LESS) { ct_comp = COMPARISON_EQUALS_GREATER; } else if(ct_comp == COMPARISON_LESS) { ct_comp = COMPARISON_GREATER; } isolate_x_sub(eo, eo2, x_var, morig); mtest->add(m_zero, OPERATION_GREATER); MathStructure *mtest_alt = new MathStructure(*mtest); mtest_alt->setComparisonType(COMPARISON_LESS); mtest->isolate_x_sub(eo, eo2, x_var); add_nocopy(mtest, OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); malt->isolate_x_sub(eo, eo2, x_var, morig); mtest_alt->isolate_x_sub(eo, eo2, x_var); malt->add_nocopy(mtest_alt, OPERATION_LOGICAL_AND); malt->calculatesub(eo2, eo, false); add_nocopy(malt, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); return true; } MathStructure mbak(*this); if(CHILD(0)[1].number().isMinusOne()) { CHILD(0).setToChild(1, true); CHILD(1).calculateRaise(m_minus_one, eo2); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); } else if(CHILD(0)[1].number().isInteger()) { bool b_real = CHILD(0)[0].representsNonComplex(true); bool b_complex = !b_real && CHILD(0)[0].representsComplex(true); bool warn_complex = false; bool check_complex = false; if(CHILD(0)[1].number().isEven()) { if(!CHILD(1).representsNonNegative(true)) { if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(CHILD(1).representsNegative(true)) { if(ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_LESS) clear(true); else set(1, 1, 0, true); return true; } return false; } if(b_real && (CHILD(1).representsNegative(true) || CHILD(1).representsComplex(true))) { if(ct_comp == COMPARISON_EQUALS) { clear(true); } else if(ct_comp == COMPARISON_NOT_EQUALS) { set(1, 1, 0, true); } return true; } } } bool b_set = false; if(b_neg) CHILD(0)[1].number().negate(); if(CHILD(0)[1].number().isTwo()) { CHILD(1).raise(CHILD(0)[1].number()); CHILD(1)[1].number().recip(); if(b_neg) CHILD(1)[1].number().negate(); CHILD(1).calculateRaiseExponent(eo2); CHILDREN_UPDATED } else if(!b_real && CHILD(0)[1].number() == 4 && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { CHILD(1).raise(CHILD(0)[1].number()); CHILD(1)[1].number().recip(); if(b_neg) CHILD(1)[1].number().negate(); CHILD(1).calculateRaiseExponent(eo2); CHILD(0).setToChild(1); CHILDREN_UPDATED MathStructure *malt1 = new MathStructure(*this); MathStructure *malt2 = new MathStructure(*this); MathStructure *malt3 = new MathStructure(*this); (*malt1)[1].calculateNegate(eo2); (*malt2)[1].calculateMultiply(m_one_i, eo2); (*malt3)[1].calculateMultiply(nr_minus_i, eo2); malt1->childUpdated(2); malt2->childUpdated(2); malt3->childUpdated(2); malt1->isolate_x_sub(eo, eo2, x_var, morig); malt2->isolate_x_sub(eo, eo2, x_var, morig); malt3->isolate_x_sub(eo, eo2, x_var, morig); isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(malt1, ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR); add_nocopy(malt2, ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); add_nocopy(malt3, ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); calculatesub(eo2, eo, false); b_set = true; } else if(!b_real && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { if(CHILD(0)[1].number() > 20) return false; MathStructure mdeg(CHILD(0)[1]); Number marg_pi; MathStructure marg; if(CHILD(1).representsNegative(true)) { marg_pi.set(1, 1, 0); } else if(!CHILD(1).representsNegative(true)) { if(CHILD(1).isNumber() && !CHILD(1).number().hasRealPart()) { if(CHILD(1).number().imaginaryPartIsNegative()) marg_pi.set(-1, 2, 0); else marg_pi.set(1, 2, 0); } else { marg.set(CALCULATOR->f_arg, &CHILD(1), NULL); marg.calculateFunctions(eo); switch(eo2.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {marg.multiply(Number(1, 180, 0)); marg.multiply(CALCULATOR->v_pi); break;} case ANGLE_UNIT_GRADIANS: {marg.multiply(Number(1, 200, 0)); marg.multiply(CALCULATOR->v_pi); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) marg /= CALCULATOR->getRadUnit();} } marg.calculatesub(eo2, eo, true); } } MathStructure minv(mdeg); minv.number().recip(); MathStructure mmul(CALCULATOR->f_abs, &CHILD(1), NULL); mmul.calculateFunctions(eo); mmul.calculateRaise(minv, eo2); Number nr_i; while(nr_i.isLessThan(mdeg.number())) { MathStructure mroot; if(CALCULATOR->aborted()) {set(mbak); return false;} MathStructure mexp; Number nexp; if(!nr_i.isZero()) { nexp.set(2, 1, 0); if(!nexp.multiply(nr_i)) {set(mbak); return false;} } b_set = false; if(!marg_pi.isZero()) { if(nexp.isZero()) nexp = marg_pi; else if(!nexp.add(marg_pi)) {set(mbak); return false;} if(!nexp.divide(mdeg.number())) {set(mbak); return false;} if(nexp.isInteger()) { mroot.set(mmul); if(nexp.isOdd()) { mroot.calculateNegate(eo2); } b_set = true; } else if(nexp.isRational() && nexp.denominatorIsTwo()) { if(!nexp.floor()) {set(mbak); return false;} mroot.set(mmul); if(nexp.isEven()) { mroot.calculateMultiply(nr_one_i, eo2); } else { mroot.calculateMultiply(nr_minus_i, eo2); } b_set = true; } if(!b_set) { mexp.set(nexp); mexp.multiply(CALCULATOR->v_pi); } } else { if(nexp.isZero()) { if(!marg.isZero()) { mexp.set(marg); mexp.multiply(minv); } } else { mexp.set(nexp); mexp.multiply(CALCULATOR->v_pi); if(!marg.isZero()) mexp.add(marg); mexp.multiply(minv); } } if(!b_set) { if(mexp.isZero()) { mroot.set(mmul); } else { mexp.multiply(m_one_i); mroot.set(CALCULATOR->v_e); mroot.raise(mexp); mroot.calculatesub(eo2, eo, true); mroot.calculateMultiply(mmul, eo2); } } if(b_neg) mroot.calculateRaise(m_minus_one, eo2); if(nr_i.isZero()) { CHILD(0).setToChild(1); CHILD(1) = mroot; isolate_x_sub(eo, eo2, x_var, morig); } else { MathStructure *malt = new MathStructure(mbak[0][0]); malt->add(mroot, mbak.comparisonType() == COMPARISON_NOT_EQUALS ? OPERATION_NOT_EQUALS : OPERATION_EQUALS); malt->isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(malt, mbak.comparisonType() == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR, true); } nr_i++; } calculatesub(eo2, eo, false); b_set = true; } else { if(b_complex) { warn_complex = true; } else if(!b_real) { check_complex = true; } CHILD(1).transform(STRUCT_FUNCTION, CHILD(0)[1]); CHILD(1).setFunction(CALCULATOR->f_root); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); if(b_neg) CHILD(1).calculateRaise(m_minus_one, eo2); childUpdated(2); } if(!b_set) { if(CHILD(0)[1].number().isEven()) { CHILD(0).setToChild(1); MathStructure *mneg = new MathStructure(*this); (*mneg)[1].calculateNegate(eo2); mneg->childUpdated(2); if(ct_comp == COMPARISON_LESS) mneg->setComparisonType(COMPARISON_GREATER); else if(ct_comp == COMPARISON_GREATER) mneg->setComparisonType(COMPARISON_LESS); else if(ct_comp == COMPARISON_EQUALS_LESS) mneg->setComparisonType(COMPARISON_EQUALS_GREATER); else if(ct_comp == COMPARISON_EQUALS_GREATER) mneg->setComparisonType(COMPARISON_EQUALS_LESS); mneg->isolate_x_sub(eo, eo2, x_var, morig); isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(mneg, ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); } else { CHILD(0).setToChild(1); isolate_x_sub(eo, eo2, x_var, morig); } } if(check_complex) { if(!isComparison() || CHILD(0) != x_var) { warn_complex = true; } MathStructure mtest(mbak[0][0]); if(!warn_complex && check_complex) { mtest.replace(x_var, CHILD(1)); if(mtest.representsNonComplex(true)) check_complex = false; if(mtest.representsComplex(true)) { warn_complex = true; } } if(!warn_complex && check_complex) { CALCULATOR->beginTemporaryStopMessages(); EvaluationOptions eo3 = eo; eo3.approximation = APPROXIMATION_APPROXIMATE; mtest.eval(eo3); if(CALCULATOR->endTemporaryStopMessages() || !mtest.representsReal(true)) { warn_complex = true; } } } if(warn_complex) CALCULATOR->error(false, _("Only one or two of the roots where calculated for %s."), format_and_print(mbak).c_str(), NULL); } else { MathStructure *mposcheck = NULL; bool b_test = false; if(!CHILD(1).representsNonNegative(true)) { if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(CHILD(1).representsNegative(true)) { if(ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_LESS) clear(true); else set(1, 1, 0, true); return true; } return false; } if(CHILD(1).representsNegative(true)) { if(ct_comp == COMPARISON_EQUALS) { clear(true); } else if(ct_comp == COMPARISON_NOT_EQUALS) { set(1, 1, 0, true); } return true; } if(CHILD(1).representsNonComplex(true)) { mposcheck = new MathStructure(CHILD(1)); mposcheck->add(m_zero, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LESS : OPERATION_EQUALS_GREATER); mposcheck->isolate_x_sub(eo, eo2, x_var); } else { b_test = true; mposcheck = new MathStructure(*this); } } CHILD(0)[1].number().recip(); CHILD(1).calculateRaise(CHILD(0)[1], eo); CHILD(0).setToChild(1); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); if(b_test) { if(test_comparisons(*mposcheck, *this, x_var, eo) < 0) { mposcheck->unref(); return false; } mposcheck->unref(); } else if(mposcheck) { add_nocopy(mposcheck, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } } if(b_neg && !b_nonzero) { MathStructure *mtest = new MathStructure(mbak[1]); mtest->add(m_zero, (mbak.comparisonType() == COMPARISON_NOT_EQUALS) ? OPERATION_EQUALS : OPERATION_NOT_EQUALS); mtest->isolate_x_sub(eo, eo2, x_var); add_nocopy(mtest, (mbak.comparisonType() == COMPARISON_NOT_EQUALS) ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); if(mbak.comparisonType() != COMPARISON_NOT_EQUALS && mbak.comparisonType() != COMPARISON_EQUALS) { MathStructure *malt = new MathStructure(mbak[0]); if(mbak[0][1].representsInteger() && mbak[0][1].representsEven()) { malt->add(m_zero, OPERATION_NOT_EQUALS); } else { malt->add(m_zero, (ct_comp == COMPARISON_EQUALS_GREATER || ct_comp == COMPARISON_GREATER) ? OPERATION_LESS : OPERATION_GREATER); } malt->isolate_x_sub(eo, eo2, x_var, morig); MathStructure *mtest2 = new MathStructure(mbak[1]); mtest2->add(m_zero, OPERATION_EQUALS); mtest2->isolate_x_sub(eo, eo2, x_var); malt->add_nocopy(mtest2, (mbak.comparisonType() == COMPARISON_NOT_EQUALS) ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); malt->calculatesub(eo2, eo, false); add_nocopy(malt, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); } } return true; } } else if(CHILD(0)[1].contains(x_var) && (!CHILD(0)[1].representsNonComplex() || (CHILD(0)[0].representsNonNegative() || (CHILD(0)[0].isNumber() && CHILD(0)[0].number().isNegative() && CHILD(1).isNumber())))) { // a^x=b => x=log(b, a) MathStructure *mtest = NULL, *m0 = NULL, *m1 = NULL; if(CHILD(0)[0].isOne()) return false; if((ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) && !CHILD(0)[0].representsNonZero()) { if(!CHILD(1).representsNonZero()) { MathStructure *mtest2 = NULL; if(!CHILD(1).isZero()) { mtest2 = new MathStructure(CHILD(1)); mtest2->transform(ct_comp, m_zero); mtest2->isolate_x(eo2, eo); } m0 = new MathStructure(CHILD(0)[1]); if(!m0->representsNonComplex(true)) { m0->transform(CALCULATOR->f_re); if(m0->calculateFunctions(eo)) m0->calculatesub(eo2, eo, true); } m0->transform(ct_comp == COMPARISON_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, m_zero); m0->isolate_x_sub(eo, eo2, x_var, morig); if(mtest2) { m0->add_nocopy(mtest2, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR); m0->calculatesub(eo2, eo, false); } if(CHILD(0)[0].isZero()) { set_nocopy(*m0, true); m0->unref(); return true; } MathStructure *mtest3 = new MathStructure(CHILD(0)[0]); mtest3->transform(ct_comp, m_zero); mtest3->isolate_x(eo2, eo); m0->add_nocopy(mtest3, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR); m0->calculatesub(eo2, eo, false); } mtest = new MathStructure(CHILD(0)[1]); mtest->transform(ct_comp == COMPARISON_EQUALS ? COMPARISON_NOT_EQUALS : COMPARISON_EQUALS, m_zero); mtest->isolate_x_sub(eo, eo2, x_var, morig); if(!CHILD(0)[0].isZero()) { MathStructure *mtest_b = new MathStructure(CHILD(0)[0]); mtest_b->transform(ct_comp == COMPARISON_EQUALS ? COMPARISON_NOT_EQUALS : COMPARISON_EQUALS, m_zero); mtest_b->isolate_x_sub(eo, eo2, x_var, morig); mtest->add_nocopy(mtest_b, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); mtest->calculatesub(eo2, eo, false); } } ComparisonResult cr1 = COMPARISON_RESULT_NOT_EQUAL; if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS) { cr1 = CHILD(0)[0].compare(m_one); if(cr1 == COMPARISON_RESULT_EQUAL) { ComparisonResult cr2 = CHILD(1).compare(m_one); if(cr2 == COMPARISON_RESULT_EQUAL) { if(ct_comp == COMPARISON_EQUALS) set(1, 1, 0, true); else clear(true); return true; } else if(COMPARISON_MIGHT_BE_EQUAL(cr2)) { m1 = new MathStructure(); m1->setType(STRUCT_COMPARISON); m1->setComparisonType(ct_comp); m1->addChild(CHILD(1)); m1->addChild(m_one); m1->isolate_x(eo2, eo); } } else if(COMPARISON_MIGHT_BE_EQUAL(cr1)) { ComparisonResult cr2 = CHILD(1).compare(m_one); if(cr2 == COMPARISON_RESULT_EQUAL) { m1 = new MathStructure(); m1->setType(STRUCT_COMPARISON); m1->setComparisonType(ct_comp); m1->addChild(CHILD(0)[0]); m1->addChild(m_one); m1->isolate_x(eo2, eo); } else if(COMPARISON_MIGHT_BE_EQUAL(cr2)) { m1 = new MathStructure(); m1->setType(STRUCT_COMPARISON); m1->setComparisonType(ct_comp); m1->addChild(CHILD(1)); m1->addChild(m_one); m1->isolate_x(eo2, eo); MathStructure *m1b = new MathStructure(); m1b->setType(STRUCT_COMPARISON); m1b->setComparisonType(ct_comp); m1b->addChild(CHILD(0)[0]); m1b->addChild(m_one); m1b->isolate_x(eo2, eo); m1->add_nocopy(m1b, ct_comp == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); m1->calculatesub(eo2, eo, false); } } } ComparisonType ct = ct_comp; if((ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { if(CHILD(0)[0].isMinusOne()) { if(CHILD(1).isOne() || CHILD(1).isMinusOne()) { bool b_m1 = CHILD(1).isMinusOne(); CHILD(0).setToChild(2, true); CHILD(1).set(2, 1, 0, true); CHILD(1) *= CALCULATOR->v_n; if(b_m1) CHILD(1) += m_one; CHILD(1).evalSort(false); fix_n_multiple(*this, eo2, eo, x_var); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); return true; } } else if(CHILD(1).isOne() && CHILD(0)[1].representsNonComplex()) { CHILD(0).setToChild(2, true); CHILD(1).clear(true); isolate_x_sub(eo, eo2, x_var, morig); if(m1) { add_nocopy(m1, ct == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } if(mtest) { add_nocopy(mtest, ct == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } return true; } } if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(CHILD(0)[0].isNumber() && CHILD(0)[0].number().isReal() && CHILD(0)[0].number().isPositive()) { if(CHILD(1).representsNegative()) { if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) { set(1, 1, 0, true); } else { clear(true); } return true; } if(CHILD(0)[0].number().isFraction()) { switch(ct_comp) { case COMPARISON_LESS: {ct_comp = COMPARISON_GREATER; break;} case COMPARISON_GREATER: {ct_comp = COMPARISON_LESS; break;} case COMPARISON_EQUALS_LESS: {ct_comp = COMPARISON_EQUALS_GREATER; break;} case COMPARISON_EQUALS_GREATER: {ct_comp = COMPARISON_EQUALS_LESS; break;} default: {} } } } else if(CHILD(0)[0].isZero()) { bool b_clear = false, b_gz = false; switch(ct_comp) { case COMPARISON_LESS: {b_gz = CHILD(1).representsPositive(); b_clear = !b_gz && CHILD(1).representsNonPositive(); break;} case COMPARISON_GREATER: {b_gz = CHILD(1).representsNegative(); b_clear = !b_gz && CHILD(1).representsNonNegative(); break;} case COMPARISON_EQUALS_LESS: {b_gz = CHILD(1).representsNonNegative(); b_clear = !b_gz && CHILD(1).representsNegative(); break;} case COMPARISON_EQUALS_GREATER: {b_gz = CHILD(1).representsNonPositive(); b_clear = !b_gz && CHILD(1).representsPositive(); break;} default: {} } if(b_clear) { clear(true); return true; } else if(b_gz) { ct_comp = COMPARISON_GREATER; CHILD(1).clear(true); CHILD(0).setToChild(2, true); if(!CHILD(0).representsNonComplex(true)) { CHILD(0).transform(CALCULATOR->f_re); if(CHILD(0).calculateFunctions(eo)) CHILD(0).calculatesub(eo2, eo, true); } CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); return true; } else { return false; } } else { return false; } } MathStructure msave(CHILD(1)); if(CHILD(0)[1].representsNonComplex()) { if(CHILD(0)[0].representsNegative()) { MathStructure mtest2(CALCULATOR->f_logn, &msave, &CHILD(0)[0], NULL); mtest2[1].calculateNegate(eo2); mtest2.childUpdated(2); if(mtest2.calculateFunctions(eo)) mtest2.calculatesub(eo2, eo, true); if(mtest) mtest->unref(); if(m0) m0->unref(); mtest = NULL; if(!mtest2.isInteger()) return false; if(mtest2.number().isOdd()) { if(ct_comp == COMPARISON_NOT_EQUALS) set(1, 1, 0, true); else clear(true); return true; } CHILD(1).set(mtest2, true); } else { CHILD(1).set(CALCULATOR->f_logn, &msave, &CHILD(0)[0], NULL); bool b = CHILD(1).calculateFunctions(eo); if(b) CHILD(1).calculatesub(eo2, eo, true); } } else { CHILD(1).set(CALCULATOR->f_ln, &msave, NULL); CHILD(1) += nr_one_i; CHILD(1)[1] *= nr_two; CHILD(1)[1].multiply(CALCULATOR->v_pi, true); CHILD(1)[1].multiply(CALCULATOR->v_n, true); CHILD(1).divide_nocopy(new MathStructure(CALCULATOR->f_ln, &CHILD(0)[0], NULL)); CHILD(1).evalSort(true); bool b = CHILD(1).calculateFunctions(eo); if(b) CHILD(1).calculatesub(eo2, eo, true); } MathStructure *mn1 = NULL; if(COMPARISON_MIGHT_BE_EQUAL(cr1)) { mn1 = new MathStructure(); mn1->setType(STRUCT_COMPARISON); mn1->setComparisonType(ct == COMPARISON_EQUALS ? COMPARISON_NOT_EQUALS : COMPARISON_EQUALS); mn1->addChild(CHILD(0)[0]); mn1->addChild(m_one); mn1->isolate_x(eo2, eo); } CHILD(0).setToChild(2, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); if(mn1) { add_nocopy(mn1, ct == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } if(m1) { add_nocopy(m1, ct == COMPARISON_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } if(mtest) { add_nocopy(mtest, ct == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); if(m0) { addChild_nocopy(m0); } calculatesub(eo2, eo, false); } fix_n_multiple(*this, eo2, eo, x_var); return true; } break; } case STRUCT_FUNCTION: { if(CHILD(0).function() == CALCULATOR->f_root && VALID_ROOT(CHILD(0))) { if(CHILD(0)[0].contains(x_var)) { MathStructure *mposcheck = NULL; bool b_test = false; if(CHILD(0)[1].number().isEven() && !CHILD(1).representsNonNegative(true)) { if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) { if(CHILD(1).representsNegative(true)) { if(ct_comp == COMPARISON_EQUALS_LESS || ct_comp == COMPARISON_LESS) clear(true); else set(1, 1, 0, true); return true; } return false; } if(CHILD(1).representsNegative(true)) { if(ct_comp == COMPARISON_EQUALS) { clear(true); } else if(ct_comp == COMPARISON_NOT_EQUALS) { set(1, 1, 0, true); } return true; } if(CHILD(1).representsNonComplex(true)) { mposcheck = new MathStructure(CHILD(1)); mposcheck->add(m_zero, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LESS : OPERATION_EQUALS_GREATER); mposcheck->isolate_x_sub(eo, eo2, x_var); } else { b_test = true; mposcheck = new MathStructure(*this); } } CHILD(1).calculateRaise(CHILD(0)[1], eo); CHILD(0).setToChild(1); CHILDREN_UPDATED isolate_x_sub(eo, eo2, x_var, morig); if(b_test) { if(test_comparisons(*mposcheck, *this, x_var, eo) < 0) { mposcheck->unref(); return false; } mposcheck->unref(); } else if(mposcheck) { add_nocopy(mposcheck, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); calculatesub(eo2, eo, false); } return true; } } else if(CHILD(0).function() == CALCULATOR->f_ln && CHILD(0).size() == 1) { if(CHILD(0)[0].contains(x_var)) { if(!CHILD(1).representsNonComplex()) { if(ct_comp != COMPARISON_EQUALS && ct_comp != COMPARISON_NOT_EQUALS) return false; MathStructure mtest(CALCULATOR->v_e); mtest.raise(CHILD(1)); mtest.transform(CALCULATOR->f_ln); ComparisonResult cr = mtest.compareApproximately(CHILD(1), eo); if(cr != COMPARISON_RESULT_EQUAL) { if(COMPARISON_IS_NOT_EQUAL(cr)) { if(ct_comp == COMPARISON_EQUALS) clear(true); else set(1, 1, 0, true); return true; } return false; } } MathStructure msave(CHILD(1)); CHILD(1).set(CALCULATOR->v_e); CHILD(1).calculateRaise(msave, eo2); CHILD(0).setToChild(1, true); CHILDREN_UPDATED; if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { MathStructure *mand = new MathStructure(CHILD(0)); mand->add(m_zero, OPERATION_GREATER); mand->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(mand, OPERATION_LOGICAL_AND); SWAP_CHILDREN(0, 1); calculatesub(eo2, eo, false); } else { isolate_x_sub(eo, eo2, x_var, morig); } return true; } } else if(CHILD(0).function() == CALCULATOR->f_lambert_w && (CHILD(0).size() == 1 || (CHILD(0).size() == 2 && CHILD(0)[1].isZero())) && (ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_NOT_EQUALS)) { if(CHILD(0)[0].contains(x_var)) { MathStructure msave(CHILD(1)); CHILD(1).set(CALCULATOR->v_e); CHILD(1).calculateRaise(msave, eo2); CHILD(1).calculateMultiply(msave, eo2); CHILD(0).setToChild(1, true); CHILDREN_UPDATED; if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { MathStructure *mand = new MathStructure(CHILD(0)); mand->add(m_zero, OPERATION_GREATER); mand->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(mand, OPERATION_LOGICAL_AND); SWAP_CHILDREN(0, 1); calculatesub(eo2, eo, false); } else { isolate_x_sub(eo, eo2, x_var, morig); } return true; } } else if(CHILD(0).function() == CALCULATOR->f_logn && CHILD(0).size() == 2) { if(CHILD(0)[0].contains(x_var)) { MathStructure msave(CHILD(1)); CHILD(1) = CHILD(0)[1]; CHILD(1).calculateRaise(msave, eo2); CHILD(0).setToChild(1, true); CHILDREN_UPDATED; if(ct_comp == COMPARISON_LESS || ct_comp == COMPARISON_EQUALS_LESS) { MathStructure *mand = new MathStructure(CHILD(0)); mand->add(m_zero, OPERATION_GREATER); mand->isolate_x_sub(eo, eo2, x_var); isolate_x_sub(eo, eo2, x_var, morig); add_nocopy(mand, OPERATION_LOGICAL_AND); SWAP_CHILDREN(0, 1); calculatesub(eo2, eo, false); } else { isolate_x_sub(eo, eo2, x_var, morig); } return true; } } else if((CHILD(0).function() == CALCULATOR->f_tan || CHILD(0).function() == CALCULATOR->f_sin || CHILD(0).function() == CALCULATOR->f_cos) && CHILD(0).size() == 1 && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { MathFunction *f = CHILD(0).function(); CHILD(0).setToChild(1, true); if(f == CALCULATOR->f_sin) CHILD(1).transform(CALCULATOR->f_asin); else if(f == CALCULATOR->f_cos) CHILD(1).transform(CALCULATOR->f_acos); else CHILD(1).transform(CALCULATOR->f_atan); CHILD(1).calculateFunctions(eo); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { EvaluationOptions eo3 = eo2; eo3.sync_units = true; CHILD(0) /= CALCULATOR->getDegUnit(); CHILD(0).calculatesub(eo3, eo, true); CHILD(1) += Number(180, 1); break; } case ANGLE_UNIT_GRADIANS: { EvaluationOptions eo3 = eo2; eo3.sync_units = true; CHILD(0) /= CALCULATOR->getGraUnit(); CHILD(0).calculatesub(eo3, eo, true); CHILD(1) += Number(200, 1); break; } case ANGLE_UNIT_RADIANS: { CHILD(0).calculateDivide(CALCULATOR->getRadUnit(), eo2); CHILD(1) += CALCULATOR->v_pi; break; } default: { CHILD(1) += CALCULATOR->v_pi; CHILD(1)[1] *= CALCULATOR->getRadUnit(); } } CHILD(1)[1] *= CALCULATOR->v_n; if(f == CALCULATOR->f_sin || f == CALCULATOR->f_cos) { CHILD(1)[1] *= 2; MathStructure *malt = new MathStructure(*this); (*malt)[1][0].negate(); if(f == CALCULATOR->f_sin) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {(*malt)[1].add(Number(180, 1), true); break;} case ANGLE_UNIT_GRADIANS: {(*malt)[1].add(Number(200, 1), true); break;} case ANGLE_UNIT_RADIANS: {(*malt)[1].add(CALCULATOR->v_pi, true); break;} default: {(*malt)[1].add(CALCULATOR->v_pi, true); (*malt)[1].last() *= CALCULATOR->getRadUnit();} } } CHILD(1).calculatesub(eo2, eo, true); (*malt)[1].calculatesub(eo2, eo, true); CHILDREN_UPDATED; malt->childrenUpdated(); isolate_x_sub(eo, eo2, x_var, morig); malt->isolate_x_sub(eo, eo2, x_var, morig); if(ct_comp == COMPARISON_NOT_EQUALS) add_nocopy(malt, OPERATION_LOGICAL_AND); else add_nocopy(malt, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); } else { CHILD(1).calculatesub(eo2, eo, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); } fix_n_multiple(*this, eo2, eo, x_var); return true; } else if(CHILD(0).function() == CALCULATOR->f_sinh && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { CHILD(0).setToChild(1, true); CHILD(1).transform(CALCULATOR->f_asinh); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); if(CHILD(0).representsNonComplex()) { CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); } else { MathStructure *malt = new MathStructure(*this); CHILD(1) *= nr_one_i; (*malt)[1] *= nr_minus_i; CHILD(1) += CALCULATOR->v_pi; CHILD(1) += CALCULATOR->v_n; CHILD(1).last() *= CALCULATOR->v_pi; CHILD(1).last() *= nr_two; (*malt)[1] += CALCULATOR->v_n; (*malt)[1].last() *= CALCULATOR->v_pi; (*malt)[1].last() *= nr_two; CHILD(1) *= nr_one_i; (*malt)[1] *= nr_one_i; CHILD(1).calculatesub(eo2, eo, true); (*malt)[1].calculatesub(eo2, eo, true); CHILDREN_UPDATED; malt->childrenUpdated(); isolate_x_sub(eo, eo2, x_var, morig); malt->isolate_x_sub(eo, eo2, x_var, morig); if(ct_comp == COMPARISON_NOT_EQUALS) add_nocopy(malt, OPERATION_LOGICAL_AND); else add_nocopy(malt, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); fix_n_multiple(*this, eo2, eo, x_var); } return true; } else if(CHILD(0).function() == CALCULATOR->f_cosh && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { CHILD(0).setToChild(1, true); CHILD(1).transform(CALCULATOR->f_acosh); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); if(CHILD(0).representsNonComplex()) { MathStructure *malt = new MathStructure(*this); (*malt)[1].calculateNegate(eo2); CHILDREN_UPDATED; malt->childrenUpdated(); isolate_x_sub(eo, eo2, x_var, morig); malt->isolate_x_sub(eo, eo2, x_var, morig); if(ct_comp == COMPARISON_NOT_EQUALS) add_nocopy(malt, OPERATION_LOGICAL_AND); else add_nocopy(malt, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); } else { MathStructure *malt = new MathStructure(*this); CHILD(1) *= nr_one_i; (*malt)[1] *= nr_minus_i; CHILD(1) += CALCULATOR->v_n; CHILD(1).last() *= CALCULATOR->v_pi; CHILD(1).last() *= nr_two; (*malt)[1] += CALCULATOR->v_n; (*malt)[1].last() *= CALCULATOR->v_pi; (*malt)[1].last() *= nr_two; CHILD(1) *= nr_one_i; (*malt)[1] *= nr_one_i; CHILD(1).calculatesub(eo2, eo, true); (*malt)[1].calculatesub(eo2, eo, true); CHILDREN_UPDATED; malt->childrenUpdated(); isolate_x_sub(eo, eo2, x_var, morig); malt->isolate_x_sub(eo, eo2, x_var, morig); if(ct_comp == COMPARISON_NOT_EQUALS) add_nocopy(malt, OPERATION_LOGICAL_AND); else add_nocopy(malt, OPERATION_LOGICAL_OR); calculatesub(eo2, eo, false); fix_n_multiple(*this, eo2, eo, x_var); } return true; } else if(CHILD(0).function() == CALCULATOR->f_tanh && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { CHILD(0).setToChild(1, true); CHILD(1).transform(CALCULATOR->f_atanh); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); if(CHILD(0).representsNonComplex()) { CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); } else { CHILD(1) *= nr_minus_i; CHILD(1) += CALCULATOR->v_n; CHILD(1).last() *= CALCULATOR->v_pi; CHILD(1) *= nr_one_i; CHILD(1).calculatesub(eo2, eo, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); fix_n_multiple(*this, eo2, eo, x_var); } return true; } else if(CHILD(0).function() == CALCULATOR->f_asin && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { MathStructure m1(CHILD(1)); CHILD(0).setToChild(1, true); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {CHILD(1) *= CALCULATOR->getDegUnit(); break;} case ANGLE_UNIT_GRADIANS: {CHILD(1) *= CALCULATOR->getGraUnit(); break;} default: {CHILD(1) *= CALCULATOR->getRadUnit();} } CHILD(1).transform(CALCULATOR->f_sin); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); m1.transform(CALCULATOR->f_re); if(m1.calculateFunctions(eo)) m1.calculatesub(eo2, eo, true); MathStructure *mreq1 = new MathStructure(m1); MathStructure *mreq2 = new MathStructure(m1); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, Number(90, 1)); mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, Number(-90, 1)); break; } case ANGLE_UNIT_GRADIANS: { mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, Number(100, 1)); mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, Number(-100, 1)); break; } default: { mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, CALCULATOR->v_pi); mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, CALCULATOR->v_pi); mreq1->last() *= nr_half; mreq2->last() *= nr_minus_half; } } mreq1->isolate_x(eo2, eo); mreq2->isolate_x(eo2, eo); add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); return true; } else if(CHILD(0).function() == CALCULATOR->f_acos && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { MathStructure m1(CHILD(1)), m2(CHILD(1)); CHILD(0).setToChild(1, true); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {CHILD(1) *= CALCULATOR->getDegUnit(); break;} case ANGLE_UNIT_GRADIANS: {CHILD(1) *= CALCULATOR->getGraUnit(); break;} default: {CHILD(1) *= CALCULATOR->getRadUnit();} } CHILD(1).transform(CALCULATOR->f_cos); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); m2.transform(CALCULATOR->f_im); m1.transform(CALCULATOR->f_re); if(m1.calculateFunctions(eo)) m1.calculatesub(eo2, eo, true); MathStructure *mreq1 = new MathStructure(m1); MathStructure *mreq2 = new MathStructure(m1); MathStructure *mreq3 = new MathStructure(m1); MathStructure *mreq4 = new MathStructure(m2); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, Number(180, 1)); break; } case ANGLE_UNIT_GRADIANS: { mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, Number(200, 1)); break; } default: { mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, CALCULATOR->v_pi); } } mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, m_zero); mreq3->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_EQUALS : COMPARISON_NOT_EQUALS, m_zero); mreq4->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, m_zero); mreq1->isolate_x(eo2, eo); mreq2->isolate_x(eo2, eo); mreq3->isolate_x(eo2, eo); mreq4->isolate_x(eo2, eo); add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); mreq3->add_nocopy(mreq4, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_AND : OPERATION_LOGICAL_OR); mreq3->calculatesub(eo2, eo, false); add_nocopy(mreq3, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); return true; } else if(CHILD(0).function() == CALCULATOR->f_atan && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { MathStructure m1(CHILD(1)); CHILD(0).setToChild(1, true); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {CHILD(1) *= CALCULATOR->getDegUnit(); break;} case ANGLE_UNIT_GRADIANS: {CHILD(1) *= CALCULATOR->getGraUnit(); break;} default: {CHILD(1) *= CALCULATOR->getRadUnit();} } CHILD(1).transform(CALCULATOR->f_tan); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); m1.transform(CALCULATOR->f_re); if(m1.calculateFunctions(eo)) m1.calculatesub(eo2, eo, true); MathStructure *mreq1 = new MathStructure(m1); MathStructure *mreq2 = new MathStructure(m1); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, Number(90, 1)); mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, Number(-90, 1)); break; } case ANGLE_UNIT_GRADIANS: { mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, Number(100, 1)); mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, Number(-100, 1)); break; } default: { mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, CALCULATOR->v_pi); mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, CALCULATOR->v_pi); mreq1->last() *= nr_half; mreq2->last() *= nr_minus_half; } } mreq1->isolate_x(eo2, eo); mreq2->isolate_x(eo2, eo); add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); return true; } else if(CHILD(0).function() == CALCULATOR->f_asinh && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { MathStructure m1(CHILD(1)); CHILD(0).setToChild(1, true); CHILD(1).transform(CALCULATOR->f_sinh); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); m1.transform(CALCULATOR->f_im); if(m1.calculateFunctions(eo)) m1.calculatesub(eo2, eo, true); MathStructure *mreq1 = new MathStructure(m1); MathStructure *mreq2 = new MathStructure(m1); mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, CALCULATOR->v_pi); mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, CALCULATOR->v_pi); mreq1->last() *= nr_half; mreq2->last() *= nr_minus_half; mreq1->isolate_x(eo2, eo); mreq2->isolate_x(eo2, eo); add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); return true; } else if(CHILD(0).function() == CALCULATOR->f_acosh && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { MathStructure m1(CHILD(1)); CHILD(0).setToChild(1, true); CHILD(1).transform(CALCULATOR->f_cosh); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); MathStructure m1im(m1); m1.transform(CALCULATOR->f_re); m1im.transform(CALCULATOR->f_im); if(m1.calculateFunctions(eo)) m1.calculatesub(eo2, eo, true); if(m1im.calculateFunctions(eo)) m1im.calculatesub(eo2, eo, true); MathStructure *mreq1 = new MathStructure(m1); MathStructure *mreq2 = new MathStructure(m1im); MathStructure *mreq3 = new MathStructure(m1im); mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, m_zero); mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, CALCULATOR->v_pi); mreq3->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, m_zero); mreq3->last().negate(); mreq1->isolate_x(eo2, eo); mreq2->isolate_x(eo2, eo); mreq3->isolate_x(eo2, eo); add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); add_nocopy(mreq3, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); return true; } else if(CHILD(0).function() == CALCULATOR->f_atanh && (ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_EQUALS)) { MathStructure m1(CHILD(1)); CHILD(0).setToChild(1, true); CHILD(1).transform(CALCULATOR->f_tanh); if(CHILD(1).calculateFunctions(eo)) CHILD(1).calculatesub(eo2, eo, true); CHILDREN_UPDATED; isolate_x_sub(eo, eo2, x_var, morig); m1.transform(CALCULATOR->f_im); if(m1.calculateFunctions(eo)) m1.calculatesub(eo2, eo, true); MathStructure *mreq1 = new MathStructure(m1); MathStructure *mreq2 = new MathStructure(m1); mreq1->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_GREATER : COMPARISON_EQUALS_LESS, CALCULATOR->v_pi); mreq2->transform(ct_comp == COMPARISON_NOT_EQUALS ? COMPARISON_LESS : COMPARISON_EQUALS_GREATER, CALCULATOR->v_pi); mreq1->last() *= nr_half; mreq2->last() *= nr_minus_half; mreq1->isolate_x(eo2, eo); mreq2->isolate_x(eo2, eo); add_nocopy(mreq1, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND); add_nocopy(mreq2, ct_comp == COMPARISON_NOT_EQUALS ? OPERATION_LOGICAL_OR : OPERATION_LOGICAL_AND, true); calculatesub(eo2, eo, false); return true; } else if(CHILD(0).function() == CALCULATOR->f_abs && CHILD(0).size() == 1) { if(CHILD(0)[0].contains(x_var)) { CHILD(0).setToChild(1); CHILD_UPDATED(0) CHILD(0) ^= nr_two; CHILD(0) ^= nr_half; isolate_x_sub(eo, eo2, x_var, morig); return true; } } else if(CHILD(0).function() == CALCULATOR->f_signum && CHILD(0).size() == 2) { if(CHILD(0)[0].contains(x_var) && CHILD(0)[0].representsNonComplex(true)) { if(CHILD(1).isZero() && !CHILD(0)[1].isOne() && !CHILD(0)[1].isMinusOne()) { CHILD(0).setToChild(2, true, this, 1); isolate_x_sub(eo, eo2, x_var, morig); return true; } if(CHILD(1).isNumber() && !CHILD(1).number().isInterval(false)) { if(CHILD(1).number().isOne()) { if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_EQUALS_GREATER) ct_comp = (CHILD(0)[1].isOne() ? COMPARISON_EQUALS_GREATER : COMPARISON_GREATER); else if(ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_LESS) ct_comp = (CHILD(0)[1].isOne() ? COMPARISON_LESS : COMPARISON_EQUALS_LESS); else if(ct_comp == COMPARISON_GREATER) {clear(true); return 1;} else {set(1, 1, 0, true); return 1;} CHILD(0).setToChild(1, true, this, 1); CHILD(1).clear(true); isolate_x_sub(eo, eo2, x_var, morig); return true; } else if(CHILD(1).number().isMinusOne()) { if(ct_comp == COMPARISON_EQUALS || ct_comp == COMPARISON_EQUALS_LESS) ct_comp = (CHILD(0)[1].isMinusOne() ?COMPARISON_EQUALS_LESS : COMPARISON_LESS); else if(ct_comp == COMPARISON_NOT_EQUALS || ct_comp == COMPARISON_GREATER) ct_comp = (CHILD(0)[1].isMinusOne() ? COMPARISON_GREATER : COMPARISON_EQUALS_GREATER); else if(ct_comp == COMPARISON_LESS) {clear(true); return 1;} else {set(1, 1, 0, true); return 1;} CHILD(0).setToChild(1, true, this, 1); CHILD(1).clear(true); isolate_x_sub(eo, eo2, x_var, morig); return true; } if(ct_comp == COMPARISON_EQUALS) { clear(true); return true; } else if(ct_comp == COMPARISON_NOT_EQUALS) { set(1, 1, 0, true); return true; } if(CHILD(0)[1].isZero() || CHILD(0)[1].isOne() || CHILD(0)[1].isMinusOne()) { if(CHILD(1).number().isPositive()) { if(CHILD(1).number().isGreaterThan(1)) { if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) clear(true); else set(1, 1, 0, true); return 1; } if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) ct_comp = (CHILD(0)[1].isOne() ? COMPARISON_EQUALS_GREATER : COMPARISON_GREATER); else ct_comp = (CHILD(0)[1].isOne() ? COMPARISON_LESS : COMPARISON_EQUALS_LESS); CHILD(0).setToChild(1, true, this, 1); CHILD(1).clear(true); isolate_x_sub(eo, eo2, x_var, morig); return true; } else if(CHILD(1).number().isNegative()) { if(CHILD(1).number().isLessThan(-1)) { if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) set(1, 1, 0, true); else clear(true); return 1; } if(ct_comp == COMPARISON_GREATER || ct_comp == COMPARISON_EQUALS_GREATER) ct_comp = (CHILD(0)[1].isMinusOne() ? COMPARISON_GREATER : COMPARISON_EQUALS_GREATER); else ct_comp = (CHILD(0)[1].isMinusOne() ? COMPARISON_EQUALS_LESS : COMPARISON_LESS); CHILD(0).setToChild(1, true, this, 1); CHILD(1).clear(true); isolate_x_sub(eo, eo2, x_var, morig); return true; } } } } } break; } default: {} } return false; } bool contains_unsolved_equals(const MathStructure &mstruct, const MathStructure &x_var) { if(mstruct.isComparison()) { return mstruct.comparisonType() == COMPARISON_EQUALS && mstruct[0] != x_var && mstruct[1] != x_var && mstruct.contains(x_var); } for(size_t i = 0; i < mstruct.size(); i++) { if(contains_unsolved_equals(mstruct[i], x_var)) return true; } return false; } bool sync_sine(MathStructure &mstruct, const EvaluationOptions &eo, const MathStructure &x_var, bool use_cos, bool b_hyp = false, const MathStructure &mstruct_parent = m_undefined) { if(!mstruct_parent.isUndefined() && mstruct.isFunction() && mstruct.function() == (b_hyp ? CALCULATOR->f_sinh : CALCULATOR->f_sin) && mstruct[0].contains(x_var)) { MathStructure m_half(mstruct); m_half[0].calculateDivide(nr_two, eo); bool b = mstruct_parent.contains(m_half); if(!b) { m_half.setFunction(b_hyp ? CALCULATOR->f_cosh : CALCULATOR->f_cos); b = mstruct_parent.contains(m_half); m_half.setFunction(b_hyp ? CALCULATOR->f_sinh : CALCULATOR->f_sin); } if(b) { mstruct = m_half; MathStructure *m_cos = new MathStructure(mstruct); (*m_cos).setFunction(b_hyp ? CALCULATOR->f_cosh : CALCULATOR->f_cos); mstruct.multiply_nocopy(m_cos); mstruct.multiply(nr_two); return true; } } else if(mstruct.isPower() && mstruct[0].isFunction() && mstruct[1].isNumber() && mstruct[1].number().isEven() && mstruct[0].size() == 1) { if(!mstruct_parent.isUndefined() && mstruct[0].function() == (b_hyp ? CALCULATOR->f_sinh : CALCULATOR->f_sin) && mstruct[0][0].contains(x_var)) { MathStructure m_half(mstruct[0]); m_half[0].calculateDivide(nr_two, eo); bool b = mstruct_parent.contains(m_half); if(!b) { m_half.setFunction(b_hyp ? CALCULATOR->f_cosh : CALCULATOR->f_cos); b = mstruct_parent.contains(m_half); m_half.setFunction(b_hyp ? CALCULATOR->f_sinh : CALCULATOR->f_sin); } if(b) { MathStructure *mmul = new MathStructure(2, 1, 0); mmul->raise(mstruct[1]); mstruct[0] = m_half; MathStructure *m_cos = new MathStructure(mstruct); (*m_cos)[0].setFunction(b_hyp ? CALCULATOR->f_cosh : CALCULATOR->f_cos); mstruct.multiply_nocopy(m_cos); mstruct.multiply_nocopy(mmul); sync_sine(mstruct, eo, x_var, use_cos, b_hyp, mstruct_parent); return true; } } if(mstruct[0].function() == (b_hyp ? CALCULATOR->f_tanh : CALCULATOR->f_tan) && mstruct[0][0].contains(x_var)) { mstruct[0].setFunction(CALCULATOR->f_sin); MathStructure *m_cos = new MathStructure(mstruct); (*m_cos)[0].setFunction(CALCULATOR->f_cos); (*m_cos)[1].number().negate(); mstruct.multiply_nocopy(m_cos); sync_sine(mstruct, eo, x_var, use_cos, b_hyp, mstruct_parent); return true; } if(mstruct[0].function() == (use_cos ? (b_hyp ? CALCULATOR->f_sinh : CALCULATOR->f_sin) : (b_hyp ? CALCULATOR->f_cosh : CALCULATOR->f_cos)) && mstruct[0][0].contains(x_var)) { mstruct[0].setFunction(use_cos ? (b_hyp ? CALCULATOR->f_cosh : CALCULATOR->f_cos) : (b_hyp ? CALCULATOR->f_sinh : CALCULATOR->f_sin)); Number nr_pow = mstruct[1].number(); nr_pow /= 2; mstruct[1].set(nr_two, true); if(b_hyp) { if(use_cos) mstruct += m_minus_one; else mstruct += m_one; } else { mstruct.negate(); mstruct += m_one; } if(!nr_pow.isOne()) { mstruct ^= nr_pow; } return true; } } bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(CALCULATOR->aborted()) return false; if(sync_sine(mstruct[i], eo, x_var, use_cos, b_hyp, mstruct_parent.isUndefined() ? mstruct : mstruct_parent)) b = true; } return b; } void sync_find_cos_sin(const MathStructure &mstruct, const MathStructure &x_var, bool &b_sin, bool &b_cos, bool b_hyp = false) { if(mstruct.isFunction() && mstruct.size() == 1) { if(!b_sin && mstruct.function() == (b_hyp ? CALCULATOR->f_sinh : CALCULATOR->f_sin) && mstruct[0].contains(x_var)) { b_sin = true; } else if(!b_cos && mstruct.function() == (b_hyp ? CALCULATOR->f_cosh : CALCULATOR->f_cos) && mstruct[0].contains(x_var)) { b_cos = true; } if(b_sin && b_cos) return; } for(size_t i = 0; i < mstruct.size(); i++) { sync_find_cos_sin(mstruct[i], x_var, b_sin, b_cos, b_hyp); if(b_sin && b_cos) return; } } bool sync_trigonometric_functions(MathStructure &mstruct, const EvaluationOptions &eo, const MathStructure &x_var, bool use_cos = false) { bool b_ret = false; if(sync_sine(mstruct, eo, x_var, use_cos)) b_ret = true; if(sync_sine(mstruct, eo, x_var, use_cos, true)) b_ret = true; return b_ret; } bool simplify_functions(MathStructure &mstruct, const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_var) { if(!mstruct.isAddition()) { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(CALCULATOR->aborted()) break; if(simplify_functions(mstruct[i], eo, feo, x_var)) {b = true; mstruct.childUpdated(i + 1);} } return b; } if(mstruct.containsFunction(CALCULATOR->f_sin, false, false, false) > 0 && mstruct.containsFunction(CALCULATOR->f_cos, false, false, false)) { if(x_var.isUndefined()) { // a*(sin(x)+cos(x))=a*sqrt(2)*sin(x+pi/4) bool b_ret = false; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isFunction() && mstruct[i].size() == 1 && mstruct[i].function() == CALCULATOR->f_sin) { for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(i != i2 && mstruct[i2].isFunction() && mstruct[i2].size() == 1 && mstruct[i2].function() == CALCULATOR->f_cos && mstruct[i][0] == mstruct[i2][0]) { MathStructure madd(CALCULATOR->v_pi); madd /= Number(4, 1); madd *= CALCULATOR->getRadUnit(); madd.calculatesub(eo, feo, true); mstruct[i][0].calculateAdd(madd, eo); mstruct[i].childUpdated(1); mstruct.childUpdated(i + 1); MathStructure mmul(nr_two); mmul.calculateRaise(nr_half, eo); mstruct[i].calculateMultiply(mmul, eo); mstruct.delChild(i2 + 1); b_ret = true; break; } } } else if(mstruct[i].isMultiplication()) { for(size_t i3 = 0; i3 < mstruct[i].size(); i3++) { if(mstruct[i][i3].isFunction() && mstruct[i][i3].size() == 1 && mstruct[i][i3].function() == CALCULATOR->f_sin) { mstruct[i][i3].setFunction(CALCULATOR->f_cos); bool b = false; for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(i != i2 && mstruct[i2] == mstruct[i]) { MathStructure madd(CALCULATOR->v_pi); madd /= Number(4, 1); madd *= CALCULATOR->getRadUnit(); madd.calculatesub(eo, feo, true); mstruct[i][i3].setFunction(CALCULATOR->f_sin); mstruct[i][i3][0].calculateAdd(madd, eo); mstruct[i][i3].childUpdated(1); mstruct[i].childUpdated(i3 + 1); mstruct.childUpdated(i + 1); MathStructure mmul(nr_two); mmul.calculateRaise(nr_half, eo); mstruct[i].calculateMultiply(mmul, eo); mstruct.delChild(i2 + 1); b = true; break; } } if(b) { b_ret = true; break; } else { mstruct[i][i3].setFunction(CALCULATOR->f_sin); } } } } } if(mstruct.size() == 1) mstruct.setToChild(1, true); return b_ret; } else { // a*sin(x)+b*cos(x)=a*sqrt((b/a)^2+1)*sin(x+atan(b/a)) MathStructure *marg = NULL; bool b_cos = false; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isFunction() && mstruct[i].size() == 1 && (mstruct[i].function() == CALCULATOR->f_sin || mstruct[i].function() == CALCULATOR->f_cos) && mstruct[i][0].contains(x_var)) { marg = &mstruct[i][0]; b_cos = mstruct[i].function() == CALCULATOR->f_cos; } else if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { if(!marg && mstruct[i][i2].isFunction() && mstruct[i][i2].size() == 1 && (mstruct[i][i2].function() == CALCULATOR->f_sin || mstruct[i][i2].function() == CALCULATOR->f_cos) && mstruct[i][i2][0].contains(x_var)) { marg = &mstruct[i][i2][0]; b_cos = mstruct[i][i2].function() == CALCULATOR->f_cos; } else if(mstruct[i][i2].contains(x_var)) { marg = NULL; break; } } } if(marg) { bool b = false; for(size_t i3 = i + 1; i3 < mstruct.size(); i3++) { if(mstruct[i3].isFunction() && mstruct[i3].size() == 1 && mstruct[i3].function() == (b_cos ? CALCULATOR->f_sin : CALCULATOR->f_cos) && mstruct[i3][0] == *marg) { b = true; } else if(mstruct[i3].isMultiplication()) { bool b2 = false; for(size_t i2 = 0; i2 < mstruct[i3].size(); i2++) { if(!b2 && mstruct[i3][i2].isFunction() && mstruct[i3][i2].size() == 1 && (mstruct[i3][i2].function() == CALCULATOR->f_sin || mstruct[i3][i2].function() == CALCULATOR->f_cos) && mstruct[i3][i2][0] == *marg) { if((mstruct[i3][i2].function() == CALCULATOR->f_sin) == b_cos) b = true; b2 = true; } else if(mstruct[i3][i2].contains(x_var)) { marg = NULL; break; } } if(!marg) break; } } if(!b) marg = NULL; } if(marg) { marg->ref(); MathStructure m_a, m_b; for(size_t i3 = i; i3 < mstruct.size();) { bool b = false; if(mstruct[i3].isFunction() && mstruct[i3].size() == 1 && mstruct[i3].function() == CALCULATOR->f_sin && mstruct[i3][0] == *marg) { if(m_a.isZero()) m_a = m_one; else m_a.add(m_one, true); b = true; } else if(mstruct[i3].isFunction() && mstruct[i3].size() == 1 && mstruct[i3].function() == CALCULATOR->f_cos && mstruct[i3][0] == *marg) { if(m_b.isZero()) m_a = m_one; else m_b.add(m_one, true); b = true; } else if(mstruct[i3].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct[i3].size(); i2++) { if(mstruct[i3][i2].isFunction() && mstruct[i3][i2].size() == 1 && mstruct[i3][i2].function() == CALCULATOR->f_sin && mstruct[i3][i2][0] == *marg) { mstruct[i3].delChild(i2 + 1, true); if(m_a.isZero()) m_a.set_nocopy(mstruct[i3]); else {mstruct[i3].ref(); m_a.add_nocopy(&mstruct[i3], true);} b = true; break; } else if(mstruct[i3][i2].isFunction() && mstruct[i3][i2].size() == 1 && mstruct[i3][i2].function() == CALCULATOR->f_cos && mstruct[i3][i2][0] == *marg) { mstruct[i3].delChild(i2 + 1, true); if(m_b.isZero()) m_b.set_nocopy(mstruct[i3]); else {mstruct[i3].ref(); m_b.add_nocopy(&mstruct[i3], true);} b = true; break; } } } if(b) { mstruct.delChild(i3 + 1); } else { i3++; } } MathStructure *m_sin = new MathStructure(CALCULATOR->f_sin, NULL); m_sin->addChild_nocopy(marg); m_b.calculateDivide(m_a, eo); MathStructure *m_atan = new MathStructure(CALCULATOR->f_atan, &m_b, NULL); if(m_atan->calculateFunctions(feo)) m_atan->calculatesub(eo, feo, true); if(eo.parse_options.angle_unit != ANGLE_UNIT_NONE) m_atan->calculateMultiply(CALCULATOR->getRadUnit(), eo); (*m_sin)[0].add_nocopy(m_atan); (*m_sin)[0].calculateAddLast(eo); m_sin->childUpdated(1); m_b.calculateRaise(nr_two, eo); m_b.calculateAdd(m_one, eo); m_b.calculateRaise(nr_half, eo); m_sin->calculateMultiply(m_b, eo); m_sin->calculateMultiply(m_a, eo); if(mstruct.size() == 0) {mstruct.set_nocopy(*m_sin); m_sin->unref();} else mstruct.insertChild_nocopy(m_sin, i + 1); simplify_functions(mstruct, eo, feo, x_var); return true; } } } } return false; } bool MathStructure::isolate_x(const EvaluationOptions &eo, const MathStructure &x_varp, bool check_result) { return isolate_x(eo, eo, x_varp, check_result); } bool MathStructure::isolate_x(const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_varp, bool check_result) { if(isProtected()) return false; if(!isComparison()) { bool b = false; for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isolate_x(eo, feo, x_varp, check_result)) { CHILD_UPDATED(i); b = true; } } return b; } MathStructure x_var(x_varp); if(x_var.isUndefined()) { const MathStructure *x_var2; if(eo.isolate_var && contains(*eo.isolate_var)) x_var2 = eo.isolate_var; else x_var2 = &find_x_var(); if(x_var2->isUndefined()) return false; x_var = *x_var2; } if(CHILD(0) == x_var && !CHILD(1).contains(x_var)) return true; if(!CHILD(1).isZero()) { CHILD(0).calculateSubtract(CHILD(1), eo); CHILD(1).clear(true); CHILDREN_UPDATED } if(eo.expand > 0) simplify_functions(*this, eo, feo, x_var); EvaluationOptions eo2 = eo; eo2.calculate_functions = false; eo2.test_comparisons = false; eo2.isolate_x = false; if(check_result && CHILD(1).isZero() && CHILD(0).isAddition()) { bool found_1x = false; for(size_t i = 0; i < CHILD(0).size(); i++) { if(CHILD(0)[i] == x_var) { found_1x = true; } else if(CHILD(0)[i].contains(x_var)) { found_1x = false; break; } } if(found_1x) check_result = false; } MathStructure msave(*this); bool b = isolate_x_sub(feo, eo2, x_var); if(CALCULATOR->aborted()) return !check_result && b; if(eo.expand > 0 && contains_unsolved_equals(*this, x_var)) { MathStructure mtest(msave); EvaluationOptions eo3 = eo; eo3.transform_trigonometric_functions = false; eo2.transform_trigonometric_functions = false; bool do_cos = true; if(sync_trigonometric_functions(mtest, eo3, x_var, false)) { mtest.calculatesub(eo3, feo); if(CALCULATOR->aborted()) return !check_result && b; if(eo.do_polynomial_division) do_simplification(mtest, eo3, true, eo.structuring == STRUCTURING_NONE || eo.structuring == STRUCTURING_FACTORIZE, false, true, true); if(CALCULATOR->aborted()) return !check_result && b; if(mtest.isComparison() && mtest.isolate_x_sub(feo, eo2, x_var) && !contains_unsolved_equals(mtest, x_var)) { set(mtest); b = true; do_cos = false; } else if(CALCULATOR->aborted()) { return !check_result && b; } } if(do_cos) { mtest = msave; if(sync_trigonometric_functions(mtest, eo3, x_var, true)) { mtest.calculatesub(eo3, feo); if(CALCULATOR->aborted()) return !check_result && b; if(eo.do_polynomial_division) do_simplification(mtest, eo3, true, eo.structuring == STRUCTURING_NONE || eo.structuring == STRUCTURING_FACTORIZE, false, true, true); if(CALCULATOR->aborted()) return !check_result && b; if(mtest.isComparison() && mtest.isolate_x_sub(feo, eo2, x_var) && !contains_unsolved_equals(mtest, x_var)) { b = true; set(mtest); } } } } fix_n_multiple(*this, eo, feo, x_var); if(check_result && b) { b = test_comparisons(msave, *this, x_var, eo) >= 0; } return b; } bool MathStructure::isRationalPolynomial(bool allow_non_rational_coefficient, bool allow_interval_coefficient) const { switch(m_type) { case STRUCT_NUMBER: { if(allow_interval_coefficient) return o_number.isReal() && o_number.isNonZero(); if(allow_non_rational_coefficient) return o_number.isReal() && !o_number.isInterval() && o_number.isNonZero(); return o_number.isRational() && !o_number.isZero(); } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isAddition() || CHILD(i).isMultiplication() || !CHILD(i).isRationalPolynomial(allow_non_rational_coefficient, allow_interval_coefficient)) { return false; } } return true; } case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isAddition() || !CHILD(i).isRationalPolynomial(allow_non_rational_coefficient, allow_interval_coefficient)) { return false; } } return true; } case STRUCT_POWER: { return CHILD(1).isInteger() && CHILD(1).number().isNonNegative() && !CHILD(1).number().isOne() && CHILD(1).number() < 1000 && !CHILD(0).isMultiplication() && !CHILD(0).isAddition() && !CHILD(0).isPower() && CHILD(0).isRationalPolynomial(allow_non_rational_coefficient, allow_interval_coefficient); } case STRUCT_FUNCTION: { if(o_function == CALCULATOR->f_interval || containsInterval() || containsInfinity()) return false; } case STRUCT_UNIT: {} case STRUCT_VARIABLE: {} case STRUCT_SYMBOLIC: { return representsNonMatrix() && !representsUndefined(true, true); } default: {} } return false; } const Number &MathStructure::overallCoefficient() const { switch(m_type) { case STRUCT_NUMBER: { return o_number; } case STRUCT_MULTIPLICATION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isNumber()) { return CHILD(i).number(); } } return nr_one; } case STRUCT_ADDITION: { for(size_t i = 0; i < SIZE; i++) { if(CHILD(i).isNumber()) { return CHILD(i).number(); } } return nr_zero; } case STRUCT_POWER: { return nr_zero; } default: {} } return nr_zero; } bool MathStructure::inParentheses() const {return b_parentheses;} void MathStructure::setInParentheses(bool b) {b_parentheses = b;} libqalculate-2.8.2/libqalculate/ExpressionItem.h0000644000175000017500000003400013227067157016706 00000000000000/* Qalculate Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef EXPRESSIONITEM_H #define EXPRESSIONITEM_H #include /** @file */ /// A name for an expression item (function, variable or unit) /** An expression name has a text string representing a name and boolean values describing the names properties. */ struct ExpressionName { /// If the name is an abbreviation. bool abbreviation; /// If the name has a suffix. If set to true, the part of the name after an underscore should be treated as a suffix. bool suffix; /// If the name contains unicode characters. bool unicode; /// If the name is in plural form. bool plural; /// If the name shall be used as a fixed reference. If this is set to true, the name will kept as it is in addition to translations of it. bool reference; /// If the name is unsuitable for user input. bool avoid_input; /// If the name is case sensitive. The default behavior is that abbreviations are case sensitive and other names are not. bool case_sensitive; /// Use only for completion (useful for unicode letter alternatives) bool completion_only; /// The name. string name; /** Create an empty expression name. All properties are set to false. */ ExpressionName(); /** Create an expression name. All properties are set to false, unless the name only has one character in which case abbreviation and case_sesnsitive is set to true. * * @param sname The name. */ ExpressionName(string sname); void operator = (const ExpressionName &ename); bool operator == (const ExpressionName &ename) const; bool operator != (const ExpressionName &ename) const; }; /// Abstract base class for functions, variables and units. /** * Expression items have one or more names used to reference it in mathematical expressions and display them in a result. * Each name must be fully unique, with the exception that functions can have names used by other types of items * (for example "min" is used as a name for the minute unit but also for a function returning smallest value in a vector). * * Items have an optional title and description for information to the end user. * The categoy property is used to organize items, so that the end user can easily find them. * Subcategories are separated by a slash, '/' (ex. "Physical Constants/Electromagnetic Constants"). * * A local item is created/edited by the end user. * * A builtin item has defining properties that can/should not be edited by the user and is usually an item not loaded from the definition files. * * An inactive item can not be used in expressions and can share the name of an active item. * * The hidden propery defines if the item should be hidden from the end user. * * Before an item can be used in expressions, it must be added to the Calculator object using CALCULATOR->addExpressionItem(). * It is then said to be registered. * * To delete an ExpressionItem object you should use destroy() to make sure that the item is removed from the Calculator and does not have any referrer. * */ class ExpressionItem { protected: string scat, stitle, sdescr; bool b_local, b_changed, b_builtin, b_approx, b_active, b_registered, b_hidden, b_destroyed; int i_ref, i_precision; vector v_refs; vector names; public: ExpressionItem(string cat_, string name_, string title_ = "", string descr_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); ExpressionItem(); virtual ~ExpressionItem(); virtual ExpressionItem *copy() const = 0; virtual void set(const ExpressionItem *item); virtual bool destroy(); bool isRegistered() const; /// For internal use. void setRegistered(bool is_registered); virtual const string &name(bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual const string &referenceName() const; /** Returns the name that best fulfils provided criterias. If two names are equally preferred, the one with lowest index is returned. * * @param abbreviation If an abbreviated name is preferred. * @param use_unicode If a name with unicode characters can be displayed/is preferred (prioritized if false). * @param plural If a name in plural form is preferred. * @param reference If a reference name is preferred (ignored if false). * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns The preferred name. */ virtual const ExpressionName &preferredName(bool abbreviation = false, bool use_unicode = false, bool plural = false, bool reference = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns the name that best fulfils provided criterias and is suitable for user input. If two names are equally preferred, the one with lowest index is returned. * * @param abbreviation If an abbreviated name is preferred. * @param use_unicode If a name with unicode characters can be displayed/is preferred (prioritized if false). * @param plural If a name in plural form is preferred. * @param reference If a reference name is preferred (ignored if false). * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns The preferred name. */ virtual const ExpressionName &preferredInputName(bool abbreviation = false, bool use_unicode = false, bool plural = false, bool reference = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns the name that best fulfils provided criterias and is suitable for display. If two names are equally preferred, the one with lowest index is returned. * * @param abbreviation If an abbreviated name is preferred. * @param use_unicode If a name with unicode characters can be displayed/is preferred (prioritized if false). * @param plural If a name in plural form is preferred. * @param reference If a reference name is preferred (ignored if false). * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns The preferred name. */ virtual const ExpressionName &preferredDisplayName(bool abbreviation = false, bool use_unicode = false, bool plural = false, bool reference = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns name for an index (starting at one). All functions can be traversed by starting at index one and increasing the index until empty_expression_name is returned. * * @param index Index of name. * @returns Name for index or empty_expression_name if not found. */ virtual const ExpressionName &getName(size_t index) const; /** Changes a name. If a name for the provided index is not present, it is added (equivalent to addName(ename, index, force)). * * @param ename The new name. * @param index Index of name to change. * @param force If true, expression items with conflicting names are replaced, otherwise . Only applies if the item is registered. */ virtual void setName(const ExpressionName &ename, size_t index = 1, bool force = true); /** Changes the text string of a name. If a name for the provided index is not present, it is added (equivalent to addName(sname, index, force)). * * @param sname The new name text string. * @param index Index of name to change. * @param force If true, expression items with conflicting names are replaced, otherwise . Only applies if the item is registered. */ virtual void setName(string sname, size_t index, bool force = true); virtual void addName(const ExpressionName &ename, size_t index = 0, bool force = true); virtual void addName(string sname, size_t index = 0, bool force = true); virtual size_t countNames() const; /** Removes all names. */ virtual void clearNames(); /** Removes all names that are not used for reference (ExpressionName.reference = true). */ virtual void clearNonReferenceNames(); virtual void removeName(size_t index); /** Checks if the expression item has a name with a specific text string. * * @param sname A text string to look for (not case sensitive) * @param case_sensitive If the name is case sensitive. * @returns Index of the name with the given text string or zero if such a name was not found. */ virtual size_t hasName(const string &sname, bool case_sensitive = true) const; /** Checks if the expression item has a name with a specific case sensitive text string. * * @param sname A text string to look for (case sensitive) * @returns Index of the name with the given text string or zero if such a name was not found. */ virtual size_t hasNameCaseSensitive(const string &sname) const; /** Searches for a name with specific properties. * * @param abbreviation If the name must be abbreviated. 1=true, 0=false, -1=ignore. * @param use_unicode If the name must have unicode characters. 1=true, 0=false, -1=ignore. * @param plural If the name must be in plural form. 1=true, 0=false, -1=ignore. * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns The first found name with the specified properties or empty_expression_name if none found. */ virtual const ExpressionName &findName(int abbreviation = -1, int use_unicode = -1, int plural = -1, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns the title, descriptive name, of the item. * * @param return_name_if_no_title If true, a name is returned if the title string is empty (using preferredName(false, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg)). * @param use_unicode If a name with unicode characters can be displayed/is preferred (passed to preferredName()). * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected (passed to preferredName()). * @param can_display_unicode_string_arg Argument to pass to the above test function (passed to preferredName()). * @returns Item title. */ virtual const string &title(bool return_name_if_no_title = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Sets the title, descriptive name, of the item. The title can not be used in expressions. * * @param title_ The new title. */ virtual void setTitle(string title_); /** Returns the expression items description. * * @returns Description. */ virtual const string &description() const; /** Sets the expression items description. * * @param descr_ Description. */ virtual void setDescription(string descr_); /** Returns the category that the expression item belongs to. Subcategories are separated by '/'. * * @returns Category. */ virtual const string &category() const; /** Sets which category the expression belongs to. Subcategories are separated by '/'. * * @param cat_ Category. */ virtual void setCategory(string cat_); /** If the object has been changed since it was created/loaded. */ virtual bool hasChanged() const; virtual void setChanged(bool has_changed); virtual bool isLocal() const; virtual bool setLocal(bool is_local = true, int will_be_active = -1); virtual bool isBuiltin() const; /** If the item is approximate or exact. * Note that an actual value associated with the item might have a have a lower precision. * For, for example, a mathematical function this defines the precision of the formula, not the result. * * @returns true if the item is approximate */ virtual bool isApproximate() const; virtual void setApproximate(bool is_approx = true); /** Returns precision of the item, if it is approximate. * Note that an actual value associated with the item might have a have a lower precision. * For, for example, a mathematical function this defines the precision of the formula, not the result. */ virtual int precision() const; virtual void setPrecision(int prec); /** Returns if the expression item is active and can be used in expressions. * * @returns true if active. */ virtual bool isActive() const; virtual void setActive(bool is_active); virtual bool isHidden() const; virtual void setHidden(bool is_hidden); /** The reference count is not used to delete the expression item when it becomes zero, but to stop from being deleted while it is in use. */ virtual int refcount() const; virtual void ref(); virtual void unref(); virtual void ref(ExpressionItem *o); virtual void unref(ExpressionItem *o); virtual ExpressionItem *getReferencer(size_t index = 1) const; virtual bool changeReference(ExpressionItem *o_from, ExpressionItem *o_to); /** Returns the type of the expression item, corresponding to which subclass the object belongs to. * * @returns ::ExpressionItemType. */ virtual int type() const = 0; /** Returns the subtype of the expression item, corresponding to which subsubclass the object belongs to. * * @returns Subtype/subsubclass. */ virtual int subtype() const = 0; }; #endif libqalculate-2.8.2/libqalculate/Unit.h0000644000175000017500000003167513272065364014664 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef UNIT_H #define UNIT_H /** @file */ /// Type of unit typedef enum { /// class Unit SUBTYPE_BASE_UNIT, /// class AliasUnit SUBTYPE_ALIAS_UNIT, /// class CompositeUnit SUBTYPE_COMPOSITE_UNIT } UnitSubtype; #include #include /// A unit for measurement. /** * The Unit class both represents a base unit and is the base class for other unit types. * Base units are units defined as basis for other units. Meters and seconds are typical base units. * * For base units, a name is all that is needed. * Base units do however normally have three different names defined for use in expressions - abbreviation (ex. "m"), singular ("meter") and plural ("meters"). */ class Unit : public ExpressionItem { protected: string ssystem, scountries; bool b_si; bool b_use_with_prefixes; public: Unit(string cat_, string name_, string plural_ = "", string singular_ = "", string title_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); Unit(); Unit(const Unit *unit); virtual ~Unit(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); /** Returns if the unit is part of the SI standard. * * @returns true if the unit is part of the SI standard. */ bool isSIUnit() const; /** State that the unit is part of the SI standard. * Sets system to "SI". */ void setAsSIUnit(); /** Sets which system/standard ("SI", "CGS", etc.) the unit is part of. * Setting system to "SI" (case-insensitive), is equivalent to setAsSIUnit(). */ void setSystem(string s_system); /** Returns the system/standard that the unit is part of. * * @returns System string. */ const string &system() const; /** Returns wether prefixes should be used with this unit or not. * * @returns true if the prefixes is appropriate for this unit. */ bool useWithPrefixesByDefault() const; /** Sets wether prefixes are approriate with this unit or not. */ void setUseWithPrefixesByDefault(bool use_with_prefixes); /** Returns if the unit is a currency (Euro is base unit). * * @returns true if the unit is a currency. */ bool isCurrency() const; const string &countries() const; void setCountries(string country_names); /** Returns a display string representing the unit in an expression. * * Equivalent to preferredName() for Unit and AliasUnit, but closer to MathStructure::print() for CompositeUnit (prints out base expression). */ virtual string print(bool plural_, bool short_, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual const string &plural(bool return_singular_if_no_plural = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual const string &singular(bool return_abbreviation_if_no_singular = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual const string &abbreviation(bool return_singular_if_no_abbreviation = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual bool isUsedByOtherUnits() const; virtual Unit* baseUnit() const; virtual MathStructure &convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertToBaseUnit(MathStructure &mvalue) const; virtual MathStructure &convertFromBaseUnit(MathStructure &mvalue) const; virtual MathStructure convertToBaseUnit() const; virtual MathStructure convertFromBaseUnit() const; virtual int baseExponent(int exp = 1) const; virtual int type() const; /** Returns the subtype of the unit, corresponding to which subsubclass the object belongs to. * * @returns ::UnitSubtype. */ virtual int subtype() const; /** If specified unit is a base unit for this unit, directly or with other units in between. * Equivalent to u->isParentOf(this). */ virtual bool isChildOf(Unit *u) const; /** If this unit is a base unit for specified unit, directly or with other units in between. * Equivalent to u->isChildOf(this). */ virtual bool isParentOf(Unit *u) const; virtual bool hasComplexRelationTo(Unit *u) const; /** Converts a value from specified unit and exponent to this unit. * value * (unit^exponent) = new value * (this^new exponent) * This function cannot convert to or from CompositeUnit. * * @param u Unit to convert from. * @param[in,out] mvalue Quantity value. * @param[in,out] exp Exponent. * @returns true if the value was successfully converted. */ bool convert(Unit *u, MathStructure &mvalue, MathStructure &exp) const; /** Converts a value from specified unit and exponent to this unit. * value * unit = new value * this * This function cannot convert to or from CompositeUnit. * * @param u Unit to convert from. * @param[in,out] mvalue Quantity value. * @returns true if the value was successfully converted. */ bool convert(Unit *u, MathStructure &mvalue) const; MathStructure convert(Unit *u, bool *converted = NULL) const; }; /// An unit with relation to another unit /** * Alias units is defined in relation to another unit. * For example, hour are defined as an alias unit that equals 60 minutes which in turn is defined in relation to seconds. * * Alias units have an associated base unit, exponent and relation expression. * For more complex relations an inverse relation can also be specified for conversion back from the base unit. * The base unit must not necessarily be of the base unit class and it is recommended that an alias unit is defined in relation to the closest unit * (ex. 1ft = 3 hands, 1 hand = 4 in, and 1 in = 0.0254 m). * * The relation is usually just a number that tells how large quantity of the base unit is needed to get the alias unit (alias unit = base unit * relation). * More complex units can specify the relation as a full-blown expression where '\x' is replaced by the quantity of the base unit and * '\y' is the exponent. * For example, Degrees Celsius has the relation "\x + 273.15" and the inverse relation "\x - 273.15" to the base unit Kelvin. * For simple relations, the reversion is automatic and ought not be defined separately. * * The precision property inherited from ExpressionItem defines the precision of the relation. * * The exponent defines the exponential relation to the base unit, so that the alias unit equals the base unit raised to the exponent. * For simple unit relations this gives: alias unit = relation * base unit^exponent. * * Alias units normally have three different names defined for use in expressions - abbreviation (ex. "m"), singular ("meter") and plural ("meters"). */ class AliasUnit : public Unit { protected: string svalue, sinverse, suncertainty; int i_exp, i_mix, i_mix_min; Unit *o_unit; public: AliasUnit(string cat_, string name_, string plural_, string singular_, string title_, Unit *alias, string relation = "1", int exp = 1, string inverse = "", bool is_local = true, bool is_builtin = false, bool is_active = true); AliasUnit(const AliasUnit *unit); AliasUnit(); virtual ~AliasUnit(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); virtual Unit* baseUnit() const; virtual Unit* firstBaseUnit() const; virtual void setBaseUnit(Unit *alias); virtual string expression() const; virtual string inverseExpression() const; virtual string uncertainty() const; /** * Sets the relation expression. */ virtual void setExpression(string relation); /** * Sets the inverse relation expression. */ virtual void setInverseExpression(string inverse); virtual void setUncertainty(string standard_uncertainty); virtual MathStructure &convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertToBaseUnit(MathStructure &mvalue) const; virtual MathStructure &convertFromBaseUnit(MathStructure &mvalue) const; virtual MathStructure convertToBaseUnit() const; virtual MathStructure convertFromBaseUnit() const; virtual int baseExponent(int exp = 1) const; virtual void setExponent(int exp); virtual int firstBaseExponent() const; virtual int mixWithBase() const; virtual int mixWithBaseMinimum() const; virtual void setMixWithBase(int combine_priority = 1); virtual void setMixWithBaseMinimum(int combine_minimum); virtual int subtype() const; virtual bool isChildOf(Unit *u) const; virtual bool isParentOf(Unit *u) const; virtual bool hasComplexExpression() const; virtual bool hasComplexRelationTo(Unit *u) const; }; /// A subunit in a CompositeUnit /** * Should normally not be used directly. */ class AliasUnit_Composite : public AliasUnit { protected: Prefix *prefixv; public: AliasUnit_Composite(Unit *alias, int exp = 1, Prefix *prefix_ = NULL); AliasUnit_Composite(const AliasUnit_Composite *unit); virtual ~AliasUnit_Composite(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); virtual string print(bool plural_, bool short_, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual Prefix *prefix() const; virtual int prefixExponent() const; virtual void set(Unit *u, int exp = 1, Prefix *prefix_ = NULL); virtual MathStructure &convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; virtual MathStructure &convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const; }; /// A unit consisting of a number of other units /** * Composite units are defined by a unit expression with multiple units. * Composite units often have an alias unit associated with them, as they do not have a reference name on their own. * For example, a joule is defined as an alias defined in relation to a composite unit defined as "Newton * meter". * * The names of composite units is only used to reference the unit in definitions of other units. * They can not be used in expressions. * * Composite units is definited as a composition of units. * The units, with prefixes and exponents, can either be added one by one with add() or * parsed from an expression (ex. "cm^3/g) with setBaseExpression(). */ class CompositeUnit : public Unit { protected: string sshort; vector units; public: CompositeUnit(string cat_, string name_, string title_ = "", string base_expression_ = "", bool is_local = true, bool is_builtin = false, bool is_active = true); CompositeUnit(const CompositeUnit *unit); virtual ~CompositeUnit(); virtual ExpressionItem *copy() const; virtual void set(const ExpressionItem *item); /** Adds a sub/base unit with specified exponent and an optional prefix. * * @param u Unit. * @param exp Exponent. * @param prefix Prefix. */ virtual void add(Unit *u, int exp = 1, Prefix *prefix = NULL); /** Retrieves information about a sub/base unit * * @param index Index starting at 1. * @param[out] exp Exponent. * @param[out] prefix Prefix. * @returns Sub/base unit (AliasUnit_Composite::firstBaseUnit()). */ virtual Unit *get(size_t index, int *exp = NULL, Prefix **prefix = NULL) const; virtual void setExponent(size_t index, int exp); virtual void setPrefix(size_t index, Prefix *prefix); /** Returns the number of sub/base units */ virtual size_t countUnits() const; virtual size_t find(Unit *u) const; virtual void del(size_t index); /** Prints out the sub/base units with prefixes and exponents. * This is the representation of the unit in expressions. */ virtual string print(bool plural_, bool short_, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; virtual int subtype() const; /** If this unit contains a sub/base unit with a relation to the specified unit. */ virtual bool containsRelativeTo(Unit *u) const; /** Creates a MathStructure with the sub/base units of the unit. */ virtual MathStructure generateMathStructure(bool make_division = false, bool set_null_prefixes = false) const; virtual void setBaseExpression(string base_expression_); /** Removes all sub/base units. */ virtual void clear(); }; #endif libqalculate-2.8.2/libqalculate/Calculator.h0000644000175000017500000016005313365127205016023 00000000000000/* Qalculate Copyright (C) 2003-2007, 2008, 2016-2018 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef CALCULATOR_H #define CALCULATOR_H #include #include #include /** @file */ /** \mainpage Index * * \section intro_sec Introduction * * libqalculate is math libary for expression evaluation with units, variables and functions support and CAS functionality. * * The main parts of the library is the almighty Calculator class, the MathStructure class for mathematical expressions and classes for objects in an expression, * mostly of the class Numbers and sub classes of ExpressionItem. * * A simple application using libqalculate need only create a calculator object, perhaps load definitions (functions, variables, units, etc.), and calculate (and output) an expression as follows: * \code * new Calculator(); * CALCULATOR->loadGlobalDefinitions(); * CALCULATOR->loadLocalDefinitions(); * cout << CALCULATOR->calculateAndPrint("1 + 1", 2000) << endl;\endcode * In the above example, the calculation is terminated after two seconds (2000 ms), if it is not finished before then. * Applications using localized numbers should first call Calculalor::unlocalizeExpression() on the expression. * * A less simple application might calculate and output the expression separately. * \code * EvaluationOptions eo; * MathStructure result; * CALCULATOR->calculate(&mstruct, unlocalizeExpression("1 + 1"), 2000, eo);\endcode * * More complex usage mainly involves manipulating objects of the MathStructure class directly. * * To display the resulting expression use Calculator::print() as follows: * \code * PrintOptions po; * string result_str = CALCULATOR->print(result, 2000, po);\endcode * Alternatively MathStructure::format() followed by MathStructure::print() can be used, whithout the possiblity to specify a time limit. * * Central to the flexiblity of libqalculate is the many options passed to evaluating and display functions with EvaluationOptions and PrintOptions. * * \section usage_sec Using the library * * libqalculate uses pkg-config. * * For a simple program use pkg-config on the command line: * \code c++ `pkg-config --cflags --libs libqalculate` hello.c -o hello \endcode * * If the program uses autoconf, put the following in configure.ac: * \code PKG_CHECK_MODULES(QALCULATE, [ * libqalculate >= 1.0.0 * ]) * AC_SUBST(QALCULATE_CFLAGS) * AC_SUBST(QALCULATE_LIBS) \endcode */ typedef vector p_type; /// Parameters passed to plotting functions. struct PlotParameters { /// Title label. string title; /// Y-axis label. string y_label; /// X-axis label. string x_label; /// Image to save plot to. If empty shows plot in a window on the screen. string filename; /// The image type to save as. Set to PLOT_FILETYPE_AUTO to guess from file extension. PlotFileType filetype; /// Font used for text string font; /// Set to true for colored plot, false for monochrome. Default: true bool color; /// If the minimum y-axis value shall be set automatically (otherwise uses y_min). Default: true bool auto_y_min; /// If the minimum x-axis value shall be set automatically (otherwise uses x_min). Default: true bool auto_x_min; /// If the maximum y-axis value shall be set automatically (otherwise uses y_max). Default: true bool auto_y_max; /// If the maximum x-axis value shall be set automatically (otherwise uses x_max). Default: true bool auto_x_max; /// Minimum y-axis value. float y_min; /// Minimum x-axis value. float x_min; /// Maximum y-axis value. float y_max; /// Maximum x-axis value. float x_max; /// If a logarithimic scale shall be used for the y-axis. Default: false bool y_log; /// If a logarithimic scale shall be used for the x-axis. Default: false bool x_log; /// Logarithimic base for the y-axis. Default: 10 int y_log_base; /// Logarithimic base for the x-axis. Default: 10 int x_log_base; /// If a grid shall be shown in the plot. Default: false bool grid; /// Width of lines. Default: 2 int linewidth; /// If the plot shall be surrounded by borders on all sides (not just axis). Default: false bool show_all_borders; /// Where the plot legend shall be placed. Default: PLOT_LEGEND_TOP_RIGHT PlotLegendPlacement legend_placement; PlotParameters(); }; /// Parameters for plot data series. struct PlotDataParameters { /// Title label. string title; /// Plot smoothing. PlotSmoothing smoothing; /// Plot style PlotStyle style; /// Use scale on second y-axis bool yaxis2; /// Use scale on second x-axis bool xaxis2; /// Check if data is continuous bool test_continuous; PlotDataParameters(); }; ///Message types typedef enum { MESSAGE_INFORMATION, MESSAGE_WARNING, MESSAGE_ERROR } MessageType; ///Message stages #define MESSAGE_STAGE_CONVERSION -4 #define MESSAGE_STAGE_CONVERSION_PARSING -3 #define MESSAGE_STAGE_CALCULATION -2 #define MESSAGE_STAGE_PARSING -1 #define MESSAGE_STAGE_UNSET 0 ///Message categories #define MESSAGE_CATEGORY_NONE 0 #define MESSAGE_CATEGORY_PARSING 1 /// A message with information to the user. Primarily used for errors and warnings. class CalculatorMessage { protected: string smessage; MessageType mtype; int i_stage, i_cat; public: CalculatorMessage(string message_, MessageType type_ = MESSAGE_WARNING, int cat_ = MESSAGE_CATEGORY_NONE, int stage_ = MESSAGE_STAGE_UNSET); CalculatorMessage(const CalculatorMessage &e); string message() const; const char* c_message() const; MessageType type() const; int stage() const; int category() const; }; #include enum { ELEMENT_CLASS_NOT_DEFINED, ALKALI_METALS, ALKALI_EARTH_METALS, LANTHANIDES, ACTINIDES, TRANSITION_METALS, METALS, METALLOIDS, NONMETALS, HALOGENS, NOBLE_GASES, TRANSACTINIDES }; struct Element { string symbol, name; int number, group; string weight; int x_pos, y_pos; }; #define UFV_LENGTHS 20 class Calculate_p; /// The almighty calculator class. /** The calculator class is responsible for loading functions, variables and units, and keeping track of them, as well as parsing expressions and much more. A calculator object must be created before any other Qalculate! class is used. There should never be more than one calculator object, accessed with CALCULATOR. * * A simple application using libqalculate need only create a calculator object, perhaps load definitions (functions, variables, units, etc.) and use the calculate function as follows: * \code new Calculator(); * CALCULATOR->loadGlobalDefinitions(); * CALCULATOR->loadLocalDefinitions(); * MathStructure result = CALCULATOR->calculate("1 + 1");\endcode */ class Calculator { protected: vector messages; int ianglemode; int i_precision; bool b_interval; int i_stop_interval; int i_start_interval; char vbuffer[200]; vector ufvl; vector ufvl_t; vector ufvl_i; vector ufv[4][UFV_LENGTHS]; vector ufv_i[4][UFV_LENGTHS]; vector data_sets; class Calculator_p *priv; vector signs; vector real_signs; vector default_signs; vector default_real_signs; char *saved_locale; int disable_errors_ref; vector stopped_errors_count; vector stopped_warnings_count; vector stopped_messages_count; vector > stopped_messages; Thread *calculate_thread; string NAME_NUMBER_PRE_S, NAME_NUMBER_PRE_STR, DOT_STR, DOT_S, COMMA_S, COMMA_STR, ILLEGAL_IN_NAMES, ILLEGAL_IN_UNITNAMES, ILLEGAL_IN_NAMES_MINUS_SPACE_STR; bool b_argument_errors; int current_stage; time_t exchange_rates_time[3], exchange_rates_check_time[3]; int b_exchange_rates_used; bool b_exchange_rates_warning_enabled; bool b_gnuplot_open; string gnuplot_cmdline; FILE *gnuplot_pipe; bool local_to; Assumptions *default_assumptions; vector deleted_variables; vector deleted_functions; vector deleted_units; bool b_var_units; bool b_save_called; int i_timeout; struct timeval t_end; int i_aborted; bool b_controlled; string per_str, times_str, plus_str, minus_str, and_str, AND_str, or_str, OR_str, XOR_str; size_t per_str_len, times_str_len, plus_str_len, minus_str_len, and_str_len, AND_str_len, or_str_len, OR_str_len, XOR_str_len; vector rpn_stack; bool calculateRPN(MathStructure *mstruct, int command, size_t index, int msecs, const EvaluationOptions &eo, int function_arguments = 0); bool calculateRPN(string str, int command, size_t index, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division, int function_arguments = 0); public: KnownVariable *v_pi, *v_e, *v_euler, *v_catalan, *v_i, *v_pinf, *v_minf, *v_undef, *v_precision; KnownVariable *v_percent, *v_permille, *v_permyriad; KnownVariable *v_today, *v_yesterday, *v_tomorrow, *v_now; UnknownVariable *v_x, *v_y, *v_z; UnknownVariable *v_C, *v_n; MathFunction *f_vector, *f_sort, *f_rank, *f_limits, *f_component, *f_dimension, *f_merge_vectors; MathFunction *f_matrix, *f_matrix_to_vector, *f_area, *f_rows, *f_columns, *f_row, *f_column, *f_elements, *f_element, *f_transpose, *f_identity, *f_determinant, *f_permanent, *f_adjoint, *f_cofactor, *f_inverse, *f_magnitude, *f_hadamard, *f_entrywise; MathFunction *f_factorial, *f_factorial2, *f_multifactorial, *f_binomial; MathFunction *f_xor, *f_bitxor, *f_even, *f_odd, *f_shift, *f_bitcmp; MathFunction *f_abs, *f_gcd, *f_lcm, *f_signum, *f_heaviside, *f_dirac, *f_round, *f_floor, *f_ceil, *f_trunc, *f_int, *f_frac, *f_rem, *f_mod; MathFunction *f_polynomial_unit, *f_polynomial_primpart, *f_polynomial_content, *f_coeff, *f_lcoeff, *f_tcoeff, *f_degree, *f_ldegree; MathFunction *f_re, *f_im, *f_arg, *f_numerator, *f_denominator, *f_interval; MathFunction *f_sqrt, *f_cbrt, *f_root, *f_sq; MathFunction *f_exp; MathFunction *f_ln, *f_logn; MathFunction *f_lambert_w; MathFunction *f_sin, *f_cos, *f_tan, *f_asin, *f_acos, *f_atan, *f_sinh, *f_cosh, *f_tanh, *f_asinh, *f_acosh, *f_atanh, *f_atan2, *f_sinc, *f_radians_to_default_angle_unit; MathFunction *f_zeta, *f_gamma, *f_digamma, *f_beta, *f_airy, *f_besselj, *f_bessely, *f_erf, *f_erfc; MathFunction *f_total, *f_percentile, *f_min, *f_max, *f_mode, *f_rand; MathFunction *f_date, *f_datetime, *f_timevalue, *f_timestamp, *f_stamptodate, *f_days, *f_yearfrac, *f_week, *f_weekday, *f_month, *f_day, *f_year, *f_yearday, *f_time, *f_add_days, *f_add_months, *f_add_years; MathFunction *f_lunarphase, *f_nextlunarphase; MathFunction *f_bin, *f_oct, *f_hex, *f_base, *f_roman; MathFunction *f_ascii, *f_char; MathFunction *f_length, *f_concatenate; MathFunction *f_replace, *f_stripunits; MathFunction *f_genvector, *f_for, *f_sum, *f_product, *f_process, *f_process_matrix, *f_csum, *f_if, *f_is_number, *f_is_real, *f_is_rational, *f_is_integer, *f_represents_number, *f_represents_real, *f_represents_rational, *f_represents_integer, *f_function, *f_select; MathFunction *f_diff, *f_integrate, *f_solve, *f_multisolve, *f_dsolve, *f_limit; MathFunction *f_li, *f_Li, *f_Ei, *f_Si, *f_Ci, *f_Shi, *f_Chi, *f_igamma; MathFunction *f_error, *f_warning, *f_message, *f_save, *f_load, *f_export, *f_title; MathFunction *f_register, *f_stack; MathFunction *f_plot; Unit *u_rad, *u_gra, *u_deg, *u_euro, *u_btc, *u_second, *u_minute, *u_hour, *u_year, *u_month, *u_day; DecimalPrefix *decimal_null_prefix; BinaryPrefix *binary_null_prefix; bool place_currency_code_before, place_currency_sign_before; bool place_currency_code_before_negative, place_currency_sign_before_negative; bool default_dot_as_separator; string local_digit_group_separator, local_digit_group_format; bool b_busy; string expression_to_calculate; EvaluationOptions tmp_evaluationoptions; MathStructure *tmp_parsedstruct; MathStructure *tmp_tostruct; MathStructure *tmp_rpn_mstruct; bool tmp_maketodivision; int tmp_proc_command; int tmp_proc_registers; size_t tmp_rpnindex; PrintOptions save_printoptions, message_printoptions; vector variables; vector functions; vector units; vector prefixes; vector decimal_prefixes; vector binary_prefixes; /** @name Constructor */ //@{ Calculator(); virtual ~Calculator(); //@} /** @name Functions for calculating expressions. */ //@{ /** Calculates an expression. The expression should be unlocalized first with unlocalizeExpression(). * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param[out] mstruct Math structure to fill with the result. * @param str Expression. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression. * @param[out] to_struct NULL or a math structure to fill with unit expression parsed after "to". If expression does not contain a "to" string, and to_struct is a unit or a symbol (a unit expression string), to_struct will be used instead. * @param make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculate(MathStructure *mstruct, string str, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); /** Calculates an expression. The expression should be unlocalized first with unlocalizeExpression(). * * @param str Expression. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression. * @param[out] to_struct NULL or a math structure to fill with unit expression parsed after "to". If expression does not contain a "to" string, and to_struct is a unit or a symbol (a unit expression string), to_struct will be used instead. * @param make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to. * @returns The result of the calculation. */ MathStructure calculate(string str, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); /** Calculates a parsed value. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param[out] mstruct Parsed value to evaluate and fill with the result. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation of the expression. * @param to_str "to" expression for conversion. * @returns The result of the calculation. */ bool calculate(MathStructure *mstruct, int msecs, const EvaluationOptions &eo = default_evaluation_options, string to_str = ""); /** Calculates a parsed value. * * @param mstruct Parsed value to evaluate. * @param eo Options for the evaluation of the expression. * @param to_str "to" expression for conversion. * @returns The result of the calculation. */ MathStructure calculate(const MathStructure &mstruct, const EvaluationOptions &eo = default_evaluation_options, string to_str = ""); /** Calculates an expression.and outputs the result to a text string. The expression should be unlocalized first with unlocalizeExpression(). * * Unlike other functions for expression evaluation this function handles ending "to"-commmands, in addition to unit conversion, such "to hexadecimal" or to "fractions", similar to the qalc application. * * * @param str Expression. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param po Result formatting options. * @returns The result of the calculation. * \since 2.6.0 */ string calculateAndPrint(string str, int msecs = 10000, const EvaluationOptions &eo = default_evaluation_options, const PrintOptions &po = default_print_options); int testCondition(string expression); //@} /** @name Functions for printing expressions with the option to set maximum time or abort. */ //@{ /** Calls MathStructure::format(po) and MathStructure::print(po). The process is aborted after msecs milliseconds. */ string print(const MathStructure &mstruct, int milliseconds = 100000, const PrintOptions &op = default_print_options); ///Deprecated: use print() instead string printMathStructureTimeOut(const MathStructure &mstruct, int milliseconds = 100000, const PrintOptions &op = default_print_options); /** Called before calculation, formatting or printing of a MathStructure (Calculator::calculate(), without maximum time, MathStructure::eval(), MathStructure::format() and MathStructure::print(), etc.) or printing of a Number (using Number::print) to be able to abort the process. Always use Calculator::stopControl() after finishing. * * @param milliseconds The maximum time for the process in milliseconds. If msecs <= 0 the time will be unlimited (stop with abort()). */ void startControl(int milliseconds = 0); /** Always call this function after Calculator::startControl() after formatting, printing or calculation has finished. */ void stopControl(void); /** Abort formatting, printing or evaluation (after startControl() has been called). * This function will normally be called from a thread that checks for user input or other conditions. * * @returns false if the calculation thread was forcibly stopped */ bool abort(); bool aborted(void); bool isControlled(void) const; string abortedMessage(void) const; string timedOutString(void) const; ///Deprecated: use startControl() void startPrintControl(int milliseconds = 0); ///Deprecated: use abort() void abortPrint(void); ///Deprecated: use stopControl() void stopPrintControl(void); /// Deprecated: use aborted() bool printingAborted(void); /// Deprecated: use isControlled() bool printingControlled(void) const; /// Deprecated: use abortedMessage() string printingAbortedMessage(void) const; //@} /** @name Functions for handling of threaded calculations */ //@{ /** Returns true if the calculate or print thread is busy. */ bool busy(); /// Deprecated: does nothing. void saveState(); /// Deprecated: does nothing. void restoreState(); /** Clears all stored values. Used internally after aborted calculation. */ void clearBuffers(); /** Terminate calculation and print threads if started. Do not use to terminate calculation. */ void terminateThreads(); //@} /** @name Functions for manipulation of the RPN stack. */ //@{ /** Evaluates a value on the RPN stack. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param index Index, starting at 1, on the RPN stack. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPNRegister(size_t index, int msecs, const EvaluationOptions &eo = default_evaluation_options); /** Applies a mathematical operation to the first and second value on the RPN stack. The the second value is changed with input from the first value. * For example, with OPERATION_SUBTRACT the first value is subtracted from the second. The first value on the stack is removed. * If not enough registers is available, then zeros are added. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param op Operation. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPN(MathOperation op, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies a mathematical operation to the first value on the RPN stack. The value is set as the first argument of the function. * If no register is available, then zero is added. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param f Mathematical function. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPN(MathFunction *f, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies bitwise not to the first value on the RPN stack. * If no register is available, then zero is added. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPNBitwiseNot(int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies logical not to the first value on the RPN stack. * If no register is available, then zero is added. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool calculateRPNLogicalNot(int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies a mathematical operation to the first and second value on the RPN stack. The the second value is changed with input from the first value. * For example, with OPERATION_SUBTRACT the first value is subtracted from the second. The first value on the stack is removed. * If not enough registers is available, then zeros are added. * * @param op Operation. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns The first value on the stack. */ MathStructure *calculateRPN(MathOperation op, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies a mathematical operation to the first value on the RPN stack. The value is set as the first argument of the function. * If no register is available, then zero is added. * * @param f Mathematical function. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns The first value on the stack. */ MathStructure *calculateRPN(MathFunction *f, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies bitwise not to the first value on the RPN stack. * If no register is available, then zero is added. * * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns The first value on the stack. */ MathStructure *calculateRPNBitwiseNot(const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Applies logical not to the first value on the RPN stack. * If no register is available, then zero is added. * * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the unevaluated result. * @returns The first value on the stack. */ MathStructure *calculateRPNLogicalNot(const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL); /** Evaluates a value and adds the result first on the RPN stack. * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param mstruct Value. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation of the expression. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool RPNStackEnter(MathStructure *mstruct, int msecs, const EvaluationOptions &eo = default_evaluation_options); /** Calculates an expression and adds the result first on the RPN stack. The expression should be unlocalized first with unlocalizeExpression(). * This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. * The calculation can then be stopped with abort(). * * @param str Expression. * @param msecs The maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression. * @param[out] to_struct NULL or a math structure to fill with unit expression parsed after "to". * @param make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to. * @returns true if the calculation was successfully started (and finished if msecs > 0). */ bool RPNStackEnter(string str, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); /** Adds a value first on the RPN stack. * * @param mstruct Value. * @param eval If true, the the mathematical structure will be evaluated first. */ void RPNStackEnter(MathStructure *mstruct, bool eval = false, const EvaluationOptions &eo = default_evaluation_options); /** Calculates an expression adds the result first on the RPN stack. The expression should be unlocalized first with unlocalizeExpression(). * * @param str Expression. * @param eo Options for the evaluation and parsing of the expression. * @param[out] parsed_struct NULL or a math structure to fill with the result of the parsing of the expression. * @param[out] to_struct NULL or a math structure to fill with unit expression parsed after "to". * @param make_to_division If true, the expression after "to" will be interpreted as a unit epxression to convert the result to. */ void RPNStackEnter(string str, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); bool setRPNRegister(size_t index, MathStructure *mstruct, int msecs, const EvaluationOptions &eo = default_evaluation_options); bool setRPNRegister(size_t index, string str, int msecs, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); void setRPNRegister(size_t index, MathStructure *mstruct, bool eval = false, const EvaluationOptions &eo = default_evaluation_options); void setRPNRegister(size_t index, string str, const EvaluationOptions &eo = default_evaluation_options, MathStructure *parsed_struct = NULL, MathStructure *to_struct = NULL, bool make_to_division = true); void deleteRPNRegister(size_t index); MathStructure *getRPNRegister(size_t index = 1) const; size_t RPNStackSize() const; void clearRPNStack(); void moveRPNRegister(size_t old_index, size_t new_index); void moveRPNRegisterUp(size_t index); void moveRPNRegisterDown(size_t index); //@} /** @name Functions for expression parsing. */ //@{ /** Returns a localized expressions. Affects decimal signs and argument separators. * * @param str The expression to localize. * @returns A localized expression. */ string localizeExpression(string str, const ParseOptions &po = default_parse_options) const; /** Returns an unlocalized expressions. Affects decimal signs and argument separators. * * @param str The expression to unlocalize. * @returns An unlocalized expression. */ string unlocalizeExpression(string str, const ParseOptions &po = default_parse_options) const; /** Split an expression string after and before " to ". * * @param[out] str The expression. Will be set to the string before " to ". * @param[out] to_str Will be set to the string after " to ". * @param eo Options for the evaluation and parsing of the expression (nothing will be done if units are not enabled). * @returns true if " to " was found and the expression split. */ bool separateToExpression(string &str, string &to_str, const EvaluationOptions &eo, bool keep_modifiers = false, bool allow_empty_from = false) const; bool hasToExpression(const string &str, bool allow_empty_from = false) const; void parseSigns(string &str, bool convert_to_internal_representation = false) const; /** Parse an expression and place in a MathStructure object. * * @param str Expression * @param po Parse options. * @returns MathStructure with result of parse. */ MathStructure parse(string str, const ParseOptions &po = default_parse_options); void parse(MathStructure *mstruct, string str, const ParseOptions &po = default_parse_options); bool parseNumber(MathStructure *mstruct, string str, const ParseOptions &po = default_parse_options); bool parseOperators(MathStructure *mstruct, string str, const ParseOptions &po = default_parse_options); bool parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po, MathOperation s, bool append = true); bool parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po); //@} /** @name Functions converting epxressions between units. */ //@{ /** Converts to a unit expression. * The converted value is evaluated. * * @param mstruct The value to convert. * @param composite_ Unit expression. * @param eo Evaluation options. * @param[out] units NULL or a math structure to fill with the parsed unit expression(or set to undefined if no units were found). * @returns Converted value. */ MathStructure convert(const MathStructure &mstruct, string composite_, const EvaluationOptions &eo = default_evaluation_options, MathStructure *units = NULL); /** Converts to a unit. * The converted value is evaluated. * * @param mstruct The value to convert. * @param composite_ Unit to convert to. * @param eo Evaluation options. * @param always_convert ... * @returns Converted value. */ MathStructure convert(const MathStructure &mstruct, Unit *to_unit, const EvaluationOptions &eo = default_evaluation_options, bool always_convert = true, bool convert_to_mixed_units = true); MathStructure convert(const MathStructure &mstruct, KnownVariable *to_var, const EvaluationOptions &eo = default_evaluation_options); MathStructure convert(double value, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo = default_evaluation_options); MathStructure convert(string str, Unit *from_unit, Unit *to_unit, int milliseconds, const EvaluationOptions &eo = default_evaluation_options); /** Depecated: use convert() */ MathStructure convertTimeOut(string str, Unit *from_unit, Unit *to_unit, int milliseconds, const EvaluationOptions &eo = default_evaluation_options); MathStructure convert(string str, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo = default_evaluation_options); MathStructure convertToBaseUnits(const MathStructure &mstruct, const EvaluationOptions &eo = default_evaluation_options); Unit *getBestUnit(Unit *u, bool allow_only_div = false, bool convert_to_local_currency = true); MathStructure convertToBestUnit(const MathStructure &mstruct, const EvaluationOptions &eo = default_evaluation_options, bool convert_to_si_units = true); MathStructure convertToCompositeUnit(const MathStructure &mstruct, CompositeUnit *cu, const EvaluationOptions &eo = default_evaluation_options, bool always_convert = true); MathStructure convertToMixedUnits(const MathStructure &mstruct, const EvaluationOptions &eo = default_evaluation_options); //@} /** Used by the UI to find unit category for a mathematical expression.*/ Unit *findMatchingUnit(const MathStructure &mstruct); /** @name Functions for default assumptions for unknown variables and symbols */ //@{ /** Set assumptions for objects without own assumptions (unknown variables and symbols). */ void setDefaultAssumptions(Assumptions *ass); /** Returns the default assumptions for objects without own assumptions (unknown variables and symbols). */ Assumptions *defaultAssumptions(); //@} /** @name Functions for retrieval of angle units */ //@{ /** Returns the gradians unit. */ Unit *getGraUnit(); /** Returns the radians unit. */ Unit *getRadUnit(); /** Returns the degrees unit. */ Unit *getDegUnit(); //@} /** @name Functions for finding a suitable prefix. */ //@{ /** Returns a decimal prefix with exactly the provided value, that fulfils the condition prefix->exponent(exp) == exp10. * * @param exp10 Base-10 exponent of the requested prefix. * @param exp The exponent of the unit. * @returns A prefix or NULL if not found. */ DecimalPrefix *getExactDecimalPrefix(int exp10, int exp = 1) const; /** Returns a binary prefix with exactly the provided value, that fulfils the condition prefix->exponent(exp) == exp2. * * @param exp2 Base-2 exponent of the requested prefix. * @param exp The exponent of the unit. * @returns A prefix or NULL if not found. */ BinaryPrefix *getExactBinaryPrefix(int exp2, int exp = 1) const; /** Returns a prefix with exactly the provided value, that fulfils the condition prefix->value(exp) == o. * * @param o Value of the requested prefix. * @param exp The exponent of the unit. * @returns A prefix or NULL if not found. */ Prefix *getExactPrefix(const Number &o, int exp = 1) const; /** Returns the nearest decimal prefix for a value. * * @param exp10 Base-10 exponent of the value. * @param exp The exponent of the unit. * @returns A prefix or NULL if no decimal prefix is available. */ DecimalPrefix *getNearestDecimalPrefix(int exp10, int exp = 1) const; /** Returns the best suited decimal prefix for a value. * * @param exp10 Base-10 exponent of the value. * @param exp The exponent of the unit. * @param all_prefixes If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will be skipped. * @returns A prefix or NULL if the unit should be left without prefix. */ DecimalPrefix *getBestDecimalPrefix(int exp10, int exp = 1, bool all_prefixes = true) const; /** Returns the best suited decimal prefix for a value. * * @param exp10 Base-10 exponent of the value. * @param exp The exponent of the unit. * @param all_prefixes If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will be skipped. * @returns A prefix or NULL if the unit should be left without prefix. */ DecimalPrefix *getBestDecimalPrefix(const Number &exp10, const Number &exp, bool all_prefixes = true) const; /** Returns the nearest binary prefix for a value. * * @param exp10 Base-2 exponent of the value. * @param exp The exponent of the unit. * @returns A prefix or NULL if no binary prefix is available. */ BinaryPrefix *getNearestBinaryPrefix(int exp2, int exp = 1) const; /** Returns the best suited binary prefix for a value. * * @param exp10 Base-2 exponent of the value. * @param exp The exponent of the unit. * @returns A prefix or NULL if the unit should be left without prefix. */ BinaryPrefix *getBestBinaryPrefix(int exp2, int exp = 1) const; /** Returns the best suited binary prefix for a value. * * @param exp10 Base-2 exponent of the value. * @param exp The exponent of the unit. * @returns A prefix or NULL if the unit should be left without prefix. */ BinaryPrefix *getBestBinaryPrefix(const Number &exp2, const Number &exp) const; /** Add a new prefix to the calculator. */ Prefix *addPrefix(Prefix *p); /** Used internally. */ void prefixNameChanged(Prefix *p, bool new_item = false); //@} /** @name Functions for managing functions, variables, units, prefixes and data sets. */ //@{ void expressionItemActivated(ExpressionItem *item); void expressionItemDeactivated(ExpressionItem *item); void expressionItemDeleted(ExpressionItem *item); void nameChanged(ExpressionItem *item, bool new_item = false); void deleteName(string name_, ExpressionItem *object = NULL); void deleteUnitName(string name_, Unit *object = NULL); Unit* addUnit(Unit *u, bool force = true, bool check_names = true); void delPrefixUFV(Prefix *object); void delUFV(ExpressionItem *object); /** Checks if a variable exists/is registered in the calculator. */ bool hasVariable(Variable *v); /** Checks if a unit exists/is registered in the calculator. */ bool hasUnit(Unit *u); /** Checks if a function exists/is registered in the calculator. */ bool hasFunction(MathFunction *f); /** Checks if a pointer points to a variable that still exists in the calculator. * As opposed to hasFunction(), this function only checks if the mathematical function has been deleted. */ bool stillHasVariable(Variable *v); /** Checks if a pointer points to a unit that still exists in the calculator. * As opposed to hasUnit(), this function only checks if the unit has been deleted. */ bool stillHasUnit(Unit *u); /** Checks if a pointer points to a mathematical function that still exists in the calculator. * As opposed to hasFunction(), this function only checks if the mathematical function has been deleted. */ bool stillHasFunction(MathFunction *f); void saveFunctionCalled(); bool checkSaveFunctionCalled(); ExpressionItem *getActiveExpressionItem(string name, ExpressionItem *item = NULL); ExpressionItem *getInactiveExpressionItem(string name, ExpressionItem *item = NULL); ExpressionItem *getActiveExpressionItem(ExpressionItem *item); ExpressionItem *getExpressionItem(string name, ExpressionItem *item = NULL); Unit* getUnit(string name_); Unit* getActiveUnit(string name_); Unit* getCompositeUnit(string internal_name_); Unit* getLocalCurrency(); /** Returns prefix for an index (starting at zero). All prefixes can be traversed by starting at index zero and increasing the index until NULL is returned. * * @param index Index of prefix. * @returns Prefix for index or NULL if not found. */ Prefix *getPrefix(size_t index) const; /** Returns prefix with provided name. * * @param name_ Name of prefix to retrieve. * @returns Prefix with provided name or NULL if not found. */ Prefix *getPrefix(string name_) const; Variable* addVariable(Variable *v, bool force = true, bool check_names = true); void variableNameChanged(Variable *v, bool new_item = false); void functionNameChanged(MathFunction *f, bool new_item = false); void unitNameChanged(Unit *u, bool new_item = false); Variable* getVariable(string name_); Variable* getActiveVariable(string name_); ExpressionItem *addExpressionItem(ExpressionItem *item, bool force = true); MathFunction* addFunction(MathFunction *f, bool force = true, bool check_names = true); DataSet* addDataSet(DataSet *dc, bool force = true, bool check_names = true); DataSet* getDataSet(size_t index); DataSet* getDataSet(string name); MathFunction* getFunction(string name_); MathFunction* getActiveFunction(string name_); /** Returns variable for an index (starting at zero). All variables can be traversed by starting at index zero and increasing the index until NULL is returned. * * @param index Index of variable. * @returns Variable for index or NULL if not found. */ Variable *getVariable(size_t index) const; /** Returns unit for an index (starting at zero). All units can be traversed by starting at index zero and increasing the index until NULL is returned. * * @param index Index of unit. * @returns Unit for index or NULL if not found. */ Unit *getUnit(size_t index) const; /** Returns function for an index (starting at zero). All functions can be traversed by starting at index zero and increasing the index until NULL is returned. * * @param index Index of function. * @returns Function for index or NULL if not found. */ MathFunction *getFunction(size_t index) const; bool unitIsUsedByOtherUnits(const Unit *u) const; //@} /** @name Functions for handling of builtin expression items */ //@{ /** Unloads all non-builtin variables. */ void resetVariables(); /** Unloads all non-builtin functions. */ void resetFunctions(); /** Unloads all non-builtin units. */ void resetUnits(); /** Unloads all non-builtin variables, functions and units. */ void reset(); /** Adds builtin variables. Called automatically when the calculator is created. */ void addBuiltinVariables(); /** Adds builtin functions. Called automatically when the calculator is created. */ void addBuiltinFunctions(); /** Adds builtin units. Called automatically when the calculator is created. */ void addBuiltinUnits(); //@} void setVariableUnitsEnabled(bool enable_variable_units = true); bool variableUnitsEnabled() const; /** @name Functions for testing validity of functions, variable and unit names. */ //@{ /** Tests if a name is valid for a variable. * * @param name_ Variable name. * @returns true if the name is valid for a variable. */ bool variableNameIsValid(const string &name_); /** Tests if a name is valid for a variable. * * @param name_ Variable name. * @returns true if the name is valid for a variable. */ bool variableNameIsValid(const char *name_); bool variableNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs); bool variableNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs); string convertToValidVariableName(string name_); bool functionNameIsValid(const string &name_); bool functionNameIsValid(const char *name_); bool functionNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs); bool functionNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs); string convertToValidFunctionName(string name_); bool unitNameIsValid(const string &name_); bool unitNameIsValid(const char *name_); bool unitNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs); bool unitNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs); bool utf8_pos_is_valid_in_name(char *pos); string convertToValidUnitName(string name_); /** Checks if a name is used by another object which is not allowed to have the same name. * * @param name Name. * @param object Object to exclude from check. * @returns true if the name is used. */ bool nameTaken(string name, ExpressionItem *object = NULL); bool variableNameTaken(string name, Variable *object = NULL); bool unitNameTaken(string name, Unit *object = NULL); bool functionNameTaken(string name, MathFunction *object = NULL); string getName(string name = "", ExpressionItem *object = NULL, bool force = false, bool always_append = false); //@} /** @name Functions for message handling. */ //@{ void error(bool critical, int message_category, const char *TEMPLATE,...); void error(bool critical, const char *TEMPLATE,...); /** Put a message in the message queue. */ void message(MessageType mtype, int message_category, const char *TEMPLATE,...); void message(MessageType mtype, const char *TEMPLATE,...); void message(MessageType mtype, int message_category, const char *TEMPLATE, va_list ap); /** Returns the first message in queue. */ CalculatorMessage *message(); /** Removes the first message in queue and returns the next. */ CalculatorMessage *nextMessage(); bool showArgumentErrors() const; void beginTemporaryStopMessages(); int endTemporaryStopMessages(int *message_count = NULL, int *warning_count = NULL, int release_messages_if_no_equal_or_greater_than_message_type = -1); void endTemporaryStopMessages(bool release_messages, vector *blocked_messages = NULL); void addMessages(vector *message_vector); const PrintOptions &messagePrintOptions() const; void setMessagePrintOptions(const PrintOptions &po); //@} /** @name Functions for loading and saving definitions (variables, functions, units, etc.). */ //@{ /** Load all standard global (system wide) definitions from the global data directory ($PREFIX/share/qalculate). * * @returns true if the definitions were successfully loaded. */ bool loadGlobalDefinitions(); /** Load global (system wide) definitions from a file in the global data directory ($PREFIX/share/qalculate). * * @param filename Name of the file in the global data directory. * @returns true if the definitions were successfully loaded. */ bool loadGlobalDefinitions(string filename); /** Load prefixes. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalPrefixes(); /** Load currencies. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalCurrencies(); /** Load units. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalUnits(); /** Load variables. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalVariables(); /** Load functions. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalFunctions(); /** Load data sets. * * @returns true if the definitions were successfully loaded. */ bool loadGlobalDataSets(); /** Load local, user specific, definitions from the local definitions directory (~/.qalculate/definitions). * All files in the directory and in the datasets subdirectory are loaded. * * @returns true if the definitions were successfully loaded. */ bool loadLocalDefinitions(); /** Load definitions from a file. * * @param file_name The path to the file to load. * @param is_user_defs true if the definitions are local, false if they are global. * @returns true if the definitions were successfully loaded. */ int loadDefinitions(const char *file_name, bool is_user_defs = true); /** Save local definitions to ~/.qalculate/definitions/ * * @returns true if definitions was successfully saved. */ bool saveDefinitions(); int saveDataObjects(); int savePrefixes(const char *file_name, bool save_global = false); string temporaryCategory(void) const; int saveVariables(const char *file_name, bool save_global = false); int saveUnits(const char *file_name, bool save_global = false); int saveFunctions(const char *file_name, bool save_global = false); int saveDataSets(const char *file_name, bool save_global = false); //@} /** @name Functions for CSV file import/export. */ //@{ bool importCSV(MathStructure &mstruct, const char *file_name, int first_row = 1, string delimiter = ",", vector *headers = NULL); bool importCSV(const char *file_name, int first_row = 1, bool headers = true, string delimiter = ",", bool to_matrix = false, string name = "", string title = "", string category = ""); bool exportCSV(const MathStructure &mstruct, const char *file_name, string delimiter = ","); //@} /** @name Functions for exchange rates. */ /** Checks if able to downloading exchange rates from the Internet (using libcurl). * * @returns true if exchange rates can downloaded (if libcurl is available). */ bool canFetch(); ///Deprecated: gvfs is not needed anymore. bool hasGVFS(); ///Deprecated: gvfs is not needed anymore. bool hasGnomeVFS(); /** Load saved (local) currency units and exchange rates. * * @returns true if operation successful. */ bool loadExchangeRates(); /** Name of the exchange rates file on local disc. * Multiple exchange rates sources might be used. Iterate over these, using the index parameter, until an empty string is returned. * * @param index The index (starting at one) of the exchange rate source * @returns name of local exchange rates file. */ string getExchangeRatesFileName(int index = 1); /** Url of the exchange rates file on the Internet. * Multiple exchange rates sources might be used. Iterate over these, using the index parameter, until an empty string is returned. * * @param index The index (starting at one) of the exchange rate source * @returns Url of exchange rates file. */ string getExchangeRatesUrl(int index = 1); /** Modification time of the exchange rates file. * * @returns Returns exchange rates modification time. */ time_t getExchangeRatesTime(int index = -1); ///Deprecated: wget arguments are not used bool fetchExchangeRates(int seconds, string wget_args); /** Download current exchange rates from the Internet to local disc with default wget arguments. * * @param seconds Maximum time for donwload try * @returns true if operation was successful. */ bool fetchExchangeRates(int seconds = 15, int n = -1); /** Check age of exchange rates on local disc. * * @param n_days How old in days exchange rates may be before exchange rates need updating * @param force_check If exchange rates date should be checked again even if found outdated within n_days before * @param send_warning If the standard exchange rates warning should be sent. * @returns false if exchange.rates need updating */ bool checkExchangeRatesDate(unsigned int n_days = 7, bool force_check = false, bool send_warning = false, int n = -1); /// Enable or disable old exchange rates warning (initial state is true). void setExchangeRatesWarningEnabled(bool enable); bool exchangeRatesWarningEnabled() const; /// Check if exchange rates has been used since resetExchangeRatesUsed() was last called int exchangeRatesUsed() const; void resetExchangeRatesUsed(); /// For internal use, called by currency units void setExchangeRatesUsed(int index); //@} /** @name Functions for plotting */ //@{ /** Checks if gnuplot is available. * * @returns true if gnuplot was found. */ bool canPlot(); MathStructure expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector = NULL, string x_var = "\\x", const ParseOptions &po = default_parse_options, int msecs = 5000); MathStructure expressionToPlotVector(string expression, float min, float max, int steps, MathStructure *x_vector = NULL, string x_var = "\\x", const ParseOptions &po = default_parse_options, int msecs = 5000); MathStructure expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector = NULL, string x_var = "\\x", const ParseOptions &po = default_parse_options, int msecs = 5000); MathStructure expressionToPlotVector(string expression, float min, float max, float step, MathStructure *x_vector = NULL, string x_var = "\\x", const ParseOptions &po = default_parse_options, int msecs = 5000); MathStructure expressionToPlotVector(string expression, const MathStructure &x_vector, string x_var = "\\x", const ParseOptions &po = default_parse_options, int msecs = 5000); bool plotVectors(PlotParameters *param, const vector &y_vectors, const vector &x_vectors, vector &pdps, bool persistent = false, int msecs = 5000); bool invokeGnuplot(string commands, string commandline_extra = "", bool persistent = false); bool closeGnuplot(); bool gnuplotOpen(); //@} /** @name Functions for global precision */ //@{ /** Set default precision for approximate calculations. * * @param precision Precision. */ void setPrecision(int precision = DEFAULT_PRECISION); /** Returns default precision for approximate calculations. */ int getPrecision() const; /** Set if interval arithmetic should be used for approximate calculations. * * @param use_interval_arithmetic Set true to activate, or false to deactivate, interval arithmetic. */ void useIntervalArithmetic(bool use_interval_arithmetic = true); /** Returns true if interval arithmetic are activated. */ bool usesIntervalArithmetic() const; void beginTemporaryStopIntervalArithmetic(); void endTemporaryStopIntervalArithmetic(); void beginTemporaryEnableIntervalArithmetic(); void endTemporaryEnableIntervalArithmetic(); //@} /** @name Functions for localization */ //@{ /** Returns the preferred decimal point character. */ const string &getDecimalPoint() const; /** Returns the preferred comma character for separating arguments.*/ const string &getComma() const; /** Sets argument separator and decimal sign from the current locale. Mainly for internal use. */ void setLocale(); void useDecimalComma(); /** Use point as decimal separator. * To use comma as an ignored separator in numbers, must be invoked with comma_as_separator = true, to change the default function argument separator to semicolon, in addition to using ParseOptions::comma_as_separator. */ void useDecimalPoint(bool comma_as_separator = false); /** Resets argument separator and decimal sign. Mainly for internal use. */ void unsetLocale(); /** Returns the translated text string used in expressions for converting to a specific unit expression (ex "5 meters to feet.*/ string localToString(bool include_spaces = true) const; //@} /** @name Functions adding alternative symbols for operators and such */ //@{ void addStringAlternative(string replacement, string standard); bool delStringAlternative(string replacement, string standard); void addDefaultStringAlternative(string replacement, string standard); bool delDefaultStringAlternative(string replacement, string standard); //@} /** @name Functions for storing values with associated identifiers */ //@{ /** Stores a value with an associated id. Mainly for internal use. * * @param mstruct The value to store. * @param persistent If false the values will be removed from storage when retrieved with getId(). * @returns Storage id. */ size_t addId(MathStructure *mstruct, bool persistent = false); /** Stores a function value with arguments parsed from a text string using Function::parse(), with an associated id. Mainly for internal use. * * @param f Mathematical function. * @param str Arguments. * @param po Parse options. * @param persistent If false the values will be removed from storage when retrieved with getId(). * @returns Storage id. */ size_t parseAddId(MathFunction *f, const string &str, const ParseOptions &po, bool persistent = false); size_t parseAddIdAppend(MathFunction *f, const MathStructure &append_mstruct, const string &str, const ParseOptions &po, bool persistent = false); size_t parseAddVectorId(const string &str, const ParseOptions &po, bool persistent = false); /** Returns a stored value. Mainly for internal use. * * @param id Storage id. * @returns A stored value. */ MathStructure *getId(size_t id); /** Removes and unreferences (value->unref() will be called) a value from storage. Mainly for internal use. * * @param id Storage id. */ void delId(size_t id); //@} }; #endif libqalculate-2.8.2/libqalculate/qalculate.h0000644000175000017500000000150413301564240015672 00000000000000/* Qalculate Copyright (C) 2003-2005 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef QALCULATE_H #define QALCULATE_H #include #include #include #include #include #include #include #include #include #include #include #include #endif libqalculate-2.8.2/libqalculate/BuiltinFunctions.cc0000644000175000017500000110303013366625543017371 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016, 2018 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "BuiltinFunctions.h" #include "util.h" #include "MathStructure.h" #include "Number.h" #include "Calculator.h" #include "Variable.h" #include "Unit.h" #include #include #include #define FR_FUNCTION(FUNC) Number nr(vargs[0].number()); if(!nr.FUNC() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !vargs[0].isApproximate()) || (!eo.allow_complex && nr.isComplex() && !vargs[0].number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !vargs[0].number().includesInfinity())) {return 0;} else {mstruct.set(nr); return 1;} #define FR_FUNCTION_2(FUNC) Number nr(vargs[0].number()); if(!nr.FUNC(vargs[1].number()) || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !vargs[0].isApproximate() && !vargs[1].isApproximate()) || (!eo.allow_complex && nr.isComplex() && !vargs[0].number().isComplex() && !vargs[1].number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !vargs[0].number().includesInfinity() && !vargs[1].number().includesInfinity())) {return 0;} else {mstruct.set(nr); return 1;} #define FR_FUNCTION_2R(FUNC) Number nr(vargs[1].number()); if(!nr.FUNC(vargs[0].number()) || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !vargs[0].isApproximate() && !vargs[1].isApproximate()) || (!eo.allow_complex && nr.isComplex() && !vargs[0].number().isComplex() && !vargs[1].number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !vargs[0].number().includesInfinity() && !vargs[1].number().includesInfinity())) {return 0;} else {mstruct.set(nr); return 1;} #define REPRESENTS_FUNCTION(x, y) x::x() : MathFunction(#y, 1) {} int x::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) {mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.y()) {mstruct.clear(); mstruct.number().setTrue();} else {mstruct.clear(); mstruct.number().setFalse();} return 1;} #define IS_NUMBER_FUNCTION(x, y) x::x() : MathFunction(#y, 1) {} int x::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) {mstruct = vargs[0]; if(!mstruct.isNumber()) mstruct.eval(eo); if(mstruct.isNumber() && mstruct.number().y()) {mstruct.number().setTrue();} else {mstruct.clear(); mstruct.number().setFalse();} return 1;} #define NON_COMPLEX_NUMBER_ARGUMENT(i) NumberArgument *arg_non_complex##i = new NumberArgument(); arg_non_complex##i->setComplexAllowed(false); setArgumentDefinition(i, arg_non_complex##i); #define NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(i) NumberArgument *arg_non_complex##i = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false); arg_non_complex##i->setComplexAllowed(false); setArgumentDefinition(i, arg_non_complex##i); #define NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR_NONZERO(i) NumberArgument *arg_non_complex##i = new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, true, false); arg_non_complex##i->setComplexAllowed(false); setArgumentDefinition(i, arg_non_complex##i); #define RATIONAL_NUMBER_ARGUMENT_NO_ERROR(i) NumberArgument *arg_rational##i = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false); arg_rational##i->setRationalNumber(true); setArgumentDefinition(i, arg_rational##i); #define RATIONAL_POLYNOMIAL_ARGUMENT(i) Argument *arg_poly##i = new Argument(); arg_poly##i->setRationalPolynomial(true); setArgumentDefinition(i, arg_poly##i); #define RATIONAL_POLYNOMIAL_ARGUMENT_HV(i) Argument *arg_poly##i = new Argument(); arg_poly##i->setRationalPolynomial(true); arg_poly##i->setHandleVector(true); setArgumentDefinition(i, arg_poly##i); extern string format_and_print(const MathStructure &mstruct); bool calculate_arg(MathStructure &mstruct, const EvaluationOptions &eo); VectorFunction::VectorFunction() : MathFunction("vector", -1) { } int VectorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs; mstruct.setType(STRUCT_VECTOR); return 1; } MatrixFunction::MatrixFunction() : MathFunction("matrix", 3) { Argument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE); arg->setHandleVector(false); setArgumentDefinition(1, arg); arg = new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE); arg->setHandleVector(false); setArgumentDefinition(2, arg); setArgumentDefinition(3, new VectorArgument()); } int MatrixFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { size_t rows = (size_t) vargs[0].number().uintValue(); size_t columns = (size_t) vargs[1].number().uintValue(); mstruct.clearMatrix(); mstruct.resizeMatrix(rows, columns, m_zero); size_t r = 1, c = 1; for(size_t i = 0; i < vargs[2].size(); i++) { if(r > rows || c > columns) { CALCULATOR->error(false, _("Too many elements (%s) for the dimensions (%sx%s) of the matrix."), i2s(vargs[2].size()).c_str(), i2s(rows).c_str(), i2s(columns).c_str(), NULL); break; } mstruct[r - 1][c - 1] = vargs[2][i]; if(c == columns) { c = 1; r++; } else { c++; } } return 1; } RankFunction::RankFunction() : MathFunction("rank", 1, 2) { setArgumentDefinition(1, new VectorArgument("")); setArgumentDefinition(2, new BooleanArgument("")); setDefaultValue(2, "1"); } int RankFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; return mstruct.rankVector(vargs[1].number().getBoolean()); } SortFunction::SortFunction() : MathFunction("sort", 1, 2) { setArgumentDefinition(1, new VectorArgument("")); setArgumentDefinition(2, new BooleanArgument("")); setDefaultValue(2, "1"); } int SortFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; return mstruct.sortVector(vargs[1].number().getBoolean()); } MergeVectorsFunction::MergeVectorsFunction() : MathFunction("mergevectors", 1, -1) { setArgumentDefinition(1, new VectorArgument("")); setArgumentDefinition(2, new VectorArgument("")); } int MergeVectorsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.clearVector(); for(size_t i = 0; i < vargs.size(); i++) { if(CALCULATOR->aborted()) return 0; if(vargs[i].isVector()) { for(size_t i2 = 0; i2 < vargs[i].size(); i2++) { mstruct.addChild(vargs[i][i2]); } } else { mstruct.addChild(vargs[i]); } } return 1; } MatrixToVectorFunction::MatrixToVectorFunction() : MathFunction("matrix2vector", 1) { setArgumentDefinition(1, new MatrixArgument()); } int MatrixToVectorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].matrixToVector(mstruct); return 1; } RowFunction::RowFunction() : MathFunction("row", 2) { setArgumentDefinition(1, new MatrixArgument()); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE)); } int RowFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { size_t row = (size_t) vargs[1].number().uintValue(); if(row > vargs[0].rows()) { CALCULATOR->error(true, _("Row %s does not exist in matrix."), format_and_print(vargs[1]).c_str(), NULL); return 0; } vargs[0].rowToVector(row, mstruct); return 1; } ColumnFunction::ColumnFunction() : MathFunction("column", 2) { setArgumentDefinition(1, new MatrixArgument()); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE)); } int ColumnFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { size_t col = (size_t) vargs[1].number().uintValue(); if(col > vargs[0].columns()) { CALCULATOR->error(true, _("Column %s does not exist in matrix."), format_and_print(vargs[1]).c_str(), NULL); return 0; } vargs[0].columnToVector(col, mstruct); return 1; } RowsFunction::RowsFunction() : MathFunction("rows", 1) { setArgumentDefinition(1, new VectorArgument("")); } int RowsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(!vargs[0].isMatrix()) mstruct = m_one; else mstruct = (int) vargs[0].rows(); return 1; } ColumnsFunction::ColumnsFunction() : MathFunction("columns", 1) { setArgumentDefinition(1, new VectorArgument("")); } int ColumnsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(!vargs[0].isMatrix()) mstruct = (int) vargs[0].countChildren(); else mstruct = (int) vargs[0].columns(); return 1; } ElementsFunction::ElementsFunction() : MathFunction("elements", 1) { setArgumentDefinition(1, new VectorArgument("")); } int ElementsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].isMatrix()) { mstruct = (int) (vargs[0].rows() * vargs[0].columns()); } else { mstruct = (int) vargs[0].countChildren(); } return 1; } ElementFunction::ElementFunction() : MathFunction("element", 2, 3) { setArgumentDefinition(1, new VectorArgument("")); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE)); setArgumentDefinition(3, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SIZE)); setDefaultValue(3, "0"); } int ElementFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[2].number().isPositive() && vargs[0].isMatrix()) { size_t row = (size_t) vargs[1].number().uintValue(); size_t col = (size_t) vargs[2].number().uintValue(); bool b = true; if(col > vargs[0].columns()) { CALCULATOR->error(true, _("Column %s does not exist in matrix."), format_and_print(vargs[2]).c_str(), NULL); b = false; } if(row > vargs[0].rows()) { CALCULATOR->error(true, _("Row %s does not exist in matrix."), format_and_print(vargs[1]).c_str(), NULL); b = false; } if(b) { const MathStructure *em = vargs[0].getElement(row, col); if(em) mstruct = *em; else b = false; } return b; } else { if(vargs[2].number().isGreaterThan(1)) { CALCULATOR->error(false, _("Argument 3, %s, is ignored for vectors."), getArgumentDefinition(3)->name().c_str(), NULL); } size_t row = (size_t) vargs[1].number().uintValue(); if(row > vargs[0].countChildren()) { CALCULATOR->error(true, _("Element %s does not exist in vector."), format_and_print(vargs[1]).c_str(), NULL); return 0; } mstruct = *vargs[0].getChild(row); return 1; } } DimensionFunction::DimensionFunction() : MathFunction("dimension", 1) { setArgumentDefinition(1, new VectorArgument("")); } int DimensionFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = (int) vargs[0].countChildren(); return 1; } ComponentFunction::ComponentFunction() : MathFunction("component", 2) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE)); setArgumentDefinition(2, new VectorArgument("")); } int ComponentFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { size_t i = (size_t) vargs[0].number().uintValue(); if(i > vargs[1].countChildren()) { CALCULATOR->error(true, _("Element %s does not exist in vector."), format_and_print(vargs[0]).c_str(), NULL); return 0; } mstruct = *vargs[1].getChild(i); return 1; } LimitsFunction::LimitsFunction() : MathFunction("limits", 3) { setArgumentDefinition(1, new VectorArgument("")); Argument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SINT); arg->setHandleVector(false); setArgumentDefinition(2, arg); arg = new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SINT); arg->setHandleVector(false); setArgumentDefinition(3, arg); } int LimitsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].getRange(vargs[1].number().intValue(), vargs[2].number().intValue(), mstruct); return 1; } AreaFunction::AreaFunction() : MathFunction("area", 5) { setArgumentDefinition(1, new MatrixArgument("")); Argument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE); arg->setHandleVector(false); setArgumentDefinition(2, arg); arg = new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE); arg->setHandleVector(false); setArgumentDefinition(3, arg); arg = new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE); arg->setHandleVector(false); setArgumentDefinition(4, arg); arg = new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE); arg->setHandleVector(false); setArgumentDefinition(5, arg); } int AreaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].getArea(vargs[1].number().uintValue(), vargs[2].number().uintValue(), vargs[3].number().uintValue(), vargs[4].number().uintValue(), mstruct); return 1; } TransposeFunction::TransposeFunction() : MathFunction("transpose", 1) { setArgumentDefinition(1, new MatrixArgument()); } int TransposeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; return mstruct.transposeMatrix(); } IdentityFunction::IdentityFunction() : MathFunction("identity", 1) { ArgumentSet *arg = new ArgumentSet(); arg->addArgument(new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE)); MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); arg->addArgument(marg); setArgumentDefinition(1, arg); } int IdentityFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].isMatrix()) { if(vargs[0].rows() != vargs[0].columns()) { return 0; } mstruct.setToIdentityMatrix(vargs[0].size()); } else { mstruct.setToIdentityMatrix((size_t) vargs[0].number().uintValue()); } return 1; } DeterminantFunction::DeterminantFunction() : MathFunction("det", 1) { MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); setArgumentDefinition(1, marg); } int DeterminantFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].determinant(mstruct, eo); return !mstruct.isUndefined(); } PermanentFunction::PermanentFunction() : MathFunction("permanent", 1) { MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); setArgumentDefinition(1, marg); } int PermanentFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].permanent(mstruct, eo); return !mstruct.isUndefined(); } CofactorFunction::CofactorFunction() : MathFunction("cofactor", 3) { setArgumentDefinition(1, new MatrixArgument()); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE)); setArgumentDefinition(3, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE)); } int CofactorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].cofactor((size_t) vargs[1].number().uintValue(), (size_t) vargs[2].number().uintValue(), mstruct, eo); return !mstruct.isUndefined(); } AdjointFunction::AdjointFunction() : MathFunction("adj", 1) { MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); setArgumentDefinition(1, marg); } int AdjointFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.adjointMatrix(eo); return !mstruct.isUndefined(); } InverseFunction::InverseFunction() : MathFunction("inverse", 1) { MatrixArgument *marg = new MatrixArgument(); marg->setSquareDemanded(true); setArgumentDefinition(1, marg); } int InverseFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; return mstruct.invertMatrix(eo); } MagnitudeFunction::MagnitudeFunction() : MathFunction("magnitude", 1) { } int MagnitudeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; if(mstruct.isVector()) { mstruct ^= nr_two; mstruct.raise(nr_half); return 1; } else if(mstruct.representsScalar()) { mstruct.transform(CALCULATOR->f_abs); return 1; } mstruct.eval(eo); if(mstruct.isVector()) { mstruct ^= nr_two; mstruct.raise(nr_half); return 1; } mstruct = vargs[0]; mstruct.transform(CALCULATOR->f_abs); return 1; } HadamardFunction::HadamardFunction() : MathFunction("hadamard", 1, -1) { setArgumentDefinition(1, new VectorArgument()); setArgumentDefinition(2, new VectorArgument()); } int HadamardFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { bool b_matrix = vargs[0].isMatrix(); for(size_t i3 = 1; i3 < vargs.size(); i3++) { if(b_matrix) { if(!vargs[i3].isMatrix() || vargs[i3].columns() != vargs[0].columns() || vargs[i3].rows() != vargs[0].rows()) { CALCULATOR->error(true, _("%s() requires that all matrices/vectors have the same dimensions."), preferredDisplayName().name.c_str(), NULL); return 0; } } else if(vargs[i3].size() != vargs[0].size()) { CALCULATOR->error(true, _("%s() requires that all matrices/vectors have the same dimensions."), preferredDisplayName().name.c_str(), NULL); return 0; } } mstruct = vargs[0]; for(size_t i = 0; i < mstruct.size(); i++) { if(b_matrix) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { for(size_t i3 = 1; i3 < vargs.size(); i3++) mstruct[i][i2] *= vargs[i3][i][i2]; } } else { for(size_t i3 = 1; i3 < vargs.size(); i3++) mstruct[i] *= vargs[i3][i]; } } return 1; } EntrywiseFunction::EntrywiseFunction() : MathFunction("entrywise", 2) { VectorArgument *arg = new VectorArgument(); arg->addArgument(new VectorArgument()); arg->addArgument(new SymbolicArgument()); arg->setReoccuringArguments(true); setArgumentDefinition(2, arg); } int EntrywiseFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[1].size() == 0) { mstruct = vargs[0]; return 1; } bool b_matrix = vargs[1][0].isMatrix(); for(size_t i3 = 2; i3 < vargs[1].size(); i3 += 2) { if(b_matrix) { if(!vargs[1][i3].isMatrix() || vargs[1][i3].columns() != vargs[1][0].columns() || vargs[1][i3].rows() != vargs[1][0].rows()) { CALCULATOR->error(true, _("%s() requires that all matrices/vectors have the same dimensions."), preferredDisplayName().name.c_str(), NULL); return 0; } } else if(vargs[1][i3].size() != vargs[1][0].size()) { CALCULATOR->error(true, _("%s() requires that all matrices/vectors have the same dimensions."), preferredDisplayName().name.c_str(), NULL); return 0; } } MathStructure mexpr(vargs[0]); EvaluationOptions eo2 = eo; eo2.calculate_functions = false; mexpr.eval(eo2); mstruct = vargs[1][0]; for(size_t i = 0; i < mstruct.size(); i++) { if(b_matrix) { for(size_t i2 = 0; i2 < mstruct[i].size(); i2++) { mstruct[i][i2] = mexpr; for(size_t i3 = 1; i3 < vargs[1].size(); i3 += 2) { mstruct[i][i2].replace(vargs[1][i3], vargs[1][i3 - 1][i][i2]); } } } else { mstruct[i] = mexpr; for(size_t i3 = 1; i3 < vargs[1].size(); i3 += 2) { mstruct[i].replace(vargs[1][i3], vargs[1][i3 - 1][i]); } } } return 1; } ZetaFunction::ZetaFunction() : MathFunction("zeta", 1, 1, SIGN_ZETA) { IntegerArgument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SLONG); setArgumentDefinition(1, arg); } int ZetaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].number().isZero()) { mstruct.set(1, 2, 0); return 1; } else if(vargs[0].number().isMinusOne()) { mstruct.set(1, 12, 0); return 1; } else if(vargs[0].number().isNegative() && vargs[0].number().isEven()) { mstruct.clear(); return 1; } else if(vargs[0].number() == 2) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(2); mstruct.divide(6); mstruct.mergePrecision(vargs[0]); return 1; } else if(vargs[0].number() == 4) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(4); mstruct.divide(90); mstruct.mergePrecision(vargs[0]); return 1; } else if(vargs[0].number() == 6) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(6); mstruct.divide(945); mstruct.mergePrecision(vargs[0]); return 1; } else if(vargs[0].number() == 8) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(8); mstruct.divide(9450); mstruct.mergePrecision(vargs[0]); return 1; } else if(vargs[0].number() == 10) { mstruct.set(CALCULATOR->v_pi); mstruct.raise(10); mstruct.divide(93555); mstruct.mergePrecision(vargs[0]); return 1; } FR_FUNCTION(zeta) } GammaFunction::GammaFunction() : MathFunction("gamma", 1, 1, SIGN_CAPITAL_GAMMA) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1); } int GammaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].number().isRational() && (eo.approximation == APPROXIMATION_EXACT || (eo.approximation == APPROXIMATION_TRY_EXACT && vargs[0].number().isLessThan(1000)))) { if(vargs[0].number().isInteger() && vargs[0].number().isPositive()) { mstruct.set(CALCULATOR->f_factorial, &vargs[0], NULL); mstruct[0] -= 1; return 1; } else if(vargs[0].number().denominatorIsTwo()) { Number nr(vargs[0].number()); nr.floor(); if(nr.isZero()) { MathStructure mtmp(CALCULATOR->v_pi); mstruct.set(CALCULATOR->f_sqrt, &mtmp, NULL); return 1; } else if(nr.isPositive()) { Number nr2(nr); nr2 *= 2; nr2 -= 1; nr2.doubleFactorial(); Number nr3(2, 1, 0); nr3 ^= nr; nr2 /= nr3; mstruct = nr2; MathStructure mtmp1(CALCULATOR->v_pi); MathStructure mtmp2(CALCULATOR->f_sqrt, &mtmp1, NULL); mstruct *= mtmp2; return 1; } else { nr.negate(); Number nr2(nr); nr2 *= 2; nr2 -= 1; nr2.doubleFactorial(); Number nr3(2, 1, 0); nr3 ^= nr; if(nr.isOdd()) nr3.negate(); nr3 /= nr2; mstruct = nr3; MathStructure mtmp1(CALCULATOR->v_pi); MathStructure mtmp2(CALCULATOR->f_sqrt, &mtmp1, NULL); mstruct *= mtmp2; return 1; } } } FR_FUNCTION(gamma) } DigammaFunction::DigammaFunction() : MathFunction("digamma", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1); } int DigammaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].number().isOne()) { mstruct.set(CALCULATOR->v_euler); mstruct.negate(); return 1; } FR_FUNCTION(digamma) } BetaFunction::BetaFunction() : MathFunction("beta", 2, 2, SIGN_CAPITAL_BETA) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false)); setArgumentDefinition(2, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false)); } int BetaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; mstruct.set(CALCULATOR->f_gamma, &vargs[0], NULL); MathStructure mstruct2(CALCULATOR->f_gamma, &vargs[1], NULL); mstruct *= mstruct2; mstruct2[0] += vargs[0]; mstruct /= mstruct2; return 1; } AiryFunction::AiryFunction() : MathFunction("airy", 1) { NumberArgument *arg = new NumberArgument(); Number fr(-500, 1, 0); arg->setMin(&fr); fr.set(500, 1, 0); arg->setMax(&fr); setArgumentDefinition(1, arg); } int AiryFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(airy) } BesseljFunction::BesseljFunction() : MathFunction("besselj", 2) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SLONG)); NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(2); } int BesseljFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2R(besselj) } BesselyFunction::BesselyFunction() : MathFunction("bessely", 2) { IntegerArgument *iarg = new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SLONG); Number nmax(1000); iarg->setMax(&nmax); setArgumentDefinition(1, iarg); NON_COMPLEX_NUMBER_ARGUMENT(2); } int BesselyFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2R(bessely) } ErfFunction::ErfFunction() : MathFunction("erf", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1); } int ErfFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(erf) } ErfcFunction::ErfcFunction() : MathFunction("erfc", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1); } int ErfcFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(erfc) } FactorialFunction::FactorialFunction() : MathFunction("factorial", 1) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONNEGATIVE, true, false, INTEGER_TYPE_SLONG)); } int FactorialFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(factorial) } bool FactorialFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsNegative(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool FactorialFunction::representsComplex(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool FactorialFunction::representsEven(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsOdd(const MathStructure&, bool) const {return false;} bool FactorialFunction::representsUndefined(const MathStructure&) const {return false;} DoubleFactorialFunction::DoubleFactorialFunction() : MathFunction("factorial2", 1) { IntegerArgument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SLONG); Number nr(-1, 1, 0); arg->setMin(&nr); setArgumentDefinition(1, arg); } int DoubleFactorialFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(doubleFactorial) } bool DoubleFactorialFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsNegative(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool DoubleFactorialFunction::representsComplex(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool DoubleFactorialFunction::representsEven(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsOdd(const MathStructure&, bool) const {return false;} bool DoubleFactorialFunction::representsUndefined(const MathStructure&) const {return false;} MultiFactorialFunction::MultiFactorialFunction() : MathFunction("multifactorial", 2) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONNEGATIVE, true, true, INTEGER_TYPE_SLONG)); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SLONG)); } int MultiFactorialFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2(multiFactorial) } bool MultiFactorialFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsNegative(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool MultiFactorialFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsComplex(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsInteger() && vargs[0].representsNonNegative();} bool MultiFactorialFunction::representsEven(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsOdd(const MathStructure&, bool) const {return false;} bool MultiFactorialFunction::representsUndefined(const MathStructure&) const {return false;} BinomialFunction::BinomialFunction() : MathFunction("binomial", 2) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true)); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_ULONG)); } int BinomialFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { Number nr; if(!nr.binomial(vargs[0].number(), vargs[1].number())) return 0; mstruct = nr; return 1; } BitXorFunction::BitXorFunction() : MathFunction("bitxor", 2) { ArgumentSet *arg = new ArgumentSet(); arg->addArgument(new IntegerArgument("", ARGUMENT_MIN_MAX_NONE)); arg->addArgument(new VectorArgument); setArgumentDefinition(1, arg); arg = new ArgumentSet(); arg->addArgument(new IntegerArgument("", ARGUMENT_MIN_MAX_NONE)); arg->addArgument(new VectorArgument); setArgumentDefinition(2, arg); } int BitXorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.add(vargs[1], OPERATION_BITWISE_XOR); if(vargs[0].isNumber() && vargs[1].isNumber()) { Number nr(vargs[0].number()); if(nr.bitXor(vargs[1].number()) && (eo.approximation >= APPROXIMATION_APPROXIMATE || !nr.isApproximate() || vargs[0].number().isApproximate() || vargs[1].number().isApproximate()) && (eo.allow_complex || !nr.isComplex() || vargs[0].number().isComplex() || vargs[1].number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || vargs[0].number().includesInfinity() || vargs[1].number().includesInfinity())) { mstruct.set(nr, true); return 1; } return 0; } else if(vargs[0].isVector() && vargs[1].isVector()) { int i1 = 0, i2 = 1; if(vargs[0].size() < vargs[1].size()) { i1 = 1; i2 = 0; } mstruct.clearVector(); mstruct.resizeVector(vargs[i1].size(), m_undefined); size_t i = 0; for(; i < vargs[i2].size(); i++) { mstruct[i].set(CALCULATOR->f_xor, &vargs[i1][i], &vargs[i2][0], NULL); } for(; i < vargs[i1].size(); i++) { mstruct[i] = vargs[i1][i]; mstruct[i].add(m_zero, OPERATION_GREATER); } return 1; } return 0; } XorFunction::XorFunction() : MathFunction("xor", 2) { } int XorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int b0, b1; if(vargs[0].representsNonPositive(true)) { b0 = 0; } else if(vargs[0].representsPositive(true)) { b0 = 1; } else { b0 = -1; } if(vargs[1].representsNonPositive(true)) { b1 = 0; } else if(vargs[1].representsPositive(true)) { b1 = 1; } else { b1 = -1; } if((b0 == 1 && b1 == 0) || (b0 == 0 && b1 == 1)) { mstruct = m_one; return 1; } else if(b0 >= 0 && b1 >= 0) { return 1; } else if(b0 == 0) { mstruct = vargs[1]; mstruct.add(m_zero, OPERATION_GREATER); return 1; } else if(b0 == 1) { mstruct = vargs[1]; mstruct.add(m_zero, OPERATION_EQUALS_LESS); return 1; } else if(b1 == 0) { mstruct = vargs[0]; mstruct.add(m_zero, OPERATION_GREATER); return 1; } else if(b1 == 1) { mstruct = vargs[0]; mstruct.add(m_zero, OPERATION_EQUALS_LESS); return 1; } mstruct = vargs[1]; mstruct.setLogicalNot(); mstruct.add(vargs[0], OPERATION_LOGICAL_AND); MathStructure mstruct2(vargs[0]); mstruct2.setLogicalNot(); mstruct2.add(vargs[1], OPERATION_LOGICAL_AND); mstruct.add(mstruct2, OPERATION_LOGICAL_OR); return 1; } OddFunction::OddFunction() : MathFunction("odd", 1) { Argument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } int OddFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; if(vargs[0].representsOdd()) { mstruct.set(1, 1, 0); return 1; } else if(vargs[0].representsEven()) { mstruct.clear(); return 1; } mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.representsOdd()) { mstruct.set(1, 1, 0); return 1; } else if(mstruct.representsEven()) { mstruct.clear(); return 1; } return -1; } EvenFunction::EvenFunction() : MathFunction("even", 1) { Argument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } int EvenFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; if(vargs[0].representsEven()) { mstruct.set(1, 1, 0); return 1; } else if(vargs[0].representsOdd()) { mstruct.clear(); return 1; } mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.representsEven()) { mstruct.set(1, 1, 0); return 1; } else if(mstruct.representsOdd()) { mstruct.clear(); return 1; } return -1; } ShiftFunction::ShiftFunction() : MathFunction("shift", 2) { setArgumentDefinition(1, new IntegerArgument()); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SLONG)); } int ShiftFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2(shift) } BitCmpFunction::BitCmpFunction() : MathFunction("bitcmp", 1, 2) { setArgumentDefinition(1, new IntegerArgument()); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_UINT)); setDefaultValue(2, "0"); } int BitCmpFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { Number nr(vargs[0].number()); unsigned int bits = vargs[1].number().uintValue(); if(bits == 0) { bits = nr.integerLength(); if(bits <= 8) bits = 8; else if(bits <= 16) bits = 16; else if(bits <= 32) bits = 32; else if(bits <= 64) bits = 64; else if(bits <= 128) bits = 128; else { bits = (unsigned int) ::ceil(::log2(bits)); bits = ::pow(2, bits); } } if(nr.bitCmp(bits)) { mstruct = nr; return 1; } return 0; } bool test_eval(MathStructure &mtest, const EvaluationOptions &eo) { EvaluationOptions eo2 = eo; eo2.assume_denominators_nonzero = false; eo2.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->beginTemporaryEnableIntervalArithmetic(); CALCULATOR->beginTemporaryStopMessages(); mtest.calculateFunctions(eo2); mtest.calculatesub(eo2, eo2, true); CALCULATOR->endTemporaryEnableIntervalArithmetic(); if(CALCULATOR->endTemporaryStopMessages()) return false; return true; } AbsFunction::AbsFunction() : MathFunction("abs", 1) { Argument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } bool AbsFunction::representsPositive(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units) && vargs[0].representsNonZero(allow_units);} bool AbsFunction::representsNegative(const MathStructure&, bool) const {return false;} bool AbsFunction::representsNonNegative(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units);} bool AbsFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool AbsFunction::representsInteger(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsInteger(allow_units);} bool AbsFunction::representsNumber(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units);} bool AbsFunction::representsRational(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsRational(allow_units);} bool AbsFunction::representsReal(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units);} bool AbsFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool AbsFunction::representsComplex(const MathStructure&, bool) const {return false;} bool AbsFunction::representsNonZero(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units) && vargs[0].representsNonZero(allow_units);} bool AbsFunction::representsEven(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsEven(allow_units);} bool AbsFunction::representsOdd(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsOdd(allow_units);} bool AbsFunction::representsUndefined(const MathStructure &vargs) const {return vargs.size() == 1 && vargs[0].representsUndefined();} int AbsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.isNumber()) { if(eo.approximation != APPROXIMATION_APPROXIMATE && mstruct.number().hasImaginaryPart() && mstruct.number().hasRealPart()) { MathStructure m_i(mstruct.number().imaginaryPart()); m_i ^= nr_two; mstruct.number().clearImaginary(); mstruct.numberUpdated(); mstruct ^= nr_two; mstruct += m_i; mstruct ^= nr_half; return 1; } Number nr(mstruct.number()); if(!nr.abs() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate())) { return -1; } mstruct = nr; return 1; } if(mstruct.isPower() && mstruct[0].representsPositive()) { if(mstruct[1].isNumber() && !mstruct[1].number().hasRealPart()) { mstruct.set(1, 1, 0, true); return 1; } else if(mstruct[1].isMultiplication() && mstruct.size() > 0 && mstruct[1][0].isNumber() && !mstruct[1][0].number().hasRealPart()) { bool b = true; for(size_t i = 1; i < mstruct[1].size(); i++) { if(!mstruct[1][i].representsNonComplex()) {b = false; break;} } if(b) { mstruct.set(1, 1, 0, true); return 1; } } } if(mstruct.representsNegative(true)) { mstruct.negate(); return 1; } if(mstruct.representsNonNegative(true)) { return 1; } if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].transform(STRUCT_FUNCTION); mstruct[i].setFunction(this); } mstruct.childrenUpdated(); return 1; } if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_signum && mstruct.size() == 2) { mstruct[0].transform(this); mstruct.childUpdated(1); return 1; } if(eo.approximation == APPROXIMATION_EXACT) { MathStructure mtest(mstruct); if(test_eval(mtest, eo)) { if(mtest.representsNegative(true)) { mstruct.negate(); return 1; } if(mtest.representsNonNegative(true)) { return 1; } } } return -1; } GcdFunction::GcdFunction() : MathFunction("gcd", 2) { RATIONAL_POLYNOMIAL_ARGUMENT_HV(1) RATIONAL_POLYNOMIAL_ARGUMENT_HV(2) } int GcdFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(MathStructure::gcd(vargs[0], vargs[1], mstruct, eo)) { return 1; } return 0; } LcmFunction::LcmFunction() : MathFunction("lcm", 2) { RATIONAL_POLYNOMIAL_ARGUMENT_HV(1) RATIONAL_POLYNOMIAL_ARGUMENT_HV(2) } int LcmFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(MathStructure::lcm(vargs[0], vargs[1], mstruct, eo)) { return 1; } return 0; } HeavisideFunction::HeavisideFunction() : MathFunction("heaviside", 1) { NumberArgument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setHandleVector(true); arg->setComplexAllowed(false); setArgumentDefinition(1, arg); } bool HeavisideFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonNegative(true);} bool HeavisideFunction::representsNegative(const MathStructure&, bool) const {return false;} bool HeavisideFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal(true);} bool HeavisideFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool HeavisideFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonZero() && vargs[0].representsReal(true);} bool HeavisideFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal(true);} bool HeavisideFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal(true);} bool HeavisideFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex(true);} bool HeavisideFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal(true);} bool HeavisideFunction::representsComplex(const MathStructure&, bool) const {return false;} bool HeavisideFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonNegative(true);} bool HeavisideFunction::representsEven(const MathStructure&, bool) const {return false;} bool HeavisideFunction::representsOdd(const MathStructure&, bool) const {return false;} bool HeavisideFunction::representsUndefined(const MathStructure &vargs) const {return vargs.size() == 1 && vargs[0].representsUndefined();} int HeavisideFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(!mstruct.representsNonComplex(true)) return false; if(mstruct.representsPositive(true)) { mstruct.set(1, 1, 0); return 1; } if(mstruct.representsNegative(true)) { mstruct.clear(); return 1; } if(mstruct.isZero()) { mstruct = nr_half; return 1; } if(mstruct.isNumber() && mstruct.number().isInterval()) { if(!mstruct.number().isNonNegative()) { mstruct.number().setInterval(nr_half, nr_one); } else if(!mstruct.number().isNonPositive()) { mstruct.number().setInterval(nr_zero, nr_half); } else { mstruct.number().setInterval(nr_zero, nr_one); } return 1; } if(eo.approximation == APPROXIMATION_EXACT) { MathStructure mtest(mstruct); if(test_eval(mtest, eo)) { if(mtest.representsPositive(true)) { mstruct.set(1, 1, 0); return 1; } if(mtest.representsNegative(true)) { mstruct.clear(); return 1; } } } return -1; } DiracFunction::DiracFunction() : MathFunction("dirac", 1) { NumberArgument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setComplexAllowed(false); setArgumentDefinition(1, arg); } bool DiracFunction::representsPositive(const MathStructure&, bool allow_units) const {return false;} bool DiracFunction::representsNegative(const MathStructure&, bool) const {return false;} bool DiracFunction::representsNonNegative(const MathStructure&, bool) const {return true;} bool DiracFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool DiracFunction::representsInteger(const MathStructure&, bool) const {return false;} bool DiracFunction::representsNumber(const MathStructure&, bool) const {return false;} bool DiracFunction::representsRational(const MathStructure&, bool) const {return false;} bool DiracFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex(true);} bool DiracFunction::representsReal(const MathStructure&, bool) const {return false;} bool DiracFunction::representsComplex(const MathStructure&, bool) const {return false;} bool DiracFunction::representsNonZero(const MathStructure&, bool) const {return false;} bool DiracFunction::representsEven(const MathStructure&, bool) const {return false;} bool DiracFunction::representsOdd(const MathStructure&, bool) const {return false;} bool DiracFunction::representsUndefined(const MathStructure &vargs) const {return vargs.size() == 1 && vargs[0].representsUndefined();} int DiracFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.eval(eo); if(!mstruct.representsNonComplex(true)) return false; if(mstruct.representsNonZero(true)) { mstruct.clear(); return 1; } if(mstruct.isZero()) { mstruct = nr_plus_inf; return 1; } if(mstruct.isNumber() && mstruct.number().isInterval() && !mstruct.number().isNonZero()) { mstruct.number().setInterval(nr_zero, nr_plus_inf); return 1; } if(eo.approximation == APPROXIMATION_EXACT) { MathStructure mtest(mstruct); if(test_eval(mtest, eo)) { if(mtest.representsNonZero(true)) { mstruct.clear(); return 1; } } } return -1; } SignumFunction::SignumFunction() : MathFunction("sgn", 1, 2) { Argument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); setDefaultValue(2, "0"); } bool SignumFunction::representsPositive(const MathStructure&, bool allow_units) const {return false;} bool SignumFunction::representsNegative(const MathStructure&, bool) const {return false;} bool SignumFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() >= 1 && vargs[0].representsNonNegative(true);} bool SignumFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() >= 1 && vargs[0].representsNonPositive(true);} bool SignumFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() >= 1 && vargs[0].representsReal(true);} bool SignumFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() >= 1 && vargs[0].representsNumber(true);} bool SignumFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() >= 1 && vargs[0].representsReal(true);} bool SignumFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() >= 1 && vargs[0].representsNonComplex(true);} bool SignumFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() >= 1 && vargs[0].representsReal(true);} bool SignumFunction::representsComplex(const MathStructure &vargs, bool) const {return vargs.size() >= 1 && vargs[0].representsComplex(true);} bool SignumFunction::representsNonZero(const MathStructure &vargs, bool) const {return (vargs.size() == 2 && !vargs[1].isZero()) || (vargs.size() >= 1 && vargs[0].representsNonZero(true));} bool SignumFunction::representsEven(const MathStructure&, bool) const {return false;} bool SignumFunction::representsOdd(const MathStructure &vargs, bool b) const {return representsNonZero(vargs, b);} bool SignumFunction::representsUndefined(const MathStructure &vargs) const {return vargs.size() >= 1 && vargs[0].representsUndefined();} int SignumFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.isNumber() && (vargs.size() == 1 || vargs[1].isZero())) { Number nr(mstruct.number()); if(!nr.signum() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate())) { if(mstruct.number().isNonZero()) { MathStructure *mabs = new MathStructure(mstruct); mabs->transform(STRUCT_FUNCTION); mabs->setFunction(CALCULATOR->f_abs); mstruct.divide_nocopy(mabs); return 1; } return -1; } else { mstruct = nr; return 1; } } if((vargs.size() > 1 && vargs[1].isOne() && mstruct.representsNonNegative(true)) || mstruct.representsPositive(true)) { mstruct.set(1, 1, 0); return 1; } if((vargs.size() > 1 && vargs[1].isMinusOne() && mstruct.representsNonPositive(true)) || mstruct.representsNegative(true)) { mstruct.set(-1, 1, 0); return 1; } if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(vargs.size() > 1) mstruct[i].transform(STRUCT_FUNCTION, vargs[1]); else mstruct[i].transform(STRUCT_FUNCTION); mstruct[i].setFunction(this); } mstruct.childrenUpdated(); return 1; } if(vargs.size() > 1 && mstruct.isZero()) { mstruct.set(vargs[1], true); return 1; } if(eo.approximation == APPROXIMATION_EXACT) { MathStructure mtest(mstruct); if(test_eval(mtest, eo)) { if((vargs.size() > 1 && vargs[1].isOne() && mtest.representsNonNegative(true)) || mtest.representsPositive(true)) { mstruct.set(1, 1, 0); return 1; } if((vargs.size() > 1 && vargs[1].isMinusOne() && mtest.representsNonPositive(true)) || mtest.representsNegative(true)) { mstruct.set(-1, 1, 0); return 1; } } } return -1; } CeilFunction::CeilFunction() : MathFunction("ceil", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int CeilFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(ceil) } bool CeilFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsPositive();} bool CeilFunction::representsNegative(const MathStructure&, bool) const {return false;} bool CeilFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative();} bool CeilFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonPositive();} bool CeilFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool CeilFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool CeilFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool CeilFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool CeilFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool CeilFunction::representsComplex(const MathStructure&, bool) const {return false;} bool CeilFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsPositive();} bool CeilFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsEven();} bool CeilFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsOdd();} bool CeilFunction::representsUndefined(const MathStructure&) const {return false;} FloorFunction::FloorFunction() : MathFunction("floor", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int FloorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(floor) } bool FloorFunction::representsPositive(const MathStructure&, bool) const {return false;} bool FloorFunction::representsNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNegative();} bool FloorFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative();} bool FloorFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonPositive();} bool FloorFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool FloorFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool FloorFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool FloorFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool FloorFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool FloorFunction::representsComplex(const MathStructure&, bool) const {return false;} bool FloorFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNegative();} bool FloorFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsEven();} bool FloorFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsOdd();} bool FloorFunction::representsUndefined(const MathStructure&) const {return false;} TruncFunction::TruncFunction() : MathFunction("trunc", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int TruncFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(trunc) } bool TruncFunction::representsPositive(const MathStructure&, bool) const {return false;} bool TruncFunction::representsNegative(const MathStructure&, bool) const {return false;} bool TruncFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative();} bool TruncFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonPositive();} bool TruncFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool TruncFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool TruncFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool TruncFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool TruncFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool TruncFunction::representsComplex(const MathStructure&, bool) const {return false;} bool TruncFunction::representsNonZero(const MathStructure&, bool) const {return false;} bool TruncFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsEven();} bool TruncFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsOdd();} bool TruncFunction::representsUndefined(const MathStructure&) const {return false;} RoundFunction::RoundFunction() : MathFunction("round", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int RoundFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(round) } bool RoundFunction::representsPositive(const MathStructure&, bool) const {return false;} bool RoundFunction::representsNegative(const MathStructure&, bool) const {return false;} bool RoundFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative();} bool RoundFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonPositive();} bool RoundFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool RoundFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool RoundFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool RoundFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool RoundFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool RoundFunction::representsComplex(const MathStructure&, bool) const {return false;} bool RoundFunction::representsNonZero(const MathStructure&, bool) const {return false;} bool RoundFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsEven();} bool RoundFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger() && vargs[0].representsOdd();} bool RoundFunction::representsUndefined(const MathStructure&) const {return false;} FracFunction::FracFunction() : MathFunction("frac", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int FracFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(frac) } IntFunction::IntFunction() : MathFunction("int", 1) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) } int IntFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(trunc) } NumeratorFunction::NumeratorFunction() : MathFunction("numerator", 1) { NumberArgument *arg_rational_1 = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg_rational_1->setRationalNumber(true); arg_rational_1->setHandleVector(true); setArgumentDefinition(1, arg_rational_1); } int NumeratorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; if(vargs[0].isNumber()) { if(vargs[0].number().isInteger()) { mstruct = vargs[0]; return 1; } else if(vargs[0].number().isRational()) { mstruct.set(vargs[0].number().numerator()); return 1; } return 0; } else if(vargs[0].representsInteger()) { mstruct = vargs[0]; return 1; } mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.representsInteger()) { return 1; } else if(mstruct.isNumber() && mstruct.number().isRational()) { Number nr(mstruct.number().numerator()); mstruct.set(nr); return 1; } return -1; } DenominatorFunction::DenominatorFunction() : MathFunction("denominator", 1) { RATIONAL_NUMBER_ARGUMENT_NO_ERROR(1) } int DenominatorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.set(vargs[0].number().denominator()); return 1; } RemFunction::RemFunction() : MathFunction("rem", 2) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR_NONZERO(2) } int RemFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2(rem) } ModFunction::ModFunction() : MathFunction("mod", 2) { NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR(1) NON_COMPLEX_NUMBER_ARGUMENT_NO_ERROR_NONZERO(2) } int ModFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2(mod) } PolynomialUnitFunction::PolynomialUnitFunction() : MathFunction("punit", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int PolynomialUnitFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct.set(vargs[0].polynomialUnit(vargs[1]), 0); return 1; } PolynomialPrimpartFunction::PolynomialPrimpartFunction() : MathFunction("primpart", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int PolynomialPrimpartFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].polynomialPrimpart(vargs[1], mstruct, eo); return 1; } PolynomialContentFunction::PolynomialContentFunction() : MathFunction("pcontent", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int PolynomialContentFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { vargs[0].polynomialContent(vargs[1], mstruct, eo); return 1; } CoeffFunction::CoeffFunction() : MathFunction("coeff", 2, 3) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_NONNEGATIVE)); setArgumentDefinition(3, new SymbolicArgument()); setDefaultValue(3, "x"); } int CoeffFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].coefficient(vargs[2], vargs[1].number(), mstruct); return 1; } LCoeffFunction::LCoeffFunction() : MathFunction("lcoeff", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int LCoeffFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].lcoefficient(vargs[1], mstruct); return 1; } TCoeffFunction::TCoeffFunction() : MathFunction("tcoeff", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int TCoeffFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { vargs[0].tcoefficient(vargs[1], mstruct); return 1; } DegreeFunction::DegreeFunction() : MathFunction("degree", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int DegreeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0].degree(vargs[1]); return 1; } LDegreeFunction::LDegreeFunction() : MathFunction("ldegree", 1, 2) { RATIONAL_POLYNOMIAL_ARGUMENT(1) setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } int LDegreeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0].ldegree(vargs[1]); return 1; } ImFunction::ImFunction() : MathFunction("im", 1) { Argument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } int ImFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.isNumber()) { mstruct = mstruct.number().imaginaryPart(); return 1; } else if(mstruct.representsReal()) { mstruct.clear(); return 1; } return -1; } bool ImFunction::representsPositive(const MathStructure&, bool) const {return false;} bool ImFunction::representsNegative(const MathStructure&, bool) const {return false;} bool ImFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool ImFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool ImFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool ImFunction::representsComplex(const MathStructure&, bool) const {return false;} bool ImFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsComplex();} bool ImFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ImFunction::representsOdd(const MathStructure&, bool) const {return false;} bool ImFunction::representsUndefined(const MathStructure&) const {return false;} ReFunction::ReFunction() : MathFunction("re", 1) { Argument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } int ReFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.isNumber()) { mstruct = mstruct.number().realPart(); return 1; } else if(mstruct.representsReal()) { return 1; } return -1; } bool ReFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsPositive();} bool ReFunction::representsNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNegative();} bool ReFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonNegative();} bool ReFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonPositive();} bool ReFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsInteger();} bool ReFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool ReFunction::representsRational(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsRational();} bool ReFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool ReFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} bool ReFunction::representsComplex(const MathStructure&, bool) const {return false;} bool ReFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonZero();} bool ReFunction::representsEven(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsEven();} bool ReFunction::representsOdd(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsOdd();} bool ReFunction::representsUndefined(const MathStructure&) const {return false;} SqrtFunction::SqrtFunction() : MathFunction("sqrt", 1) { Argument *arg = new Argument("", false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } int SqrtFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; if(!vargs[0].representsScalar()) { mstruct.eval(eo); if(mstruct.isVector()) return -1; } mstruct.raise(nr_half); return 1; } bool SqrtFunction::representsPositive(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsPositive(allow_units);} bool SqrtFunction::representsNegative(const MathStructure&, bool) const {return false;} bool SqrtFunction::representsNonNegative(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNonNegative(allow_units);} bool SqrtFunction::representsNonPositive(const MathStructure&, bool) const {return false;} bool SqrtFunction::representsInteger(const MathStructure&, bool) const {return false;} bool SqrtFunction::representsNumber(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNumber(allow_units);} bool SqrtFunction::representsRational(const MathStructure&, bool) const {return false;} bool SqrtFunction::representsReal(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNonNegative(allow_units);} bool SqrtFunction::representsNonComplex(const MathStructure &vargs, bool allow_units) const {return representsReal(vargs, allow_units);} bool SqrtFunction::representsComplex(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNegative(allow_units);} bool SqrtFunction::representsNonZero(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 1 && vargs[0].representsNonZero(allow_units);} bool SqrtFunction::representsEven(const MathStructure&, bool) const {return false;} bool SqrtFunction::representsOdd(const MathStructure&, bool) const {return false;} bool SqrtFunction::representsUndefined(const MathStructure&) const {return false;} CbrtFunction::CbrtFunction() : MathFunction("cbrt", 1) { Argument *arg = new Argument("", false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } int CbrtFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; if(vargs[0].representsNegative(true)) { mstruct = vargs[0]; mstruct.negate(); mstruct.raise(Number(1, 3, 0)); mstruct.negate(); } else if(vargs[0].representsNonNegative(true)) { mstruct = vargs[0]; mstruct.raise(Number(1, 3, 0)); } else { MathStructure mroot(3, 1, 0); mstruct.set(CALCULATOR->f_root, &vargs[0], &mroot, NULL); } return 1; } RootFunction::RootFunction() : MathFunction("root", 2) { NumberArgument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setComplexAllowed(false); arg->setHandleVector(true); setArgumentDefinition(1, arg); NumberArgument *arg2 = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, true); arg2->setComplexAllowed(false); arg2->setRationalNumber(true); arg2->setHandleVector(true); setArgumentDefinition(2, arg2); } int RootFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; if(vargs[1].number().isOne()) { mstruct = vargs[0]; return 1; } if(!vargs[1].number().isInteger() || !vargs[1].number().isPositive()) { mstruct = vargs[0]; if(!vargs[0].representsScalar()) { mstruct.eval(eo); } if(mstruct.isVector()) return -1; Number nr_root(vargs[1].number().numerator()); nr_root.setPrecisionAndApproximateFrom(vargs[1].number()); Number nr_pow(vargs[1].number().denominator()); nr_pow.setPrecisionAndApproximateFrom(vargs[1].number()); if(nr_root.isNegative()) { nr_root.negate(); nr_pow.negate(); } if(nr_root.isOne()) { mstruct ^= nr_pow; } else if(nr_root.isZero()) { mstruct ^= nr_zero; } else { mstruct ^= nr_pow; mstruct.transform(this); mstruct.addChild(nr_root); } return 1; } if(vargs[0].representsNonNegative(true)) { mstruct = vargs[0]; Number nr_exp(vargs[1].number()); nr_exp.recip(); mstruct.raise(nr_exp); return 1; } else if(vargs[1].number().isOdd() && vargs[0].representsNegative(true)) { mstruct = vargs[0]; mstruct.negate(); Number nr_exp(vargs[1].number()); nr_exp.recip(); mstruct.raise(nr_exp); mstruct.negate(); return 1; } bool eval_mstruct = !vargs[0].isNumber(); Number nr; if(eval_mstruct) { mstruct = vargs[0]; if(eo.approximation == APPROXIMATION_TRY_EXACT && mstruct.representsScalar()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; mstruct.eval(eo2); } else { mstruct.eval(eo); } if(mstruct.isVector()) { if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return -1; } if(mstruct.representsNonNegative(true)) { Number nr_exp(vargs[1].number()); nr_exp.recip(); mstruct.raise(nr_exp); return 1; } else if(vargs[1].number().isOdd() && mstruct.representsNegative(true)) { mstruct.negate(); Number nr_exp(vargs[1].number()); nr_exp.recip(); mstruct.raise(nr_exp); mstruct.negate(); return 1; } if(!mstruct.isNumber()) { if(mstruct.isPower() && mstruct[1].isNumber() && mstruct[1].number().isInteger()) { if(mstruct[1] == vargs[1]) { if(mstruct[1].number().isEven()) { if(!mstruct[0].representsReal(true)) return -1; mstruct.delChild(2); mstruct.setType(STRUCT_FUNCTION); mstruct.setFunction(CALCULATOR->f_abs); } else { mstruct.setToChild(1); } return 1; } else if(mstruct[1].number().isIntegerDivisible(vargs[1].number())) { if(mstruct[1].number().isEven()) { if(!mstruct[0].representsReal(true)) return -1; mstruct[0].transform(STRUCT_FUNCTION); mstruct[0].setFunction(CALCULATOR->f_abs); } mstruct[1].divide(vargs[1].number()); return 1; } else if(!mstruct[1].number().isMinusOne() && vargs[1].number().isIntegerDivisible(mstruct[1].number())) { if(mstruct[1].number().isEven()) { if(!mstruct[0].representsReal(true)) return -1; mstruct[0].transform(STRUCT_FUNCTION); mstruct[0].setFunction(CALCULATOR->f_abs); } Number new_root(vargs[1].number()); new_root.divide(mstruct[1].number()); bool bdiv = new_root.isNegative(); if(bdiv) new_root.negate(); mstruct[1] = new_root; mstruct.setType(STRUCT_FUNCTION); mstruct.setFunction(this); if(bdiv) mstruct.raise(nr_minus_one); return 1; } else if(mstruct[1].number().isMinusOne()) { mstruct[0].transform(STRUCT_FUNCTION, vargs[1]); mstruct[0].setFunction(this); return 1; } else if(mstruct[1].number().isNegative()) { mstruct[1].number().negate(); mstruct.transform(STRUCT_FUNCTION, vargs[1]); mstruct.setFunction(this); mstruct.raise(nr_minus_one); return 1; } } else if(mstruct.isPower() && mstruct[1].isNumber() && mstruct[1].number().isRational() && mstruct[1].number().denominatorIsTwo()) { Number new_root(vargs[1].number()); new_root.multiply(Number(2, 1, 0)); if(mstruct[1].number().numeratorIsOne()) { mstruct[1].number().set(new_root, true); mstruct.setType(STRUCT_FUNCTION); mstruct.setFunction(this); } else { mstruct[1].number().set(mstruct[1].number().numerator(), true); mstruct.transform(STRUCT_FUNCTION); mstruct.addChild(new_root); mstruct.setFunction(this); } return 1; } else if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_sqrt && mstruct.size() == 1) { Number new_root(vargs[1].number()); new_root.multiply(Number(2, 1, 0)); mstruct.addChild(new_root); mstruct.setFunction(this); return 1; } else if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_root && mstruct.size() == 2 && mstruct[1].isNumber() && mstruct[1].number().isInteger() && mstruct[1].number().isPositive()) { Number new_root(vargs[1].number()); new_root.multiply(mstruct[1].number()); mstruct[1] = new_root; return 1; } else if(mstruct.isMultiplication()) { bool b = true; for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsReal(true)) { b = false; break; } } if(b) { if(vargs[1].number().isOdd()) { bool b_neg = false; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isNumber() && mstruct[i].number().isNegative() && !mstruct[i].isMinusOne()) { mstruct[i].negate(); b_neg = !b_neg; } mstruct[i].transform(STRUCT_FUNCTION, vargs[1]); mstruct[i].setFunction(this); } if(b_neg) mstruct.insertChild_nocopy(new MathStructure(-1, 1, 0), 1); return 1; } else { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isNumber() && mstruct[i].number().isNegative() && !mstruct[i].isMinusOne()) { MathStructure *mmul = new MathStructure(this, &mstruct[i], &vargs[1], NULL); (*mmul)[0].negate(); mstruct[i] = nr_minus_one; mstruct.transform(STRUCT_FUNCTION, vargs[1]); mstruct.setFunction(this); mstruct.multiply_nocopy(mmul); return true; } else if(mstruct[i].representsPositive()) { mstruct[i].transform(STRUCT_FUNCTION, vargs[1]); mstruct[i].setFunction(this); mstruct[i].ref(); MathStructure *mmul = &mstruct[i]; mstruct.delChild(i + 1, true); mstruct.transform(STRUCT_FUNCTION, vargs[1]); mstruct.setFunction(this); mstruct.multiply_nocopy(mmul); return true; } } } } } return -1; } nr = mstruct.number(); } else { nr = vargs[0].number(); } if(!nr.root(vargs[1].number()) || (eo.approximation < APPROXIMATION_APPROXIMATE && nr.isApproximate() && !vargs[0].isApproximate() && !mstruct.isApproximate() && !vargs[1].isApproximate()) || (!eo.allow_complex && nr.isComplex() && !vargs[0].number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !vargs[0].number().includesInfinity())) { if(!eval_mstruct) { if(vargs[0].number().isNegative() && vargs[1].number().isOdd()) { mstruct.set(this, &vargs[0], &vargs[1], NULL); mstruct[0].number().negate(); mstruct.negate(); return 1; } return 0; } else if(mstruct.number().isNegative() && vargs[1].number().isOdd()) { mstruct.number().negate(); mstruct.transform(STRUCT_FUNCTION, vargs[1]); mstruct.setFunction(this); mstruct.negate(); return 1; } } else { mstruct.set(nr); return 1; } return -1; } bool RootFunction::representsPositive(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsPositive(allow_units);} bool RootFunction::representsNegative(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 2 && vargs[1].representsOdd() && vargs[1].representsPositive() && vargs[0].representsNegative(allow_units);} bool RootFunction::representsNonNegative(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsNonNegative(allow_units);} bool RootFunction::representsNonPositive(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 2 && vargs[1].representsOdd() && vargs[1].representsPositive() && vargs[0].representsNonPositive(allow_units);} bool RootFunction::representsInteger(const MathStructure&, bool) const {return false;} bool RootFunction::representsNumber(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsNumber(allow_units);} bool RootFunction::representsRational(const MathStructure&, bool) const {return false;} bool RootFunction::representsReal(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsReal(allow_units) && (vargs[0].representsNonNegative(allow_units) || vargs[1].representsOdd());} bool RootFunction::representsNonComplex(const MathStructure &vargs, bool allow_units) const {return representsReal(vargs, allow_units);} bool RootFunction::representsComplex(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && (vargs[0].representsComplex(allow_units) || (vargs[1].representsEven() && vargs[0].representsNegative(allow_units)));} bool RootFunction::representsNonZero(const MathStructure &vargs, bool allow_units) const {return vargs.size() == 2 && vargs[1].representsInteger() && vargs[1].representsPositive() && vargs[0].representsNonZero(allow_units);} bool RootFunction::representsEven(const MathStructure&, bool) const {return false;} bool RootFunction::representsOdd(const MathStructure&, bool) const {return false;} bool RootFunction::representsUndefined(const MathStructure&) const {return false;} SquareFunction::SquareFunction() : MathFunction("sq", 1) { Argument *arg = new Argument("", false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } int SquareFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; mstruct ^= 2; return 1; } ExpFunction::ExpFunction() : MathFunction("exp", 1) { Argument *arg = new Argument("", false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } int ExpFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = CALCULATOR->v_e; mstruct ^= vargs[0]; return 1; } LogFunction::LogFunction() : MathFunction("ln", 1) { Argument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } bool LogFunction::representsPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsPositive() && ((vargs[0].isNumber() && vargs[0].number().isGreaterThan(nr_one)) || (vargs[0].isVariable() && vargs[0].variable()->isKnown() && ((KnownVariable*) vargs[0].variable())->get().isNumber() && ((KnownVariable*) vargs[0].variable())->get().number().isGreaterThan(nr_one)));} bool LogFunction::representsNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative() && ((vargs[0].isNumber() && vargs[0].number().isLessThan(nr_one)) || (vargs[0].isVariable() && vargs[0].variable()->isKnown() && ((KnownVariable*) vargs[0].variable())->get().isNumber() && ((KnownVariable*) vargs[0].variable())->get().number().isLessThan(nr_one)));} bool LogFunction::representsNonNegative(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsPositive() && ((vargs[0].isNumber() && vargs[0].number().isGreaterThanOrEqualTo(nr_one)) || (vargs[0].isVariable() && vargs[0].variable()->isKnown() && ((KnownVariable*) vargs[0].variable())->get().isNumber() && ((KnownVariable*) vargs[0].variable())->get().number().isGreaterThanOrEqualTo(nr_one)));} bool LogFunction::representsNonPositive(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative() && ((vargs[0].isNumber() && vargs[0].number().isLessThanOrEqualTo(nr_one)) || (vargs[0].isVariable() && vargs[0].variable()->isKnown() && ((KnownVariable*) vargs[0].variable())->get().isNumber() && ((KnownVariable*) vargs[0].variable())->get().number().isLessThanOrEqualTo(nr_one)));} bool LogFunction::representsInteger(const MathStructure&, bool) const {return false;} bool LogFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber() && vargs[0].representsNonZero();} bool LogFunction::representsRational(const MathStructure&, bool) const {return false;} bool LogFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsPositive();} bool LogFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative();} bool LogFunction::representsComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNegative();} bool LogFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 1 && (vargs[0].representsNonPositive() || (vargs[0].isNumber() && !vargs[0].number().isOne()) || (vargs[0].isVariable() && vargs[0].variable()->isKnown() && ((KnownVariable*) vargs[0].variable())->get().isNumber() && !((KnownVariable*) vargs[0].variable())->get().number().isOne()));} bool LogFunction::representsEven(const MathStructure&, bool) const {return false;} bool LogFunction::representsOdd(const MathStructure&, bool) const {return false;} bool LogFunction::representsUndefined(const MathStructure&) const {return false;} int LogFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_e) { mstruct.set(m_one); return true; } else if(mstruct.isPower()) { if(mstruct[0].isVariable() && mstruct[0].variable() == CALCULATOR->v_e) { if(mstruct[1].representsReal()) { mstruct.setToChild(2, true); return true; } } else if(eo.approximation != APPROXIMATION_APPROXIMATE && ((mstruct[0].representsPositive(true) && mstruct[1].representsReal()) || (mstruct[1].isNumber() && mstruct[1].number().isFraction()))) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_ln, &mstruct[0], NULL); mstruct2 *= mstruct[1]; mstruct = mstruct2; return true; } } if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); if(mstruct.isVector()) {CALCULATOR->endTemporaryStopMessages(true); return -1;} } else { mstruct.eval(eo); if(mstruct.isVector()) return -1; } bool b = false; if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_e) { mstruct.set(m_one); b = true; } else if(mstruct.isPower()) { if(mstruct[0].isVariable() && mstruct[0].variable() == CALCULATOR->v_e) { if(mstruct[1].representsReal()) { mstruct.setToChild(2, true); b = true; } } else if((mstruct[0].representsPositive(true) && mstruct[1].representsReal()) || (mstruct[1].isNumber() && mstruct[1].number().isFraction())) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_ln, &mstruct[0], NULL); mstruct2 *= mstruct[1]; mstruct = mstruct2; b = true; } } else if(mstruct.isMultiplication()) { b = true; for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsPositive()) { b = false; break; } } if(b) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_ln, &mstruct[0], NULL); for(size_t i = 1; i < mstruct.size(); i++) { mstruct2.add(MathStructure(CALCULATOR->f_ln, &mstruct[i], NULL), i > 1); } mstruct = mstruct2; } } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(b); if(b) return 1; if(eo.approximation == APPROXIMATION_TRY_EXACT && !mstruct.isNumber()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mstruct = vargs[0]; mstruct.eval(eo2); } if(mstruct.isNumber()) { if(eo.allow_complex && mstruct.number().isMinusOne()) { mstruct = CALCULATOR->v_i->get(); mstruct *= CALCULATOR->v_pi; return 1; } else if(mstruct.number().isI()) { mstruct.set(1, 2, 0); mstruct *= CALCULATOR->v_pi; mstruct *= CALCULATOR->v_i->get(); return 1; } else if(mstruct.number().isMinusI()) { mstruct.set(-1, 2, 0); mstruct *= CALCULATOR->v_pi; mstruct *= CALCULATOR->v_i->get(); return 1; } else if(eo.allow_complex && eo.allow_infinite && mstruct.number().isMinusInfinity()) { mstruct = CALCULATOR->v_pi; mstruct *= CALCULATOR->v_i->get(); Number nr; nr.setPlusInfinity(); mstruct += nr; return 1; } Number nr(mstruct.number()); if(nr.ln() && !(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { mstruct.set(nr, true); return 1; } if(mstruct.number().isRational() && mstruct.number().isPositive()) { if(mstruct.number().isInteger()) { if(mstruct.number().isLessThanOrEqualTo(PRIMES[NR_OF_PRIMES - 1])) { vector factors; mstruct.number().factorize(factors); if(factors.size() > 1) { mstruct.clear(true); mstruct.setType(STRUCT_ADDITION); for(size_t i = 0; i < factors.size(); i++) { if(i > 0 && factors[i] == factors[i - 1]) { if(mstruct.last().isMultiplication()) mstruct.last().last().number()++; else mstruct.last() *= nr_two; } else { mstruct.addChild(MathStructure(CALCULATOR->f_ln, NULL)); mstruct.last().addChild(factors[i]); } } if(mstruct.size() == 1) mstruct.setToChild(1, true); return 1; } } } else { MathStructure mstruct2(CALCULATOR->f_ln, NULL); mstruct2.addChild(mstruct.number().denominator()); mstruct.number().set(mstruct.number().numerator()); mstruct.transform(CALCULATOR->f_ln); mstruct -= mstruct2; return 1; } } else if(mstruct.number().hasImaginaryPart()) { if(mstruct.number().hasRealPart()) { MathStructure *marg = new MathStructure(mstruct); if(calculate_arg(*marg, eo)) { mstruct.transform(CALCULATOR->f_abs); mstruct.transform(CALCULATOR->f_ln); marg->multiply(CALCULATOR->v_i->get()); mstruct.add_nocopy(marg); return 1; } marg->unref(); } else { bool b_neg = mstruct.number().imaginaryPartIsNegative(); if(mstruct.number().abs()) { mstruct.transform(this); mstruct += b_neg ? nr_minus_half : nr_half; mstruct.last() *= CALCULATOR->v_pi; mstruct.last().multiply(CALCULATOR->v_i->get(), true); } return 1; } } } else if(mstruct.isPower()) { if((mstruct[0].representsPositive(true) && mstruct[1].representsReal()) || (mstruct[1].isNumber() && mstruct[1].number().isFraction())) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_ln, &mstruct[0], NULL); mstruct2 *= mstruct[1]; mstruct = mstruct2; return 1; } if(eo.approximation == APPROXIMATION_EXACT && !mstruct[1].isNumber()) { CALCULATOR->beginTemporaryStopMessages(); MathStructure mtest(mstruct[1]); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.eval(eo2); if(!CALCULATOR->endTemporaryStopMessages() && mtest.isNumber() && mtest.number().isFraction()) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_ln, &mstruct[0], NULL); mstruct2 *= mstruct[1]; mstruct = mstruct2; return 1; } } } if(eo.allow_complex && mstruct.representsNegative()) { mstruct.negate(); mstruct.transform(CALCULATOR->f_ln); mstruct += CALCULATOR->v_pi; mstruct.last() *= nr_one_i; return 1; } if(!mstruct.representsReal()) { MathStructure *marg = new MathStructure(mstruct); if(calculate_arg(*marg, eo)) { mstruct.transform(CALCULATOR->f_abs); mstruct.transform(CALCULATOR->f_ln); marg->multiply(CALCULATOR->v_i->get()); mstruct.add_nocopy(marg); return 1; } marg->unref(); } return -1; } LognFunction::LognFunction() : MathFunction("log", 1, 2) { Argument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, false); arg->setHandleVector(true); setArgumentDefinition(2, arg); setDefaultValue(2, "e"); } int LognFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector() || vargs[1].isVector()) return 0; if(vargs[1].isVariable() && vargs[1].variable() == CALCULATOR->v_e) { mstruct.set(CALCULATOR->f_ln, &vargs[0], NULL); return 1; } mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; MathStructure mstructv2 = vargs[1]; mstructv2.eval(eo); if(mstructv2.isVector()) return -2; if(mstruct.isPower()) { if((mstruct[0].representsPositive(true) && mstruct[1].representsReal()) || (mstruct[1].isNumber() && mstruct[1].number().isFraction())) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_logn, &mstruct[0], &mstructv2, NULL); mstruct2 *= mstruct[1]; mstruct = mstruct2; return 1; } } else if(mstruct.isMultiplication()) { bool b = true; for(size_t i = 0; i < mstruct.size(); i++) { if(!mstruct[i].representsPositive()) { b = false; break; } } if(b) { MathStructure mstruct2; mstruct2.set(CALCULATOR->f_logn, &mstruct[0], &mstructv2, NULL); for(size_t i = 1; i < mstruct.size(); i++) { mstruct2.add(MathStructure(CALCULATOR->f_logn, &mstruct[i], &mstructv2, NULL), i > 1); } mstruct = mstruct2; return 1; } } else if(mstruct.isNumber() && mstructv2.isNumber()) { Number nr(mstruct.number()); if(nr.log(mstructv2.number()) && !(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { mstruct.set(nr, true); return 1; } } mstruct.set(CALCULATOR->f_ln, &vargs[0], NULL); mstruct.divide_nocopy(new MathStructure(CALCULATOR->f_ln, &vargs[1], NULL)); return 1; } bool LambertWFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 2 && (vargs[0].representsNumber() && (vargs[1].isZero() || vargs[0].representsNonZero()));} bool LambertWFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 2 && (vargs[1].isZero() && vargs[0].representsNonNegative());} bool LambertWFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 2 && (vargs[0].isZero() || (vargs[1].isZero() && vargs[0].representsNonNegative()));} bool LambertWFunction::representsComplex(const MathStructure &vargs, bool) const {return vargs.size() == 2 && (vargs[0].representsComplex() || (vargs[0].representsNonZero() && (vargs[1].isInteger() && (!vargs[1].isMinusOne() || vargs[0].representsPositive()) && !vargs[1].isZero())));} bool LambertWFunction::representsNonZero(const MathStructure &vargs, bool) const {return vargs.size() == 2 && (vargs[1].representsNonZero() || vargs[0].representsNonZero());} LambertWFunction::LambertWFunction() : MathFunction("lambertw", 1, 2) { NumberArgument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setComplexAllowed(false); arg->setHandleVector(true); setArgumentDefinition(1, arg); setArgumentDefinition(2, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); setDefaultValue(2, "0"); } int LambertWFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; if(eo.approximation == APPROXIMATION_TRY_EXACT && vargs[1].isZero()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); if(mstruct.isVector()) {CALCULATOR->endTemporaryStopMessages(true); return -1;} } else { mstruct.eval(eo); if(mstruct.isVector()) return -1; } if(!vargs[1].isZero()) { if(vargs[0].isZero()) { mstruct.set(nr_minus_inf, true); return 1; } return 0; } bool b = false; if(mstruct.isZero()) { b = true; } else if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_e) { mstruct.set(1, 1, 0, true); b = true; } else if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isMinusOne() && mstruct[1].isPower() && mstruct[1][0].isVariable() && mstruct[1][0].variable() == CALCULATOR->v_e && mstruct[1][1].isMinusOne()) { mstruct.set(-1, 1, 0, true); b = true; } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(b); if(b) return 1; if(eo.approximation == APPROXIMATION_EXACT) return -1; if(eo.approximation == APPROXIMATION_TRY_EXACT && !mstruct.isNumber()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mstruct = vargs[0]; mstruct.eval(eo2); } if(mstruct.isNumber()) { Number nr(mstruct.number()); if(!nr.lambertW()) { //if(!CALCULATOR->aborted()) CALCULATOR->error(false, _("Argument for %s() must be a real number greater than or equal to -1/e."), preferredDisplayName().name.c_str(), NULL); } else if(!(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { mstruct.set(nr, true); return 1; } } return -1; } bool is_real_angle_value(const MathStructure &mstruct) { if(mstruct.isUnit()) { return mstruct.unit() == CALCULATOR->getRadUnit() || mstruct.unit() == CALCULATOR->getDegUnit() || mstruct.unit() == CALCULATOR->getGraUnit(); } else if(mstruct.isMultiplication()) { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(!b && mstruct[i].isUnit()) { if(mstruct[i].unit() == CALCULATOR->getRadUnit() || mstruct[i].unit() == CALCULATOR->getDegUnit() || mstruct[i].unit() == CALCULATOR->getGraUnit()) { b = true; } else { return false; } } else if(!mstruct[i].representsReal()) { return false; } } return b; } else if(mstruct.isAddition()) { for(size_t i = 0; i < mstruct.size(); i++) { if(!is_real_angle_value(mstruct[i])) return false; } return true; } return false; } bool is_infinite_angle_value(const MathStructure &mstruct) { if(mstruct.isMultiplication() && mstruct.size() == 2) { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(!b && mstruct[i].isUnit()) { if(mstruct[i].unit() == CALCULATOR->getRadUnit() || mstruct[i].unit() == CALCULATOR->getDegUnit() || mstruct[i].unit() == CALCULATOR->getGraUnit()) { b = true; } else { return false; } } else if(!mstruct[i].isNumber() || !mstruct[i].number().isInfinite()) { return false; } } return b; } return false; } bool is_number_angle_value(const MathStructure &mstruct, bool allow_infinity = false) { if(mstruct.isUnit()) { return mstruct.unit() == CALCULATOR->getRadUnit() || mstruct.unit() == CALCULATOR->getDegUnit() || mstruct.unit() == CALCULATOR->getGraUnit(); } else if(mstruct.isMultiplication()) { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(!b && mstruct[i].isUnit()) { if(mstruct[i].unit() == CALCULATOR->getRadUnit() || mstruct[i].unit() == CALCULATOR->getDegUnit() || mstruct[i].unit() == CALCULATOR->getGraUnit()) { b = true; } else { return false; } } else if(!mstruct[i].representsNumber()) { if(!allow_infinity || ((!mstruct[i].isNumber() || !mstruct[i].number().isInfinite()) && (!mstruct[i].isPower() || !mstruct[i][0].representsNumber() || !mstruct[i][1].representsNumber())) || mstruct[i].representsUndefined(true)) { return false; } } } return b; } else if(mstruct.isAddition()) { for(size_t i = 0; i < mstruct.size(); i++) { if(!is_number_angle_value(mstruct[i])) return false; } return true; } return false; } bool has_predominately_negative_sign(const MathStructure &mstruct) { if(mstruct.hasNegativeSign() && !mstruct.containsType(STRUCT_ADDITION, true)) return true; if(mstruct.isAddition() && mstruct.size() > 0) { size_t p_count = 0; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].hasNegativeSign()) { p_count++; if(p_count > mstruct.size() / 2) return true; } } if(mstruct.size() % 2 == 0 && p_count == mstruct.size() / 2) return mstruct[0].hasNegativeSign(); } return false; } bool trig_remove_i(MathStructure &mstruct) { if(mstruct.isNumber() && mstruct.number().hasImaginaryPart() && !mstruct.number().hasRealPart()) { mstruct.number() /= nr_one_i; return true; } else if(mstruct.isMultiplication() && mstruct.size() > 1 && mstruct[0].isNumber() && mstruct[0].number().hasImaginaryPart() && !mstruct[0].number().hasRealPart()) { mstruct[0].number() /= nr_one_i; return true; } else if(mstruct.isAddition() && mstruct.size() > 0) { for(size_t i = 0; i < mstruct.size(); i++) { if(!(mstruct[i].isNumber() && mstruct[i].number().hasImaginaryPart() && !mstruct[i].number().hasRealPart()) && !(mstruct[i].isMultiplication() && mstruct[i].size() > 1 && mstruct[i][0].isNumber() && mstruct[i][0].number().hasImaginaryPart() && !mstruct[i][0].number().hasRealPart())) { return false; } } for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isNumber()) mstruct[i].number() /= nr_one_i; else mstruct[i][0].number() /= nr_one_i; } return true; } return false; } SinFunction::SinFunction() : MathFunction("sin", 1) { Argument *arg = new AngleArgument(); arg->setHandleVector(true); setArgumentDefinition(1, arg); } bool SinFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_number_angle_value(vargs[0], true);} bool SinFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && (is_real_angle_value(vargs[0]) || is_infinite_angle_value(vargs[0]));} bool SinFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex(true);} int SinFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; if(CALCULATOR->getRadUnit()) { if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][1] == CALCULATOR->getRadUnit()) { mstruct = vargs[0][0]; } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][0] == CALCULATOR->getRadUnit()) { mstruct = vargs[0][1]; } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][1] == CALCULATOR->getDegUnit()) { mstruct = vargs[0][0]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 180), true); } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][0] == CALCULATOR->getDegUnit()) { mstruct = vargs[0][1]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 180), true); } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][1] == CALCULATOR->getGraUnit()) { mstruct = vargs[0][0]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 200), true); } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][0] == CALCULATOR->getGraUnit()) { mstruct = vargs[0][1]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 200), true); } else { mstruct = vargs[0]; mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } } else { mstruct = vargs[0]; } MathFunction *f = NULL; if(eo.approximation == APPROXIMATION_APPROXIMATE && (eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES || eo.parse_options.angle_unit == ANGLE_UNIT_GRADIANS)) { if(mstruct.isMultiplication() && mstruct.size() == 3 && mstruct[0].isFunction() && mstruct[0].size() == 1 && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi && mstruct[2].isNumber() && mstruct[2].number().equals(Number(1, eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES ? 180 : 200))) { f = mstruct[0].function(); } } if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); } else if(!f) { mstruct.eval(eo); } if(mstruct.isVector()) { if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); if(CALCULATOR->getRadUnit()) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i] *= CALCULATOR->getRadUnit(); } } return -1; } bool b = false, b_recalc = true; if(eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES || eo.parse_options.angle_unit == ANGLE_UNIT_GRADIANS) { if(!f && mstruct.isMultiplication() && mstruct.size() == 3 && mstruct[2].isFunction() && mstruct[2].size() == 1 && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi && mstruct[0].isNumber() && mstruct[0].number().equals(Number(1, eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES ? 180 : 200))) { f = mstruct[2].function(); } } else if(mstruct.isFunction() && mstruct.size() == 1) { f = mstruct.function(); } if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_pi) { mstruct.clear(); b = true; } else if(f) { if(f == CALCULATOR->f_asin) { if(!mstruct.isFunction()) mstruct.setToChild(mstruct[0].isFunction() ? 1 : 3, true); mstruct.setToChild(1, true); b = true; } else if(f == CALCULATOR->f_acos) { if(!mstruct.isFunction()) mstruct.setToChild(mstruct[0].isFunction() ? 1 : 3, true); mstruct.setToChild(1); mstruct ^= nr_two; mstruct.negate(); mstruct += nr_one; mstruct ^= nr_half; b = true; } else if(f == CALCULATOR->f_atan) { if(!mstruct.isFunction()) mstruct.setToChild(mstruct[0].isFunction() ? 1 : 3, true); mstruct.setToChild(1); MathStructure *mmul = new MathStructure(mstruct); mstruct ^= nr_two; mstruct += nr_one; mstruct ^= nr_minus_half; mstruct.multiply_nocopy(mmul); b = true; } } else if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isNumber() && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi) { if(mstruct[0].number().isInteger()) { mstruct.clear(); b = true; } else if(!mstruct[0].number().hasImaginaryPart() && !mstruct[0].number().includesInfinity() && !mstruct[0].number().isInterval()) { Number nr(mstruct[0].number()); nr.frac(); Number nr_int(mstruct[0].number()); nr_int.floor(); bool b_even = nr_int.isEven(); nr.setNegative(false); if(nr.equals(Number(1, 2, 0))) { if(b_even) mstruct.set(1, 1, 0); else mstruct.set(-1, 1, 0); b = true; } else if(nr.equals(Number(1, 4, 0)) || nr.equals(Number(3, 4, 0))) { mstruct.set(2, 1, 0); mstruct.raise_nocopy(new MathStructure(1, 2, 0)); mstruct.divide_nocopy(new MathStructure(2, 1, 0)); if(!b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(1, 3, 0)) || nr.equals(Number(2, 3, 0))) { mstruct.set(3, 1, 0); mstruct.raise_nocopy(new MathStructure(1, 2, 0)); mstruct.divide_nocopy(new MathStructure(2, 1, 0)); if(!b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(1, 6, 0)) || nr.equals(Number(5, 6, 0))) { if(b_even) mstruct.set(1, 2, 0); else mstruct.set(-1, 2, 0); b = true; } else if(eo.approximation == APPROXIMATION_EXACT && (mstruct[0].number().isNegative() || !mstruct[0].number().isFraction() || mstruct[0].number().isGreaterThan(nr_half))) { nr_int = mstruct[0].number(); nr_int.floor(); Number nr_frac = mstruct[0].number(); nr_frac -= nr_int; if(nr_frac.isGreaterThan(nr_half)) { nr_frac -= nr_half; mstruct[0].number() = nr_half; mstruct[0].number() -= nr_frac; } else { mstruct[0].number() = nr_frac; } if(nr_int.isOdd()) { if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); mstruct.transform(this); mstruct.negate(); b = true; } } } } else if(mstruct.isAddition()) { size_t i = 0; bool b_negate = false; for(; i < mstruct.size(); i++) { if((mstruct[i].isVariable() && mstruct[i].variable() == CALCULATOR->v_pi) || (mstruct[i].isMultiplication() && mstruct[i].size() == 2 && mstruct[i][1] == CALCULATOR->v_pi && mstruct[i][0].isNumber())) { if(mstruct[i].isVariable() || mstruct[i][0].number().isInteger()) { b_negate = mstruct[i].isVariable() || mstruct[i][0].number().isOdd(); mstruct.delChild(i + 1); b_recalc = false; break; } else if(mstruct[i][0].number().isReal() && (mstruct[i][0].number().isNegative() || !mstruct[i][0].number().isFraction())) { Number nr_int = mstruct[i][0].number(); nr_int.floor(); mstruct[i][0].number() -= nr_int; b_negate = nr_int.isOdd(); b_recalc = false; break; } } } b = b_negate; if(b_negate) { if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); mstruct.transform(this); mstruct.negate(); } } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(b); if(b) return 1; if(eo.approximation == APPROXIMATION_TRY_EXACT && !mstruct.isNumber()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; if(b_recalc) { mstruct = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } } mstruct.eval(eo2); } if(mstruct.isNumber()) { Number nr(mstruct.number()); if(nr.sin() && !(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { mstruct.set(nr, true); return 1; } } if(trig_remove_i(mstruct)) { mstruct.transform(CALCULATOR->f_sinh); mstruct *= nr_one_i; return 1; } if(has_predominately_negative_sign(mstruct)) { mstruct.negate(); if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); mstruct.transform(this); mstruct.negate(); return 1; } if(CALCULATOR->getRadUnit()) { if(mstruct.isVector()) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i] *= CALCULATOR->getRadUnit(); } } else { mstruct *= CALCULATOR->getRadUnit(); } } return -1; } CosFunction::CosFunction() : MathFunction("cos", 1) { Argument *arg = new AngleArgument(); arg->setHandleVector(true); setArgumentDefinition(1, arg); } bool CosFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_number_angle_value(vargs[0], true);} bool CosFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && (is_real_angle_value(vargs[0]) || is_infinite_angle_value(vargs[0]));} bool CosFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex(true);} int CosFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; if(CALCULATOR->getRadUnit()) { if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][1] == CALCULATOR->getRadUnit()) { mstruct = vargs[0][0]; } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][0] == CALCULATOR->getRadUnit()) { mstruct = vargs[0][1]; } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][1] == CALCULATOR->getDegUnit()) { mstruct = vargs[0][0]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 180), true); } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][0] == CALCULATOR->getDegUnit()) { mstruct = vargs[0][1]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 180), true); } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][1] == CALCULATOR->getGraUnit()) { mstruct = vargs[0][0]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 200), true); } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][0] == CALCULATOR->getGraUnit()) { mstruct = vargs[0][1]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 200), true); } else { mstruct = vargs[0]; mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } } else { mstruct = vargs[0]; } MathFunction *f = NULL; if(eo.approximation == APPROXIMATION_APPROXIMATE && (eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES || eo.parse_options.angle_unit == ANGLE_UNIT_GRADIANS)) { if(mstruct.isMultiplication() && mstruct.size() == 3 && mstruct[0].isFunction() && mstruct[0].size() == 1 && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi && mstruct[2].isNumber() && mstruct[2].number().equals(Number(1, eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES ? 180 : 200))) { f = mstruct[0].function(); } } if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); } else if(!f) { mstruct.eval(eo); } if(mstruct.isVector()) { if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); if(CALCULATOR->getRadUnit()) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i] *= CALCULATOR->getRadUnit(); } } return -1; } bool b = false, b_recalc = true; if(eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES || eo.parse_options.angle_unit == ANGLE_UNIT_GRADIANS) { if(!f && mstruct.isMultiplication() && mstruct.size() == 3 && mstruct[2].isFunction() && mstruct[2].size() == 1 && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi && mstruct[0].isNumber() && mstruct[0].number().equals(Number(1, eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES ? 180 : 200))) { f = mstruct[2].function(); } } else if(mstruct.isFunction() && mstruct.size() == 1) { f = mstruct.function(); } if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_pi) { mstruct = -1; b = true; } else if(f) { if(f == CALCULATOR->f_acos) { if(!mstruct.isFunction()) mstruct.setToChild(mstruct[0].isFunction() ? 1 : 3, true); mstruct.setToChild(1, true); b = true; } else if(f == CALCULATOR->f_asin) { if(!mstruct.isFunction()) mstruct.setToChild(mstruct[0].isFunction() ? 1 : 3, true); mstruct.setToChild(1); mstruct ^= nr_two; mstruct.negate(); mstruct += nr_one; mstruct ^= nr_half; b = true; } else if(f == CALCULATOR->f_atan) { if(!mstruct.isFunction()) mstruct.setToChild(mstruct[0].isFunction() ? 1 : 3, true); mstruct.setToChild(1); mstruct ^= nr_two; mstruct += nr_one; mstruct ^= nr_minus_half; b = true; } } else if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isNumber() && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi) { if(mstruct[0].number().isInteger()) { if(mstruct[0].number().isEven()) { mstruct = 1; } else { mstruct = -1; } b = true; } else if(!mstruct[0].number().hasImaginaryPart() && !mstruct[0].number().includesInfinity() && !mstruct[0].number().isInterval()) { Number nr(mstruct[0].number()); nr.frac(); Number nr_int(mstruct[0].number()); nr_int.trunc(); bool b_even = nr_int.isEven(); nr.setNegative(false); if(nr.equals(Number(1, 2, 0))) { mstruct.clear(); b = true; } else if(nr.equals(Number(1, 4, 0))) { mstruct.set(2, 1, 0); mstruct.raise_nocopy(new MathStructure(1, 2, 0)); mstruct.divide_nocopy(new MathStructure(2, 1, 0)); if(!b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(3, 4, 0))) { mstruct.set(2, 1, 0); mstruct.raise_nocopy(new MathStructure(1, 2, 0)); mstruct.divide_nocopy(new MathStructure(2, 1, 0)); if(b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(1, 3, 0))) { if(b_even) mstruct.set(1, 2, 0); else mstruct.set(-1, 2, 0); b = true; } else if(nr.equals(Number(2, 3, 0))) { if(b_even) mstruct.set(-1, 2, 0); else mstruct.set(1, 2, 0); b = true; } else if(nr.equals(Number(1, 6, 0))) { mstruct.set(3, 1, 0); mstruct.raise_nocopy(new MathStructure(1, 2, 0)); mstruct.divide_nocopy(new MathStructure(2, 1, 0)); if(!b_even) mstruct.negate(); b = true; } else if(nr.equals(Number(5, 6, 0))) { mstruct.set(3, 1, 0); mstruct.raise_nocopy(new MathStructure(1, 2, 0)); mstruct.divide_nocopy(new MathStructure(2, 1, 0)); if(b_even) mstruct.negate(); b = true; } else if(eo.approximation == APPROXIMATION_EXACT && (mstruct[0].number().isNegative() || !mstruct[0].number().isFraction() || mstruct[0].number().isGreaterThan(nr_half))) { nr_int = mstruct[0].number(); nr_int.floor(); Number nr_frac = mstruct[0].number(); nr_frac -= nr_int; if(nr_frac.isGreaterThan(nr_half)) { nr_frac -= nr_half; mstruct[0].number() = nr_half; mstruct[0].number() -= nr_frac; nr_int++; } else { mstruct[0].number() = nr_frac; } if(nr_int.isOdd()) { if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); mstruct.transform(this); mstruct.negate(); b = true; } } } } else if(mstruct.isAddition()) { size_t i = 0; bool b_negate = false; for(; i < mstruct.size(); i++) { if((mstruct[i].isVariable() && mstruct[i].variable() == CALCULATOR->v_pi) || (mstruct[i].isMultiplication() && mstruct[i].size() == 2 && mstruct[i][1] == CALCULATOR->v_pi && mstruct[i][0].isNumber())) { if(mstruct[i].isVariable() || mstruct[i][0].number().isInteger()) { b_negate = mstruct[i].isVariable() || mstruct[i][0].number().isOdd(); mstruct.delChild(i + 1); b_recalc = false; break; } else if(mstruct[i][0].number().isReal() && (mstruct[i][0].number().isNegative() || !mstruct[i][0].number().isFraction())) { Number nr_int = mstruct[i][0].number(); nr_int.floor(); mstruct[i][0].number() -= nr_int; b_negate = nr_int.isOdd(); b_recalc = false; break; } } } b = b_negate; if(b_negate) { if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); mstruct.transform(this); mstruct.negate(); } } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(b); if(b) return 1; if(eo.approximation == APPROXIMATION_TRY_EXACT && !mstruct.isNumber()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; if(b_recalc) { mstruct = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } } mstruct.eval(eo2); } if(mstruct.isNumber()) { Number nr(mstruct.number()); if(nr.cos() && !(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { mstruct.set(nr, true); return 1; } } if(trig_remove_i(mstruct)) { mstruct.transform(CALCULATOR->f_cosh); return 1; } if(has_predominately_negative_sign(mstruct)) { mstruct.negate(); } if(CALCULATOR->getRadUnit()) { if(mstruct.isVector()) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i] *= CALCULATOR->getRadUnit(); } } else { mstruct *= CALCULATOR->getRadUnit(); } } return -1; } TanFunction::TanFunction() : MathFunction("tan", 1) { Argument *arg = new AngleArgument(); arg->setHandleVector(true); setArgumentDefinition(1, arg); } bool TanFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_number_angle_value(vargs[0]);} bool TanFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_real_angle_value(vargs[0]);} bool TanFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex(true);} int TanFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; if(CALCULATOR->getRadUnit()) { if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][1] == CALCULATOR->getRadUnit()) { mstruct = vargs[0][0]; } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][0] == CALCULATOR->getRadUnit()) { mstruct = vargs[0][1]; } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][1] == CALCULATOR->getDegUnit()) { mstruct = vargs[0][0]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 180), true); } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][0] == CALCULATOR->getDegUnit()) { mstruct = vargs[0][1]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 180), true); } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][1] == CALCULATOR->getGraUnit()) { mstruct = vargs[0][0]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 200), true); } else if(vargs[0].isMultiplication() && vargs[0].size() == 2 && vargs[0][0] == CALCULATOR->getGraUnit()) { mstruct = vargs[0][1]; mstruct *= CALCULATOR->v_pi; mstruct.multiply(Number(1, 200), true); } else { mstruct = vargs[0]; mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } } else { mstruct = vargs[0]; } MathFunction *f = NULL; if(eo.approximation == APPROXIMATION_APPROXIMATE && (eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES || eo.parse_options.angle_unit == ANGLE_UNIT_GRADIANS)) { if(mstruct.isMultiplication() && mstruct.size() == 3 && mstruct[0].isFunction() && mstruct[0].size() == 1 && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi && mstruct[2].isNumber() && mstruct[2].number().equals(Number(1, eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES ? 180 : 200))) { f = mstruct[0].function(); } } if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); } else if(!f) { mstruct.eval(eo); } if(mstruct.isVector()) { if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); if(CALCULATOR->getRadUnit()) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i] *= CALCULATOR->getRadUnit(); } } return -1; } bool b = false, b_recalc = true; if(eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES || eo.parse_options.angle_unit == ANGLE_UNIT_GRADIANS) { if(!f && mstruct.isMultiplication() && mstruct.size() == 3 && mstruct[2].isFunction() && mstruct[2].size() == 1 && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi && mstruct[0].isNumber() && mstruct[0].number().equals(Number(1, eo.parse_options.angle_unit == ANGLE_UNIT_DEGREES ? 180 : 200))) { f = mstruct[2].function(); } } else if(mstruct.isFunction() && mstruct.size() == 1) { f = mstruct.function(); } if(mstruct.isVariable() && mstruct.variable() == CALCULATOR->v_pi) { mstruct.clear(); b = true; } else if(f) { if(f == CALCULATOR->f_atan) { if(!mstruct.isFunction()) mstruct.setToChild(mstruct[0].isFunction() ? 1 : 3, true); mstruct.setToChild(1, true); b = true; } else if(f == CALCULATOR->f_asin) { if(!mstruct.isFunction()) mstruct.setToChild(mstruct[0].isFunction() ? 1 : 3, true); mstruct.setToChild(1); MathStructure *mmul = new MathStructure(mstruct); mstruct ^= nr_two; mstruct.negate(); mstruct += nr_one; mstruct ^= nr_minus_half; mstruct.multiply_nocopy(mmul); b = true; } else if(f == CALCULATOR->f_acos) { if(!mstruct.isFunction()) mstruct.setToChild(mstruct[0].isFunction() ? 1 : 3, true); mstruct.setToChild(1); MathStructure *mmul = new MathStructure(mstruct); mstruct ^= nr_two; mstruct.negate(); mstruct += nr_one; mstruct ^= nr_half; mstruct.divide_nocopy(mmul); b = true; } } else if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isNumber() && mstruct[1].isVariable() && mstruct[1].variable() == CALCULATOR->v_pi) { if(mstruct[0].number().isInteger()) { mstruct.clear(); b = true; } else if(!mstruct[0].number().hasImaginaryPart() && !mstruct[0].number().includesInfinity() && !mstruct[0].number().isInterval()) { Number nr(mstruct[0].number()); nr.frac(); bool b_neg = nr.isNegative(); nr.setNegative(false); if(nr.equals(nr_half)) { Number nr_int(mstruct[0].number()); nr_int.floor(); bool b_even = nr_int.isEven(); if(b_even) nr.setPlusInfinity(); else nr.setMinusInfinity(); mstruct.set(nr); b = true; } else if(nr.equals(Number(1, 4, 0))) { if(b_neg) mstruct.set(-1, 1, 0); else mstruct.set(1, 1, 0); b = true; } else if(nr.equals(Number(3, 4, 0))) { if(!b_neg) mstruct.set(-1, 1, 0); else mstruct.set(1, 1, 0); b = true; } else if(nr.equals(Number(1, 3, 0))) { mstruct.set(3, 1, 0); mstruct.raise_nocopy(new MathStructure(1, 2, 0)); if(b_neg) mstruct.negate(); b = true; } else if(nr.equals(Number(2, 3, 0))) { mstruct.set(3, 1, 0); mstruct.raise_nocopy(new MathStructure(1, 2, 0)); if(!b_neg) mstruct.negate(); b = true; } else if(nr.equals(Number(1, 6, 0))) { mstruct.set(3, 1, 0); mstruct.raise_nocopy(new MathStructure(-1, 2, 0)); if(b_neg) mstruct.negate(); b = true; } else if(nr.equals(Number(5, 6, 0))) { mstruct.set(3, 1, 0); mstruct.raise_nocopy(new MathStructure(-1, 2, 0)); if(!b_neg) mstruct.negate(); b = true; } else if(eo.approximation == APPROXIMATION_EXACT && (mstruct[0].number().isNegative() || !mstruct[0].number().isFraction() || mstruct[0].number().isGreaterThan(nr_half))) { Number nr_int(mstruct[0].number()); nr_int.floor(); Number nr_frac = mstruct[0].number(); nr_frac -= nr_int; if(nr_frac.isGreaterThan(nr_half)) { nr_frac -= nr_half; mstruct[0].number() = nr_half; mstruct[0].number() -= nr_frac; if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); mstruct.transform(this); mstruct.negate(); b = true; } else { mstruct[0].number() = nr_frac; } } } } else if(mstruct.isAddition()) { size_t i = 0; for(; i < mstruct.size(); i++) { if((mstruct[i].isVariable() && mstruct[i].variable() == CALCULATOR->v_pi) || (mstruct[i].isMultiplication() && mstruct[i].size() == 2 && mstruct[i][1] == CALCULATOR->v_pi && mstruct[i][0].isNumber())) { if(mstruct[i].isVariable() || mstruct[i][0].number().isInteger()) { mstruct.delChild(i + 1); b_recalc = false; break; } else if(mstruct[i][0].number().isReal() && (mstruct[i][0].number().isNegative() || !mstruct[i][0].number().isFraction())) { Number nr_int = mstruct[i][0].number(); nr_int.floor(); mstruct[i][0].number() -= nr_int; b_recalc = false; break; } } } } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(b); if(b) return 1; if(eo.approximation == APPROXIMATION_TRY_EXACT && !mstruct.isNumber()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; if(b_recalc) { mstruct = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } mstruct.eval(eo2); } } if(mstruct.isNumber()) { Number nr(mstruct.number()); if(nr.tan() && !(eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) && !(!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) && !(!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { mstruct.set(nr, true); return 1; } } if(trig_remove_i(mstruct)) { mstruct.transform(CALCULATOR->f_tanh); mstruct *= nr_one_i; return 1; } if(has_predominately_negative_sign(mstruct)) { mstruct.negate(); if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit(); mstruct.transform(this); mstruct.negate(); return 1; } if(CALCULATOR->getRadUnit()) { if(mstruct.isVector()) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i] *= CALCULATOR->getRadUnit(); } } else { mstruct *= CALCULATOR->getRadUnit(); } } return -1; } AsinFunction::AsinFunction() : MathFunction("asin", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool AsinFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} int AsinFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); } else { mstruct.eval(eo); } if(mstruct.isVector()) { if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return -1; } if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0] == nr_half && mstruct[1].isPower() && mstruct[1][1] == nr_half) { if(mstruct[1][0] == nr_two) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(45, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(50, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} default: {mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();}} } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return 1; } else if(mstruct[1][0] == nr_three) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(60, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(200, 3, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(1, 3, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} default: {mstruct.set(1, 3, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();}} } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return 1; } } else if(mstruct.isPower() && mstruct[1] == nr_minus_half && mstruct[0] == nr_two) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(45, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(50, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} default: {mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();}} } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return 1; } if(eo.approximation == APPROXIMATION_TRY_EXACT) { if(!mstruct.isNumber()) { CALCULATOR->endTemporaryStopMessages(false); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mstruct = vargs[0]; mstruct.eval(eo2); } else { CALCULATOR->endTemporaryStopMessages(true); } } if(!mstruct.isNumber()) { if(trig_remove_i(mstruct)) { mstruct.transform(CALCULATOR->f_asinh); mstruct *= nr_one_i; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.multiply_nocopy(new MathStructure(180, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.multiply_nocopy(new MathStructure(200, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();} break;} } return 1; } if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } if(mstruct.number().isZero()) { mstruct.clear(); } else if(mstruct.number().isOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(90, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(100, 1, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(mstruct.number().isMinusOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(-90, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(-100, 1, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(-1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(-1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(mstruct.number().equals(nr_half)) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(30, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(100, 3, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 6, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 6, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else { Number nr = mstruct.number(); if(!nr.asin() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { if(trig_remove_i(mstruct)) { mstruct.transform(CALCULATOR->f_asinh); mstruct *= nr_one_i; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.multiply_nocopy(new MathStructure(180, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.multiply_nocopy(new MathStructure(200, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();} break;} } return 1; } if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } mstruct = nr; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.multiply_nocopy(new MathStructure(180, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.multiply_nocopy(new MathStructure(200, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();} break;} } } return 1; } AcosFunction::AcosFunction() : MathFunction("acos", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool AcosFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} int AcosFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); } else { mstruct.eval(eo); } if(mstruct.isVector()) { if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return -1; } if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0] == nr_half && mstruct[1].isPower() && mstruct[1][1] == nr_half) { if(mstruct[1][0] == nr_two) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(45, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(50, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} default: {mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();}} } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return 1; } else if(mstruct[1][0] == nr_three) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(30, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(100, 3, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(1, 6, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} default: {mstruct.set(1, 6, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();}} } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return 1; } } else if(mstruct.isPower() && mstruct[1] == nr_minus_half && mstruct[0] == nr_two) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(45, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(50, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} default: {mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();}} } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return 1; } if(eo.approximation == APPROXIMATION_TRY_EXACT) { if(!mstruct.isNumber()) { CALCULATOR->endTemporaryStopMessages(false); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mstruct = vargs[0]; mstruct.eval(eo2); } else { CALCULATOR->endTemporaryStopMessages(true); } } if(!mstruct.isNumber()) { if(has_predominately_negative_sign(mstruct)) { mstruct.negate(); mstruct.transform(CALCULATOR->f_asin); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct += Number(90, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct += Number(100, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct += CALCULATOR->v_pi; mstruct.last() *= nr_half; break;} default: {mstruct += CALCULATOR->v_pi; mstruct.last() *= nr_half; if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();} break;} } return 1; } return -1; } if(mstruct.number().isZero()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(90, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(100, 1, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(mstruct.number().isOne()) { mstruct.clear(); } else if(mstruct.number().isMinusOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(180, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(200, 1, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(CALCULATOR->v_pi); break; } default: { mstruct.set(CALCULATOR->v_pi); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(mstruct.number().equals(nr_half)) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(60, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(200, 3, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 3, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 3, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else { Number nr = mstruct.number(); if(!nr.acos() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { if(has_predominately_negative_sign(mstruct)) { mstruct.negate(); mstruct.transform(CALCULATOR->f_asin); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct += Number(90, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct += Number(100, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct += CALCULATOR->v_pi; mstruct.last() *= nr_half; break;} default: {mstruct += CALCULATOR->v_pi; mstruct.last() *= nr_half; if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();} break;} } return 1; } return -1; } mstruct = nr; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.multiply_nocopy(new MathStructure(180, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.multiply_nocopy(new MathStructure(200, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();} break;} } } return 1; } AtanFunction::AtanFunction() : MathFunction("atan", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool AtanFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber() && !vargs[0].number().isI() && !vargs[0].number().isMinusI();} bool AtanFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool AtanFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex();} int AtanFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; if(eo.approximation == APPROXIMATION_TRY_EXACT) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); } else { mstruct.eval(eo); } if(mstruct.isVector()) { if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return -1; } if(mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isNumber() && mstruct[1].isPower() && mstruct[1][1] == nr_half && mstruct[1][0] == nr_three && mstruct[0].number() == Number(1, 3)) { if(mstruct[1][0] == nr_three) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(30, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(100, 3, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(1, 6, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} default: {mstruct.set(1, 6, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();}} } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return 1; } } else if(mstruct.isPower() && mstruct[1] == nr_half && mstruct[0] == nr_three) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(60, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(200, 3, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(1, 3, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} default: {mstruct.set(1, 3, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();}} } if(eo.approximation == APPROXIMATION_TRY_EXACT) CALCULATOR->endTemporaryStopMessages(true); return 1; } if(eo.approximation == APPROXIMATION_TRY_EXACT) { if(!mstruct.isNumber()) { CALCULATOR->endTemporaryStopMessages(false); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mstruct = vargs[0]; mstruct.eval(eo2); } else { CALCULATOR->endTemporaryStopMessages(true); } } if(!mstruct.isNumber()) { if(trig_remove_i(mstruct)) { mstruct.transform(CALCULATOR->f_atanh); mstruct *= nr_one_i; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.multiply_nocopy(new MathStructure(180, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.multiply_nocopy(new MathStructure(200, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();} break;} } return 1; } if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } if(mstruct.number().isZero()) { mstruct.clear(); } else if(eo.allow_infinite && mstruct.number().isI()) { Number nr; nr.setImaginaryPart(nr_plus_inf); mstruct = nr; } else if(eo.allow_infinite && mstruct.number().isMinusI()) { Number nr; nr.setImaginaryPart(nr_minus_inf); mstruct = nr; } else if(mstruct.number().isPlusInfinity()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(90, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(100, 1, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(mstruct.number().isMinusInfinity()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(-90, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(-100, 1, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(-1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(-1, 2, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(mstruct.number().isOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(45, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(50, 1, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else if(mstruct.number().isMinusOne()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct.set(-45, 1, 0); break; } case ANGLE_UNIT_GRADIANS: { mstruct.set(-50, 1, 0); break; } case ANGLE_UNIT_RADIANS: { mstruct.set(-1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break; } default: { mstruct.set(-1, 4, 0); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } } else { Number nr = mstruct.number(); if(!nr.atan() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { if(trig_remove_i(mstruct)) { mstruct.transform(CALCULATOR->f_atanh); mstruct *= nr_one_i; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.multiply_nocopy(new MathStructure(180, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.multiply_nocopy(new MathStructure(200, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();} break;} } return 1; } if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } mstruct = nr; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.multiply_nocopy(new MathStructure(180, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.multiply_nocopy(new MathStructure(200, 1, 0)); mstruct.divide_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct *= CALCULATOR->getRadUnit();} break;} } } return 1; } SinhFunction::SinhFunction() : MathFunction("sinh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool SinhFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool SinhFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool SinhFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex();} int SinhFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.isFunction() && mstruct.size() == 1) { if(mstruct.function() == CALCULATOR->f_asinh) { mstruct.setToChild(1, true); return 1; } else if(mstruct.function() == CALCULATOR->f_acosh) { mstruct.setToChild(1); MathStructure *mmul = new MathStructure(mstruct); mstruct += nr_minus_one; mstruct ^= nr_half; *mmul += nr_one; *mmul ^= nr_half; mstruct.multiply_nocopy(mmul); return 1; } else if(mstruct.function() == CALCULATOR->f_atanh) { mstruct.setToChild(1); MathStructure *mmul = new MathStructure(mstruct); mstruct ^= nr_two; mstruct.negate(); mstruct += nr_one; mstruct ^= nr_minus_half; mstruct.multiply_nocopy(mmul); return 1; } } if(!mstruct.isNumber()) { if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } Number nr = mstruct.number(); if(!nr.sinh() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } mstruct = nr; return 1; } CoshFunction::CoshFunction() : MathFunction("cosh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool CoshFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool CoshFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool CoshFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex();} int CoshFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.isFunction() && mstruct.size() == 1) { if(mstruct.function() == CALCULATOR->f_acosh) { mstruct.setToChild(1, true); return 1; } else if(mstruct.function() == CALCULATOR->f_asinh) { mstruct.setToChild(1); mstruct ^= nr_two; mstruct += nr_one; mstruct ^= nr_half; return 1; } else if(mstruct.function() == CALCULATOR->f_atanh) { mstruct.setToChild(1); mstruct ^= nr_two; mstruct.negate(); mstruct += nr_one; mstruct ^= nr_minus_half; return 1; } } if(!mstruct.isNumber()) { if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); return -1;} return -1; } Number nr = mstruct.number(); if(!nr.cosh() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { if(has_predominately_negative_sign(mstruct)) mstruct.negate(); return -1; } mstruct = nr; return 1; } TanhFunction::TanhFunction() : MathFunction("tanh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool TanhFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool TanhFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool TanhFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex();} int TanhFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.isFunction() && mstruct.size() == 1) { if(mstruct.function() == CALCULATOR->f_atanh) { mstruct.setToChild(1, true); return 1; } else if(mstruct.function() == CALCULATOR->f_asinh) { mstruct.setToChild(1); MathStructure *mmul = new MathStructure(mstruct); mstruct ^= nr_two; mstruct += nr_one; mstruct ^= nr_minus_half; mstruct.multiply_nocopy(mmul); return 1; } else if(mstruct.function() == CALCULATOR->f_acosh) { mstruct.setToChild(1); MathStructure *mmul = new MathStructure(mstruct); MathStructure *mmul2 = new MathStructure(mstruct); *mmul2 ^= nr_minus_one; mstruct += nr_minus_one; mstruct ^= nr_half; *mmul += nr_one; *mmul ^= nr_half; mstruct.multiply_nocopy(mmul); mstruct.multiply_nocopy(mmul2); return 1; } } if(!mstruct.isNumber()) { if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } Number nr = mstruct.number(); if(!nr.tanh() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } mstruct = nr; return 1; } AsinhFunction::AsinhFunction() : MathFunction("asinh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } bool AsinhFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool AsinhFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool AsinhFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex();} int AsinhFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(!mstruct.isNumber()) { if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } Number nr = mstruct.number(); if(!nr.asinh() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } mstruct = nr; return 1; } AcoshFunction::AcoshFunction() : MathFunction("acosh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } bool AcoshFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} int AcoshFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(acosh) } AtanhFunction::AtanhFunction() : MathFunction("atanh", 1) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false)); } int AtanhFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(!mstruct.isNumber()) { if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } if(mstruct.number().includesInfinity()) { if(mstruct.number().isPlusInfinity() || (!mstruct.number().hasRealPart() && mstruct.number().hasImaginaryPart() && mstruct.number().internalImaginary()->isMinusInfinity())) { mstruct = nr_minus_half; mstruct *= nr_one_i; mstruct *= CALCULATOR->v_pi; return true; } else if(mstruct.number().isMinusInfinity() || (!mstruct.number().hasRealPart() && mstruct.number().hasImaginaryPart() && mstruct.number().internalImaginary()->isPlusInfinity())) { mstruct = nr_half; mstruct *= nr_one_i; mstruct *= CALCULATOR->v_pi; return true; } } Number nr = mstruct.number(); if(!nr.atanh() || (eo.approximation == APPROXIMATION_EXACT && nr.isApproximate() && !mstruct.isApproximate()) || (!eo.allow_complex && nr.isComplex() && !mstruct.number().isComplex()) || (!eo.allow_infinite && nr.includesInfinity() && !mstruct.number().includesInfinity())) { if(has_predominately_negative_sign(mstruct)) {mstruct.negate(); mstruct.transform(this); mstruct.negate(); return 1;} return -1; } mstruct = nr; return 1; } Atan2Function::Atan2Function() : MathFunction("atan2", 2) { NumberArgument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, true); arg->setComplexAllowed(false); setArgumentDefinition(1, arg); arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, true); arg->setComplexAllowed(false); setArgumentDefinition(2, arg); } bool Atan2Function::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[0].representsNumber() && vargs[1].representsNumber();} int Atan2Function::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].number().isZero()) { if(!vargs[1].number().isNonZero()) return 0; if(vargs[1].number().isNegative()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(180, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(200, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(CALCULATOR->v_pi); break;} default: {mstruct.set(CALCULATOR->v_pi); if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit();} } } else { mstruct.clear(); } } else if(vargs[1].number().isZero() && vargs[0].number().isNonZero()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(90, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(100, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(CALCULATOR->v_pi); mstruct.multiply(nr_half); break;} default: {mstruct.set(CALCULATOR->v_pi); mstruct.multiply(nr_half); if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit();} } if(vargs[0].number().hasNegativeSign()) mstruct.negate(); } else if(!vargs[1].number().isNonZero()) { FR_FUNCTION_2(atan2) } else { MathStructure new_nr(vargs[0]); if(!new_nr.number().divide(vargs[1].number())) return -1; if(vargs[1].number().isNegative() && vargs[0].number().isNonZero()) { if(vargs[0].number().isNegative()) { mstruct.set(CALCULATOR->f_atan, &new_nr, NULL); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.add(-180); break;} case ANGLE_UNIT_GRADIANS: {mstruct.add(-200); break;} case ANGLE_UNIT_RADIANS: {mstruct.subtract(CALCULATOR->v_pi); break;} default: {MathStructure msub(CALCULATOR->v_pi); if(CALCULATOR->getRadUnit()) msub *= CALCULATOR->getRadUnit(); mstruct.subtract(msub);} } } else { mstruct.set(CALCULATOR->f_atan, &new_nr, NULL); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.add(180); break;} case ANGLE_UNIT_GRADIANS: {mstruct.add(200); break;} case ANGLE_UNIT_RADIANS: {mstruct.add(CALCULATOR->v_pi); break;} default: {MathStructure madd(CALCULATOR->v_pi); if(CALCULATOR->getRadUnit()) madd *= CALCULATOR->getRadUnit(); mstruct.add(madd);} } } } else { mstruct.set(CALCULATOR->f_atan, &new_nr, NULL); } } return 1; } bool calculate_arg(MathStructure &mstruct, const EvaluationOptions &eo) { MathStructure msave; if(!mstruct.isNumber()) { if(mstruct.isPower() && mstruct[0] == CALCULATOR->v_e && mstruct[1].isNumber() && mstruct[1].number().hasImaginaryPart() && !mstruct[1].number().hasRealPart()) { CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->beginTemporaryEnableIntervalArithmetic(); Number nr(*mstruct[1].number().internalImaginary()); nr.add(CALCULATOR->v_pi->get().number()); nr.divide(CALCULATOR->v_pi->get().number() * 2); Number nr_u(nr.upperEndPoint()); nr = nr.lowerEndPoint(); CALCULATOR->endTemporaryEnableIntervalArithmetic(); nr_u.floor(); nr.floor(); if(!CALCULATOR->endTemporaryStopMessages() && nr == nr_u) { nr.setApproximate(false); nr *= 2; nr.negate(); mstruct = mstruct[1].number().imaginaryPart(); if(!nr.isZero()) { mstruct += nr; mstruct.last() *= CALCULATOR->v_pi; } return true; } } if(eo.approximation == APPROXIMATION_EXACT) { msave = mstruct; if(!test_eval(mstruct, eo)) { mstruct = msave; return false; } } } if(mstruct.isNumber()) { if(!mstruct.number().hasImaginaryPart()) { return false; } else if(!mstruct.number().hasRealPart() && mstruct.number().imaginaryPartIsNonZero()) { bool b_neg = mstruct.number().imaginaryPartIsNegative(); mstruct.set(CALCULATOR->v_pi); mstruct.multiply(nr_half); if(b_neg) mstruct.negate(); } else if(!msave.isZero()) { mstruct = msave; return false; } else if(!mstruct.number().realPartIsNonZero()) { return false; } else { MathStructure new_nr(mstruct.number().imaginaryPart()); if(!new_nr.number().divide(mstruct.number().realPart())) return false; if(mstruct.number().realPartIsNegative()) { if(mstruct.number().imaginaryPartIsNegative()) { mstruct.set(CALCULATOR->f_atan, &new_nr, NULL); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.divide_nocopy(new MathStructure(180, 1, 0)); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.divide_nocopy(new MathStructure(200, 1, 0)); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct /= CALCULATOR->getRadUnit();} break;} } mstruct.subtract(CALCULATOR->v_pi); } else if(mstruct.number().imaginaryPartIsNonNegative()) { mstruct.set(CALCULATOR->f_atan, &new_nr, NULL); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.divide_nocopy(new MathStructure(180, 1, 0)); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.divide_nocopy(new MathStructure(200, 1, 0)); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct /= CALCULATOR->getRadUnit();} break;} } mstruct.add(CALCULATOR->v_pi); } else { return false; } } else { mstruct.set(CALCULATOR->f_atan, &new_nr, NULL); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.divide_nocopy(new MathStructure(180, 1, 0)); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_GRADIANS: {mstruct.divide_nocopy(new MathStructure(200, 1, 0)); mstruct.multiply_nocopy(new MathStructure(CALCULATOR->v_pi)); break;} case ANGLE_UNIT_RADIANS: {break;} default: {if(CALCULATOR->getRadUnit()) {mstruct /= CALCULATOR->getRadUnit();} break;} } } } return true; } if(!msave.isZero()) { mstruct = msave; } return false; } ArgFunction::ArgFunction() : MathFunction("arg", 1) { Argument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } bool ArgFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber(true);} bool ArgFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber(true);} bool ArgFunction::representsNonComplex(const MathStructure &vargs, bool) const {return true;} int ArgFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; MathStructure msave; arg_test_non_number: if(!mstruct.isNumber()) { if(mstruct.representsPositive(true)) { mstruct.clear(); return 1; } if(mstruct.representsNegative(true)) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(180, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(200, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(CALCULATOR->v_pi); break;} default: {mstruct.set(CALCULATOR->v_pi); if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit();} } return 1; } if(!msave.isZero()) { mstruct = msave; return -1; } if(mstruct.isMultiplication()) { bool b = false; for(size_t i = 0; i < mstruct.size();) { if(mstruct[i].representsPositive()) { mstruct.delChild(i + 1); b = true; } else { if(!mstruct[i].isMinusOne() && mstruct[i].representsNegative()) { mstruct[i].set(-1, 1, 0, true); b = true; } i++; } } if(b) { if(mstruct.size() == 1) { mstruct.setToChild(1); } else if(mstruct.size() == 0) { mstruct.clear(true); } mstruct.transform(STRUCT_FUNCTION); mstruct.setFunction(this); return 1; } } if(mstruct.isPower() && mstruct[0].representsComplex() && mstruct[1].representsInteger()) { mstruct.setType(STRUCT_MULTIPLICATION); mstruct[0].transform(STRUCT_FUNCTION); mstruct[0].setFunction(this); return 1; } if(mstruct.isPower() && mstruct[0] == CALCULATOR->v_e && mstruct[1].isNumber() && mstruct[1].number().hasImaginaryPart() && !mstruct[1].number().hasRealPart()) { CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->beginTemporaryEnableIntervalArithmetic(); Number nr(*mstruct[1].number().internalImaginary()); nr.add(CALCULATOR->v_pi->get().number()); nr.divide(CALCULATOR->v_pi->get().number() * 2); Number nr_u(nr.upperEndPoint()); nr = nr.lowerEndPoint(); CALCULATOR->endTemporaryEnableIntervalArithmetic(); nr_u.floor(); nr.floor(); if(!CALCULATOR->endTemporaryStopMessages() && nr == nr_u) { nr.setApproximate(false); nr *= 2; nr.negate(); mstruct = mstruct[1].number().imaginaryPart(); if(!nr.isZero()) { mstruct += nr; mstruct.last() *= CALCULATOR->v_pi; } return true; } } if(eo.approximation == APPROXIMATION_EXACT) { msave = mstruct; if(!test_eval(mstruct, eo)) { mstruct = msave; return -1; } } } if(mstruct.isNumber()) { if(!mstruct.number().hasImaginaryPart()) { if(!mstruct.number().isNonZero()) { if(!msave.isZero()) mstruct = msave; return -1; } if(mstruct.number().isNegative()) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(180, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(200, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(CALCULATOR->v_pi); break;} default: {mstruct.set(CALCULATOR->v_pi); if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit();} } } else { mstruct.clear(); } } else if(!mstruct.number().hasRealPart() && mstruct.number().imaginaryPartIsNonZero()) { bool b_neg = mstruct.number().imaginaryPartIsNegative(); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.set(90, 1, 0); break;} case ANGLE_UNIT_GRADIANS: {mstruct.set(100, 1, 0); break;} case ANGLE_UNIT_RADIANS: {mstruct.set(CALCULATOR->v_pi); mstruct.multiply(nr_half); break;} default: {mstruct.set(CALCULATOR->v_pi); mstruct.multiply(nr_half); if(CALCULATOR->getRadUnit()) mstruct *= CALCULATOR->getRadUnit();} } if(b_neg) mstruct.negate(); } else if(!msave.isZero()) { mstruct = msave; return -1; } else if(!mstruct.number().realPartIsNonZero()) { FR_FUNCTION(arg) } else { MathStructure new_nr(mstruct.number().imaginaryPart()); if(!new_nr.number().divide(mstruct.number().realPart())) return -1; if(mstruct.number().realPartIsNegative()) { if(mstruct.number().imaginaryPartIsNegative()) { mstruct.set(CALCULATOR->f_atan, &new_nr, NULL); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.add(-180); break;} case ANGLE_UNIT_GRADIANS: {mstruct.add(-200); break;} case ANGLE_UNIT_RADIANS: {mstruct.subtract(CALCULATOR->v_pi); break;} default: {MathStructure msub(CALCULATOR->v_pi); if(CALCULATOR->getRadUnit()) msub *= CALCULATOR->getRadUnit(); mstruct.subtract(msub);} } } else if(mstruct.number().imaginaryPartIsNonNegative()) { mstruct.set(CALCULATOR->f_atan, &new_nr, NULL); switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: {mstruct.add(180); break;} case ANGLE_UNIT_GRADIANS: {mstruct.add(200); break;} case ANGLE_UNIT_RADIANS: {mstruct.add(CALCULATOR->v_pi); break;} default: {MathStructure madd(CALCULATOR->v_pi); if(CALCULATOR->getRadUnit()) madd *= CALCULATOR->getRadUnit(); mstruct.add(madd);} } } else { FR_FUNCTION(arg) } } else { mstruct.set(CALCULATOR->f_atan, &new_nr, NULL); } } return 1; } if(!msave.isZero()) { goto arg_test_non_number; } return -1; } SincFunction::SincFunction() : MathFunction("sinc", 1) { Argument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setHandleVector(true); setArgumentDefinition(1, arg); } bool SincFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && (vargs[0].representsNumber() || is_number_angle_value(vargs[0]));} bool SincFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && (vargs[0].representsReal() || is_real_angle_value(vargs[0]));} bool SincFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex();} int SincFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isVector()) return -1; if(mstruct.containsType(STRUCT_UNIT) && CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } if(mstruct.isZero()) { mstruct.set(1, 1, 0, true); return 1; } else if(mstruct.representsNonZero(true)) { MathStructure *m_sin = new MathStructure(CALCULATOR->f_sin, &mstruct, NULL); if(CALCULATOR->getRadUnit()) (*m_sin)[0].multiply(CALCULATOR->getRadUnit()); mstruct.inverse(); mstruct.multiply_nocopy(m_sin); return 1; } return -1; } bool create_interval(MathStructure &mstruct, const MathStructure &m1, const MathStructure &m2) { if(m1 == m2) { mstruct.set(m1, true); return 1; } else if(m1.isNumber() && m2.isNumber()) { Number nr; if(!nr.setInterval(m1.number(), m2.number())) return false; mstruct.set(nr, true); return true; } else if(m1.isMultiplication() && m2.isMultiplication() && m1.size() > 1 && m2.size() > 1) { size_t i0 = 0, i1 = 0; if(m1[0].isNumber()) i0++; if(m2[0].isNumber()) i1++; if(i0 == 0 && i1 == 0) return false; if(m1.size() - i0 != m2.size() - i1) return false; for(size_t i = 0; i < m1.size() - i0; i++) { if(!m1[i + i0].equals(m2[i + i1], true)) { return false; } } Number nr; if(!nr.setInterval(i0 == 1 ? m1[0].number() : nr_one, i1 == 1 ? m2[0].number() : nr_one)) return 0; mstruct.set(m1, true); if(i0 == 1) mstruct.delChild(1, true); mstruct *= nr; mstruct.evalSort(false); return 1; } else if(m1.isAddition() && m2.isAddition() && m1.size() > 1 && m2.size() > 1) { size_t i0 = 0, i1 = 0; if(m1.last().isNumber()) i0++; if(m2.last().isNumber()) i1++; if(i0 == 0 && i1 == 0) return false; if(m1.size() - i0 != m2.size() - i1) return false; for(size_t i = 0; i < m1.size() - i0; i++) { if(!m1[i].equals(m2[i], true)) { return false; } } Number nr; if(!nr.setInterval(i0 == 1 ? m1.last().number() : nr_one, i1 == 1 ? m2.last().number() : nr_one)) return false; mstruct.set(m1, true); if(i0 == 1) mstruct.delChild(mstruct.size(), true); mstruct += nr; mstruct.evalSort(false); return true; } else if(m1.isMultiplication() && m1.size() == 2 && m1[0].isNumber() && m2.equals(m1[1], true)) { Number nr; if(!nr.setInterval(m1[0].number(), nr_one)) return false; mstruct.set(nr, true); mstruct *= m2; return true; } else if(m2.isMultiplication() && m2.size() == 2 && m2[0].isNumber() && m1.equals(m2[1], true)) { Number nr; if(!nr.setInterval(nr_one, m2[0].number())) return false; mstruct.set(nr, true); mstruct *= m1; return true; } return false; } IntervalFunction::IntervalFunction() : MathFunction("interval", 2) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false)); setArgumentDefinition(2, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false)); } int IntervalFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(create_interval(mstruct, vargs[0], vargs[1])) return 1; MathStructure marg1(vargs[0]); marg1.eval(eo); MathStructure marg2(vargs[1]); marg2.eval(eo); if(create_interval(mstruct, marg1, marg2)) return 1; return 0; } RadiansToDefaultAngleUnitFunction::RadiansToDefaultAngleUnitFunction() : MathFunction("radtodef", 1) { } int RadiansToDefaultAngleUnitFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct *= 180; mstruct /= CALCULATOR->v_pi; break; } case ANGLE_UNIT_GRADIANS: { mstruct *= 200; mstruct /= CALCULATOR->v_pi; break; } case ANGLE_UNIT_RADIANS: { break; } default: { if(CALCULATOR->getRadUnit()) { mstruct *= CALCULATOR->getRadUnit(); } } } return 1; } TotalFunction::TotalFunction() : MathFunction("total", 1) { setArgumentDefinition(1, new VectorArgument("")); } int TotalFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct.clear(); for(size_t index = 0; index < vargs[0].size(); index++) { if(CALCULATOR->aborted()) return 0; mstruct.calculateAdd(vargs[0][index], eo); } return 1; } PercentileFunction::PercentileFunction() : MathFunction("percentile", 2, 3) { setArgumentDefinition(1, new VectorArgument("")); NumberArgument *arg = new NumberArgument(); Number fr; arg->setMin(&fr); fr.set(100, 1, 0); arg->setMax(&fr); arg->setIncludeEqualsMin(true); arg->setIncludeEqualsMax(true); setArgumentDefinition(2, arg); IntegerArgument *iarg = new IntegerArgument(); fr.set(1, 1, 0); iarg->setMin(&fr); fr.set(9, 1, 0); iarg->setMax(&fr); setArgumentDefinition(3, iarg); setDefaultValue(3, "8"); } int PercentileFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { MathStructure v(vargs[0]); if(v.size() == 0) {mstruct.clear(); return 1;} MathStructure *mp; Number fr100(100, 1, 0); int i_variant = vargs[2].number().intValue(); if(!v.sortVector()) { return 0; } else { Number pfr(vargs[1].number()); if(pfr == fr100) { // Max value mstruct = v[v.size() - 1]; return 1; } else if(pfr.isZero()) { // Min value mstruct = v[0]; return 1; } pfr /= 100; if(pfr == nr_half) { // Median if(v.size() % 2 == 1) { mstruct = v[v.size() / 2]; } else { mstruct = v[v.size() / 2 - 1]; mstruct += v[v.size() / 2]; mstruct *= nr_half; } return 1; } // Method numbers as in R switch(i_variant) { case 2: { Number ufr(pfr); ufr *= (long int) v.countChildren(); if(ufr.isInteger()) { pfr = ufr; ufr++; mstruct = v[pfr.uintValue() - 1]; if(ufr.uintValue() > v.size()) return 1; mstruct += v[ufr.uintValue() - 1]; mstruct *= nr_half; return 1; } } case 1: { pfr *= (long int) v.countChildren(); pfr.ceil(); size_t index = pfr.uintValue(); if(index > v.size()) index = v.size(); if(index == 0) index = 1; mstruct = v[index - 1]; return 1; } case 3: { pfr *= (long int) v.countChildren(); pfr.round(); size_t index = pfr.uintValue(); if(index > v.size()) index = v.size(); if(index == 0) index = 1; mstruct = v[index - 1]; return 1; } case 4: {pfr *= (long int) v.countChildren(); break;} case 5: {pfr *= (long int) v.countChildren(); pfr += nr_half; break;} case 6: {pfr *= (long int) v.countChildren() + 1; break;} case 7: {pfr *= (long int) v.countChildren() - 1; pfr += 1; break;} case 9: {pfr *= Number(v.countChildren() * 4 + 1, 4); pfr += Number(3, 8); break;} case 8: {} default: {pfr *= Number(v.countChildren() * 3 + 1, 3); pfr += Number(1, 3); break;} } Number ufr(pfr); ufr.ceil(); Number lfr(pfr); lfr.floor(); pfr -= lfr; size_t u_index = ufr.uintValue(); size_t l_index = lfr.uintValue(); if(u_index > v.size()) { mstruct = v[v.size() - 1]; return 1; } if(l_index == 0) { mstruct = v[0]; return 1; } mp = v.getChild(u_index); if(!mp) return 0; MathStructure gap(*mp); mp = v.getChild(l_index); if(!mp) return 0; gap -= *mp; gap *= pfr; mp = v.getChild(l_index); if(!mp) return 0; mstruct = *mp; mstruct += gap; } return 1; } MinFunction::MinFunction() : MathFunction("min", 1) { setArgumentDefinition(1, new VectorArgument("")); } int MinFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { ComparisonResult cmp; const MathStructure *min = NULL; vector unsolveds; bool b = false; for(size_t index = 0; index < vargs[0].size(); index++) { if(min == NULL) { min = &vargs[0][index]; } else { cmp = min->compare(vargs[0][index]); if(cmp == COMPARISON_RESULT_LESS) { min = &vargs[0][index]; b = true; } else if(COMPARISON_NOT_FULLY_KNOWN(cmp)) { if(CALCULATOR->showArgumentErrors()) { CALCULATOR->error(true, _("Unsolvable comparison in %s()."), name().c_str(), NULL); } unsolveds.push_back(&vargs[0][index]); } else { b = true; } } } if(min) { if(unsolveds.size() > 0) { if(!b) return 0; MathStructure margs; margs.clearVector(); margs.addChild(*min); for(size_t i = 0; i < unsolveds.size(); i++) { margs.addChild(*unsolveds[i]); } mstruct.set(this, &margs, NULL); return 1; } else { mstruct = *min; return 1; } } return 0; } MaxFunction::MaxFunction() : MathFunction("max", 1) { setArgumentDefinition(1, new VectorArgument("")); } int MaxFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { ComparisonResult cmp; const MathStructure *max = NULL; vector unsolveds; bool b = false; for(size_t index = 0; index < vargs[0].size(); index++) { if(max == NULL) { max = &vargs[0][index]; } else { cmp = max->compare(vargs[0][index]); if(cmp == COMPARISON_RESULT_GREATER) { max = &vargs[0][index]; b = true; } else if(COMPARISON_NOT_FULLY_KNOWN(cmp)) { if(CALCULATOR->showArgumentErrors()) { CALCULATOR->error(true, _("Unsolvable comparison in %s()."), name().c_str(), NULL); } unsolveds.push_back(&vargs[0][index]); } else { b = true; } } } if(max) { if(unsolveds.size() > 0) { if(!b) return 0; MathStructure margs; margs.clearVector(); margs.addChild(*max); for(size_t i = 0; i < unsolveds.size(); i++) { margs.addChild(*unsolveds[i]); } mstruct.set(this, &margs, NULL); return 1; } else { mstruct = *max; return 1; } } return 0; } ModeFunction::ModeFunction() : MathFunction("mode", 1) { setArgumentDefinition(1, new VectorArgument("")); } int ModeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].size() <= 0) { return 0; } size_t n = 0; bool b; vector vargs_nodup; vector is; const MathStructure *value = NULL; for(size_t index_c = 0; index_c < vargs[0].size(); index_c++) { b = true; for(size_t index = 0; index < vargs_nodup.size(); index++) { if(vargs_nodup[index]->equals(vargs[0][index_c])) { is[index]++; b = false; break; } } if(b) { vargs_nodup.push_back(&vargs[0][index_c]); is.push_back(1); } } for(size_t index = 0; index < is.size(); index++) { if(is[index] > n) { n = is[index]; value = vargs_nodup[index]; } } if(value) { mstruct = *value; return 1; } return 0; } RandFunction::RandFunction() : MathFunction("rand", 0, 1) { setArgumentDefinition(1, new IntegerArgument()); setDefaultValue(1, "0"); } int RandFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { Number nr; if(vargs[0].number().isZero() || vargs[0].number().isNegative()) { nr.rand(); } else { nr.intRand(vargs[0].number()); nr++; } mstruct = nr; return 1; } bool RandFunction::representsReal(const MathStructure&, bool) const {return true;} bool RandFunction::representsInteger(const MathStructure &vargs, bool) const {return vargs.size() > 0 && vargs[0].isNumber() && vargs[0].number().isPositive();} bool RandFunction::representsNonNegative(const MathStructure&, bool) const {return true;} int calender_to_id(const string &str) { if(str == "1" || equalsIgnoreCase(str, "gregorian") || equalsIgnoreCase(str, _("gregorian"))) return CALENDAR_GREGORIAN; if(str == "8" || equalsIgnoreCase(str, "milankovic") || equalsIgnoreCase(str, "milanković") || equalsIgnoreCase(str, _("milankovic"))) return CALENDAR_MILANKOVIC; if(str == "7" || equalsIgnoreCase(str, "julian") || equalsIgnoreCase(str, _("julian"))) return CALENDAR_JULIAN; if(str == "3" || equalsIgnoreCase(str, "islamic") || equalsIgnoreCase(str, _("islamic"))) return CALENDAR_ISLAMIC; if(str == "2" || equalsIgnoreCase(str, "hebrew") || equalsIgnoreCase(str, _("hebrew"))) return CALENDAR_HEBREW; if(str == "11" || equalsIgnoreCase(str, "egyptian") || equalsIgnoreCase(str, _("egyptian"))) return CALENDAR_EGYPTIAN; if(str == "4" || equalsIgnoreCase(str, "persian") || equalsIgnoreCase(str, _("persian"))) return CALENDAR_PERSIAN; if(str == "9" || equalsIgnoreCase(str, "coptic") || equalsIgnoreCase(str, _("coptic"))) return CALENDAR_COPTIC; if(str == "10" || equalsIgnoreCase(str, "ethiopian") || equalsIgnoreCase(str, _("ethiopian"))) return CALENDAR_ETHIOPIAN; if(str == "5" || equalsIgnoreCase(str, "indian") || equalsIgnoreCase(str, _("indian"))) return CALENDAR_INDIAN; if(str == "6" || equalsIgnoreCase(str, "chinese") || equalsIgnoreCase(str, _("chinese"))) return CALENDAR_CHINESE; return -1; } DateFunction::DateFunction() : MathFunction("date", 1, 4) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SLONG)); IntegerArgument *iarg = new IntegerArgument(); iarg->setHandleVector(false); Number fr(1, 1, 0); iarg->setMin(&fr); fr.set(24, 1, 0); iarg->setMax(&fr); setArgumentDefinition(2, iarg); setDefaultValue(2, "1"); iarg = new IntegerArgument(); iarg->setHandleVector(false); fr.set(1, 1, 0); iarg->setMin(&fr); fr.set(31, 1, 0); iarg->setMax(&fr); setDefaultValue(3, "1"); setArgumentDefinition(3, iarg); TextArgument *targ = new TextArgument(); setArgumentDefinition(4, targ); setDefaultValue(4, _("gregorian")); } int DateFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { int ct = calender_to_id(vargs[3].symbol()); if(ct < 0) { CALCULATOR->error(true, "Unrecognized calendar.", NULL); return 0; } QalculateDateTime dt; if(!calendarToDate(dt, vargs[0].number().lintValue(), vargs[1].number().lintValue(), vargs[2].number().lintValue(), (CalendarSystem) ct)) return 0; mstruct.set(dt); return 1; } DateTimeFunction::DateTimeFunction() : MathFunction("datetime", 1, 6) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SLONG)); IntegerArgument *iarg = new IntegerArgument(); iarg->setHandleVector(false); Number fr(1, 1, 0); iarg->setMin(&fr); fr.set(12, 1, 0); iarg->setMax(&fr); setArgumentDefinition(2, iarg); setDefaultValue(2, "1"); iarg = new IntegerArgument(); iarg->setHandleVector(false); fr.set(1, 1, 0); iarg->setMin(&fr); fr.set(31, 1, 0); iarg->setMax(&fr); setDefaultValue(3, "1"); setArgumentDefinition(3, iarg); iarg = new IntegerArgument(); iarg->setHandleVector(false); iarg->setMin(&nr_zero); fr.set(23, 1, 0); iarg->setMax(&fr); setArgumentDefinition(4, iarg); setDefaultValue(4, "0"); iarg = new IntegerArgument(); iarg->setHandleVector(false); iarg->setMin(&nr_zero); fr.set(59, 1, 0); iarg->setMax(&fr); setArgumentDefinition(5, iarg); setDefaultValue(5, "0"); NumberArgument *narg = new NumberArgument(); narg->setHandleVector(false); narg->setMin(&nr_zero); fr.set(61, 1, 0); narg->setMax(&fr); narg->setIncludeEqualsMax(false); setArgumentDefinition(6, narg); setDefaultValue(6, "0"); } int DateTimeFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime dt; if(!dt.set(vargs[0].number().lintValue(), vargs[1].number().lintValue(), vargs[2].number().lintValue())) return 0; if(!vargs[3].isZero() || !vargs[4].isZero() || !vargs[5].isZero()) { if(!dt.setTime(vargs[3].number().lintValue(), vargs[4].number().lintValue(), vargs[5].number())) return 0; } mstruct.set(dt); return 1; } TimeValueFunction::TimeValueFunction() : MathFunction("timevalue", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "now"); } int TimeValueFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { Number nr(vargs[0].datetime()->second()); nr /= 60; nr += vargs[0].datetime()->minute(); nr /= 60; nr += vargs[0].datetime()->hour(); mstruct.set(nr); return 1; } TimestampFunction::TimestampFunction() : MathFunction("timestamp", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "now"); } int TimestampFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime date(*vargs[0].datetime()); Number nr(date.timestamp()); if(nr.isInfinite()) return 0; mstruct.set(nr); return 1; } TimestampToDateFunction::TimestampToDateFunction() : MathFunction("stamptodate", 1) { //setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SLONG)); } int TimestampToDateFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.eval(eo); if((mstruct.isUnit() && mstruct.unit()->baseUnit() == CALCULATOR->u_second) || (mstruct.isMultiplication() && mstruct.size() >= 2 && mstruct.last().isUnit() && mstruct.last().unit()->baseUnit() == CALCULATOR->u_second)) { Unit *u = NULL; if(mstruct.isUnit()) { u = mstruct.unit(); mstruct.set(1, 1, 0, true); } else { u = mstruct.last().unit(); mstruct.delChild(mstruct.size(), true); } if(u != CALCULATOR->u_second) { u->convertToBaseUnit(mstruct); mstruct.eval(eo); } } if(!mstruct.isNumber() || !mstruct.number().isReal() || mstruct.number().isInterval()) return -1; QalculateDateTime date; if(!date.set(mstruct.number())) return -1; mstruct.set(date, true); return 1; } AddDaysFunction::AddDaysFunction() : MathFunction("addDays", 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new NumberArgument()); } int AddDaysFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; if(!mstruct.datetime()->addDays(vargs[1].number())) return 0; return 1; } AddMonthsFunction::AddMonthsFunction() : MathFunction("addMonths", 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new NumberArgument()); } int AddMonthsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; if(!mstruct.datetime()->addMonths(vargs[1].number())) return 0; return 1; } AddYearsFunction::AddYearsFunction() : MathFunction("addYears", 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new NumberArgument()); } int AddYearsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[0]; if(!mstruct.datetime()->addYears(vargs[1].number())) return 0; return 1; } DaysFunction::DaysFunction() : MathFunction("days", 2, 4) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new DateArgument()); IntegerArgument *arg = new IntegerArgument(); Number integ; arg->setMin(&integ); integ.set(4, 1, 0); arg->setMax(&integ); setArgumentDefinition(3, arg); setArgumentDefinition(4, new BooleanArgument()); setDefaultValue(3, "1"); } int DaysFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime date1(*vargs[0].datetime()), date2(*vargs[1].datetime()); Number days(date1.daysTo(date2, vargs[2].number().intValue(), vargs[3].number().isZero())); if(days.isInfinite()) return 0; days.abs(); mstruct.set(days); return 1; } YearFracFunction::YearFracFunction() : MathFunction("yearfrac", 2, 4) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new DateArgument()); IntegerArgument *arg = new IntegerArgument(); Number integ; arg->setMin(&integ); integ.set(4, 1, 0); arg->setMax(&integ); setArgumentDefinition(3, arg); setArgumentDefinition(4, new BooleanArgument()); setDefaultValue(3, "1"); } int YearFracFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime date1(*vargs[0].datetime()), date2(*vargs[1].datetime()); Number years(date1.yearsTo(date2, vargs[2].number().intValue(), vargs[3].number().isZero())); if(years.isInfinite()) return 0; years.abs(); mstruct.set(years); return 1; } WeekFunction::WeekFunction() : MathFunction("week", 0, 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new BooleanArgument()); setDefaultValue(1, "today"); } int WeekFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime date(*vargs[0].datetime()); int w = date.week(vargs[1].number().getBoolean()); if(w < 0) return 0; mstruct.set(w, 1, 0); return 1; } WeekdayFunction::WeekdayFunction() : MathFunction("weekday", 0, 2) { setArgumentDefinition(1, new DateArgument()); setArgumentDefinition(2, new BooleanArgument()); setDefaultValue(1, "today"); } int WeekdayFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime date(*vargs[0].datetime()); int w = date.weekday(); if(w < 0) return 0; if(vargs[1].number().getBoolean()) { if(w == 7) w = 1; else w++; } mstruct.set(w, 1, 0); return 1; } YeardayFunction::YeardayFunction() : MathFunction("yearday", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int YeardayFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime date(*vargs[0].datetime()); int yd = date.yearday(); if(yd < 0) return 0; mstruct.set(yd, 1, 0); return 1; } MonthFunction::MonthFunction() : MathFunction("month", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int MonthFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime date(*vargs[0].datetime()); mstruct.set(date.month(), 1L, 0L); return 1; } DayFunction::DayFunction() : MathFunction("day", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int DayFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime date(*vargs[0].datetime()); mstruct.set(date.day(), 1L, 0L); return 1; } YearFunction::YearFunction() : MathFunction("year", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "today"); } int YearFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { QalculateDateTime date(*vargs[0].datetime()); mstruct.set(date.year(), 1L, 0L); return 1; } TimeFunction::TimeFunction() : MathFunction("time", 0) { } int TimeFunction::calculate(MathStructure &mstruct, const MathStructure&, const EvaluationOptions&) { int hour, min, sec; now(hour, min, sec); Number tnr(sec, 1, 0); tnr /= 60; tnr += min; tnr /= 60; tnr += hour; mstruct = tnr; return 1; } LunarPhaseFunction::LunarPhaseFunction() : MathFunction("lunarphase", 0, 1) { setArgumentDefinition(1, new DateArgument()); setDefaultValue(1, "now"); } int LunarPhaseFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = lunarPhase(*vargs[0].datetime()); if(CALCULATOR->aborted()) return 0; return 1; } NextLunarPhaseFunction::NextLunarPhaseFunction() : MathFunction("nextlunarphase", 1, 2) { NumberArgument *arg = new NumberArgument(); Number fr; arg->setMin(&fr); fr.set(1, 1, 0); arg->setMax(&fr); arg->setIncludeEqualsMin(true); arg->setIncludeEqualsMax(false); arg->setHandleVector(true); setArgumentDefinition(1, arg); setArgumentDefinition(2, new DateArgument()); setDefaultValue(2, "now"); } int NextLunarPhaseFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = findNextLunarPhase(*vargs[1].datetime(), vargs[0].number()); if(CALCULATOR->aborted()) return 0; return 1; } BinFunction::BinFunction() : MathFunction("bin", 1, 2) { setArgumentDefinition(1, new TextArgument()); setArgumentDefinition(2, new BooleanArgument()); setDefaultValue(2, "0"); } int BinFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { ParseOptions po = eo.parse_options; po.base = BASE_BINARY; po.twos_complement = vargs[1].number().getBoolean(); CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } OctFunction::OctFunction() : MathFunction("oct", 1) { setArgumentDefinition(1, new TextArgument()); } int OctFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { ParseOptions po = eo.parse_options; po.base = BASE_OCTAL; CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } HexFunction::HexFunction() : MathFunction("hex", 1) { setArgumentDefinition(1, new TextArgument()); } int HexFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { ParseOptions po = eo.parse_options; po.base = BASE_HEXADECIMAL; CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } BaseFunction::BaseFunction() : MathFunction("base", 2) { setArgumentDefinition(1, new TextArgument()); IntegerArgument *arg = new IntegerArgument(); Number integ(2, 1, 0); arg->setMin(&integ); integ.set(36, 1, 0); arg->setMax(&integ); setArgumentDefinition(2, arg); } int BaseFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { ParseOptions po = eo.parse_options; po.base = vargs[1].number().intValue(); CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } RomanFunction::RomanFunction() : MathFunction("roman", 1) { setArgumentDefinition(1, new TextArgument()); } int RomanFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].symbol().find_first_not_of("0123456789.:" SIGNS) == string::npos && vargs[0].symbol().find_first_not_of("0" SIGNS) != string::npos) { CALCULATOR->parse(&mstruct, vargs[0].symbol(), eo.parse_options); PrintOptions po; po.base = BASE_ROMAN_NUMERALS; mstruct.eval(eo); mstruct.set(mstruct.print(po), true, true); return 1; } ParseOptions po = eo.parse_options; po.base = BASE_ROMAN_NUMERALS; CALCULATOR->parse(&mstruct, vargs[0].symbol(), po); return 1; } AsciiFunction::AsciiFunction() : MathFunction("code", 1) { TextArgument *arg = new TextArgument(); arg->setCustomCondition("len(\\x) = 1"); setArgumentDefinition(1, arg); } int AsciiFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { unsigned char c = (unsigned char) vargs[0].symbol()[0]; mstruct.set(c, 1, 0); return 1; } CharFunction::CharFunction() : MathFunction("char", 1) { IntegerArgument *arg = new IntegerArgument(); Number fr(32, 1, 0); arg->setMin(&fr); fr.set(0x7f, 1, 0); arg->setMax(&fr); setArgumentDefinition(1, arg); } int CharFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string str; str += vargs[0].number().intValue(); mstruct = str; return 1; } ConcatenateFunction::ConcatenateFunction() : MathFunction("concatenate", 1, -1) { setArgumentDefinition(1, new TextArgument()); setArgumentDefinition(2, new TextArgument()); } int ConcatenateFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string str; for(size_t i = 0; i < vargs.size(); i++) { str += vargs[i].symbol(); } mstruct = str; return 1; } LengthFunction::LengthFunction() : MathFunction("len", 1) { setArgumentDefinition(1, new TextArgument()); } int LengthFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = (int) vargs[0].symbol().length(); return 1; } extern bool replace_intervals_f(MathStructure &mstruct); extern bool create_interval(MathStructure &mstruct, const MathStructure &m1, const MathStructure &m2); extern bool replace_f_interval(MathStructure &mstruct, const EvaluationOptions &eo); ReplaceFunction::ReplaceFunction() : MathFunction("replace", 3, 4) { setArgumentDefinition(4, new BooleanArgument()); setDefaultValue(4, "0"); } int ReplaceFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; if(vargs[3].number().getBoolean() || mstruct.contains(vargs[1], true) <= 0) mstruct.eval(eo); if(vargs[2].containsInterval(true) || vargs[2].containsFunction(CALCULATOR->f_interval, true)) { MathStructure mv(vargs[2]); replace_f_interval(mv, eo); replace_intervals_f(mv); mstruct.replace(vargs[1], mv); } else { mstruct.replace(vargs[1], vargs[2]); } return 1; } StripUnitsFunction::StripUnitsFunction() : MathFunction("nounit", 1) {} int StripUnitsFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.eval(eo); mstruct.removeType(STRUCT_UNIT); return 1; } ErrorFunction::ErrorFunction() : MathFunction("error", 1) { setArgumentDefinition(1, new TextArgument()); } int ErrorFunction::calculate(MathStructure&, const MathStructure &vargs, const EvaluationOptions&) { CALCULATOR->error(true, vargs[0].symbol().c_str(), NULL); return 1; } WarningFunction::WarningFunction() : MathFunction("warning", 1) { setArgumentDefinition(1, new TextArgument()); } int WarningFunction::calculate(MathStructure&, const MathStructure &vargs, const EvaluationOptions&) { CALCULATOR->error(false, vargs[0].symbol().c_str(), NULL); return 1; } MessageFunction::MessageFunction() : MathFunction("message", 1) { setArgumentDefinition(1, new TextArgument()); } int MessageFunction::calculate(MathStructure&, const MathStructure &vargs, const EvaluationOptions&) { CALCULATOR->message(MESSAGE_INFORMATION, vargs[0].symbol().c_str(), NULL); return 1; } GenerateVectorFunction::GenerateVectorFunction() : MathFunction("genvector", 4, 6) { setArgumentDefinition(5, new SymbolicArgument()); setDefaultValue(5, "x"); setArgumentDefinition(6, new BooleanArgument()); setDefaultValue(6, "0"); } int GenerateVectorFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(CALCULATOR->aborted()) return 0; if(vargs[5].number().getBoolean()) { mstruct = vargs[0].generateVector(vargs[4], vargs[1], vargs[2], vargs[3], NULL, eo); } else { bool overflow = false; int steps = vargs[3].number().intValue(&overflow); if(!vargs[3].isNumber() || overflow || steps < 1) { CALCULATOR->error(true, _("The number of requested elements in generate vector function must be a positive integer."), NULL); return 0; } mstruct = vargs[0].generateVector(vargs[4], vargs[1], vargs[2], steps, NULL, eo); } if(CALCULATOR->aborted()) return 0; return 1; } ForFunction::ForFunction() : MathFunction("for", 7) { setArgumentDefinition(2, new SymbolicArgument()); setArgumentDefinition(7, new SymbolicArgument()); } int ForFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[4]; MathStructure mcounter = vargs[0]; MathStructure mtest; MathStructure mcount; MathStructure mupdate; while(true) { mtest = vargs[2]; mtest.replace(vargs[1], mcounter); mtest.eval(eo); if(!mtest.isNumber() || CALCULATOR->aborted()) return 0; if(!mtest.number().getBoolean()) { break; } mupdate = vargs[5]; mupdate.replace(vargs[1], mcounter, vargs[6], mstruct); mstruct = mupdate; mstruct.calculatesub(eo, eo, false); mcount = vargs[3]; mcount.replace(vargs[1], mcounter); mcounter = mcount; mcounter.calculatesub(eo, eo, false); } return 1; } SumFunction::SumFunction() : MathFunction("sum", 3, 4) { Argument *arg = new IntegerArgument(); arg->setHandleVector(false); setArgumentDefinition(2, arg); arg = new IntegerArgument(); arg->setHandleVector(false); setArgumentDefinition(3, arg); setArgumentDefinition(4, new SymbolicArgument()); setDefaultValue(4, "x"); setCondition("\\z >= \\y"); } int SumFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { MathStructure m1(vargs[0]); EvaluationOptions eo2 = eo; eo2.calculate_functions = false; eo2.expand = false; Number i_nr(vargs[1].number()); if(eo2.approximation == APPROXIMATION_TRY_EXACT) { Number nr(vargs[2].number()); nr.subtract(i_nr); if(nr.isGreaterThan(100)) eo2.approximation = APPROXIMATION_APPROXIMATE; } CALCULATOR->beginTemporaryStopMessages(); m1.eval(eo2); int im = 0; if(CALCULATOR->endTemporaryStopMessages(NULL, &im) > 0 || im > 0) m1 = vargs[0]; eo2.calculate_functions = eo.calculate_functions; eo2.expand = eo.expand; mstruct.clear(); MathStructure mstruct_calc; bool started = false; while(i_nr.isLessThanOrEqualTo(vargs[2].number())) { if(CALCULATOR->aborted()) { if(!started) { return 0; } else if(i_nr != vargs[2].number()) { MathStructure mmin(i_nr); mstruct.add(MathStructure(this, &vargs[0], &mmin, &vargs[2], &vargs[3], NULL), true); return 1; } } mstruct_calc.set(m1); mstruct_calc.replace(vargs[3], i_nr); mstruct_calc.eval(eo2); if(started) { mstruct.calculateAdd(mstruct_calc, eo2); } else { mstruct = mstruct_calc; mstruct.calculatesub(eo2, eo2); started = true; } i_nr += 1; } return 1; } ProductFunction::ProductFunction() : MathFunction("product", 3, 4) { Argument *arg = new IntegerArgument(); arg->setHandleVector(false); setArgumentDefinition(2, arg); arg = new IntegerArgument(); arg->setHandleVector(false); setArgumentDefinition(3, arg); setArgumentDefinition(4, new SymbolicArgument()); setDefaultValue(4, "x"); setCondition("\\z >= \\y"); } int ProductFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { MathStructure m1(vargs[0]); EvaluationOptions eo2 = eo; eo2.calculate_functions = false; eo2.expand = false; Number i_nr(vargs[1].number()); if(eo2.approximation == APPROXIMATION_TRY_EXACT) { Number nr(vargs[2].number()); nr.subtract(i_nr); if(nr.isGreaterThan(100)) eo2.approximation = APPROXIMATION_APPROXIMATE; } CALCULATOR->beginTemporaryStopMessages(); m1.eval(eo2); int im = 0; if(CALCULATOR->endTemporaryStopMessages(NULL, &im) || im > 0) m1 = vargs[0]; eo2.calculate_functions = eo.calculate_functions; eo2.expand = eo.expand; mstruct.clear(); MathStructure mstruct_calc; bool started = false; while(i_nr.isLessThanOrEqualTo(vargs[2].number())) { if(CALCULATOR->aborted()) { if(!started) { return 0; } else if(i_nr != vargs[2].number()) { MathStructure mmin(i_nr); mstruct.multiply(MathStructure(this, &vargs[0], &mmin, &vargs[2], &vargs[3], NULL), true); return 1; } } mstruct_calc.set(m1); mstruct_calc.replace(vargs[3], i_nr); mstruct_calc.eval(eo2); if(started) { mstruct.calculateMultiply(mstruct_calc, eo2); } else { mstruct = mstruct_calc; mstruct.calculatesub(eo2, eo2); started = true; } i_nr += 1; } return 1; } bool process_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t index); bool process_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t index) { if(mprocess == vargs[1]) { mprocess = mstruct[index]; return true; } if(!vargs[3].isEmptySymbol() && mprocess == vargs[3]) { mprocess = (int) index + 1; return true; } if(!vargs[4].isEmptySymbol() && mprocess == vargs[4]) { mprocess = vargs[2]; return true; } bool b = false; for(size_t i = 0; i < mprocess.size(); i++) { if(process_replace(mprocess[i], mstruct, vargs, index)) { mprocess.childUpdated(i + 1); b = true; } } return b; } ProcessFunction::ProcessFunction() : MathFunction("process", 3, 5) { setArgumentDefinition(2, new SymbolicArgument()); setArgumentDefinition(3, new VectorArgument()); setArgumentDefinition(4, new SymbolicArgument()); setDefaultValue(4, "\"\""); setArgumentDefinition(5, new SymbolicArgument()); setDefaultValue(5, "\"\""); } int ProcessFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[2]; MathStructure mprocess; for(size_t index = 0; index < mstruct.size(); index++) { mprocess = vargs[0]; process_replace(mprocess, mstruct, vargs, index); mstruct[index] = mprocess; } return 1; } bool process_matrix_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t rindex, size_t cindex); bool process_matrix_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t rindex, size_t cindex) { if(mprocess == vargs[1]) { mprocess = mstruct[rindex][cindex]; return true; } if(!vargs[3].isEmptySymbol() && mprocess == vargs[3]) { mprocess = (int) rindex + 1; return true; } if(!vargs[4].isEmptySymbol() && mprocess == vargs[4]) { mprocess = (int) cindex + 1; return true; } if(!vargs[5].isEmptySymbol() && mprocess == vargs[5]) { mprocess = vargs[2]; return true; } bool b = false; for(size_t i = 0; i < mprocess.size(); i++) { if(process_matrix_replace(mprocess[i], mstruct, vargs, rindex, cindex)) { mprocess.childUpdated(i + 1); b = true; } } return b; } ProcessMatrixFunction::ProcessMatrixFunction() : MathFunction("processm", 3, 6) { setArgumentDefinition(2, new SymbolicArgument()); setArgumentDefinition(3, new MatrixArgument()); setArgumentDefinition(4, new SymbolicArgument()); setDefaultValue(4, "\"\""); setArgumentDefinition(5, new SymbolicArgument()); setDefaultValue(5, "\"\""); setArgumentDefinition(6, new SymbolicArgument()); setDefaultValue(6, "\"\""); } int ProcessMatrixFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { mstruct = vargs[2]; MathStructure mprocess; for(size_t rindex = 0; rindex < mstruct.size(); rindex++) { for(size_t cindex = 0; cindex < mstruct[rindex].size(); cindex++) { if(CALCULATOR->aborted()) return 0; mprocess = vargs[0]; process_matrix_replace(mprocess, mstruct, vargs, rindex, cindex); mstruct[rindex][cindex] = mprocess; } } return 1; } bool csum_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t index, const EvaluationOptions &eo2); bool csum_replace(MathStructure &mprocess, const MathStructure &mstruct, const MathStructure &vargs, size_t index, const EvaluationOptions &eo2) { if(mprocess == vargs[4]) { mprocess = vargs[6][index]; return true; } if(mprocess == vargs[5]) { mprocess = mstruct; return true; } if(!vargs[7].isEmptySymbol() && mprocess == vargs[7]) { mprocess = (int) index + 1; return true; } if(!vargs[8].isEmptySymbol()) { if(mprocess.isFunction() && mprocess.function() == CALCULATOR->f_component && mprocess.size() == 2 && mprocess[1] == vargs[8]) { bool b = csum_replace(mprocess[0], mstruct, vargs, index, eo2); mprocess[0].eval(eo2); if(mprocess[0].isNumber() && mprocess[0].number().isInteger() && mprocess[0].number().isPositive() && mprocess[0].number().isLessThanOrEqualTo(vargs[6].size())) { mprocess = vargs[6][mprocess[0].number().intValue() - 1]; return true; } return csum_replace(mprocess[1], mstruct, vargs, index, eo2) || b; } else if(mprocess == vargs[8]) { mprocess = vargs[6]; return true; } } bool b = false; for(size_t i = 0; i < mprocess.size(); i++) { if(csum_replace(mprocess[i], mstruct, vargs, index, eo2)) { mprocess.childUpdated(i + 1); b = true; } } return b; } CustomSumFunction::CustomSumFunction() : MathFunction("csum", 7, 9) { Argument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SINT); setArgumentDefinition(1, arg); //begin arg = new IntegerArgument("", ARGUMENT_MIN_MAX_NONE, true, true, INTEGER_TYPE_SINT); arg->setHandleVector(false); setArgumentDefinition(2, arg); //end //3. initial //4. function setArgumentDefinition(5, new SymbolicArgument()); //x var setArgumentDefinition(6, new SymbolicArgument()); //y var setArgumentDefinition(7, new VectorArgument()); setArgumentDefinition(8, new SymbolicArgument()); //i var setDefaultValue(8, "\"\""); setArgumentDefinition(9, new SymbolicArgument()); //v var setDefaultValue(9, "\"\""); } int CustomSumFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { int start = vargs[0].number().intValue(); if(start < 1) start = 1; int end = vargs[1].number().intValue(); int n = vargs[6].countChildren(); if(start > n) { CALCULATOR->error(true, _("Too few elements (%s) in vector (%s required)"), i2s(n).c_str(), i2s(start).c_str(), NULL); start = n; } if(end < 1 || end > n) { if(end > n) CALCULATOR->error(true, _("Too few elements (%s) in vector (%s required)"), i2s(n).c_str(), i2s(end).c_str(), NULL); end = n; } else if(end < start) { end = start; } mstruct = vargs[2]; MathStructure mexpr(vargs[3]); MathStructure mprocess; EvaluationOptions eo2 = eo; eo2.calculate_functions = false; mstruct.eval(eo2); for(size_t index = (size_t) start - 1; index < (size_t) end; index++) { if(CALCULATOR->aborted()) return 0; mprocess = mexpr; csum_replace(mprocess, mstruct, vargs, index, eo2); mprocess.eval(eo2); mstruct = mprocess; } return 1; } FunctionFunction::FunctionFunction() : MathFunction("function", 2) { setArgumentDefinition(1, new TextArgument()); setArgumentDefinition(2, new VectorArgument()); } int FunctionFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { UserFunction f = new UserFunction("", "Generated MathFunction", vargs[0].symbol()); MathStructure args = vargs[1]; mstruct = f.MathFunction::calculate(args, eo); if(mstruct.isFunction() && mstruct.function() == &f) mstruct.setUndefined(); return 1; } SelectFunction::SelectFunction() : MathFunction("select", 2, 4) { setArgumentDefinition(3, new SymbolicArgument()); setDefaultValue(3, "x"); setArgumentDefinition(4, new BooleanArgument()); setDefaultValue(4, "0"); } int SelectFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { MathStructure mtest; mstruct = vargs[0]; mstruct.eval(eo); if(!mstruct.isVector()) { mtest = vargs[1]; mtest.replace(vargs[2], mstruct); mtest.eval(eo); if(!mtest.isNumber() || mtest.number().getBoolean() < 0) { CALCULATOR->error(true, _("Comparison failed."), NULL); return -1; } if(mtest.number().getBoolean() == 0) { if(vargs[3].number().getBoolean() > 0) { CALCULATOR->error(true, _("No matching item found."), NULL); return -1; } mstruct.clearVector(); } return 1; } for(size_t i = 0; i < mstruct.size();) { mtest = vargs[1]; mtest.replace(vargs[2], mstruct[i]); mtest.eval(eo); if(!mtest.isNumber() || mtest.number().getBoolean() < 0) { CALCULATOR->error(true, _("Comparison failed."), NULL); return -1; } if(mtest.number().getBoolean() == 0) { if(vargs[3].number().getBoolean() == 0) { mstruct.delChild(i + 1); } else { i++; } } else if(vargs[3].number().getBoolean() > 0) { MathStructure msave(mstruct[i]); mstruct = msave; return 1; } else { i++; } } if(vargs[3].number().getBoolean() > 0) { CALCULATOR->error(true, _("No matching item found."), NULL); return -1; } return 1; } IFFunction::IFFunction() : MathFunction("if", 3) {} int IFFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isNumber()) { int result = vargs[0].number().getBoolean(); if(result) { mstruct = vargs[1]; } else if(result == 0) { mstruct = vargs[2]; } else { return 0; } return 1; } mstruct = vargs[0]; mstruct.eval(eo); if(mstruct.isNumber()) { int result = mstruct.number().getBoolean(); if(result) { mstruct = vargs[1]; } else if(result == 0) { mstruct = vargs[2]; } else { return -1; } return 1; } return -1; } IsNumberFunction::IsNumberFunction() : MathFunction("isNumber", 1) { } int IsNumberFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; if(!mstruct.isNumber()) mstruct.eval(eo); if(mstruct.isNumber()) { mstruct.number().setTrue(); } else { mstruct.clear(); mstruct.number().setFalse(); } return 1; } IS_NUMBER_FUNCTION(IsIntegerFunction, isInteger) IS_NUMBER_FUNCTION(IsRealFunction, isReal) IS_NUMBER_FUNCTION(IsRationalFunction, isRational) REPRESENTS_FUNCTION(RepresentsIntegerFunction, representsInteger) REPRESENTS_FUNCTION(RepresentsRealFunction, representsReal) REPRESENTS_FUNCTION(RepresentsRationalFunction, representsRational) REPRESENTS_FUNCTION(RepresentsNumberFunction, representsNumber) LoadFunction::LoadFunction() : MathFunction("load", 1, 3) { setArgumentDefinition(1, new FileArgument()); Argument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SINT); arg->setHandleVector(false); setArgumentDefinition(2, arg); setDefaultValue(2, "1"); setArgumentDefinition(3, new TextArgument()); setDefaultValue(3, ","); } int LoadFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { string delim = vargs[2].symbol(); if(delim == "tab") { delim = "\t"; } if(!CALCULATOR->importCSV(mstruct, vargs[0].symbol().c_str(), vargs[1].number().intValue(), delim)) { CALCULATOR->error(true, "Failed to load %s.", vargs[0].symbol().c_str(), NULL); return 0; } return 1; } ExportFunction::ExportFunction() : MathFunction("export", 2, 3) { setArgumentDefinition(1, new VectorArgument()); setArgumentDefinition(2, new FileArgument()); setArgumentDefinition(3, new TextArgument()); setDefaultValue(3, ","); } int ExportFunction::calculate(MathStructure&, const MathStructure &vargs, const EvaluationOptions&) { string delim = vargs[2].symbol(); if(delim == "tab") { delim = "\t"; } if(!CALCULATOR->exportCSV(vargs[0], vargs[1].symbol().c_str(), delim)) { CALCULATOR->error(true, "Failed to export to %s.", vargs[1].symbol().c_str(), NULL); return 0; } return 1; } TitleFunction::TitleFunction() : MathFunction("title", 1) { setArgumentDefinition(1, new ExpressionItemArgument()); } int TitleFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { ExpressionItem *item = CALCULATOR->getExpressionItem(vargs[0].symbol()); if(!item) { CALCULATOR->error(true, _("Object %s does not exist."), vargs[0].symbol().c_str(), NULL); return 0; } else { mstruct = item->title(); } return 1; } SaveFunction::SaveFunction() : MathFunction("save", 2, 4) { setArgumentDefinition(2, new TextArgument()); setArgumentDefinition(3, new TextArgument()); setArgumentDefinition(4, new TextArgument()); setDefaultValue(3, CALCULATOR->temporaryCategory()); setDefaultValue(4, ""); } int SaveFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct = vargs[0]; mstruct.eval(eo); if(!CALCULATOR->variableNameIsValid(vargs[1].symbol())) { CALCULATOR->error(true, _("Invalid variable name (%s)."), vargs[1].symbol().c_str(), NULL); return -1; } if(CALCULATOR->variableNameTaken(vargs[1].symbol())) { Variable *v = CALCULATOR->getActiveVariable(vargs[1].symbol()); if(v && v->isLocal() && v->isKnown()) { if(!vargs[2].symbol().empty()) v->setCategory(vargs[2].symbol()); if(!vargs[3].symbol().empty()) v->setTitle(vargs[3].symbol()); ((KnownVariable*) v)->set(mstruct); if(v->countNames() == 0) { ExpressionName ename(vargs[1].symbol()); ename.reference = true; v->setName(ename, 1); } else { v->setName(vargs[1].symbol(), 1); } } else { CALCULATOR->error(false, _("A global unit or variable was deactivated. It will be restored after the new variable has been removed."), NULL); CALCULATOR->addVariable(new KnownVariable(vargs[2].symbol(), vargs[1].symbol(), mstruct, vargs[3].symbol())); } } else { CALCULATOR->addVariable(new KnownVariable(vargs[2].symbol(), vargs[1].symbol(), mstruct, vargs[3].symbol())); } CALCULATOR->saveFunctionCalled(); return 1; } RegisterFunction::RegisterFunction() : MathFunction("register", 1) { setArgumentDefinition(1, new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SIZE)); } int RegisterFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { if(vargs[0].number().isGreaterThan(CALCULATOR->RPNStackSize())) { CALCULATOR->error(false, _("Register %s does not exist. Returning zero."), format_and_print(vargs[0]).c_str(), NULL); mstruct.clear(); return 1; } mstruct.set(*CALCULATOR->getRPNRegister((size_t) vargs[0].number().uintValue())); return 1; } StackFunction::StackFunction() : MathFunction("stack", 0) { } int StackFunction::calculate(MathStructure &mstruct, const MathStructure&, const EvaluationOptions&) { mstruct.clearVector(); for(size_t i = 1; i <= CALCULATOR->RPNStackSize(); i++) { mstruct.addChild(*CALCULATOR->getRPNRegister(i)); } return 1; } DeriveFunction::DeriveFunction() : MathFunction("diff", 1, 3) { setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); Argument *arg = new IntegerArgument("", ARGUMENT_MIN_MAX_POSITIVE, true, true, INTEGER_TYPE_SINT); arg->setHandleVector(false); setArgumentDefinition(3, arg); setDefaultValue(3, "1"); } int DeriveFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { int i = vargs[2].number().intValue(); mstruct = vargs[0]; bool b = false; while(i) { if(i > 0) mstruct.eval(eo); if(CALCULATOR->aborted()) return 0; if(!mstruct.differentiate(vargs[1], eo) && !b) { return 0; } b = true; i--; } return 1; } liFunction::liFunction() : MathFunction("li", 1) { names[0].case_sensitive = true; setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } bool liFunction::representsReal(const MathStructure &vargs, bool) const { return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative() && ((vargs[0].isNumber() && !vargs[0].number().isOne()) || (vargs[0].isVariable() && vargs[0].variable()->isKnown() && ((KnownVariable*) vargs[0].variable())->get().isNumber() && !((KnownVariable*) vargs[0].variable())->get().number().isOne())); } bool liFunction::representsNonComplex(const MathStructure &vargs, bool) const { return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonNegative(); } bool liFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber() && ((vargs[0].isNumber() && !vargs[0].number().isOne()) || (vargs[0].isVariable() && vargs[0].variable()->isKnown() && ((KnownVariable*) vargs[0].variable())->get().isNumber() && !((KnownVariable*) vargs[0].variable())->get().number().isOne()));} int liFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(logint) } LiFunction::LiFunction() : MathFunction("Li", 2) { names[0].case_sensitive = true; setArgumentDefinition(1, new IntegerArgument()); Argument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false); arg->setHandleVector(true); setArgumentDefinition(2, arg); } bool LiFunction::representsReal(const MathStructure &vargs, bool) const { return vargs.size() == 2 && vargs[0].representsInteger() && vargs[1].representsReal() && (vargs[1].representsNonPositive() || vargs[1].representsNonPositive() || ((vargs[1].isNumber() && vargs[1].number().isLessThanOrEqualTo(1)) || (vargs[1].isVariable() && vargs[1].variable()->isKnown() && ((KnownVariable*) vargs[1].variable())->get().isNumber() && ((KnownVariable*) vargs[1].variable())->get().number().isLessThanOrEqualTo(1)))) && ((vargs[0].representsPositive() || ((vargs[1].isNumber() && !vargs[1].number().isOne()) || (vargs[1].isVariable() && vargs[1].variable()->isKnown() && ((KnownVariable*) vargs[1].variable())->get().isNumber() && !((KnownVariable*) vargs[1].variable())->get().number().isOne())))); } bool LiFunction::representsNonComplex(const MathStructure &vargs, bool) const { return vargs.size() == 2 && vargs[0].representsInteger() && vargs[1].representsNonComplex() && (vargs[1].representsNonPositive() || vargs[1].representsNonPositive() || ((vargs[1].isNumber() && vargs[1].number().isLessThanOrEqualTo(1)) || (vargs[1].isVariable() && vargs[1].variable()->isKnown() && ((KnownVariable*) vargs[1].variable())->get().isNumber() && ((KnownVariable*) vargs[1].variable())->get().number().isLessThanOrEqualTo(1)))); } bool LiFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 2 && vargs[0].representsInteger() && (vargs[0].representsPositive() || (vargs[1].representsNumber() && ((vargs[1].isNumber() && !vargs[1].number().isOne()) || (vargs[1].isVariable() && vargs[1].variable()->isKnown() && ((KnownVariable*) vargs[1].variable())->get().isNumber() && !((KnownVariable*) vargs[1].variable())->get().number().isOne()))));} int LiFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[1].isVector()) return 0; if(vargs[0].isOne()) { mstruct.set(1, 1, 0); mstruct -= vargs[1]; mstruct.transform(CALCULATOR->f_ln); mstruct.negate(); return true; } else if(vargs[0].isZero()) { mstruct.set(1, 1, 0); mstruct -= vargs[1]; mstruct.inverse(); mstruct *= vargs[1]; return true; } else if(vargs[0].isMinusOne()) { mstruct.set(1, 1, 0); mstruct -= vargs[1]; mstruct.raise(Number(-2, 1)); mstruct *= vargs[1]; return true; } mstruct = vargs[1]; mstruct.eval(eo); if(mstruct.isVector()) return -2; if(vargs[0].number().isPositive() && mstruct.isOne()) { mstruct = vargs[0]; mstruct.transform(CALCULATOR->f_zeta); return true; } if(mstruct.isNumber()) { Number nr(mstruct.number()); if(nr.polylog(vargs[0].number()) && (eo.approximation != APPROXIMATION_EXACT || !nr.isApproximate() || vargs[0].isApproximate() || mstruct.isApproximate()) && (eo.allow_complex || !nr.isComplex() || vargs[0].number().isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || vargs[0].number().includesInfinity() || mstruct.number().includesInfinity())) { mstruct.set(nr); return 1; } } return -2; } EiFunction::EiFunction() : MathFunction("Ei", 1) { names[0].case_sensitive = true; setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, true, false)); } bool EiFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal() && vargs[0].representsNonZero();} bool EiFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex();} bool EiFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber() && vargs[0].representsNonZero();} int EiFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(expint) } SiFunction::SiFunction() : MathFunction("Si", 1) { names[0].case_sensitive = true; Argument *arg = new AngleArgument(); arg->setHandleVector(true); setArgumentDefinition(1, arg); } bool SiFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_number_angle_value(vargs[0]);} bool SiFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_real_angle_value(vargs[0]);} bool SiFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex(true);} int SiFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } mstruct.eval(eo); if(mstruct.isNumber()) { Number nr(mstruct.number()); if(nr.sinint() && (eo.approximation != APPROXIMATION_EXACT || !nr.isApproximate() || mstruct.isApproximate()) && (eo.allow_complex || !nr.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || mstruct.number().includesInfinity())) { mstruct.set(nr); return 1; } } if(CALCULATOR->getRadUnit()) { if(mstruct.isVector()) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i] *= CALCULATOR->getRadUnit(); } } else { mstruct *= CALCULATOR->getRadUnit(); } } return -1; } CiFunction::CiFunction() : MathFunction("Ci", 1) { names[0].case_sensitive = true; Argument *arg = new AngleArgument(); arg->setHandleVector(true); setArgumentDefinition(1, arg); } bool CiFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_real_angle_value(vargs[0]);} bool CiFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && is_number_angle_value(vargs[0]);} bool CiFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex(true);} int CiFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[0].isVector()) return 0; mstruct = vargs[0]; if(CALCULATOR->getRadUnit()) { mstruct.convert(CALCULATOR->getRadUnit()); mstruct /= CALCULATOR->getRadUnit(); } mstruct.eval(eo); if(mstruct.isNumber()) { Number nr(mstruct.number()); if(nr.cosint() && (eo.approximation != APPROXIMATION_EXACT || !nr.isApproximate() || mstruct.isApproximate()) && (eo.allow_complex || !nr.isComplex() || mstruct.number().isComplex()) && (eo.allow_infinite || !nr.includesInfinity() || mstruct.number().includesInfinity())) { mstruct.set(nr); return 1; } } if(CALCULATOR->getRadUnit()) { if(mstruct.isVector()) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i] *= CALCULATOR->getRadUnit(); } } else { mstruct *= CALCULATOR->getRadUnit(); } } return -1; } ShiFunction::ShiFunction() : MathFunction("Shi", 1) { names[0].case_sensitive = true; setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, true, false)); } bool ShiFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ShiFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} bool ShiFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex();} int ShiFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(sinhint) } ChiFunction::ChiFunction() : MathFunction("Chi", 1) { names[0].case_sensitive = true; setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONZERO, true, false)); } bool ChiFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsReal();} bool ChiFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNonComplex();} bool ChiFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 1 && vargs[0].representsNumber();} int ChiFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION(coshint) } IGammaFunction::IGammaFunction() : MathFunction("igamma", 2) { setArgumentDefinition(1, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); setArgumentDefinition(2, new NumberArgument("", ARGUMENT_MIN_MAX_NONE, true, false)); } bool IGammaFunction::representsReal(const MathStructure &vargs, bool) const {return vargs.size() == 2 && (vargs[1].representsPositive() || (vargs[0].representsInteger() && vargs[0].representsPositive()));} bool IGammaFunction::representsNonComplex(const MathStructure &vargs, bool) const {return vargs.size() == 2 && (vargs[1].representsNonNegative() || (vargs[0].representsInteger() && vargs[0].representsNonNegative()));} bool IGammaFunction::representsNumber(const MathStructure &vargs, bool) const {return vargs.size() == 2 && (vargs[1].representsNonZero() || vargs[0].representsPositive());} int IGammaFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { FR_FUNCTION_2(igamma) } IntegrateFunction::IntegrateFunction() : MathFunction("integrate", 1, 4) { setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); setDefaultValue(3, "undefined"); setDefaultValue(4, "undefined"); } bool numerical_integration(MathStructure &mstruct, const MathStructure &x_var, const EvaluationOptions &eo2, const Number &nr_begin, const Number &nr_end, int i_samples) { Number nr_step(nr_end); nr_step -= nr_begin; nr_step /= i_samples; if(i_samples > 10) nr_step.setToFloatingPoint(); MathStructure m_a = mstruct; m_a.replace(x_var, nr_begin); m_a.eval(eo2); MathStructure mvalue(m_a); m_a = mstruct; m_a.replace(x_var, nr_end); m_a.eval(eo2); mvalue.calculateAdd(m_a, eo2); for(int i = 1; i < i_samples; i++) { if(CALCULATOR->aborted()) { return false; } Number nr(nr_step); nr *= i; nr += nr_begin; MathStructure m_a(mstruct); m_a.replace(x_var, nr); if(i % 2 == 0) m_a *= Number(2, 1); else m_a *= Number(4, 1); m_a.eval(eo2); mvalue.calculateAdd(m_a, eo2); } Number nr_mul(nr_step); nr_mul /= 3; mvalue.calculateMultiply(nr_mul, eo2); mstruct = mvalue; return true; } bool contains_complex(const MathStructure &mstruct) { if(mstruct.isNumber()) return mstruct.number().isComplex(); if(mstruct.isVariable() && mstruct.variable()->isKnown()) return contains_complex(((KnownVariable*) mstruct.variable())->get()); for(size_t i = 0; i < mstruct.size(); i++) { if(contains_complex(mstruct[i])) return true; } return false; } bool check_denominators(const MathStructure &m, const MathStructure &mi, const MathStructure &mx, const EvaluationOptions &eo) { if(m.contains(mx, false, true, true) == 0) return true; if(m.isPower()) { bool b_neg = m[1].representsNegative(); if(!m[1].representsNonNegative()) { if(!m[0].representsNonZero()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->beginTemporaryStopMessages(); KnownVariable *v = new KnownVariable("", "", mi); v->ref(); MathStructure mpow(m[1]); mpow.replace(mx, v, true); mpow.eval(eo2); b_neg = mpow.representsNegative(); CALCULATOR->endTemporaryStopMessages(); v->destroy(); } } if(b_neg && !m[0].representsNonZero()) { if(m[0].isZero()) return false; EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->beginTemporaryStopMessages(); MathStructure mbase(m[0]); KnownVariable *v = new KnownVariable("", "", mi); v->ref(); mbase.replace(mx, v, true); bool b_multiple = mbase.contains(mx, true) > 0; if(b_multiple) mbase.replace(mx, v); mbase.eval(eo2); CALCULATOR->endTemporaryStopMessages(); if(!b_multiple && mbase.isNumber()) { if(!mbase.number().isNonZero()) {v->destroy(); return false;} } else if(!mbase.isNumber() || !mbase.number().isNonZero()) { mbase = m[0]; eo2.isolate_x = true; eo2.isolate_var = &mx; eo2.test_comparisons = true; mbase.transform(COMPARISON_NOT_EQUALS, m_zero); mbase.eval(eo2); eo2.isolate_x = false; eo2.isolate_var = NULL; if(!mbase.isOne()) { if(mbase.isZero()) {v->destroy(); return false;} bool b = false; if(mbase.isComparison() && mbase.comparisonType() == COMPARISON_NOT_EQUALS && (mbase[0] == mx || mbase[0].isFunction()) && mbase[1].isNumber() && mi.isNumber()) { ComparisonResult cr = COMPARISON_RESULT_UNKNOWN; if(mbase[0].isFunction()) { MathStructure mfunc(mbase[0]); mfunc.replace(mx, v); mfunc.eval(eo2); if(mfunc.isNumber()) cr = mbase[1].number().compare(mfunc.number()); } else { cr = mbase[1].number().compare(mi.number()); } b = COMPARISON_IS_NOT_EQUAL(cr); if(!b && cr != COMPARISON_RESULT_UNKNOWN) {v->destroy(); return false;} } else if(mbase.isLogicalAnd()) { for(size_t i = 0; i < mbase.size(); i++) { if(mbase[i].isComparison() && mbase[i].comparisonType() == COMPARISON_NOT_EQUALS && (mbase[i][0] == mx || mbase[i][0].isFunction()) && mbase[i][1].isNumber() && mi.isNumber()) { ComparisonResult cr = COMPARISON_RESULT_UNKNOWN; if(mbase[i][0].isFunction()) { MathStructure mfunc(mbase[i][0]); mfunc.replace(mx, v); mfunc.eval(eo2); if(mfunc.isNumber()) cr = mbase[i][1].number().compare(mfunc.number()); } else { cr = mbase[i][1].number().compare(mi.number()); } b = COMPARISON_IS_NOT_EQUAL(cr); if(!b && cr != COMPARISON_RESULT_UNKNOWN) {v->destroy(); return false;} } } } if(!b) { PrintOptions po; po.spell_out_logical_operators = true; mbase.format(po); CALCULATOR->endTemporaryStopMessages(); CALCULATOR->endTemporaryStopMessages(); CALCULATOR->error(false, _("To avoid division by zero, the following must be true: %s."), mbase.print(po).c_str(), NULL); CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->beginTemporaryStopMessages(); } } } v->destroy(); } } else if(m.isVariable()) { if(m.variable()->isKnown() && !check_denominators(((KnownVariable*) m.variable())->get(), mi, mx, eo)) return false; } else if(m.isFunction()) { EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; eo2.assume_denominators_nonzero = false; CALCULATOR->beginTemporaryStopMessages(); MathStructure mfunc(m); mfunc.replace(mx, mi); bool b = mfunc.calculateFunctions(eo2); CALCULATOR->endTemporaryStopMessages(); if(b && !check_denominators(mfunc, mi, mx, eo)) return false; } for(size_t i = 0; i < m.size(); i++) { if(!check_denominators(m[i], mi, mx, eo)) return false; } return true; } int IntegrateFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { CALCULATOR->beginTemporaryStopIntervalArithmetic(); MathStructure m1(vargs[2]), m2(vargs[3]); if(vargs[2].isUndefined() != vargs[3].isUndefined()) { if(vargs[2].isUndefined()) m1.set(nr_minus_inf); else m2.set(nr_plus_inf); } m1.eval(eo); m2.eval(eo); bool definite_integral = !vargs[2].isUndefined() && !vargs[3].isUndefined() && (!m1.isNumber() || !m1.number().isMinusInfinity()) && (!m2.isNumber() || !m2.number().isPlusInfinity()); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->beginTemporaryStopMessages(); EvaluationOptions eo2 = eo; if(eo.approximation == APPROXIMATION_TRY_EXACT) eo2.approximation = APPROXIMATION_EXACT; CALCULATOR->beginTemporaryStopMessages(); eo2.do_polynomial_division = true; MathStructure mstruct_pre = vargs[0]; MathStructure x_var = vargs[1]; if(!m1.isUndefined()) { MathStructure m_interval(CALCULATOR->f_interval, &m1, &m2, NULL); CALCULATOR->beginTemporaryStopMessages(); EvaluationOptions eo3 = eo; eo3.approximation = APPROXIMATION_APPROXIMATE; m_interval.calculateFunctions(eo3); CALCULATOR->endTemporaryStopMessages(); if(definite_integral && !check_denominators(mstruct_pre, m_interval, x_var, eo)) { CALCULATOR->endTemporaryStopMessages(); CALCULATOR->endTemporaryStopMessages(true); CALCULATOR->error(false, _("Unable to integrate the expression."), NULL); return false; } UnknownVariable *var = new UnknownVariable("", "x"); var->ref(); var->setInterval(m_interval); x_var.set(var); mstruct_pre.replace(vargs[1], x_var); var->destroy(); } mstruct = mstruct_pre; mstruct.eval(eo2); eo2.do_polynomial_division = eo.do_polynomial_division; MathStructure mbak(mstruct); int use_abs = -1; if(m1.isUndefined() && x_var.representsReal() && !contains_complex(mstruct)) { use_abs = 1; } int b = mstruct.integrate(x_var, eo2, true, use_abs, definite_integral); if(b < 0) { mstruct = mbak; mstruct.replace(x_var, vargs[1]); CALCULATOR->endTemporaryStopMessages(true); CALCULATOR->endTemporaryStopMessages(true); CALCULATOR->error(false, _("Unable to integrate the expression."), NULL); return -1; } if((eo.approximation == APPROXIMATION_TRY_EXACT || (eo.approximation == APPROXIMATION_APPROXIMATE && mstruct.isApproximate())) && (!b || mstruct.containsFunction(this, true) > 0)) { vector blocked_messages; CALCULATOR->endTemporaryStopMessages(false, &blocked_messages); CALCULATOR->beginTemporaryStopMessages(); MathStructure mbak_integ(mstruct); if(eo.approximation == APPROXIMATION_APPROXIMATE) eo2.approximation = APPROXIMATION_EXACT; else eo2.approximation = eo.approximation; eo2.do_polynomial_division = true; mstruct = mstruct_pre; mstruct.eval(eo2); eo2.do_polynomial_division = eo.do_polynomial_division; int b2 = mstruct.integrate(x_var, eo2, true, use_abs, definite_integral); if(b2 < 0) { mstruct = mbak; mstruct.replace(x_var, vargs[1]); CALCULATOR->endTemporaryStopMessages(true); CALCULATOR->endTemporaryStopMessages(true); CALCULATOR->error(false, _("Unable to integrate the expression."), NULL); return -1; } if(b2 && (!b || mstruct.containsFunction(this, true) <= 0)) { CALCULATOR->endTemporaryStopMessages(true); b = true; } else { CALCULATOR->endTemporaryStopMessages(false); if(b) { CALCULATOR->addMessages(&blocked_messages); mstruct = mbak_integ; } } } else { CALCULATOR->endTemporaryStopMessages(true); } eo2.approximation = eo.approximation; if(b) { if(!definite_integral) { if(!m1.isUndefined()) mstruct.replace(x_var, vargs[1]); CALCULATOR->endTemporaryStopMessages(true); mstruct += CALCULATOR->v_C; return 1; #if MPFR_VERSION_MAJOR < 4 } else if(mstruct.containsFunction(this, true) <= 0 && mstruct.containsFunction(CALCULATOR->f_igamma, true) <= 0 && mstruct.containsFunction(CALCULATOR->f_Si, true) <= 0 && mstruct.containsFunction(CALCULATOR->f_Ci, true) <= 0 && mstruct.containsFunction(CALCULATOR->f_Shi, true) <= 0 && mstruct.containsFunction(CALCULATOR->f_Chi, true) <= 0 && (mstruct.containsFunction(CALCULATOR->f_Si, true) <= 0 || m1.representsNonNegative())) { #else } else if(mstruct.containsFunction(this, true) <= 0 && mstruct.containsFunction(CALCULATOR->f_Si, true) <= 0 && mstruct.containsFunction(CALCULATOR->f_Ci, true) <= 0 && mstruct.containsFunction(CALCULATOR->f_Shi, true) <= 0 && mstruct.containsFunction(CALCULATOR->f_Chi, true) <= 0 && (mstruct.containsFunction(CALCULATOR->f_Si, true) <= 0 || m1.representsNonNegative())) { #endif CALCULATOR->endTemporaryStopMessages(true); MathStructure mstruct_lower(mstruct); mstruct_lower.replace(x_var, vargs[2]); mstruct.replace(x_var, vargs[3]); mstruct -= mstruct_lower; return 1; } else { mstruct = mbak; } } else { mstruct = mbak; if(!definite_integral) { CALCULATOR->endTemporaryStopMessages(true); CALCULATOR->error(false, _("Unable to integrate the expression."), NULL); return -1; } } CALCULATOR->endTemporaryStopMessages(); CALCULATOR->beginTemporaryStopIntervalArithmetic(); if(eo.approximation != APPROXIMATION_EXACT) eo2.approximation = APPROXIMATION_APPROXIMATE; if(mstruct.containsInterval() && eo.approximation == APPROXIMATION_EXACT) { CALCULATOR->error(false, _("Unable to integrate the expression exact."), NULL); mstruct.replace(x_var, vargs[1]); return -1; } mstruct = mstruct_pre; mstruct.eval(eo2); if(m1.isNumber() && m1.number().isReal() && m2.isNumber() && m2.number().isReal()) { Number nr_begin, nr_end; if(m1.number().isGreaterThan(m2.number())) { nr_begin = m2.number(); nr_end = m1.number(); } else { nr_begin = m1.number(); nr_end = m2.number(); } Number nr_range(nr_end); nr_range -= nr_begin; MathStructure merr(mstruct); bool b_unknown_precision = false; for(size_t i = 0; i < 4; i++) { if(merr.containsFunction(CALCULATOR->f_diff, true) > 0 || !merr.differentiate(x_var, eo2)) { b_unknown_precision = true; break; } merr.calculatesub(eo2, eo2, true); } if(!b_unknown_precision) b_unknown_precision = merr.containsFunction(CALCULATOR->f_diff, true) > 0; bool b_exact = merr.isZero(); Number nr_samples; if(b_exact) { if(numerical_integration(mstruct, x_var, eo2, nr_begin, nr_end, 10)) { CALCULATOR->endTemporaryStopIntervalArithmetic(); return 1; } } else if(eo.approximation == APPROXIMATION_EXACT) { CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->error(false, _("Unable to integrate the expression exact."), NULL); mstruct.replace(x_var, vargs[1]); return -1; } else { MathStructure mtr = mstruct; mtr.replace(x_var, nr_end); mtr.eval(eo2); MathStructure mtr2 = mstruct; mtr2.replace(x_var, nr_begin); mtr2.eval(eo2); if(!mtr2.isNumber() || !mtr2.number().isReal() || !mtr.isNumber() || !mtr2.number().isReal()) b_unknown_precision = true; if(!b_unknown_precision) { Number ntr; if(mtr2.number().isGreaterThan(mtr.number())) { ntr = mtr2.number(); ntr -= mtr.number(); } else { ntr = mtr.number(); ntr -= mtr2.number(); } Number nr_interval; nr_interval.setInterval(nr_begin, nr_end); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->beginTemporaryEnableIntervalArithmetic(); MathStructure m_interval(nr_interval); KnownVariable *v = new KnownVariable("", "v", m_interval); v->ref(); merr.replace(x_var, v); CALCULATOR->beginTemporaryStopMessages(); merr.eval(eo2); if(CALCULATOR->endTemporaryStopMessages() > 0) b_unknown_precision = true; CALCULATOR->endTemporaryEnableIntervalArithmetic(); CALCULATOR->beginTemporaryStopIntervalArithmetic(); if(!merr.isNumber() || !merr.number().isReal()) b_unknown_precision = true; v->destroy(); if(!b_unknown_precision) { nr_interval = merr.number(); Number nr1(nr_interval.upperEndPoint()); Number nr2(nr_interval.lowerEndPoint()); nr1.abs(); nr2.abs(); if(nr1.isGreaterThan(nr2)) nr_interval = nr1; else nr_interval = nr2; bool b_first = true; while(true) { if(CALCULATOR->aborted()) { mstruct.replace(x_var, vargs[1]); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->error(false, _("Unable to integrate the expression."), NULL); return -1; } Number prec_exp(1, 1, CALCULATOR->getPrecision() + 2); prec_exp /= ntr; nr_samples = nr_range; nr_samples ^= 5; nr_samples *= nr_interval; nr_samples /= 180; nr_samples *= prec_exp; nr_samples.root(4); nr_samples.ceil(); if(nr_samples.isOdd()) nr_samples++; bool b_limited_samples = nr_samples.isGreaterThan(b_first ? 1000 : 100000); if(b_limited_samples) { nr_samples = b_first ? 1000 : 100000; if(!b_first) { Number nr_prec(nr_range); nr_prec ^= 5; nr_prec /= 180; Number nr_samples_exp(nr_samples); nr_samples_exp ^= Number(4, 1); nr_prec /= nr_samples_exp; nr_prec *= nr_interval; Number nr_rel_prec(mstruct.number()); nr_rel_prec.abs(); nr_rel_prec /= nr_prec; nr_rel_prec.log(10); nr_rel_prec.floor(); if(!nr_rel_prec.isPositive()) { mstruct = mbak; break; } } } if(numerical_integration(mstruct, x_var, eo2, nr_begin, nr_end, nr_samples.intValue())) { if(!mstruct.isNumber() || !mstruct.number().isReal()) { CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->error(true, _("Definite integral was approximated with unknown precision."), NULL); mstruct.setApproximate(true, true); return 1; } Number nr_prec(nr_range); nr_prec ^= 5; nr_prec /= 180; Number nr_samples_exp(nr_samples); nr_samples_exp ^= Number(4, 1); nr_prec /= nr_samples_exp; nr_prec *= nr_interval; Number nr_rel_prec(mstruct.number()); nr_rel_prec.abs(); nr_rel_prec /= nr_prec; nr_rel_prec.log(10); nr_rel_prec.floor(); if(!b_first && b_limited_samples && !nr_rel_prec.isPositive()) { mstruct = mbak; break; } if((b_limited_samples && !b_first) || nr_rel_prec.intValue() >= CALCULATOR->getPrecision()) { CALCULATOR->endTemporaryStopIntervalArithmetic(); mstruct.number().setUncertainty(nr_prec); mstruct.numberUpdated(); CALCULATOR->error(false, _("Definite integral was approximated."), NULL); return 1; } ntr = mstruct.number(); } else { mstruct = mbak; break; } b_first = false; } } } if(b_unknown_precision) { nr_samples = CALCULATOR->getPrecision(); nr_samples.raise(Number(3, 4)); nr_samples.ceil(); nr_samples *= 100; if(numerical_integration(mstruct, x_var, eo2, nr_begin, nr_end, nr_samples.intValue())) { CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->error(true, _("Definite integral was approximated with unknown precision."), NULL); mstruct.setApproximate(true, true); return 1; } } } } mstruct.replace(x_var, vargs[1]); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->error(false, _("Unable to integrate the expression."), NULL); return -1; } SolveFunction::SolveFunction() : MathFunction("solve", 1, 2) { setArgumentDefinition(2, new SymbolicArgument()); setDefaultValue(2, "x"); } bool is_comparison_structure(const MathStructure &mstruct, const MathStructure &xvar, bool *bce = NULL, bool do_bce_or = false); bool is_comparison_structure(const MathStructure &mstruct, const MathStructure &xvar, bool *bce, bool do_bce_or) { if(mstruct.isComparison()) { if(bce) *bce = mstruct.comparisonType() == COMPARISON_EQUALS && mstruct[0] == xvar; return true; } if(bce && do_bce_or && mstruct.isLogicalOr()) { *bce = true; for(size_t i = 0; i < mstruct.size(); i++) { bool bcei = false; if(!is_comparison_structure(mstruct[i], xvar, &bcei, false)) return false; if(!bcei) *bce = false; } return true; } if(bce) *bce = false; if(mstruct.isLogicalAnd()) { for(size_t i = 0; i < mstruct.size(); i++) { if(is_comparison_structure(mstruct[i], xvar)) return true; } return true; } else if(mstruct.isLogicalOr()) { for(size_t i = 0; i < mstruct.size(); i++) { if(!is_comparison_structure(mstruct[i], xvar)) return false; } return true; } return false; } MathStructure *solve_handle_logical_and(MathStructure &mstruct, MathStructure **mtruefor, ComparisonType ct, bool &b_partial, const MathStructure &x_var) { MathStructure *mcondition = NULL; for(size_t i2 = 0; i2 < mstruct.size(); ) { if(ct == COMPARISON_EQUALS) { if(mstruct[i2].isComparison() && ct == mstruct[i2].comparisonType() && mstruct[i2][0].contains(x_var)) { if(mstruct[i2][0] == x_var) { if(mstruct.size() == 2) { if(i2 == 0) { mstruct[1].ref(); mcondition = &mstruct[1]; } else { mstruct[0].ref(); mcondition = &mstruct[0]; } } else { mcondition = new MathStructure(); mcondition->set_nocopy(mstruct); mcondition->delChild(i2 + 1); } mstruct.setToChild(i2 + 1, true); break; } else { b_partial = true; i2++; } } else { i2++; } } else { if(mstruct[i2].isComparison() && mstruct[i2][0].contains(x_var)) { i2++; } else { mstruct[i2].ref(); if(mcondition) { mcondition->add_nocopy(&mstruct[i2], OPERATION_LOGICAL_AND, true); } else { mcondition = &mstruct[i2]; } mstruct.delChild(i2 + 1); } } } if(ct == COMPARISON_EQUALS) { if(mstruct.isLogicalAnd()) { MathStructure *mtmp = new MathStructure(); mtmp->set_nocopy(mstruct); if(!(*mtruefor)) { *mtruefor = mtmp; } else { (*mtruefor)->add_nocopy(mtmp, OPERATION_LOGICAL_OR, true); } mstruct.clear(true); } } else { if(mstruct.size() == 1) { mstruct.setToChild(1, true); if(ct != COMPARISON_EQUALS) mstruct.setProtected(); } else if(mstruct.size() == 0) { mstruct.clear(true); if(!(*mtruefor)) { *mtruefor = mcondition; } else { (*mtruefor)->add_nocopy(mcondition, OPERATION_LOGICAL_OR, true); } mcondition = NULL; } else if(ct != COMPARISON_EQUALS) { for(size_t i = 0; i < mstruct.size(); i++) { mstruct[i].setProtected(); } } } return mcondition; } void simplify_constant(MathStructure &mstruct, const MathStructure &x_var, const MathStructure &y_var, const MathStructure &c_var, bool in_comparison = false, bool in_or = false, bool in_and = false); void simplify_constant(MathStructure &mstruct, const MathStructure &x_var, const MathStructure &y_var, const MathStructure &c_var, bool in_comparison, bool in_or, bool in_and) { if(!in_comparison && mstruct.isComparison()) { if(mstruct[0] == c_var) { if(in_or) mstruct.clear(true); else mstruct.set(1, 1, 0); } else if(mstruct[0] == y_var) { if(mstruct[1].contains(y_var, true) <= 0) simplify_constant(mstruct[1], x_var, y_var, c_var, true); } else if(mstruct[0].contains(y_var, true) <= 0 && mstruct.contains(c_var, true) > 0) { if(in_or) mstruct.clear(true); else mstruct.set(1, 1, 0); } } if(in_comparison) { if(mstruct.contains(y_var, true) <= 0 && mstruct.contains(x_var, true) <= 0 && mstruct.contains(c_var, true) > 0) { mstruct = c_var; return; } } if(in_comparison) { int n_c = 0, b_cx = false; size_t i_c = 0; for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].contains(c_var, true) > 0) { n_c++; i_c = i; if(!b_cx && mstruct[i].contains(x_var, true) > 0) { b_cx = true; } } } if(!b_cx && n_c >= 1 && (mstruct.isAddition() || mstruct.isMultiplication())) { bool b_c = false; for(size_t i = 0; i < mstruct.size();) { if(mstruct[i].contains(c_var, true) > 0) { if(b_c) { mstruct.delChild(i + 1); } else { b_c = true; mstruct[i] = c_var; i++; } } else if(mstruct[i].contains(x_var, true) <= 0) { mstruct.delChild(i + 1); } else { i++; } } if(mstruct.size() == 1) mstruct.setToChild(1, true); } else if(n_c == 1) { if(b_cx) simplify_constant(mstruct[i_c], x_var, y_var, c_var, true); else mstruct[i_c] = c_var; } } else { for(size_t i = 0; i < mstruct.size(); i++) { simplify_constant(mstruct[i], x_var, y_var, c_var, false, mstruct.isLogicalOr(), mstruct.isLogicalAnd()); } } } extern int test_comparisons(const MathStructure &msave, MathStructure &mthis, const MathStructure &x_var, const EvaluationOptions &eo, bool sub = false); int test_equation(MathStructure &mstruct, const EvaluationOptions &eo, const MathStructure &x_var, const MathStructure &y_var, const MathStructure &x_value, const MathStructure &y_value) { if(mstruct.isComparison() && mstruct.comparisonType() == COMPARISON_EQUALS && mstruct[0] == y_var) { MathStructure mtest(mstruct); mtest.replace(x_var, x_value); MathStructure mtest2(y_var); mtest2.transform(COMPARISON_EQUALS, y_value); CALCULATOR->beginTemporaryStopMessages(); EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_APPROXIMATE; mtest.calculateFunctions(eo2); mtest2.calculateFunctions(eo2); int b = test_comparisons(mtest, mtest2, y_var, eo); CALCULATOR->endTemporaryStopMessages(); if(!b) mstruct.clear(true); return b; } bool b_ret = 0; for(size_t i = 0; i < mstruct.size(); i++) { int b = test_equation(mstruct[i], eo, x_var, y_var, x_value, y_value); if(b < 0) return b; else if(b > 0) b_ret = 1; } return b_ret; } int solve_equation(MathStructure &mstruct, const MathStructure &m_eqn, const MathStructure &y_var, const EvaluationOptions &eo, bool dsolve = false, const MathStructure &x_var = m_undefined, const MathStructure &c_var = m_undefined, const MathStructure &x_value = m_undefined, const MathStructure &y_value = m_undefined) { int itry = 0; int ierror = 0; int first_error = 0; Assumptions *assumptions = NULL; bool assumptions_added = false; AssumptionSign as = ASSUMPTION_SIGN_UNKNOWN; AssumptionType at = ASSUMPTION_TYPE_NUMBER; MathStructure msave; string strueforall; while(true) { if(itry == 1) { if(ierror == 1) { if(!dsolve) CALCULATOR->error(true, _("No equality or inequality to solve. The entered expression to solve is not correct (ex. \"x + 5 = 3\" is correct)"), NULL); return -1; } else { first_error = ierror; msave = mstruct; } } itry++; if(itry == 2) { if(y_var.isVariable() && y_var.variable()->subtype() == SUBTYPE_UNKNOWN_VARIABLE) { assumptions = ((UnknownVariable*) y_var.variable())->assumptions(); if(!assumptions) { assumptions = new Assumptions(); assumptions->setSign(CALCULATOR->defaultAssumptions()->sign()); assumptions->setType(CALCULATOR->defaultAssumptions()->type()); ((UnknownVariable*) y_var.variable())->setAssumptions(assumptions); assumptions_added = true; } } else { assumptions = CALCULATOR->defaultAssumptions(); } if(assumptions->sign() != ASSUMPTION_SIGN_UNKNOWN) { as = assumptions->sign(); assumptions->setSign(ASSUMPTION_SIGN_UNKNOWN); } else { itry++; } } if(itry == 3) { if(assumptions->type() > ASSUMPTION_TYPE_NUMBER) { at = assumptions->type(); assumptions->setType(ASSUMPTION_TYPE_NUMBER); as = assumptions->sign(); assumptions->setSign(ASSUMPTION_SIGN_UNKNOWN); } else { itry++; } } if(itry > 3) { if(as != ASSUMPTION_SIGN_UNKNOWN) assumptions->setSign(as); if(at > ASSUMPTION_TYPE_NUMBER) assumptions->setType(at); if(assumptions_added) ((UnknownVariable*) y_var.variable())->setAssumptions(NULL); switch(first_error) { case 2: { CALCULATOR->error(true, _("The comparison is true for all %s (with current assumptions)."), format_and_print(y_var).c_str(), NULL); break; } case 3: { CALCULATOR->error(true, _("No possible solution was found (with current assumptions)."), NULL); break; } case 4: { CALCULATOR->error(true, _("Was unable to completely isolate %s."), format_and_print(y_var).c_str(), NULL); break; } case 7: { CALCULATOR->error(false, _("The comparison is true for all %s if %s."), format_and_print(y_var).c_str(), strueforall.c_str(), NULL); break; } default: { CALCULATOR->error(true, _("Was unable to isolate %s."), format_and_print(y_var).c_str(), NULL); break; } } mstruct = msave; return -1; } ComparisonType ct = COMPARISON_EQUALS; bool b = false; bool b_partial = false; if(m_eqn.isComparison()) { ct = m_eqn.comparisonType(); mstruct = m_eqn; b = true; } else if(m_eqn.isLogicalAnd() && m_eqn.size() > 0 && m_eqn[0].isComparison()) { ct = m_eqn[0].comparisonType(); for(size_t i = 0; i < m_eqn.size(); i++) { if(m_eqn[i].isComparison() && m_eqn[i].contains(y_var, true) > 0) { ct = m_eqn[i].comparisonType(); break; } } mstruct = m_eqn; b = true; } else if(m_eqn.isLogicalOr() && m_eqn.size() > 0 && m_eqn[0].isComparison()) { ct = m_eqn[0].comparisonType(); mstruct = m_eqn; b = true; } else if(m_eqn.isLogicalOr() && m_eqn.size() > 0 && m_eqn[0].isLogicalAnd() && m_eqn[0].size() > 0 && m_eqn[0][0].isComparison()) { ct = m_eqn[0][0].comparisonType(); for(size_t i = 0; i < m_eqn[0].size(); i++) { if(m_eqn[0][i].isComparison() && m_eqn[0][i].contains(y_var, true) > 0) { ct = m_eqn[0][i].comparisonType(); break; } } mstruct = m_eqn; b = true; } else if(m_eqn.isVariable() && m_eqn.variable()->isKnown() && (eo.approximation != APPROXIMATION_EXACT || !m_eqn.variable()->isApproximate()) && ((KnownVariable*) m_eqn.variable())->get().isComparison()) { mstruct = ((KnownVariable*) m_eqn.variable())->get(); ct = m_eqn.comparisonType(); b = true; } else { EvaluationOptions eo2 = eo; eo2.test_comparisons = false; eo2.assume_denominators_nonzero = false; eo2.isolate_x = false; mstruct = m_eqn; mstruct.eval(eo2); if(mstruct.isComparison()) { ct = mstruct.comparisonType(); b = true; } else if(mstruct.isLogicalAnd() && mstruct.size() > 0 && mstruct[0].isComparison()) { ct = mstruct[0].comparisonType(); b = true; } else if(mstruct.isLogicalOr() && mstruct.size() > 0 && mstruct[0].isComparison()) { ct = mstruct[0].comparisonType(); b = true; } else if(mstruct.isLogicalOr() && mstruct.size() > 0 && mstruct[0].isLogicalAnd() && mstruct[0].size() > 0 && mstruct[0][0].isComparison()) { ct = mstruct[0][0].comparisonType(); b = true; } } if(!b) { ierror = 1; continue; } EvaluationOptions eo2 = eo; eo2.isolate_var = &y_var; eo2.isolate_x = true; eo2.test_comparisons = true; mstruct.eval(eo2); if(dsolve) { if(x_value.isUndefined() || y_value.isUndefined()) { simplify_constant(mstruct, x_var, y_var, c_var); mstruct.eval(eo2); } else { int test_r = test_equation(mstruct, eo2, x_var, y_var, x_value, y_value); if(test_r < 0) { ierror = 8; continue; } else if(test_r > 0) { mstruct.eval(eo2); } } } if(mstruct.isOne()) { ierror = 2; continue; } else if(mstruct.isZero()) { ierror = 3; continue; } PrintOptions po; po.spell_out_logical_operators = true; if(mstruct.isComparison()) { if((ct == COMPARISON_EQUALS && mstruct.comparisonType() != COMPARISON_EQUALS) || !mstruct.contains(y_var)) { if(itry == 1) { mstruct.format(po); strueforall = mstruct.print(po); } ierror = 7; continue; } else if(ct == COMPARISON_EQUALS && mstruct[0] != y_var) { ierror = 4; continue; } if(ct == COMPARISON_EQUALS) { mstruct.setToChild(2, true); } else { mstruct.setProtected(); } if(itry > 1) { assumptions->setSign(as); if(itry == 2) { CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed sign was therefor temporarily set as unknown."), format_and_print(y_var).c_str(), NULL); } else if(itry == 3) { assumptions->setType(at); CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed type and sign was therefor temporarily set as unknown."), format_and_print(y_var).c_str(), NULL); } if(assumptions_added) ((UnknownVariable*) y_var.variable())->setAssumptions(NULL); } return 1; } else if(mstruct.isLogicalAnd()) { MathStructure *mtruefor = NULL; bool b_partial; MathStructure mcopy(mstruct); MathStructure *mcondition = solve_handle_logical_and(mstruct, &mtruefor, ct, b_partial, y_var); if((!mstruct.isComparison() && !mstruct.isLogicalAnd()) || (ct == COMPARISON_EQUALS && (!mstruct.isComparison() || mstruct.comparisonType() != COMPARISON_EQUALS || mstruct[0] != y_var)) || !mstruct.contains(y_var)) { if(mtruefor) delete mtruefor; if(mcondition) delete mcondition; if(b_partial) { ierror = 4; } else { ierror = 5; } mstruct = mcopy; continue; } if(itry > 1) { assumptions->setSign(as); if(itry == 2) { CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed sign was therefor temporarily set as unknown."), format_and_print(y_var).c_str(), NULL); } else if(itry == 3) { assumptions->setType(at); CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed type and sign was therefor temporarily set as unknown."), format_and_print(y_var).c_str(), NULL); } if(assumptions_added) ((UnknownVariable*) y_var.variable())->setAssumptions(NULL); } if(mcondition) { mcondition->format(po); CALCULATOR->error(false, _("The solution requires that %s."), mcondition->print(po).c_str(), NULL); delete mcondition; } if(mtruefor) { mtruefor->format(po); CALCULATOR->error(false, _("The comparison is true for all %s if %s."), format_and_print(y_var).c_str(), mtruefor->print(po).c_str(), NULL); delete mtruefor; } if(ct == COMPARISON_EQUALS) mstruct.setToChild(2, true); return 1; } else if(mstruct.isLogicalOr()) { MathStructure mcopy(mstruct); MathStructure *mtruefor = NULL; vector mconditions; for(size_t i = 0; i < mstruct.size(); ) { MathStructure *mcondition = NULL; bool b_and = false; if(mstruct[i].isLogicalAnd()) { mcondition = solve_handle_logical_and(mstruct[i], &mtruefor, ct, b_partial, y_var); b_and = true; } if(!mstruct[i].isZero()) { for(size_t i2 = 0; i2 < i; i2++) { if(mstruct[i2] == mstruct[i]) { mstruct[i].clear(); if(mcondition && mconditions[i2]) { mconditions[i2]->add_nocopy(mcondition, OPERATION_LOGICAL_OR, true); } break; } } } bool b_del = false; if((!mstruct[i].isComparison() && !mstruct[i].isLogicalAnd()) || (ct == COMPARISON_EQUALS && (!mstruct[i].isComparison() || mstruct[i].comparisonType() != COMPARISON_EQUALS)) || !mstruct[i].contains(y_var)) { b_del = true; } else if(ct == COMPARISON_EQUALS && mstruct[i][0] != y_var) { b_partial = true; b_del = true; } if(b_del) { if(!mstruct[i].isZero()) { mstruct[i].ref(); if(!mtruefor) { mtruefor = &mstruct[i]; } else { mtruefor->add_nocopy(&mstruct[i], OPERATION_LOGICAL_OR, true); } } mstruct.delChild(i + 1); } else { mconditions.push_back(mcondition); if(!b_and && ct != COMPARISON_EQUALS) mstruct[i].setProtected(); i++; } } if(ct == COMPARISON_EQUALS) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isComparison() && mstruct[i].comparisonType() == ct) mstruct[i].setToChild(2, true); } } if(mstruct.size() == 1) { mstruct.setToChild(1, true); } else if(mstruct.size() == 0) { if(mtruefor) delete mtruefor; if(b_partial) ierror = 4; else ierror = 5; mstruct = mcopy; continue; } else { mstruct.setType(STRUCT_VECTOR); } if(itry > 1) { assumptions->setSign(as); if(itry == 2) { CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed sign was therefor temporarily set as unknown."), format_and_print(y_var).c_str(), NULL); } else if(itry == 3) { assumptions->setType(at); CALCULATOR->error(false, _("Was unable to isolate %s with the current assumptions. The assumed type and sign was therefor temporarily set as unknown."), format_and_print(y_var).c_str(), NULL); } if(assumptions_added) ((UnknownVariable*) y_var.variable())->setAssumptions(NULL); } if(mconditions.size() == 1) { if(mconditions[0]) { mconditions[0]->format(po); CALCULATOR->error(false, _("The solution requires that %s."), mconditions[0]->print(po).c_str(), NULL); delete mconditions[0]; } } else { string sconditions; for(size_t i = 0; i < mconditions.size(); i++) { if(mconditions[i]) { mconditions[i]->format(po); CALCULATOR->error(false, _("Solution %s requires that %s."), i2s(i + 1).c_str(), mconditions[i]->print(po).c_str(), NULL); delete mconditions[i]; } } } if(mtruefor) { mtruefor->format(po); CALCULATOR->error(false, _("The comparison is true for all %s if %s."), format_and_print(y_var).c_str(), mtruefor->print(po).c_str(), NULL); delete mtruefor; } return 1; } else { ierror = 6; } } return -1; } int SolveFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { return solve_equation(mstruct, vargs[0], vargs[1], eo); } SolveMultipleFunction::SolveMultipleFunction() : MathFunction("multisolve", 2) { setArgumentDefinition(1, new VectorArgument()); VectorArgument *arg = new VectorArgument(); arg->addArgument(new SymbolicArgument()); arg->setReoccuringArguments(true); setArgumentDefinition(2, arg); setCondition("dimension(\\x) = dimension(\\y)"); } int SolveMultipleFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { mstruct.clearVector(); if(vargs[1].size() < 1) return 1; vector eleft; eleft.resize(vargs[0].size(), true); vector eorder; bool b = false; for(size_t i = 0; i < vargs[1].size(); i++) { b = false; for(size_t i2 = 0; i2 < vargs[0].size(); i2++) { if(eleft[i2] && vargs[0][i2].contains(vargs[1][i], true)) { eorder.push_back(i2); eleft[i2] = false; b = true; break; } } if(!b) { eorder.clear(); for(size_t i2 = 0; i2 < vargs[0].size(); i2++) { eorder.push_back(i2); } break; } } for(size_t i = 0; i < eorder.size(); i++) { MathStructure msolve(vargs[0][eorder[i]]); EvaluationOptions eo2 = eo; eo2.isolate_var = &vargs[1][i]; for(size_t i2 = 0; i2 < i; i2++) { msolve.replace(vargs[1][i2], mstruct[i2]); } msolve.eval(eo2); if(msolve.isComparison()) { if(msolve[0] != vargs[1][i]) { if(!b) { CALCULATOR->error(true, _("Unable to isolate %s.\n\nYou might need to place the equations and variables in an appropriate order so that each equation at least contains the corresponding variable (if automatic reordering failed)."), format_and_print(vargs[1][i]).c_str(), NULL); } else { CALCULATOR->error(true, _("Unable to isolate %s."), format_and_print(vargs[1][i]).c_str(), NULL); } return 0; } else { if(msolve.comparisonType() == COMPARISON_EQUALS) { mstruct.addChild(msolve[1]); } else { CALCULATOR->error(true, _("Inequalities is not allowed in %s()."), preferredName().name.c_str(), NULL); return 0; } } } else if(msolve.isLogicalOr()) { for(size_t i2 = 0; i2 < msolve.size(); i2++) { if(!msolve[i2].isComparison() || msolve[i2].comparisonType() != COMPARISON_EQUALS || msolve[i2][0] != vargs[1][i]) { CALCULATOR->error(true, _("Unable to isolate %s."), format_and_print(vargs[1][i]).c_str(), NULL); return 0; } else { msolve[i2].setToChild(2, true); } } msolve.setType(STRUCT_VECTOR); mstruct.addChild(msolve); } else { CALCULATOR->error(true, _("Unable to isolate %s."), format_and_print(vargs[1][i]).c_str(), NULL); return 0; } for(size_t i2 = 0; i2 < i; i2++) { for(size_t i3 = 0; i3 <= i; i3++) { if(i2 != i3) { mstruct[i2].replace(vargs[1][i3], mstruct[i3]); } } } } return 1; } MathStructure *find_deqn(MathStructure &mstruct); MathStructure *find_deqn(MathStructure &mstruct) { if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_diff) return &mstruct; for(size_t i = 0; i < mstruct.size(); i++) { MathStructure *m = find_deqn(mstruct[i]); if(m) return m; } return NULL; } bool contains_ignore_diff(const MathStructure &m, const MathStructure &mstruct, const MathStructure &mdiff); bool contains_ignore_diff(const MathStructure &m, const MathStructure &mstruct, const MathStructure &mdiff) { if(m.equals(mstruct)) return true; if(m.equals(mdiff)) return false; for(size_t i = 0; i < m.size(); i++) { if(contains_ignore_diff(m[i], mstruct, mdiff)) return true; } if(m.isVariable() && m.variable()->isKnown()) { return contains_ignore_diff(((KnownVariable*) m.variable())->get(), mstruct, mdiff); } else if(m.isVariable()) { if(mstruct.isNumber() || !m.representsNumber()) return true; } else if(m.isAborted()) { return true; } return false; } void add_C(MathStructure &m_eqn, const MathStructure &m_x, const MathStructure &m_y, const MathStructure &x_value, const MathStructure &y_value) { if(!y_value.isUndefined() && !x_value.isUndefined()) { MathStructure m_c(m_eqn); m_c.replace(m_x, x_value); m_c.replace(m_y, y_value); m_c.setType(STRUCT_ADDITION); m_c[1].negate(); m_c.childUpdated(2); m_eqn[1] += m_c; } else { m_eqn[1] += CALCULATOR->v_C; } m_eqn.childrenUpdated(); } bool dsolve(MathStructure &m_eqn, const EvaluationOptions &eo, const MathStructure &m_diff, const MathStructure &y_value, const MathStructure &x_value) { MathStructure m_y(m_diff[0]), m_x(m_diff[1]); bool b = false; if(m_eqn[0] == m_diff) { if(m_eqn[1].containsRepresentativeOf(m_y, true, true) == 0) { // y'=f(x) MathStructure m_fx(m_eqn[1]); if(m_fx.integrate(m_x, eo, true, false) > 0) { m_eqn[0] = m_y; m_eqn[1] = m_fx; b = true; } } else if(m_eqn[1].containsRepresentativeOf(m_x, true, true) == 0) { MathStructure m_fy(m_eqn[1]); m_fy.inverse(); if(m_fy.integrate(m_y, eo, true, false) > 0) { m_eqn[0] = m_fy; m_eqn[1] = m_x; b = true; } } else if(m_eqn[1].isMultiplication() && m_eqn[1].size() >= 2) { b = true; MathStructure m_fx(1, 1, 0), m_fy(1, 1, 0); for(size_t i = 0; i < m_eqn[1].size(); i++) { if(m_eqn[1][i].containsRepresentativeOf(m_y, true, true) != 0) { if(m_eqn[1][i].containsRepresentativeOf(m_x, true, true) != 0) { b = false; break; } if(m_fy.isOne()) m_fy = m_eqn[1][i]; else m_fy.multiply(m_eqn[1][i], true); } else { if(m_fx.isOne()) m_fx = m_eqn[1][i]; else m_fx.multiply(m_eqn[1][i], true); } } if(b) { // y'=f(x)*f(y) m_fy.inverse(); if(m_fy.integrate(m_y, eo, true, false) > 0 && m_fx.integrate(m_x, eo, true, false) > 0) { m_eqn[0] = m_fy; m_eqn[1] = m_fx; } else { b = false; } } } else { MathStructure mfactor(m_eqn); mfactor[1].factorize(eo, false, 0, 0, false, false, NULL, m_x); if(mfactor[1].isMultiplication() && mfactor[1].size() >= 2) { mfactor.childUpdated(2); if(dsolve(mfactor, eo, m_diff, y_value, x_value)) { m_eqn = mfactor; return 1; } } if(m_eqn[1].isAddition()) { MathStructure m_left; MathStructure m_muly; MathStructure m_mul_exp; MathStructure m_exp; b = true; for(size_t i = 0; i < m_eqn[1].size(); i++) { if(m_eqn[1][i] == m_y) { if(m_muly.isZero()) m_muly = m_one; else m_muly.add(m_one, true); } else if(m_eqn[1][i].containsRepresentativeOf(m_y, true, true) != 0) { if(m_left.isZero() && m_eqn[1][i].isPower() && m_eqn[1][i][0] == m_y && (m_mul_exp.isZero() || m_eqn[1][i][1] == m_exp)) { if(m_mul_exp.isZero()) { m_exp = m_eqn[1][i][1]; m_mul_exp = m_one; } else { m_mul_exp.add(m_one, true); } } else if(m_eqn[1][i].isMultiplication()) { size_t i_my = 0; bool b2 = false, b2_exp = false; for(size_t i2 = 0; i2 < m_eqn[1][i].size(); i2++) { if(!b2 && m_eqn[1][i][i2] == m_y) { i_my = i2; b2 = true; } else if(!b2 && m_left.isZero() && m_eqn[1][i][i2].isPower() && m_eqn[1][i][i2][0] == m_y && (m_mul_exp.isZero() || m_eqn[1][i][i2][1] == m_exp)) { i_my = i2; b2 = true; b2_exp = true; } else if(m_eqn[1][i][i2].containsRepresentativeOf(m_y, true, true) != 0) { b2 = false; break; } } if(b2) { MathStructure m_a(m_eqn[1][i]); m_a.delChild(i_my + 1, true); if(b2_exp) { if(m_mul_exp.isZero()) { m_exp = m_eqn[1][i][i_my][1]; m_mul_exp = m_a; } else { m_mul_exp.add(m_a, true); } } else { if(m_muly.isZero()) m_muly = m_a; else m_muly.add(m_a, true); } } else { b = false; break; } } else { b = false; break; } } else { if(!m_mul_exp.isZero()) { b = false; break; } if(m_left.isZero()) m_left = m_eqn[1][i]; else m_left.add(m_eqn[1][i], true); } } if(b && !m_muly.isZero()) { if(!m_mul_exp.isZero()) { if(m_exp.isOne() || !m_left.isZero()) return false; // y' = f(x)*y+g(x)*y^c b = false; m_muly.calculateNegate(eo); MathStructure m_y1_integ(m_muly); if(m_y1_integ.integrate(m_x, eo, true, false) > 0) { m_exp.negate(); m_exp += m_one; MathStructure m_y1_exp(m_exp); m_y1_exp *= m_y1_integ; m_y1_exp.transform(STRUCT_POWER, CALCULATOR->v_e); m_y1_exp.swapChildren(1, 2); MathStructure m_y1_exp_integ(m_y1_exp); m_y1_exp_integ *= m_mul_exp; if(m_y1_exp_integ.integrate(m_x, eo, true, false) > 0) { m_eqn[1] = m_exp; m_eqn[1] *= m_y1_exp_integ; m_eqn[0] = m_y; m_eqn[0] ^= m_exp; m_eqn[0] *= m_y1_exp; add_C(m_eqn, m_x, m_y, x_value, y_value); m_eqn[0].delChild(m_eqn[0].size()); m_eqn[1] /= m_y1_exp; m_eqn.childrenUpdated(); return 1; } } } else if(m_left.isZero()) { // y'=f(x)*y+g(x)*y MathStructure mtest(m_eqn); MathStructure m_fy(m_y); m_fy.inverse(); MathStructure m_fx(m_muly); if(m_fy.integrate(m_y, eo, true, false) > 0 && m_fx.integrate(m_x, eo, true, false) > 0) { m_eqn[0] = m_fy; m_eqn[1] = m_fx; b = true; } } else { // y'=f(x)*y+g(x) MathStructure integ_fac(m_muly); integ_fac.negate(); if(integ_fac.integrate(m_x, eo, true, false) > 0) { UnknownVariable *var = new UnknownVariable("", "u"); var->ref(); Assumptions *ass = new Assumptions(); if(false) { ass->setType(ASSUMPTION_TYPE_REAL); } var->setAssumptions(ass); MathStructure m_u(var); m_u.inverse(); if(m_u.integrate(var, eo, false, false) > 0) { MathStructure m_eqn2(integ_fac); m_eqn2.transform(COMPARISON_EQUALS, m_u); m_eqn2.isolate_x(eo, var); if(m_eqn2.isComparison() && m_eqn2.comparisonType() == COMPARISON_EQUALS && m_eqn2[0] == var) { integ_fac = m_eqn2[1]; MathStructure m_fx(m_left); m_fx *= integ_fac; if(m_fx.integrate(m_x, eo, true, false) > 0) { m_eqn[0] = m_y; m_eqn[0] *= integ_fac; m_eqn[1] = m_fx; add_C(m_eqn, m_x, m_y, x_value, y_value); m_eqn[0] = m_y; m_eqn[1] /= integ_fac; m_eqn.childrenUpdated(); return 1; } } else if(m_eqn2.isLogicalOr() && m_eqn2.size() >= 2) { b = true; for(size_t i = 0; i < m_eqn2.size(); i++) { if(!m_eqn2[i].isComparison() || m_eqn2[i].comparisonType() != COMPARISON_EQUALS || m_eqn2[i][0] != var) { b = false; break; } } if(b) { MathStructure m_eqn_new; m_eqn_new.setType(STRUCT_LOGICAL_OR); for(size_t i = 0; i < m_eqn2.size(); i++) { integ_fac = m_eqn2[i][1]; MathStructure m_fx(m_left); m_fx *= integ_fac; if(m_fx.integrate(m_x, eo, true, false) > 0) { MathStructure m_fy(m_y); m_fy *= integ_fac; m_eqn_new.addChild(m_fy); m_eqn_new.last().transform(COMPARISON_EQUALS, m_fx); add_C(m_eqn_new.last(), m_x, m_y, x_value, y_value); m_eqn_new.last()[0] = m_y; m_eqn_new.last()[1] /= integ_fac; m_eqn_new.last().childrenUpdated(); m_eqn_new.childUpdated(m_eqn_new.size()); } else { b = false; break; } } if(b) { m_eqn_new.childrenUpdated(); m_eqn = m_eqn_new; return 1; } } } } var->destroy(); } } } else { b = false; } } } if(b) { add_C(m_eqn, m_x, m_y, x_value, y_value); return 1; } } return false; } DSolveFunction::DSolveFunction() : MathFunction("dsolve", 1, 3) { setDefaultValue(2, "undefined"); setDefaultValue(3, "0"); } int DSolveFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { MathStructure m_eqn(vargs[0]); EvaluationOptions eo2 = eo; eo2.isolate_x = false; eo2.protected_function = CALCULATOR->f_diff; m_eqn.eval(eo2); MathStructure *m_diff_p = NULL; if(m_eqn.isLogicalAnd()) { for(size_t i = 0; i < m_eqn.size(); i++) { if(m_eqn[i].isComparison() && m_eqn.comparisonType() == COMPARISON_EQUALS) { m_diff_p = find_deqn(m_eqn[i]); if(m_diff_p) break; } } } else if(m_eqn.isComparison() && m_eqn.comparisonType() == COMPARISON_EQUALS) { m_diff_p = find_deqn(m_eqn); } if(!m_diff_p) { CALCULATOR->error(true, _("No differential equation found."), NULL); mstruct = m_eqn; return -1; } MathStructure m_diff(*m_diff_p); if(m_diff.size() != 3 || (!m_diff[0].isSymbolic() && !m_diff[0].isVariable()) || (!m_diff[1].isSymbolic() && !m_diff[1].isVariable()) || !m_diff[2].isInteger() || !m_diff[2].number().isPositive() || !m_diff[2].number().isLessThanOrEqualTo(10)) { CALCULATOR->error(true, _("No differential equation found."), NULL); mstruct = m_eqn; return -1; } if(m_diff[2].number().intValue() != 1) { CALCULATOR->error(true, _("Unable to solve differential equation."), NULL); mstruct = m_eqn; return -1; } m_eqn.isolate_x(eo2, m_diff); mstruct = m_eqn; if(eo.approximation == APPROXIMATION_TRY_EXACT) eo2.approximation = APPROXIMATION_EXACT; if(m_eqn.isLogicalAnd()) { for(size_t i = 0; i < m_eqn.size(); i++) { if(m_eqn[i].isComparison() && m_eqn[i].comparisonType() == COMPARISON_EQUALS && m_eqn[i][0] == m_diff) { dsolve(m_eqn[i], eo2, m_diff, vargs[1], vargs[2]); } } } else if(m_eqn.isLogicalOr()) { for(size_t i = 0; i < m_eqn.size(); i++) { if(m_eqn[i].isComparison() && m_eqn[i].comparisonType() == COMPARISON_EQUALS && m_eqn[i][0] == m_diff) { dsolve(m_eqn[i], eo2, m_diff, vargs[1], vargs[2]); } else if(m_eqn[i].isLogicalAnd()) { for(size_t i2 = 0; i2 < m_eqn[i].size(); i2++) { if(m_eqn[i][i2].isComparison() && m_eqn[i][i2].comparisonType() == COMPARISON_EQUALS && m_eqn[i][i2][0] == m_diff) { dsolve(m_eqn[i][i2], eo2, m_diff, vargs[1], vargs[2]); } } } } } else if(m_eqn.isComparison() && m_eqn.comparisonType() == COMPARISON_EQUALS && m_eqn[0] == m_diff) { dsolve(m_eqn, eo2, m_diff, vargs[1], vargs[2]); } if(m_eqn.contains(m_diff)) { CALCULATOR->error(true, _("Unable to solve differential equation."), NULL); return -1; } m_eqn.calculatesub(eo2, eo2, true); MathStructure msolve(m_eqn); if(solve_equation(msolve, m_eqn, m_diff[0], eo, true, m_diff[1], MathStructure(CALCULATOR->v_C), vargs[2], vargs[1]) <= 0) { CALCULATOR->error(true, _("Unable to solve differential equation."), NULL); return -1; } mstruct = msolve; return 1; } LimitFunction::LimitFunction() : MathFunction("limit", 2, 4) { NumberArgument *arg = new NumberArgument("", ARGUMENT_MIN_MAX_NONE, false, false); arg->setComplexAllowed(false); arg->setHandleVector(true); setArgumentDefinition(2, arg); setArgumentDefinition(3, new SymbolicArgument()); setDefaultValue(3, "x"); IntegerArgument *iarg = new IntegerArgument(); iarg->setMin(&nr_minus_one); iarg->setMax(&nr_one); setArgumentDefinition(4, iarg); setDefaultValue(4, "0"); } int LimitFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { if(vargs[1].isVector()) return 0; mstruct = vargs[0]; EvaluationOptions eo2 = eo; eo2.approximation = APPROXIMATION_EXACT; if(mstruct.calculateLimit(vargs[2], vargs[1], eo2, vargs[3].number().intValue())) return 1; CALCULATOR->error(true, _("Unable to find limit."), NULL); return -1; } PlotFunction::PlotFunction() : MathFunction("plot", 1, 6) { NumberArgument *arg = new NumberArgument(); arg->setComplexAllowed(false); arg->setHandleVector(false); setArgumentDefinition(2, arg); setDefaultValue(2, "0"); arg = new NumberArgument(); arg->setHandleVector(false); arg->setComplexAllowed(false); setArgumentDefinition(3, arg); setDefaultValue(3, "10"); setDefaultValue(4, "1001"); setArgumentDefinition(5, new SymbolicArgument()); setDefaultValue(5, "x"); setArgumentDefinition(6, new BooleanArgument()); setDefaultValue(6, "0"); setCondition("\\y < \\z"); } int PlotFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { EvaluationOptions eo2; eo2.parse_options = eo.parse_options; eo2.approximation = APPROXIMATION_APPROXIMATE; eo2.parse_options.read_precision = DONT_READ_PRECISION; bool use_step_size = vargs[5].number().getBoolean(); mstruct = vargs[0]; eo2.calculate_functions = false; eo2.expand = false; CALCULATOR->beginTemporaryStopMessages(); mstruct.eval(eo2); int im = 0; if(CALCULATOR->endTemporaryStopMessages(NULL, &im) > 0 || im > 0) mstruct = vargs[0]; eo2.calculate_functions = eo.calculate_functions; eo2.expand = eo.expand; vector x_vectors, y_vectors; vector dpds; if(mstruct.isMatrix() && mstruct.columns() == 2) { MathStructure x_vector, y_vector; mstruct.columnToVector(1, x_vector); mstruct.columnToVector(2, y_vector); y_vectors.push_back(y_vector); x_vectors.push_back(x_vector); PlotDataParameters *dpd = new PlotDataParameters; dpd->title = _("Matrix"); dpds.push_back(dpd); } else if(mstruct.isVector()) { int matrix_index = 1, vector_index = 1; if(mstruct.size() > 0 && (mstruct[0].isVector() || mstruct[0].contains(vargs[4], false, true, true))) { for(size_t i = 0; i < mstruct.size() && !CALCULATOR->aborted(); i++) { MathStructure x_vector; if(mstruct[i].isMatrix() && mstruct[i].columns() == 2) { MathStructure y_vector; mstruct[i].columnToVector(1, x_vector); mstruct[i].columnToVector(2, y_vector); y_vectors.push_back(y_vector); x_vectors.push_back(x_vector); PlotDataParameters *dpd = new PlotDataParameters; dpd->title = _("Matrix"); if(matrix_index > 1) { dpd->title += " "; dpd->title += i2s(matrix_index); } matrix_index++; dpds.push_back(dpd); } else if(mstruct[i].isVector()) { y_vectors.push_back(mstruct[i]); x_vectors.push_back(x_vector); PlotDataParameters *dpd = new PlotDataParameters; dpd->title = _("Vector"); if(vector_index > 1) { dpd->title += " "; dpd->title += i2s(vector_index); } vector_index++; dpds.push_back(dpd); } else { MathStructure y_vector; if(use_step_size) { CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->beginTemporaryStopIntervalArithmetic(); y_vector.set(mstruct[i].generateVector(vargs[4], vargs[1], vargs[2], vargs[3], &x_vector, eo2)); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->endTemporaryStopMessages(); if(y_vector.size() == 0) CALCULATOR->error(true, _("Unable to generate plot data with current min, max and step size."), NULL); } else if(!vargs[3].isInteger() || !vargs[3].representsPositive()) { CALCULATOR->error(true, _("Sampling rate must be a positive integer."), NULL); } else { bool overflow = false; int steps = vargs[3].number().intValue(&overflow); CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->beginTemporaryStopIntervalArithmetic(); if(steps <= 1000000 && !overflow) y_vector.set(mstruct[i].generateVector(vargs[4], vargs[1], vargs[2], steps, &x_vector, eo2)); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->endTemporaryStopMessages(); if(y_vector.size() == 0) CALCULATOR->error(true, _("Unable to generate plot data with current min, max and sampling rate."), NULL); } if(CALCULATOR->aborted()) { mstruct.clear(); return 1; } if(y_vector.size() > 0) { x_vectors.push_back(x_vector); y_vectors.push_back(y_vector); PlotDataParameters *dpd = new PlotDataParameters; MathStructure mprint; if(vargs[0].isVector() && vargs[0].size() == mstruct.size()) mprint = vargs[0][i]; else mprint = mstruct[i]; PrintOptions po; po.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; mprint.format(po); dpd->title = mprint.print(po); dpd->test_continuous = true; dpds.push_back(dpd); } } } } else { MathStructure x_vector; y_vectors.push_back(mstruct); x_vectors.push_back(x_vector); PlotDataParameters *dpd = new PlotDataParameters; dpd->title = _("Vector"); dpds.push_back(dpd); } } else { MathStructure x_vector, y_vector; if(use_step_size) { CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->beginTemporaryStopIntervalArithmetic(); y_vector.set(mstruct.generateVector(vargs[4], vargs[1], vargs[2], vargs[3], &x_vector, eo2)); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->endTemporaryStopMessages(); if(y_vector.size() == 0) CALCULATOR->error(true, _("Unable to generate plot data with current min, max and step size."), NULL); } else if(!vargs[3].isInteger() || !vargs[3].representsPositive()) { CALCULATOR->error(true, _("Sampling rate must be a positive integer."), NULL); } else { bool overflow = false; int steps = vargs[3].number().intValue(&overflow); CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->beginTemporaryStopIntervalArithmetic(); if(steps <= 1000000 && !overflow) y_vector.set(mstruct.generateVector(vargs[4], vargs[1], vargs[2], steps, &x_vector, eo2)); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->endTemporaryStopMessages(); if(y_vector.size() == 0) CALCULATOR->error(true, _("Unable to generate plot data with current min, max and sampling rate."), NULL); } if(CALCULATOR->aborted()) { mstruct.clear(); return 1; } if(y_vector.size() > 0) { x_vectors.push_back(x_vector); y_vectors.push_back(y_vector); PlotDataParameters *dpd = new PlotDataParameters; MathStructure mprint(vargs[0]); PrintOptions po; po.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; mprint.format(po); dpd->title = mprint.print(po); dpd->test_continuous = true; dpds.push_back(dpd); } } if(x_vectors.size() > 0 && !CALCULATOR->aborted()) { PlotParameters param; CALCULATOR->plotVectors(¶m, y_vectors, x_vectors, dpds, false, 0); for(size_t i = 0; i < dpds.size(); i++) { if(dpds[i]) delete dpds[i]; } } mstruct.clear(); return 1; } libqalculate-2.8.2/libqalculate/Calculator.cc0000644000175000017500000136367713401033052016166 00000000000000/* Qalculate Copyright (C) 2003-2007, 2008, 2016-2018 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "Calculator.h" #include "BuiltinFunctions.h" #include "util.h" #include "MathStructure.h" #include "Unit.h" #include "Variable.h" #include "Function.h" #include "DataSet.h" #include "ExpressionItem.h" #include "Prefix.h" #include "Number.h" #include "QalculateDateTime.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBCURL # include #endif #ifdef HAVE_ICU # include #endif #if HAVE_UNORDERED_MAP # include #elif defined(__GNUC__) # ifndef __has_include # define __has_include(x) 0 # endif # if (defined(__clang__) && __has_include()) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) # include namespace Sgi = std; # define unordered_map std::tr1::unordered_map # else # if __GNUC__ < 3 # include namespace Sgi { using ::hash_map; }; // inherit globals # else # include # if __GNUC__ == 3 && __GNUC_MINOR__ == 0 namespace Sgi = std; // GCC 3.0 # else namespace Sgi = ::__gnu_cxx; // GCC 3.1 and later # endif # endif # define unordered_map Sgi::hash_map # endif #else // ... there are other compilers, right? namespace Sgi = std; # define unordered_map Sgi::hash_map #endif #define XML_GET_PREC_FROM_PROP(node, i) value = xmlGetProp(node, (xmlChar*) "precision"); if(value) {i = s2i((char*) value); xmlFree(value);} else {i = -1;} #define XML_GET_APPROX_FROM_PROP(node, b) value = xmlGetProp(node, (xmlChar*) "approximate"); if(value) {b = !xmlStrcmp(value, (const xmlChar*) "true");} else {value = xmlGetProp(node, (xmlChar*) "precise"); if(value) {b = xmlStrcmp(value, (const xmlChar*) "true");} else {b = false;}} if(value) xmlFree(value); #define XML_GET_FALSE_FROM_PROP(node, name, b) value = xmlGetProp(node, (xmlChar*) name); if(value && !xmlStrcmp(value, (const xmlChar*) "false")) {b = false;} else {b = true;} if(value) xmlFree(value); #define XML_GET_TRUE_FROM_PROP(node, name, b) value = xmlGetProp(node, (xmlChar*) name); if(value && !xmlStrcmp(value, (const xmlChar*) "true")) {b = true;} else {b = false;} if(value) xmlFree(value); #define XML_GET_BOOL_FROM_PROP(node, name, b) value = xmlGetProp(node, (xmlChar*) name); if(value && !xmlStrcmp(value, (const xmlChar*) "false")) {b = false;} else if(value && !xmlStrcmp(value, (const xmlChar*) "true")) {b = true;} if(value) xmlFree(value); #define XML_GET_FALSE_FROM_TEXT(node, b) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value && !xmlStrcmp(value, (const xmlChar*) "false")) {b = false;} else {b = true;} if(value) xmlFree(value); #define XML_GET_TRUE_FROM_TEXT(node, b) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value && !xmlStrcmp(value, (const xmlChar*) "true")) {b = true;} else {b = false;} if(value) xmlFree(value); #define XML_GET_BOOL_FROM_TEXT(node, b) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value && !xmlStrcmp(value, (const xmlChar*) "false")) {b = false;} else if(value && !xmlStrcmp(value, (const xmlChar*) "true")) {b = true;} if(value) xmlFree(value); #define XML_GET_STRING_FROM_PROP(node, name, str) value = xmlGetProp(node, (xmlChar*) name); if(value) {str = (char*) value; remove_blank_ends(str); xmlFree(value);} else str = ""; #define XML_GET_STRING_FROM_TEXT(node, str) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value) {str = (char*) value; remove_blank_ends(str); xmlFree(value);} else str = ""; #define XML_DO_FROM_PROP(node, name, action) value = xmlGetProp(node, (xmlChar*) name); if(value) action((char*) value); else action(""); if(value) xmlFree(value); #define XML_DO_FROM_TEXT(node, action) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value) {action((char*) value); xmlFree(value);} else action(""); #define XML_GET_INT_FROM_PROP(node, name, i) value = xmlGetProp(node, (xmlChar*) name); if(value) {i = s2i((char*) value); xmlFree(value);} #define XML_GET_INT_FROM_TEXT(node, i) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value) {i = s2i((char*) value); xmlFree(value);} #define XML_GET_LOCALE_STRING_FROM_TEXT(node, str, best, next_best) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); lang = xmlNodeGetLang(node); if(!best) {if(!lang) {if(!next_best) {if(value) {str = (char*) value; remove_blank_ends(str);} else str = ""; if(locale.empty()) {best = true;}}} else {if(locale == (char*) lang) {best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {next_best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && str.empty() && value) {str = (char*) value; remove_blank_ends(str);}}} if(value) xmlFree(value); if(lang) xmlFree(lang); #define XML_GET_LOCALE_STRING_FROM_TEXT_REQ(node, str, best, next_best) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); lang = xmlNodeGetLang(node); if(!best) {if(!lang) {if(!next_best) {if(value) {str = (char*) value; remove_blank_ends(str);} else str = ""; if(locale.empty()) {best = true;}}} else {if(locale == (char*) lang) {best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {next_best = true; if(value) {str = (char*) value; remove_blank_ends(str);} else str = "";} else if(!next_best && str.empty() && value && !require_translation) {str = (char*) value; remove_blank_ends(str);}}} if(value) xmlFree(value); if(lang) xmlFree(lang); const string &PrintOptions::comma() const {if(comma_sign.empty()) return CALCULATOR->getComma(); return comma_sign;} const string &PrintOptions::decimalpoint() const {if(decimalpoint_sign.empty()) return CALCULATOR->getDecimalPoint(); return decimalpoint_sign;} /*#include #include struct timeval tvtime; long int usecs, secs, usecs2, usecs3; #define PRINT_TIME(x) gettimeofday(&tvtime, NULL); usecs2 = tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000; printf("%s %li\n", x, usecs2); #define PRINT_TIMEDIFF(x) gettimeofday(&tvtime, NULL); printf("%s %li\n", x, tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000 - usecs2); usecs2 = tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000; #define ADD_TIME1 gettimeofday(&tvtime, NULL); usecs2 = tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000; #define ADD_TIME2 gettimeofday(&tvtime, NULL); usecs3 += tvtime.tv_usec - usecs + (tvtime.tv_sec - secs) * 1000000 - usecs2; */ typedef void (*CREATEPLUG_PROC)(); PlotParameters::PlotParameters() { auto_y_min = true; auto_x_min = true; auto_y_max = true; auto_x_max = true; y_log = false; x_log = false; y_log_base = 10; x_log_base = 10; grid = false; color = true; linewidth = -1; show_all_borders = false; legend_placement = PLOT_LEGEND_TOP_RIGHT; } PlotDataParameters::PlotDataParameters() { yaxis2 = false; xaxis2 = false; style = PLOT_STYLE_LINES; smoothing = PLOT_SMOOTHING_NONE; test_continuous = false; } CalculatorMessage::CalculatorMessage(string message_, MessageType type_, int cat_, int stage_) { mtype = type_; i_stage = stage_; i_cat = cat_; smessage = message_; } CalculatorMessage::CalculatorMessage(const CalculatorMessage &e) { mtype = e.type(); i_stage = e.stage(); i_cat = e.category(); smessage = e.message(); } string CalculatorMessage::message() const { return smessage; } const char* CalculatorMessage::c_message() const { return smessage.c_str(); } MessageType CalculatorMessage::type() const { return mtype; } int CalculatorMessage::stage() const { return i_stage; } int CalculatorMessage::category() const { return i_cat; } void Calculator::addStringAlternative(string replacement, string standard) { signs.push_back(replacement); real_signs.push_back(standard); } bool Calculator::delStringAlternative(string replacement, string standard) { for(size_t i = 0; i < signs.size(); i++) { if(signs[i] == replacement && real_signs[i] == standard) { signs.erase(signs.begin() + i); real_signs.erase(real_signs.begin() + i); return true; } } return false; } void Calculator::addDefaultStringAlternative(string replacement, string standard) { default_signs.push_back(replacement); default_real_signs.push_back(standard); } bool Calculator::delDefaultStringAlternative(string replacement, string standard) { for(size_t i = 0; i < default_signs.size(); i++) { if(default_signs[i] == replacement && default_real_signs[i] == standard) { default_signs.erase(default_signs.begin() + i); default_real_signs.erase(default_real_signs.begin() + i); return true; } } return false; } Calculator *calculator = NULL; MathStructure m_undefined, m_empty_vector, m_empty_matrix, m_zero, m_one, m_minus_one, m_one_i; Number nr_zero, nr_one, nr_two, nr_three, nr_minus_one, nr_one_i, nr_minus_i, nr_half, nr_minus_half, nr_plus_inf, nr_minus_inf; EvaluationOptions no_evaluation; ExpressionName empty_expression_name; extern gmp_randstate_t randstate; #ifdef HAVE_ICU extern UCaseMap *ucm; #endif enum { PROC_RPN_ADD, PROC_RPN_SET, PROC_RPN_OPERATION_1, PROC_RPN_OPERATION_2, PROC_RPN_OPERATION_F, PROC_NO_COMMAND }; class CalculateThread : public Thread { protected: virtual void run(); }; void autoConvert(const MathStructure &morig, MathStructure &mconv, const EvaluationOptions &eo) { if(!morig.containsType(STRUCT_UNIT, true)) { if(&mconv != &morig) mconv.set(morig); return; } switch(eo.auto_post_conversion) { case POST_CONVERSION_OPTIMAL: { mconv.set(CALCULATOR->convertToBestUnit(morig, eo, false)); break; } case POST_CONVERSION_BASE: { mconv.set(CALCULATOR->convertToBaseUnits(morig, eo)); break; } case POST_CONVERSION_OPTIMAL_SI: { mconv.set(CALCULATOR->convertToBestUnit(morig, eo, true)); break; } default: { if(&mconv != &morig) mconv.set(morig); } } if(eo.mixed_units_conversion != MIXED_UNITS_CONVERSION_NONE) mconv.set(CALCULATOR->convertToMixedUnits(mconv, eo)); } void CalculateThread::run() { enableAsynchronousCancel(); while(true) { bool b_parse = true; if(!read(&b_parse)) break; void *x = NULL; if(!read(&x) || !x) break; MathStructure *mstruct = (MathStructure*) x; CALCULATOR->startControl(); if(b_parse) { mstruct->setAborted(); if(CALCULATOR->tmp_parsedstruct) CALCULATOR->tmp_parsedstruct->setAborted(); //if(CALCULATOR->tmp_tostruct) CALCULATOR->tmp_tostruct->setUndefined(); mstruct->set(CALCULATOR->calculate(CALCULATOR->expression_to_calculate, CALCULATOR->tmp_evaluationoptions, CALCULATOR->tmp_parsedstruct, CALCULATOR->tmp_tostruct, CALCULATOR->tmp_maketodivision)); } else { MathStructure meval(*mstruct); mstruct->setAborted(); mstruct->set(CALCULATOR->calculate(meval, CALCULATOR->tmp_evaluationoptions)); } switch(CALCULATOR->tmp_proc_command) { case PROC_RPN_ADD: { CALCULATOR->RPNStackEnter(mstruct, false); break; } case PROC_RPN_SET: { CALCULATOR->setRPNRegister(CALCULATOR->tmp_rpnindex, mstruct, false); break; } case PROC_RPN_OPERATION_1: { if(CALCULATOR->RPNStackSize() > 0) { CALCULATOR->setRPNRegister(1, mstruct, false); } else { CALCULATOR->RPNStackEnter(mstruct, false); } break; } case PROC_RPN_OPERATION_2: { if(CALCULATOR->RPNStackSize() > 1) { CALCULATOR->deleteRPNRegister(1); } if(CALCULATOR->RPNStackSize() > 0) { CALCULATOR->setRPNRegister(1, mstruct, false); } else { CALCULATOR->RPNStackEnter(mstruct, false); } break; } case PROC_RPN_OPERATION_F: { for(size_t i = 0; (CALCULATOR->tmp_proc_registers < 0 || (int) i < CALCULATOR->tmp_proc_registers - 1) && CALCULATOR->RPNStackSize() > 1; i++) { CALCULATOR->deleteRPNRegister(1); } if(CALCULATOR->RPNStackSize() > 0 && CALCULATOR->tmp_proc_registers != 0) { CALCULATOR->setRPNRegister(1, mstruct, false); } else { CALCULATOR->RPNStackEnter(mstruct, false); } break; } case PROC_NO_COMMAND: {} } CALCULATOR->stopControl(); CALCULATOR->b_busy = false; } } class Calculator_p { public: unordered_map id_structs; unordered_map ids_p; vector freed_ids; size_t ids_i; }; Calculator::Calculator() { #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, getPackageLocaleDir().c_str()); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); #endif gmp_randinit_default(randstate); gmp_randseed_ui(randstate, (unsigned long int) time(NULL)); priv = new Calculator_p; setlocale(LC_ALL, ""); #ifdef HAVE_ICU UErrorCode err = U_ZERO_ERROR; ucm = ucasemap_open(NULL, 0, &err); #endif srand(time(NULL)); exchange_rates_time[0] = 0; exchange_rates_time[1] = 0; exchange_rates_time[2] = 0; exchange_rates_check_time[0] = 0; exchange_rates_check_time[1] = 0; exchange_rates_check_time[2] = 0; b_exchange_rates_warning_enabled = true; b_exchange_rates_used = 0; i_aborted = 0; b_controlled = false; i_timeout = 0; setPrecision(DEFAULT_PRECISION); b_interval = false; i_stop_interval = 0; b_var_units = true; addStringAlternative(SIGN_POWER_0, "^(0)"); addStringAlternative(SIGN_POWER_1, "^(1)"); addStringAlternative(SIGN_POWER_2, "^(2)"); addStringAlternative(SIGN_POWER_3, "^(3)"); addStringAlternative(SIGN_POWER_4, "^(4)"); addStringAlternative(SIGN_POWER_5, "^(5)"); addStringAlternative(SIGN_POWER_6, "^(6)"); addStringAlternative(SIGN_POWER_7, "^(7)"); addStringAlternative(SIGN_POWER_8, "^(8)"); addStringAlternative(SIGN_POWER_9, "^(9)"); //addStringAlternative(SIGN_INFINITY, "infinity"); addStringAlternative(SIGN_DIVISION, DIVISION); addStringAlternative(SIGN_DIVISION_SLASH, DIVISION); addStringAlternative(SIGN_MULTIPLICATION, MULTIPLICATION); addStringAlternative(SIGN_MULTIDOT, MULTIPLICATION); addStringAlternative(SIGN_MIDDLEDOT, MULTIPLICATION); addStringAlternative(SIGN_MULTIBULLET, MULTIPLICATION); addStringAlternative(SIGN_SMALLCIRCLE, MULTIPLICATION); addStringAlternative(SIGN_MINUS, MINUS); addStringAlternative("–", MINUS); addStringAlternative(SIGN_PLUS, PLUS); addStringAlternative(SIGN_NOT_EQUAL, " " NOT EQUALS); addStringAlternative(SIGN_GREATER_OR_EQUAL, GREATER EQUALS); addStringAlternative(SIGN_LESS_OR_EQUAL, LESS EQUALS); addStringAlternative(";", COMMA); addStringAlternative("\t", SPACE); addStringAlternative("\n", SPACE); addStringAlternative(" ", SPACE); addStringAlternative("**", POWER); addStringAlternative("↊", "X"); addStringAlternative("↋", "E"); per_str = _("per"); per_str_len = per_str.length(); times_str = _("times"); times_str_len = times_str.length(); plus_str = _("plus"); plus_str_len = plus_str.length(); minus_str = _("minus"); minus_str_len = minus_str.length(); and_str = _("and"); and_str_len = and_str.length(); AND_str = "AND"; AND_str_len = AND_str.length(); or_str = _("or"); or_str_len = or_str.length(); OR_str = "OR"; OR_str_len = OR_str.length(); XOR_str = "XOR"; XOR_str_len = OR_str.length(); char *current_lc_numeric = setlocale(LC_NUMERIC, ""); if(current_lc_numeric) saved_locale = strdup(current_lc_numeric); else saved_locale = NULL; struct lconv *lc = localeconv(); if(!lc) { setlocale(LC_NUMERIC, "C"); lc = localeconv(); } #ifdef HAVE_STRUCT_LCONV_INT_N_CS_PRECEDES place_currency_code_before = lc->int_p_cs_precedes; #else place_currency_code_before = 1; #endif #ifdef HAVE_STRUCT_LCONV_INT_P_CS_PRECEDES place_currency_code_before_negative = lc->int_n_cs_precedes; #else place_currency_code_before_negative = 1; #endif place_currency_sign_before = lc->p_cs_precedes; place_currency_sign_before_negative = lc->n_cs_precedes; local_digit_group_separator = lc->thousands_sep; local_digit_group_format = lc->grouping; remove_blank_ends(local_digit_group_format); default_dot_as_separator = (local_digit_group_separator == "."); if(strcmp(lc->decimal_point, ",") == 0) { DOT_STR = ","; DOT_S = ".,"; COMMA_STR = ";"; COMMA_S = ";"; } else { DOT_STR = "."; DOT_S = "."; COMMA_STR = ","; COMMA_S = ",;"; } setlocale(LC_NUMERIC, "C"); NAME_NUMBER_PRE_S = "_#"; NAME_NUMBER_PRE_STR = "_"; string str = _(" to "); local_to = (str != " to "); priv->ids_i = 0; decimal_null_prefix = new DecimalPrefix(0, "", ""); binary_null_prefix = new BinaryPrefix(0, "", ""); m_undefined.setUndefined(); m_empty_vector.clearVector(); m_empty_matrix.clearMatrix(); m_zero.clear(); m_one.set(1, 1, 0); m_minus_one.set(-1, 1, 0); nr_zero.clear(); nr_one.set(1, 1, 0); nr_two.set(2, 1, 0); nr_three.set(3, 1, 0); nr_half.set(1, 2, 0); nr_minus_half.set(-1, 2, 0); nr_one_i.setImaginaryPart(1, 1, 0); nr_minus_i.setImaginaryPart(-1, 1, 0); m_one_i.set(nr_one_i); nr_minus_one.set(-1, 1, 0); nr_plus_inf.setPlusInfinity(); nr_minus_inf.setMinusInfinity(); no_evaluation.approximation = APPROXIMATION_EXACT; no_evaluation.structuring = STRUCTURING_NONE; no_evaluation.sync_units = false; save_printoptions.decimalpoint_sign = "."; save_printoptions.comma_sign = ","; save_printoptions.use_reference_names = true; save_printoptions.preserve_precision = true; save_printoptions.interval_display = INTERVAL_DISPLAY_INTERVAL; save_printoptions.use_reference_names = true; save_printoptions.limit_implicit_multiplication = true; save_printoptions.spacious = false; save_printoptions.number_fraction_format = FRACTION_FRACTIONAL; save_printoptions.short_multiplication = false; message_printoptions.interval_display = INTERVAL_DISPLAY_PLUSMINUS; message_printoptions.spell_out_logical_operators = true; message_printoptions.number_fraction_format = FRACTION_FRACTIONAL; default_assumptions = new Assumptions; default_assumptions->setType(ASSUMPTION_TYPE_REAL); default_assumptions->setSign(ASSUMPTION_SIGN_UNKNOWN); u_rad = NULL; u_gra = NULL; u_deg = NULL; b_save_called = false; ILLEGAL_IN_NAMES = DOT_S + RESERVED OPERATORS SPACES PARENTHESISS VECTOR_WRAPS COMMAS; ILLEGAL_IN_NAMES_MINUS_SPACE_STR = DOT_S + RESERVED OPERATORS PARENTHESISS VECTOR_WRAPS COMMAS; ILLEGAL_IN_UNITNAMES = ILLEGAL_IN_NAMES + NUMBERS; b_argument_errors = true; current_stage = MESSAGE_STAGE_UNSET; calculator = this; srand48(time(0)); addBuiltinVariables(); addBuiltinFunctions(); addBuiltinUnits(); disable_errors_ref = 0; b_busy = false; b_gnuplot_open = false; gnuplot_pipe = NULL; calculate_thread = new CalculateThread; } Calculator::~Calculator() { closeGnuplot(); abort(); terminateThreads(); delete priv; delete calculate_thread; gmp_randclear(randstate); #ifdef HAVE_ICU if(ucm) ucasemap_close(ucm); #endif } Unit *Calculator::getGraUnit() { if(!u_gra) u_gra = getUnit("gra"); if(!u_gra) { CALCULATOR->error(true, _("Gradians unit is missing. Creating one for this session."), NULL); u_gra = addUnit(new AliasUnit(_("Angle/Plane Angle"), "gra", "gradians", "gradian", "Gradian", getRadUnit(), "pi/200", 1, "", false, true, true)); } return u_gra; } Unit *Calculator::getRadUnit() { if(!u_rad) u_rad = getUnit("rad"); if(!u_rad) { CALCULATOR->error(true, _("Radians unit is missing. Creating one for this session."), NULL); u_rad = addUnit(new Unit(_("Angle/Plane Angle"), "rad", "radians", "radian", "Radian", false, true, true)); } return u_rad; } Unit *Calculator::getDegUnit() { if(!u_deg) u_deg = getUnit("deg"); if(!u_deg) { CALCULATOR->error(true, _("Degrees unit is missing. Creating one for this session."), NULL); u_deg = addUnit(new AliasUnit(_("Angle/Plane Angle"), "deg", "degrees", "degree", "Degree", getRadUnit(), "pi/180", 1, "", false, true, true)); } return u_deg; } bool Calculator::utf8_pos_is_valid_in_name(char *pos) { if(is_in(ILLEGAL_IN_NAMES, pos[0])) { return false; } if((unsigned char) pos[0] >= 0xC0) { string str; str += pos[0]; while((unsigned char) pos[1] >= 0x80 && (unsigned char) pos[1] < 0xC0) { str += pos[1]; pos++; } return str != SIGN_DIVISION && str != SIGN_DIVISION_SLASH && str != SIGN_MULTIPLICATION && str != SIGN_MULTIDOT && str != SIGN_SMALLCIRCLE && str != SIGN_MULTIBULLET && str != SIGN_MINUS && str != SIGN_PLUS && str != SIGN_NOT_EQUAL && str != SIGN_GREATER_OR_EQUAL && str != SIGN_LESS_OR_EQUAL; } return true; } bool Calculator::showArgumentErrors() const { return b_argument_errors; } void Calculator::beginTemporaryStopMessages() { disable_errors_ref++; stopped_errors_count.push_back(0); stopped_warnings_count.push_back(0); stopped_messages_count.push_back(0); vector vcm; stopped_messages.push_back(vcm); } int Calculator::endTemporaryStopMessages(int *message_count, int *warning_count, int release_messages_if_no_equal_or_greater_than_message_type) { if(disable_errors_ref <= 0) return -1; disable_errors_ref--; int ret = stopped_errors_count[disable_errors_ref]; bool release_messages = false; if(release_messages_if_no_equal_or_greater_than_message_type >= MESSAGE_INFORMATION) { if(ret > 0) release_messages = true; if(release_messages_if_no_equal_or_greater_than_message_type == MESSAGE_WARNING && stopped_warnings_count[disable_errors_ref] > 0) release_messages = true; else if(release_messages_if_no_equal_or_greater_than_message_type == MESSAGE_INFORMATION && stopped_messages_count[disable_errors_ref] > 0) release_messages = true; } if(message_count) *message_count = stopped_messages_count[disable_errors_ref]; if(warning_count) *warning_count = stopped_warnings_count[disable_errors_ref]; stopped_errors_count.pop_back(); stopped_warnings_count.pop_back(); stopped_messages_count.pop_back(); if(release_messages) addMessages(&stopped_messages[disable_errors_ref]); stopped_messages.pop_back(); return ret; } void Calculator::endTemporaryStopMessages(bool release_messages, vector *blocked_messages) { if(disable_errors_ref <= 0) return; disable_errors_ref--; stopped_errors_count.pop_back(); stopped_warnings_count.pop_back(); stopped_messages_count.pop_back(); if(blocked_messages) *blocked_messages = stopped_messages[disable_errors_ref]; if(release_messages) addMessages(&stopped_messages[disable_errors_ref]); stopped_messages.pop_back(); } void Calculator::addMessages(vector *message_vector) { for(size_t i3 = 0; i3 < message_vector->size(); i3++) { string error_str = (*message_vector)[i3].message(); bool dup_error = false; for(size_t i = 0; i < messages.size(); i++) { if(error_str == messages[i].message()) { dup_error = true; break; } } if(!dup_error) { if(disable_errors_ref > 0) { for(size_t i2 = 0; !dup_error && i2 < (size_t) disable_errors_ref; i2++) { for(size_t i = 0; i < stopped_messages[i2].size(); i++) { if(error_str == stopped_messages[i2][i].message()) { dup_error = true; break; } } } if(!dup_error) stopped_messages[disable_errors_ref - 1].push_back((*message_vector)[i3]); } else { messages.push_back((*message_vector)[i3]); } } } } const PrintOptions &Calculator::messagePrintOptions() const {return message_printoptions;} void Calculator::setMessagePrintOptions(const PrintOptions &po) {message_printoptions = po;} Variable *Calculator::getVariable(size_t index) const { if(index < variables.size()) { return variables[index]; } return NULL; } bool Calculator::hasVariable(Variable *v) { for(size_t i = 0; i < variables.size(); i++) { if(variables[i] == v) return true; } return false; } bool Calculator::hasUnit(Unit *u) { for(size_t i = 0; i < units.size(); i++) { if(units[i] == u) return true; } return false; } bool Calculator::hasFunction(MathFunction *f) { for(size_t i = 0; i < functions.size(); i++) { if(functions[i] == f) return true; } return false; } bool Calculator::stillHasVariable(Variable *v) { for(vector::iterator it = deleted_variables.begin(); it != deleted_variables.end(); ++it) { if(*it == v) return false; } return true; } bool Calculator::stillHasUnit(Unit *u) { for(vector::iterator it = deleted_units.begin(); it != deleted_units.end(); ++it) { if(*it == u) return false; } return true; } bool Calculator::stillHasFunction(MathFunction *f) { for(vector::iterator it = deleted_functions.begin(); it != deleted_functions.end(); ++it) { if(*it == f) return false; } return true; } void Calculator::saveFunctionCalled() { b_save_called = true; } bool Calculator::checkSaveFunctionCalled() { if(b_save_called) { b_save_called = false; return true; } return false; } ExpressionItem *Calculator::getActiveExpressionItem(ExpressionItem *item) { if(!item) return NULL; for(size_t i = 1; i <= item->countNames(); i++) { ExpressionItem *item2 = getActiveExpressionItem(item->getName(i).name, item); if(item2) { return item2; } } return NULL; } ExpressionItem *Calculator::getActiveExpressionItem(string name, ExpressionItem *item) { if(name.empty()) return NULL; for(size_t index = 0; index < variables.size(); index++) { if(variables[index] != item && variables[index]->isActive() && variables[index]->hasName(name)) { return variables[index]; } } for(size_t index = 0; index < functions.size(); index++) { if(functions[index] != item && functions[index]->isActive() && functions[index]->hasName(name)) { return functions[index]; } } for(size_t i = 0; i < units.size(); i++) { if(units[i] != item && units[i]->isActive() && units[i]->hasName(name)) { return units[i]; } } return NULL; } ExpressionItem *Calculator::getInactiveExpressionItem(string name, ExpressionItem *item) { if(name.empty()) return NULL; for(size_t index = 0; index < variables.size(); index++) { if(variables[index] != item && !variables[index]->isActive() && variables[index]->hasName(name)) { return variables[index]; } } for(size_t index = 0; index < functions.size(); index++) { if(functions[index] != item && !functions[index]->isActive() && functions[index]->hasName(name)) { return functions[index]; } } for(size_t i = 0; i < units.size(); i++) { if(units[i] != item && !units[i]->isActive() && units[i]->hasName(name)) { return units[i]; } } return NULL; } ExpressionItem *Calculator::getExpressionItem(string name, ExpressionItem *item) { if(name.empty()) return NULL; Variable *v = getVariable(name); if(v && v != item) return v; MathFunction *f = getFunction(name); if(f && f != item) return f; Unit *u = getUnit(name); if(u && u != item) return u; u = getCompositeUnit(name); if(u && u != item) return u; return NULL; } Unit *Calculator::getUnit(size_t index) const { if(index < units.size()) { return units[index]; } return NULL; } MathFunction *Calculator::getFunction(size_t index) const { if(index < functions.size()) { return functions[index]; } return NULL; } void Calculator::setDefaultAssumptions(Assumptions *ass) { if(default_assumptions) delete default_assumptions; default_assumptions = ass; } Assumptions *Calculator::defaultAssumptions() { return default_assumptions; } Prefix *Calculator::getPrefix(size_t index) const { if(index < prefixes.size()) { return prefixes[index]; } return NULL; } Prefix *Calculator::getPrefix(string name_) const { for(size_t i = 0; i < prefixes.size(); i++) { if(prefixes[i]->shortName(false) == name_ || prefixes[i]->longName(false) == name_ || prefixes[i]->unicodeName(false) == name_) { return prefixes[i]; } } return NULL; } DecimalPrefix *Calculator::getExactDecimalPrefix(int exp10, int exp) const { for(size_t i = 0; i < decimal_prefixes.size(); i++) { if(decimal_prefixes[i]->exponent(exp) == exp10) { return decimal_prefixes[i]; } else if(decimal_prefixes[i]->exponent(exp) > exp10) { break; } } return NULL; } BinaryPrefix *Calculator::getExactBinaryPrefix(int exp2, int exp) const { for(size_t i = 0; i < binary_prefixes.size(); i++) { if(binary_prefixes[i]->exponent(exp) == exp2) { return binary_prefixes[i]; } else if(binary_prefixes[i]->exponent(exp) > exp2) { break; } } return NULL; } Prefix *Calculator::getExactPrefix(const Number &o, int exp) const { ComparisonResult c; for(size_t i = 0; i < prefixes.size(); i++) { c = o.compare(prefixes[i]->value(exp)); if(c == COMPARISON_RESULT_EQUAL) { return prefixes[i]; } else if(c == COMPARISON_RESULT_GREATER) { break; } } return NULL; } DecimalPrefix *Calculator::getNearestDecimalPrefix(int exp10, int exp) const { if(decimal_prefixes.size() <= 0) return NULL; int i = 0; if(exp < 0) { i = decimal_prefixes.size() - 1; } while((exp < 0 && i >= 0) || (exp >= 0 && i < (int) decimal_prefixes.size())) { if(decimal_prefixes[i]->exponent(exp) == exp10) { return decimal_prefixes[i]; } else if(decimal_prefixes[i]->exponent(exp) > exp10) { if(i == 0) { return decimal_prefixes[i]; } else if(exp10 - decimal_prefixes[i - 1]->exponent(exp) < decimal_prefixes[i]->exponent(exp) - exp10) { return decimal_prefixes[i - 1]; } else { return decimal_prefixes[i]; } } if(exp < 0) { i--; } else { i++; } } return decimal_prefixes[decimal_prefixes.size() - 1]; } DecimalPrefix *Calculator::getBestDecimalPrefix(int exp10, int exp, bool all_prefixes) const { if(decimal_prefixes.size() <= 0 || exp10 == 0) return NULL; int i = 0; if(exp < 0) { i = decimal_prefixes.size() - 1; } DecimalPrefix *p = NULL, *p_prev = NULL; int exp10_1, exp10_2; while((exp < 0 && i >= 0) || (exp >= 0 && i < (int) decimal_prefixes.size())) { if(all_prefixes || decimal_prefixes[i]->exponent() % 3 == 0) { p = decimal_prefixes[i]; if(p_prev && (p_prev->exponent() >= 0) != (p->exponent() >= 0) && p_prev->exponent() != 0) { if(exp < 0) { i++; } else { i--; } p = decimal_null_prefix; } if(p->exponent(exp) == exp10) { if(p == decimal_null_prefix) return NULL; return p; } else if(p->exponent(exp) > exp10) { if(i == 0) { if(p == decimal_null_prefix) return NULL; return p; } exp10_1 = exp10; if(p_prev) { exp10_1 -= p_prev->exponent(exp); } exp10_2 = p->exponent(exp); exp10_2 -= exp10; exp10_2 *= 2; exp10_2 += 2; if(exp10_1 < exp10_2) { if(p_prev == decimal_null_prefix) return NULL; return p_prev; } else { return p; } } p_prev = p; } if(exp < 0) { i--; } else { i++; } } return p_prev; } DecimalPrefix *Calculator::getBestDecimalPrefix(const Number &exp10, const Number &exp, bool all_prefixes) const { if(decimal_prefixes.size() <= 0 || exp10.isZero()) return NULL; int i = 0; ComparisonResult c; if(exp.isNegative()) { i = decimal_prefixes.size() - 1; } DecimalPrefix *p = NULL, *p_prev = NULL; Number exp10_1, exp10_2; while((exp.isNegative() && i >= 0) || (!exp.isNegative() && i < (int) decimal_prefixes.size())) { if(all_prefixes || decimal_prefixes[i]->exponent() % 3 == 0) { p = decimal_prefixes[i]; if(p_prev && (p_prev->exponent() >= 0) != (p->exponent() >= 0) && p_prev->exponent() != 0) { if(exp.isNegative()) { i++; } else { i--; } p = decimal_null_prefix; } c = exp10.compare(p->exponent(exp)); if(c == COMPARISON_RESULT_EQUAL) { if(p == decimal_null_prefix) return NULL; return p; } else if(c == COMPARISON_RESULT_GREATER) { if(i == 0) { if(p == decimal_null_prefix) return NULL; return p; } exp10_1 = exp10; if(p_prev) { exp10_1 -= p_prev->exponent(exp); } exp10_2 = p->exponent(exp); exp10_2 -= exp10; exp10_2 *= 2; exp10_2 += 2; if(exp10_1.isLessThan(exp10_2)) { if(p_prev == decimal_null_prefix) return NULL; return p_prev; } else { return p; } } p_prev = p; } if(exp.isNegative()) { i--; } else { i++; } } return p_prev; } BinaryPrefix *Calculator::getNearestBinaryPrefix(int exp2, int exp) const { if(binary_prefixes.size() <= 0) return NULL; int i = 0; if(exp < 0) { i = binary_prefixes.size() - 1; } while((exp < 0 && i >= 0) || (exp >= 0 && i < (int) binary_prefixes.size())) { if(binary_prefixes[i]->exponent(exp) == exp2) { return binary_prefixes[i]; } else if(binary_prefixes[i]->exponent(exp) > exp2) { if(i == 0) { return binary_prefixes[i]; } else if(exp2 - binary_prefixes[i - 1]->exponent(exp) < binary_prefixes[i]->exponent(exp) - exp2) { return binary_prefixes[i - 1]; } else { return binary_prefixes[i]; } } if(exp < 0) { i--; } else { i++; } } return binary_prefixes[binary_prefixes.size() - 1]; } BinaryPrefix *Calculator::getBestBinaryPrefix(int exp2, int exp) const { if(binary_prefixes.size() <= 0 || exp2 == 0) return NULL; int i = 0; if(exp < 0) { i = binary_prefixes.size() - 1; } BinaryPrefix *p = NULL, *p_prev = NULL; int exp2_1, exp2_2; while((exp < 0 && i >= 0) || (exp >= 0 && i < (int) binary_prefixes.size())) { p = binary_prefixes[i]; if(p_prev && (p_prev->exponent() >= 0) != (p->exponent() >= 0) && p_prev->exponent() != 0) { if(exp < 0) { i++; } else { i--; } p = binary_null_prefix; } if(p->exponent(exp) == exp2) { if(p == binary_null_prefix) return NULL; return p; } else if(p->exponent(exp) > exp2) { if(i == 0) { if(p == binary_null_prefix) return NULL; return p; } exp2_1 = exp2; if(p_prev) { exp2_1 -= p_prev->exponent(exp); } exp2_2 = p->exponent(exp); exp2_2 -= exp2; exp2_2 *= 2; exp2_2 += 2; if(exp2_1 < exp2_2) { if(p_prev == binary_null_prefix) return NULL; return p_prev; } else { return p; } } p_prev = p; if(exp < 0) { i--; } else { i++; } } return p_prev; } BinaryPrefix *Calculator::getBestBinaryPrefix(const Number &exp2, const Number &exp) const { if(binary_prefixes.size() <= 0 || exp2.isZero()) return NULL; int i = 0; ComparisonResult c; if(exp.isNegative()) { i = binary_prefixes.size() - 1; } BinaryPrefix *p = NULL, *p_prev = NULL; Number exp2_1, exp2_2; while((exp.isNegative() && i >= 0) || (!exp.isNegative() && i < (int) binary_prefixes.size())) { p = binary_prefixes[i]; if(p_prev && (p_prev->exponent() >= 0) != (p->exponent() >= 0) && p_prev->exponent() != 0) { if(exp.isNegative()) { i++; } else { i--; } p = binary_null_prefix; } c = exp2.compare(p->exponent(exp)); if(c == COMPARISON_RESULT_EQUAL) { if(p == binary_null_prefix) return NULL; return p; } else if(c == COMPARISON_RESULT_GREATER) { if(i == 0) { if(p == binary_null_prefix) return NULL; return p; } exp2_1 = exp2; if(p_prev) { exp2_1 -= p_prev->exponent(exp); } exp2_2 = p->exponent(exp); exp2_2 -= exp2; exp2_2 *= 2; exp2_2 += 2; if(exp2_1.isLessThan(exp2_2)) { if(p_prev == binary_null_prefix) return NULL; return p_prev; } else { return p; } } p_prev = p; if(exp.isNegative()) { i--; } else { i++; } } return p_prev; } Prefix *Calculator::addPrefix(Prefix *p) { if(p->type() == PREFIX_DECIMAL) { decimal_prefixes.push_back((DecimalPrefix*) p); } else if(p->type() == PREFIX_BINARY) { binary_prefixes.push_back((BinaryPrefix*) p); } prefixes.push_back(p); prefixNameChanged(p, true); return p; } void Calculator::prefixNameChanged(Prefix *p, bool new_item) { size_t l2; if(!new_item) delPrefixUFV(p); if(!p->longName(false).empty()) { l2 = p->longName(false).length(); if(l2 > UFV_LENGTHS) { size_t i = 0, l; for(vector::iterator it = ufvl.begin(); ; ++it) { l = 0; if(it != ufvl.end()) { if(ufvl_t[i] == 'v') l = ((Variable*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'f') l = ((MathFunction*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'u') l = ((Unit*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'p') l = ((Prefix*) (*it))->shortName(false).length(); else if(ufvl_t[i] == 'P') l = ((Prefix*) (*it))->longName(false).length(); else if(ufvl_t[i] == 'q') l = ((Prefix*) (*it))->unicodeName(false).length(); } if(it == ufvl.end()) { ufvl.push_back((void*) p); ufvl_t.push_back('P'); ufvl_i.push_back(1); break; } else if(l <= l2) { ufvl.insert(it, (void*) p); ufvl_t.insert(ufvl_t.begin() + i, 'P'); ufvl_i.insert(ufvl_i.begin() + i, 1); break; } i++; } } else if(l2 > 0) { l2--; ufv[0][l2].push_back((void*) p); ufv_i[0][l2].push_back(1); } } if(!p->shortName(false).empty()) { l2 = p->shortName(false).length(); if(l2 > UFV_LENGTHS) { size_t i = 0, l; for(vector::iterator it = ufvl.begin(); ; ++it) { l = 0; if(it != ufvl.end()) { if(ufvl_t[i] == 'v') l = ((Variable*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'f') l = ((MathFunction*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'u') l = ((Unit*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'p') l = ((Prefix*) (*it))->shortName(false).length(); else if(ufvl_t[i] == 'P') l = ((Prefix*) (*it))->longName(false).length(); else if(ufvl_t[i] == 'q') l = ((Prefix*) (*it))->unicodeName(false).length(); } if(it == ufvl.end()) { ufvl.push_back((void*) p); ufvl_t.push_back('p'); ufvl_i.push_back(1); break; } else if(l <= l2) { ufvl.insert(it, (void*) p); ufvl_t.insert(ufvl_t.begin() + i, 'p'); ufvl_i.insert(ufvl_i.begin() + i, 1); break; } i++; } } else if(l2 > 0) { l2--; ufv[0][l2].push_back((void*) p); ufv_i[0][l2].push_back(2); } } if(!p->unicodeName(false).empty()) { l2 = p->unicodeName(false).length(); if(l2 > UFV_LENGTHS) { size_t i = 0, l; for(vector::iterator it = ufvl.begin(); ; ++it) { l = 0; if(it != ufvl.end()) { if(ufvl_t[i] == 'v') l = ((Variable*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'f') l = ((MathFunction*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'u') l = ((Unit*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'p') l = ((Prefix*) (*it))->shortName(false).length(); else if(ufvl_t[i] == 'P') l = ((Prefix*) (*it))->longName(false).length(); else if(ufvl_t[i] == 'q') l = ((Prefix*) (*it))->unicodeName(false).length(); } if(it == ufvl.end()) { ufvl.push_back((void*) p); ufvl_t.push_back('q'); ufvl_i.push_back(1); break; } else if(l <= l2) { ufvl.insert(it, (void*) p); ufvl_t.insert(ufvl_t.begin() + i, 'q'); ufvl_i.insert(ufvl_i.begin() + i, 1); break; } i++; } } else if(l2 > 0) { l2--; ufv[0][l2].push_back((void*) p); ufv_i[0][l2].push_back(3); } } } #define PRECISION_TO_BITS(p) (((p) * 3.322) + 100) void Calculator::setPrecision(int precision) { if(precision <= 0) precision = DEFAULT_PRECISION; i_precision = precision; mpfr_set_default_prec(PRECISION_TO_BITS(i_precision)); } int Calculator::getPrecision() const { return i_precision; } void Calculator::useIntervalArithmetic(bool use_interval_arithmetic) {b_interval = use_interval_arithmetic;} bool Calculator::usesIntervalArithmetic() const {return i_start_interval > 0 || (b_interval && i_stop_interval <= 0);} void Calculator::beginTemporaryStopIntervalArithmetic() { i_stop_interval++; } void Calculator::endTemporaryStopIntervalArithmetic() { i_stop_interval--; } void Calculator::beginTemporaryEnableIntervalArithmetic() { i_start_interval++; } void Calculator::endTemporaryEnableIntervalArithmetic() { i_start_interval--; } const string &Calculator::getDecimalPoint() const {return DOT_STR;} const string &Calculator::getComma() const {return COMMA_STR;} string Calculator::localToString(bool include_spaces) const { if(include_spaces) return _(" to "); else return _("to"); } void Calculator::setLocale() { if(saved_locale) setlocale(LC_NUMERIC, saved_locale); lconv *locale = localeconv(); if(strcmp(locale->decimal_point, ",") == 0) { DOT_STR = ","; DOT_S = ".,"; COMMA_STR = ";"; COMMA_S = ";"; } else { DOT_STR = "."; DOT_S = "."; COMMA_STR = ","; COMMA_S = ",;"; } setlocale(LC_NUMERIC, "C"); } void Calculator::useDecimalComma() { DOT_STR = ","; DOT_S = ".,"; COMMA_STR = ";"; COMMA_S = ";"; } void Calculator::useDecimalPoint(bool use_comma_as_separator) { DOT_STR = "."; DOT_S = "."; if(use_comma_as_separator) { COMMA_STR = ";"; COMMA_S = ";"; } else { COMMA_STR = ","; COMMA_S = ",;"; } } void Calculator::unsetLocale() { COMMA_STR = ","; COMMA_S = ",;"; DOT_STR = "."; DOT_S = "."; } size_t Calculator::addId(MathStructure *mstruct, bool persistent) { size_t id = 0; if(priv->freed_ids.size() > 0) { id = priv->freed_ids.back(); priv->freed_ids.pop_back(); } else { priv->ids_i++; id = priv->ids_i; } priv->ids_p[id] = persistent; priv->id_structs[id] = mstruct; return id; } size_t Calculator::parseAddId(MathFunction *f, const string &str, const ParseOptions &po, bool persistent) { size_t id = 0; if(priv->freed_ids.size() > 0) { id = priv->freed_ids.back(); priv->freed_ids.pop_back(); } else { priv->ids_i++; id = priv->ids_i; } priv->ids_p[id] = persistent; priv->id_structs[id] = new MathStructure(); f->parse(*priv->id_structs[id], str, po); return id; } size_t Calculator::parseAddIdAppend(MathFunction *f, const MathStructure &append_mstruct, const string &str, const ParseOptions &po, bool persistent) { size_t id = 0; if(priv->freed_ids.size() > 0) { id = priv->freed_ids.back(); priv->freed_ids.pop_back(); } else { priv->ids_i++; id = priv->ids_i; } priv->ids_p[id] = persistent; priv->id_structs[id] = new MathStructure(); f->parse(*priv->id_structs[id], str, po); priv->id_structs[id]->addChild(append_mstruct); return id; } size_t Calculator::parseAddVectorId(const string &str, const ParseOptions &po, bool persistent) { size_t id = 0; if(priv->freed_ids.size() > 0) { id = priv->freed_ids.back(); priv->freed_ids.pop_back(); } else { priv->ids_i++; id = priv->ids_i; } priv->ids_p[id] = persistent; priv->id_structs[id] = new MathStructure(); f_vector->args(str, *priv->id_structs[id], po); return id; } MathStructure *Calculator::getId(size_t id) { if(priv->id_structs.find(id) != priv->id_structs.end()) { if(priv->ids_p[id]) { return new MathStructure(*priv->id_structs[id]); } else { MathStructure *mstruct = priv->id_structs[id]; priv->freed_ids.push_back(id); priv->id_structs.erase(id); priv->ids_p.erase(id); return mstruct; } } return NULL; } void Calculator::delId(size_t id) { if(priv->ids_p.find(id) != priv->ids_p.end()) { priv->freed_ids.push_back(id); priv->id_structs[id]->unref(); priv->id_structs.erase(id); priv->ids_p.erase(id); } } void Calculator::resetVariables() { variables.clear(); addBuiltinVariables(); } void Calculator::resetFunctions() { functions.clear(); addBuiltinFunctions(); } void Calculator::resetUnits() { units.clear(); addBuiltinUnits(); } void Calculator::reset() { resetVariables(); resetFunctions(); resetUnits(); } void Calculator::addBuiltinVariables() { v_e = (KnownVariable*) addVariable(new EVariable()); v_pi = (KnownVariable*) addVariable(new PiVariable()); Number nr(1, 1); MathStructure mstruct; mstruct.number().setImaginaryPart(nr); v_i = (KnownVariable*) addVariable(new KnownVariable("", "i", mstruct, "Imaginary i (sqrt(-1))", false, true)); mstruct.number().setPlusInfinity(); v_pinf = (KnownVariable*) addVariable(new KnownVariable("", "plus_infinity", mstruct, "+Infinity", false, true)); mstruct.number().setMinusInfinity(); v_minf = (KnownVariable*) addVariable(new KnownVariable("", "minus_infinity", mstruct, "-Infinity", false, true)); mstruct.setUndefined(); v_undef = (KnownVariable*) addVariable(new KnownVariable("", "undefined", mstruct, "Undefined", false, true)); v_euler = (KnownVariable*) addVariable(new EulerVariable()); v_catalan = (KnownVariable*) addVariable(new CatalanVariable()); v_precision = (KnownVariable*) addVariable(new PrecisionVariable()); v_percent = (KnownVariable*) addVariable(new KnownVariable("", "%", MathStructure(1, 1, -2), "Percent", false, true)); v_permille = (KnownVariable*) addVariable(new KnownVariable("", "permille", MathStructure(1, 1, -3), "Per Mille", false, true)); v_permyriad = (KnownVariable*) addVariable(new KnownVariable("", "permyriad", MathStructure(1, 1, -4), "Per Myriad", false, true)); v_x = (UnknownVariable*) addVariable(new UnknownVariable("", "x", "", true, false)); v_y = (UnknownVariable*) addVariable(new UnknownVariable("", "y", "", true, false)); v_z = (UnknownVariable*) addVariable(new UnknownVariable("", "z", "", true, false)); v_C = new UnknownVariable("", "C", "", false, true); v_C->setAssumptions(new Assumptions()); v_n = (UnknownVariable*) addVariable(new UnknownVariable("", "n", "", false, true)); v_n->setAssumptions(new Assumptions()); v_n->assumptions()->setType(ASSUMPTION_TYPE_INTEGER); v_today = (KnownVariable*) addVariable(new TodayVariable()); v_yesterday = (KnownVariable*) addVariable(new YesterdayVariable()); v_tomorrow = (KnownVariable*) addVariable(new TomorrowVariable()); v_now = (KnownVariable*) addVariable(new NowVariable()); } void Calculator::addBuiltinFunctions() { f_vector = addFunction(new VectorFunction()); f_sort = addFunction(new SortFunction()); f_rank = addFunction(new RankFunction()); f_limits = addFunction(new LimitsFunction()); //f_component = addFunction(new ComponentFunction()); f_dimension = addFunction(new DimensionFunction()); f_merge_vectors = addFunction(new MergeVectorsFunction()); f_matrix = addFunction(new MatrixFunction()); f_matrix_to_vector = addFunction(new MatrixToVectorFunction()); f_area = addFunction(new AreaFunction()); f_rows = addFunction(new RowsFunction()); f_columns = addFunction(new ColumnsFunction()); f_row = addFunction(new RowFunction()); f_column = addFunction(new ColumnFunction()); f_elements = addFunction(new ElementsFunction()); f_element = addFunction(new ElementFunction()); f_transpose = addFunction(new TransposeFunction()); f_identity = addFunction(new IdentityFunction()); f_determinant = addFunction(new DeterminantFunction()); f_permanent = addFunction(new PermanentFunction()); f_adjoint = addFunction(new AdjointFunction()); f_cofactor = addFunction(new CofactorFunction()); f_inverse = addFunction(new InverseFunction()); f_magnitude = addFunction(new MagnitudeFunction()); f_hadamard = addFunction(new HadamardFunction()); f_entrywise = addFunction(new EntrywiseFunction()); f_factorial = addFunction(new FactorialFunction()); f_factorial2 = addFunction(new DoubleFactorialFunction()); f_multifactorial = addFunction(new MultiFactorialFunction()); f_binomial = addFunction(new BinomialFunction()); f_xor = addFunction(new XorFunction()); f_bitxor = addFunction(new BitXorFunction()); f_even = addFunction(new EvenFunction()); f_odd = addFunction(new OddFunction()); f_shift = addFunction(new ShiftFunction()); f_bitcmp = addFunction(new BitCmpFunction()); f_abs = addFunction(new AbsFunction()); f_signum = addFunction(new SignumFunction()); f_heaviside = addFunction(new HeavisideFunction()); f_dirac = addFunction(new DiracFunction()); f_gcd = addFunction(new GcdFunction()); f_lcm = addFunction(new LcmFunction()); f_round = addFunction(new RoundFunction()); f_floor = addFunction(new FloorFunction()); f_ceil = addFunction(new CeilFunction()); f_trunc = addFunction(new TruncFunction()); f_int = addFunction(new IntFunction()); f_frac = addFunction(new FracFunction()); f_rem = addFunction(new RemFunction()); f_mod = addFunction(new ModFunction()); f_polynomial_unit = addFunction(new PolynomialUnitFunction()); f_polynomial_primpart = addFunction(new PolynomialPrimpartFunction()); f_polynomial_content = addFunction(new PolynomialContentFunction()); f_coeff = addFunction(new CoeffFunction()); f_lcoeff = addFunction(new LCoeffFunction()); f_tcoeff = addFunction(new TCoeffFunction()); f_degree = addFunction(new DegreeFunction()); f_ldegree = addFunction(new LDegreeFunction()); f_re = addFunction(new ReFunction()); f_im = addFunction(new ImFunction()); f_arg = addFunction(new ArgFunction()); f_numerator = addFunction(new NumeratorFunction()); f_denominator = addFunction(new DenominatorFunction()); f_interval = addFunction(new IntervalFunction()); f_sqrt = addFunction(new SqrtFunction()); f_cbrt = addFunction(new CbrtFunction()); f_root = addFunction(new RootFunction()); f_sq = addFunction(new SquareFunction()); f_exp = addFunction(new ExpFunction()); f_ln = addFunction(new LogFunction()); f_logn = addFunction(new LognFunction()); f_lambert_w = addFunction(new LambertWFunction()); f_sin = addFunction(new SinFunction()); f_cos = addFunction(new CosFunction()); f_tan = addFunction(new TanFunction()); f_asin = addFunction(new AsinFunction()); f_acos = addFunction(new AcosFunction()); f_atan = addFunction(new AtanFunction()); f_sinh = addFunction(new SinhFunction()); f_cosh = addFunction(new CoshFunction()); f_tanh = addFunction(new TanhFunction()); f_asinh = addFunction(new AsinhFunction()); f_acosh = addFunction(new AcoshFunction()); f_atanh = addFunction(new AtanhFunction()); f_atan2 = addFunction(new Atan2Function()); f_sinc = addFunction(new SincFunction()); f_radians_to_default_angle_unit = addFunction(new RadiansToDefaultAngleUnitFunction()); f_zeta = addFunction(new ZetaFunction()); f_gamma = addFunction(new GammaFunction()); f_digamma = addFunction(new DigammaFunction()); f_beta = addFunction(new BetaFunction()); f_airy = addFunction(new AiryFunction()); f_besselj = addFunction(new BesseljFunction()); f_bessely = addFunction(new BesselyFunction()); f_erf = addFunction(new ErfFunction()); f_erfc = addFunction(new ErfcFunction()); f_total = addFunction(new TotalFunction()); f_percentile = addFunction(new PercentileFunction()); f_min = addFunction(new MinFunction()); f_max = addFunction(new MaxFunction()); f_mode = addFunction(new ModeFunction()); f_rand = addFunction(new RandFunction()); f_date = addFunction(new DateFunction()); f_datetime = addFunction(new DateTimeFunction()); f_timevalue = addFunction(new TimeValueFunction()); f_timestamp = addFunction(new TimestampFunction()); f_stamptodate = addFunction(new TimestampToDateFunction()); f_days = addFunction(new DaysFunction()); f_yearfrac = addFunction(new YearFracFunction()); f_week = addFunction(new WeekFunction()); f_weekday = addFunction(new WeekdayFunction()); f_month = addFunction(new MonthFunction()); f_day = addFunction(new DayFunction()); f_year = addFunction(new YearFunction()); f_yearday = addFunction(new YeardayFunction()); f_time = addFunction(new TimeFunction()); f_add_days = addFunction(new AddDaysFunction()); f_add_months = addFunction(new AddMonthsFunction()); f_add_years = addFunction(new AddYearsFunction()); f_lunarphase = addFunction(new LunarPhaseFunction()); f_nextlunarphase = addFunction(new NextLunarPhaseFunction()); f_base = addFunction(new BaseFunction()); f_bin = addFunction(new BinFunction()); f_oct = addFunction(new OctFunction()); f_hex = addFunction(new HexFunction()); f_roman = addFunction(new RomanFunction()); f_ascii = addFunction(new AsciiFunction()); f_char = addFunction(new CharFunction()); f_length = addFunction(new LengthFunction()); f_concatenate = addFunction(new ConcatenateFunction()); f_replace = addFunction(new ReplaceFunction()); f_stripunits = addFunction(new StripUnitsFunction()); f_genvector = addFunction(new GenerateVectorFunction()); f_for = addFunction(new ForFunction()); f_sum = addFunction(new SumFunction()); f_product = addFunction(new ProductFunction()); f_process = addFunction(new ProcessFunction()); f_process_matrix = addFunction(new ProcessMatrixFunction()); f_csum = addFunction(new CustomSumFunction()); f_function = addFunction(new FunctionFunction()); f_select = addFunction(new SelectFunction()); f_title = addFunction(new TitleFunction()); f_if = addFunction(new IFFunction()); f_is_number = addFunction(new IsNumberFunction()); f_is_real = addFunction(new IsRealFunction()); f_is_rational = addFunction(new IsRationalFunction()); f_is_integer = addFunction(new IsIntegerFunction()); f_represents_number = addFunction(new RepresentsNumberFunction()); f_represents_real = addFunction(new RepresentsRealFunction()); f_represents_rational = addFunction(new RepresentsRationalFunction()); f_represents_integer = addFunction(new RepresentsIntegerFunction()); f_error = addFunction(new ErrorFunction()); f_warning = addFunction(new WarningFunction()); f_message = addFunction(new MessageFunction()); f_save = addFunction(new SaveFunction()); f_load = addFunction(new LoadFunction()); f_export = addFunction(new ExportFunction()); f_register = addFunction(new RegisterFunction()); f_stack = addFunction(new StackFunction()); f_diff = addFunction(new DeriveFunction()); f_integrate = addFunction(new IntegrateFunction()); f_solve = addFunction(new SolveFunction()); f_multisolve = addFunction(new SolveMultipleFunction()); f_dsolve = addFunction(new DSolveFunction()); f_limit = addFunction(new LimitFunction()); f_li = addFunction(new liFunction()); f_Li = addFunction(new LiFunction()); f_Ei = addFunction(new EiFunction()); f_Si = addFunction(new SiFunction()); f_Ci = addFunction(new CiFunction()); f_Shi = addFunction(new ShiFunction()); f_Chi = addFunction(new ChiFunction()); f_igamma = addFunction(new IGammaFunction()); if(canPlot()) f_plot = addFunction(new PlotFunction()); /*void *plugin = dlopen("", RTLD_NOW); if(plugin) { CREATEPLUG_PROC createproc = (CREATEPLUG_PROC) dlsym(plugin, "createPlugin"); if (dlerror() != NULL) { dlclose(plugin); printf( "dlsym error\n"); } else { createproc(); } } else { printf( "dlopen error\n"); }*/ } void Calculator::addBuiltinUnits() { u_euro = addUnit(new Unit(_("Currency"), "EUR", "euros", "euro", "European Euros", false, true, true)); u_btc = addUnit(new AliasUnit(_("Currency"), "BTC", "bitcoins", "bitcoin", "Bitcoins", u_euro, "3615.44", 1, "", false, true, true)); u_btc->setApproximate(); u_btc->setPrecision(-2); u_btc->setChanged(false); u_second = NULL; u_minute = NULL; u_hour = NULL; u_day = NULL; u_month = NULL; u_year = NULL; } void Calculator::setVariableUnitsEnabled(bool enable_variable_units) { b_var_units = enable_variable_units; } bool Calculator::variableUnitsEnabled() const { return b_var_units; } void Calculator::error(bool critical, int message_category, const char *TEMPLATE, ...) { va_list ap; va_start(ap, TEMPLATE); message(critical ? MESSAGE_ERROR : MESSAGE_WARNING, message_category, TEMPLATE, ap); va_end(ap); } void Calculator::error(bool critical, const char *TEMPLATE, ...) { va_list ap; va_start(ap, TEMPLATE); message(critical ? MESSAGE_ERROR : MESSAGE_WARNING, MESSAGE_CATEGORY_NONE, TEMPLATE, ap); va_end(ap); } void Calculator::message(MessageType mtype, int message_category, const char *TEMPLATE, ...) { va_list ap; va_start(ap, TEMPLATE); message(mtype, message_category, TEMPLATE, ap); va_end(ap); } void Calculator::message(MessageType mtype, const char *TEMPLATE, ...) { va_list ap; va_start(ap, TEMPLATE); message(mtype, MESSAGE_CATEGORY_NONE, TEMPLATE, ap); va_end(ap); } void Calculator::message(MessageType mtype, int message_category, const char *TEMPLATE, va_list ap) { if(disable_errors_ref > 0) { stopped_messages_count[disable_errors_ref - 1]++; if(mtype == MESSAGE_ERROR) { stopped_errors_count[disable_errors_ref - 1]++; } else if(mtype == MESSAGE_WARNING) { stopped_warnings_count[disable_errors_ref - 1]++; } } string error_str = TEMPLATE; size_t i = 0; while(true) { i = error_str.find("%", i); if(i == string::npos || i + 1 == error_str.length()) break; switch(error_str[i + 1]) { case 's': { const char *str = va_arg(ap, const char*); if(!str) { i++; } else { error_str.replace(i, 2, str); i += strlen(str); } break; } case 'c': { char c = (char) va_arg(ap, int); if(c > 0) { error_str.replace(i, 2, 1, c); } i++; break; } default: { i++; break; } } } bool dup_error = false; for(i = 0; i < messages.size(); i++) { if(error_str == messages[i].message()) { dup_error = true; break; } } if(disable_errors_ref > 0) { for(size_t i2 = 0; !dup_error && i2 < (size_t) disable_errors_ref; i2++) { for(i = 0; i < stopped_messages[i2].size(); i++) { if(error_str == stopped_messages[i2][i].message()) { dup_error = true; break; } } } } if(!dup_error) { if(disable_errors_ref > 0) stopped_messages[disable_errors_ref - 1].push_back(CalculatorMessage(error_str, mtype, message_category, current_stage)); else messages.push_back(CalculatorMessage(error_str, mtype, message_category, current_stage)); } } CalculatorMessage* Calculator::message() { if(!messages.empty()) { return &messages[0]; } return NULL; } CalculatorMessage* Calculator::nextMessage() { if(!messages.empty()) { messages.erase(messages.begin()); if(!messages.empty()) { return &messages[0]; } } return NULL; } void Calculator::deleteName(string name_, ExpressionItem *object) { Variable *v2 = getVariable(name_); if(v2 == object) { return; } if(v2 != NULL) { v2->destroy(); } else { MathFunction *f2 = getFunction(name_); if(f2 == object) return; if(f2 != NULL) { f2->destroy(); } } deleteName(name_, object); } void Calculator::deleteUnitName(string name_, Unit *object) { Unit *u2 = getUnit(name_); if(u2) { if(u2 != object) { u2->destroy(); } return; } u2 = getCompositeUnit(name_); if(u2) { if(u2 != object) { u2->destroy(); } } deleteUnitName(name_, object); } void Calculator::saveState() { } void Calculator::restoreState() { } void Calculator::clearBuffers() { for(unordered_map::iterator it = priv->ids_p.begin(); it != priv->ids_p.end(); ++it) { if(!it->second) { priv->freed_ids.push_back(it->first); priv->id_structs.erase(it->first); priv->ids_p.erase(it); } } } bool Calculator::abort() { i_aborted = 1; if(!b_busy) return true; if(!calculate_thread->running) { b_busy = false; } else { int msecs = 5000; while(b_busy && msecs > 0) { sleep_ms(10); msecs -= 10; } if(b_busy) { calculate_thread->cancel(); stopControl(); stopped_messages_count.clear(); stopped_warnings_count.clear(); stopped_errors_count.clear(); stopped_messages.clear(); disable_errors_ref = 0; if(tmp_rpn_mstruct) tmp_rpn_mstruct->unref(); tmp_rpn_mstruct = NULL; error(true, _("The calculation has been forcibly terminated. Please restart the application and report this as a bug."), NULL); b_busy = false; calculate_thread->start(); return false; } } return true; } bool Calculator::busy() { return b_busy; } void Calculator::terminateThreads() { if(calculate_thread->running) { if(!calculate_thread->write(false) || !calculate_thread->write(NULL)) calculate_thread->cancel(); for(size_t i = 0; i < 10 && calculate_thread->running; i++) { sleep_ms(1); } if(calculate_thread->running) calculate_thread->cancel(); } } string Calculator::localizeExpression(string str, const ParseOptions &po) const { if(DOT_STR == DOT && COMMA_STR == COMMA && !po.comma_as_separator) return str; vector q_begin; vector q_end; size_t i3 = 0; while(true) { i3 = str.find_first_of("\"\'", i3); if(i3 == string::npos) { break; } q_begin.push_back(i3); i3 = str.find(str[i3], i3 + 1); if(i3 == string::npos) { q_end.push_back(str.length() - 1); break; } q_end.push_back(i3); i3++; } if(COMMA_STR != COMMA || po.comma_as_separator) { bool b_alt_comma = po.comma_as_separator && COMMA_STR == COMMA; size_t ui = str.find(COMMA); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(COMMA, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, strlen(COMMA), b_alt_comma ? ";" : COMMA_STR); ui = str.find(COMMA, ui + (b_alt_comma ? 1 : COMMA_STR.length())); } } } if(DOT_STR != DOT) { size_t ui = str.find(DOT); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(DOT, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, strlen(DOT), DOT_STR); ui = str.find(DOT, ui + DOT_STR.length()); } } } return str; } string Calculator::unlocalizeExpression(string str, const ParseOptions &po) const { if(DOT_STR == DOT && COMMA_STR == COMMA && !po.comma_as_separator) return str; vector q_begin; vector q_end; size_t i3 = 0; while(true) { i3 = str.find_first_of("\"\'", i3); if(i3 == string::npos) { break; } q_begin.push_back(i3); i3 = str.find(str[i3], i3 + 1); if(i3 == string::npos) { q_end.push_back(str.length() - 1); break; } q_end.push_back(i3); i3++; } if(DOT_STR != DOT) { if(po.dot_as_separator) { size_t ui = str.find(DOT); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(DOT, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, strlen(DOT), SPACE); ui = str.find(DOT, ui + strlen(SPACE)); } } } size_t ui = str.find(DOT_STR); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(DOT_STR, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, DOT_STR.length(), DOT); ui = str.find(DOT_STR, ui + strlen(DOT)); } } } if(COMMA_STR != COMMA || po.comma_as_separator) { bool b_alt_comma = po.comma_as_separator && COMMA_STR == COMMA; if(po.comma_as_separator) { size_t ui = str.find(COMMA); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(COMMA, q_end[ui2] + 1); b = true; break; } } if(!b) { str.erase(ui, strlen(COMMA)); ui = str.find(COMMA, ui); } } } size_t ui = str.find(b_alt_comma ? ";" : COMMA_STR); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(b_alt_comma ? ";" : COMMA_STR, q_end[ui2] + 1); b = true; break; } } if(!b) { str.replace(ui, b_alt_comma ? 1 : COMMA_STR.length(), COMMA); ui = str.find(b_alt_comma ? ";" : COMMA_STR, ui + strlen(COMMA)); } } } return str; } bool Calculator::calculateRPNRegister(size_t index, int msecs, const EvaluationOptions &eo) { if(index <= 0 || index > rpn_stack.size()) return false; return calculateRPN(new MathStructure(*rpn_stack[rpn_stack.size() - index]), PROC_RPN_SET, index, msecs, eo); } bool Calculator::calculateRPN(MathStructure *mstruct, int command, size_t index, int msecs, const EvaluationOptions &eo, int function_arguments) { b_busy = true; if(!calculate_thread->running && !calculate_thread->start()) {mstruct->setAborted(); return false;} bool had_msecs = msecs > 0; tmp_evaluationoptions = eo; tmp_proc_command = command; tmp_rpnindex = index; tmp_rpn_mstruct = mstruct; tmp_proc_registers = function_arguments; if(!calculate_thread->write(false)) {calculate_thread->cancel(); mstruct->setAborted(); return false;} if(!calculate_thread->write((void*) mstruct)) {calculate_thread->cancel(); mstruct->setAborted(); return false;} while(msecs > 0 && b_busy) { sleep_ms(10); msecs -= 10; } if(had_msecs && b_busy) { abort(); return false; } return true; } bool Calculator::calculateRPN(string str, int command, size_t index, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division, int function_arguments) { MathStructure *mstruct = new MathStructure(); b_busy = true; if(!calculate_thread->running && !calculate_thread->start()) {mstruct->setAborted(); return false;} bool had_msecs = msecs > 0; expression_to_calculate = str; tmp_evaluationoptions = eo; tmp_proc_command = command; tmp_rpnindex = index; tmp_rpn_mstruct = mstruct; tmp_parsedstruct = parsed_struct; tmp_tostruct = to_struct; tmp_maketodivision = make_to_division; tmp_proc_registers = function_arguments; if(!calculate_thread->write(true)) {calculate_thread->cancel(); mstruct->setAborted(); return false;} if(!calculate_thread->write((void*) mstruct)) {calculate_thread->cancel(); mstruct->setAborted(); return false;} while(msecs > 0 && b_busy) { sleep_ms(10); msecs -= 10; } if(had_msecs && b_busy) { abort(); return false; } return true; } bool Calculator::calculateRPN(MathOperation op, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->add(m_zero, op); if(parsed_struct) parsed_struct->clear(); } else if(rpn_stack.size() == 1) { if(parsed_struct) { parsed_struct->set(*rpn_stack.back()); if(op == OPERATION_SUBTRACT) { parsed_struct->transform(STRUCT_NEGATE); } else if(op == OPERATION_DIVIDE) { parsed_struct->transform(STRUCT_DIVISION, *rpn_stack.back()); } else { parsed_struct->add(*rpn_stack.back(), op); } } if(op == OPERATION_SUBTRACT) { mstruct = new MathStructure(); } else { mstruct = new MathStructure(*rpn_stack.back()); } mstruct->add(*rpn_stack.back(), op); } else { if(parsed_struct) { parsed_struct->set(*rpn_stack[rpn_stack.size() - 2]); if(op == OPERATION_SUBTRACT) { parsed_struct->transform(STRUCT_ADDITION, *rpn_stack.back()); (*parsed_struct)[1].transform(STRUCT_NEGATE); } else if(op == OPERATION_DIVIDE) { parsed_struct->transform(STRUCT_DIVISION, *rpn_stack.back()); } else { parsed_struct->add(*rpn_stack.back(), op); } } mstruct = new MathStructure(*rpn_stack[rpn_stack.size() - 2]); mstruct->add(*rpn_stack.back(), op); } return calculateRPN(mstruct, PROC_RPN_OPERATION_2, 0, msecs, eo); } bool Calculator::calculateRPN(MathFunction *f, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct = new MathStructure(f, NULL); int iregs = 0; if(f->args() != 0) { size_t i = f->minargs(); bool fill_vector = (i > 0 && f->getArgumentDefinition(i) && f->getArgumentDefinition(i)->type() == ARGUMENT_TYPE_VECTOR); if(fill_vector && rpn_stack.size() < i) fill_vector = false; if(fill_vector && rpn_stack.size() > 0 && rpn_stack.back()->isVector()) fill_vector = false; if(fill_vector) { i = rpn_stack.size(); } else if(i < 1) { i = 1; } for(; i > 0; i--) { if(i > rpn_stack.size()) { error(false, _("Stack is empty. Filling remaining function arguments with zeroes."), NULL); mstruct->addChild(m_zero); } else { if(fill_vector && rpn_stack.size() - i == (size_t) f->minargs() - 1) mstruct->addChild(m_empty_vector); if(fill_vector && rpn_stack.size() - i >= (size_t) f->minargs() - 1) mstruct->getChild(f->minargs())->addChild(*rpn_stack[rpn_stack.size() - i]); else mstruct->addChild(*rpn_stack[rpn_stack.size() - i]); iregs++; } if(!fill_vector && f->getArgumentDefinition(i) && f->getArgumentDefinition(i)->type() == ARGUMENT_TYPE_ANGLE) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { (*mstruct)[i - 1].multiply(getDegUnit()); break; } case ANGLE_UNIT_GRADIANS: { (*mstruct)[i - 1].multiply(getGraUnit()); break; } case ANGLE_UNIT_RADIANS: { (*mstruct)[i - 1].multiply(getRadUnit()); break; } default: {} } } } if(fill_vector) mstruct->childrenUpdated(); f->appendDefaultValues(*mstruct); } if(parsed_struct) parsed_struct->set(*mstruct); return calculateRPN(mstruct, PROC_RPN_OPERATION_F, 0, msecs, eo, iregs); } bool Calculator::calculateRPNBitwiseNot(int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->setBitwiseNot(); } else { mstruct = new MathStructure(*rpn_stack.back()); mstruct->setBitwiseNot(); } if(parsed_struct) parsed_struct->set(*mstruct); return calculateRPN(mstruct, PROC_RPN_OPERATION_1, 0, msecs, eo); } bool Calculator::calculateRPNLogicalNot(int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct) { MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->setLogicalNot(); } else { mstruct = new MathStructure(*rpn_stack.back()); mstruct->setLogicalNot(); } if(parsed_struct) parsed_struct->set(*rpn_stack.back()); return calculateRPN(mstruct, PROC_RPN_OPERATION_1, 0, msecs, eo); } MathStructure *Calculator::calculateRPN(MathOperation op, const EvaluationOptions &eo, MathStructure *parsed_struct) { current_stage = MESSAGE_STAGE_PARSING; MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->add(m_zero, op); if(parsed_struct) parsed_struct->clear(); } else if(rpn_stack.size() == 1) { if(parsed_struct) { parsed_struct->clear(); if(op == OPERATION_SUBTRACT) { parsed_struct->transform(STRUCT_ADDITION, *rpn_stack.back()); (*parsed_struct)[1].transform(STRUCT_NEGATE); } else if(op == OPERATION_DIVIDE) { parsed_struct->transform(STRUCT_DIVISION, *rpn_stack.back()); } else { parsed_struct->add(*rpn_stack.back(), op); } } mstruct = new MathStructure(); mstruct->add(*rpn_stack.back(), op); } else { if(parsed_struct) { parsed_struct->set(*rpn_stack[rpn_stack.size() - 2]); if(op == OPERATION_SUBTRACT) { parsed_struct->transform(STRUCT_ADDITION, *rpn_stack.back()); (*parsed_struct)[1].transform(STRUCT_NEGATE); } else if(op == OPERATION_DIVIDE) { parsed_struct->transform(STRUCT_DIVISION, *rpn_stack.back()); } else { parsed_struct->add(*rpn_stack.back(), op); } } mstruct = new MathStructure(*rpn_stack[rpn_stack.size() - 2]); mstruct->add(*rpn_stack.back(), op); } current_stage = MESSAGE_STAGE_CALCULATION; mstruct->eval(eo); current_stage = MESSAGE_STAGE_CONVERSION; autoConvert(*mstruct, *mstruct, eo); current_stage = MESSAGE_STAGE_UNSET; if(rpn_stack.size() > 1) { rpn_stack.back()->unref(); rpn_stack.erase(rpn_stack.begin() + (rpn_stack.size() - 1)); } if(rpn_stack.size() > 0) { rpn_stack.back()->unref(); rpn_stack.back() = mstruct; } else { rpn_stack.push_back(mstruct); } return rpn_stack.back(); } MathStructure *Calculator::calculateRPN(MathFunction *f, const EvaluationOptions &eo, MathStructure *parsed_struct) { current_stage = MESSAGE_STAGE_PARSING; MathStructure *mstruct = new MathStructure(f, NULL); size_t iregs = 0; if(f->args() != 0) { size_t i = f->minargs(); bool fill_vector = (i > 0 && f->getArgumentDefinition(i) && f->getArgumentDefinition(i)->type() == ARGUMENT_TYPE_VECTOR); if(fill_vector && rpn_stack.size() < i) fill_vector = false; if(fill_vector && rpn_stack.size() > 0 && rpn_stack.back()->isVector()) fill_vector = false; if(fill_vector) { i = rpn_stack.size(); } else if(i < 1) { i = 1; } for(; i > 0; i--) { if(i > rpn_stack.size()) { error(false, _("Stack is empty. Filling remaining function arguments with zeroes."), NULL); mstruct->addChild(m_zero); } else { if(fill_vector && rpn_stack.size() - i == (size_t) f->minargs() - 1) mstruct->addChild(m_empty_vector); if(fill_vector && rpn_stack.size() - i >= (size_t) f->minargs() - 1) mstruct->getChild(f->minargs())->addChild(*rpn_stack[rpn_stack.size() - i]); else mstruct->addChild(*rpn_stack[rpn_stack.size() - i]); iregs++; } if(!fill_vector && f->getArgumentDefinition(i) && f->getArgumentDefinition(i)->type() == ARGUMENT_TYPE_ANGLE) { switch(eo.parse_options.angle_unit) { case ANGLE_UNIT_DEGREES: { (*mstruct)[i - 1].multiply(getDegUnit()); break; } case ANGLE_UNIT_GRADIANS: { (*mstruct)[i - 1].multiply(getGraUnit()); break; } case ANGLE_UNIT_RADIANS: { (*mstruct)[i - 1].multiply(getRadUnit()); break; } default: {} } } } if(fill_vector) mstruct->childrenUpdated(); f->appendDefaultValues(*mstruct); } if(parsed_struct) parsed_struct->set(*mstruct); current_stage = MESSAGE_STAGE_CALCULATION; mstruct->eval(eo); current_stage = MESSAGE_STAGE_CONVERSION; autoConvert(*mstruct, *mstruct, eo); current_stage = MESSAGE_STAGE_UNSET; if(iregs == 0) { rpn_stack.push_back(mstruct); } else { for(size_t i = 0; i < iregs - 1 && rpn_stack.size() > 1; i++) { rpn_stack.back()->unref(); rpn_stack.pop_back(); CALCULATOR->deleteRPNRegister(1); } rpn_stack.back()->unref(); rpn_stack.back() = mstruct; } return rpn_stack.back(); } MathStructure *Calculator::calculateRPNBitwiseNot(const EvaluationOptions &eo, MathStructure *parsed_struct) { current_stage = MESSAGE_STAGE_PARSING; MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->setBitwiseNot(); } else { mstruct = new MathStructure(*rpn_stack.back()); mstruct->setBitwiseNot(); } if(parsed_struct) parsed_struct->set(*mstruct); current_stage = MESSAGE_STAGE_CALCULATION; mstruct->eval(eo); current_stage = MESSAGE_STAGE_CONVERSION; autoConvert(*mstruct, *mstruct, eo); current_stage = MESSAGE_STAGE_UNSET; if(rpn_stack.size() == 0) { rpn_stack.push_back(mstruct); } else { rpn_stack.back()->unref(); rpn_stack.back() = mstruct; } return rpn_stack.back(); } MathStructure *Calculator::calculateRPNLogicalNot(const EvaluationOptions &eo, MathStructure *parsed_struct) { current_stage = MESSAGE_STAGE_PARSING; MathStructure *mstruct; if(rpn_stack.size() == 0) { mstruct = new MathStructure(); mstruct->setLogicalNot(); } else { mstruct = new MathStructure(*rpn_stack.back()); mstruct->setLogicalNot(); } if(parsed_struct) parsed_struct->set(*mstruct); current_stage = MESSAGE_STAGE_CALCULATION; mstruct->eval(eo); current_stage = MESSAGE_STAGE_CONVERSION; autoConvert(*mstruct, *mstruct, eo); current_stage = MESSAGE_STAGE_UNSET; if(rpn_stack.size() == 0) { rpn_stack.push_back(mstruct); } else { rpn_stack.back()->unref(); rpn_stack.back() = mstruct; } return rpn_stack.back(); } bool Calculator::RPNStackEnter(MathStructure *mstruct, int msecs, const EvaluationOptions &eo) { return calculateRPN(mstruct, PROC_RPN_ADD, 0, msecs, eo); } bool Calculator::RPNStackEnter(string str, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { remove_blank_ends(str); if(str.empty() && rpn_stack.size() > 0) { rpn_stack.push_back(new MathStructure(*rpn_stack.back())); return true; } return calculateRPN(str, PROC_RPN_ADD, 0, msecs, eo, parsed_struct, to_struct, make_to_division); } void Calculator::RPNStackEnter(MathStructure *mstruct, bool eval, const EvaluationOptions &eo) { if(eval) { current_stage = MESSAGE_STAGE_CALCULATION; mstruct->eval(); current_stage = MESSAGE_STAGE_CONVERSION; autoConvert(*mstruct, *mstruct, eo); current_stage = MESSAGE_STAGE_UNSET; } rpn_stack.push_back(mstruct); } void Calculator::RPNStackEnter(string str, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { remove_blank_ends(str); if(str.empty() && rpn_stack.size() > 0) rpn_stack.push_back(new MathStructure(*rpn_stack.back())); else rpn_stack.push_back(new MathStructure(calculate(str, eo, parsed_struct, to_struct, make_to_division))); } bool Calculator::setRPNRegister(size_t index, MathStructure *mstruct, int msecs, const EvaluationOptions &eo) { if(mstruct == NULL) { deleteRPNRegister(index); return true; } if(index <= 0 || index > rpn_stack.size()) return false; return calculateRPN(mstruct, PROC_RPN_SET, index, msecs, eo); } bool Calculator::setRPNRegister(size_t index, string str, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { if(index <= 0 || index > rpn_stack.size()) return false; return calculateRPN(str, PROC_RPN_SET, index, msecs, eo, parsed_struct, to_struct, make_to_division); } void Calculator::setRPNRegister(size_t index, MathStructure *mstruct, bool eval, const EvaluationOptions &eo) { if(mstruct == NULL) { deleteRPNRegister(index); return; } if(eval) { current_stage = MESSAGE_STAGE_CALCULATION; mstruct->eval(); current_stage = MESSAGE_STAGE_CONVERSION; autoConvert(*mstruct, *mstruct, eo); current_stage = MESSAGE_STAGE_UNSET; } if(index <= 0 || index > rpn_stack.size()) return; index = rpn_stack.size() - index; rpn_stack[index]->unref(); rpn_stack[index] = mstruct; } void Calculator::setRPNRegister(size_t index, string str, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { if(index <= 0 || index > rpn_stack.size()) return; index = rpn_stack.size() - index; MathStructure *mstruct = new MathStructure(calculate(str, eo, parsed_struct, to_struct, make_to_division)); rpn_stack[index]->unref(); rpn_stack[index] = mstruct; } void Calculator::deleteRPNRegister(size_t index) { if(index <= 0 || index > rpn_stack.size()) return; index = rpn_stack.size() - index; rpn_stack[index]->unref(); rpn_stack.erase(rpn_stack.begin() + index); } MathStructure *Calculator::getRPNRegister(size_t index) const { if(index > 0 && index <= rpn_stack.size()) { index = rpn_stack.size() - index; return rpn_stack[index]; } return NULL; } size_t Calculator::RPNStackSize() const { return rpn_stack.size(); } void Calculator::clearRPNStack() { for(size_t i = 0; i < rpn_stack.size(); i++) { rpn_stack[i]->unref(); } rpn_stack.clear(); } void Calculator::moveRPNRegister(size_t old_index, size_t new_index) { if(old_index == new_index) return; if(old_index > 0 && old_index <= rpn_stack.size()) { old_index = rpn_stack.size() - old_index; MathStructure *mstruct = rpn_stack[old_index]; if(new_index > rpn_stack.size()) { new_index = 0; } else if(new_index <= 1) { rpn_stack.push_back(mstruct); rpn_stack.erase(rpn_stack.begin() + old_index); return; } else { new_index = rpn_stack.size() - new_index; } if(new_index > old_index) { rpn_stack.erase(rpn_stack.begin() + old_index); rpn_stack.insert(rpn_stack.begin() + new_index, mstruct); } else if(new_index < old_index) { rpn_stack.insert(rpn_stack.begin() + new_index, mstruct); rpn_stack.erase(rpn_stack.begin() + (old_index + 1)); } } } void Calculator::moveRPNRegisterUp(size_t index) { if(index > 1 && index <= rpn_stack.size()) { index = rpn_stack.size() - index; MathStructure *mstruct = rpn_stack[index]; rpn_stack.erase(rpn_stack.begin() + index); index++; if(index == rpn_stack.size()) rpn_stack.push_back(mstruct); else rpn_stack.insert(rpn_stack.begin() + index, mstruct); } } void Calculator::moveRPNRegisterDown(size_t index) { if(index > 0 && index < rpn_stack.size()) { index = rpn_stack.size() - index; MathStructure *mstruct = rpn_stack[index]; rpn_stack.erase(rpn_stack.begin() + index); index--; rpn_stack.insert(rpn_stack.begin() + index, mstruct); } } #define EQUALS_IGNORECASE_AND_LOCAL(x,y,z) (equalsIgnoreCase(x, y) || equalsIgnoreCase(x, z)) string Calculator::calculateAndPrint(string str, int msecs, const EvaluationOptions &eo, const PrintOptions &po) { if(msecs > 0) startControl(msecs); PrintOptions printops = po; EvaluationOptions evalops = eo; MathStructure mstruct; bool do_bases = false, do_factors = false, do_fraction = false, do_pfe = false, do_calendars = false; string from_str = str, to_str; if(separateToExpression(from_str, to_str, evalops, true)) { remove_duplicate_blanks(to_str); string to_str1, to_str2; size_t ispace = to_str.find_first_of(SPACES); if(ispace != string::npos) { to_str1 = to_str.substr(0, ispace); remove_blank_ends(to_str1); to_str2 = to_str.substr(ispace + 1); remove_blank_ends(to_str2); } if(equalsIgnoreCase(to_str, "hex") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "hexadecimal", _("hexadecimal"))) { str = from_str; printops.base = BASE_HEXADECIMAL; } else if(equalsIgnoreCase(to_str, "bin") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "binary", _("binary"))) { str = from_str; printops.base = BASE_BINARY; } else if(equalsIgnoreCase(to_str, "oct") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "octal", _("octal"))) { str = from_str; printops.base = BASE_OCTAL; } else if(equalsIgnoreCase(to_str, "duo") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "duodecimal", _("duodecimal"))) { str = from_str; printops.base = BASE_DUODECIMAL; } else if(equalsIgnoreCase(to_str, "roman") || equalsIgnoreCase(to_str, _("roman"))) { str = from_str; printops.base = BASE_ROMAN_NUMERALS; } else if(equalsIgnoreCase(to_str, "sexa") || equalsIgnoreCase(to_str, "sexagesimal") || equalsIgnoreCase(to_str, _("sexagesimal"))) { str = from_str; printops.base = BASE_SEXAGESIMAL; } else if(equalsIgnoreCase(to_str, "time") || equalsIgnoreCase(to_str, _("time"))) { str = from_str; printops.base = BASE_TIME; } else if(equalsIgnoreCase(to_str, "utc") || equalsIgnoreCase(to_str, "gmt")) { str = from_str; printops.time_zone = TIME_ZONE_UTC; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "fraction", _("fraction"))) { str = from_str; do_fraction = true; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "factors", _("factors"))) { str = from_str; do_factors = true; } else if(equalsIgnoreCase(to_str, "partial fraction") || equalsIgnoreCase(to_str, _("partial fraction"))) { str = from_str; do_pfe = true; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "bases", _("bases"))) { do_bases = true; str = from_str; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "calendars", _("calendars"))) { do_calendars = true; str = from_str; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "optimal", _("optimal"))) { str = from_str; evalops.parse_options.units_enabled = true; evalops.auto_post_conversion = POST_CONVERSION_OPTIMAL_SI; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "base", _("base"))) { str = from_str; evalops.parse_options.units_enabled = true; evalops.auto_post_conversion = POST_CONVERSION_BASE; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str1, "base", _("base")) && s2i(to_str2) >= 2 && (s2i(to_str2) <= 36 || s2i(to_str2) == BASE_SEXAGESIMAL)) { str = from_str; printops.base = s2i(to_str2); } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "mixed", _("mixed"))) { str = from_str; evalops.parse_options.units_enabled = true; evalops.auto_post_conversion = POST_CONVERSION_NONE; evalops.mixed_units_conversion = MIXED_UNITS_CONVERSION_FORCE_INTEGER; } else { evalops.parse_options.units_enabled = true; } } mstruct = calculate(str, evalops); if(do_factors) { if(!mstruct.integerFactorize()) mstruct.factorize(evalops, true, -1, 0, true, 2); } if(do_pfe) mstruct.expandPartialFractions(evalops); printops.allow_factorization = printops.allow_factorization || evalops.structuring == STRUCTURING_FACTORIZE || do_factors; if(do_calendars && mstruct.isDateTime()) { str = ""; bool b_fail; long int y, m, d; #define PRINT_CALENDAR(x, c) if(!str.empty()) {str += "\n";} str += x; str += " "; b_fail = !dateToCalendar(*mstruct.datetime(), y, m, d, c); if(b_fail) {str += _("failed");} else {str += i2s(d); str += " "; str += monthName(m, c, true); str += " "; str += i2s(y);} PRINT_CALENDAR(string(_("Gregorian:")), CALENDAR_GREGORIAN); PRINT_CALENDAR(string(_("Hebrew:")), CALENDAR_HEBREW); PRINT_CALENDAR(string(_("Islamic:")), CALENDAR_ISLAMIC); PRINT_CALENDAR(string(_("Persian:")), CALENDAR_PERSIAN); PRINT_CALENDAR(string(_("Indian national:")), CALENDAR_INDIAN); PRINT_CALENDAR(string(_("Chinese:")), CALENDAR_CHINESE); long int cy, yc, st, br; chineseYearInfo(y, cy, yc, st, br); if(!b_fail) {str += " ("; str += chineseStemName(st); str += string(" "); str += chineseBranchName(br); str += ")";} PRINT_CALENDAR(string(_("Julian:")), CALENDAR_JULIAN); PRINT_CALENDAR(string(_("Revised julian:")), CALENDAR_MILANKOVIC); PRINT_CALENDAR(string(_("Coptic:")), CALENDAR_COPTIC); PRINT_CALENDAR(string(_("Ethiopian:")), CALENDAR_ETHIOPIAN); stopControl(); return str; } else if(do_bases) { printops.base = BASE_BINARY; str = print(mstruct, 0, printops); str += " = "; printops.base = BASE_OCTAL; str += print(mstruct, 0, printops); str += " = "; printops.base = BASE_DECIMAL; str += print(mstruct, 0, printops); str += " = "; printops.base = BASE_HEXADECIMAL; str += print(mstruct, 0, printops); stopControl(); return str; } else if(do_fraction) { if(mstruct.isNumber()) printops.number_fraction_format = FRACTION_COMBINED; else printops.number_fraction_format = FRACTION_FRACTIONAL; } mstruct.format(printops); str = mstruct.print(printops); stopControl(); return str; } bool Calculator::calculate(MathStructure *mstruct, string str, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { mstruct->set(string(_("calculating...")), false, true); b_busy = true; if(!calculate_thread->running && !calculate_thread->start()) {mstruct->setAborted(); return false;} bool had_msecs = msecs > 0; expression_to_calculate = str; tmp_evaluationoptions = eo; tmp_proc_command = PROC_NO_COMMAND; tmp_rpn_mstruct = NULL; tmp_parsedstruct = parsed_struct; tmp_tostruct = to_struct; tmp_maketodivision = make_to_division; if(!calculate_thread->write(true)) {calculate_thread->cancel(); mstruct->setAborted(); return false;} if(!calculate_thread->write((void*) mstruct)) {calculate_thread->cancel(); mstruct->setAborted(); return false;} while(msecs > 0 && b_busy) { sleep_ms(10); msecs -= 10; } if(had_msecs && b_busy) { if(!abort()) mstruct->setAborted(); return false; } return true; } bool Calculator::calculate(MathStructure *mstruct, int msecs, const EvaluationOptions &eo, string to_str) { b_busy = true; if(!calculate_thread->running && !calculate_thread->start()) {mstruct->setAborted(); return false;} bool had_msecs = msecs > 0; expression_to_calculate = ""; tmp_evaluationoptions = eo; tmp_proc_command = PROC_NO_COMMAND; tmp_rpn_mstruct = NULL; tmp_parsedstruct = NULL; if(!to_str.empty()) tmp_tostruct = new MathStructure(to_str); else tmp_tostruct = NULL; tmp_tostruct = NULL; tmp_maketodivision = false; if(!calculate_thread->write(false)) {calculate_thread->cancel(); mstruct->setAborted(); return false;} if(!calculate_thread->write((void*) mstruct)) {calculate_thread->cancel(); mstruct->setAborted(); return false;} while(msecs > 0 && b_busy) { sleep_ms(10); msecs -= 10; } if(had_msecs && b_busy) { if(!abort()) mstruct->setAborted(); return false; } return true; } bool Calculator::hasToExpression(const string &str, bool allow_empty_from) const { if(str.rfind(_(" to ")) != string::npos || str.rfind(" to ") != string::npos) return true; if(allow_empty_from && (str.find("to ") == 0 || (str.find(_("to")) == 0 && str.length() > strlen(_("to")) && str[strlen(_("to"))] == ' '))) return true; return false; } bool Calculator::separateToExpression(string &str, string &to_str, const EvaluationOptions &eo, bool keep_modifiers, bool allow_empty_from) const { to_str = ""; size_t i = 0; if((i = str.find(_(" to "))) != string::npos) { size_t l = strlen(_(" to ")); to_str = str.substr(i + l, str.length() - i - l); } else if((i = str.find(" to ")) != string::npos) { size_t l = strlen(" to "); to_str = str.substr(i + l, str.length() - i - l); } else if(allow_empty_from && str.find("to ") == 0) { to_str = str.substr(3); i = 0; } else if(allow_empty_from && (str.find(_("to")) == 0 && str.length() > strlen(_("to")) && str[strlen(_("to"))] == ' ')) { to_str = str.substr(strlen(_("to"))); i = 0; } else { return false; } if(!to_str.empty()) { remove_blank_ends(to_str); if(to_str.rfind(SIGN_MINUS, 0) == 0) { to_str.replace(0, strlen(SIGN_MINUS), MINUS); } if(!keep_modifiers && (to_str[0] == '0' || to_str[0] == '?' || to_str[0] == '+' || to_str[0] == '-')) { to_str = to_str.substr(1, str.length() - 1); remove_blank_ends(to_str); } str = str.substr(0, i); return true; } return false; } MathStructure Calculator::calculate(string str, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division) { string str2; if(make_to_division) separateToExpression(str, str2, eo, true); Unit *u = NULL; if(to_struct) { if(str2.empty()) { if(to_struct->isSymbolic() && !to_struct->symbol().empty()) { str2 = to_struct->symbol(); remove_blank_ends(str2); } else if(to_struct->isUnit()) { u = to_struct->unit(); } } to_struct->setUndefined(); } MathStructure mstruct; current_stage = MESSAGE_STAGE_PARSING; parse(&mstruct, str, eo.parse_options); if(parsed_struct) { beginTemporaryStopMessages(); ParseOptions po = eo.parse_options; po.preserve_format = true; parse(parsed_struct, str, po); endTemporaryStopMessages(); } current_stage = MESSAGE_STAGE_CALCULATION; mstruct.eval(eo); current_stage = MESSAGE_STAGE_UNSET; if(aborted()) return mstruct; bool b_units = mstruct.containsType(STRUCT_UNIT, true); if(b_units && u) { current_stage = MESSAGE_STAGE_CONVERSION; if(to_struct) to_struct->set(u); mstruct.set(convert(mstruct, u, eo, false, false)); } else if(!str2.empty()) { return convert(mstruct, str2, eo); } else if(!b_units) { return mstruct; } else { current_stage = MESSAGE_STAGE_CONVERSION; switch(eo.auto_post_conversion) { case POST_CONVERSION_OPTIMAL: { mstruct.set(convertToBestUnit(mstruct, eo, false)); break; } case POST_CONVERSION_BASE: { mstruct.set(convertToBaseUnits(mstruct, eo)); break; } case POST_CONVERSION_OPTIMAL_SI: { mstruct.set(convertToBestUnit(mstruct, eo, true)); break; } default: {} } } if(eo.mixed_units_conversion != MIXED_UNITS_CONVERSION_NONE) mstruct.set(convertToMixedUnits(mstruct, eo)); current_stage = MESSAGE_STAGE_UNSET; return mstruct; } MathStructure Calculator::calculate(const MathStructure &mstruct_to_calculate, const EvaluationOptions &eo, string to_str) { remove_blank_ends(to_str); MathStructure mstruct(mstruct_to_calculate); current_stage = MESSAGE_STAGE_CALCULATION; mstruct.eval(eo); current_stage = MESSAGE_STAGE_CONVERSION; if(!to_str.empty()) { return convert(mstruct, to_str, eo); } else { switch(eo.auto_post_conversion) { case POST_CONVERSION_OPTIMAL: { mstruct.set(convertToBestUnit(mstruct, eo, false)); break; } case POST_CONVERSION_BASE: { mstruct.set(convertToBaseUnits(mstruct, eo)); break; } case POST_CONVERSION_OPTIMAL_SI: { mstruct.set(convertToBestUnit(mstruct, eo, true)); break; } default: {} } } if(eo.mixed_units_conversion != MIXED_UNITS_CONVERSION_NONE) mstruct.set(convertToMixedUnits(mstruct, eo)); current_stage = MESSAGE_STAGE_UNSET; return mstruct; } string Calculator::print(const MathStructure &mstruct, int msecs, const PrintOptions &po) { startControl(msecs); MathStructure mstruct2(mstruct); mstruct2.format(po); string print_result = mstruct2.print(po); stopControl(); return print_result; } string Calculator::printMathStructureTimeOut(const MathStructure &mstruct, int msecs, const PrintOptions &po) { return print(mstruct, msecs, po); } MathStructure Calculator::convertToMixedUnits(const MathStructure &mstruct, const EvaluationOptions &eo) { if(eo.mixed_units_conversion == MIXED_UNITS_CONVERSION_NONE) return mstruct; if(!mstruct.isMultiplication()) return mstruct; if(mstruct.size() != 2) return mstruct; if(mstruct[1].isUnit() && (!mstruct[1].prefix() || mstruct[1].prefix() == decimal_null_prefix) && mstruct[0].isNumber()) { Prefix *p = mstruct[1].prefix(); MathStructure mstruct_new(mstruct); Unit *u = mstruct[1].unit(); Number nr = mstruct[0].number(); if(!nr.isReal()) return mstruct; if(nr.isOne()) return mstruct; if(u->subtype() == SUBTYPE_COMPOSITE_UNIT) return mstruct; bool negated = false; if(nr.isNegative()) { nr.negate(); negated = true; } bool accept_obsolete = (u->subtype() == SUBTYPE_ALIAS_UNIT && abs(((AliasUnit*) u)->mixWithBase()) > 1); Unit *original_u = u; Unit *last_nonobsolete_u = u; Number last_nonobsolete_nr = nr; Number nr_one(1, 1); Number nr_ten(10, 1); while(eo.mixed_units_conversion > MIXED_UNITS_CONVERSION_DOWNWARDS && nr.isGreaterThan(nr_one)) { Unit *best_u = NULL; Number best_nr; int best_priority = 0; for(size_t i = 0; i < units.size(); i++) { Unit *ui = units[i]; if(ui->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) ui)->firstBaseUnit() == u && ((AliasUnit*) ui)->firstBaseExponent() == 1) { AliasUnit *aui = (AliasUnit*) ui; int priority_i = aui->mixWithBase(); if(((priority_i > 0 && (!best_u || priority_i <= best_priority)) || (best_priority == 0 && priority_i == 0 && ((eo.mixed_units_conversion == MIXED_UNITS_CONVERSION_FORCE_INTEGER && aui->expression().find_first_not_of(NUMBERS) == string::npos) || eo.mixed_units_conversion == MIXED_UNITS_CONVERSION_FORCE_ALL))) && (aui->mixWithBaseMinimum() <= 1 || nr.isGreaterThanOrEqualTo(aui->mixWithBaseMinimum()))) { MathStructure mstruct_nr(nr); MathStructure m_exp(m_one); aui->convertFromFirstBaseUnit(mstruct_nr, m_exp); mstruct_nr.eval(eo); if(mstruct_nr.isNumber() && m_exp.isOne() && mstruct_nr.number().isLessThan(nr) && mstruct_nr.number().isGreaterThanOrEqualTo(nr_one) && (!best_u || mstruct_nr.number().isLessThan(best_nr))) { best_u = ui; best_nr = mstruct_nr.number(); best_priority = priority_i; } } } } if(!best_u) break; u = best_u; nr = best_nr; if(accept_obsolete || best_priority <= 1) { last_nonobsolete_u = u; last_nonobsolete_nr = nr; } } u = last_nonobsolete_u; nr = last_nonobsolete_nr; if(u != original_u) { if(negated) last_nonobsolete_nr.negate(); mstruct_new[0].set(last_nonobsolete_nr); mstruct_new[1].set(u, p); } while(u->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) u)->firstBaseUnit()->subtype() != SUBTYPE_COMPOSITE_UNIT && ((AliasUnit*) u)->firstBaseExponent() == 1 && (((AliasUnit*) u)->mixWithBase() != 0 || eo.mixed_units_conversion == MIXED_UNITS_CONVERSION_FORCE_ALL || (eo.mixed_units_conversion == MIXED_UNITS_CONVERSION_FORCE_INTEGER && ((AliasUnit*) u)->expression().find_first_not_of(NUMBERS) == string::npos)) && !nr.isInteger() && !nr.isZero()) { Number int_nr(nr); int_nr.trunc(); if(eo.mixed_units_conversion == MIXED_UNITS_CONVERSION_DOWNWARDS_KEEP && int_nr.isZero()) break; nr -= int_nr; MathStructure mstruct_nr(nr); MathStructure m_exp(m_one); ((AliasUnit*) u)->convertToFirstBaseUnit(mstruct_nr, m_exp); mstruct_nr.eval(eo); while(!accept_obsolete && ((AliasUnit*) u)->firstBaseUnit()->subtype() == SUBTYPE_ALIAS_UNIT && abs(((AliasUnit*) ((AliasUnit*) u)->firstBaseUnit())->mixWithBase()) > 1) { u = ((AliasUnit*) u)->firstBaseUnit(); if(((AliasUnit*) u)->firstBaseExponent() == 1 && (((AliasUnit*) u)->mixWithBase() != 0 || eo.mixed_units_conversion == MIXED_UNITS_CONVERSION_FORCE_ALL || (eo.mixed_units_conversion == MIXED_UNITS_CONVERSION_FORCE_INTEGER && ((AliasUnit*) u)->expression().find_first_not_of(NUMBERS) == string::npos))) { ((AliasUnit*) u)->convertToFirstBaseUnit(mstruct_nr, m_exp); mstruct_nr.eval(eo); if(!mstruct_nr.isNumber() || !m_exp.isOne()) break; } else { mstruct_nr.setUndefined(); break; } } if(!mstruct_nr.isNumber() || !m_exp.isOne()) break; if(eo.mixed_units_conversion == MIXED_UNITS_CONVERSION_FORCE_ALL && mstruct_nr.number().isLessThanOrEqualTo(nr)) break; u = ((AliasUnit*) u)->firstBaseUnit(); nr = mstruct_nr.number(); MathStructure mstruct_term; if(negated) { Number pos_nr(nr); pos_nr.negate(); mstruct_term.set(pos_nr); } else { mstruct_term.set(nr); } mstruct_term *= MathStructure(u, p); if(int_nr.isZero()) { if(mstruct_new.isAddition()) mstruct_new[mstruct_new.size() - 1].set(mstruct_term); else mstruct_new.set(mstruct_term); } else { if(negated) int_nr.negate(); if(mstruct_new.isAddition()) mstruct_new[mstruct_new.size() - 1][0].set(int_nr); else mstruct_new[0].set(int_nr); mstruct_new.add(mstruct_term, true); } } return mstruct_new; } return mstruct; } MathStructure Calculator::convert(double value, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo) { MathStructure mstruct(value); mstruct *= from_unit; mstruct.eval(eo); mstruct.convert(to_unit, true); mstruct.divide(to_unit, true); mstruct.eval(eo); return mstruct; } MathStructure Calculator::convert(string str, Unit *from_unit, Unit *to_unit, int msecs, const EvaluationOptions &eo) { return convertTimeOut(str, from_unit, to_unit, msecs, eo); } MathStructure Calculator::convertTimeOut(string str, Unit *from_unit, Unit *to_unit, int msecs, const EvaluationOptions &eo) { MathStructure mstruct; parse(&mstruct, str, eo.parse_options); mstruct *= from_unit; b_busy = true; if(!calculate_thread->running && !calculate_thread->start()) return mstruct; bool had_msecs = msecs > 0; tmp_evaluationoptions = eo; tmp_proc_command = PROC_NO_COMMAND; bool b_parse = false; if(!calculate_thread->write(b_parse)) {calculate_thread->cancel(); return mstruct;} void *x = (void*) &mstruct; if(!calculate_thread->write(x)) {calculate_thread->cancel(); return mstruct;} while(msecs > 0 && b_busy) { sleep_ms(10); msecs -= 10; } if(had_msecs && b_busy) { abort(); mstruct.setAborted(); return mstruct; } mstruct.convert(to_unit, true); mstruct.divide(to_unit, true); b_busy = true; if(!calculate_thread->write(b_parse)) {calculate_thread->cancel(); return mstruct;} x = (void*) &mstruct; if(!calculate_thread->write(x)) {calculate_thread->cancel(); return mstruct;} while(msecs > 0 && b_busy) { sleep_ms(10); msecs -= 10; } if(had_msecs && b_busy) { abort(); mstruct.setAborted(); } return mstruct; } MathStructure Calculator::convert(string str, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo) { MathStructure mstruct; parse(&mstruct, str, eo.parse_options); mstruct *= from_unit; mstruct.eval(eo); mstruct.convert(to_unit, true); mstruct.divide(to_unit, true); mstruct.eval(eo); return mstruct; } MathStructure Calculator::convert(const MathStructure &mstruct, KnownVariable *to_var, const EvaluationOptions &eo) { if(mstruct.contains(to_var, true) > 0) return mstruct; if(!to_var->unit().empty() && to_var->isExpression()) { CompositeUnit cu("", "temporary_composite_convert", "", to_var->unit()); if(cu.countUnits() > 0) { AliasUnit au("", "temporary_alias_convert", "", "", "", &cu, to_var->expression()); au.setUncertainty(to_var->uncertainty()); au.setApproximate(to_var->isApproximate()); au.setPrecision(to_var->precision()); MathStructure mstruct_new(convert(mstruct, &au, eo, false, false)); mstruct_new.replace(&au, to_var); return mstruct_new; } } MathStructure mstruct_new(mstruct); mstruct_new /= to_var->get(); mstruct_new.eval(eo); mstruct_new *= to_var; return mstruct_new; } MathStructure Calculator::convert(const MathStructure &mstruct, Unit *to_unit, const EvaluationOptions &eo, bool always_convert, bool convert_to_mixed_units) { if(!mstruct.containsType(STRUCT_UNIT, true)) return mstruct; CompositeUnit *cu = NULL; if(to_unit->subtype() == SUBTYPE_COMPOSITE_UNIT) cu = (CompositeUnit*) to_unit; if(cu && cu->countUnits() == 0) return mstruct; MathStructure mstruct_new(mstruct); if(to_unit->hasComplexRelationTo(to_unit->baseUnit()) && to_unit->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { mstruct_new = convert(mstruct, to_unit->baseUnit(), eo, always_convert, convert_to_mixed_units); mstruct_new.calculateDivide(((CompositeUnit*) to_unit->baseUnit())->generateMathStructure(false, eo.keep_prefixes), eo); to_unit->convertFromBaseUnit(mstruct_new); mstruct_new.eval(eo); mstruct_new.multiply(MathStructure(to_unit, eo.keep_prefixes ? decimal_null_prefix : NULL)); EvaluationOptions eo2 = eo; eo2.sync_units = false; eo2.keep_prefixes = true; mstruct_new.eval(eo2); return mstruct_new; } //bool b_simple = !cu && (to_unit->subtype() != SUBTYPE_ALIAS_UNIT || (((AliasUnit*) to_unit)->baseUnit()->subtype() != SUBTYPE_COMPOSITE_UNIT && ((AliasUnit*) to_unit)->baseExponent() == 1)); bool b_changed = false; if(mstruct_new.isAddition()) { if(mstruct_new.size() > 100 && aborted()) return mstruct; mstruct_new.factorizeUnits(); if(!b_changed && !mstruct_new.equals(mstruct, true, true)) b_changed = true; } if(!mstruct_new.isPower() && !mstruct_new.isUnit() && !mstruct_new.isMultiplication()) { if(mstruct_new.size() > 0) { for(size_t i = 0; i < mstruct_new.size(); i++) { if(mstruct_new.size() > 100 && aborted()) return mstruct; if(!mstruct_new.isFunction() || !mstruct_new.function()->getArgumentDefinition(i + 1) || mstruct_new.function()->getArgumentDefinition(i + 1)->type() != ARGUMENT_TYPE_ANGLE) { mstruct_new[i] = convert(mstruct_new[i], to_unit, eo, false, convert_to_mixed_units); if(!b_changed && !mstruct_new.equals(mstruct[i], true, true)) b_changed = true; } } if(b_changed) { mstruct_new.childrenUpdated(); EvaluationOptions eo2 = eo; //eo2.calculate_functions = false; eo2.sync_units = false; eo2.keep_prefixes = true; mstruct_new.eval(eo2); } return mstruct_new; } } else { EvaluationOptions eo2 = eo; eo2.keep_prefixes = true; bool b = false; if(mstruct_new.convert(to_unit, true, NULL, false, eo2, eo.keep_prefixes ? decimal_null_prefix : NULL) || always_convert) { b = true; } else { CompositeUnit *cu2 = cu; if(to_unit->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) to_unit)->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { cu2 = (CompositeUnit*) ((AliasUnit*) to_unit)->baseUnit(); } if(cu2) { switch(mstruct_new.type()) { case STRUCT_UNIT: { if(cu2->containsRelativeTo(mstruct_new.unit())) { b = true; } break; } case STRUCT_MULTIPLICATION: { for(size_t i = 1; i <= mstruct_new.countChildren(); i++) { if(mstruct_new.countChildren() > 100 && aborted()) return mstruct; if(mstruct_new.getChild(i)->isUnit() && cu2->containsRelativeTo(mstruct_new.getChild(i)->unit())) { b = true; } if(mstruct_new.getChild(i)->isPower() && mstruct_new.getChild(i)->base()->isUnit() && cu2->containsRelativeTo(mstruct_new.getChild(i)->base()->unit())) { b = true; } } break; } case STRUCT_POWER: { if(mstruct_new.base()->isUnit() && cu2->containsRelativeTo(mstruct_new.base()->unit())) { b = true; } break; } default: {} } } } if(b) { eo2.sync_units = true; eo2.keep_prefixes = false; mstruct_new.divide(MathStructure(to_unit, NULL)); mstruct_new.eval(eo2); if(cu) { MathStructure mstruct_cu(cu->generateMathStructure(false, eo.keep_prefixes)); Prefix *p = NULL; size_t i = 1; Unit *u = cu->get(i, NULL, &p); while(u) { mstruct_new.setPrefixForUnit(u, p); i++; u = cu->get(i, NULL, &p); } mstruct_new.multiply(mstruct_cu); } else { mstruct_new.multiply(MathStructure(to_unit, eo.keep_prefixes ? decimal_null_prefix : NULL)); } eo2.sync_units = false; eo2.keep_prefixes = true; mstruct_new.eval(eo2); if(convert_to_mixed_units && eo2.mixed_units_conversion != MIXED_UNITS_CONVERSION_NONE) { eo2.mixed_units_conversion = MIXED_UNITS_CONVERSION_DOWNWARDS_KEEP; return convertToMixedUnits(mstruct_new, eo2); } else { return mstruct_new; } } } return mstruct; } MathStructure Calculator::convertToBaseUnits(const MathStructure &mstruct, const EvaluationOptions &eo) { if(!mstruct.containsType(STRUCT_UNIT, true)) return mstruct; MathStructure mstruct_new(mstruct); mstruct_new.convertToBaseUnits(true, NULL, true, eo); if(!mstruct_new.equals(mstruct, true, true)) { EvaluationOptions eo2 = eo; eo2.keep_prefixes = false; eo2.isolate_x = false; eo2.test_comparisons = false; //eo2.calculate_functions = false; mstruct_new.eval(eo2); } return mstruct_new; } Unit *Calculator::findMatchingUnit(const MathStructure &mstruct) { switch(mstruct.type()) { case STRUCT_POWER: { if(mstruct.base()->isUnit() && mstruct.base()->unit()->subtype() != SUBTYPE_COMPOSITE_UNIT && mstruct.exponent()->isNumber() && mstruct.exponent()->number().isInteger()) { Unit *u_base = mstruct.base()->unit(); if(u_base->subtype() == SUBTYPE_ALIAS_UNIT) { if(((AliasUnit*) u_base)->baseExponent() == 1) return u_base; else u_base = u_base->baseUnit(); } int exp = mstruct.exponent()->number().intValue(); for(size_t i = 0; i < units.size(); i++) { Unit *u = units[i]; if(u->subtype() == SUBTYPE_ALIAS_UNIT && u->baseUnit() == u_base && ((AliasUnit*) u)->baseExponent() == exp) { return u; } } } return findMatchingUnit(mstruct[0]); } case STRUCT_UNIT: { return mstruct.unit(); } case STRUCT_MULTIPLICATION: { if(mstruct.size() == 2 && !mstruct[0].isUnit_exp()) { return findMatchingUnit(mstruct[1]); } CompositeUnit *cu = new CompositeUnit("", "temporary_find_matching_unit"); for(size_t i = 1; i <= mstruct.countChildren(); i++) { if(mstruct.getChild(i)->isUnit()) { cu->add(mstruct.getChild(i)->unit()->baseUnit()); } else if(mstruct.getChild(i)->isPower() && mstruct.getChild(i)->base()->isUnit() && mstruct.getChild(i)->exponent()->isNumber() && mstruct.getChild(i)->exponent()->number().isInteger()) { cu->add(mstruct.getChild(i)->base()->unit()->baseUnit(), mstruct.getChild(i)->exponent()->number().intValue()); } } if(cu->countUnits() == 1) { int exp = 1; Unit *u_base = cu->get(1, &exp); if(exp == 1) return u_base; for(size_t i = 0; i < units.size(); i++) { Unit *u = units[i]; if(u->subtype() == SUBTYPE_ALIAS_UNIT && u->baseUnit() == u_base && ((AliasUnit*) u)->baseExponent() == exp) { return u; } } } if(cu->countUnits() > 1) { for(size_t i = 0; i < units.size(); i++) { Unit *u = units[i]; if(u->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) u)->countUnits() == cu->countUnits()) { bool b = true; for(size_t i2 = 1; i2 <= cu->countUnits(); i2++) { int exp1 = 1, exp2 = 1; Unit *ui1 = cu->get(i2, &exp1); Unit *ui2 = ((CompositeUnit*) u)->get(i2, &exp2); if(ui1 != ui2->baseUnit() || exp1 != exp2) { b = false; break; } } if(b) { delete cu; return u; } } } } } delete cu; break; } default: { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct.size() > 100 && aborted()) return NULL; Unit *u = findMatchingUnit(mstruct[i]); if(u) return u; } break; } } return NULL; } Unit *Calculator::getBestUnit(Unit *u, bool allow_only_div, bool convert_to_local_currency) { switch(u->subtype()) { case SUBTYPE_BASE_UNIT: { if(convert_to_local_currency && u->isCurrency()) { Unit *u_local_currency = CALCULATOR->getLocalCurrency(); if(u_local_currency) return u_local_currency; } return u; } case SUBTYPE_ALIAS_UNIT: { AliasUnit *au = (AliasUnit*) u; if(au->baseExponent() == 1 && au->baseUnit()->subtype() == SUBTYPE_BASE_UNIT) { if(au->isCurrency()) { if(!convert_to_local_currency) return u; Unit *u_local_currency = CALCULATOR->getLocalCurrency(); if(u_local_currency) return u_local_currency; } return (Unit*) au->baseUnit(); } else if(au->isSIUnit() && (au->firstBaseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT || au->firstBaseExponent() != 1)) { return u; } else { return getBestUnit((Unit*) au->firstBaseUnit()); } } case SUBTYPE_COMPOSITE_UNIT: { CompositeUnit *cu = (CompositeUnit*) u; int exp, b_exp; int points = 0; bool minus = false; bool has_positive = false; int new_points; int new_points_m; int max_points = 0; for(size_t i = 1; i <= cu->countUnits(); i++) { cu->get(i, &exp); if(exp < 0) { max_points -= exp; } else { max_points += exp; has_positive = true; } } for(size_t i = 0; i < units.size(); i++) { if(units[i]->subtype() == SUBTYPE_COMPOSITE_UNIT) { CompositeUnit *cu2 = (CompositeUnit*) units[i]; if(cu == cu2 && !cu2->isHidden()) { points = max_points - 1; } else if(!cu2->isHidden() && cu2->isSIUnit() && cu2->countUnits() == cu->countUnits()) { bool b_match = true; for(size_t i2 = 1; i2 <= cu->countUnits(); i2++) { int exp2; if(cu->get(i2, &exp) != cu2->get(i2, &exp2) || exp != exp2) { b_match = false; break; } } if(b_match) { points = max_points - 1; break; } } } } Unit *best_u = NULL; Unit *bu, *u2; AliasUnit *au; for(size_t i = 0; i < units.size(); i++) { u2 = units[i]; if(u2->subtype() == SUBTYPE_BASE_UNIT && (points == 0 || (points == 1 && minus))) { for(size_t i2 = 1; i2 <= cu->countUnits(); i2++) { if(cu->get(i2, &exp)->baseUnit() == u2 && !cu->get(i2)->hasComplexRelationTo(u2)) { points = 1; best_u = u2; minus = !has_positive && (exp < 0); break; } } } else if(!u2->isSIUnit()) { } else if(u2->subtype() == SUBTYPE_ALIAS_UNIT) { au = (AliasUnit*) u2; bu = (Unit*) au->baseUnit(); b_exp = au->baseExponent(); new_points = 0; new_points_m = 0; if((b_exp != 1 || bu->subtype() == SUBTYPE_COMPOSITE_UNIT) && !au->hasComplexRelationTo(bu)) { if(bu->subtype() == SUBTYPE_BASE_UNIT) { for(size_t i2 = 1; i2 <= cu->countUnits(); i2++) { if(cu->get(i2, &exp) == bu) { bool m = false; if(b_exp < 0 && exp < 0) { b_exp = -b_exp; exp = -exp; } else if(b_exp < 0) { b_exp = -b_exp; m = true; } else if(exp < 0) { exp = -exp; m = true; } new_points = exp - b_exp; if(new_points < 0) { new_points = -new_points; } new_points = exp - new_points; if(!allow_only_div && m && new_points >= max_points) { new_points = -1; } if(new_points > points || (!m && minus && new_points == points)) { points = new_points; minus = m; best_u = au; } break; } } } else if(au->firstBaseExponent() != 1 || au->firstBaseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { MathStructure cu_mstruct = ((CompositeUnit*) bu)->generateMathStructure(); cu_mstruct.raise(b_exp); cu_mstruct = convertToBaseUnits(cu_mstruct); if(cu_mstruct.isMultiplication()) { for(size_t i2 = 1; i2 <= cu_mstruct.countChildren(); i2++) { bu = NULL; if(cu_mstruct.getChild(i2)->isUnit()) { bu = cu_mstruct.getChild(i2)->unit(); b_exp = 1; } else if(cu_mstruct.getChild(i2)->isPower() && cu_mstruct.getChild(i2)->base()->isUnit() && cu_mstruct.getChild(i2)->exponent()->isNumber() && cu_mstruct.getChild(i2)->exponent()->number().isInteger()) { bu = cu_mstruct.getChild(i2)->base()->unit(); b_exp = cu_mstruct.getChild(i2)->exponent()->number().intValue(); } if(bu) { bool b = false; for(size_t i3 = 1; i3 <= cu->countUnits(); i3++) { if(cu->get(i3, &exp) == bu) { b = true; bool m = false; if(exp < 0 && b_exp > 0) { new_points -= b_exp; exp = -exp; m = true; } else if(exp > 0 && b_exp < 0) { new_points += b_exp; b_exp = -b_exp; m = true; } else { if(b_exp < 0) new_points_m += b_exp; else new_points_m -= b_exp; } if(exp < 0) { exp = -exp; b_exp = -b_exp; } if(exp >= b_exp) { if(m) new_points_m += exp - (exp - b_exp); else new_points += exp - (exp - b_exp); } else { if(m) new_points_m += exp - (b_exp - exp); else new_points += exp - (b_exp - exp); } break; } } if(!b) { if(b_exp < 0) b_exp = -b_exp; new_points -= b_exp; new_points_m -= b_exp; } } } if(!allow_only_div && new_points_m >= max_points) { new_points_m = -1; } if(new_points > points && new_points >= new_points_m) { minus = false; points = new_points; best_u = au; } else if(new_points_m > points || (new_points_m == points && minus)) { minus = true; points = new_points_m; best_u = au; } } } } } if(points >= max_points && !minus) break; } if(!best_u) return u; best_u = getBestUnit(best_u, false, convert_to_local_currency); if(points > 1 && points < max_points - 1) { CompositeUnit *cu_new = new CompositeUnit("", "temporary_composite_convert"); bool return_cu = minus; if(minus) { cu_new->add(best_u, -1); } else { cu_new->add(best_u); } MathStructure cu_mstruct = ((CompositeUnit*) u)->generateMathStructure(); if(minus) cu_mstruct *= best_u; else cu_mstruct /= best_u; cu_mstruct = convertToBaseUnits(cu_mstruct); CompositeUnit *cu2 = new CompositeUnit("", "temporary_composite_convert_to_best_unit"); bool b = false; for(size_t i = 1; i <= cu_mstruct.countChildren(); i++) { if(cu_mstruct.getChild(i)->isUnit()) { b = true; cu2->add(cu_mstruct.getChild(i)->unit()); } else if(cu_mstruct.getChild(i)->isPower() && cu_mstruct.getChild(i)->base()->isUnit() && cu_mstruct.getChild(i)->exponent()->isNumber() && cu_mstruct.getChild(i)->exponent()->number().isInteger()) { if(cu_mstruct.getChild(i)->exponent()->number().isGreaterThan(10) || cu_mstruct.getChild(i)->exponent()->number().isLessThan(-10)) { if(aborted() || cu_mstruct.getChild(i)->exponent()->number().isGreaterThan(1000) || cu_mstruct.getChild(i)->exponent()->number().isLessThan(-1000)) { b = false; break; } } b = true; cu2->add(cu_mstruct.getChild(i)->base()->unit(), cu_mstruct.getChild(i)->exponent()->number().intValue()); } } if(b) { Unit *u2 = getBestUnit(cu2, true, convert_to_local_currency); b = false; if(u2->subtype() == SUBTYPE_COMPOSITE_UNIT) { for(size_t i3 = 1; i3 <= ((CompositeUnit*) u2)->countUnits(); i3++) { Unit *cu_unit = ((CompositeUnit*) u2)->get(i3, &exp); for(size_t i4 = 1; i4 <= cu_new->countUnits(); i4++) { if(cu_new->get(i4, &b_exp) == cu_unit) { b = true; cu_new->setExponent(i4, b_exp + exp); break; } } if(!b) cu_new->add(cu_unit, exp); } return_cu = true; } else if(u2->subtype() == SUBTYPE_ALIAS_UNIT) { return_cu = true; for(size_t i3 = 1; i3 <= cu_new->countUnits(); i3++) { if(cu_new->get(i3, &exp) == u2) { b = true; cu_new->setExponent(i3, exp + 1); break; } } if(!b) cu_new->add(u2); } if(!u2->isRegistered() && u2 != cu2) delete u2; } delete cu2; if(return_cu) { return cu_new; } else { delete cu_new; return best_u; } } if(minus) { CompositeUnit *cu_new = new CompositeUnit("", "temporary_composite_convert"); cu_new->add(best_u, -1); return cu_new; } else { return best_u; } } } return u; } MathStructure Calculator::convertToBestUnit(const MathStructure &mstruct, const EvaluationOptions &eo, bool convert_to_si_units) { EvaluationOptions eo2 = eo; //eo2.calculate_functions = false; eo2.sync_units = false; eo2.isolate_x = false; eo2.test_comparisons = false; switch(mstruct.type()) { case STRUCT_POWER: { if(mstruct.base()->isUnit() && mstruct.exponent()->isNumber() && mstruct.exponent()->number().isRational()) { MathStructure mstruct_new(mstruct); int old_points = 0; if(mstruct_new.exponent()->isInteger()) old_points = mstruct_new.exponent()->number().intValue(); else old_points = mstruct_new.exponent()->number().numerator().intValue() + mstruct_new.exponent()->number().denominator().intValue() * (mstruct_new.exponent()->number().isNegative() ? -1 : 1); bool old_minus = false; if(old_points < 0) { old_points = -old_points; old_minus = true; } bool is_si_units = mstruct_new.base()->unit()->isSIUnit(); if(mstruct_new.base()->unit()->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { mstruct_new = convertToBestUnit(convertToBaseUnits(mstruct_new, eo), eo, convert_to_si_units); if(mstruct_new == mstruct) return mstruct_new; } else { CompositeUnit *cu = new CompositeUnit("", "temporary_composite_convert_to_best_unit"); cu->add(mstruct_new.base()->unit(), mstruct_new.exponent()->number().intValue()); Unit *u = getBestUnit(cu, false, eo.local_currency_conversion); if(u == cu) { delete cu; return mstruct_new; } mstruct_new = convert(mstruct_new, u, eo, true); if(!u->isRegistered()) delete u; delete cu; } int new_points = 0; bool new_is_si_units = true; bool new_minus = true; bool is_currency = false; if(mstruct_new.isMultiplication()) { for(size_t i = 1; i <= mstruct_new.countChildren(); i++) { if(mstruct_new.getChild(i)->isUnit()) { if(new_is_si_units && !mstruct_new.getChild(i)->unit()->isSIUnit()) new_is_si_units = false; is_currency = mstruct_new.getChild(i)->unit()->isCurrency(); new_points++; new_minus = false; } else if(mstruct_new.getChild(i)->isPower() && mstruct_new.getChild(i)->base()->isUnit() && mstruct_new.getChild(i)->exponent()->isNumber() && mstruct_new.getChild(i)->exponent()->number().isRational()) { int points = 0; if(mstruct_new.getChild(i)->exponent()->isInteger()) points = mstruct_new.getChild(i)->exponent()->number().intValue(); else points = mstruct_new.getChild(i)->exponent()->number().numerator().intValue() + mstruct_new.getChild(i)->exponent()->number().denominator().intValue() * (mstruct_new.getChild(i)->exponent()->number().isNegative() ? -1 : 1); if(new_is_si_units && !mstruct_new.getChild(i)->base()->unit()->isSIUnit()) new_is_si_units = false; is_currency = mstruct_new.getChild(i)->base()->unit()->isCurrency(); if(points < 0) { new_points -= points; } else { new_points += points; new_minus = false; } } } } else if(mstruct_new.isPower() && mstruct_new.base()->isUnit() && mstruct_new.exponent()->isNumber() && mstruct_new.exponent()->number().isRational()) { int points = 0; if(mstruct_new.exponent()->isInteger()) points = mstruct_new.exponent()->number().intValue(); else points = mstruct_new.exponent()->number().numerator().intValue() + mstruct_new.exponent()->number().denominator().intValue() * (mstruct_new.exponent()->number().isNegative() ? -1 : 1); if(new_is_si_units && !mstruct_new.base()->unit()->isSIUnit()) new_is_si_units = false; is_currency = mstruct_new.base()->unit()->isCurrency(); if(points < 0) { new_points = -points; } else { new_points = points; new_minus = false; } } else if(mstruct_new.isUnit()) { if(!mstruct_new.unit()->isSIUnit()) new_is_si_units = false; is_currency = mstruct_new.unit()->isCurrency(); new_points = 1; new_minus = false; } if(new_points == 0) return mstruct; if((new_points > old_points && (!convert_to_si_units || is_si_units || !new_is_si_units)) || (new_points == old_points && (new_minus || !old_minus) && (!is_currency || !eo.local_currency_conversion) && (!convert_to_si_units || !new_is_si_units))) return mstruct; return mstruct_new; } } case STRUCT_BITWISE_XOR: {} case STRUCT_BITWISE_OR: {} case STRUCT_BITWISE_AND: {} case STRUCT_BITWISE_NOT: {} case STRUCT_LOGICAL_XOR: {} case STRUCT_LOGICAL_OR: {} case STRUCT_LOGICAL_AND: {} case STRUCT_LOGICAL_NOT: {} case STRUCT_COMPARISON: {} case STRUCT_FUNCTION: {} case STRUCT_VECTOR: {} case STRUCT_ADDITION: { if(!mstruct.containsType(STRUCT_UNIT, true)) return mstruct; MathStructure mstruct_new(mstruct); bool b = false; for(size_t i = 0; i < mstruct_new.size(); i++) { if(mstruct_new.size() > 100 && aborted()) return mstruct; mstruct_new[i] = convertToBestUnit(mstruct_new[i], eo, convert_to_si_units); if(!b && !mstruct_new[i].equals(mstruct[i], true, true)) b = true; } if(b) { mstruct_new.childrenUpdated(); mstruct_new.eval(eo2); } return mstruct_new; } case STRUCT_UNIT: { if((!mstruct.unit()->isCurrency() || !eo.local_currency_conversion) && (!convert_to_si_units || mstruct.unit()->isSIUnit())) return mstruct; Unit *u = getBestUnit(mstruct.unit(), false, eo.local_currency_conversion); if(u != mstruct.unit() && (u->isSIUnit() || (u->isCurrency() && eo.local_currency_conversion))) { MathStructure mstruct_new = convert(mstruct, u, eo, true); if(!u->isRegistered()) delete u; return mstruct_new; } break; } case STRUCT_MULTIPLICATION: { if(!mstruct.containsType(STRUCT_UNIT, true)) return mstruct; int old_points = 0; bool old_minus = true; bool is_si_units = true; bool is_currency = false; bool child_updated = false; MathStructure mstruct_old(mstruct); for(size_t i = 1; i <= mstruct_old.countChildren(); i++) { if(mstruct_old.countChildren() > 100 && aborted()) return mstruct_old; if(mstruct_old.getChild(i)->isUnit()) { if(is_si_units && !mstruct_old.getChild(i)->unit()->isSIUnit()) is_si_units = false; is_currency = mstruct_old.getChild(i)->unit()->isCurrency(); old_points++; old_minus = false; } else if(mstruct_old.getChild(i)->isPower() && mstruct_old.getChild(i)->base()->isUnit() && mstruct_old.getChild(i)->exponent()->isNumber() && mstruct_old.getChild(i)->exponent()->number().isRational()) { int points = 0; if(mstruct_old.getChild(i)->exponent()->number().isInteger()) points = mstruct_old.getChild(i)->exponent()->number().intValue(); else points = mstruct_old.getChild(i)->exponent()->number().numerator().intValue() + mstruct_old.getChild(i)->exponent()->number().denominator().intValue() * (mstruct_old.getChild(i)->exponent()->number().isNegative() ? -1 : 1);; if(is_si_units && !mstruct_old.getChild(i)->base()->unit()->isSIUnit()) is_si_units = false; is_currency = mstruct_old.getChild(i)->base()->unit()->isCurrency(); if(points < 0) { old_points -= points; } else { old_points += points; old_minus = false; } } else if(mstruct_old.getChild(i)->size() > 0) { mstruct_old[i - 1] = convertToBestUnit(mstruct_old[i - 1], eo, convert_to_si_units); mstruct_old.childUpdated(i); if(!mstruct_old[i - 1].equals(mstruct[i - 1], true, true)) child_updated = true; } } if(child_updated) mstruct_old.eval(eo2); if((!is_currency || !eo.local_currency_conversion) && (!convert_to_si_units || is_si_units) && old_points <= 1 && !old_minus) { return mstruct_old; } MathStructure mstruct_new(convertToBaseUnits(mstruct_old, eo)); if(mstruct_new.type() != STRUCT_MULTIPLICATION) { mstruct_new = convertToBestUnit(mstruct_new, eo, convert_to_si_units); } else { CompositeUnit *cu = new CompositeUnit("", "temporary_composite_convert_to_best_unit"); bool b = false; child_updated = false; for(size_t i = 1; i <= mstruct_new.countChildren(); i++) { if(mstruct_new.countChildren() > 100 && aborted()) return mstruct_old; if(mstruct_new.getChild(i)->isUnit()) { b = true; cu->add(mstruct_new.getChild(i)->unit()); } else if(mstruct_new.getChild(i)->isPower() && mstruct_new.getChild(i)->base()->isUnit() && mstruct_new.getChild(i)->exponent()->isNumber() && mstruct_new.getChild(i)->exponent()->number().isInteger()) { b = true; cu->add(mstruct_new.getChild(i)->base()->unit(), mstruct_new.getChild(i)->exponent()->number().intValue()); } else if(mstruct_new.getChild(i)->size() > 0) { MathStructure m_i_old(mstruct_new[i - 1]); mstruct_new[i - 1] = convertToBestUnit(mstruct_new[i - 1], eo, convert_to_si_units); mstruct_new.childUpdated(i); if(!mstruct_new[i - 1].equals(m_i_old, true, true)) child_updated = true; } } bool is_converted = false; if(b) { Unit *u = getBestUnit(cu, false, eo.local_currency_conversion); if(u != cu) { mstruct_new = convert(mstruct_new, u, eo, true); if(!u->isRegistered()) delete u; is_converted = true; } } delete cu; if((!b || !is_converted) && (!convert_to_si_units || is_si_units)) { return mstruct_old; } if(child_updated) mstruct_new.eval(eo2); } if(mstruct_new == mstruct_old) return mstruct_old; int new_points = 0; bool new_minus = true; bool new_is_si_units = true; bool new_is_currency = false; if(mstruct_new.isMultiplication()) { for(size_t i = 1; i <= mstruct_new.countChildren(); i++) { if(mstruct_new.countChildren() > 100 && aborted()) return mstruct_old; if(mstruct_new.getChild(i)->isUnit()) { if(new_is_si_units && !mstruct_new.getChild(i)->unit()->isSIUnit()) new_is_si_units = false; new_is_currency = mstruct_new.getChild(i)->unit()->isCurrency(); new_points++; new_minus = false; } else if(mstruct_new.getChild(i)->isPower() && mstruct_new.getChild(i)->base()->isUnit() && mstruct_new.getChild(i)->exponent()->isNumber() && mstruct_new.getChild(i)->exponent()->number().isRational()) { int points = 0; if(mstruct_new.getChild(i)->exponent()->number().isInteger()) points = mstruct_new.getChild(i)->exponent()->number().intValue(); else points = mstruct_new.getChild(i)->exponent()->number().numerator().intValue() + mstruct_new.getChild(i)->exponent()->number().denominator().intValue() * (mstruct_new.getChild(i)->exponent()->number().isNegative() ? -1 : 1); if(new_is_si_units && !mstruct_new.getChild(i)->base()->unit()->isSIUnit()) new_is_si_units = false; new_is_currency = mstruct_new.getChild(i)->base()->unit()->isCurrency(); if(points < 0) { new_points -= points; } else { new_points += points; new_minus = false; } } } } else if(mstruct_new.isPower() && mstruct_new.base()->isUnit() && mstruct_new.exponent()->isNumber() && mstruct_new.exponent()->number().isRational()) { int points = 0; if(mstruct_new.exponent()->number().isInteger()) points = mstruct_new.exponent()->number().intValue(); else points = mstruct_new.exponent()->number().numerator().intValue() + mstruct_new.exponent()->number().denominator().intValue() * (mstruct_new.exponent()->number().isNegative() ? -1 : 1); if(new_is_si_units && !mstruct_new.base()->unit()->isSIUnit()) new_is_si_units = false; new_is_currency = mstruct_new.base()->unit()->isCurrency(); if(points < 0) { new_points = -points; } else { new_points = points; new_minus = false; } } else if(mstruct_new.isUnit()) { if(!mstruct_new.unit()->isSIUnit()) new_is_si_units = false; new_is_currency = mstruct_new.unit()->isCurrency(); new_points = 1; new_minus = false; } if(new_points == 0) return mstruct_old; if((new_points > old_points && (!convert_to_si_units || is_si_units || !new_is_si_units)) || (new_points == old_points && (new_minus || !old_minus) && (!new_is_currency || !eo.local_currency_conversion) && (!convert_to_si_units || !new_is_si_units))) return mstruct_old; return mstruct_new; } default: {} } return mstruct; } MathStructure Calculator::convertToCompositeUnit(const MathStructure &mstruct, CompositeUnit *cu, const EvaluationOptions &eo, bool always_convert) { return convert(mstruct, cu, eo, always_convert); } MathStructure Calculator::convert(const MathStructure &mstruct_to_convert, string str2, const EvaluationOptions &eo, MathStructure *to_struct) { if(to_struct) to_struct->setUndefined(); remove_blank_ends(str2); if(str2.empty()) return mstruct_to_convert; current_stage = MESSAGE_STAGE_CONVERSION; EvaluationOptions eo2 = eo; eo2.keep_prefixes = (str2[0] != '?'); if(str2[0] == '-') eo2.mixed_units_conversion = MIXED_UNITS_CONVERSION_NONE; else if(str2[0] == '+') eo2.mixed_units_conversion = MIXED_UNITS_CONVERSION_FORCE_INTEGER; else if(eo2.mixed_units_conversion != MIXED_UNITS_CONVERSION_NONE) eo2.mixed_units_conversion = MIXED_UNITS_CONVERSION_DOWNWARDS_KEEP; if(str2[0] == '?' || str2[0] == '0' || str2[0] == '+' || str2[0] == '-') { str2 = str2.substr(1, str2.length() - 1); remove_blank_ends(str2); if(str2.empty()) { current_stage = MESSAGE_STAGE_UNSET; return convertToMixedUnits(mstruct_to_convert, eo2); } } MathStructure mstruct; bool b = false; Unit *u = getUnit(str2); Variable *v = NULL; if(!u) v = getVariable(str2); if(!u && !v) { for(size_t i = 0; i < signs.size(); i++) { if(str2 == signs[i]) { u = getUnit(real_signs[i]); if(!u) v = getVariable(real_signs[i]); break; } } } if(v && (!v->isKnown() || ((KnownVariable*) v)->unit().empty())) v = NULL; if(u) { if(to_struct) to_struct->set(u); mstruct.set(convert(mstruct_to_convert, u, eo2, false, false)); b = true; } else if(v) { if(to_struct) to_struct->set(v); mstruct.set(convert(mstruct_to_convert, (KnownVariable*) v, eo2)); b = true; } else { current_stage = MESSAGE_STAGE_CONVERSION_PARSING; CompositeUnit cu("", "temporary_composite_convert", "", str2); current_stage = MESSAGE_STAGE_CONVERSION; if(to_struct) to_struct->set(cu.generateMathStructure()); if(cu.countUnits() > 0) { mstruct.set(convert(mstruct_to_convert, &cu, eo2, false, false)); b = true; } } if(!b) return mstruct_to_convert; if(!v && eo.mixed_units_conversion != MIXED_UNITS_CONVERSION_NONE) mstruct.set(convertToMixedUnits(mstruct, eo2)); current_stage = MESSAGE_STAGE_UNSET; return mstruct; } Unit* Calculator::addUnit(Unit *u, bool force, bool check_names) { if(check_names) { for(size_t i = 1; i <= u->countNames(); i++) { u->setName(getName(u->getName(i).name, u, force), i); } } if(!u->isLocal() && units.size() > 0 && units[units.size() - 1]->isLocal()) { units.insert(units.begin(), u); } else { units.push_back(u); } unitNameChanged(u, true); for(vector::iterator it = deleted_units.begin(); it != deleted_units.end(); ++it) { if(*it == u) { deleted_units.erase(it); break; } } u->setRegistered(true); u->setChanged(false); return u; } void Calculator::delPrefixUFV(Prefix *object) { int i = 0; for(vector::iterator it = ufvl.begin(); ; ++it) { del_ufvl: if(it == ufvl.end()) { break; } if(*it == object) { it = ufvl.erase(it); ufvl_t.erase(ufvl_t.begin() + i); ufvl_i.erase(ufvl_i.begin() + i); if(it == ufvl.end()) break; goto del_ufvl; } i++; } for(size_t i2 = 0; i2 < UFV_LENGTHS; i2++) { i = 0; for(vector::iterator it = ufv[0][i2].begin(); ; ++it) { del_ufv: if(it == ufv[0][i2].end()) { break; } if(*it == object) { it = ufv[0][i2].erase(it); ufv_i[0][i2].erase(ufv_i[0][i2].begin() + i); if(it == ufv[0][i2].end()) break; goto del_ufv; } i++; } } } void Calculator::delUFV(ExpressionItem *object) { int i = 0; for(vector::iterator it = ufvl.begin(); ; ++it) { del_ufvl: if(it == ufvl.end()) { break; } if(*it == object) { it = ufvl.erase(it); ufvl_t.erase(ufvl_t.begin() + i); ufvl_i.erase(ufvl_i.begin() + i); if(it == ufvl.end()) break; goto del_ufvl; } i++; } int i3 = 0; switch(object->type()) { case TYPE_FUNCTION: {i3 = 1; break;} case TYPE_UNIT: {i3 = 2; break;} case TYPE_VARIABLE: {i3 = 3; break;} } for(size_t i2 = 0; i2 < UFV_LENGTHS; i2++) { i = 0; for(vector::iterator it = ufv[i3][i2].begin(); ; ++it) { del_ufv: if(it == ufv[i3][i2].end()) { break; } if(*it == object) { it = ufv[i3][i2].erase(it); ufv_i[i3][i2].erase(ufv_i[i3][i2].begin() + i); if(it == ufv[i3][i2].end()) break; goto del_ufv; } i++; } } } Unit* Calculator::getUnit(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < units.size(); i++) { if(units[i]->subtype() != SUBTYPE_COMPOSITE_UNIT && (units[i]->hasName(name_))) { return units[i]; } } return NULL; } Unit* Calculator::getActiveUnit(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < units.size(); i++) { if(units[i]->isActive() && units[i]->subtype() != SUBTYPE_COMPOSITE_UNIT && units[i]->hasName(name_)) { return units[i]; } } return NULL; } Unit* Calculator::getLocalCurrency() { struct lconv *lc = localeconv(); if(lc) { string local_currency = lc->int_curr_symbol; remove_blank_ends(local_currency); if(!local_currency.empty()) { return CALCULATOR->getActiveUnit(local_currency); } } return NULL; } Unit* Calculator::getCompositeUnit(string internal_name_) { if(internal_name_.empty()) return NULL; for(size_t i = 0; i < units.size(); i++) { if(units[i]->subtype() == SUBTYPE_COMPOSITE_UNIT && units[i]->hasName(internal_name_)) { return units[i]; } } return NULL; } Variable* Calculator::addVariable(Variable *v, bool force, bool check_names) { if(check_names) { for(size_t i = 1; i <= v->countNames(); i++) { v->setName(getName(v->getName(i).name, v, force), i); } } if(!v->isLocal() && variables.size() > 0 && variables[variables.size() - 1]->isLocal()) { variables.insert(variables.begin(), v); } else { variables.push_back(v); } variableNameChanged(v, true); for(vector::iterator it = deleted_variables.begin(); it != deleted_variables.end(); ++it) { if(*it == v) { deleted_variables.erase(it); break; } } v->setRegistered(true); v->setChanged(false); return v; } void Calculator::expressionItemDeactivated(ExpressionItem *item) { delUFV(item); } void Calculator::expressionItemActivated(ExpressionItem *item) { ExpressionItem *item2 = getActiveExpressionItem(item); if(item2) { item2->setActive(false); } nameChanged(item); } void Calculator::expressionItemDeleted(ExpressionItem *item) { switch(item->type()) { case TYPE_VARIABLE: { for(vector::iterator it = variables.begin(); it != variables.end(); ++it) { if(*it == item) { variables.erase(it); deleted_variables.push_back((Variable*) item); break; } } break; } case TYPE_FUNCTION: { for(vector::iterator it = functions.begin(); it != functions.end(); ++it) { if(*it == item) { functions.erase(it); deleted_functions.push_back((MathFunction*) item); break; } } if(item->subtype() == SUBTYPE_DATA_SET) { for(vector::iterator it = data_sets.begin(); it != data_sets.end(); ++it) { if(*it == item) { data_sets.erase(it); break; } } } break; } case TYPE_UNIT: { for(vector::iterator it = units.begin(); it != units.end(); ++it) { if(*it == item) { units.erase(it); deleted_units.push_back((Unit*) item); break; } } break; } } for(size_t i2 = 1; i2 <= item->countNames(); i2++) { if(item->type() == TYPE_VARIABLE || item->type() == TYPE_UNIT) { for(size_t i = 0; i < variables.size(); i++) { if(!variables[i]->isLocal() && !variables[i]->isActive() && variables[i]->hasName(item->getName(i2).name, item->getName(i2).case_sensitive) && !getActiveExpressionItem(variables[i])) {variables[i]->setActive(true);} } for(size_t i = 0; i < units.size(); i++) { if(!units[i]->isLocal() && !units[i]->isActive() && units[i]->hasName(item->getName(i2).name, item->getName(i2).case_sensitive) && !getActiveExpressionItem(units[i])) units[i]->setActive(true); } } else { for(size_t i = 0; i < functions.size(); i++) { if(!functions[i]->isLocal() && !functions[i]->isActive() && functions[i]->hasName(item->getName(i2).name, item->getName(i2).case_sensitive) && !getActiveExpressionItem(functions[i])) functions[i]->setActive(true); } } } delUFV(item); } void Calculator::nameChanged(ExpressionItem *item, bool new_item) { if(!item->isActive() || item->countNames() == 0) return; if(item->type() == TYPE_UNIT && ((Unit*) item)->subtype() == SUBTYPE_COMPOSITE_UNIT) { return; } size_t l2; if(!new_item) delUFV(item); for(size_t i2 = 1; i2 <= item->countNames(); i2++) { l2 = item->getName(i2).name.length(); if(l2 > UFV_LENGTHS) { size_t i = 0, l = 0; for(vector::iterator it = ufvl.begin(); ; ++it) { if(it != ufvl.end()) { if(ufvl_t[i] == 'v') l = ((Variable*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'f') l = ((MathFunction*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'u') l = ((Unit*) (*it))->getName(ufvl_i[i]).name.length(); else if(ufvl_t[i] == 'p') l = ((Prefix*) (*it))->shortName(false).length(); else if(ufvl_t[i] == 'P') l = ((Prefix*) (*it))->longName(false).length(); else if(ufvl_t[i] == 'q') l = ((Prefix*) (*it))->unicodeName(false).length(); } if(it == ufvl.end()) { ufvl.push_back((void*) item); switch(item->type()) { case TYPE_VARIABLE: {ufvl_t.push_back('v'); break;} case TYPE_FUNCTION: {ufvl_t.push_back('f'); break;} case TYPE_UNIT: {ufvl_t.push_back('u'); break;} } ufvl_i.push_back(i2); break; } else { if(l < l2 || (item->type() == TYPE_VARIABLE && l == l2 && ufvl_t[i] == 'v') || (item->type() == TYPE_FUNCTION && l == l2 && (ufvl_t[i] != 'p' && ufvl_t[i] != 'P' && ufvl_t[i] != 'q')) || (item->type() == TYPE_UNIT && l == l2 && (ufvl_t[i] != 'p' && ufvl_t[i] != 'P' && ufvl_t[i] != 'q' && ufvl_t[i] != 'f')) ) { ufvl.insert(it, (void*) item); switch(item->type()) { case TYPE_VARIABLE: {ufvl_t.insert(ufvl_t.begin() + i, 'v'); break;} case TYPE_FUNCTION: {ufvl_t.insert(ufvl_t.begin() + i, 'f'); break;} case TYPE_UNIT: {ufvl_t.insert(ufvl_t.begin() + i, 'u'); break;} } ufvl_i.insert(ufvl_i.begin() + i, i2); break; } } i++; } } else if(l2 > 0) { l2--; switch(item->type()) { case TYPE_VARIABLE: { ufv[3][l2].push_back((void*) item); ufv_i[3][l2].push_back(i2); break; } case TYPE_FUNCTION: { ufv[1][l2].push_back((void*) item); ufv_i[1][l2].push_back(i2); break; } case TYPE_UNIT: { ufv[2][l2].push_back((void*) item); ufv_i[2][l2].push_back(i2); break; } } } } } void Calculator::variableNameChanged(Variable *v, bool new_item) { nameChanged(v, new_item); } void Calculator::functionNameChanged(MathFunction *f, bool new_item) { nameChanged(f, new_item); } void Calculator::unitNameChanged(Unit *u, bool new_item) { nameChanged(u, new_item); } Variable* Calculator::getVariable(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < variables.size(); i++) { if(variables[i]->hasName(name_)) { return variables[i]; } } return NULL; } Variable* Calculator::getActiveVariable(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < variables.size(); i++) { if(variables[i]->isActive() && variables[i]->hasName(name_)) { return variables[i]; } } return NULL; } ExpressionItem* Calculator::addExpressionItem(ExpressionItem *item, bool force) { switch(item->type()) { case TYPE_VARIABLE: { return addVariable((Variable*) item, force); } case TYPE_FUNCTION: { if(item->subtype() == SUBTYPE_DATA_SET) return addDataSet((DataSet*) item, force); else return addFunction((MathFunction*) item, force); } case TYPE_UNIT: { return addUnit((Unit*) item, force); } } return NULL; } MathFunction* Calculator::addFunction(MathFunction *f, bool force, bool check_names) { if(check_names) { for(size_t i = 1; i <= f->countNames(); i++) { f->setName(getName(f->getName(i).name, f, force), i); } } if(!f->isLocal() && functions.size() > 0 && functions[functions.size() - 1]->isLocal()) { functions.insert(functions.begin(), f); } else { functions.push_back(f); } functionNameChanged(f, true); for(vector::iterator it = deleted_functions.begin(); it != deleted_functions.end(); ++it) { if(*it == f) { deleted_functions.erase(it); break; } } f->setRegistered(true); f->setChanged(false); return f; } DataSet* Calculator::addDataSet(DataSet *dc, bool force, bool check_names) { addFunction(dc, force, check_names); data_sets.push_back(dc); return dc; } DataSet* Calculator::getDataSet(size_t index) { if(index > 0 && index <= data_sets.size()) { return data_sets[index - 1]; } return 0; } DataSet* Calculator::getDataSet(string name) { if(name.empty()) return NULL; for(size_t i = 0; i < data_sets.size(); i++) { if(data_sets[i]->hasName(name)) { return data_sets[i]; } } return NULL; } MathFunction* Calculator::getFunction(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < functions.size(); i++) { if(functions[i]->hasName(name_)) { return functions[i]; } } return NULL; } MathFunction* Calculator::getActiveFunction(string name_) { if(name_.empty()) return NULL; for(size_t i = 0; i < functions.size(); i++) { if(functions[i]->isActive() && functions[i]->hasName(name_)) { return functions[i]; } } return NULL; } bool Calculator::variableNameIsValid(const string &name_) { return !name_.empty() && name_.find_first_of(ILLEGAL_IN_NAMES) == string::npos && is_not_in(NUMBERS, name_[0]); } bool Calculator::functionNameIsValid(const string &name_) { return !name_.empty() && name_.find_first_of(ILLEGAL_IN_NAMES) == string::npos && is_not_in(NUMBERS, name_[0]); } bool Calculator::unitNameIsValid(const string &name_) { return !name_.empty() && name_.find_first_of(ILLEGAL_IN_UNITNAMES) == string::npos; } bool Calculator::variableNameIsValid(const char *name_) { if(strlen(name_) == 0) return false; if(is_in(NUMBERS, name_[0])) return false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_NAMES, name_[i])) return false; } return true; } bool Calculator::functionNameIsValid(const char *name_) { if(strlen(name_) == 0) return false; if(is_in(NUMBERS, name_[0])) return false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_NAMES, name_[i])) return false; } return true; } bool Calculator::unitNameIsValid(const char *name_) { if(strlen(name_) == 0) return false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_UNITNAMES, name_[i])) return false; } return true; } #define VERSION_BEFORE(i1, i2, i3) (version_numbers[0] < i1 || (version_numbers[0] == i1 && (version_numbers[1] < i2 || (version_numbers[1] == i2 && version_numbers[2] < i3)))) bool Calculator::variableNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) { return variableNameIsValid(name_.c_str(), version_numbers, is_user_defs); } bool Calculator::functionNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) { return functionNameIsValid(name_.c_str(), version_numbers, is_user_defs); } bool Calculator::unitNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) { return unitNameIsValid(name_.c_str(), version_numbers, is_user_defs); } bool Calculator::variableNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) { if(strlen(name_) == 0) return false; if(is_in(NUMBERS, name_[0])) return false; bool b = false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_NAMES, name_[i])) { if(is_user_defs && VERSION_BEFORE(0, 8, 1) && name_[i] == BITWISE_NOT_CH) { b = true; } else { return false; } } } if(b) { error(true, _("\"%s\" is not allowed in names anymore. Please change the name of \"%s\", or the variable will be lost."), BITWISE_NOT, name_, NULL); } return true; } bool Calculator::functionNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) { if(strlen(name_) == 0) return false; if(is_in(NUMBERS, name_[0])) return false; bool b = false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_NAMES, name_[i])) { if(is_user_defs && VERSION_BEFORE(0, 8, 1) && name_[i] == BITWISE_NOT_CH) { b = true; } else { return false; } } } if(b) { error(true, _("\"%s\" is not allowed in names anymore. Please change the name \"%s\", or the function will be lost."), BITWISE_NOT, name_, NULL); } return true; } bool Calculator::unitNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) { if(strlen(name_) == 0) return false; bool b = false; for(size_t i = 0; name_[i] != '\0'; i++) { if(is_in(ILLEGAL_IN_UNITNAMES, name_[i])) { if(is_user_defs && VERSION_BEFORE(0, 8, 1) && name_[i] == BITWISE_NOT_CH) { b = true; } else { return false; } } } if(b) { error(true, _("\"%s\" is not allowed in names anymore. Please change the name \"%s\", or the unit will be lost."), BITWISE_NOT, name_, NULL); } return true; } string Calculator::convertToValidVariableName(string name_) { if(name_.empty()) return "var_1"; size_t i = 0; while(true) { i = name_.find_first_of(ILLEGAL_IN_NAMES_MINUS_SPACE_STR, i); if(i == string::npos) break; name_.erase(name_.begin() + i); } gsub(SPACE, UNDERSCORE, name_); while(is_in(NUMBERS, name_[0])) { name_.erase(name_.begin()); } return name_; } string Calculator::convertToValidFunctionName(string name_) { if(name_.empty()) return "func_1"; return convertToValidVariableName(name_); } string Calculator::convertToValidUnitName(string name_) { if(name_.empty()) return "new_unit"; size_t i = 0; string stmp = ILLEGAL_IN_NAMES_MINUS_SPACE_STR + NUMBERS; while(true) { i = name_.find_first_of(stmp, i); if(i == string::npos) break; name_.erase(name_.begin() + i); } gsub(SPACE, UNDERSCORE, name_); return name_; } bool Calculator::nameTaken(string name, ExpressionItem *object) { if(name.empty()) return false; if(object) { switch(object->type()) { case TYPE_VARIABLE: {} case TYPE_UNIT: { for(size_t index = 0; index < variables.size(); index++) { if(variables[index]->isActive() && variables[index]->hasName(name)) { return variables[index] != object; } } for(size_t i = 0; i < units.size(); i++) { if(units[i]->isActive() && units[i]->hasName(name)) { return units[i] != object; } } break; } case TYPE_FUNCTION: { for(size_t index = 0; index < functions.size(); index++) { if(functions[index]->isActive() && functions[index]->hasName(name)) { return functions[index] != object; } } break; } } } else { return getActiveExpressionItem(name) != NULL; } return false; } bool Calculator::variableNameTaken(string name, Variable *object) { if(name.empty()) return false; for(size_t index = 0; index < variables.size(); index++) { if(variables[index]->isActive() && variables[index]->hasName(name)) { return variables[index] != object; } } for(size_t i = 0; i < units.size(); i++) { if(units[i]->isActive() && units[i]->hasName(name)) { return true; } } return false; } bool Calculator::unitNameTaken(string name, Unit *object) { if(name.empty()) return false; for(size_t index = 0; index < variables.size(); index++) { if(variables[index]->isActive() && variables[index]->hasName(name)) { return true; } } for(size_t i = 0; i < units.size(); i++) { if(units[i]->isActive() && units[i]->hasName(name)) { return units[i] == object; } } return false; } bool Calculator::functionNameTaken(string name, MathFunction *object) { if(name.empty()) return false; for(size_t index = 0; index < functions.size(); index++) { if(functions[index]->isActive() && functions[index]->hasName(name)) { return functions[index] != object; } } return false; } bool Calculator::unitIsUsedByOtherUnits(const Unit *u) const { const Unit *u2; for(size_t i = 0; i < units.size(); i++) { if(units[i] != u) { u2 = units[i]; while(u2->subtype() == SUBTYPE_ALIAS_UNIT) { u2 = ((AliasUnit*) u2)->firstBaseUnit(); if(u2 == u) { return true; } } } } return false; } bool compare_name(const string &name, const string &str, const size_t &name_length, const size_t &str_index) { if(name_length == 0) return false; if(name[0] != str[str_index]) return false; if(name_length == 1) return true; for(size_t i = 1; i < name_length; i++) { if(name[i] != str[str_index + i]) return false; } return true; } size_t compare_name_no_case(const string &name, const string &str, const size_t &name_length, const size_t &str_index) { if(name_length == 0) return 0; size_t is = str_index; for(size_t i = 0; i < name_length; i++, is++) { if(is >= str.length()) return 0; if((name[i] < 0 && i + 1 < name_length) || (str[is] < 0 && is + 1 < str.length())) { size_t i2 = 1, is2 = 1; if(name[i] < 0) { while(i2 + i < name_length && name[i2 + i] < 0) { i2++; } } if(str[is] < 0) { while(is2 + is < str.length() && str[is2 + is] < 0) { is2++; } } bool isequal = (i2 == is2); if(isequal) { for(size_t i3 = 0; i3 < i2; i3++) { if(str[is + i3] != name[i + i3]) { isequal = false; break; } } } if(!isequal) { char *gstr1 = utf8_strdown(name.c_str() + (sizeof(char) * i), i2); char *gstr2 = utf8_strdown(str.c_str() + (sizeof(char) * (is)), is2); if(!gstr1 || !gstr2) return 0; if(strcmp(gstr1, gstr2) != 0) {free(gstr1); free(gstr2); return 0;} free(gstr1); free(gstr2); } i += i2 - 1; is += is2 - 1; } else if(name[i] != str[is] && !((name[i] >= 'a' && name[i] <= 'z') && name[i] - 32 == str[is]) && !((name[i] <= 'Z' && name[i] >= 'A') && name[i] + 32 == str[is])) { return 0; } } return is - str_index; } const char *internal_signs[] = {SIGN_PLUSMINUS, "\b", "+/-", "\b"}; #define INTERNAL_SIGNS_COUNT 4 #define INTERNAL_NUMBER_CHARS "\b" #define DUODECIMAL_CHARS "EX" void Calculator::parseSigns(string &str, bool convert_to_internal_representation) const { vector q_begin; vector q_end; size_t quote_index = 0; while(true) { quote_index = str.find_first_of("\"\'", quote_index); if(quote_index == string::npos) { break; } q_begin.push_back(quote_index); quote_index = str.find(str[quote_index], quote_index + 1); if(quote_index == string::npos) { q_end.push_back(str.length() - 1); break; } q_end.push_back(quote_index); quote_index++; } for(size_t i = 0; i < signs.size(); i++) { size_t ui = str.find(signs[i]); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(signs[i], q_end[ui2] + 1); b = true; break; } } if(!b) { int index_shift = real_signs[i].length() - signs[i].length(); for(size_t ui2 = 0; ui2 < q_begin.size(); ui2++) { if(q_begin[ui2] >= ui) { q_begin[ui2] += index_shift; q_end[ui2] += index_shift; } } str.replace(ui, signs[i].length(), real_signs[i]); ui = str.find(signs[i], ui + real_signs[i].length()); } } } if(convert_to_internal_representation) { remove_blank_ends(str); remove_duplicate_blanks(str); for(size_t i = 0; i < INTERNAL_SIGNS_COUNT; i += 2) { size_t ui = str.find(internal_signs[i]); while(ui != string::npos) { bool b = false; for(size_t ui2 = 0; ui2 < q_end.size(); ui2++) { if(ui <= q_end[ui2] && ui >= q_begin[ui2]) { ui = str.find(internal_signs[i], q_end[ui2] + 1); b = true; break; } } if(!b) { int index_shift = strlen(internal_signs[i + 1]) - strlen(internal_signs[i]); for(size_t ui2 = 0; ui2 < q_begin.size(); ui2++) { if(q_begin[ui2] >= ui) { q_begin[ui2] += index_shift; q_end[ui2] += index_shift; } } str.replace(ui, strlen(internal_signs[i]), internal_signs[i + 1]); ui = str.find(internal_signs[i], ui + strlen(internal_signs[i + 1])); } } } } } MathStructure Calculator::parse(string str, const ParseOptions &po) { MathStructure mstruct; parse(&mstruct, str, po); return mstruct; } void Calculator::parse(MathStructure *mstruct, string str, const ParseOptions &parseoptions) { ParseOptions po = parseoptions; MathStructure *unended_function = po.unended_function; po.unended_function = NULL; mstruct->clear(); const string *name = NULL; string stmp, stmp2; bool b_prime_quote = true; size_t i_degree = str.find(SIGN_DEGREE); if(i_degree != string::npos && i_degree < str.length() - strlen(SIGN_DEGREE) && is_not_in(NOT_IN_NAMES NUMBER_ELEMENTS, str[i_degree + strlen(SIGN_DEGREE)])) i_degree = string::npos; if(i_degree == string::npos) { size_t i_quote = str.find('\'', 0); size_t i_dquote = str.find('\"', 0); if(i_quote == 0 || i_dquote == 0) { b_prime_quote = false; } else if((i_quote != string::npos && i_quote < str.length() - 1 && str.find('\'', i_quote + 1) != string::npos) || (i_quote != string::npos && i_dquote == i_quote + 1) || (i_dquote != string::npos && i_dquote < str.length() - 1 && str.find('\"', i_dquote + 1) != string::npos)) { b_prime_quote = false; while(i_dquote != string::npos) { i_quote = str.rfind('\'', i_dquote - 1); if(i_quote != string::npos) { size_t i_prev = str.find_last_not_of(SPACES, i_quote - 1); if(i_prev != string::npos && is_in(NUMBER_ELEMENTS, str[i_prev])) { if(is_in(NUMBER_ELEMENTS, str[str.find_first_not_of(SPACES, i_quote + 1)]) && str.find_first_not_of(SPACES NUMBER_ELEMENTS, i_quote + 1) == i_dquote) { if(i_prev == 0) { b_prime_quote = true; break; } else { i_prev = str.find_last_not_of(NUMBER_ELEMENTS, i_prev - 1); if(i_prev == string::npos || (str[i_prev] != '\"' && str[i_prev] != '\'')) { b_prime_quote = true; break; } } } } } i_dquote = str.find('\"', i_dquote + 2); } } } if(b_prime_quote) { gsub("\'", "′", str); gsub("\"", "″", str); } parseSigns(str, true); for(size_t str_index = 0; str_index < str.length(); str_index++) { if(str[str_index] == '\"' || str[str_index] == '\'') { if(str_index == str.length() - 1) { str.erase(str_index, 1); } else { size_t i = str.find(str[str_index], str_index + 1); size_t name_length; if(i == string::npos) { i = str.length(); name_length = i - str_index; } else { name_length = i - str_index + 1; } stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(str.substr(str_index + 1, i - str_index - 1)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1; } } } if(po.brackets_as_parentheses) { gsub(LEFT_VECTOR_WRAP, LEFT_PARENTHESIS, str); gsub(RIGHT_VECTOR_WRAP, RIGHT_PARENTHESIS, str); } size_t isave = 0; if((isave = str.find(":=", 1)) != string::npos) { string name = str.substr(0, isave); string value = str.substr(isave + 2, str.length() - (isave + 2)); str = value; str += COMMA; str += name; f_save->parse(*mstruct, str, po); return; } if(((po.base >= 2 && po.base <= 10) || po.base == BASE_DUODECIMAL) && po.default_dataset != NULL && str.length() > 1) { size_t str_index = str.find(DOT_CH, 1); while(str_index != string::npos) { if(str_index + 1 < str.length() && ((is_not_in(po.base == BASE_DUODECIMAL ? NUMBERS INTERNAL_NUMBER_CHARS NOT_IN_NAMES DUODECIMAL_CHARS : NUMBERS INTERNAL_NUMBER_CHARS NOT_IN_NAMES, str[str_index + 1]) && is_not_in(NOT_IN_NAMES, str[str_index - 1])) || (is_not_in(NOT_IN_NAMES, str[str_index + 1]) && is_not_in(po.base == BASE_DUODECIMAL ? NUMBERS INTERNAL_NUMBER_CHARS NOT_IN_NAMES DUODECIMAL_CHARS : NUMBERS INTERNAL_NUMBER_CHARS NOT_IN_NAMES, str[str_index - 1])))) { size_t dot_index = str.find_first_of(NOT_IN_NAMES DOT, str_index + 1); if(dot_index != string::npos && str[dot_index] == DOT_CH) { str_index = dot_index; } else { size_t property_index = str.find_last_of(NOT_IN_NAMES, str_index - 1); if(property_index == string::npos) { str.insert(0, 1, '.'); str.insert(0, po.default_dataset->referenceName()); str_index += po.default_dataset->referenceName().length() + 1; } else { str.insert(property_index + 1, 1, '.'); str.insert(property_index + 1, po.default_dataset->referenceName()); str_index += po.default_dataset->referenceName().length() + 1; } } } str_index = str.find(DOT_CH, str_index + 1); } } //remove spaces in numbers size_t space_i = 0; if(!po.rpn) { space_i = str.find(SPACE_CH, 0); while(space_i != string::npos) { if(is_in(NUMBERS INTERNAL_NUMBER_CHARS DOT, str[space_i + 1]) && is_in(NUMBERS INTERNAL_NUMBER_CHARS DOT, str[space_i - 1])) { str.erase(space_i, 1); space_i--; } space_i = str.find(SPACE_CH, space_i + 1); } } bool b_degree = (i_degree != string::npos); size_t i_quote = str.find("′"); size_t i_dquote = str.find("″"); while(i_quote != string::npos || i_dquote != string::npos) { size_t i_op = 0; if(i_quote == string::npos || i_dquote < i_quote) { bool b = false; if(b_degree) { i_degree = str.rfind(SIGN_DEGREE, i_dquote - 1); if(i_degree != string::npos && i_degree > 0 && i_degree < i_dquote) { size_t i_op = str.find_first_not_of(SPACE, i_degree + strlen(SIGN_DEGREE)); if(i_op != string::npos) { i_op = str.find_first_not_of(SPACE, i_degree + strlen(SIGN_DEGREE)); if(is_in(NUMBER_ELEMENTS, str[i_op])) i_op = str.find_first_not_of(NUMBER_ELEMENTS SPACE, i_op); else i_op = 0; } size_t i_prev = string::npos; if(i_op == i_dquote) { i_prev = str.find_last_not_of(SPACE, i_degree - 1); if(i_prev != string::npos) { if(is_in(NUMBER_ELEMENTS, str[i_prev])) { i_prev = str.find_last_not_of(NUMBER_ELEMENTS SPACE, i_prev); if(i_prev == string::npos) i_prev = 0; else i_prev++; } else { i_prev = string::npos; } } } if(i_prev != string::npos) { str.insert(i_prev, LEFT_PARENTHESIS); i_degree++; i_op++; str.replace(i_op, strlen("″"), "arcsec" RIGHT_PARENTHESIS); str.replace(i_degree, strlen(SIGN_DEGREE), "deg" PLUS); b = true; } } } if(!b) { if(str.length() >= i_dquote + strlen("″") && is_in(NUMBERS, str[i_dquote + strlen("″")])) str.insert(i_dquote + strlen("″"), " "); str.replace(i_dquote, strlen("″"), b_degree ? "arcsec" : "in"); i_op = i_dquote; } } else { bool b = false; if(b_degree) { i_degree = str.rfind(SIGN_DEGREE, i_quote - 1); if(i_degree != string::npos && i_degree > 0 && i_degree < i_quote) { size_t i_op = str.find_first_not_of(SPACE, i_degree + strlen(SIGN_DEGREE)); if(i_op != string::npos) { i_op = str.find_first_not_of(SPACE, i_degree + strlen(SIGN_DEGREE)); if(is_in(NUMBER_ELEMENTS, str[i_op])) i_op = str.find_first_not_of(NUMBER_ELEMENTS SPACE, i_op); else i_op = 0; } size_t i_prev = string::npos; if(i_op == i_quote) { i_prev = str.find_last_not_of(SPACE, i_degree - 1); if(i_prev != string::npos) { if(is_in(NUMBER_ELEMENTS, str[i_prev])) { i_prev = str.find_last_not_of(NUMBER_ELEMENTS SPACE, i_prev); if(i_prev == string::npos) i_prev = 0; else i_prev++; } else { i_prev = string::npos; } } } if(i_prev != string::npos) { str.insert(i_prev, LEFT_PARENTHESIS); i_degree++; i_quote++; i_op++; if(i_dquote != string::npos) { i_dquote++; size_t i_op2 = str.find_first_not_of(SPACE, i_quote + strlen("′")); if(i_op2 != string::npos && is_in(NUMBER_ELEMENTS, str[i_op2])) i_op2 = str.find_first_not_of(NUMBER_ELEMENTS SPACE, i_op2); else i_op2 = 0; if(i_op2 == i_dquote) { str.replace(i_dquote, strlen("″"), "arcsec" RIGHT_PARENTHESIS); i_op = i_op2; } } str.replace(i_quote, strlen("′"), i_op == i_quote ? "arcmin" RIGHT_PARENTHESIS : "arcmin" PLUS); str.replace(i_degree, strlen(SIGN_DEGREE), "deg" PLUS); b = true; } } } if(!b) { i_op = str.find_first_not_of(SPACE, i_quote + strlen("′")); if(i_op != string::npos && is_in(NUMBER_ELEMENTS, str[i_op])) i_op = str.find_first_not_of(NUMBER_ELEMENTS SPACE, i_op); else i_op = 0; size_t i_prev = string::npos; if(((!b_degree && i_op == string::npos) || i_op == i_dquote) && i_quote != 0) { i_prev = str.find_last_not_of(SPACE, i_quote - 1); if(i_prev != string::npos) { if(is_in(NUMBER_ELEMENTS, str[i_prev])) { i_prev = str.find_last_not_of(NUMBER_ELEMENTS SPACE, i_prev); if(i_prev == string::npos) i_prev = 0; else i_prev++; } else { i_prev = string::npos; } } } if(i_prev != string::npos) { str.insert(i_prev, LEFT_PARENTHESIS); i_quote++; if(i_op == string::npos) str += b_degree ? "arcsec" RIGHT_PARENTHESIS : "in" RIGHT_PARENTHESIS; else str.replace(i_op + 1, strlen("″"), b_degree ? "arcsec" RIGHT_PARENTHESIS : "in" RIGHT_PARENTHESIS); str.replace(i_quote, strlen("′"), b_degree ? "arcmin" PLUS : "ft" PLUS); if(i_op == string::npos) break; i_op++; } else { if(str.length() >= i_quote + strlen("′") && is_in(NUMBERS, str[i_quote + strlen("′")])) str.insert(i_quote + strlen("′"), " "); str.replace(i_quote, strlen("′"), b_degree ? "arcmin" : "ft"); i_op = i_quote; } } } if(i_dquote != string::npos) i_dquote = str.find("″", i_op); if(i_quote != string::npos) i_quote = str.find("′", i_op); } for(size_t str_index = 0; str_index < str.length(); str_index++) { if(str[str_index] == LEFT_VECTOR_WRAP_CH) { int i4 = 1; size_t i3 = str_index; while(true) { i3 = str.find_first_of(LEFT_VECTOR_WRAP RIGHT_VECTOR_WRAP, i3 + 1); if(i3 == string::npos) { for(; i4 > 0; i4--) { str += RIGHT_VECTOR_WRAP; } i3 = str.length() - 1; } else if(str[i3] == LEFT_VECTOR_WRAP_CH) { i4++; } else if(str[i3] == RIGHT_VECTOR_WRAP_CH) { i4--; if(i4 > 0) { size_t i5 = str.find_first_not_of(SPACE, i3 + 1); if(i5 != string::npos && str[i5] == LEFT_VECTOR_WRAP_CH) { str.insert(i5, COMMA); } } } if(i4 == 0) { stmp2 = str.substr(str_index + 1, i3 - str_index - 1); stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(parseAddVectorId(stmp2, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, i3 + 1 - str_index, stmp); str_index += stmp.length() - 1; break; } } } else if(str[str_index] == '\\' && str_index + 1 < str.length() && is_not_in(NOT_IN_NAMES, str[str_index + 1])) { stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; size_t l = 1; if(str[str_index + l] < 0) { do { l++; } while(str_index + l < str.length() && str[str_index + l] < 0 && (unsigned char) str[str_index + l] < 0xC0); l--; } MathStructure *mstruct = new MathStructure(str.substr(str_index + 1, l)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, l + 1, stmp); str_index += stmp.length() - l; } else if(((po.base >= 2 && po.base <= 10) || po.base == BASE_DUODECIMAL) && str[str_index] == '!' && po.functions_enabled) { if(str_index > 0 && (str.length() - str_index == 1 || str[str_index + 1] != EQUALS_CH)) { stmp = ""; size_t i5 = str.find_last_not_of(SPACE, str_index - 1); size_t i3; if(i5 == string::npos) { } else if(str[i5] == RIGHT_PARENTHESIS_CH) { if(i5 == 0) { stmp2 = str.substr(0, i5 + 1); } else { i3 = i5 - 1; size_t i4 = 1; while(true) { i3 = str.find_last_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, i3); if(i3 == string::npos) { stmp2 = str.substr(0, i5 + 1); break; } if(str[i3] == RIGHT_PARENTHESIS_CH) { i4++; } else { i4--; if(i4 == 0) { stmp2 = str.substr(i3, i5 + 1 - i3); break; } } if(i3 == 0) { stmp2 = str.substr(0, i5 + 1); break; } i3--; } } } else if(str[i5] == ID_WRAP_RIGHT_CH && (i3 = str.find_last_of(ID_WRAP_LEFT, i5 - 1)) != string::npos) { stmp2 = str.substr(i3, i5 + 1 - i3); } else if(is_not_in(RESERVED OPERATORS SPACES VECTOR_WRAPS PARENTHESISS COMMAS, str[i5])) { i3 = str.find_last_of(RESERVED OPERATORS SPACES VECTOR_WRAPS PARENTHESISS COMMAS, i5); if(i3 == string::npos) { stmp2 = str.substr(0, i5 + 1); } else { stmp2 = str.substr(i3 + 1, i5 - i3); } } if(!stmp2.empty()) { stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; int ifac = 1; i3 = str_index + 1; size_t i4 = i3; while((i3 = str.find_first_not_of(SPACE, i3)) != string::npos && str[i3] == '!') { ifac++; i3++; i4 = i3; } if(ifac == 2) stmp += i2s(parseAddId(f_factorial2, stmp2, po)); else if(ifac == 1) stmp += i2s(parseAddId(f_factorial, stmp2, po)); else stmp += i2s(parseAddIdAppend(f_multifactorial, MathStructure(ifac, 1, 0), stmp2, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(i5 - stmp2.length() + 1, stmp2.length() + i4 - i5 - 1, stmp); str_index = stmp.length() + i5 - stmp2.length(); } } } else if(str[str_index] == SPACE_CH) { size_t i = str.find(SPACE, str_index + 1); if(i != string::npos) { i -= str_index + 1; size_t il = 0; if((il = compare_name_no_case(per_str, str, per_str_len, str_index + 1))) { str.replace(str_index + 1, il, DIVISION); str_index++; } else if((il = compare_name_no_case(times_str, str, times_str_len, str_index + 1))) { str.replace(str_index + 1, il, MULTIPLICATION); str_index++; } else if((il = compare_name_no_case(plus_str, str, plus_str_len, str_index + 1))) { str.replace(str_index + 1, il, PLUS); str_index++; } else if((il = compare_name_no_case(minus_str, str, minus_str_len, str_index + 1))) { str.replace(str_index + 1, il, MINUS); str_index++; } else if((il = compare_name_no_case(and_str, str, and_str_len, str_index + 1))) { str.replace(str_index + 1, il, LOGICAL_AND); str_index++; } else if(i == AND_str_len && (il = compare_name_no_case(AND_str, str, AND_str_len, str_index + 1))) { str.replace(str_index + 1, il, LOGICAL_AND); str_index++; } else if((il = compare_name_no_case(or_str, str, or_str_len, str_index + 1))) { str.replace(str_index + 1, il, LOGICAL_OR); str_index++; } else if(i == OR_str_len && (il = compare_name_no_case(OR_str, str, OR_str_len, str_index + 1))) { str.replace(str_index + 1, il, LOGICAL_OR); str_index++; // } else if(compare_name_no_case(XOR_str, str, XOR_str_len, str_index + 1)) { } } } else if(str_index > 0 && po.base >= 2 && po.base <= 10 && is_in(EXPS, str[str_index]) && str_index + 1 < str.length() && (is_in(NUMBER_ELEMENTS, str[str_index + 1]) || (is_in(PLUS MINUS, str[str_index + 1]) && str_index + 2 < str.length() && is_in(NUMBER_ELEMENTS, str[str_index + 2]))) && is_in(NUMBER_ELEMENTS, str[str_index - 1])) { //don't do anything when e is used instead of E for EXP } else if(po.base == BASE_DECIMAL && str[str_index] == '0' && (str_index == 0 || is_in(ILLEGAL_IN_NAMES, str[str_index - 1]))) { if(str_index + 2 < str.length() && (str[str_index + 1] == 'x' || str[str_index + 1] == 'X') && is_in(NUMBER_ELEMENTS "abcdefABCDEF", str[str_index + 2])) { //hexadecimal number 0x... size_t i; if(po.rpn) i = str.find_first_not_of(NUMBER_ELEMENTS "abcdefABCDEF", str_index + 2); else i = str.find_first_not_of(SPACE NUMBER_ELEMENTS "abcdefABCDEF", str_index + 2); size_t name_length; if(i == string::npos) i = str.length(); name_length = i - str_index; ParseOptions po_hex = po; po_hex.base = BASE_HEXADECIMAL; stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(Number(str.substr(str_index, i - str_index), po_hex)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1; } else if(str_index + 2 < str.length() && (str[str_index + 1] == 'b' || str[str_index + 1] == 'B') && is_in("01", str[str_index + 2])) { //binary number 0b... size_t i; if(po.rpn) i = str.find_first_not_of(NUMBER_ELEMENTS, str_index + 2); else i = str.find_first_not_of(SPACE NUMBER_ELEMENTS, str_index + 2); size_t name_length; if(i == string::npos) i = str.length(); name_length = i - str_index; ParseOptions po_bin = po; po_bin.base = BASE_BINARY; stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(Number(str.substr(str_index, i - str_index), po_bin)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1; } else if(str_index + 2 < str.length() && (str[str_index + 1] == 'o' || str[str_index + 1] == 'O') && is_in(NUMBERS, str[str_index + 2])) { //octal number 0o... size_t i; if(po.rpn) i = str.find_first_not_of(NUMBER_ELEMENTS, str_index + 2); else i = str.find_first_not_of(SPACE NUMBER_ELEMENTS, str_index + 2); size_t name_length; if(i == string::npos) i = str.length(); name_length = i - str_index; ParseOptions po_oct = po; po_oct.base = BASE_OCTAL; stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(Number(str.substr(str_index, i - str_index), po_oct)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1; /*} else if(str_index + 1 < str.length() && is_in("123456789", str[str_index + 1])) { //octal number 0... size_t i = str.find_first_not_of(SPACE NUMBER_ELEMENTS, str_index + 1); size_t name_length; if(i == string::npos) i = str.length(); name_length = i - str_index; ParseOptions po_oct = po; po_oct.base = BASE_OCTAL; stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; MathStructure *mstruct = new MathStructure(Number(str.substr(str_index, i - str_index), po_oct)); stmp += i2s(addId(mstruct)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length() - 1;*/ } } else if((po.base >= 2 && po.base <= 10 && is_not_in(NUMBERS INTERNAL_NUMBER_CHARS NOT_IN_NAMES, str[str_index])) || (po.base == BASE_DUODECIMAL && is_not_in(NUMBERS INTERNAL_NUMBER_CHARS NOT_IN_NAMES DUODECIMAL_CHARS, str[str_index]))) { bool p_mode = false; void *best_p_object = NULL; Prefix *best_p = NULL; size_t best_pl = 0; size_t best_pnl = 0; bool moved_forward = false; const string *found_function_name = NULL; bool case_sensitive = false; size_t found_function_name_length = 0; void *found_function = NULL, *object = NULL; int vt2 = -1; size_t ufv_index; size_t name_length; size_t vt3 = 0; char ufvt = 0; size_t last_name_char = str.find_first_of(NOT_IN_NAMES, str_index + 1); if(last_name_char == string::npos) { last_name_char = str.length() - 1; } else { last_name_char--; } size_t last_unit_char = str.find_last_not_of(NUMBERS INTERNAL_NUMBER_CHARS, last_name_char); size_t name_chars_left = last_name_char - str_index + 1; size_t unit_chars_left = last_unit_char - str_index + 1; if(name_chars_left <= UFV_LENGTHS) { ufv_index = name_chars_left - 1; vt2 = 0; } else { ufv_index = 0; } Prefix *p = NULL; while(vt2 < 4) { name = NULL; p = NULL; switch(vt2) { case -1: { if(ufv_index < ufvl.size()) { switch(ufvl_t[ufv_index]) { case 'v': { if(po.variables_enabled && !p_mode) { name = &((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).name; case_sensitive = ((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).case_sensitive; name_length = name->length(); if(name_length < found_function_name_length) { name = NULL; } else if(po.limit_implicit_multiplication) { if(name_length != name_chars_left && name_length != unit_chars_left) name = NULL; } else if(name_length > name_chars_left) { name = NULL; } } break; } case 'f': { if(po.functions_enabled && !found_function_name && !p_mode) { name = &((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).name; case_sensitive = ((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).case_sensitive; name_length = name->length(); if(po.limit_implicit_multiplication) { if(name_length != name_chars_left && name_length != unit_chars_left) name = NULL; } else if(name_length > name_chars_left || name_length < found_function_name_length) { name = NULL; } } break; } case 'u': { if(po.units_enabled && !p_mode) { name = &((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).name; case_sensitive = ((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).case_sensitive; name_length = name->length(); if(name_length < found_function_name_length) { name = NULL; } else if(po.limit_implicit_multiplication || ((ExpressionItem*) ufvl[ufv_index])->getName(ufvl_i[ufv_index]).plural) { if(name_length != unit_chars_left) name = NULL; } else if(name_length > unit_chars_left) { name = NULL; } } break; } case 'p': { if(!p && po.units_enabled) { name = &((Prefix*) ufvl[ufv_index])->shortName(); name_length = name->length(); if(name_length >= unit_chars_left || name_length < found_function_name_length) { name = NULL; } } case_sensitive = true; break; } case 'P': { if(!p && po.units_enabled) { name = &((Prefix*) ufvl[ufv_index])->longName(); name_length = name->length(); if(name_length >= unit_chars_left || name_length < found_function_name_length) { name = NULL; } } case_sensitive = false; break; } case 'q': { if(!p && po.units_enabled) { name = &((Prefix*) ufvl[ufv_index])->unicodeName(); name_length = name->length(); if(name_length >= unit_chars_left || name_length < found_function_name_length) { name = NULL; } } case_sensitive = true; break; } } ufvt = ufvl_t[ufv_index]; object = ufvl[ufv_index]; ufv_index++; break; } else { if(found_function_name) { vt2 = 4; break; } vt2 = 0; vt3 = 0; if(po.limit_implicit_multiplication && unit_chars_left <= UFV_LENGTHS) { ufv_index = unit_chars_left - 1; } else { ufv_index = UFV_LENGTHS - 1; } } } case 0: { if(po.units_enabled && ufv_index < unit_chars_left - 1 && vt3 < ufv[vt2][ufv_index].size()) { object = ufv[vt2][ufv_index][vt3]; switch(ufv_i[vt2][ufv_index][vt3]) { case 1: { ufvt = 'P'; name = &((Prefix*) object)->longName(); name_length = name->length(); case_sensitive = false; break; } case 2: { ufvt = 'p'; name = &((Prefix*) object)->shortName(); name_length = name->length(); case_sensitive = true; break; } case 3: { ufvt = 'q'; name = &((Prefix*) object)->unicodeName(); name_length = name->length(); case_sensitive = true; break; } } vt3++; break; } vt2 = 1; vt3 = 0; } case 1: { if(!found_function_name && po.functions_enabled && !p_mode && (!po.limit_implicit_multiplication || ufv_index + 1 == unit_chars_left || ufv_index + 1 == name_chars_left) && vt3 < ufv[vt2][ufv_index].size()) { object = ufv[vt2][ufv_index][vt3]; ufvt = 'f'; name = &((MathFunction*) object)->getName(ufv_i[vt2][ufv_index][vt3]).name; name_length = name->length(); case_sensitive = ((MathFunction*) object)->getName(ufv_i[vt2][ufv_index][vt3]).case_sensitive; vt3++; break; } vt2 = 2; vt3 = 0; } case 2: { if(po.units_enabled && !p_mode && (!po.limit_implicit_multiplication || ufv_index + 1 == unit_chars_left) && ufv_index < unit_chars_left && vt3 < ufv[vt2][ufv_index].size()) { object = ufv[vt2][ufv_index][vt3]; if(ufv_index + 1 == unit_chars_left || !((Unit*) object)->getName(ufv_i[vt2][ufv_index][vt3]).plural) { ufvt = 'u'; name = &((Unit*) object)->getName(ufv_i[vt2][ufv_index][vt3]).name; name_length = name->length(); case_sensitive = ((Unit*) object)->getName(ufv_i[vt2][ufv_index][vt3]).case_sensitive; } vt3++; break; } vt2 = 3; vt3 = 0; } case 3: { if(po.variables_enabled && !p_mode && (!po.limit_implicit_multiplication || ufv_index + 1 == unit_chars_left || ufv_index + 1 == name_chars_left) && vt3 < ufv[vt2][ufv_index].size()) { object = ufv[vt2][ufv_index][vt3]; ufvt = 'v'; name = &((Variable*) object)->getName(ufv_i[vt2][ufv_index][vt3]).name; name_length = name->length(); case_sensitive = ((Variable*) object)->getName(ufv_i[vt2][ufv_index][vt3]).case_sensitive; vt3++; break; } if(ufv_index == 0 || found_function_name) { vt2 = 4; } else { ufv_index--; vt3 = 0; vt2 = 0; } } } if(name && name_length >= found_function_name_length && ((case_sensitive && compare_name(*name, str, name_length, str_index)) || (!case_sensitive && (name_length = compare_name_no_case(*name, str, name_length, str_index))))) { moved_forward = false; switch(ufvt) { case 'v': { stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure((Variable*) object))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length(); moved_forward = true; break; } case 'f': { if(((ExpressionItem*) object)->subtype() == SUBTYPE_DATA_SET && str[str_index + name_length] == DOT_CH) { str[str_index + name_length] = LEFT_PARENTHESIS_CH; size_t dot2_index = str.find(DOT_CH, str_index + name_length + 1); str[dot2_index] = COMMA_CH; size_t end_index = str.find_first_of(NOT_IN_NAMES, dot2_index + 1); if(end_index == string::npos) str += RIGHT_PARENTHESIS_CH; else str.insert(end_index, 1, RIGHT_PARENTHESIS_CH); } size_t not_space_index; if((not_space_index = str.find_first_not_of(SPACES, str_index + name_length)) == string::npos || str[not_space_index] != LEFT_PARENTHESIS_CH) { found_function = object; found_function_name = name; found_function_name_length = name_length; break; } set_function: MathFunction *f = (MathFunction*) object; int i4 = -1; size_t i6; if(f->args() == 0) { size_t i7 = str.find_first_not_of(SPACES, str_index + name_length); if(i7 != string::npos && str[i7] == LEFT_PARENTHESIS_CH) { i7 = str.find_first_not_of(SPACES, i7 + 1); if(i7 != string::npos && str[i7] == RIGHT_PARENTHESIS_CH) { i4 = i7 - str_index + 1; } } stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(parseAddId(f, empty_string, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; if(i4 < 0) i4 = name_length; } else if(po.rpn && f->args() == 1 && str_index > 0 && str[str_index - 1] != LEFT_PARENTHESIS_CH && (str_index + name_length >= str.length() || str[str_index + name_length] != LEFT_PARENTHESIS_CH) && (i6 = str.find_last_not_of(SPACE, str_index - 1)) != string::npos) { size_t i7 = i6; int nr_of_p = 0, nr_of_op = 0; bool b_started = false; while(i7 != 0) { if(nr_of_p > 0) { if(str[i7] == LEFT_PARENTHESIS_CH) { nr_of_p--; if(nr_of_p == 0 && nr_of_op == 0) break; } else if(str[i7] == RIGHT_PARENTHESIS_CH) { nr_of_p++; } } else if(nr_of_p == 0 && is_in(OPERATORS SPACE RIGHT_PARENTHESIS, str[i7])) { if(nr_of_op == 0 && b_started) { i7++; break; } else { if(is_in(OPERATORS, str[i7])) { nr_of_op++; b_started = false; } else if(str[i7] == RIGHT_PARENTHESIS_CH) { nr_of_p++; b_started = true; } else if(b_started) { nr_of_op--; b_started = false; } } } else { b_started = true; } i7--; } stmp2 = str.substr(i7, i6 - i7 + 1); stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; if(f == f_vector) stmp += i2s(parseAddVectorId(stmp2, po)); else stmp += i2s(parseAddId(f, stmp2, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(i7, str_index + name_length - i7, stmp); str_index += name_length; moved_forward = true; } else { bool b = false, b_unended_function = false, b_comma_before = false, b_power_before = false; //bool b_space_first = false; size_t i5 = 1; int arg_i = f->args(); i6 = 0; while(!b) { if(i6 + str_index + name_length >= str.length()) { b = true; i5 = 2; i6++; b_unended_function = true; break; } else { char c = str[str_index + name_length + i6]; if(c == LEFT_PARENTHESIS_CH) { if(i5 < 2) b = true; else if(i5 == 2 && po.parsing_mode == PARSING_MODE_CONVENTIONAL && !b_power_before) b = true; else i5++; } else if(c == RIGHT_PARENTHESIS_CH) { if(i5 <= 2) b = true; else i5--; } else if(c == POWER_CH) { if(i5 < 2) i5 = 2; b_power_before = true; } else if(!b_comma_before && !b_power_before && c == ' ' && arg_i <= 1) { //if(i5 < 2) b_space_first = true; if(i5 == 2) b = true; } else if(!b_comma_before && i5 == 2 && arg_i <= 1 && is_in(OPERATORS, c) && c != POWER_CH) { b = true; } else if(c == COMMA_CH) { if(i5 == 2) arg_i--; b_comma_before = true; if(i5 < 2) i5 = 2; } else if(i5 < 2) { i5 = 2; } if(c != COMMA_CH && c != ' ') b_comma_before = false; if(c != POWER_CH && c != ' ') b_power_before = false; } i6++; } if(b && i5 >= 2) { stmp2 = str.substr(str_index + name_length, i6 - 1); stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; if(b_unended_function && unended_function) { po.unended_function = unended_function; } if(f == f_vector) { stmp += i2s(parseAddVectorId(stmp2, po)); } else if(f == f_interval && po.read_precision != DONT_READ_PRECISION) { ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; stmp += i2s(parseAddId(f, stmp2, po2)); } else { stmp += i2s(parseAddId(f, stmp2, po)); } po.unended_function = NULL; stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; i4 = i6 + 1 + name_length - 2; b = false; } size_t i9 = i6; if(b) { b = false; i6 = i6 + 1 + str_index + name_length; size_t i7 = i6 - 1; size_t i8 = i7; while(true) { i5 = str.find(RIGHT_PARENTHESIS_CH, i7); if(i5 == string::npos) { b_unended_function = true; //str.append(1, RIGHT_PARENTHESIS_CH); //i5 = str.length() - 1; i5 = str.length(); } if(i5 < (i6 = str.find(LEFT_PARENTHESIS_CH, i8)) || i6 == string::npos) { i6 = i5; b = true; break; } i7 = i5 + 1; i8 = i6 + 1; } if(!b) { b_unended_function = false; } } if(b) { stmp2 = str.substr(str_index + name_length + i9, i6 - (str_index + name_length + i9)); stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; if(b_unended_function && unended_function) { po.unended_function = unended_function; } if(f == f_vector) { stmp += i2s(parseAddVectorId(stmp2, po)); } else if(f == f_interval && po.read_precision != DONT_READ_PRECISION) { ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; stmp += i2s(parseAddId(f, stmp2, po2)); } else { stmp += i2s(parseAddId(f, stmp2, po)); } po.unended_function = NULL; stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; i4 = i6 + 1 - str_index; } } if(i4 > 0) { str.replace(str_index, i4, stmp); str_index += stmp.length(); moved_forward = true; } break; } case 'u': { replace_text_by_unit_place: if(str.length() > str_index + name_length && is_in("23", str[str_index + name_length]) && (str.length() == str_index + name_length + 1 || is_not_in(NUMBER_ELEMENTS, str[str_index + name_length + 1])) && *name != SIGN_DEGREE && !((Unit*) object)->isCurrency()) { str.insert(str_index + name_length, 1, POWER_CH); } stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure((Unit*) object, p))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, name_length, stmp); str_index += stmp.length(); moved_forward = true; p = NULL; break; } case 'p': {} case 'q': {} case 'P': { if(str_index + name_length == str.length() || is_in(NOT_IN_NAMES, str[str_index + name_length])) { break; } p = (Prefix*) object; str_index += name_length; unit_chars_left = last_unit_char - str_index + 1; size_t name_length_old = name_length; int index = 0; if(unit_chars_left > UFV_LENGTHS) { for(size_t ufv_index2 = 0; ufv_index2 < ufvl.size(); ufv_index2++) { name = NULL; switch(ufvl_t[ufv_index2]) { case 'u': { name = &((Unit*) ufvl[ufv_index2])->getName(ufvl_i[ufv_index2]).name; case_sensitive = ((Unit*) ufvl[ufv_index2])->getName(ufvl_i[ufv_index2]).case_sensitive; name_length = name->length(); if(po.limit_implicit_multiplication || ((Unit*) ufvl[ufv_index2])->getName(ufvl_i[ufv_index2]).plural) { if(name_length != unit_chars_left) name = NULL; } else if(name_length > unit_chars_left) { name = NULL; } break; } } if(name && ((case_sensitive && compare_name(*name, str, name_length, str_index)) || (!case_sensitive && (name_length = compare_name_no_case(*name, str, name_length, str_index))))) { if((!p_mode && name_length_old > 1) || (p_mode && (name_length + name_length_old > best_pl || ((ufvt != 'P' || !((Unit*) ufvl[ufv_index2])->getName(ufvl_i[ufv_index2]).abbreviation) && name_length + name_length_old == best_pl)))) { p_mode = true; best_p = p; best_p_object = ufvl[ufv_index2]; best_pl = name_length + name_length_old; best_pnl = name_length_old; index = -1; break; } if(!p_mode) { str.erase(str_index - name_length_old, name_length_old); str_index -= name_length_old; object = ufvl[ufv_index2]; goto replace_text_by_unit_place; } } } } if(index < 0) { } else if(UFV_LENGTHS >= unit_chars_left) { index = unit_chars_left - 1; } else if(po.limit_implicit_multiplication) { index = -1; } else { index = UFV_LENGTHS - 1; } for(; index >= 0; index--) { for(size_t ufv_index2 = 0; ufv_index2 < ufv[2][index].size(); ufv_index2++) { name = &((Unit*) ufv[2][index][ufv_index2])->getName(ufv_i[2][index][ufv_index2]).name; case_sensitive = ((Unit*) ufv[2][index][ufv_index2])->getName(ufv_i[2][index][ufv_index2]).case_sensitive; name_length = name->length(); if(index + 1 == (int) unit_chars_left || !((Unit*) ufv[2][index][ufv_index2])->getName(ufv_i[2][index][ufv_index2]).plural) { if(name_length <= unit_chars_left && ((case_sensitive && compare_name(*name, str, name_length, str_index)) || (!case_sensitive && (name_length = compare_name_no_case(*name, str, name_length, str_index))))) { if((!p_mode && name_length_old > 1) || (p_mode && (name_length + name_length_old > best_pl || ((ufvt != 'P' || !((Unit*) ufv[2][index][ufv_index2])->getName(ufv_i[2][index][ufv_index2]).abbreviation) && name_length + name_length_old == best_pl)))) { p_mode = true; best_p = p; best_p_object = ufv[2][index][ufv_index2]; best_pl = name_length + name_length_old; best_pnl = name_length_old; index = -1; } if(!p_mode) { str.erase(str_index - name_length_old, name_length_old); str_index -= name_length_old; object = ufv[2][index][ufv_index2]; goto replace_text_by_unit_place; } } } } if(po.limit_implicit_multiplication || (p_mode && index + 1 + name_length_old < best_pl)) { break; } } str_index -= name_length_old; unit_chars_left = last_unit_char - str_index + 1; break; } } if(moved_forward) { str_index--; break; } } } if(!moved_forward && p_mode) { object = best_p_object; p = best_p; str.erase(str_index, best_pnl); name_length = best_pl - best_pnl; goto replace_text_by_unit_place; } else if(!moved_forward && found_function) { object = found_function; name = found_function_name; name_length = found_function_name_length; goto set_function; } if(!moved_forward) { bool b = po.unknowns_enabled && !(str_index > 0 && is_in(EXPS, str[str_index]) && str_index + 1 < str.length() && (is_in(NUMBER_ELEMENTS, str[str_index + 1]) || (is_in(PLUS MINUS, str[str_index + 1]) && str_index + 2 < str.length() && is_in(NUMBER_ELEMENTS, str[str_index + 2]))) && is_in(NUMBER_ELEMENTS, str[str_index - 1])); if(po.limit_implicit_multiplication) { if(b) { stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure(str.substr(str_index, unit_chars_left)))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, unit_chars_left, stmp); str_index += stmp.length() - 1; } else { str_index += unit_chars_left - 1; } } else if(b) { size_t i = 1; if(str[str_index + 1] < 0) { i++; while(i <= unit_chars_left && (unsigned char) str[str_index + i] >= 0x80 && (unsigned char) str[str_index + i] <= 0xBF) { i++; } } stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(addId(new MathStructure(str.substr(str_index, i)))); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(str_index, i, stmp); str_index += stmp.length() - 1; } } } } size_t comma_i = str.find(COMMA, 0); while(comma_i != string::npos) { int i3 = 1; size_t left_par_i = comma_i; while(left_par_i > 0) { left_par_i = str.find_last_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, left_par_i - 1); if(left_par_i == string::npos) break; if(str[left_par_i] == LEFT_PARENTHESIS_CH) { i3--; if(i3 == 0) break; } else if(str[left_par_i] == RIGHT_PARENTHESIS_CH) { i3++; } } if(i3 > 0) { str.insert(0, i3, LEFT_PARENTHESIS_CH); comma_i += i3; i3 = 0; left_par_i = 0; } if(i3 == 0) { i3 = 1; size_t right_par_i = comma_i; while(true) { right_par_i = str.find_first_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, right_par_i + 1); if(right_par_i == string::npos) { for(; i3 > 0; i3--) { str += RIGHT_PARENTHESIS; } right_par_i = str.length() - 1; } else if(str[right_par_i] == LEFT_PARENTHESIS_CH) { i3++; } else if(str[right_par_i] == RIGHT_PARENTHESIS_CH) { i3--; } if(i3 == 0) { stmp2 = str.substr(left_par_i + 1, right_par_i - left_par_i - 1); stmp = LEFT_PARENTHESIS ID_WRAP_LEFT; stmp += i2s(parseAddVectorId(stmp2, po)); stmp += ID_WRAP_RIGHT RIGHT_PARENTHESIS; str.replace(left_par_i, right_par_i + 1 - left_par_i, stmp); comma_i = left_par_i + stmp.length() - 1; break; } } } comma_i = str.find(COMMA, comma_i + 1); } if(po.rpn) { size_t rpn_i = str.find(SPACE, 0); while(rpn_i != string::npos) { if(rpn_i == 0 || is_in(OPERATORS, str[rpn_i - 1]) || rpn_i + 1 == str.length() || is_in(SPACE OPERATORS, str[rpn_i + 1])) { str.erase(rpn_i, 1); } else { rpn_i++; } rpn_i = str.find(SPACE, rpn_i); } } else if(po.parsing_mode != PARSING_MODE_ADAPTIVE) { remove_blanks(str); } else { //remove spaces between next to operators (except '/') and before/after parentheses space_i = str.find(SPACE_CH, 0); while(space_i != string::npos) { if((str[space_i + 1] != DIVISION_CH && is_in(OPERATORS RIGHT_PARENTHESIS, str[space_i + 1])) || (str[space_i - 1] != DIVISION_CH && is_in(OPERATORS LEFT_PARENTHESIS, str[space_i - 1]))) { str.erase(space_i, 1); space_i--; } space_i = str.find(SPACE_CH, space_i + 1); } } parseOperators(mstruct, str, po); } bool Calculator::parseNumber(MathStructure *mstruct, string str, const ParseOptions &po) { mstruct->clear(); if(str.empty()) return false; if(str.find_first_not_of(OPERATORS SPACE) == string::npos) { error(false, _("Misplaced operator(s) \"%s\" ignored"), str.c_str(), NULL); return false; } int minus_count = 0; bool has_sign = false, had_non_sign = false, b_dot = false, b_exp = false, after_sign_e = false; int i_colon = 0; size_t i = 0; while(i < str.length()) { if(!had_non_sign && str[i] == MINUS_CH) { has_sign = true; minus_count++; str.erase(i, 1); } else if(!had_non_sign && str[i] == PLUS_CH) { has_sign = true; str.erase(i, 1); } else if(str[i] == SPACE_CH) { str.erase(i, 1); } else if(!b_exp && (po.base <= 10 && po.base >= 2) && (str[i] == EXP_CH || str[i] == EXP2_CH)) { b_exp = true; had_non_sign = true; after_sign_e = true; i++; } else if(after_sign_e && (str[i] == MINUS_CH || str[i] == PLUS_CH)) { after_sign_e = false; i++; } else if(po.preserve_format && str[i] == DOT_CH) { b_dot = true; had_non_sign = true; after_sign_e = false; i++; } else if(po.preserve_format && (!b_dot || i_colon > 0) && str[i] == ':') { i_colon++; had_non_sign = true; after_sign_e = false; i++; } else if(str[i] == COMMA_CH && DOT_S == ".") { str.erase(i, 1); after_sign_e = false; had_non_sign = true; } else if(is_in(OPERATORS, str[i])) { error(false, _("Misplaced '%c' ignored"), str[i], NULL); str.erase(i, 1); } else if(str[i] == '\b') { b_exp = false; had_non_sign = false; after_sign_e = false; i++; } else { had_non_sign = true; after_sign_e = false; i++; } } if(str.empty()) { if(minus_count % 2 == 1 && !po.preserve_format) { mstruct->set(-1, 1, 0); } else if(has_sign) { mstruct->set(1, 1, 0); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } } return false; } if(str[0] == ID_WRAP_LEFT_CH && str.length() > 2 && str[str.length() - 1] == ID_WRAP_RIGHT_CH) { int id = s2i(str.substr(1, str.length() - 2)); MathStructure *m_temp = getId((size_t) id); if(!m_temp) { mstruct->setUndefined(); error(true, _("Internal id %s does not exist."), i2s(id).c_str(), NULL); return true; } mstruct->set_nocopy(*m_temp); m_temp->unref(); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } else if(minus_count % 2 == 1) { mstruct->negate(); } return true; } size_t itmp; if(((po.base >= 2 && po.base <= 10) || po.base == BASE_DUODECIMAL) && (itmp = str.find_first_not_of(po.base == BASE_DUODECIMAL ? NUMBER_ELEMENTS INTERNAL_NUMBER_CHARS MINUS DUODECIMAL_CHARS : NUMBER_ELEMENTS INTERNAL_NUMBER_CHARS EXPS MINUS, 0)) != string::npos) { if(itmp == 0) { error(true, _("\"%s\" is not a valid variable/function/unit."), str.c_str(), NULL); if(minus_count % 2 == 1 && !po.preserve_format) { mstruct->set(-1, 1, 0); } else if(has_sign) { mstruct->set(1, 1, 0); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } } return false; } else { string stmp = str.substr(itmp, str.length() - itmp); error(true, _("Trailing characters \"%s\" (not a valid variable/function/unit) in number \"%s\" was ignored."), stmp.c_str(), str.c_str(), NULL); str.erase(itmp, str.length() - itmp); } } gsub("\b", "±", str); Number nr(str, po); if(!po.preserve_format && minus_count % 2 == 1) { nr.negate(); } if(i_colon && nr.isRational() && !nr.isInteger()) { Number nr_num(nr.numerator()), nr_den(1, 1, 0); while(i_colon) { nr_den *= 60; i_colon--; } nr_num *= nr_den; nr_num /= nr.denominator(); mstruct->set(nr_num); mstruct->transform(STRUCT_DIVISION, nr_den); } else { mstruct->set(nr); } if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } return true; } bool Calculator::parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po) { if(str.length() > 0) { size_t i; if(po.base >= 2 && po.base <= 10) { i = str.find_first_of(SPACE MULTIPLICATION_2 OPERATORS PARENTHESISS EXPS ID_WRAP_LEFT, 1); } else { i = str.find_first_of(SPACE MULTIPLICATION_2 OPERATORS PARENTHESISS ID_WRAP_LEFT, 1); } if(i == string::npos && str[0] != LOGICAL_NOT_CH && str[0] != BITWISE_NOT_CH && !(str[0] == ID_WRAP_LEFT_CH && str.find(ID_WRAP_RIGHT) < str.length() - 1)) { return parseNumber(mstruct, str, po); } else { return parseOperators(mstruct, str, po); } } return false; } bool Calculator::parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po, MathOperation s, bool append) { if(str.length() > 0) { size_t i; if(po.base >= 2 && po.base <= 10) { i = str.find_first_of(SPACE MULTIPLICATION_2 OPERATORS PARENTHESISS EXPS ID_WRAP_LEFT, 1); } else { i = str.find_first_of(SPACE MULTIPLICATION_2 OPERATORS PARENTHESISS ID_WRAP_LEFT, 1); } if(i == string::npos && str[0] != LOGICAL_NOT_CH && str[0] != BITWISE_NOT_CH && !(str[0] == ID_WRAP_LEFT_CH && str.find(ID_WRAP_RIGHT) < str.length() - 1)) { if(s == OPERATION_EXP10 && po.read_precision == ALWAYS_READ_PRECISION) { ParseOptions po2 = po; po2.read_precision = READ_PRECISION_WHEN_DECIMALS; MathStructure *mstruct2 = new MathStructure(); if(!parseNumber(mstruct2, str, po2)) { mstruct2->unref(); return false; } mstruct->add_nocopy(mstruct2, s, append); } else { MathStructure *mstruct2 = new MathStructure(); if(!parseNumber(mstruct2, str, po)) { mstruct2->unref(); return false; } if(s == OPERATION_EXP10 && !po.preserve_format && mstruct->isNumber() && mstruct2->isNumber()) { mstruct->number().exp10(mstruct2->number()); mstruct->numberUpdated(); mstruct->mergePrecision(*mstruct2); } else if(s == OPERATION_DIVIDE && po.preserve_format) { mstruct->transform_nocopy(STRUCT_DIVISION, mstruct2); } else if(s == OPERATION_SUBTRACT && po.preserve_format) { mstruct2->transform(STRUCT_NEGATE); mstruct->add_nocopy(mstruct2, OPERATION_ADD, append); } else { mstruct->add_nocopy(mstruct2, s, append); } } } else { MathStructure *mstruct2 = new MathStructure(); if(!parseOperators(mstruct2, str, po)) { mstruct2->unref(); return false; } if(s == OPERATION_DIVIDE && po.preserve_format) { mstruct->transform_nocopy(STRUCT_DIVISION, mstruct2); } else if(s == OPERATION_SUBTRACT && po.preserve_format) { mstruct2->transform(STRUCT_NEGATE); mstruct->add_nocopy(mstruct2, OPERATION_ADD, append); } else { mstruct->add_nocopy(mstruct2, s, append); } } } return true; } MathStructure *get_out_of_negate(MathStructure &mstruct, int *i_neg) { if(mstruct.isNegate() || (mstruct.isMultiplication() && mstruct.size() == 2 && mstruct[0].isMinusOne())) { (*i_neg)++; return get_out_of_negate(mstruct.last(), i_neg); } return &mstruct; } bool Calculator::parseOperators(MathStructure *mstruct, string str, const ParseOptions &po) { string save_str = str; mstruct->clear(); size_t i = 0, i2 = 0, i3 = 0; string str2, str3; while(true) { //find first right parenthesis and then the last left parenthesis before i2 = str.find(RIGHT_PARENTHESIS_CH); if(i2 == string::npos) { i = str.rfind(LEFT_PARENTHESIS_CH); if(i == string::npos) { //if no parenthesis break break; } else { //right parenthesis missing -- append str += RIGHT_PARENTHESIS_CH; i2 = str.length() - 1; } } else { if(i2 > 0) { i = str.rfind(LEFT_PARENTHESIS_CH, i2 - 1); } else { i = string::npos; } if(i == string::npos) { //left parenthesis missing -- prepend str.insert(str.begin(), 1, LEFT_PARENTHESIS_CH); i = 0; i2++; } } while(true) { //remove unnecessary double parenthesis and the found parenthesis if(i > 0 && i2 + 1 < str.length() && str[i - 1] == LEFT_PARENTHESIS_CH && str[i2 + 1] == RIGHT_PARENTHESIS_CH) { str.erase(str.begin() + (i - 1)); i--; i2--; str.erase(str.begin() + (i2 + 1)); } else { break; } } if(i > 0 && is_not_in(MULTIPLICATION_2 OPERATORS PARENTHESISS SPACE, str[i - 1]) && (po.base > 10 || po.base < 2 || (str[i - 1] != EXP_CH && str[i - 1] != EXP2_CH))) { if(po.rpn) { str.insert(i2 + 1, MULTIPLICATION); str.insert(i, SPACE); i++; i2++; } } if(i2 + 1 < str.length() && is_not_in(MULTIPLICATION_2 OPERATORS PARENTHESISS SPACE, str[i2 + 1]) && (po.base > 10 || po.base < 2 || (str[i2 + 1] != EXP_CH && str[i2 + 1] != EXP2_CH))) { if(po.rpn) { i3 = str.find(SPACE, i2 + 1); if(i3 == string::npos) { str += MULTIPLICATION; } else { str.replace(i3, 1, MULTIPLICATION); } str.insert(i2 + 1, SPACE); } } if(po.rpn && i > 0 && i2 + 1 == str.length() && is_not_in(PARENTHESISS SPACE, str[i - 1])) { str += MULTIPLICATION_CH; } str2 = str.substr(i + 1, i2 - (i + 1)); MathStructure *mstruct2 = new MathStructure(); if(str2.empty()) { CALCULATOR->error(false, "Empty expression in parentheses interpreted as zero.", NULL); } else { parseOperators(mstruct2, str2, po); } mstruct2->setInParentheses(true); str2 = ID_WRAP_LEFT; str2 += i2s(addId(mstruct2)); str2 += ID_WRAP_RIGHT; str.replace(i, i2 - i + 1, str2); mstruct->clear(); } bool b_abs_or = false, b_bit_or = false; i = 0; while((i = str.find('|', i)) != string::npos) { if(i == 0 || i == str.length() - 1 || is_in(po.rpn ? OPERATORS : OPERATORS SPACE, str[i - 1])) {b_abs_or = true; break;} if(str[i + 1] == '|') { if(i == str.length() - 2) {b_abs_or = true; break;} if(b_bit_or) { b_abs_or = true; break; } i += 2; } else { b_bit_or = true; i++; } } if(b_abs_or) { while((i = str.find('|', 0)) != string::npos && i + 1 != str.length()) { if(str[i + 1] == '|') { size_t depth = 1; i2 = i; while((i2 = str.find("||", i2 + 2)) != string::npos) { if(is_in(OPERATORS, str[i2 - 1])) depth++; else depth--; if(depth == 0) break; } if(i2 == string::npos) str2 = str.substr(i + 2); else str2 = str.substr(i + 2, i2 - (i + 2)); str3 = ID_WRAP_LEFT; str3 += i2s(parseAddId(f_magnitude, str2, po)); str3 += ID_WRAP_RIGHT; if(i2 == string::npos) str.replace(i, str.length() - i, str3); else str.replace(i, i2 - i + 2, str3); } else { size_t depth = 1; i2 = i; while((i2 = str.find('|', i2 + 1)) != string::npos) { if(is_in(OPERATORS, str[i2 - 1])) depth++; else depth--; if(depth == 0) break; } if(i2 == string::npos) str2 = str.substr(i + 1); else str2 = str.substr(i + 1, i2 - (i + 1)); str3 = ID_WRAP_LEFT; str3 += i2s(parseAddId(f_abs, str2, po)); str3 += ID_WRAP_RIGHT; if(i2 == string::npos) str.replace(i, str.length() - i, str3); else str.replace(i, i2 - i + 1, str3); } } } if((i = str.find(LOGICAL_AND, 1)) != string::npos && i + 2 != str.length()) { bool b = false, append = false; while(i != string::npos && i + 2 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 2, str.length() - (i + 2)); if(b) { parseAdd(str2, mstruct, po, OPERATION_LOGICAL_AND, append); append = true; } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(LOGICAL_AND, 1); } if(b) { parseAdd(str, mstruct, po, OPERATION_LOGICAL_AND, append); } else { parseAdd(str, mstruct, po); } return true; } if((i = str.find(LOGICAL_OR, 1)) != string::npos && i + 2 != str.length()) { bool b = false, append = false; while(i != string::npos && i + 2 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 2, str.length() - (i + 2)); if(b) { parseAdd(str2, mstruct, po, OPERATION_LOGICAL_OR, append); append = true; } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(LOGICAL_OR, 1); } if(b) { parseAdd(str, mstruct, po, OPERATION_LOGICAL_OR, append); } else { parseAdd(str, mstruct, po); } return true; } if(str[0] == LOGICAL_NOT_CH) { str.erase(str.begin()); parseAdd(str, mstruct, po); mstruct->setLogicalNot(); return true; } if((i = str.find_first_of(LESS GREATER EQUALS NOT, 0)) != string::npos) { while(i != string::npos && ((str[i] == LESS_CH && i + 1 < str.length() && str[i + 1] == LESS_CH) || (str[i] == GREATER_CH && i + 1 < str.length() && str[i + 1] == GREATER_CH))) { i = str.find_first_of(LESS GREATER NOT EQUALS, i + 2); } } if(i != string::npos) { bool b = false; bool c = false; while(i != string::npos && str[i] == NOT_CH && str.length() > i + 1 && str[i + 1] == NOT_CH) { i++; if(i + 1 == str.length()) { c = true; } } MathOperation s = OPERATION_ADD; while(!c) { while(i != string::npos && ((str[i] == LESS_CH && i + 1 < str.length() && str[i + 1] == LESS_CH) || (str[i] == GREATER_CH && i + 1 < str.length() && str[i + 1] == GREATER_CH))) { i = str.find_first_of(LESS GREATER NOT EQUALS, i + 2); while(i != string::npos && str[i] == NOT_CH && str.length() > i + 1 && str[i + 1] == NOT_CH) { i++; if(i + 1 == str.length()) { i = string::npos; } } } if(i == string::npos) { str2 = str.substr(0, str.length()); } else { str2 = str.substr(0, i); } if(b) { switch(i3) { case EQUALS_CH: {s = OPERATION_EQUALS; break;} case GREATER_CH: {s = OPERATION_GREATER; break;} case LESS_CH: {s = OPERATION_LESS; break;} case GREATER_CH * EQUALS_CH: {s = OPERATION_EQUALS_GREATER; break;} case LESS_CH * EQUALS_CH: {s = OPERATION_EQUALS_LESS; break;} case GREATER_CH * LESS_CH: {s = OPERATION_NOT_EQUALS; break;} } parseAdd(str2, mstruct, po, s); } if(i == string::npos) { return true; } if(!b) { parseAdd(str2, mstruct, po); b = true; } if(str.length() > i + 1 && is_in(LESS GREATER NOT EQUALS, str[i + 1])) { if(str[i] == str[i + 1]) { i3 = str[i]; } else { i3 = str[i] * str[i + 1]; if(i3 == NOT_CH * EQUALS_CH) { i3 = GREATER_CH * LESS_CH; } else if(i3 == NOT_CH * LESS_CH) { i3 = GREATER_CH; } else if(i3 == NOT_CH * GREATER_CH) { i3 = LESS_CH; } } i++; } else { i3 = str[i]; } str = str.substr(i + 1, str.length() - (i + 1)); i = str.find_first_of(LESS GREATER NOT EQUALS, 0); while(i != string::npos && str[i] == NOT_CH && str.length() > i + 1 && str[i + 1] == NOT_CH) { i++; if(i + 1 == str.length()) { i = string::npos; } } } } if((i = str.find(BITWISE_OR, 1)) != string::npos && i + 1 != str.length()) { bool b = false, append = false; while(i != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); if(b) { parseAdd(str2, mstruct, po, OPERATION_BITWISE_OR, append); append = true; } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(BITWISE_OR, 1); } if(b) { parseAdd(str, mstruct, po, OPERATION_BITWISE_OR, append); } else { parseAdd(str, mstruct, po); } return true; } if((i = str.find(BITWISE_AND, 1)) != string::npos && i + 1 != str.length()) { bool b = false, append = false; while(i != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); if(b) { parseAdd(str2, mstruct, po, OPERATION_BITWISE_AND, append); append = true; } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(BITWISE_AND, 1); } if(b) { parseAdd(str, mstruct, po, OPERATION_BITWISE_AND, append); } else { parseAdd(str, mstruct, po); } return true; } i = str.find(SHIFT_LEFT, 1); i2 = str.find(SHIFT_RIGHT, 1); if(i != string::npos && i + 2 != str.length() && (i2 == string::npos || i < i2)) { MathStructure mstruct1, mstruct2; str2 = str.substr(0, i); str = str.substr(i + 2, str.length() - (i + 2)); parseAdd(str2, &mstruct1, po); parseAdd(str, &mstruct2, po); mstruct->set(f_shift, &mstruct1, &mstruct2, NULL); return true; } i = i2; if(i != string::npos && i + 2 != str.length()) { MathStructure mstruct1, mstruct2; str2 = str.substr(0, i); str = str.substr(i + 2, str.length() - (i + 2)); parseAdd(str2, &mstruct1, po); parseAdd(str, &mstruct2, po); if(po.preserve_format) mstruct2.transform(STRUCT_NEGATE); else mstruct2.negate(); mstruct->set(f_shift, &mstruct1, &mstruct2, NULL); return true; } if(str[0] == BITWISE_NOT_CH) { str.erase(str.begin()); parseAdd(str, mstruct, po); mstruct->setBitwiseNot(); return true; } i = 0; i3 = 0; if(po.rpn) { ParseOptions po2 = po; po2.rpn = false; vector mstack; bool b = false; char last_operator = 0; while(true) { i = str.find_first_of(OPERATORS SPACE, i3 + 1); if(i == string::npos) { if(!b) { parseAdd(str, mstruct, po2); return true; } if(i3 != 0) { str2 = str.substr(i3 + 1, str.length() - i3 - 1); } else { str2 = str.substr(i3, str.length() - i3); } remove_blank_ends(str2); if(!str2.empty()) { error(false, _("RPN syntax error. Values left at the end of the RPN expression."), NULL); } else if(mstack.size() > 1) { if(last_operator == 0) { error(false, _("Unused stack values."), NULL); } else { while(mstack.size() > 1) { switch(last_operator) { case PLUS_CH: { mstack[mstack.size() - 2]->add_nocopy(mstack.back()); mstack.pop_back(); break; } case MINUS_CH: { if(po.preserve_format) { mstack.back()->transform(STRUCT_NEGATE); mstack[mstack.size() - 2]->add_nocopy(mstack.back()); } else { mstack[mstack.size() - 2]->subtract_nocopy(mstack.back()); } mstack.pop_back(); break; } case MULTIPLICATION_CH: { mstack[mstack.size() - 2]->multiply_nocopy(mstack.back()); mstack.pop_back(); break; } case DIVISION_CH: { if(po.preserve_format) { mstack[mstack.size() - 2]->transform_nocopy(STRUCT_DIVISION, mstack.back()); } else { mstack[mstack.size() - 2]->divide_nocopy(mstack.back()); } mstack.pop_back(); break; } case POWER_CH: { mstack[mstack.size() - 2]->raise_nocopy(mstack.back()); mstack.pop_back(); break; } default: { error(true, _("RPN syntax error. Operator '%c' not supported."), last_operator, NULL); mstack.pop_back(); break; } } } } } mstruct->set_nocopy(*mstack.back()); while(!mstack.empty()) { mstack.back()->unref(); mstack.pop_back(); } return true; } b = true; if(i3 != 0) { str2 = str.substr(i3 + 1, i - i3 - 1); } else { str2 = str.substr(i3, i - i3); } remove_blank_ends(str2); if(!str2.empty()) { mstack.push_back(new MathStructure()); parseAdd(str2, mstack.back(), po2); } if(str[i] != SPACE_CH) { if(mstack.size() < 1) { error(true, _("RPN syntax error. Stack is empty."), NULL); } else if(mstack.size() < 2) { error(false, _("RPN syntax error. Operator ignored as there where only one stack value."), NULL); } else { switch(str[i]) { case PLUS_CH: { mstack[mstack.size() - 2]->add_nocopy(mstack.back()); mstack.pop_back(); break; } case MINUS_CH: { if(po.preserve_format) { mstack.back()->transform(STRUCT_NEGATE); mstack[mstack.size() - 2]->add_nocopy(mstack.back()); } else { mstack[mstack.size() - 2]->subtract_nocopy(mstack.back()); } mstack.pop_back(); break; } case MULTIPLICATION_CH: { mstack[mstack.size() - 2]->multiply_nocopy(mstack.back()); mstack.pop_back(); break; } case DIVISION_CH: { if(po.preserve_format) { mstack[mstack.size() - 2]->transform_nocopy(STRUCT_DIVISION, mstack.back()); } else { mstack[mstack.size() - 2]->divide_nocopy(mstack.back()); } mstack.pop_back(); break; } case POWER_CH: { mstack[mstack.size() - 2]->raise_nocopy(mstack.back()); mstack.pop_back(); break; } default: { error(true, _("RPN syntax error. Operator '%c' not supported."), str[i], NULL); mstack.pop_back(); break; } } last_operator = str[i]; } } i3 = i; } } if(po.rpn) remove_blanks(str); if((i = str.find_first_of(PLUS MINUS, 1)) != string::npos && i + 1 != str.length()) { bool b = false, c = false, append = false; bool min = false; while(i != string::npos && i + 1 != str.length()) { if(is_not_in(MULTIPLICATION_2 OPERATORS EXPS, str[i - 1])) { str2 = str.substr(0, i); if(!c && b) { bool b_add; if(min) { b_add = parseAdd(str2, mstruct, po, OPERATION_SUBTRACT, append) && mstruct->isAddition(); } else { b_add = parseAdd(str2, mstruct, po, OPERATION_ADD, append) && mstruct->isAddition(); } append = true; if(b_add) { int i_neg = 0; MathStructure *mstruct_a = get_out_of_negate(mstruct->last(), &i_neg); MathStructure *mstruct_b = mstruct_a; if(mstruct_a->isMultiplication() && mstruct_a->size() >= 2) mstruct_b = &mstruct_a->last(); if(mstruct_b->isVariable() && (mstruct_b->variable() == v_percent || mstruct_b->variable() == v_permille || mstruct_b->variable() == v_permyriad)) { Variable *v = mstruct_b->variable(); bool b_neg = (i_neg % 2 == 1); while(i_neg > 0) { mstruct->last().setToChild(mstruct->last().size()); i_neg--; } if(mstruct->last().isVariable()) { mstruct->last().multiply(m_one); mstruct->last().swapChildren(1, 2); } if(mstruct->last().size() > 2) { mstruct->last().delChild(mstruct->last().size()); mstruct->last().multiply(v); } if(mstruct->last()[0].isNumber()) { if(b_neg) mstruct->last()[0].number().negate(); if(v == CALCULATOR->v_percent) mstruct->last()[0].number().add(100); else if(v == CALCULATOR->v_permille) mstruct->last()[0].number().add(1000); else mstruct->last()[0].number().add(10000); } else { if(b_neg && po.preserve_format) mstruct->last()[0].transform(STRUCT_NEGATE); else if(b_neg) mstruct->last()[0].negate(); if(v == CALCULATOR->v_percent) mstruct->last()[0] += Number(100, 1); else if(v == CALCULATOR->v_permille) mstruct->last()[0] += Number(1000, 1); else mstruct->last()[0] += Number(10000, 1); mstruct->last()[0].swapChildren(1, 2); } if(mstruct->size() == 2) { mstruct->setType(STRUCT_MULTIPLICATION); } else { MathStructure *mpercent = &mstruct->last(); mpercent->ref(); mstruct->delChild(mstruct->size()); mstruct->multiply_nocopy(mpercent); } } } } else { if(!b && str2.empty()) { c = true; } else { parseAdd(str2, mstruct, po); if(c && min) { if(po.preserve_format) mstruct->transform(STRUCT_NEGATE); else mstruct->negate(); } c = false; } b = true; } min = str[i] == MINUS_CH; str = str.substr(i + 1, str.length() - (i + 1)); i = str.find_first_of(PLUS MINUS, 1); } else { i = str.find_first_of(PLUS MINUS, i + 1); } } if(b) { if(c) { b = parseAdd(str, mstruct, po); if(min) { if(po.preserve_format) mstruct->transform(STRUCT_NEGATE); else mstruct->negate(); } return b; } else { bool b_add; if(min) { b_add = parseAdd(str, mstruct, po, OPERATION_SUBTRACT, append) && mstruct->isAddition(); } else { b_add = parseAdd(str, mstruct, po, OPERATION_ADD, append) && mstruct->isAddition(); } if(b_add) { int i_neg = 0; MathStructure *mstruct_a = get_out_of_negate(mstruct->last(), &i_neg); MathStructure *mstruct_b = mstruct_a; if(mstruct_a->isMultiplication() && mstruct_a->size() >= 2) mstruct_b = &mstruct_a->last(); if(mstruct_b->isVariable() && (mstruct_b->variable() == v_percent || mstruct_b->variable() == v_permille || mstruct_b->variable() == v_permyriad)) { Variable *v = mstruct_b->variable(); bool b_neg = (i_neg % 2 == 1); while(i_neg > 0) { mstruct->last().setToChild(mstruct->last().size()); i_neg--; } if(mstruct->last().isVariable()) { mstruct->last().multiply(m_one); mstruct->last().swapChildren(1, 2); } if(mstruct->last().size() > 2) { mstruct->last().delChild(mstruct->last().size()); mstruct->last().multiply(v); } if(mstruct->last()[0].isNumber()) { if(b_neg) mstruct->last()[0].number().negate(); if(v == CALCULATOR->v_percent) mstruct->last()[0].number().add(100); else if(v == CALCULATOR->v_permille) mstruct->last()[0].number().add(1000); else mstruct->last()[0].number().add(10000); } else { if(b_neg && po.preserve_format) mstruct->last()[0].transform(STRUCT_NEGATE); else if(b_neg) mstruct->last()[0].negate(); if(v == CALCULATOR->v_percent) mstruct->last()[0] += Number(100, 1); else if(v == CALCULATOR->v_permille) mstruct->last()[0] += Number(1000, 1); else mstruct->last()[0] += Number(10000, 1); mstruct->last()[0].swapChildren(1, 2); } if(mstruct->size() == 2) { mstruct->setType(STRUCT_MULTIPLICATION); } else { MathStructure *mpercent = &mstruct->last(); mpercent->ref(); mstruct->delChild(mstruct->size()); mstruct->multiply_nocopy(mpercent); } } } } return true; } } if(!po.rpn && po.parsing_mode == PARSING_MODE_ADAPTIVE && (i = str.find(DIVISION_CH, 1)) != string::npos && i + 1 != str.length()) { while(i != string::npos && i + 1 != str.length()) { bool b = false; if(i > 2 && i < str.length() - 3 && str[i + 1] == ID_WRAP_LEFT_CH) { i2 = i; b = true; bool had_unit = false, had_nonunit = false; MathStructure *m_temp = NULL, *m_temp2 = NULL; while(b) { b = false; size_t i4 = i2; if(i2 > 2 && str[i2 - 1] == ID_WRAP_RIGHT_CH) { b = true; } else if(i2 > 4 && str[i2 - 3] == ID_WRAP_RIGHT_CH && str[i2 - 2] == POWER_CH && is_in(NUMBERS INTERNAL_NUMBER_CHARS, str[i2 - 1])) { b = true; i4 -= 2; } if(!b) { if((i2 > 1 && is_not_in(OPERATORS MULTIPLICATION_2, str[i2 - 1])) || (i2 > 2 && str[i2 - 1] == MULTIPLICATION_2_CH && is_not_in(OPERATORS, str[i2 - 2]))) had_nonunit = true; break; } i2 = str.rfind(ID_WRAP_LEFT_CH, i4 - 2); m_temp = NULL; if(i2 != string::npos) { int id = s2i(str.substr(i2 + 1, (i4 - 1) - (i2 + 1))); if(priv->id_structs.find(id) != priv->id_structs.end()) m_temp = priv->id_structs[id]; } if(!m_temp || !m_temp->isUnit()) { had_nonunit = true; break; } had_unit = true; } i3 = i; b = had_unit && had_nonunit; had_unit = false; while(b) { size_t i4 = i3; i3 = str.find(ID_WRAP_RIGHT_CH, i4 + 2); m_temp2 = NULL; if(i3 != string::npos) { int id = s2i(str.substr(i4 + 2, (i3 - 1) - (i4 + 1))); if(priv->id_structs.find(id) != priv->id_structs.end()) m_temp2 = priv->id_structs[id]; } if(!m_temp2 || !m_temp2->isUnit()) { b = false; break; } had_unit = true; b = false; if(i3 < str.length() - 3 && str[i3 + 1] == ID_WRAP_LEFT_CH) { b = true; } else if(i3 < str.length() - 5 && str[i3 + 3] == ID_WRAP_LEFT_CH && str[i3 + 1] == POWER_CH && is_in(NUMBERS INTERNAL_NUMBER_CHARS, str[i3 + 2])) { b = true; i3 += 2; } } b = had_unit; if(b) { if(i3 < str.length() - 2 && str[i3 + 1] == POWER_CH && is_in(NUMBERS INTERNAL_NUMBER_CHARS, str[i3 + 2])) i3 += 2; if(i3 == str.length() - 1 || (str[i3 + 1] != POWER_CH && str[i3 + 1] != DIVISION_CH)) { MathStructure *mstruct2 = new MathStructure(); str2 = str.substr(i2, i - i2); parseAdd(str2, mstruct2, po); str2 = str.substr(i + 1, i3 - i); parseAdd(str2, mstruct2, po, OPERATION_DIVIDE); str2 = ID_WRAP_LEFT; str2 += i2s(addId(mstruct2)); str2 += ID_WRAP_RIGHT; str.replace(i2, i3 - i2 + 1, str2); } else { b = false; } } } if(!b) { i2 = str.find_last_not_of(NUMBERS INTERNAL_NUMBER_CHARS PLUS MINUS EXPS, i - 1); if(i2 == string::npos || (i2 != i - 1 && str[i2] == MULTIPLICATION_2_CH)) b = true; i2 = str.rfind(MULTIPLICATION_2_CH, i - 1); if(i2 == string::npos) b = true; if(b) { i3 = str.find_first_of(MULTIPLICATION_2 MULTIPLICATION DIVISION, i + 1); if(i3 == string::npos || i3 == i + 1 || str[i3] != MULTIPLICATION_2_CH) b = false; if(i3 < str.length() + 1 && (str[i3 + 1] == DIVISION_CH || str[i3 + 1] == MULTIPLICATION_CH || str[i3 + 1] == POWER_CH)) b = false; } if(b) { if(i3 != string::npos) str[i3] = MULTIPLICATION_CH; if(i2 != string::npos) str[i2] = MULTIPLICATION_CH; } else { if(str[i + 1] == MULTIPLICATION_2_CH) { str.erase(i + 1, 1); } if(str[i - 1] == MULTIPLICATION_2_CH) { str.erase(i - 1, 1); i--; } } } i = str.find(DIVISION_CH, i + 1); } } if(po.parsing_mode == PARSING_MODE_ADAPTIVE && !po.rpn) remove_blanks(str); if(po.parsing_mode == PARSING_MODE_CONVENTIONAL) { if((i = str.find(ID_WRAP_RIGHT_CH, 1)) != string::npos && i + 1 != str.length()) { while(i != string::npos && i + 1 != str.length()) { if(is_in(NUMBERS INTERNAL_NUMBER_CHARS ID_WRAP_LEFT, str[i + 1])) { str.insert(i + 1, 1, MULTIPLICATION_CH); i++; } i = str.find(ID_WRAP_RIGHT_CH, i + 1); } } if((i = str.find(ID_WRAP_LEFT_CH, 1)) != string::npos) { while(i != string::npos) { if(is_in(NUMBERS INTERNAL_NUMBER_CHARS, str[i - 1])) { str.insert(i, 1, MULTIPLICATION_CH); i++; } i = str.find(ID_WRAP_LEFT_CH, i + 1); } } } if((i = str.find_first_of(MULTIPLICATION DIVISION, 0)) != string::npos && i + 1 != str.length()) { bool b = false, append = false; bool div = false; while(i != string::npos && i + 1 != str.length()) { if(i < 1) { if(i < 1 && str.find_first_not_of(MULTIPLICATION_2 OPERATORS EXPS) == string::npos) { error(false, _("Misplaced operator(s) \"%s\" ignored"), str.c_str(), NULL); return b; } i = 1; while(i < str.length() && is_in(MULTIPLICATION DIVISION, str[i])) { i++; } error(false, _("Misplaced operator(s) \"%s\" ignored"), str.substr(0, i).c_str(), NULL); str = str.substr(i, str.length() - i); i = str.find_first_of(MULTIPLICATION DIVISION, 0); } else { str2 = str.substr(0, i); if(b) { if(div) { parseAdd(str2, mstruct, po, OPERATION_DIVIDE, append); } else { parseAdd(str2, mstruct, po, OPERATION_MULTIPLY, append); } append = true; } else { parseAdd(str2, mstruct, po); b = true; } if(is_in(MULTIPLICATION DIVISION, str[i + 1])) { i2 = 1; while(i2 + i + 1 != str.length() && is_in(MULTIPLICATION DIVISION, str[i2 + i + 1])) { i2++; } error(false, _("Misplaced operator(s) \"%s\" ignored"), str.substr(i, i2).c_str(), NULL); i += i2; } div = str[i] == DIVISION_CH; str = str.substr(i + 1, str.length() - (i + 1)); i = str.find_first_of(MULTIPLICATION DIVISION, 0); } } if(b) { if(div) { parseAdd(str, mstruct, po, OPERATION_DIVIDE, append); } else { parseAdd(str, mstruct, po, OPERATION_MULTIPLY, append); } return true; } } if(str.empty()) return false; if(str.find_first_not_of(OPERATORS SPACE) == string::npos) { error(false, _("Misplaced operator(s) \"%s\" ignored"), str.c_str(), NULL); return false; } i = 0; bool ret = true; bool has_sign = false; int minus_count = 0; while(i < str.length()) { if(str[i] == MINUS_CH) { has_sign = true; minus_count++; str.erase(i, 1); } else if(str[i] == PLUS_CH) { has_sign = true; str.erase(i, 1); } else if(str[i] == SPACE_CH) { str.erase(i, 1); } else if(is_in(OPERATORS, str[i])) { error(false, _("Misplaced '%c' ignored"), str[i], NULL); str.erase(i, 1); } else { break; } } if(str.empty()) { if(minus_count % 2 == 1 && !po.preserve_format) { mstruct->set(-1, 1, 0); } else if(has_sign) { mstruct->set(1, 1, 0); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } } return false; } if((i = str.find(ID_WRAP_RIGHT_CH, 1)) != string::npos && i + 1 != str.length()) { bool b = false, append = false; while(i != string::npos && i + 1 != str.length()) { if(str[i + 1] != POWER_CH) { str2 = str.substr(0, i + 1); str = str.substr(i + 1, str.length() - (i + 1)); if(b) { parseAdd(str2, mstruct, po, OPERATION_MULTIPLY, append); append = true; } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(ID_WRAP_RIGHT_CH, 1); } else { i = str.find(ID_WRAP_RIGHT_CH, i + 1); } } if(b) { parseAdd(str, mstruct, po, OPERATION_MULTIPLY, append); if(po.parsing_mode == PARSING_MODE_ADAPTIVE && mstruct->isMultiplication() && mstruct->size() >= 2 && !(*mstruct)[0].inParentheses()) { Unit *u1 = NULL; Prefix *p1 = NULL; bool b_plus = false; if((*mstruct)[0].isMultiplication() && (*mstruct)[0].size() == 2 && (*mstruct)[0][0].isNumber() && (*mstruct)[0][1].isUnit()) {u1 = (*mstruct)[0][1].unit(); p1 = (*mstruct)[0][1].prefix();} if(u1 && u1->subtype() == SUBTYPE_BASE_UNIT && (u1->referenceName() == "m" || (!p1 && u1->referenceName() == "L")) && (!p1 || (p1->type() == PREFIX_DECIMAL && ((DecimalPrefix*) p1)->exponent() <= 3 && ((DecimalPrefix*) p1)->exponent() > -3))) { b_plus = true; for(size_t i2 = 1; i2 < mstruct->size(); i2++) { if(!(*mstruct)[i2].inParentheses() && (*mstruct)[i2].isMultiplication() && (*mstruct)[i2].size() == 2 && (*mstruct)[i2][0].isNumber() && (*mstruct)[i2][1].isUnit() && (*mstruct)[i2][1].unit() == u1) { Prefix *p2 = (*mstruct)[i2][1].prefix(); if(p1 && p2) b_plus = p1->type() == PREFIX_DECIMAL && p2->type() == PREFIX_DECIMAL && ((DecimalPrefix*) p1)->exponent() > ((DecimalPrefix*) p2)->exponent() && ((DecimalPrefix*) p2)->exponent() >= -3; else if(p2) b_plus = p2->type() == PREFIX_DECIMAL && ((DecimalPrefix*) p2)->exponent() < 0 && ((DecimalPrefix*) p2)->exponent() >= -3; else if(p1) b_plus = p1->type() == PREFIX_DECIMAL && ((DecimalPrefix*) p1)->exponent() > 1; else b_plus = false; if(!b_plus) break; p1 = p2; } else { b_plus = false; break; } } } else if(u1 && !p1 && u1->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) u1)->mixWithBase()) { b_plus = true; for(size_t i2 = 1; i2 < mstruct->size(); i2++) { if(!(*mstruct)[i2].inParentheses() && (*mstruct)[i2].isMultiplication() && (*mstruct)[i2].size() == 2 && (*mstruct)[i2][0].isNumber() && (*mstruct)[i2][1].isUnit() && u1->isChildOf((*mstruct)[i2][1].unit()) && !(*mstruct)[i2][1].prefix() && (i2 == mstruct->size() - 1 || ((*mstruct)[i2][1].unit()->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) (*mstruct)[i2][1].unit())->mixWithBase()))) { while(((AliasUnit*) u1)->firstBaseUnit() != (*mstruct)[i2][1].unit()) { u1 = ((AliasUnit*) u1)->firstBaseUnit(); if(u1->subtype() != SUBTYPE_ALIAS_UNIT || !((AliasUnit*) u1)->mixWithBase()) { b_plus = false; break; } } if(!b_plus) break; u1 = (*mstruct)[i2][1].unit(); } else { b_plus = false; break; } } } if(b_plus) mstruct->setType(STRUCT_ADDITION); } if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } else if(minus_count % 2 == 1) { mstruct->negate(); } return true; } } if((i = str.find(ID_WRAP_LEFT_CH, 1)) != string::npos) { bool b = false, append = false; while(i != string::npos) { if(str[i - 1] != POWER_CH && (i < 2 || str[i - 1] != MINUS_CH || str[i - 2] != POWER_CH)) { str2 = str.substr(0, i); str = str.substr(i, str.length() - i); if(b) { parseAdd(str2, mstruct, po, OPERATION_MULTIPLY, append); append = true; } else { parseAdd(str2, mstruct, po); b = true; } i = str.find(ID_WRAP_LEFT_CH, 1); } else { i = str.find(ID_WRAP_LEFT_CH, i + 1); } } if(b) { parseAdd(str, mstruct, po, OPERATION_MULTIPLY, append); if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } else if(minus_count % 2 == 1) { mstruct->negate(); } return true; } } if((i = str.find(POWER_CH, 1)) != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); parseAdd(str2, mstruct, po); parseAdd(str, mstruct, po, OPERATION_RAISE); } else if(po.base >= 2 && po.base <= 10 && (i = str.find_first_of(EXPS, 1)) != string::npos && i + 1 != str.length() && str.find("\b") == string::npos) { str2 = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); parseAdd(str2, mstruct, po); parseAdd(str, mstruct, po, OPERATION_EXP10); } else if((i = str.find(ID_WRAP_LEFT_CH, 1)) != string::npos && i + 1 != str.length() && str.find(ID_WRAP_RIGHT_CH, i + 1) && str.find_first_not_of(PLUS MINUS, 0) != i) { str2 = str.substr(0, i); str = str.substr(i, str.length() - i); parseAdd(str2, mstruct, po); parseAdd(str, mstruct, po, OPERATION_MULTIPLY); } else if(str.length() > 0 && str[0] == ID_WRAP_LEFT_CH && (i = str.find(ID_WRAP_RIGHT_CH, 1)) != string::npos && i + 1 != str.length()) { str2 = str.substr(0, i + 1); str = str.substr(i + 1, str.length() - (i + 1)); parseAdd(str2, mstruct, po); parseAdd(str, mstruct, po, OPERATION_MULTIPLY); } else { ret = parseNumber(mstruct, str, po); } if(po.preserve_format) { while(minus_count > 0) { mstruct->transform(STRUCT_NEGATE); minus_count--; } } else if(minus_count % 2 == 1) { mstruct->negate(); } return ret; } string Calculator::getName(string name, ExpressionItem *object, bool force, bool always_append) { ExpressionItem *item = NULL; if(!object) { } else if(object->type() == TYPE_FUNCTION) { item = getActiveFunction(name); } else { item = getActiveVariable(name); if(!item) { item = getActiveUnit(name); } if(!item) { item = getCompositeUnit(name); } } if(item && force && !name.empty() && item != object && object) { if(!item->isLocal()) { bool b = item->hasChanged(); if(object->isActive()) { item->setActive(false); } if(!object->isLocal()) { item->setChanged(b); } } else { if(object->isActive()) { item->destroy(); } } return name; } int i2 = 1; bool changed = false; if(name.empty()) { name = "var"; always_append = true; item = NULL; changed = true; } string stmp = name; if(always_append) { stmp += NAME_NUMBER_PRE_STR; stmp += "1"; } if(changed || (item && item != object)) { if(item) { i2++; stmp = name; stmp += NAME_NUMBER_PRE_STR; stmp += i2s(i2); } while(true) { if(!object) { item = getActiveFunction(stmp); if(!item) { item = getActiveVariable(stmp); } if(!item) { item = getActiveUnit(stmp); } if(!item) { item = getCompositeUnit(stmp); } } else if(object->type() == TYPE_FUNCTION) { item = getActiveFunction(stmp); } else { item = getActiveVariable(stmp); if(!item) { item = getActiveUnit(stmp); } if(!item) { item = getCompositeUnit(stmp); } } if(item && item != object) { i2++; stmp = name; stmp += NAME_NUMBER_PRE_STR; stmp += i2s(i2); } else { break; } } } if(i2 > 1 && !always_append) { error(false, _("Name \"%s\" is in use. Replacing with \"%s\"."), name.c_str(), stmp.c_str(), NULL); } return stmp; } bool Calculator::loadGlobalDefinitions() { bool b = true; if(!loadDefinitions(buildPath(getGlobalDefinitionsDir(), "prefixes.xml").c_str(), false)) b = false; if(!loadDefinitions(buildPath(getGlobalDefinitionsDir(), "currencies.xml").c_str(), false)) b = false; if(!loadDefinitions(buildPath(getGlobalDefinitionsDir(), "units.xml").c_str(), false)) b = false; if(!loadDefinitions(buildPath(getGlobalDefinitionsDir(), "functions.xml").c_str(), false)) b = false; if(!loadDefinitions(buildPath(getGlobalDefinitionsDir(), "datasets.xml").c_str(), false)) b = false; if(!loadDefinitions(buildPath(getGlobalDefinitionsDir(), "variables.xml").c_str(), false)) b = false; return b; } bool Calculator::loadGlobalDefinitions(string filename) { return loadDefinitions(buildPath(getGlobalDefinitionsDir(), filename).c_str(), false); } bool Calculator::loadGlobalPrefixes() { return loadGlobalDefinitions("prefixes.xml"); } bool Calculator::loadGlobalCurrencies() { return loadGlobalDefinitions("currencies.xml"); } bool Calculator::loadGlobalUnits() { bool b = loadGlobalDefinitions("currencies.xml"); return loadGlobalDefinitions("units.xml") && b; } bool Calculator::loadGlobalVariables() { return loadGlobalDefinitions("variables.xml"); } bool Calculator::loadGlobalFunctions() { return loadGlobalDefinitions("functions.xml"); } bool Calculator::loadGlobalDataSets() { return loadGlobalDefinitions("datasets.xml"); } bool Calculator::loadLocalDefinitions() { string homedir = buildPath(getLocalDataDir(), "definitions"); if(!dirExists(homedir)) { string homedir_old = buildPath(getOldLocalDir(), "definitions"); if(dirExists(homedir)) { if(!dirExists(getLocalDataDir())) { recursiveMakeDir(getLocalDataDir()); } if(makeDir(homedir)) { list eps_old; struct dirent *ep_old; DIR *dp_old = opendir(homedir_old.c_str()); if(dp_old) { while((ep_old = readdir(dp_old))) { #ifdef _DIRENT_HAVE_D_TYPE if(ep_old->d_type != DT_DIR) { #endif if(strcmp(ep_old->d_name, "..") != 0 && strcmp(ep_old->d_name, ".") != 0 && strcmp(ep_old->d_name, "datasets") != 0) { eps_old.push_back(ep_old->d_name); } #ifdef _DIRENT_HAVE_D_TYPE } #endif } closedir(dp_old); } for(list::iterator it = eps_old.begin(); it != eps_old.end(); ++it) { move_file(buildPath(homedir_old, *it).c_str(), buildPath(homedir, *it).c_str()); } if(removeDir(homedir_old)) { removeDir(getOldLocalDir()); } } } } list eps; struct dirent *ep; DIR *dp = opendir(homedir.c_str()); if(dp) { while((ep = readdir(dp))) { #ifdef _DIRENT_HAVE_D_TYPE if(ep->d_type != DT_DIR) { #endif if(strcmp(ep->d_name, "..") != 0 && strcmp(ep->d_name, ".") != 0 && strcmp(ep->d_name, "datasets") != 0) { eps.push_back(ep->d_name); } #ifdef _DIRENT_HAVE_D_TYPE } #endif } closedir(dp); } eps.sort(); for(list::iterator it = eps.begin(); it != eps.end(); ++it) { loadDefinitions(buildPath(homedir, *it).c_str(), (*it) == "functions.xml" || (*it) == "variables.xml" || (*it) == "units.xml" || (*it) == "datasets.xml"); } for(size_t i = 0; i < variables.size(); i++) { if(!variables[i]->isLocal() && !variables[i]->isActive() && !getActiveExpressionItem(variables[i])) variables[i]->setActive(true); } for(size_t i = 0; i < units.size(); i++) { if(!units[i]->isLocal() && !units[i]->isActive() && !getActiveExpressionItem(units[i])) units[i]->setActive(true); } for(size_t i = 0; i < functions.size(); i++) { if(!functions[i]->isLocal() && !functions[i]->isActive() && !getActiveExpressionItem(functions[i])) functions[i]->setActive(true); } return true; } #define ITEM_SAVE_BUILTIN_NAMES\ if(!is_user_defs) {item->setRegistered(false);} \ for(size_t i = 1; i <= item->countNames(); i++) { \ if(item->getName(i).reference) { \ for(size_t i2 = 0; i2 < 10; i2++) { \ if(ref_names[i2].name.empty()) { \ ref_names[i2] = item->getName(i); \ break; \ } \ } \ } \ } \ item->clearNames(); #define ITEM_SET_BEST_NAMES(validation) \ size_t names_i = 0, i2 = 0; \ string *str_names; \ if(best_names == "-") {best_names = ""; nextbest_names = "";} \ if(!best_names.empty()) {str_names = &best_names;} \ else if(!nextbest_names.empty()) {str_names = &nextbest_names;} \ else {str_names = &default_names;} \ if(!str_names->empty() && (*str_names)[0] == '!') { \ names_i = str_names->find('!', 1) + 1; \ } \ while(true) { \ size_t i3 = names_i; \ names_i = str_names->find(",", i3); \ if(i2 == 0) { \ i2 = str_names->find(":", i3); \ } \ bool case_set = false; \ ename.unicode = false; \ ename.abbreviation = false; \ ename.case_sensitive = false; \ ename.suffix = false; \ ename.avoid_input = false; \ ename.completion_only = false; \ ename.reference = false; \ ename.plural = false; \ if(i2 < names_i) { \ bool b = true; \ for(; i3 < i2; i3++) { \ switch((*str_names)[i3]) { \ case '-': {b = false; break;} \ case 'a': {ename.abbreviation = b; b = true; break;} \ case 'c': {ename.case_sensitive = b; b = true; case_set = true; break;} \ case 'i': {ename.avoid_input = b; b = true; break;} \ case 'p': {ename.plural = b; b = true; break;} \ case 'r': {ename.reference = b; b = true; break;} \ case 's': {ename.suffix = b; b = true; break;} \ case 'u': {ename.unicode = b; b = true; break;} \ case 'o': {ename.completion_only = b; b = true; break;} \ } \ } \ i3++; \ i2 = 0; \ } \ if(names_i == string::npos) {ename.name = str_names->substr(i3, str_names->length() - i3);} \ else {ename.name = str_names->substr(i3, names_i - i3);} \ remove_blank_ends(ename.name); \ if(!ename.name.empty() && validation(ename.name, version_numbers, is_user_defs)) { \ if(!case_set) { \ ename.case_sensitive = ename.abbreviation || text_length_is_one(ename.name); \ } \ item->addName(ename); \ } \ if(names_i == string::npos) {break;} \ names_i++; \ } #define ITEM_SET_BUILTIN_NAMES \ for(size_t i = 0; i < 10; i++) { \ if(ref_names[i].name.empty()) { \ break; \ } else { \ size_t i4 = item->hasName(ref_names[i].name, ref_names[i].case_sensitive); \ if(i4 > 0) { \ const ExpressionName *enameptr = &item->getName(i4); \ ref_names[i].case_sensitive = enameptr->case_sensitive; \ ref_names[i].abbreviation = enameptr->abbreviation; \ ref_names[i].avoid_input = enameptr->avoid_input; \ ref_names[i].completion_only = enameptr->completion_only; \ ref_names[i].plural = enameptr->plural; \ ref_names[i].suffix = enameptr->suffix; \ item->setName(ref_names[i], i4); \ } else { \ item->addName(ref_names[i]); \ } \ ref_names[i].name = ""; \ } \ } \ if(!is_user_defs) { \ item->setRegistered(true); \ nameChanged(item); \ } #define ITEM_SET_REFERENCE_NAMES(validation) \ if(str_names != &default_names && !default_names.empty()) { \ if(default_names[0] == '!') { \ names_i = default_names.find('!', 1) + 1; \ } else { \ names_i = 0; \ } \ i2 = 0; \ while(true) { \ size_t i3 = names_i; \ names_i = default_names.find(",", i3); \ if(i2 == 0) { \ i2 = default_names.find(":", i3); \ } \ bool case_set = false; \ ename.unicode = false; \ ename.abbreviation = false; \ ename.case_sensitive = false; \ ename.suffix = false; \ ename.avoid_input = false; \ ename.completion_only = false; \ ename.reference = false; \ ename.plural = false; \ if(i2 < names_i) { \ bool b = true; \ for(; i3 < i2; i3++) { \ switch(default_names[i3]) { \ case '-': {b = false; break;} \ case 'a': {ename.abbreviation = b; b = true; break;} \ case 'c': {ename.case_sensitive = b; b = true; case_set = true; break;} \ case 'i': {ename.avoid_input = b; b = true; break;} \ case 'p': {ename.plural = b; b = true; break;} \ case 'r': {ename.reference = b; b = true; break;} \ case 's': {ename.suffix = b; b = true; break;} \ case 'u': {ename.unicode = b; b = true; break;} \ case 'o': {ename.completion_only = b; b = true; break;} \ } \ } \ i3++; \ i2 = 0; \ } \ if(ename.reference) { \ if(names_i == string::npos) {ename.name = default_names.substr(i3, default_names.length() - i3);} \ else {ename.name = default_names.substr(i3, names_i - i3);} \ remove_blank_ends(ename.name); \ size_t i4 = item->hasName(ename.name, ename.case_sensitive); \ if(i4 > 0) { \ const ExpressionName *enameptr = &item->getName(i4); \ ename.suffix = enameptr->suffix; \ ename.abbreviation = enameptr->abbreviation; \ ename.avoid_input = enameptr->avoid_input; \ ename.completion_only = enameptr->completion_only; \ ename.plural = enameptr->plural; \ ename.case_sensitive = enameptr->case_sensitive; \ item->setName(ename, i4); \ } else if(!ename.name.empty() && validation(ename.name, version_numbers, is_user_defs)) { \ if(!case_set) { \ ename.case_sensitive = ename.abbreviation || text_length_is_one(ename.name); \ } \ item->addName(ename); \ } \ } \ if(names_i == string::npos) {break;} \ names_i++; \ } \ } #define ITEM_READ_NAME(validation)\ if(!new_names && (!xmlStrcmp(child->name, (const xmlChar*) "name") || !xmlStrcmp(child->name, (const xmlChar*) "abbreviation") || !xmlStrcmp(child->name, (const xmlChar*) "plural"))) {\ name_index = 1;\ XML_GET_INT_FROM_PROP(child, "index", name_index)\ if(name_index > 0 && name_index <= 10) {\ name_index--;\ names[name_index] = empty_expression_name;\ ref_names[name_index] = empty_expression_name;\ value2 = NULL;\ bool case_set = false;\ if(child->name[0] == 'a') {\ names[name_index].abbreviation = true;\ ref_names[name_index].abbreviation = true;\ } else if(child->name[0] == 'p') {\ names[name_index].plural = true;\ ref_names[name_index].plural = true;\ }\ child2 = child->xmlChildrenNode;\ while(child2 != NULL) {\ if((!best_name[name_index] || (ref_names[name_index].name.empty() && !locale.empty())) && !xmlStrcmp(child2->name, (const xmlChar*) "name")) {\ lang = xmlNodeGetLang(child2);\ if(!lang) {\ value2 = xmlNodeListGetString(doc, child2->xmlChildrenNode, 1);\ if(!value2 || validation((char*) value2, version_numbers, is_user_defs)) {\ if(locale.empty()) {\ best_name[name_index] = true;\ if(value2) names[name_index].name = (char*) value2;\ else names[name_index].name = "";\ } else if(!require_translation) {\ if(!best_name[name_index] && !nextbest_name[name_index]) {\ if(value2) names[name_index].name = (char*) value2;\ else names[name_index].name = "";\ }\ if(value2) ref_names[name_index].name = (char*) value2;\ else ref_names[name_index].name = "";\ }\ }\ } else if(!best_name[name_index] && !locale.empty()) {\ if(locale == (char*) lang) {\ value2 = xmlNodeListGetString(doc, child2->xmlChildrenNode, 1);\ if(!value2 || validation((char*) value2, version_numbers, is_user_defs)) {\ best_name[name_index] = true;\ if(value2) names[name_index].name = (char*) value2;\ else names[name_index].name = "";\ }\ } else if(!nextbest_name[name_index] && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {\ value2 = xmlNodeListGetString(doc, child2->xmlChildrenNode, 1);\ if(!value2 || validation((char*) value2, version_numbers, is_user_defs)) {\ nextbest_name[name_index] = true; \ if(value2) names[name_index].name = (char*) value2;\ else names[name_index].name = "";\ }\ }\ }\ if(value2) xmlFree(value2);\ if(lang) xmlFree(lang);\ value2 = NULL; lang = NULL;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "unicode")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].unicode)\ ref_names[name_index].unicode = names[name_index].unicode;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "reference")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].reference)\ ref_names[name_index].reference = names[name_index].reference;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "suffix")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].suffix)\ ref_names[name_index].suffix = names[name_index].suffix;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "avoid_input")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].avoid_input)\ ref_names[name_index].avoid_input = names[name_index].avoid_input;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "completion_only")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].completion_only)\ ref_names[name_index].completion_only = names[name_index].completion_only;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "plural")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].plural)\ ref_names[name_index].plural = names[name_index].plural;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "abbreviation")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].abbreviation)\ ref_names[name_index].abbreviation = names[name_index].abbreviation;\ } else if(!xmlStrcmp(child2->name, (const xmlChar*) "case_sensitive")) {\ XML_GET_BOOL_FROM_TEXT(child2, names[name_index].case_sensitive)\ ref_names[name_index].case_sensitive = names[name_index].case_sensitive;\ case_set = true;\ }\ child2 = child2->next;\ }\ if(!case_set) {\ ref_names[name_index].case_sensitive = ref_names[name_index].abbreviation || text_length_is_one(ref_names[name_index].name);\ names[name_index].case_sensitive = names[name_index].abbreviation || text_length_is_one(names[name_index].name);\ }\ if(names[name_index].reference) {\ if(!ref_names[name_index].name.empty()) {\ if(ref_names[name_index].name == names[name_index].name) {\ ref_names[name_index].name = "";\ } else {\ names[name_index].reference = false;\ }\ }\ } else if(!ref_names[name_index].name.empty()) {\ ref_names[name_index].name = "";\ }\ }\ } #define ITEM_READ_DTH \ if(!xmlStrcmp(child->name, (const xmlChar*) "description")) {\ XML_GET_LOCALE_STRING_FROM_TEXT(child, description, best_description, next_best_description)\ } else if(!xmlStrcmp(child->name, (const xmlChar*) "title")) {\ XML_GET_LOCALE_STRING_FROM_TEXT_REQ(child, title, best_title, next_best_title)\ } else if(!xmlStrcmp(child->name, (const xmlChar*) "hidden")) {\ XML_GET_TRUE_FROM_TEXT(child, hidden);\ } #define ITEM_READ_NAMES \ if(new_names && ((best_names.empty() && fulfilled_translation != 2) || default_names.empty()) && !xmlStrcmp(child->name, (const xmlChar*) "names")) {\ value = xmlNodeListGetString(doc, child->xmlChildrenNode, 1);\ lang = xmlNodeGetLang(child);\ if(!lang) {\ if(default_names.empty()) {\ if(value) {\ default_names = (char*) value;\ remove_blank_ends(default_names);\ } else {\ default_names = "";\ }\ }\ } else if(best_names.empty()) {\ if(locale == (char*) lang) {\ if(value) {\ best_names = (char*) value;\ remove_blank_ends(best_names);\ } else {\ best_names = " ";\ }\ } else if(nextbest_names.empty() && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) {\ if(value) {\ nextbest_names = (char*) value;\ remove_blank_ends(nextbest_names);\ } else {\ nextbest_names = " ";\ }\ } else if(nextbest_names.empty() && default_names.empty() && value && !require_translation) {\ nextbest_names = (char*) value;\ remove_blank_ends(nextbest_names);\ }\ }\ if(value) xmlFree(value);\ if(lang) xmlFree(lang);\ } #define ITEM_INIT_DTH \ hidden = false;\ title = ""; best_title = false; next_best_title = false;\ description = ""; best_description = false; next_best_description = false;\ if(fulfilled_translation > 0) require_translation = false; \ else {XML_GET_TRUE_FROM_PROP(cur, "require_translation", require_translation)} #define ITEM_INIT_NAME \ if(new_names) {\ best_names = "";\ nextbest_names = "";\ default_names = "";\ } else {\ for(size_t i = 0; i < 10; i++) {\ best_name[i] = false;\ nextbest_name[i] = false;\ }\ } #define ITEM_SET_NAME_1(validation)\ if(!name.empty() && validation(name, version_numbers, is_user_defs)) {\ ename.name = name;\ ename.unicode = false;\ ename.abbreviation = false;\ ename.case_sensitive = text_length_is_one(ename.name);\ ename.suffix = false;\ ename.avoid_input = false;\ ename.completion_only = false;\ ename.reference = true;\ ename.plural = false;\ item->addName(ename);\ } #define ITEM_SET_NAME_2\ for(size_t i = 0; i < 10; i++) {\ if(!names[i].name.empty()) {\ item->addName(names[i], i + 1);\ names[i].name = "";\ } else if(!ref_names[i].name.empty()) {\ item->addName(ref_names[i], i + 1);\ ref_names[i].name = "";\ }\ } #define ITEM_SET_NAME_3\ for(size_t i = 0; i < 10; i++) {\ if(!ref_names[i].name.empty()) {\ item->addName(ref_names[i]);\ ref_names[i].name = "";\ }\ } #define ITEM_SET_DTH\ item->setDescription(description);\ if(!title.empty() && title[0] == '!') {\ size_t i = title.find('!', 1);\ if(i == string::npos) {\ item->setTitle(title);\ } else if(i + 1 == title.length()) {\ item->setTitle("");\ } else {\ item->setTitle(title.substr(i + 1, title.length() - (i + 1)));\ }\ } else {\ item->setTitle(title);\ }\ item->setHidden(hidden); #define ITEM_SET_SHORT_NAME\ if(!name.empty() && unitNameIsValid(name, version_numbers, is_user_defs)) {\ ename.name = name;\ ename.unicode = false;\ ename.abbreviation = true;\ ename.case_sensitive = true;\ ename.suffix = false;\ ename.avoid_input = false;\ ename.completion_only = false;\ ename.reference = true;\ ename.plural = false;\ item->addName(ename);\ } #define ITEM_SET_SINGULAR\ if(!singular.empty()) {\ ename.name = singular;\ ename.unicode = false;\ ename.abbreviation = false;\ ename.case_sensitive = text_length_is_one(ename.name);\ ename.suffix = false;\ ename.avoid_input = false;\ ename.completion_only = false;\ ename.reference = false;\ ename.plural = false;\ item->addName(ename);\ } #define ITEM_SET_PLURAL\ if(!plural.empty()) {\ ename.name = plural;\ ename.unicode = false;\ ename.abbreviation = false;\ ename.case_sensitive = text_length_is_one(ename.name);\ ename.suffix = false;\ ename.avoid_input = false;\ ename.completion_only = false;\ ename.reference = false;\ ename.plural = true;\ item->addName(ename);\ } #define BUILTIN_NAMES_1\ if(!is_user_defs) item->setRegistered(false);\ bool has_ref_name;\ for(size_t i = 1; i <= item->countNames(); i++) {\ if(item->getName(i).reference) {\ has_ref_name = false;\ for(size_t i2 = 0; i2 < 10; i2++) {\ if(names[i2].name == item->getName(i).name || ref_names[i2].name == item->getName(i).name) {\ has_ref_name = true;\ break;\ }\ }\ if(!has_ref_name) {\ for(int i2 = 9; i2 >= 0; i2--) {\ if(ref_names[i2].name.empty()) {\ ref_names[i2] = item->getName(i);\ break;\ }\ }\ }\ }\ }\ item->clearNames(); #define BUILTIN_UNIT_NAMES_1\ if(!is_user_defs) item->setRegistered(false);\ bool has_ref_name;\ for(size_t i = 1; i <= item->countNames(); i++) {\ if(item->getName(i).reference) {\ has_ref_name = item->getName(i).name == singular || item->getName(i).name == plural;\ for(size_t i2 = 0; !has_ref_name && i2 < 10; i2++) {\ if(names[i2].name == item->getName(i).name || ref_names[i2].name == item->getName(i).name) {\ has_ref_name = true;\ break;\ }\ }\ if(!has_ref_name) {\ for(int i2 = 9; i2 >= 0; i2--) {\ if(ref_names[i2].name.empty()) {\ ref_names[i2] = item->getName(i);\ break;\ }\ }\ }\ }\ }\ item->clearNames(); #define BUILTIN_NAMES_2\ if(!is_user_defs) {\ item->setRegistered(true);\ nameChanged(item);\ } #define ITEM_CLEAR_NAMES\ for(size_t i = 0; i < 10; i++) {\ if(!names[i].name.empty()) {\ names[i].name = "";\ }\ if(!ref_names[i].name.empty()) {\ ref_names[i].name = "";\ }\ } int Calculator::loadDefinitions(const char* file_name, bool is_user_defs) { xmlDocPtr doc; xmlNodePtr cur, child, child2, child3; string version, stmp, name, uname, type, svalue, sexp, plural, countries, singular, category_title, category, description, title, inverse, suncertainty, base, argname, usystem; bool best_title, next_best_title, best_category_title, next_best_category_title, best_description, next_best_description; bool best_plural, next_best_plural, best_singular, next_best_singular, best_argname, next_best_argname, best_countries, next_best_countries; bool best_proptitle, next_best_proptitle, best_propdescr, next_best_propdescr; string proptitle, propdescr; ExpressionName names[10]; ExpressionName ref_names[10]; string prop_names[10]; string ref_prop_names[10]; bool best_name[10]; bool nextbest_name[10]; string best_names, nextbest_names, default_names; string best_prop_names, nextbest_prop_names, default_prop_names; int name_index, prec; ExpressionName ename; string locale; #ifdef _WIN32 WCHAR wlocale[LOCALE_NAME_MAX_LENGTH]; if(LCIDToLocaleName(LOCALE_USER_DEFAULT, wlocale, LOCALE_NAME_MAX_LENGTH, 0) != 0) locale = utf8_encode(wlocale); gsub("-", "_", locale); #else char *clocale = setlocale(LC_MESSAGES, ""); if(clocale) locale = clocale; #endif if(locale == "POSIX" || locale == "C") { locale = ""; } else { size_t i = locale.find('.'); if(i != string::npos) locale = locale.substr(0, i); } int fulfilled_translation = 0; string localebase; if(locale.length() > 2) { localebase = locale.substr(0, 2); if(locale == "en_US") { fulfilled_translation = 2; } else if(localebase == "en") { fulfilled_translation = 1; } } else { localebase = locale; if(locale == "en") { fulfilled_translation = 2; } } while(localebase.length() < 2) { localebase += " "; fulfilled_translation = 2; } int exponent = 1, litmp = 0, mix_priority = 0, mix_min = 0; bool active = false, hidden = false, b = false, require_translation = false, use_with_prefixes = false, use_with_prefixes_set = false; Number nr; ExpressionItem *item; MathFunction *f; Variable *v; Unit *u; AliasUnit *au; CompositeUnit *cu; Prefix *p; Argument *arg; DataSet *dc; DataProperty *dp; int itmp; IntegerArgument *iarg; NumberArgument *farg; xmlChar *value, *lang, *value2; int in_unfinished = 0; bool done_something = false; doc = xmlParseFile(file_name); if(doc == NULL) { return false; } cur = xmlDocGetRootElement(doc); if(cur == NULL) { xmlFreeDoc(doc); return false; } while(cur != NULL) { if(!xmlStrcmp(cur->name, (const xmlChar*) "QALCULATE")) { XML_GET_STRING_FROM_PROP(cur, "version", version) break; } cur = cur->next; } if(cur == NULL) { error(true, _("File not identified as Qalculate! definitions file: %s."), file_name, NULL); xmlFreeDoc(doc); return false; } int version_numbers[] = {2, 8, 2}; parse_qalculate_version(version, version_numbers); bool new_names = version_numbers[0] > 0 || version_numbers[1] > 9 || (version_numbers[1] == 9 && version_numbers[2] >= 4); ParseOptions po; vector unfinished_nodes; vector unfinished_cats; queue sub_items; vector > nodes; category = ""; nodes.resize(1); Unit *u_usd = getUnit("USD"); while(true) { if(!in_unfinished) { category_title = ""; best_category_title = false; next_best_category_title = false; child = cur->xmlChildrenNode; while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, category_title, best_category_title, next_best_category_title) } else if(!xmlStrcmp(child->name, (const xmlChar*) "category")) { nodes.back().push(child); } else { sub_items.push(child); } child = child->next; } if(!category.empty()) { category += "/"; } if(!category_title.empty() && category_title[0] == '!') {\ size_t i = category_title.find('!', 1); if(i == string::npos) { category += category_title; } else if(i + 1 < category_title.length()) { category += category_title.substr(i + 1, category_title.length() - (i + 1)); } } else { category += category_title; } } while(!sub_items.empty() || (in_unfinished && cur)) { if(!in_unfinished) { cur = sub_items.front(); sub_items.pop(); } if(!xmlStrcmp(cur->name, (const xmlChar*) "activate")) { XML_GET_STRING_FROM_TEXT(cur, name) ExpressionItem *item = getInactiveExpressionItem(name); if(item && !item->isLocal()) { item->setActive(true); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "deactivate")) { XML_GET_STRING_FROM_TEXT(cur, name) ExpressionItem *item = getActiveExpressionItem(name); if(item && !item->isLocal()) { item->setActive(false); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "function")) { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) f = new UserFunction(category, "", "", is_user_defs, 0, "", "", 0, active); item = f; done_something = true; child = cur->xmlChildrenNode; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "expression")) { XML_DO_FROM_TEXT(child, ((UserFunction*) f)->setFormula); XML_GET_PREC_FROM_PROP(child, prec) f->setPrecision(prec); XML_GET_APPROX_FROM_PROP(child, b) f->setApproximate(b); } else if(!xmlStrcmp(child->name, (const xmlChar*) "condition")) { XML_DO_FROM_TEXT(child, f->setCondition); } else if(!xmlStrcmp(child->name, (const xmlChar*) "subfunction")) { XML_GET_FALSE_FROM_PROP(child, "precalculate", b); value = xmlNodeListGetString(doc, child->xmlChildrenNode, 1); if(value) ((UserFunction*) f)->addSubfunction((char*) value, b); else ((UserFunction*) f)->addSubfunction("", true); if(value) xmlFree(value); } else if(!xmlStrcmp(child->name, (const xmlChar*) "argument")) { farg = NULL; iarg = NULL; XML_GET_STRING_FROM_PROP(child, "type", type); if(type == "text") { arg = new TextArgument(); } else if(type == "symbol") { arg = new SymbolicArgument(); } else if(type == "date") { arg = new DateArgument(); } else if(type == "integer") { iarg = new IntegerArgument(); arg = iarg; } else if(type == "number") { farg = new NumberArgument(); arg = farg; } else if(type == "vector") { arg = new VectorArgument(); } else if(type == "matrix") { arg = new MatrixArgument(); } else if(type == "boolean") { arg = new BooleanArgument(); } else if(type == "function") { arg = new FunctionArgument(); } else if(type == "unit") { arg = new UnitArgument(); } else if(type == "variable") { arg = new VariableArgument(); } else if(type == "object") { arg = new ExpressionItemArgument(); } else if(type == "angle") { arg = new AngleArgument(); } else if(type == "data-object") { arg = new DataObjectArgument(NULL, ""); } else if(type == "data-property") { arg = new DataPropertyArgument(NULL, ""); } else { arg = new Argument(); } child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } else if(!xmlStrcmp(child2->name, (const xmlChar*) "min")) { if(farg) { XML_DO_FROM_TEXT(child2, nr.set); farg->setMin(&nr); XML_GET_FALSE_FROM_PROP(child, "include_equals", b) farg->setIncludeEqualsMin(b); } else if(iarg) { XML_GET_STRING_FROM_TEXT(child2, stmp); Number integ(stmp); iarg->setMin(&integ); } } else if(!xmlStrcmp(child2->name, (const xmlChar*) "max")) { if(farg) { XML_DO_FROM_TEXT(child2, nr.set); farg->setMax(&nr); XML_GET_FALSE_FROM_PROP(child, "include_equals", b) farg->setIncludeEqualsMax(b); } else if(iarg) { XML_GET_STRING_FROM_TEXT(child2, stmp); Number integ(stmp); iarg->setMax(&integ); } } else if(farg && !xmlStrcmp(child2->name, (const xmlChar*) "complex_allowed")) { XML_GET_FALSE_FROM_TEXT(child2, b); farg->setComplexAllowed(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "condition")) { XML_DO_FROM_TEXT(child2, arg->setCustomCondition); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "matrix_allowed")) { XML_GET_TRUE_FROM_TEXT(child2, b); arg->setMatrixAllowed(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "zero_forbidden")) { XML_GET_TRUE_FROM_TEXT(child2, b); arg->setZeroForbidden(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "test")) { XML_GET_FALSE_FROM_TEXT(child2, b); arg->setTests(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "handle_vector")) { XML_GET_FALSE_FROM_TEXT(child2, b); arg->setHandleVector(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "alert")) { XML_GET_FALSE_FROM_TEXT(child2, b); arg->setAlerts(b); } child2 = child2->next; } if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { arg->setName(argname); } else if(i + 1 < argname.length()) { arg->setName(argname.substr(i + 1, argname.length() - (i + 1))); } } else { arg->setName(argname); } itmp = 1; XML_GET_INT_FROM_PROP(child, "index", itmp); f->setArgumentDefinition(itmp, arg); } else if(!xmlStrcmp(child->name, (const xmlChar*) "example")) { XML_DO_FROM_TEXT(child, f->setExample); } else ITEM_READ_NAME(functionNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SET_BEST_NAMES(functionNameIsValid) ITEM_SET_REFERENCE_NAMES(functionNameIsValid) } else { ITEM_SET_NAME_1(functionNameIsValid) ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH if(f->countNames() == 0) { f->destroy(); f = NULL; } else { f->setChanged(false); addFunction(f, true, is_user_defs); } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "dataset") || !xmlStrcmp(cur->name, (const xmlChar*) "builtin_dataset")) { bool builtin = !xmlStrcmp(cur->name, (const xmlChar*) "builtin_dataset"); XML_GET_FALSE_FROM_PROP(cur, "active", active) if(builtin) { XML_GET_STRING_FROM_PROP(cur, "name", name) dc = getDataSet(name); if(!dc) { goto after_load_object; } dc->setCategory(category); } else { dc = new DataSet(category, "", "", "", "", is_user_defs); } item = dc; done_something = true; child = cur->xmlChildrenNode; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "property")) { dp = new DataProperty(dc); child2 = child->xmlChildrenNode; if(new_names) { default_prop_names = ""; best_prop_names = ""; nextbest_prop_names = ""; } else { for(size_t i = 0; i < 10; i++) { best_name[i] = false; nextbest_name[i] = false; } } proptitle = ""; best_proptitle = false; next_best_proptitle = false; propdescr = ""; best_propdescr = false; next_best_propdescr = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, proptitle, best_proptitle, next_best_proptitle) } else if(!new_names && !xmlStrcmp(child2->name, (const xmlChar*) "name")) { name_index = 1; XML_GET_INT_FROM_PROP(child2, "index", name_index) if(name_index > 0 && name_index <= 10) { name_index--; prop_names[name_index] = ""; ref_prop_names[name_index] = ""; value2 = NULL; child3 = child2->xmlChildrenNode; while(child3 != NULL) { if((!best_name[name_index] || (ref_prop_names[name_index].empty() && !locale.empty())) && !xmlStrcmp(child3->name, (const xmlChar*) "name")) { lang = xmlNodeGetLang(child3); if(!lang) { value2 = xmlNodeListGetString(doc, child3->xmlChildrenNode, 1); if(locale.empty()) { best_name[name_index] = true; if(value2) prop_names[name_index] = (char*) value2; else prop_names[name_index] = ""; } else { if(!best_name[name_index] && !nextbest_name[name_index]) { if(value2) prop_names[name_index] = (char*) value2; else prop_names[name_index] = ""; } if(value2) ref_prop_names[name_index] = (char*) value2; else ref_prop_names[name_index] = ""; } } else if(!best_name[name_index] && !locale.empty()) { if(locale == (char*) lang) { value2 = xmlNodeListGetString(doc, child3->xmlChildrenNode, 1); best_name[name_index] = true; if(value2) prop_names[name_index] = (char*) value2; else prop_names[name_index] = ""; } else if(!nextbest_name[name_index] && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) { value2 = xmlNodeListGetString(doc, child3->xmlChildrenNode, 1); nextbest_name[name_index] = true; if(value2) prop_names[name_index] = (char*) value2; else prop_names[name_index] = ""; } } if(value2) xmlFree(value2); if(lang) xmlFree(lang); value2 = NULL; lang = NULL; } child3 = child3->next; } if(!ref_prop_names[name_index].empty() && ref_prop_names[name_index] == prop_names[name_index]) { ref_prop_names[name_index] = ""; } } } else if(new_names && !xmlStrcmp(child2->name, (const xmlChar*) "names") && ((best_prop_names.empty() && fulfilled_translation != 2) || default_prop_names.empty())) { value2 = xmlNodeListGetString(doc, child2->xmlChildrenNode, 1); lang = xmlNodeGetLang(child2); if(!lang) { if(default_prop_names.empty()) { if(value2) { default_prop_names = (char*) value2; remove_blank_ends(default_prop_names); } else { default_prop_names = ""; } } } else { if(locale == (char*) lang) { if(value2) { best_prop_names = (char*) value2; remove_blank_ends(best_prop_names); } else { best_prop_names = " "; } } else if(nextbest_prop_names.empty() && strlen((char*) lang) >= 2 && fulfilled_translation == 0 && lang[0] == localebase[0] && lang[1] == localebase[1]) { if(value2) { nextbest_prop_names = (char*) value2; remove_blank_ends(nextbest_prop_names); } else { nextbest_prop_names = " "; } } else if(nextbest_prop_names.empty() && default_prop_names.empty() && value2 && !require_translation) { nextbest_prop_names = (char*) value2; remove_blank_ends(nextbest_prop_names); } } if(value2) xmlFree(value2); if(lang) xmlFree(lang); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "description")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, propdescr, best_propdescr, next_best_propdescr) } else if(!xmlStrcmp(child2->name, (const xmlChar*) "unit")) { XML_DO_FROM_TEXT(child2, dp->setUnit) } else if(!xmlStrcmp(child2->name, (const xmlChar*) "key")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setKey(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "hidden")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setHidden(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "brackets")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setUsesBrackets(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "approximate")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setApproximate(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "case_sensitive")) { XML_GET_TRUE_FROM_TEXT(child2, b) dp->setCaseSensitive(b); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "type")) { XML_GET_STRING_FROM_TEXT(child2, stmp) if(stmp == "text") { dp->setPropertyType(PROPERTY_STRING); } else if(stmp == "number") { dp->setPropertyType(PROPERTY_NUMBER); } else if(stmp == "expression") { dp->setPropertyType(PROPERTY_EXPRESSION); } } child2 = child2->next; } if(!proptitle.empty() && proptitle[0] == '!') {\ size_t i = proptitle.find('!', 1); if(i == string::npos) { dp->setTitle(proptitle); } else if(i + 1 < proptitle.length()) { dp->setTitle(proptitle.substr(i + 1, proptitle.length() - (i + 1))); } } else { dp->setTitle(proptitle); } dp->setDescription(propdescr); if(new_names) { size_t names_i = 0, i2 = 0; string *str_names; bool had_ref = false; if(best_prop_names == "-") {best_prop_names = ""; nextbest_prop_names = "";} if(!best_prop_names.empty()) {str_names = &best_prop_names;} else if(!nextbest_prop_names.empty()) {str_names = &nextbest_prop_names;} else {str_names = &default_prop_names;} if(!str_names->empty() && (*str_names)[0] == '!') { names_i = str_names->find('!', 1) + 1; } while(true) { size_t i3 = names_i; names_i = str_names->find(",", i3); if(i2 == 0) { i2 = str_names->find(":", i3); } bool b_prop_ref = false; if(i2 < names_i) { bool b = true; for(; i3 < i2; i3++) { switch((*str_names)[i3]) { case '-': {b = false; break;} case 'r': {b_prop_ref = b; b = true; break;} } } i3++; i2 = 0; } if(names_i == string::npos) {stmp = str_names->substr(i3, str_names->length() - i3);} else {stmp = str_names->substr(i3, names_i - i3);} remove_blank_ends(stmp); if(!stmp.empty()) { if(b_prop_ref) had_ref = true; dp->addName(stmp, b_prop_ref); } if(names_i == string::npos) {break;} names_i++; } if(str_names != &default_prop_names && !default_prop_names.empty()) { if(default_prop_names[0] == '!') { names_i = default_prop_names.find('!', 1) + 1; } else { names_i = 0; } i2 = 0; while(true) { size_t i3 = names_i; names_i = default_prop_names.find(",", i3); if(i2 == 0) { i2 = default_prop_names.find(":", i3); } bool b_prop_ref = false; if(i2 < names_i) { bool b = true; for(; i3 < i2; i3++) { switch(default_prop_names[i3]) { case '-': {b = false; break;} case 'r': {b_prop_ref = b; b = true; break;} } } i3++; i2 = 0; } if(b_prop_ref || (!had_ref && names_i == string::npos)) { had_ref = true; if(names_i == string::npos) {stmp = default_prop_names.substr(i3, default_prop_names.length() - i3);} else {stmp = default_prop_names.substr(i3, names_i - i3);} remove_blank_ends(stmp); size_t i4 = dp->hasName(stmp); if(i4 > 0) { dp->setNameIsReference(i4, true); } else if(!stmp.empty()) { dp->addName(stmp, true); } } if(names_i == string::npos) {break;} names_i++; } } if(!had_ref && dp->countNames() > 0) dp->setNameIsReference(1, true); } else { bool b = false; for(size_t i = 0; i < 10; i++) { if(!prop_names[i].empty()) { if(!b && ref_prop_names[i].empty()) { dp->addName(prop_names[i], true, i + 1); b = true; } else { dp->addName(prop_names[i], false, i + 1); } prop_names[i] = ""; } } for(size_t i = 0; i < 10; i++) { if(!ref_prop_names[i].empty()) { if(!b) { dp->addName(ref_prop_names[i], true); b = true; } else { dp->addName(ref_prop_names[i], false); } ref_prop_names[i] = ""; } } } dp->setUserModified(is_user_defs); dc->addProperty(dp); } else if(!xmlStrcmp(child->name, (const xmlChar*) "argument")) { child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } child2 = child2->next; } itmp = 1; XML_GET_INT_FROM_PROP(child, "index", itmp); if(dc->getArgumentDefinition(itmp)) { dc->getArgumentDefinition(itmp)->setName(argname); } } else if(!xmlStrcmp(child->name, (const xmlChar*) "object_argument")) { child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } child2 = child2->next; } itmp = 1; if(dc->getArgumentDefinition(itmp)) { if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { dc->getArgumentDefinition(itmp)->setName(argname); } else if(i + 1 < argname.length()) { dc->getArgumentDefinition(itmp)->setName(argname.substr(i + 1, argname.length() - (i + 1))); } } else { dc->getArgumentDefinition(itmp)->setName(argname); } } } else if(!xmlStrcmp(child->name, (const xmlChar*) "property_argument")) { child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } child2 = child2->next; } itmp = 2; if(dc->getArgumentDefinition(itmp)) { if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { dc->getArgumentDefinition(itmp)->setName(argname); } else if(i + 1 < argname.length()) { dc->getArgumentDefinition(itmp)->setName(argname.substr(i + 1, argname.length() - (i + 1))); } } else { dc->getArgumentDefinition(itmp)->setName(argname); } } } else if(!xmlStrcmp(child->name, (const xmlChar*) "default_property")) { XML_DO_FROM_TEXT(child, dc->setDefaultProperty) } else if(!builtin && !xmlStrcmp(child->name, (const xmlChar*) "copyright")) { XML_DO_FROM_TEXT(child, dc->setCopyright) } else if(!builtin && !xmlStrcmp(child->name, (const xmlChar*) "datafile")) { XML_DO_FROM_TEXT(child, dc->setDefaultDataFile) } else if(!xmlStrcmp(child->name, (const xmlChar*) "example")) { XML_DO_FROM_TEXT(child, dc->setExample); } else ITEM_READ_NAME(functionNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { if(builtin) { ITEM_SAVE_BUILTIN_NAMES } ITEM_SET_BEST_NAMES(functionNameIsValid) ITEM_SET_REFERENCE_NAMES(functionNameIsValid) if(builtin) { ITEM_SET_BUILTIN_NAMES } } else { if(builtin) { BUILTIN_NAMES_1 } ITEM_SET_NAME_2 ITEM_SET_NAME_3 if(builtin) { BUILTIN_NAMES_2 } } ITEM_SET_DTH if(!builtin && dc->countNames() == 0) { dc->destroy(); dc = NULL; } else { dc->setChanged(builtin && is_user_defs); if(!builtin) addDataSet(dc, true, is_user_defs); } done_something = true; } else if(!xmlStrcmp(cur->name, (const xmlChar*) "builtin_function")) { XML_GET_STRING_FROM_PROP(cur, "name", name) f = getFunction(name); if(f) { XML_GET_FALSE_FROM_PROP(cur, "active", active) f->setLocal(is_user_defs, active); f->setCategory(category); item = f; child = cur->xmlChildrenNode; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "argument")) { child2 = child->xmlChildrenNode; argname = ""; best_argname = false; next_best_argname = false; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "title")) { XML_GET_LOCALE_STRING_FROM_TEXT(child2, argname, best_argname, next_best_argname) } child2 = child2->next; } itmp = 1; XML_GET_INT_FROM_PROP(child, "index", itmp); if(f->getArgumentDefinition(itmp)) { if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { f->getArgumentDefinition(itmp)->setName(argname); } else if(i + 1 < argname.length()) { f->getArgumentDefinition(itmp)->setName(argname.substr(i + 1, argname.length() - (i + 1))); } } else { f->getArgumentDefinition(itmp)->setName(argname); } } else if(itmp <= f->maxargs() || itmp <= f->minargs()) { if(!argname.empty() && argname[0] == '!') { size_t i = argname.find('!', 1); if(i == string::npos) { f->setArgumentDefinition(itmp, new Argument(argname, false)); } else if(i + 1 < argname.length()) { f->setArgumentDefinition(itmp, new Argument(argname.substr(i + 1, argname.length() - (i + 1)), false)); } } else { f->setArgumentDefinition(itmp, new Argument(argname, false)); } } } else if(!xmlStrcmp(child->name, (const xmlChar*) "example")) { XML_DO_FROM_TEXT(child, f->setExample); } else ITEM_READ_NAME(functionNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SAVE_BUILTIN_NAMES ITEM_SET_BEST_NAMES(functionNameIsValid) ITEM_SET_REFERENCE_NAMES(functionNameIsValid) ITEM_SET_BUILTIN_NAMES } else { BUILTIN_NAMES_1 ITEM_SET_NAME_2 ITEM_SET_NAME_3 BUILTIN_NAMES_2 } ITEM_SET_DTH f->setChanged(false); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "unknown")) { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) svalue = ""; v = new UnknownVariable(category, "", "", is_user_defs, false, active); item = v; done_something = true; child = cur->xmlChildrenNode; b = true; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "type")) { XML_GET_STRING_FROM_TEXT(child, stmp); if(!((UnknownVariable*) v)->assumptions()) ((UnknownVariable*) v)->setAssumptions(new Assumptions()); if(stmp == "integer") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_INTEGER); else if(stmp == "rational") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_RATIONAL); else if(stmp == "real") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_REAL); else if(stmp == "complex") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_COMPLEX); else if(stmp == "number") ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_NUMBER); else if(stmp == "non-matrix") { if(VERSION_BEFORE(0, 9, 13)) { ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_NUMBER); } else { ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_NONMATRIX); } } else if(stmp == "none") { if(VERSION_BEFORE(0, 9, 13)) { ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_NUMBER); } else { ((UnknownVariable*) v)->assumptions()->setType(ASSUMPTION_TYPE_NONE); } } } else if(!xmlStrcmp(child->name, (const xmlChar*) "sign")) { XML_GET_STRING_FROM_TEXT(child, stmp); if(!((UnknownVariable*) v)->assumptions()) ((UnknownVariable*) v)->setAssumptions(new Assumptions()); if(stmp == "non-zero") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_NONZERO); else if(stmp == "non-positive") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_NONPOSITIVE); else if(stmp == "negative") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_NEGATIVE); else if(stmp == "non-negative") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_NONNEGATIVE); else if(stmp == "positive") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_POSITIVE); else if(stmp == "unknown") ((UnknownVariable*) v)->assumptions()->setSign(ASSUMPTION_SIGN_UNKNOWN); } else ITEM_READ_NAME(variableNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SET_BEST_NAMES(variableNameIsValid) ITEM_SET_REFERENCE_NAMES(variableNameIsValid) } else { ITEM_SET_NAME_1(variableNameIsValid) ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH for(size_t i = 1; i <= v->countNames(); i++) { if(v->getName(i).name == "x") {v_x->destroy(); v_x = (UnknownVariable*) v; break;} if(v->getName(i).name == "y") {v_y->destroy(); v_y = (UnknownVariable*) v; break;} if(v->getName(i).name == "z") {v_z->destroy(); v_z = (UnknownVariable*) v; break;} } if(v->countNames() == 0) { v->destroy(); v = NULL; } else { addVariable(v, true, is_user_defs); v->setChanged(false); } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "variable")) { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) svalue = ""; v = new KnownVariable(category, "", "", "", is_user_defs, false, active); item = v; done_something = true; child = cur->xmlChildrenNode; b = true; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "value")) { XML_DO_FROM_TEXT(child, ((KnownVariable*) v)->set); XML_DO_FROM_PROP(child, "uncertainty", ((KnownVariable*) v)->setUncertainty) XML_DO_FROM_PROP(child, "unit", ((KnownVariable*) v)->setUnit) XML_GET_PREC_FROM_PROP(child, prec) v->setPrecision(prec); XML_GET_APPROX_FROM_PROP(child, b); if(b) v->setApproximate(true); } else ITEM_READ_NAME(variableNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SET_BEST_NAMES(variableNameIsValid) ITEM_SET_REFERENCE_NAMES(variableNameIsValid) } else { ITEM_SET_NAME_1(variableNameIsValid) ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH if(v->countNames() == 0) { v->destroy(); v = NULL; } else { addVariable(v, true, is_user_defs); item->setChanged(false); } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "builtin_variable")) { XML_GET_STRING_FROM_PROP(cur, "name", name) v = getVariable(name); if(v) { XML_GET_FALSE_FROM_PROP(cur, "active", active) v->setLocal(is_user_defs, active); v->setCategory(category); item = v; child = cur->xmlChildrenNode; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { ITEM_READ_NAME(variableNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(new_names) { ITEM_SAVE_BUILTIN_NAMES ITEM_SET_BEST_NAMES(variableNameIsValid) ITEM_SET_REFERENCE_NAMES(variableNameIsValid) ITEM_SET_BUILTIN_NAMES } else { BUILTIN_NAMES_1 ITEM_SET_NAME_2 ITEM_SET_NAME_3 BUILTIN_NAMES_2 } ITEM_SET_DTH v->setChanged(false); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "unit")) { XML_GET_STRING_FROM_PROP(cur, "type", type) if(type == "base") { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) u = new Unit(category, "", "", "", "", is_user_defs, false, active); item = u; child = cur->xmlChildrenNode; singular = ""; best_singular = false; next_best_singular = false; plural = ""; best_plural = false; next_best_plural = false; countries = "", best_countries = false, next_best_countries = false; use_with_prefixes_set = false; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "system")) { XML_DO_FROM_TEXT(child, u->setSystem) } else if(!xmlStrcmp(child->name, (const xmlChar*) "use_with_prefixes")) { XML_GET_TRUE_FROM_TEXT(child, use_with_prefixes) use_with_prefixes_set = true; } else if((VERSION_BEFORE(0, 6, 3)) && !xmlStrcmp(child->name, (const xmlChar*) "singular")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, singular, best_singular, next_best_singular) if(!unitNameIsValid(singular, version_numbers, is_user_defs)) { singular = ""; } } else if((VERSION_BEFORE(0, 6, 3)) && !xmlStrcmp(child->name, (const xmlChar*) "plural") && !xmlGetProp(child, (xmlChar*) "index")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, plural, best_plural, next_best_plural) if(!unitNameIsValid(plural, version_numbers, is_user_defs)) { plural = ""; } } else if(!xmlStrcmp(child->name, (const xmlChar*) "countries")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, countries, best_countries, next_best_countries) } else ITEM_READ_NAME(unitNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } u->setCountries(countries); if(new_names) { ITEM_SET_BEST_NAMES(unitNameIsValid) ITEM_SET_REFERENCE_NAMES(unitNameIsValid) } else { ITEM_SET_SHORT_NAME ITEM_SET_SINGULAR ITEM_SET_PLURAL ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH if(use_with_prefixes_set) { u->setUseWithPrefixesByDefault(use_with_prefixes); } if(u->countNames() == 0) { u->destroy(); u = NULL; } else { if(!is_user_defs && u->referenceName() == "s") u_second = u; addUnit(u, true, is_user_defs); u->setChanged(false); } done_something = true; } else if(type == "alias") { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) u = NULL; child = cur->xmlChildrenNode; singular = ""; best_singular = false; next_best_singular = false; plural = ""; best_plural = false; next_best_plural = false; countries = "", best_countries = false, next_best_countries = false; bool b_currency = false; use_with_prefixes_set = false; usystem = ""; prec = -1; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "base")) { child2 = child->xmlChildrenNode; exponent = 1; mix_priority = 0; mix_min = 0; svalue = ""; inverse = ""; suncertainty = ""; b = true; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "unit")) { XML_GET_STRING_FROM_TEXT(child2, base); u = getUnit(base); b_currency = (!is_user_defs && u && u == u_euro); if(!u) { u = getCompositeUnit(base); } } else if(!xmlStrcmp(child2->name, (const xmlChar*) "relation")) { XML_GET_STRING_FROM_TEXT(child2, svalue); XML_GET_APPROX_FROM_PROP(child2, b) XML_GET_PREC_FROM_PROP(child2, prec) XML_GET_STRING_FROM_PROP(child2, "uncertainty", suncertainty) } else if(!xmlStrcmp(child2->name, (const xmlChar*) "reverse_relation")) { XML_GET_STRING_FROM_TEXT(child2, inverse); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "inverse_relation")) { XML_GET_STRING_FROM_TEXT(child2, inverse); } else if(!xmlStrcmp(child2->name, (const xmlChar*) "exponent")) { XML_GET_STRING_FROM_TEXT(child2, stmp); if(stmp.empty()) { exponent = 1; } else { exponent = s2i(stmp); } } else if(!xmlStrcmp(child2->name, (const xmlChar*) "mix")) { XML_GET_INT_FROM_PROP(child2, "min", mix_min); XML_GET_STRING_FROM_TEXT(child2, stmp); if(stmp.empty()) { mix_priority = 0; } else { mix_priority = s2i(stmp); } } child2 = child2->next; } } else if(!xmlStrcmp(child->name, (const xmlChar*) "system")) { XML_GET_STRING_FROM_TEXT(child, usystem); } else if(!xmlStrcmp(child->name, (const xmlChar*) "use_with_prefixes")) { XML_GET_TRUE_FROM_TEXT(child, use_with_prefixes) use_with_prefixes_set = true; } else if((VERSION_BEFORE(0, 6, 3)) && !xmlStrcmp(child->name, (const xmlChar*) "singular")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, singular, best_singular, next_best_singular) if(!unitNameIsValid(singular, version_numbers, is_user_defs)) { singular = ""; } } else if((VERSION_BEFORE(0, 6, 3)) && !xmlStrcmp(child->name, (const xmlChar*) "plural") && !xmlGetProp(child, (xmlChar*) "index")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, plural, best_plural, next_best_plural) if(!unitNameIsValid(plural, version_numbers, is_user_defs)) { plural = ""; } } else if(!xmlStrcmp(child->name, (const xmlChar*) "countries")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, countries, best_countries, next_best_countries) } else ITEM_READ_NAME(unitNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(!u) { ITEM_CLEAR_NAMES if(!in_unfinished) { unfinished_nodes.push_back(cur); unfinished_cats.push_back(category); } } else { au = new AliasUnit(category, name, plural, singular, title, u, svalue, exponent, inverse, is_user_defs, false, active); au->setCountries(countries); if(mix_priority > 0) { au->setMixWithBase(mix_priority); au->setMixWithBaseMinimum(mix_min); } au->setDescription(description); au->setPrecision(prec); if(b) au->setApproximate(true); au->setUncertainty(suncertainty); au->setHidden(hidden); au->setSystem(usystem); if(use_with_prefixes_set) { au->setUseWithPrefixesByDefault(use_with_prefixes); } item = au; if(new_names) { ITEM_SET_BEST_NAMES(unitNameIsValid) ITEM_SET_REFERENCE_NAMES(unitNameIsValid) } else { ITEM_SET_NAME_2 ITEM_SET_NAME_3 } if(b_currency && !au->referenceName().empty()) { u = getUnit(au->referenceName()); if(u && u->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) u)->baseUnit() == u_euro) u->destroy(); } if(au->countNames() == 0) { au->destroy(); au = NULL; } else { if(!is_user_defs && au->baseUnit() == CALCULATOR->u_second) { if(au->referenceName() == "d" || au->referenceName() == "day") u_day = au; else if(au->referenceName() == "year") u_year = au; else if(au->referenceName() == "month") u_month = au; else if(au->referenceName() == "min") u_minute = au; else if(au->referenceName() == "h") u_hour = au; } addUnit(au, true, is_user_defs); au->setChanged(false); } done_something = true; } } else if(type == "composite") { if(VERSION_BEFORE(0, 6, 3)) { XML_GET_STRING_FROM_PROP(cur, "name", name) } else { name = ""; } XML_GET_FALSE_FROM_PROP(cur, "active", active) child = cur->xmlChildrenNode; usystem = ""; cu = NULL; ITEM_INIT_DTH ITEM_INIT_NAME b = true; while(child != NULL) { u = NULL; if(!xmlStrcmp(child->name, (const xmlChar*) "part")) { child2 = child->xmlChildrenNode; p = NULL; exponent = 1; while(child2 != NULL) { if(!xmlStrcmp(child2->name, (const xmlChar*) "unit")) { XML_GET_STRING_FROM_TEXT(child2, base); u = getUnit(base); if(!u) { u = getCompositeUnit(base); } } else if(!xmlStrcmp(child2->name, (const xmlChar*) "prefix")) { XML_GET_STRING_FROM_PROP(child2, "type", stmp) XML_GET_STRING_FROM_TEXT(child2, svalue); p = NULL; if(stmp == "binary") { litmp = s2i(svalue); if(litmp != 0) { p = getExactBinaryPrefix(litmp); if(!p) b = false; } } else if(stmp == "number") { nr.set(stmp); if(!nr.isZero()) { p = getExactPrefix(stmp); if(!p) b = false; } } else { litmp = s2i(svalue); if(litmp != 0) { p = getExactDecimalPrefix(litmp); if(!p) b = false; } } if(!b) { if(cu) { delete cu; } cu = NULL; break; } } else if(!xmlStrcmp(child2->name, (const xmlChar*) "exponent")) { XML_GET_STRING_FROM_TEXT(child2, stmp); if(stmp.empty()) { exponent = 1; } else { exponent = s2i(stmp); } } child2 = child2->next; } if(!b) break; if(u) { if(!cu) { cu = new CompositeUnit("", "", "", "", is_user_defs, false, active); } cu->add(u, exponent, p); } else { if(cu) delete cu; cu = NULL; if(!in_unfinished) { unfinished_nodes.push_back(cur); unfinished_cats.push_back(category); } break; } } else if(!xmlStrcmp(child->name, (const xmlChar*) "system")) { XML_GET_STRING_FROM_TEXT(child, usystem); } else if(!xmlStrcmp(child->name, (const xmlChar*) "use_with_prefixes")) { XML_GET_TRUE_FROM_TEXT(child, use_with_prefixes) use_with_prefixes_set = true; } else ITEM_READ_NAME(unitNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(cu) { item = cu; cu->setCategory(category); cu->setSystem(usystem); /*if(use_with_prefixes_set) { cu->setUseWithPrefixesByDefault(use_with_prefixes); }*/ if(new_names) { ITEM_SET_BEST_NAMES(unitNameIsValid) ITEM_SET_REFERENCE_NAMES(unitNameIsValid) } else { ITEM_SET_NAME_1(unitNameIsValid) ITEM_SET_NAME_2 ITEM_SET_NAME_3 } ITEM_SET_DTH if(cu->countNames() == 0) { cu->destroy(); cu = NULL; } else { addUnit(cu, true, is_user_defs); cu->setChanged(false); } done_something = true; } else { ITEM_CLEAR_NAMES } } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "builtin_unit")) { XML_GET_STRING_FROM_PROP(cur, "name", name) u = getUnit(name); if(!u) { u = getCompositeUnit(name); } if(u) { XML_GET_FALSE_FROM_PROP(cur, "active", active) u->setLocal(is_user_defs, active); u->setCategory(category); item = u; child = cur->xmlChildrenNode; singular = ""; best_singular = false; next_best_singular = false; plural = ""; best_plural = false; next_best_plural = false; countries = "", best_countries = false, next_best_countries = false; use_with_prefixes_set = false; ITEM_INIT_DTH ITEM_INIT_NAME while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "singular")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, singular, best_singular, next_best_singular) if(!unitNameIsValid(singular, version_numbers, is_user_defs)) { singular = ""; } } else if(!xmlStrcmp(child->name, (const xmlChar*) "plural") && !xmlGetProp(child, (xmlChar*) "index")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, plural, best_plural, next_best_plural) if(!unitNameIsValid(plural, version_numbers, is_user_defs)) { plural = ""; } } else if(!xmlStrcmp(child->name, (const xmlChar*) "use_with_prefixes")) { XML_GET_TRUE_FROM_TEXT(child, use_with_prefixes) use_with_prefixes_set = true; } else if(!xmlStrcmp(child->name, (const xmlChar*) "countries")) { XML_GET_LOCALE_STRING_FROM_TEXT(child, countries, best_countries, next_best_countries) } else ITEM_READ_NAME(unitNameIsValid) else ITEM_READ_DTH else { ITEM_READ_NAMES } child = child->next; } if(use_with_prefixes_set) { u->setUseWithPrefixesByDefault(use_with_prefixes); } u->setCountries(countries); if(new_names) { ITEM_SAVE_BUILTIN_NAMES ITEM_SET_BEST_NAMES(unitNameIsValid) ITEM_SET_REFERENCE_NAMES(unitNameIsValid) ITEM_SET_BUILTIN_NAMES } else { BUILTIN_UNIT_NAMES_1 ITEM_SET_SINGULAR ITEM_SET_PLURAL ITEM_SET_NAME_2 ITEM_SET_NAME_3 BUILTIN_NAMES_2 } ITEM_SET_DTH if(u_usd && u->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) u)->firstBaseUnit() == u_usd) u->setHidden(true); u->setChanged(false); done_something = true; } } else if(!xmlStrcmp(cur->name, (const xmlChar*) "prefix")) { child = cur->xmlChildrenNode; XML_GET_STRING_FROM_PROP(cur, "type", type) uname = ""; sexp = ""; svalue = ""; while(child != NULL) { if(!xmlStrcmp(child->name, (const xmlChar*) "name")) { XML_GET_STRING_FROM_TEXT(child, name); } else if(!xmlStrcmp(child->name, (const xmlChar*) "abbreviation")) { XML_GET_STRING_FROM_TEXT(child, stmp); } else if(!xmlStrcmp(child->name, (const xmlChar*) "unicode")) { XML_GET_STRING_FROM_TEXT(child, uname); } else if(!xmlStrcmp(child->name, (const xmlChar*) "exponent")) { XML_GET_STRING_FROM_TEXT(child, sexp); } else if(!xmlStrcmp(child->name, (const xmlChar*) "value")) { XML_GET_STRING_FROM_TEXT(child, svalue); } child = child->next; } if(type == "decimal") { addPrefix(new DecimalPrefix(s2i(sexp), name, stmp, uname)); } else if(type == "number") { addPrefix(new NumberPrefix(svalue, name, stmp, uname)); } else if(type == "binary") { addPrefix(new BinaryPrefix(s2i(sexp), name, stmp, uname)); } else { if(svalue.empty()) { addPrefix(new DecimalPrefix(s2i(sexp), name, stmp, uname)); } else { addPrefix(new NumberPrefix(svalue, name, stmp, uname)); } } done_something = true; } after_load_object: cur = NULL; if(in_unfinished) { if(done_something) { in_unfinished--; unfinished_nodes.erase(unfinished_nodes.begin() + in_unfinished); unfinished_cats.erase(unfinished_cats.begin() + in_unfinished); } if((int) unfinished_nodes.size() > in_unfinished) { cur = unfinished_nodes[in_unfinished]; category = unfinished_cats[in_unfinished]; } else if(done_something && unfinished_nodes.size() > 0) { cur = unfinished_nodes[0]; category = unfinished_cats[0]; in_unfinished = 0; done_something = false; } in_unfinished++; done_something = false; } } if(in_unfinished) { break; } while(!nodes.empty() && nodes.back().empty()) { size_t cat_i = category.rfind("/"); if(cat_i == string::npos) { category = ""; } else { category = category.substr(0, cat_i); } nodes.pop_back(); } if(!nodes.empty()) { cur = nodes.back().front(); nodes.back().pop(); nodes.resize(nodes.size() + 1); } else { if(unfinished_nodes.size() > 0) { cur = unfinished_nodes[0]; category = unfinished_cats[0]; in_unfinished = 1; done_something = false; } else { cur = NULL; } } if(cur == NULL) { break; } } xmlFreeDoc(doc); return true; } bool Calculator::saveDefinitions() { recursiveMakeDir(getLocalDataDir()); string homedir = buildPath(getLocalDataDir(), "definitions"); makeDir(homedir); bool b = true; if(!saveFunctions(buildPath(homedir, "functions.xml").c_str())) b = false; if(!saveUnits(buildPath(homedir, "units.xml").c_str())) b = false; if(!saveVariables(buildPath(homedir, "variables.xml").c_str())) b = false; if(!saveDataSets(buildPath(homedir, "datasets.xml").c_str())) b = false; if(!saveDataObjects()) b = false; return b; } struct node_tree_item { xmlNodePtr node; string category; vector items; }; int Calculator::saveDataObjects() { int returnvalue = 1; for(size_t i = 0; i < data_sets.size(); i++) { int rv = data_sets[i]->saveObjects(NULL, false); if(rv <= 0) returnvalue = rv; } return returnvalue; } int Calculator::savePrefixes(const char* file_name, bool save_global) { if(!save_global) { return true; } xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); cur = doc->children; for(size_t i = 0; i < prefixes.size(); i++) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "prefix", NULL); if(!prefixes[i]->longName(false).empty()) xmlNewTextChild(newnode, NULL, (xmlChar*) "name", (xmlChar*) prefixes[i]->longName(false).c_str()); if(!prefixes[i]->shortName(false).empty()) xmlNewTextChild(newnode, NULL, (xmlChar*) "abbreviation", (xmlChar*) prefixes[i]->shortName(false).c_str()); if(!prefixes[i]->unicodeName(false).empty()) xmlNewTextChild(newnode, NULL, (xmlChar*) "unicode", (xmlChar*) prefixes[i]->unicodeName(false).c_str()); switch(prefixes[i]->type()) { case PREFIX_DECIMAL: { xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "decimal"); xmlNewTextChild(newnode, NULL, (xmlChar*) "exponent", (xmlChar*) i2s(((DecimalPrefix*) prefixes[i])->exponent()).c_str()); break; } case PREFIX_BINARY: { xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "binary"); xmlNewTextChild(newnode, NULL, (xmlChar*) "exponent", (xmlChar*) i2s(((BinaryPrefix*) prefixes[i])->exponent()).c_str()); break; } case PREFIX_NUMBER: { xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "number"); xmlNewTextChild(newnode, NULL, (xmlChar*) "value", (xmlChar*) prefixes[i]->value().print(save_printoptions).c_str()); break; } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } #define SAVE_NAMES(o)\ str = "";\ for(size_t i2 = 1;;) {\ ename = &o->getName(i2);\ if(ename->abbreviation) {str += 'a';}\ bool b_cs = (ename->abbreviation || text_length_is_one(ename->name));\ if(ename->case_sensitive && !b_cs) {str += 'c';}\ if(!ename->case_sensitive && b_cs) {str += "-c";}\ if(ename->avoid_input) {str += 'i';}\ if(ename->completion_only) {str += 'o';}\ if(ename->plural) {str += 'p';}\ if(ename->reference) {str += 'r';}\ if(ename->suffix) {str += 's';}\ if(ename->unicode) {str += 'u';}\ if(str.empty() || str[str.length() - 1] == ',') {\ if(i2 == 1 && o->countNames() == 1) {\ if(save_global) {\ xmlNewTextChild(newnode, NULL, (xmlChar*) "_names", (xmlChar*) ename->name.c_str());\ } else {\ xmlNewTextChild(newnode, NULL, (xmlChar*) "names", (xmlChar*) ename->name.c_str());\ }\ break;\ }\ } else {\ str += ':';\ }\ str += ename->name;\ i2++;\ if(i2 > o->countNames()) {\ if(save_global) {\ xmlNewTextChild(newnode, NULL, (xmlChar*) "_names", (xmlChar*) str.c_str());\ } else {\ xmlNewTextChild(newnode, NULL, (xmlChar*) "names", (xmlChar*) str.c_str());\ }\ break;\ }\ str += ',';\ } string Calculator::temporaryCategory() const { return _("Temporary"); } int Calculator::saveVariables(const char* file_name, bool save_global) { string str; const ExpressionName *ename; xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); node_tree_item top; top.category = ""; top.node = doc->children; node_tree_item *item; string cat, cat_sub; for(size_t i = 0; i < variables.size(); i++) { if((save_global || variables[i]->isLocal() || variables[i]->hasChanged()) && variables[i]->category() != _("Temporary") && variables[i]->category() != "Temporary") { item = ⊤ if(!variables[i]->category().empty()) { cat = variables[i]->category(); size_t cat_i = cat.find("/"); size_t cat_i_prev = 0; bool b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(size_t i2 = 0; i2 < item->items.size(); i2++) { if(cat_sub == item->items[i2].category) { item = &item->items[i2]; b = true; break; } } if(!b) { item->items.resize(item->items.size() + 1); item->items[item->items.size() - 1].node = xmlNewTextChild(item->node, NULL, (xmlChar*) "category", NULL); item = &item->items[item->items.size() - 1]; item->category = cat_sub; if(save_global) { xmlNewTextChild(item->node, NULL, (xmlChar*) "_title", (xmlChar*) item->category.c_str()); } else { xmlNewTextChild(item->node, NULL, (xmlChar*) "title", (xmlChar*) item->category.c_str()); } } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } cur = item->node; if(!save_global && !variables[i]->isLocal() && variables[i]->hasChanged()) { if(variables[i]->isActive()) { xmlNewTextChild(cur, NULL, (xmlChar*) "activate", (xmlChar*) variables[i]->referenceName().c_str()); } else { xmlNewTextChild(cur, NULL, (xmlChar*) "deactivate", (xmlChar*) variables[i]->referenceName().c_str()); } } else if(save_global || variables[i]->isLocal()) { if(variables[i]->isBuiltin()) { if(variables[i]->isKnown()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_variable", NULL); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_unknown", NULL); } xmlNewProp(newnode, (xmlChar*) "name", (xmlChar*) variables[i]->referenceName().c_str()); } else { if(variables[i]->isKnown()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "variable", NULL); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "unknown", NULL); } } if(!variables[i]->isActive()) xmlNewProp(newnode, (xmlChar*) "active", (xmlChar*) "false"); if(variables[i]->isHidden()) xmlNewTextChild(newnode, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); if(!variables[i]->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) variables[i]->title(false).c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) variables[i]->title(false).c_str()); } } SAVE_NAMES(variables[i]) if(!variables[i]->description().empty()) { str = variables[i]->description(); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } if(!variables[i]->isBuiltin()) { if(variables[i]->isKnown()) { bool is_approx = false; save_printoptions.is_approximate = &is_approx; if(((KnownVariable*) variables[i])->isExpression()) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "value", (xmlChar*) ((KnownVariable*) variables[i])->expression().c_str()); if(!((KnownVariable*) variables[i])->uncertainty().empty()) xmlNewProp(newnode2, (xmlChar*) "uncertainty", (xmlChar*) ((KnownVariable*) variables[i])->uncertainty().c_str()); if(!((KnownVariable*) variables[i])->unit().empty()) xmlNewProp(newnode2, (xmlChar*) "unit", (xmlChar*) ((KnownVariable*) variables[i])->uncertainty().c_str()); } else { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "value", (xmlChar*) ((KnownVariable*) variables[i])->get().print(save_printoptions).c_str()); } save_printoptions.is_approximate = NULL; if(variables[i]->isApproximate() || is_approx) xmlNewProp(newnode2, (xmlChar*) "approximate", (xmlChar*) "true"); if(variables[i]->precision() >= 0) xmlNewProp(newnode2, (xmlChar*) "precision", (xmlChar*) i2s(variables[i]->precision()).c_str()); } else { if(((UnknownVariable*) variables[i])->assumptions()) { switch(((UnknownVariable*) variables[i])->assumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "integer"); break; } case ASSUMPTION_TYPE_RATIONAL: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "rational"); break; } case ASSUMPTION_TYPE_REAL: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "real"); break; } case ASSUMPTION_TYPE_COMPLEX: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "complex"); break; } case ASSUMPTION_TYPE_NUMBER: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "number"); break; } case ASSUMPTION_TYPE_NONMATRIX: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "non-matrix"); break; } case ASSUMPTION_TYPE_NONE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "type", (xmlChar*) "none"); break; } } switch(((UnknownVariable*) variables[i])->assumptions()->sign()) { case ASSUMPTION_SIGN_NONZERO: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "non-zero"); break; } case ASSUMPTION_SIGN_NONPOSITIVE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "non-positive"); break; } case ASSUMPTION_SIGN_NEGATIVE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "negative"); break; } case ASSUMPTION_SIGN_NONNEGATIVE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "non-negative"); break; } case ASSUMPTION_SIGN_POSITIVE: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "positive"); break; } case ASSUMPTION_SIGN_UNKNOWN: { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "sign", (xmlChar*) "unknown"); break; } } } } } } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } int Calculator::saveUnits(const char* file_name, bool save_global) { string str; xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2, newnode3; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); const ExpressionName *ename; CompositeUnit *cu = NULL; AliasUnit *au = NULL; Unit *u; node_tree_item top; top.category = ""; top.node = doc->children; node_tree_item *item; string cat, cat_sub; for(size_t i = 0; i < units.size(); i++) { u = units[i]; if(save_global || u->isLocal() || u->hasChanged()) { item = ⊤ if(!u->category().empty()) { cat = u->category(); size_t cat_i = cat.find("/"); size_t cat_i_prev = 0; bool b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(size_t i2 = 0; i2 < item->items.size(); i2++) { if(cat_sub == item->items[i2].category) { item = &item->items[i2]; b = true; break; } } if(!b) { item->items.resize(item->items.size() + 1); item->items[item->items.size() - 1].node = xmlNewTextChild(item->node, NULL, (xmlChar*) "category", NULL); item = &item->items[item->items.size() - 1]; item->category = cat_sub; if(save_global) { xmlNewTextChild(item->node, NULL, (xmlChar*) "_title", (xmlChar*) item->category.c_str()); } else { xmlNewTextChild(item->node, NULL, (xmlChar*) "title", (xmlChar*) item->category.c_str()); } } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } cur = item->node; if(!save_global && !u->isLocal() && u->hasChanged()) { if(u->isActive()) { xmlNewTextChild(cur, NULL, (xmlChar*) "activate", (xmlChar*) u->referenceName().c_str()); } else { xmlNewTextChild(cur, NULL, (xmlChar*) "deactivate", (xmlChar*) u->referenceName().c_str()); } } else if(save_global || u->isLocal()) { if(u->isBuiltin()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_unit", NULL); xmlNewProp(newnode, (xmlChar*) "name", (xmlChar*) u->referenceName().c_str()); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "unit", NULL); switch(u->subtype()) { case SUBTYPE_BASE_UNIT: { xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "base"); break; } case SUBTYPE_ALIAS_UNIT: { au = (AliasUnit*) u; xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "alias"); break; } case SUBTYPE_COMPOSITE_UNIT: { cu = (CompositeUnit*) u; xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "composite"); break; } } } if(!u->isActive()) xmlNewProp(newnode, (xmlChar*) "active", (xmlChar*) "false"); if(u->isHidden()) xmlNewTextChild(newnode, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); if(!u->system().empty()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "system", (xmlChar*) u->system().c_str()); } if(!u->isSIUnit() || !u->useWithPrefixesByDefault()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "use_with_prefixes", u->useWithPrefixesByDefault() ? (xmlChar*) "true" : (xmlChar*) "false"); } if(!u->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) u->title(false).c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) u->title(false).c_str()); } } if(save_global && u->subtype() == SUBTYPE_COMPOSITE_UNIT) { save_global = false; SAVE_NAMES(u) save_global = true; } else { SAVE_NAMES(u) } if(!u->description().empty()) { str = u->description(); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } if(!u->isBuiltin()) { if(u->subtype() == SUBTYPE_COMPOSITE_UNIT) { for(size_t i2 = 1; i2 <= cu->countUnits(); i2++) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "part", NULL); int exp = 1; Prefix *p = NULL; Unit *u = cu->get(i2, &exp, &p); xmlNewTextChild(newnode2, NULL, (xmlChar*) "unit", (xmlChar*) u->referenceName().c_str()); if(p) { switch(p->type()) { case PREFIX_DECIMAL: { xmlNewTextChild(newnode2, NULL, (xmlChar*) "prefix", (xmlChar*) i2s(((DecimalPrefix*) p)->exponent()).c_str()); break; } case PREFIX_BINARY: { newnode3 = xmlNewTextChild(newnode2, NULL, (xmlChar*) "prefix", (xmlChar*) i2s(((BinaryPrefix*) p)->exponent()).c_str()); xmlNewProp(newnode3, (xmlChar*) "type", (xmlChar*) "binary"); break; } case PREFIX_NUMBER: { newnode3 = xmlNewTextChild(newnode2, NULL, (xmlChar*) "prefix", (xmlChar*) p->value().print(save_printoptions).c_str()); xmlNewProp(newnode3, (xmlChar*) "type", (xmlChar*) "number"); break; } } } xmlNewTextChild(newnode2, NULL, (xmlChar*) "exponent", (xmlChar*) i2s(exp).c_str()); } } if(u->subtype() == SUBTYPE_ALIAS_UNIT) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "base", NULL); xmlNewTextChild(newnode2, NULL, (xmlChar*) "unit", (xmlChar*) au->firstBaseUnit()->referenceName().c_str()); newnode3 = xmlNewTextChild(newnode2, NULL, (xmlChar*) "relation", (xmlChar*) au->expression().c_str()); if(au->isApproximate()) xmlNewProp(newnode3, (xmlChar*) "approximate", (xmlChar*) "true"); if(au->precision() >= 0) xmlNewProp(newnode3, (xmlChar*) "precision", (xmlChar*) i2s(u->precision()).c_str()); if(!au->uncertainty().empty()) xmlNewProp(newnode3, (xmlChar*) "uncertainty", (xmlChar*) au->uncertainty().c_str()); if(!au->inverseExpression().empty()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "inverse_relation", (xmlChar*) au->inverseExpression().c_str()); } xmlNewTextChild(newnode2, NULL, (xmlChar*) "exponent", (xmlChar*) i2s(au->firstBaseExponent()).c_str()); if(au->mixWithBase() > 0) { newnode3 = xmlNewTextChild(newnode2, NULL, (xmlChar*) "mix", (xmlChar*) i2s(au->mixWithBase()).c_str()); if(au->mixWithBaseMinimum() > 1) xmlNewProp(newnode3, (xmlChar*) "min", (xmlChar*) i2s(au->mixWithBaseMinimum()).c_str()); } } } } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } int Calculator::saveFunctions(const char* file_name, bool save_global) { xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); const ExpressionName *ename; node_tree_item top; top.category = ""; top.node = doc->children; node_tree_item *item; string cat, cat_sub; Argument *arg; IntegerArgument *iarg; NumberArgument *farg; string str; for(size_t i = 0; i < functions.size(); i++) { if(functions[i]->subtype() != SUBTYPE_DATA_SET && (save_global || functions[i]->isLocal() || functions[i]->hasChanged())) { item = ⊤ if(!functions[i]->category().empty()) { cat = functions[i]->category(); size_t cat_i = cat.find("/"); size_t cat_i_prev = 0; bool b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(size_t i2 = 0; i2 < item->items.size(); i2++) { if(cat_sub == item->items[i2].category) { item = &item->items[i2]; b = true; break; } } if(!b) { item->items.resize(item->items.size() + 1); item->items[item->items.size() - 1].node = xmlNewTextChild(item->node, NULL, (xmlChar*) "category", NULL); item = &item->items[item->items.size() - 1]; item->category = cat_sub; if(save_global) { xmlNewTextChild(item->node, NULL, (xmlChar*) "_title", (xmlChar*) item->category.c_str()); } else { xmlNewTextChild(item->node, NULL, (xmlChar*) "title", (xmlChar*) item->category.c_str()); } } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } cur = item->node; if(!save_global && !functions[i]->isLocal() && functions[i]->hasChanged()) { if(functions[i]->isActive()) { xmlNewTextChild(cur, NULL, (xmlChar*) "activate", (xmlChar*) functions[i]->referenceName().c_str()); } else { xmlNewTextChild(cur, NULL, (xmlChar*) "deactivate", (xmlChar*) functions[i]->referenceName().c_str()); } } else if(save_global || functions[i]->isLocal()) { if(functions[i]->isBuiltin()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_function", NULL); xmlNewProp(newnode, (xmlChar*) "name", (xmlChar*) functions[i]->referenceName().c_str()); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "function", NULL); } if(!functions[i]->isActive()) xmlNewProp(newnode, (xmlChar*) "active", (xmlChar*) "false"); if(functions[i]->isHidden()) xmlNewTextChild(newnode, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); if(!functions[i]->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) functions[i]->title(false).c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) functions[i]->title(false).c_str()); } } SAVE_NAMES(functions[i]) if(!functions[i]->description().empty()) { str = functions[i]->description(); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } if(!functions[i]->example(true).empty()) newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "example", (xmlChar*) functions[i]->example(true).c_str()); if(functions[i]->isBuiltin()) { cur = newnode; for(size_t i2 = 1; i2 <= functions[i]->lastArgumentDefinitionIndex(); i2++) { arg = functions[i]->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "argument", NULL); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) arg->name().c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) arg->name().c_str()); } xmlNewProp(newnode, (xmlChar*) "index", (xmlChar*) i2s(i2).c_str()); } } } else { for(size_t i2 = 1; i2 <= ((UserFunction*) functions[i])->countSubfunctions(); i2++) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "subfunction", (xmlChar*) ((UserFunction*) functions[i])->getSubfunction(i2).c_str()); if(((UserFunction*) functions[i])->subfunctionPrecalculated(i2)) xmlNewProp(newnode2, (xmlChar*) "precalculate", (xmlChar*) "true"); else xmlNewProp(newnode2, (xmlChar*) "precalculate", (xmlChar*) "false"); } newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "expression", (xmlChar*) ((UserFunction*) functions[i])->formula().c_str()); if(functions[i]->isApproximate()) xmlNewProp(newnode2, (xmlChar*) "approximate", (xmlChar*) "true"); if(functions[i]->precision() >= 0) xmlNewProp(newnode2, (xmlChar*) "precision", (xmlChar*) i2s(functions[i]->precision()).c_str()); if(!functions[i]->condition().empty()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "condition", (xmlChar*) functions[i]->condition().c_str()); } cur = newnode; for(size_t i2 = 1; i2 <= functions[i]->lastArgumentDefinitionIndex(); i2++) { arg = functions[i]->getArgumentDefinition(i2); if(arg) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "argument", NULL); if(!arg->name().empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) arg->name().c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) arg->name().c_str()); } } switch(arg->type()) { case ARGUMENT_TYPE_TEXT: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "text"); break;} case ARGUMENT_TYPE_SYMBOLIC: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "symbol"); break;} case ARGUMENT_TYPE_DATE: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "date"); break;} case ARGUMENT_TYPE_INTEGER: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "integer"); break;} case ARGUMENT_TYPE_NUMBER: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "number"); break;} case ARGUMENT_TYPE_VECTOR: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "vector"); break;} case ARGUMENT_TYPE_MATRIX: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "matrix"); break;} case ARGUMENT_TYPE_BOOLEAN: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "boolean"); break;} case ARGUMENT_TYPE_FUNCTION: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "function"); break;} case ARGUMENT_TYPE_UNIT: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "unit"); break;} case ARGUMENT_TYPE_VARIABLE: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "variable"); break;} case ARGUMENT_TYPE_EXPRESSION_ITEM: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "object"); break;} case ARGUMENT_TYPE_ANGLE: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "angle"); break;} case ARGUMENT_TYPE_DATA_OBJECT: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "data-object"); break;} case ARGUMENT_TYPE_DATA_PROPERTY: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "data-property"); break;} default: {xmlNewProp(newnode, (xmlChar*) "type", (xmlChar*) "free");} } xmlNewProp(newnode, (xmlChar*) "index", (xmlChar*) i2s(i2).c_str()); if(!arg->tests()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "test", (xmlChar*) "false"); } if(!arg->alerts()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "alert", (xmlChar*) "false"); } if(arg->zeroForbidden()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "zero_forbidden", (xmlChar*) "true"); } if(arg->matrixAllowed()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "matrix_allowed", (xmlChar*) "true"); } switch(arg->type()) { case ARGUMENT_TYPE_INTEGER: { iarg = (IntegerArgument*) arg; if(iarg->min()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "min", (xmlChar*) iarg->min()->print(save_printoptions).c_str()); } if(iarg->max()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "max", (xmlChar*) iarg->max()->print(save_printoptions).c_str()); } break; } case ARGUMENT_TYPE_NUMBER: { farg = (NumberArgument*) arg; if(farg->min()) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "min", (xmlChar*) farg->min()->print(save_printoptions).c_str()); if(farg->includeEqualsMin()) { xmlNewProp(newnode2, (xmlChar*) "include_equals", (xmlChar*) "true"); } else { xmlNewProp(newnode2, (xmlChar*) "include_equals", (xmlChar*) "false"); } } if(farg->max()) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "max", (xmlChar*) farg->max()->print(save_printoptions).c_str()); if(farg->includeEqualsMax()) { xmlNewProp(newnode2, (xmlChar*) "include_equals", (xmlChar*) "true"); } else { xmlNewProp(newnode2, (xmlChar*) "include_equals", (xmlChar*) "false"); } } if(!farg->complexAllowed()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "complex_allowed", (xmlChar*) "false"); } break; } } if(!arg->getCustomCondition().empty()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "condition", (xmlChar*) arg->getCustomCondition().c_str()); } } } } } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } int Calculator::saveDataSets(const char* file_name, bool save_global) { xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); const ExpressionName *ename; node_tree_item top; top.category = ""; top.node = doc->children; node_tree_item *item; string cat, cat_sub; Argument *arg; DataSet *ds; DataProperty *dp; string str; for(size_t i = 0; i < functions.size(); i++) { if(functions[i]->subtype() == SUBTYPE_DATA_SET && (save_global || functions[i]->isLocal() || functions[i]->hasChanged())) { item = ⊤ ds = (DataSet*) functions[i]; if(!ds->category().empty()) { cat = ds->category(); size_t cat_i = cat.find("/"); size_t cat_i_prev = 0; bool b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(size_t i2 = 0; i2 < item->items.size(); i2++) { if(cat_sub == item->items[i2].category) { item = &item->items[i2]; b = true; break; } } if(!b) { item->items.resize(item->items.size() + 1); item->items[item->items.size() - 1].node = xmlNewTextChild(item->node, NULL, (xmlChar*) "category", NULL); item = &item->items[item->items.size() - 1]; item->category = cat_sub; if(save_global) { xmlNewTextChild(item->node, NULL, (xmlChar*) "_title", (xmlChar*) item->category.c_str()); } else { xmlNewTextChild(item->node, NULL, (xmlChar*) "title", (xmlChar*) item->category.c_str()); } } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } cur = item->node; if(save_global || ds->isLocal() || ds->hasChanged()) { if(save_global || ds->isLocal()) { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "dataset", NULL); } else { newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "builtin_dataset", NULL); xmlNewProp(newnode, (xmlChar*) "name", (xmlChar*) ds->referenceName().c_str()); } if(!ds->isActive()) xmlNewProp(newnode, (xmlChar*) "active", (xmlChar*) "false"); if(ds->isHidden()) xmlNewTextChild(newnode, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); if(!ds->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_title", (xmlChar*) ds->title(false).c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "title", (xmlChar*) ds->title(false).c_str()); } } if((save_global || ds->isLocal()) && !ds->defaultDataFile().empty()) { xmlNewTextChild(newnode, NULL, (xmlChar*) "datafile", (xmlChar*) ds->defaultDataFile().c_str()); } SAVE_NAMES(ds) if(!ds->description().empty()) { str = ds->description(); if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } if((save_global || ds->isLocal()) && !ds->copyright().empty()) { if(save_global) { xmlNewTextChild(newnode, NULL, (xmlChar*) "_copyright", (xmlChar*) ds->copyright().c_str()); } else { xmlNewTextChild(newnode, NULL, (xmlChar*) "copyright", (xmlChar*) ds->copyright().c_str()); } } arg = ds->getArgumentDefinition(1); if(arg && ((!save_global && !ds->isLocal()) || arg->name() != _("Object"))) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "object_argument", NULL); if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_title", (xmlChar*) arg->name().c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "title", (xmlChar*) arg->name().c_str()); } } arg = ds->getArgumentDefinition(2); if(arg && ((!save_global && !ds->isLocal()) || arg->name() != _("Property"))) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "property_argument", NULL); if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_title", (xmlChar*) arg->name().c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "title", (xmlChar*) arg->name().c_str()); } } if((!save_global && !ds->isLocal()) || ds->getDefaultValue(2) != _("info")) { xmlNewTextChild(newnode, NULL, (xmlChar*) "default_property", (xmlChar*) ds->getDefaultValue(2).c_str()); } DataPropertyIter it; dp = ds->getFirstProperty(&it); while(dp) { if(save_global || ds->isLocal() || dp->isUserModified()) { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) "property", NULL); if(!dp->title(false).empty()) { if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_title", (xmlChar*) dp->title().c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "title", (xmlChar*) dp->title().c_str()); } } switch(dp->propertyType()) { case PROPERTY_STRING: { xmlNewTextChild(newnode2, NULL, (xmlChar*) "type", (xmlChar*) "text"); break; } case PROPERTY_NUMBER: { xmlNewTextChild(newnode2, NULL, (xmlChar*) "type", (xmlChar*) "number"); break; } case PROPERTY_EXPRESSION: { xmlNewTextChild(newnode2, NULL, (xmlChar*) "type", (xmlChar*) "expression"); break; } } if(dp->isHidden()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "hidden", (xmlChar*) "true"); } if(dp->isKey()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "key", (xmlChar*) "true"); } if(dp->isApproximate()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "approximate", (xmlChar*) "true"); } if(dp->usesBrackets()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "brackets", (xmlChar*) "true"); } if(dp->isCaseSensitive()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "case_sensitive", (xmlChar*) "true"); } if(!dp->getUnitString().empty()) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "unit", (xmlChar*) dp->getUnitString().c_str()); } str = ""; for(size_t i2 = 1;;) { if(dp->nameIsReference(i2)) {str += 'r';} if(str.empty() || str[str.length() - 1] == ',') { if(i2 == 1 && dp->countNames() == 1) { if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_names", (xmlChar*) dp->getName(i2).c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "names", (xmlChar*) dp->getName(i2).c_str()); } break; } } else { str += ':'; } str += dp->getName(i2); i2++; if(i2 > dp->countNames()) { if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_names", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "names", (xmlChar*) str.c_str()); } break; } str += ','; } if(!dp->description().empty()) { str = dp->description(); if(save_global) { xmlNewTextChild(newnode2, NULL, (xmlChar*) "_description", (xmlChar*) str.c_str()); } else { xmlNewTextChild(newnode2, NULL, (xmlChar*) "description", (xmlChar*) str.c_str()); } } } dp = ds->getNextProperty(&it); } } } } int returnvalue = xmlSaveFormatFile(file_name, doc, 1); xmlFreeDoc(doc); return returnvalue; } bool Calculator::importCSV(MathStructure &mstruct, const char *file_name, int first_row, string delimiter, vector *headers) { FILE *file = fopen(file_name, "r"); if(file == NULL) { return false; } if(first_row < 1) { first_row = 1; } char line[10000]; string stmp, str1, str2; long int row = 0, rows = 1; int columns = 1; int column; mstruct = m_empty_matrix; size_t is, is_n; bool v_added = false; while(fgets(line, 10000, file)) { row++; if(row >= first_row) { stmp = line; remove_blank_ends(stmp); if(row == first_row) { if(stmp.empty()) { row--; } else { is = 0; while((is_n = stmp.find(delimiter, is)) != string::npos) { columns++; if(headers) { str1 = stmp.substr(is, is_n - is); remove_blank_ends(str1); headers->push_back(str1); } is = is_n + delimiter.length(); } if(headers) { str1 = stmp.substr(is, stmp.length() - is); remove_blank_ends(str1); headers->push_back(str1); } mstruct.resizeMatrix(1, columns, m_undefined); } } if((!headers || row > first_row) && !stmp.empty()) { is = 0; column = 1; if(v_added) { mstruct.addRow(m_undefined); rows++; } while(column <= columns) { is_n = stmp.find(delimiter, is); if(is_n == string::npos) { str1 = stmp.substr(is, stmp.length() - is); } else { str1 = stmp.substr(is, is_n - is); is = is_n + delimiter.length(); } CALCULATOR->parse(&mstruct[rows - 1][column - 1], str1); column++; if(is_n == string::npos) { break; } } v_added = true; } } } return true; } bool Calculator::importCSV(const char *file_name, int first_row, bool headers, string delimiter, bool to_matrix, string name, string title, string category) { FILE *file = fopen(file_name, "r"); if(file == NULL) { return false; } if(first_row < 1) { first_row = 1; } string filestr = file_name; remove_blank_ends(filestr); size_t i = filestr.find_last_of("/"); if(i != string::npos) { filestr = filestr.substr(i + 1, filestr.length() - (i + 1)); } remove_blank_ends(name); if(name.empty()) { name = filestr; i = name.find_last_of("/"); if(i != string::npos) name = name.substr(i + 1, name.length() - i); i = name.find_last_of("."); if(i != string::npos) name = name.substr(0, i); } char line[10000]; string stmp, str1, str2; int row = 0; int columns = 1, rows = 1; int column; vector header; vector vectors; MathStructure mstruct = m_empty_matrix; size_t is, is_n; bool v_added = false; while(fgets(line, 10000, file)) { row++; if(row >= first_row) { stmp = line; remove_blank_ends(stmp); if(row == first_row) { if(stmp.empty()) { row--; } else { is = 0; while((is_n = stmp.find(delimiter, is)) != string::npos) { columns++; if(headers) { str1 = stmp.substr(is, is_n - is); remove_blank_ends(str1); header.push_back(str1); } if(!to_matrix) { vectors.push_back(m_empty_vector); } is = is_n + delimiter.length(); } if(headers) { str1 = stmp.substr(is, stmp.length() - is); remove_blank_ends(str1); header.push_back(str1); } if(to_matrix) { mstruct.resizeMatrix(1, columns, m_undefined); } else { vectors.push_back(m_empty_vector); } } } if((!headers || row > first_row) && !stmp.empty()) { if(to_matrix && v_added) { mstruct.addRow(m_undefined); rows++; } is = 0; column = 1; while(column <= columns) { is_n = stmp.find(delimiter, is); if(is_n == string::npos) { str1 = stmp.substr(is, stmp.length() - is); } else { str1 = stmp.substr(is, is_n - is); is = is_n + delimiter.length(); } if(to_matrix) { CALCULATOR->parse(&mstruct[rows - 1][column - 1], str1); } else { vectors[column - 1].addChild(CALCULATOR->parse(str1)); } column++; if(is_n == string::npos) { break; } } for(; column <= columns; column++) { if(!to_matrix) { vectors[column - 1].addChild(m_undefined); } } v_added = true; } } } if(to_matrix) { addVariable(new KnownVariable(category, name, mstruct, title)); } else { if(vectors.size() > 1) { if(!category.empty()) { category += "/"; } category += name; } for(size_t i = 0; i < vectors.size(); i++) { str1 = ""; str2 = ""; if(vectors.size() > 1) { str1 += name; str1 += "_"; if(title.empty()) { str2 += name; str2 += " "; } else { str2 += title; str2 += " "; } if(i < header.size()) { str1 += header[i]; str2 += header[i]; } else { str1 += _("column"); str1 += "_"; str1 += i2s(i + 1); str2 += _("Column "); str2 += i2s(i + 1); } gsub(" ", "_", str1); } else { str1 = name; str2 = title; if(i < header.size()) { str2 += " ("; str2 += header[i]; str2 += ")"; } } addVariable(new KnownVariable(category, str1, vectors[i], str2)); } } return true; } bool Calculator::exportCSV(const MathStructure &mstruct, const char *file_name, string delimiter) { FILE *file = fopen(file_name, "w+"); if(file == NULL) { return false; } MathStructure mcsv(mstruct); PrintOptions po; po.number_fraction_format = FRACTION_DECIMAL; po.decimalpoint_sign = "."; po.comma_sign = ","; if(mcsv.isMatrix()) { for(size_t i = 0; i < mcsv.size(); i++) { for(size_t i2 = 0; i2 < mcsv[i].size(); i2++) { if(i2 > 0) fputs(delimiter.c_str(), file); mcsv[i][i2].format(po); fputs(mcsv[i][i2].print(po).c_str(), file); } fputs("\n", file); } } else if(mcsv.isVector()) { for(size_t i = 0; i < mcsv.size(); i++) { mcsv[i].format(po); fputs(mcsv[i].print(po).c_str(), file); fputs("\n", file); } } else { mcsv.format(po); fputs(mcsv.print(po).c_str(), file); fputs("\n", file); } fclose(file); return true; } int Calculator::testCondition(string expression) { MathStructure mstruct = calculate(expression); if(mstruct.isNumber()) { if(mstruct.number().isPositive()) { return 1; } else { return 0; } } return -1; } void Calculator::startPrintControl(int milli_timeout) { startControl(milli_timeout); } void Calculator::abortPrint() { abort(); } bool Calculator::printingAborted() { return aborted(); } string Calculator::printingAbortedMessage() const { return abortedMessage(); } string Calculator::timedOutString() const { return _("timed out"); } bool Calculator::printingControlled() const { return isControlled(); } void Calculator::stopPrintControl() { stopControl(); } void Calculator::startControl(int milli_timeout) { b_controlled = true; i_aborted = 0; i_timeout = milli_timeout; if(i_timeout > 0) { #ifndef CLOCK_MONOTONIC gettimeofday(&t_end, NULL); #else struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); t_end.tv_sec = ts.tv_sec; t_end.tv_usec = ts.tv_nsec / 1000; #endif long int usecs = t_end.tv_usec + (long int) milli_timeout * 1000; t_end.tv_usec = usecs % 1000000; t_end.tv_sec += usecs / 1000000; } } bool Calculator::aborted() { if(!b_controlled) return false; if(i_aborted > 0) return true; if(i_timeout > 0) { #ifndef CLOCK_MONOTONIC struct timeval tv; gettimeofday(&tv, NULL); if(tv.tv_sec > t_end.tv_sec || (tv.tv_sec == t_end.tv_sec && tv.tv_usec > t_end.tv_usec)) { #else struct timespec tv; clock_gettime(CLOCK_MONOTONIC, &tv); if(tv.tv_sec > t_end.tv_sec || (tv.tv_sec == t_end.tv_sec && tv.tv_nsec / 1000 > t_end.tv_usec)) { #endif i_aborted = 2; return true; } } return false; } string Calculator::abortedMessage() const { if(i_aborted == 2) return _("timed out"); return _("aborted"); } bool Calculator::isControlled() const { return b_controlled; } void Calculator::stopControl() { b_controlled = false; i_aborted = 0; i_timeout = 0; } bool Calculator::loadExchangeRates() { xmlDocPtr doc = NULL; xmlNodePtr cur = NULL; xmlChar *value; bool global_file = false; string currency, rate, sdate; string filename = buildPath(getLocalDataDir(), "eurofxref-daily.xml"); if(fileExists(filename)) { doc = xmlParseFile(filename.c_str()); } else { #ifndef _WIN32 string filename_old = buildPath(getOldLocalDir(), "eurofxref-daily.xml"); if(fileExists(filename)) { doc = xmlParseFile(filename_old.c_str()); if(doc) { recursiveMakeDir(getLocalDataDir()); move_file(filename_old.c_str(), filename.c_str()); removeDir(getOldLocalDir()); } } #endif } if(doc) cur = xmlDocGetRootElement(doc); if(!cur) { if(doc) xmlFreeDoc(doc); filename = buildPath(getGlobalDefinitionsDir(), "eurofxref-daily.xml"); doc = xmlParseFile(filename.c_str()); if(!doc) return false; cur = xmlDocGetRootElement(doc); if(!cur) return false; global_file = true; } Unit *u; while(cur) { if(!xmlStrcmp(cur->name, (const xmlChar*) "Cube")) { if(global_file && sdate.empty()) { XML_GET_STRING_FROM_PROP(cur, "time", sdate); QalculateDateTime qdate; if(qdate.set(sdate)) { exchange_rates_time[0] = (time_t) qdate.timestamp().ulintValue(); if(exchange_rates_time[0] > exchange_rates_check_time[0]) exchange_rates_check_time[0] = exchange_rates_time[0]; } else { sdate.clear(); } } XML_GET_STRING_FROM_PROP(cur, "currency", currency); if(!currency.empty()) { XML_GET_STRING_FROM_PROP(cur, "rate", rate); if(!rate.empty()) { rate = "1/" + rate; u = getUnit(currency); if(!u) { u = addUnit(new AliasUnit(_("Currency"), currency, "", "", "", u_euro, rate, 1, "", false, true)); } else if(u->subtype() == SUBTYPE_ALIAS_UNIT) { ((AliasUnit*) u)->setExpression(rate); } if(u) { u->setApproximate(); u->setPrecision(-2); u->setChanged(false); } } } } if(cur->children) { cur = cur->children; } else if(cur->next) { cur = cur->next; } else { cur = cur->parent; if(cur) { cur = cur->next; } } } xmlFreeDoc(doc); if(sdate.empty()) { struct stat stats; if(stat(filename.c_str(), &stats) == 0) { if(exchange_rates_time[0] >= stats.st_mtime) { #ifdef _WIN32 struct _utimbuf new_times; #else struct utimbuf new_times; #endif struct tm *temptm = localtime(&exchange_rates_time[0]); if(temptm) { struct tm extm = *temptm; time_t time_now = time(NULL); struct tm *newtm = localtime(&time_now); if(newtm && newtm->tm_mday != extm.tm_mday) { newtm->tm_hour = extm.tm_hour; newtm->tm_min = extm.tm_min; newtm->tm_sec = extm.tm_sec; exchange_rates_time[0] = mktime(newtm); } else { time(&exchange_rates_time[0]); } } else { time(&exchange_rates_time[0]); } new_times.modtime = exchange_rates_time[0]; new_times.actime = exchange_rates_time[0]; #ifdef _WIN32 _utime(filename.c_str(), &new_times); #else utime(filename.c_str(), &new_times); #endif } else { exchange_rates_time[0] = stats.st_mtime; if(exchange_rates_time[0] > exchange_rates_check_time[0]) exchange_rates_check_time[0] = exchange_rates_time[0]; } } } filename = buildPath(getLocalDataDir(), "btc.json"); ifstream file2(filename.c_str()); if(file2.is_open()) { std::stringstream ssbuffer2; ssbuffer2 << file2.rdbuf(); string sbuffer = ssbuffer2.str(); size_t i = sbuffer.find("\"amount\":"); if(i != string::npos) { i = sbuffer.find("\"", i + 9); if(i != string::npos) { size_t i2 = sbuffer.find("\"", i + 1); ((AliasUnit*) u_btc)->setExpression(sbuffer.substr(i + 1, i2 - (i + 1))); } } file2.close(); struct stat stats; if(stat(filename.c_str(), &stats) == 0) { exchange_rates_time[1] = stats.st_mtime; if(exchange_rates_time[1] > exchange_rates_check_time[1]) exchange_rates_check_time[1] = exchange_rates_time[1]; } } else { exchange_rates_time[1] = ((time_t) 1531087L) * 1000; if(exchange_rates_time[1] > exchange_rates_check_time[1]) exchange_rates_check_time[1] = exchange_rates_time[1]; } Unit *u_usd = getUnit("USD"); if(!u_usd) return true; string sbuffer; filename = buildPath(getLocalDataDir(), "rates.html"); ifstream file(filename.c_str()); if(file.is_open()) { std::stringstream ssbuffer; ssbuffer << file.rdbuf(); sbuffer = ssbuffer.str(); } if(sbuffer.empty()) { if(file.is_open()) file.close(); file.clear(); filename = buildPath(getGlobalDefinitionsDir(), "rates.json"); file.open(filename.c_str()); if(!file.is_open()) return true; std::stringstream ssbuffer; ssbuffer << file.rdbuf(); sbuffer = ssbuffer.str(); string sname; size_t i = sbuffer.find("\"currency_code\":"); while(i != string::npos) { i += 16; size_t i2 = sbuffer.find("\"", i); if(i2 == string::npos) break; size_t i3 = sbuffer.find("\"", i2 + 1); if(i3 != string::npos && i3 - (i2 + 1) == 3) { currency = sbuffer.substr(i2 + 1, i3 - (i2 + 1)); if(currency.length() == 3 && currency[0] >= 'A' && currency[0] <= 'Z') { u = getUnit(currency); if(!u || (u->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) u)->firstBaseUnit() == u_usd)) { i2 = sbuffer.find("\"rate\":", i3 + 1); size_t i4 = sbuffer.find("}", i3 + 1); if(i2 != string::npos && i2 < i4) { i3 = sbuffer.find(",", i2 + 7); rate = sbuffer.substr(i2 + 7, i3 - (i2 + 7)); rate = "1/" + rate; if(!u) { i2 = sbuffer.find("\"name\":\"", i3 + 1); if(i2 != string::npos && i2 < i4) { i3 = sbuffer.find("\"", i2 + 8); if(i3 != string::npos) { sname = sbuffer.substr(i2 + 8, i3 - (i2 + 8)); remove_blank_ends(sname); } } else { sname = ""; } u = addUnit(new AliasUnit(_("Currency"), currency, "", "", sname, u_usd, rate, 1, "", false, true), false, true); if(u) u->setHidden(true); } else { ((AliasUnit*) u)->setBaseUnit(u_usd); ((AliasUnit*) u)->setExpression(rate); } if(u) { u->setApproximate(); u->setPrecision(-2); u->setChanged(false); } } } } } i = sbuffer.find("\"currency_code\":", i); } file.close(); exchange_rates_time[2] = ((time_t) 1527199L) * 1000; if(exchange_rates_time[2] > exchange_rates_check_time[2]) exchange_rates_check_time[2] = exchange_rates_time[2]; } else { string sname; size_t i = sbuffer.find("class=\'country\'"); while(i != string::npos) { currency = ""; sname = ""; rate = ""; i += 15; size_t i2 = sbuffer.find("data-currency-code=\"", i); if(i2 != string::npos) { i2 += 19; size_t i3 = sbuffer.find("\"", i2 + 1); if(i3 != string::npos) { currency = sbuffer.substr(i2 + 1, i3 - (i2 + 1)); remove_blank_ends(currency); } } i2 = sbuffer.find("data-currency-name=\'", i); if(i2 != string::npos) { i2 += 19; size_t i3 = sbuffer.find("|", i2 + 1); if(i3 != string::npos) { sname = sbuffer.substr(i2 + 1, i3 - (i2 + 1)); remove_blank_ends(sname); } } i2 = sbuffer.find("data-rate=\'", i); if(i2 != string::npos) { i2 += 10; size_t i3 = sbuffer.find("'", i2 + 1); if(i3 != string::npos) { rate = sbuffer.substr(i2 + 1, i3 - (i2 + 1)); remove_blank_ends(rate); } } if(currency.length() == 3 && currency[0] >= 'A' && currency[0] <= 'Z' && !rate.empty()) { u = getUnit(currency); if(!u || (u->subtype() == SUBTYPE_ALIAS_UNIT && ((AliasUnit*) u)->firstBaseUnit() == u_usd)) { rate = "1/" + rate; if(!u) { u = addUnit(new AliasUnit(_("Currency"), currency, "", "", sname, u_usd, rate, 1, "", false, true), false, true); if(u) u->setHidden(true); } else { ((AliasUnit*) u)->setBaseUnit(u_usd); ((AliasUnit*) u)->setExpression(rate); } if(u) { u->setApproximate(); u->setPrecision(-2); u->setChanged(false); } } } i = sbuffer.find("class=\'country\'", i); } file.close(); struct stat stats; if(stat(filename.c_str(), &stats) == 0) { exchange_rates_time[2] = stats.st_mtime; if(exchange_rates_time[2] > exchange_rates_check_time[2]) exchange_rates_check_time[2] = exchange_rates_time[2]; } } return true; } bool Calculator::hasGVFS() { return false; } bool Calculator::hasGnomeVFS() { return hasGVFS(); } bool Calculator::canFetch() { #ifdef HAVE_LIBCURL return true; #else return false; #endif } string Calculator::getExchangeRatesFileName(int index) { switch(index) { case 1: {return buildPath(getLocalDataDir(), "eurofxref-daily.xml");} case 2: {return buildPath(getLocalDataDir(), "btc.json");} //case 3: {return buildPath(getLocalDataDir(), "rates.json");} case 3: {return buildPath(getLocalDataDir(), "rates.html");} default: {} } return ""; } time_t Calculator::getExchangeRatesTime(int index) { if(index > 3) return 0; if(index < 1) { if(exchange_rates_time[1] < exchange_rates_time[0]) { if(exchange_rates_time[2] < exchange_rates_time[1]) return exchange_rates_time[2]; return exchange_rates_time[1]; } if(exchange_rates_time[2] < exchange_rates_time[0]) return exchange_rates_time[2]; return exchange_rates_time[0]; } index--; return exchange_rates_time[index]; } string Calculator::getExchangeRatesUrl(int index) { switch(index) { case 1: {return "https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml";} case 2: {return "https://api.coinbase.com/v2/prices/spot?currency=EUR";} //case 2: {return "http://www.mycurrency.net/service/rates";} case 3: {return "https://www.mycurrency.net/=US";} default: {} } return ""; } bool Calculator::fetchExchangeRates(int timeout, string) {return fetchExchangeRates(timeout);} size_t write_data(void *ptr, size_t size, size_t nmemb, string *sbuffer) { sbuffer->append((char*) ptr, size * nmemb); return size * nmemb; } #define FETCH_FAIL_CLEANUP curl_easy_cleanup(curl); curl_global_cleanup(); time(&exchange_rates_check_time[0]); time(&exchange_rates_check_time[1]); time(&exchange_rates_check_time[2]); bool Calculator::fetchExchangeRates(int timeout, int n) { #ifdef HAVE_LIBCURL if(n <= 0) n = 3; recursiveMakeDir(getLocalDataDir()); string sbuffer; char error_buffer[CURL_ERROR_SIZE]; CURL *curl; CURLcode res; long int file_time = 0; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(!curl) {return false;} curl_easy_setopt(curl, CURLOPT_URL, getExchangeRatesUrl(1).c_str()); curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error_buffer); error_buffer[0] = 0; curl_easy_setopt(curl, CURLOPT_FILETIME, &file_time); #ifdef _WIN32 char exepath[MAX_PATH]; GetModuleFileName(NULL, exepath, MAX_PATH); string datadir(exepath); datadir.resize(datadir.find_last_of('\\')); if(datadir.substr(datadir.length() - 4) != "\\bin" && datadir.substr(datadir.length() - 6) != "\\.libs") { string cainfo = buildPath(datadir, "ssl", "certs", "ca-bundle.crt"); gsub("\\", "/", cainfo); curl_easy_setopt(curl, CURLOPT_CAINFO, cainfo.c_str()); } #endif res = curl_easy_perform(curl); if(res != CURLE_OK) { if(strlen(error_buffer)) error(true, _("Failed to download exchange rates from %s: %s."), "ECB", error_buffer, NULL); else error(true, _("Failed to download exchange rates from %s: %s."), "ECB", curl_easy_strerror(res), NULL); FETCH_FAIL_CLEANUP; return false; } if(sbuffer.empty()) {error(true, _("Failed to download exchange rates from %s: %s."), "ECB", "Document empty", NULL); FETCH_FAIL_CLEANUP; return false;} ofstream file(getExchangeRatesFileName(1).c_str(), ios::out | ios::trunc | ios::binary); if(!file.is_open()) { error(true, _("Failed to download exchange rates from %s: %s."), "ECB", strerror(errno), NULL); FETCH_FAIL_CLEANUP return false; } file << sbuffer; file.close(); if(file_time > 0) { #ifdef _WIN32 struct _utimbuf new_times; #else struct utimbuf new_times; #endif new_times.modtime = (time_t) file_time; new_times.actime = (time_t) file_time; #ifdef _WIN32 _utime(getExchangeRatesFileName(1).c_str(), &new_times); #else utime(getExchangeRatesFileName(1).c_str(), &new_times); #endif } if(n >= 2) { sbuffer = ""; curl_easy_setopt(curl, CURLOPT_URL, getExchangeRatesUrl(2).c_str()); curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error_buffer); res = curl_easy_perform(curl); if(res != CURLE_OK) {error(true, _("Failed to download exchange rates from %s: %s."), "coinbase.com", error_buffer, NULL); FETCH_FAIL_CLEANUP; return false;} if(sbuffer.empty()) {error(true, _("Failed to download exchange rates from %s: %s."), "coinbase.com", "Document empty", NULL); FETCH_FAIL_CLEANUP; return false;} ofstream file3(getExchangeRatesFileName(2).c_str(), ios::out | ios::trunc | ios::binary); if(!file3.is_open()) { error(true, _("Failed to download exchange rates from %s: %s."), "coinbase.com", strerror(errno), NULL); FETCH_FAIL_CLEANUP return false; } file3 << sbuffer; file3.close(); } if(n >= 3) { sbuffer = ""; curl_easy_setopt(curl, CURLOPT_URL, getExchangeRatesUrl(3).c_str()); curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error_buffer); res = curl_easy_perform(curl); if(res != CURLE_OK) {error(true, _("Failed to download exchange rates from %s: %s."), "mycurrency.net", error_buffer, NULL); FETCH_FAIL_CLEANUP; return false;} if(sbuffer.empty() || sbuffer.find("Internal Server Error") != string::npos) {error(true, _("Failed to download exchange rates from %s: %s."), "mycurrency.net", "Document empty", NULL); FETCH_FAIL_CLEANUP; return false;} ofstream file2(getExchangeRatesFileName(3).c_str(), ios::out | ios::trunc | ios::binary); if(!file2.is_open()) { error(true, _("Failed to download exchange rates from %s: %s."), "mycurrency.net", strerror(errno), NULL); FETCH_FAIL_CLEANUP return false; } file2 << sbuffer; file2.close(); } curl_easy_cleanup(curl); curl_global_cleanup(); return true; #else return false; #endif } bool Calculator::checkExchangeRatesDate(unsigned int n_days, bool force_check, bool send_warning, int n) { if(n <= 0) n = 3; time_t extime = exchange_rates_time[0]; if(n > 1 && exchange_rates_time[1] < extime) extime = exchange_rates_time[1]; if(n > 2 && exchange_rates_time[2] < extime) extime = exchange_rates_time[2]; time_t cextime = exchange_rates_check_time[0]; if(n > 1 && exchange_rates_check_time[1] < cextime) cextime = exchange_rates_check_time[1]; if(n > 2 && exchange_rates_check_time[2] < cextime) cextime = exchange_rates_check_time[2]; if(extime > 0 && ((!force_check && cextime > 0 && difftime(time(NULL), cextime) < 86400 * n_days) || difftime(time(NULL), extime) < (86400 * n_days) + 3600)) return true; time(&exchange_rates_check_time[0]); if(n > 1) time(&exchange_rates_check_time[1]); if(n > 2) time(&exchange_rates_check_time[2]); if(send_warning) error(false, _("It has been %s day(s) since the exchange rates last were updated."), i2s((int) floor(difftime(time(NULL), extime) / 86400)).c_str(), NULL); return false; } void Calculator::setExchangeRatesWarningEnabled(bool enable) { b_exchange_rates_warning_enabled = enable; } bool Calculator::exchangeRatesWarningEnabled() const { return b_exchange_rates_warning_enabled; } int Calculator::exchangeRatesUsed() const { return b_exchange_rates_used; } void Calculator::resetExchangeRatesUsed() { b_exchange_rates_used = 0; } void Calculator::setExchangeRatesUsed(int index) { if(index > b_exchange_rates_used) b_exchange_rates_used = index; if(b_exchange_rates_warning_enabled) checkExchangeRatesDate(7, false, true); } bool Calculator::canPlot() { #ifdef _WIN32 LPSTR lpFilePart; char filename[MAX_PATH]; return SearchPath(NULL, "gnuplot", ".exe", MAX_PATH, filename, &lpFilePart); #else FILE *pipe = popen("gnuplot - 2>/dev/null", "w"); if(!pipe) return false; return pclose(pipe) == 0; #endif } MathStructure Calculator::expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector, string x_var, const ParseOptions &po, int msecs) { Variable *v = getActiveVariable(x_var); MathStructure x_mstruct; if(v) x_mstruct = v; else x_mstruct = x_var; EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; eo.parse_options = po2; if(msecs > 0) startControl(msecs); MathStructure mparse(parse(expression, po2)); CALCULATOR->beginTemporaryStopMessages(); MathStructure y_vector(mparse.generateVector(x_mstruct, min, max, steps, x_vector, eo)); CALCULATOR->endTemporaryStopMessages(); if(msecs > 0) { if(aborted()) error(true, _("It took too long to generate the plot data."), NULL); stopControl(); } if(y_vector.size() == 0) { CALCULATOR->error(true, _("Unable to generate plot data with current min, max and sampling rate."), NULL); } return y_vector; } MathStructure Calculator::expressionToPlotVector(string expression, float min, float max, int steps, MathStructure *x_vector, string x_var, const ParseOptions &po, int msecs) { MathStructure min_mstruct(min), max_mstruct(max); ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; MathStructure y_vector(expressionToPlotVector(expression, min_mstruct, max_mstruct, steps, x_vector, x_var, po2, msecs)); return y_vector; } MathStructure Calculator::expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector, string x_var, const ParseOptions &po, int msecs) { Variable *v = getActiveVariable(x_var); MathStructure x_mstruct; if(v) x_mstruct = v; else x_mstruct = x_var; EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; eo.parse_options = po2; if(msecs > 0) startControl(msecs); MathStructure mparse(parse(expression, po2)); CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->beginTemporaryStopIntervalArithmetic(); MathStructure y_vector(mparse.generateVector(x_mstruct, min, max, step, x_vector, eo)); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->endTemporaryStopMessages(); if(msecs > 0) { if(aborted()) error(true, _("It took too long to generate the plot data."), NULL); stopControl(); } if(y_vector.size() == 0) { CALCULATOR->error(true, _("Unable to generate plot data with current min, max and step size."), NULL); } return y_vector; } MathStructure Calculator::expressionToPlotVector(string expression, float min, float max, float step, MathStructure *x_vector, string x_var, const ParseOptions &po, int msecs) { MathStructure min_mstruct(min), max_mstruct(max), step_mstruct(step); ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; MathStructure y_vector(expressionToPlotVector(expression, min_mstruct, max_mstruct, step_mstruct, x_vector, x_var, po2, msecs)); return y_vector; } MathStructure Calculator::expressionToPlotVector(string expression, const MathStructure &x_vector, string x_var, const ParseOptions &po, int msecs) { Variable *v = getActiveVariable(x_var); MathStructure x_mstruct; if(v) x_mstruct = v; else x_mstruct = x_var; EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; ParseOptions po2 = po; po2.read_precision = DONT_READ_PRECISION; eo.parse_options = po2; if(msecs > 0) startControl(msecs); MathStructure mparse(parse(expression, po2)); CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->beginTemporaryStopIntervalArithmetic(); MathStructure y_vector(mparse.generateVector(x_mstruct, x_vector, eo).eval(eo)); CALCULATOR->endTemporaryStopIntervalArithmetic(); CALCULATOR->endTemporaryStopMessages(); if(msecs > 0) { if(aborted()) error(true, _("It took too long to generate the plot data."), NULL); stopControl(); } return y_vector; } extern bool testComplexZero(const Number *this_nr, const Number *i_nr); bool Calculator::plotVectors(PlotParameters *param, const vector &y_vectors, const vector &x_vectors, vector &pdps, bool persistent, int msecs) { string homedir = getLocalTmpDir(); recursiveMakeDir(homedir); string commandline_extra; string title; if(!param) { PlotParameters pp; param = &pp; } string plot; if(param->filename.empty()) { if(!param->color) { commandline_extra += " -mono"; } plot += "set terminal pop\n"; } else { persistent = true; if(param->filetype == PLOT_FILETYPE_AUTO) { size_t i = param->filename.rfind("."); if(i == string::npos) { param->filetype = PLOT_FILETYPE_PNG; error(false, _("No extension in file name. Saving as PNG image."), NULL); } else { string ext = param->filename.substr(i + 1, param->filename.length() - (i + 1)); if(ext == "png") { param->filetype = PLOT_FILETYPE_PNG; } else if(ext == "ps") { param->filetype = PLOT_FILETYPE_PS; } else if(ext == "pdf") { param->filetype = PLOT_FILETYPE_PDF; } else if(ext == "eps") { param->filetype = PLOT_FILETYPE_EPS; } else if(ext == "svg") { param->filetype = PLOT_FILETYPE_SVG; } else if(ext == "fig") { param->filetype = PLOT_FILETYPE_FIG; } else if(ext == "tex") { param->filetype = PLOT_FILETYPE_LATEX; } else { param->filetype = PLOT_FILETYPE_PNG; error(false, _("Unknown extension in file name. Saving as PNG image."), NULL); } } } plot += "set terminal "; switch(param->filetype) { case PLOT_FILETYPE_FIG: { plot += "fig "; if(param->color) { plot += "color"; } else { plot += "monochrome"; } break; } case PLOT_FILETYPE_SVG: { plot += "svg"; break; } case PLOT_FILETYPE_LATEX: { plot += "latex "; break; } case PLOT_FILETYPE_PS: { plot += "postscript "; if(param->color) { plot += "color"; } else { plot += "monochrome"; } plot += " \"Times\""; break; } case PLOT_FILETYPE_PDF: { plot += "pdf "; if(param->color) { plot += "color"; } else { plot += "monochrome"; } break; } case PLOT_FILETYPE_EPS: { plot += "postscript eps "; if(param->color) { plot += "color"; } else { plot += "monochrome"; } plot += " \"Times\""; break; } default: { plot += "png "; break; } } plot += "\nset output \""; plot += param->filename; plot += "\"\n"; } switch(param->legend_placement) { case PLOT_LEGEND_NONE: {plot += "set nokey\n"; break;} case PLOT_LEGEND_TOP_LEFT: {plot += "set key top left\n"; break;} case PLOT_LEGEND_TOP_RIGHT: {plot += "set key top right\n"; break;} case PLOT_LEGEND_BOTTOM_LEFT: {plot += "set key bottom left\n"; break;} case PLOT_LEGEND_BOTTOM_RIGHT: {plot += "set key bottom right\n"; break;} case PLOT_LEGEND_BELOW: {plot += "set key below\n"; break;} case PLOT_LEGEND_OUTSIDE: {plot += "set key outside\n"; break;} } if(!param->x_label.empty()) { title = param->x_label; gsub("\"", "\\\"", title); plot += "set xlabel \""; plot += title; plot += "\"\n"; } if(!param->y_label.empty()) { string title = param->y_label; gsub("\"", "\\\"", title); plot += "set ylabel \""; plot += title; plot += "\"\n"; } if(!param->title.empty()) { title = param->title; gsub("\"", "\\\"", title); plot += "set title \""; plot += title; plot += "\"\n"; } if(param->grid) { plot += "set grid\n"; } if(!param->auto_y_min || !param->auto_y_max) { plot += "set yrange ["; if(!param->auto_y_min) plot += d2s(param->y_min); plot += ":"; if(!param->auto_y_max) plot += d2s(param->y_max); plot += "]"; plot += "\n"; } if(param->x_log) { plot += "set logscale x "; plot += i2s(param->x_log_base); plot += "\n"; } if(param->show_all_borders) { plot += "set border 15\n"; } else { bool xaxis2 = false, yaxis2 = false; for(size_t i = 0; i < pdps.size(); i++) { if(pdps[i] && pdps[i]->xaxis2) { xaxis2 = true; } if(pdps[i] && pdps[i]->yaxis2) { yaxis2 = true; } } if(xaxis2 && yaxis2) { plot += "set border 15\nset x2tics\nset y2tics\n"; } else if(xaxis2) { plot += "set border 7\nset x2tics\n"; } else if(yaxis2) { plot += "set border 11\nset y2tics\n"; } else { plot += "set border 3\n"; } plot += "set xtics nomirror\nset ytics nomirror\n"; } size_t samples = 1000; for(size_t i = 0; i < y_vectors.size(); i++) { if(!y_vectors[i].isUndefined()) { if(y_vectors[i].size() > 3000) { samples = 6000; break; } if(y_vectors[i].size() * 2 > samples) samples = y_vectors[i].size() * 2; } } plot += "set samples "; plot += i2s(samples); plot += "\n"; plot += "plot "; for(size_t i = 0; i < y_vectors.size(); i++) { if(!y_vectors[i].isUndefined()) { if(i != 0) { plot += ","; } string filename = "gnuplot_data"; filename += i2s(i + 1); filename = buildPath(homedir, filename); #ifdef _WIN32 gsub("\\", "\\\\", filename); #endif plot += "\""; plot += filename; plot += "\""; if(i < pdps.size()) { switch(pdps[i]->smoothing) { case PLOT_SMOOTHING_UNIQUE: {plot += " smooth unique"; break;} case PLOT_SMOOTHING_CSPLINES: {plot += " smooth csplines"; break;} case PLOT_SMOOTHING_BEZIER: {plot += " smooth bezier"; break;} case PLOT_SMOOTHING_SBEZIER: {plot += " smooth sbezier"; break;} default: {} } if(pdps[i]->xaxis2 && pdps[i]->yaxis2) { plot += " axis x2y2"; } else if(pdps[i]->xaxis2) { plot += " axis x2y1"; } else if(pdps[i]->yaxis2) { plot += " axis x1y2"; } if(!pdps[i]->title.empty()) { title = pdps[i]->title; gsub("\"", "\\\"", title); plot += " title \""; plot += title; plot += "\""; } switch(pdps[i]->style) { case PLOT_STYLE_LINES: {plot += " with lines"; break;} case PLOT_STYLE_POINTS: {plot += " with points"; break;} case PLOT_STYLE_POINTS_LINES: {plot += " with linespoints"; break;} case PLOT_STYLE_BOXES: {plot += " with boxes"; break;} case PLOT_STYLE_HISTOGRAM: {plot += " with histeps"; break;} case PLOT_STYLE_STEPS: {plot += " with steps"; break;} case PLOT_STYLE_CANDLESTICKS: {plot += " with candlesticks"; break;} case PLOT_STYLE_DOTS: {plot += " with dots"; break;} } if(param->linewidth < 1) { plot += " lw 2"; } else { plot += " lw "; plot += i2s(param->linewidth); } } } } plot += "\n"; string plot_data; PrintOptions po; po.number_fraction_format = FRACTION_DECIMAL; po.interval_display = INTERVAL_DISPLAY_MIDPOINT; po.decimalpoint_sign = "."; po.comma_sign = ","; for(size_t serie = 0; serie < y_vectors.size(); serie++) { if(!y_vectors[serie].isUndefined()) { string filename = "gnuplot_data"; filename += i2s(serie + 1); string filepath = buildPath(homedir, filename); FILE *fdata = fopen(filepath.c_str(), "w+"); if(!fdata) { error(true, _("Could not create temporary file %s"), filepath.c_str(), NULL); return false; } plot_data = ""; int non_numerical = 0, non_real = 0; //string str = ""; if(msecs > 0) startControl(msecs); ComparisonResult ct1 = COMPARISON_RESULT_EQUAL, ct2 = COMPARISON_RESULT_EQUAL; size_t last_index = string::npos, last_index2 = string::npos; bool check_continuous = pdps[serie]->test_continuous && (pdps[serie]->style == PLOT_STYLE_LINES || pdps[serie]->style == PLOT_STYLE_POINTS_LINES); bool prev_failed = false; for(size_t i = 1; i <= y_vectors[serie].countChildren(); i++) { ComparisonResult ct = COMPARISON_RESULT_UNKNOWN; bool invalid_nr = false, b_imagzero_x = false, b_imagzero_y = false; if(!y_vectors[serie].getChild(i)->isNumber()) { invalid_nr = true; non_numerical++; //if(non_numerical == 1) str = y_vectors[serie].getChild(i)->print(po); } else if(!y_vectors[serie].getChild(i)->number().isReal()) { b_imagzero_y = testComplexZero(&y_vectors[serie].getChild(i)->number(), y_vectors[serie].getChild(i)->number().internalImaginary()); if(!b_imagzero_y) { invalid_nr = true; non_real++; //if(non_numerical + non_real == 1) str = y_vectors[serie].getChild(i)->print(po); } } if(serie < x_vectors.size() && !x_vectors[serie].isUndefined() && x_vectors[serie].countChildren() == y_vectors[serie].countChildren()) { if(!x_vectors[serie].getChild(i)->isNumber()) { invalid_nr = true; non_numerical++; //if(non_numerical == 1) str = x_vectors[serie].getChild(i)->print(po); } else if(!x_vectors[serie].getChild(i)->number().isReal()) { b_imagzero_x = testComplexZero(&x_vectors[serie].getChild(i)->number(), x_vectors[serie].getChild(i)->number().internalImaginary()); if(!b_imagzero_x) { invalid_nr = true; non_real++; //if(non_numerical + non_real == 1) str = x_vectors[serie].getChild(i)->print(po); } } if(!invalid_nr) { if(b_imagzero_y) plot_data += x_vectors[serie].getChild(i)->number().realPart().print(po); else plot_data += x_vectors[serie].getChild(i)->print(po); plot_data += " "; } } if(!invalid_nr) { if(check_continuous && !prev_failed) { if(i == 1 || ct2 == COMPARISON_RESULT_UNKNOWN) ct = COMPARISON_RESULT_EQUAL; else ct = y_vectors[serie].getChild(i - 1)->number().compare(y_vectors[serie].getChild(i)->number()); if((ct == COMPARISON_RESULT_GREATER || ct == COMPARISON_RESULT_LESS) && (ct1 == COMPARISON_RESULT_GREATER || ct1 == COMPARISON_RESULT_LESS) && (ct2 == COMPARISON_RESULT_GREATER || ct2 == COMPARISON_RESULT_LESS) && ct1 != ct2 && ct != ct2) { if(last_index2 != string::npos) plot_data.insert(last_index2 + 1, " \n"); } } if(b_imagzero_x) plot_data += y_vectors[serie].getChild(i)->number().realPart().print(po); else plot_data += y_vectors[serie].getChild(i)->print(po); plot_data += "\n"; prev_failed = false; } else if(!prev_failed) { ct = COMPARISON_RESULT_UNKNOWN; plot_data += " \n"; prev_failed = true; } last_index2 = last_index; last_index = plot_data.length() - 1; ct1 = ct2; ct2 = ct; if(aborted()) { fclose(fdata); if(msecs > 0) { error(true, _("It took too long to generate the plot data."), NULL); stopControl(); } return false; } } if(msecs > 0) stopControl(); /*if(non_numerical > 0 || non_real > 0) { string stitle; if(serie < pdps.size() && !pdps[serie]->title.empty()) { stitle = pdps[serie]->title.c_str(); } else { stitle = i2s(serie).c_str(); } if(non_numerical > 0) { error(true, _("Series %s contains non-numerical data (\"%s\" first of %s) which can not be properly plotted."), stitle.c_str(), str.c_str(), i2s(non_numerical).c_str(), NULL); } else { error(true, _("Series %s contains non-real data (\"%s\" first of %s) which can not be properly plotted."), stitle.c_str(), str.c_str(), i2s(non_real).c_str(), NULL); } }*/ fputs(plot_data.c_str(), fdata); fflush(fdata); fclose(fdata); } } return invokeGnuplot(plot, commandline_extra, persistent); } bool Calculator::invokeGnuplot(string commands, string commandline_extra, bool persistent) { FILE *pipe = NULL; if(!b_gnuplot_open || !gnuplot_pipe || persistent || commandline_extra != gnuplot_cmdline) { if(!persistent) { closeGnuplot(); } string commandline = "gnuplot"; if(persistent) { commandline += " -persist"; } commandline += commandline_extra; #ifdef _WIN32 commandline += " - 2>nul"; pipe = _popen(commandline.c_str(), "w"); #else commandline += " - 2>/dev/null"; pipe = popen(commandline.c_str(), "w"); #endif if(!pipe) { error(true, _("Failed to invoke gnuplot. Make sure that you have gnuplot installed in your path."), NULL); return false; } if(!persistent && pipe) { gnuplot_pipe = pipe; b_gnuplot_open = true; gnuplot_cmdline = commandline_extra; } } else { pipe = gnuplot_pipe; } if(!pipe) { return false; } if(!persistent) { fputs("clear\n", pipe); fputs("reset\n", pipe); } fputs(commands.c_str(), pipe); fflush(pipe); if(persistent) { return pclose(pipe) == 0; } return true; } bool Calculator::closeGnuplot() { if(gnuplot_pipe) { #ifdef _WIN32 int rv = _pclose(gnuplot_pipe); #else int rv = pclose(gnuplot_pipe); #endif gnuplot_pipe = NULL; b_gnuplot_open = false; return rv == 0; } gnuplot_pipe = NULL; b_gnuplot_open = false; return true; } bool Calculator::gnuplotOpen() { return b_gnuplot_open && gnuplot_pipe; } libqalculate-2.8.2/libqalculate/DataSet.cc0000644000175000017500000010331613254137147015417 00000000000000/* Qalculate (library) Copyright (C) 2004-2006, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "DataSet.h" #include "util.h" #include "Calculator.h" #include "MathStructure.h" #include "Number.h" #include #include #include #include #include #include #define XML_GET_STRING_FROM_PROP(node, name, str) value = xmlGetProp(node, (xmlChar*) name); if(value) {str = (char*) value; remove_blank_ends(str); xmlFree(value);} else str = ""; #define XML_GET_STRING_FROM_TEXT(node, str) value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if(value) {str = (char*) value; remove_blank_ends(str); xmlFree(value);} else str = ""; DataObject::DataObject(DataSet *parent_set) { parent = parent_set; b_uchanged = false; } void DataObject::eraseProperty(DataProperty *property) { for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { s_properties.erase(s_properties.begin() + i); a_properties.erase(a_properties.begin() + i); if(m_properties[i]) { m_properties[i]->unref(); } m_properties.erase(m_properties.begin() + i); s_nonlocalized_properties.erase(s_nonlocalized_properties.begin() + i); } } } void DataObject::setProperty(DataProperty *property, string s_value, int is_approximate) { if(s_value.empty()) eraseProperty(property); for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { s_properties[i] = s_value; a_properties[i] = is_approximate; if(m_properties[i]) { m_properties[i]->unref(); m_properties[i] = NULL; } return; } } properties.push_back(property); s_properties.push_back(s_value); m_properties.push_back(NULL); a_properties.push_back(is_approximate); s_nonlocalized_properties.push_back(""); } void DataObject::setNonlocalizedKeyProperty(DataProperty *property, string s_value) { for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { s_nonlocalized_properties[i] = s_value; return; } } properties.push_back(property); s_properties.push_back(""); m_properties.push_back(NULL); a_properties.push_back(-1); s_nonlocalized_properties.push_back(s_value); } const string &DataObject::getProperty(DataProperty *property, int *is_approximate) { if(!property) return empty_string; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { if(is_approximate) *is_approximate = a_properties[i]; return s_properties[i]; } } return empty_string; } const string &DataObject::getNonlocalizedKeyProperty(DataProperty *property) { if(!property) return empty_string; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { return s_nonlocalized_properties[i]; } } return empty_string; } string DataObject::getPropertyInputString(DataProperty *property) { if(!property) return empty_string; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { return property->getInputString(s_properties[i]); } } return empty_string; } string DataObject::getPropertyDisplayString(DataProperty *property) { if(!property) return empty_string; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { return property->getDisplayString(s_properties[i]); } } return empty_string; } const MathStructure *DataObject::getPropertyStruct(DataProperty *property) { if(!property) return NULL; for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == property) { if(!m_properties[i]) { m_properties[i] = property->generateStruct(s_properties[i], a_properties[i]); } return m_properties[i]; } } return NULL; } bool DataObject::isUserModified() const { return b_uchanged; } void DataObject::setUserModified(bool user_modified) { b_uchanged = user_modified; } DataSet *DataObject::parentSet() const { return parent; } DataProperty::DataProperty(DataSet *parent_set, string s_name, string s_title, string s_description) { if(!s_name.empty()) { names.push_back(s_name); name_is_ref.push_back(false); } stitle = s_title; sdescr = s_description; parent = parent_set; m_unit = NULL; ptype = PROPERTY_EXPRESSION; b_key = false; b_case = false; b_hide = false; b_brackets = false; b_approximate = false; b_uchanged = false; } DataProperty::DataProperty(const DataProperty &dp) { m_unit = NULL; set(dp); } void DataProperty::set(const DataProperty &dp) { stitle = dp.title(false); sdescr = dp.description(); sunit = dp.getUnitString(); parent = dp.parentSet(); if(m_unit) m_unit->unref(); m_unit = NULL; ptype = dp.propertyType(); b_key = dp.isKey(); b_case = dp.isCaseSensitive(); b_hide = dp.isHidden(); b_brackets = dp.usesBrackets(); b_approximate = dp.isApproximate(); b_uchanged = dp.isUserModified(); clearNames(); for(size_t i = 1; i <= dp.countNames(); i++) { names.push_back(dp.getName(i)); name_is_ref.push_back(dp.nameIsReference(i)); } } void DataProperty::setName(string s_name, bool is_ref) { if(s_name.empty()) return; names.clear(); name_is_ref.clear(); names.push_back(s_name); name_is_ref.push_back(is_ref); } void DataProperty::setNameIsReference(size_t index, bool is_ref) { if(index > 0 && index <= name_is_ref.size()) name_is_ref[index - 1] = is_ref; } bool DataProperty::nameIsReference(size_t index) const { if(index > 0 && index <= name_is_ref.size()) return name_is_ref[index - 1]; return false; } void DataProperty::clearNames() { names.clear(); name_is_ref.clear(); } void DataProperty::addName(string s_name, bool is_ref, size_t index) { if(s_name.empty()) return; if(index < 1 || index > names.size()) { names.push_back(s_name); name_is_ref.push_back(is_ref); } else { names.insert(names.begin() + (index - 1), s_name); name_is_ref.insert(name_is_ref.begin() + (index - 1), is_ref); } } const string &DataProperty::getName(size_t index) const { if(index < 1 || index > names.size()) return empty_string; return names[index - 1]; } const string &DataProperty::getReferenceName() const { for(size_t i = 0; i < name_is_ref.size(); i++) { if(name_is_ref[i]) return names[i]; } return getName(); } size_t DataProperty::hasName(const string &s_name) { for(size_t i = 0; i < names.size(); i++) { if(equalsIgnoreCase(s_name, names[i])) return i + 1; } return 0; } size_t DataProperty::countNames() const { return names.size(); } const string &DataProperty::title(bool return_name_if_no_title) const { if(return_name_if_no_title && stitle.empty()) { return getName(); } return stitle; } void DataProperty::setTitle(string s_title) { remove_blank_ends(s_title); stitle = s_title; } const string &DataProperty::description() const { return sdescr; } void DataProperty::setDescription(string s_description) { remove_blank_ends(s_description); sdescr = s_description; } void DataProperty::setUnit(string s_unit) { sunit = s_unit; if(m_unit) m_unit->unref(); m_unit = NULL; } const string &DataProperty::getUnitString() const { return sunit; } const MathStructure *DataProperty::getUnitStruct() { if(!m_unit && !sunit.empty()) { m_unit = new MathStructure(); CALCULATOR->parse(m_unit, sunit); } return m_unit; } string DataProperty::getInputString(const string &valuestr) { string str; if(b_brackets && valuestr.length() > 1 && valuestr[0] == '[' && valuestr[valuestr.length() - 1] == ']') { str = valuestr.substr(1, valuestr.length() - 2); } else { str = valuestr; } if(!sunit.empty()) { str += " "; str += sunit; } return str; } string DataProperty::getDisplayString(const string &valuestr) { string str = valuestr; if(!sunit.empty()) { str += " "; str += sunit; } return str; } MathStructure *DataProperty::generateStruct(const string &valuestr, int is_approximate) { MathStructure *mstruct = NULL; switch(ptype) { case PROPERTY_EXPRESSION: { ParseOptions po; if((b_approximate && is_approximate < 0) || is_approximate > 0) po.read_precision = ALWAYS_READ_PRECISION; if(b_brackets && valuestr.length() > 1 && valuestr[0] == '[' && valuestr[valuestr.length() - 1] == ']') { mstruct = new MathStructure(); CALCULATOR->parse(mstruct, valuestr.substr(1, valuestr.length() - 2), po); } else { mstruct = new MathStructure(); CALCULATOR->parse(mstruct, valuestr, po); } break; } case PROPERTY_NUMBER: { if(b_brackets && valuestr.length() > 1 && valuestr[0] == '[' && valuestr[valuestr.length() - 1] == ']') { if((b_approximate && is_approximate < 0) || is_approximate > 0) { ParseOptions po; po.read_precision = ALWAYS_READ_PRECISION; mstruct = new MathStructure(Number(valuestr.substr(1, valuestr.length() - 2), po)); } else { mstruct = new MathStructure(Number(valuestr.substr(1, valuestr.length() - 2))); } } else { if((b_approximate && is_approximate < 0) || is_approximate > 0) { ParseOptions po; po.read_precision = ALWAYS_READ_PRECISION; mstruct = new MathStructure(Number(valuestr, po)); } else { mstruct = new MathStructure(Number(valuestr)); } } break; } case PROPERTY_STRING: { if(b_brackets && valuestr.length() > 1 && valuestr[0] == '[' && valuestr[valuestr.length() - 1] == ']') mstruct = new MathStructure(valuestr.substr(1, valuestr.length() - 2)); else mstruct = new MathStructure(valuestr); break; } } if(getUnitStruct()) { mstruct->multiply(*getUnitStruct()); } return mstruct; } void DataProperty::setKey(bool is_key) {b_key = is_key;} bool DataProperty::isKey() const {return b_key;} void DataProperty::setHidden(bool is_hidden) {b_hide = is_hidden;} bool DataProperty::isHidden() const {return b_hide;} void DataProperty::setCaseSensitive(bool is_case_sensitive) {b_case = is_case_sensitive;} bool DataProperty::isCaseSensitive() const {return b_case;} void DataProperty::setUsesBrackets(bool uses_brackets) {b_brackets = uses_brackets;} bool DataProperty::usesBrackets() const {return b_brackets;} void DataProperty::setApproximate(bool is_approximate) {b_approximate = is_approximate;} bool DataProperty::isApproximate() const {return b_approximate;} void DataProperty::setPropertyType(PropertyType property_type) {ptype = property_type;} PropertyType DataProperty::propertyType() const {return ptype;} bool DataProperty::isUserModified() const { return b_uchanged; } void DataProperty::setUserModified(bool user_modified) { b_uchanged = user_modified; } DataSet *DataProperty::parentSet() const { return parent; } DataSet::DataSet(string s_category, string s_name, string s_default_file, string s_title, string s_description, bool is_local) : MathFunction(s_name, 1, 2, s_category, s_title, s_description) { b_local = is_local; sfile = s_default_file; b_loaded = false; setArgumentDefinition(1, new DataObjectArgument(this, _("Object"))); setArgumentDefinition(2, new DataPropertyArgument(this, _("Property"))); setDefaultValue(2, _("info")); setChanged(false); } DataSet::DataSet(const DataSet *o) { b_loaded = false; set(o); } ExpressionItem *DataSet::copy() const {return new DataSet(this);} void DataSet::set(const ExpressionItem *item) { if(item->type() == TYPE_FUNCTION && item->subtype() == SUBTYPE_DATA_SET) { DataSet *dc = (DataSet*) item; sfile = dc->defaultDataFile(); scopyright = dc->copyright(); } MathFunction::set(item); } int DataSet::subtype() const { return SUBTYPE_DATA_SET; } int DataSet::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions&) { DataObject *o = getObject(vargs[0]); if(!o) { CALCULATOR->error(true, _("Object %s not available in data set."), vargs[0].symbol().c_str(), NULL); return 0; } if(equalsIgnoreCase(vargs[1].symbol(), string("info")) || equalsIgnoreCase(vargs[1].symbol(), string(_("info")))) { string str = printProperties(o); CALCULATOR->message(MESSAGE_INFORMATION, str.c_str(), NULL); return 1; } DataProperty *dp = getProperty(vargs[1].symbol()); if(!dp) { CALCULATOR->error(true, _("Property %s not available in data set."), vargs[1].symbol().c_str(), NULL); return 0; } const MathStructure *pmstruct = o->getPropertyStruct(dp); if(!pmstruct) { CALCULATOR->error(true, _("Property %s not defined for object %s."), vargs[1].symbol().c_str(), vargs[0].symbol().c_str(), NULL); return 0; } mstruct.set(*pmstruct); return 1; } void DataSet::setDefaultProperty(string property) { setDefaultValue(2, property); setChanged(true); } const string &DataSet::defaultProperty() const { return getDefaultValue(2); } void DataSet::setCopyright(string s_copyright) { scopyright = s_copyright; setChanged(true); } const string &DataSet::copyright() const { return scopyright; } void DataSet::setDefaultDataFile(string s_file) { sfile = s_file; setChanged(true); } const string &DataSet::defaultDataFile() const { return sfile; } #ifdef _WIN32 # define FILE_SEPARATOR_CHAR '\\' #else # define FILE_SEPARATOR_CHAR '/' #endif bool DataSet::loadObjects(const char *file_name, bool is_user_defs) { if(file_name) { } else if(sfile.empty()) { return false; } else if(sfile.find(FILE_SEPARATOR_CHAR) != string::npos) { bool b = loadObjects(file_name, false); size_t i = sfile.find_last_of(FILE_SEPARATOR_CHAR); if(i != sfile.length() - 1) { string filepath = buildPath(getLocalDataDir(), "definitions", "datasets", sfile.substr(i + 1, sfile.length() - (i + 1))); if(loadObjects(filepath.c_str(), true)) { b = true; } else { #ifndef _WIN32 string filepath_old = buildPath(getOldLocalDir(), "definitions", "datasets", sfile.substr(i + 1, sfile.length() - (i + 1))); if(loadObjects(filepath_old.c_str(), true)) { b = true; recursiveMakeDir(getLocalDataDir()); makeDir(buildPath(getLocalDataDir(), "definitions")); makeDir(buildPath(getLocalDataDir(), "definitions", "datasets")); move_file(filepath_old.c_str(), filepath.c_str()); removeDir(buildPath(getOldLocalDir(), "definitions", "datasets")); removeDir(buildPath(getOldLocalDir(), "definitions")); } #endif } } return b; } else { bool b = loadObjects(buildPath(getGlobalDefinitionsDir(), sfile).c_str(), false); string filepath = buildPath(getLocalDataDir(), "definitions", "datasets", sfile); if(b && !fileExists(filepath)) return true; if(loadObjects(filepath.c_str(), true)) { b = true; } else { #ifndef _WIN32 string filepath_old = buildPath(getOldLocalDir(), "definitions", "datasets", sfile); if(loadObjects(filepath_old.c_str(), true)) { b = true; recursiveMakeDir(getLocalDataDir()); makeDir(buildPath(getLocalDataDir(), "definitions")); makeDir(buildPath(getLocalDataDir(), "definitions", "datasets")); move_file(filepath_old.c_str(), filepath.c_str()); removeDir(buildPath(getOldLocalDir(), "definitions", "datasets")); removeDir(buildPath(getOldLocalDir(), "definitions")); } #endif } return b; } xmlDocPtr doc; xmlNodePtr cur, child; string locale, lang_tmp; #ifdef _WIN32 WCHAR wlocale[LOCALE_NAME_MAX_LENGTH]; if(LCIDToLocaleName(LOCALE_USER_DEFAULT, wlocale, LOCALE_NAME_MAX_LENGTH, 0) != 0) locale = utf8_encode(wlocale); gsub("-", "_", locale); #else char *clocale = setlocale(LC_MESSAGES, ""); if(clocale) locale = clocale; #endif if(locale == "POSIX" || locale == "C") { locale = ""; } else { size_t i = locale.find('.'); if(i != string::npos) locale = locale.substr(0, i); } string localebase; if(locale.length() > 2) { localebase = locale.substr(0, 2); } else { localebase = locale; } while(localebase.length() < 2) localebase += " "; doc = xmlParseFile(file_name); if(doc == NULL) { if(!is_user_defs && !isLocal()) { CALCULATOR->error(true, _("Unable to load data objects in %s."), file_name, NULL); } return false; } cur = xmlDocGetRootElement(doc); if(cur == NULL) { xmlFreeDoc(doc); if(!is_user_defs && !isLocal()) { CALCULATOR->error(true, _("Unable to load data objects in %s."), file_name, NULL); } return false; } string version; xmlChar *value, *lang; while(cur != NULL) { if(!xmlStrcmp(cur->name, (const xmlChar*) "QALCULATE")) { XML_GET_STRING_FROM_PROP(cur, "version", version) break; } cur = cur->next; } if(cur == NULL) { CALCULATOR->error(true, _("File not identified as Qalculate! definitions file: %s."), file_name, NULL); xmlFreeDoc(doc); return false; } DataObject *o = NULL; cur = cur->xmlChildrenNode; string str, str2; vector lang_status_p; vector lang_status; int ils = 0; int i_approx = 0; bool cmp = false; bool b = false, old_object = false; size_t objects_before = objects.size(); vector p_refs; vector s_refs; while(cur) { b = false; if(!xmlStrcmp(cur->name, (const xmlChar*) "object")) { b = true; } else if(xmlStrcmp(cur->name, (const xmlChar*) "text")) { for(size_t i = 1; i <= countNames(); i++) { if(!xmlStrcmp(cur->name, (const xmlChar*) properties[i]->getName(i).c_str())) { b = true; break; } } } if(b) { lang_status_p.clear(); lang_status.clear(); if(is_user_defs && objects_before > 0) { s_refs.clear(); p_refs.clear(); } else { o = new DataObject(this); } for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->isKey()) { for(size_t i2 = 1; i2 <= properties[i]->countNames(); i2++) { if(properties[i]->getName(i2).find(' ') != string::npos) { str2 = properties[i]->getName(i2); gsub(" ", "_", str2); XML_GET_STRING_FROM_PROP(cur, str2.c_str(), str) } else { XML_GET_STRING_FROM_PROP(cur, properties[i]->getName(i2).c_str(), str) } remove_blank_ends(str); if(!str.empty()) { if(is_user_defs && objects_before > 0) { s_refs.push_back(str); p_refs.push_back(properties[i]); } else { o->setProperty(properties[i], str); } } } } } old_object = false; if(is_user_defs && objects_before > 0) { for(size_t i = 0; i < p_refs.size(); i++) { for(size_t i2 = 0; i2 < objects_before; i2++) { if(s_refs[i] == objects[i2]->getProperty(p_refs[i]) || s_refs[i] == objects[i2]->getNonlocalizedKeyProperty(p_refs[i])) { o = objects[i2]; old_object = true; break; } } if(old_object) break; } if(!old_object) o = new DataObject(this); for(size_t i = 0; i < p_refs.size(); i++) { o->setProperty(p_refs[i], s_refs[i]); } } child = cur->xmlChildrenNode; while(child) { b = false; for(size_t i = 0; i < properties.size(); i++) { for(size_t i2 = 1; i2 <= properties[i]->countNames(); i2++) { if(properties[i]->getName(i2).find(' ') != string::npos) { str2 = properties[i]->getName(i2); gsub(" ", "_", str2); cmp = !xmlStrcmp(child->name, (const xmlChar*) str2.c_str()); } else { cmp = !xmlStrcmp(child->name, (const xmlChar*) properties[i]->getName(i2).c_str()); } if(cmp) { value = xmlGetProp(child, (xmlChar*) "approximate"); if(value) { if(!xmlStrcmp(value, (const xmlChar*) "false")) { i_approx = 0; } else if(value && !xmlStrcmp(value, (const xmlChar*) "true")) { i_approx = 1; } xmlFree(value); } else { i_approx = -1; } if(properties[i]->propertyType() == PROPERTY_STRING) { value = xmlNodeListGetString(doc, child->xmlChildrenNode, 1); lang = xmlNodeGetLang(child); ils = -1; for(int i3 = lang_status_p.size() - 1; i3 > 0; i3--) { if(lang_status_p[i3] == properties[i3]) { ils = i3; break; } } if(!lang && (ils < 0 || lang_status[ils] < 1 || properties[i]->isKey())) { if(value) { str = (char*) value; remove_blank_ends(str); if(!str.empty() && str[0] == '!') { size_t i4 = str.find('!', 1); if(i4 != string::npos) { if(i4 + 1 < str.length()) { str = str.substr(i4 + 1, str.length() - (i4 + 1)); } else { str = ""; } } } } else { str = ""; } if(ils < 0 || lang_status[ils] < 1) { o->setProperty(properties[i], str, i_approx); } else { o->setNonlocalizedKeyProperty(properties[i], str); } } else if(!locale.empty() && (ils < 0 || lang_status[ils] < 2)) { if(locale == (char*) lang) { if(ils < 0) { lang_status_p.push_back(properties[i]); lang_status.push_back(2); } else { lang_status[ils] = 2; } if(value) { str = (char*) value; remove_blank_ends(str); } else { str = ""; } o->setProperty(properties[i], str, i_approx); } else if((ils < 0 || lang_status[ils] < 1) && strlen((char*) lang) >= 2 && lang[0] == localebase[0] && lang[1] == localebase[1]) { if(ils < 0) { lang_status_p.push_back(properties[i]); lang_status.push_back(1); } else { lang_status[ils] = 1; } if(value) { str = (char*) value; remove_blank_ends(str); } else { str = ""; } o->setProperty(properties[i], str, i_approx); } } if(value) xmlFree(value); if(lang) xmlFree(lang); } else { XML_GET_STRING_FROM_TEXT(child, str) remove_blank_ends(str); o->setProperty(properties[i], str, i_approx); } b = true; break; } } if(b) break; } child = child->next; } if(!old_object) objects.push_back(o); } cur = cur->next; } xmlFreeDoc(doc); b_loaded = true; if(!scopyright.empty()) { CALCULATOR->message(MESSAGE_INFORMATION, scopyright.c_str(), NULL); } return true; } int DataSet::saveObjects(const char *file_name, bool save_global) { string str, filename; if(!save_global && !file_name) { recursiveMakeDir(getLocalDataDir()); filename = buildPath(getLocalDataDir(), "definitions"); makeDir(filename); filename = buildPath(filename, "datasets"); makeDir(filename); filename = buildPath(filename, sfile); } else { filename = file_name; } const string *vstr; xmlDocPtr doc = xmlNewDoc((xmlChar*) "1.0"); xmlNodePtr cur, newnode, newnode2; doc->children = xmlNewDocNode(doc, NULL, (xmlChar*) "QALCULATE", NULL); xmlNewProp(doc->children, (xmlChar*) "version", (xmlChar*) VERSION); cur = doc->children; DataObject *o; int approx = false; bool do_save = save_global; for(size_t i = 0; i < objects.size(); i++) { if(save_global || objects[i]->isUserModified()) { do_save = true; o = objects[i]; newnode = xmlNewTextChild(cur, NULL, (xmlChar*) "object", NULL); if(!save_global) { for(size_t i2 = 0; i2 < properties.size(); i2++) { if(properties[i2]->isKey()) { vstr = &o->getProperty(properties[i2], &approx); if(approx < 0 && !vstr->empty()) { xmlNewProp(newnode, (xmlChar*) properties[i2]->getReferenceName().c_str(), (xmlChar*) vstr->c_str()); } } } } for(size_t i2 = 0; i2 < properties.size(); i2++) { if(save_global && properties[i2]->isKey()) { vstr = &o->getNonlocalizedKeyProperty(properties[i2]); if(vstr->empty()) { vstr = &o->getProperty(properties[i2], &approx); } else { o->getProperty(properties[i2], &approx); } } else { vstr = &o->getProperty(properties[i2], &approx); } if(save_global || approx >= 0 || !properties[i2]->isKey()) { if(!vstr->empty()) { if(properties[i2]->getReferenceName().find(' ') != string::npos) { if(save_global && properties[i2]->propertyType() == PROPERTY_STRING) { str = "_"; } else { str = ""; } str += properties[i2]->getReferenceName(); gsub(" ", "_", str); newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) str.c_str(), (xmlChar*) vstr->c_str()); } else { if(save_global && properties[i2]->propertyType() == PROPERTY_STRING) { str = "_"; str += properties[i2]->getReferenceName(); newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) str.c_str(), (xmlChar*) vstr->c_str()); } else { newnode2 = xmlNewTextChild(newnode, NULL, (xmlChar*) properties[i2]->getReferenceName().c_str(), (xmlChar*) vstr->c_str()); } } if(approx >= 0) { xmlNewProp(newnode2, (xmlChar*) "approximate", (xmlChar*) b2tf(approx > 0)); } } } } } } int returnvalue = 1; if(do_save) { returnvalue = xmlSaveFormatFile(filename.c_str(), doc, 1); } xmlFreeDoc(doc); return returnvalue; } bool DataSet::objectsLoaded() const { return b_loaded || sfile.empty(); } void DataSet::setObjectsLoaded(bool objects_loaded) { b_loaded = objects_loaded; } void DataSet::addProperty(DataProperty *dp) { properties.push_back(dp); setChanged(true); } void DataSet::delProperty(DataProperty *dp) { for(size_t i = 0; i < properties.size(); i++) { if(properties[i] == dp) { delete properties[i]; properties.erase(properties.begin() + i); setChanged(true); break; } } } void DataSet::delProperty(DataPropertyIter *it) { *it = properties.erase(*it); --(*it); } DataProperty *DataSet::getPrimaryKeyProperty() { for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->isKey()) return properties[i]; } return NULL; } DataProperty *DataSet::getProperty(string property) { if(property.empty()) return NULL; for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->hasName(property)) return properties[i]; } return NULL; } DataProperty *DataSet::getFirstProperty(DataPropertyIter *it) { *it = properties.begin(); if(*it != properties.end()) return **it; return NULL; } DataProperty *DataSet::getNextProperty(DataPropertyIter *it) { ++(*it); if(*it != properties.end()) return **it; return NULL; } const string &DataSet::getFirstPropertyName(DataPropertyIter *it) { *it = properties.begin(); if(*it != properties.end()) return (**it)->getName(); return empty_string; } const string &DataSet::getNextPropertyName(DataPropertyIter *it) { ++(*it); if(*it != properties.end()) return (**it)->getName(); return empty_string; } void DataSet::addObject(DataObject *o) { objects.push_back(o); } void DataSet::delObject(DataObject *o) { for(size_t i = 0; i < objects.size(); i++) { if(objects[i] == o) { delete objects[i]; objects.erase(objects.begin() + i); break; } } } void DataSet::delObject(DataObjectIter *it) { *it = objects.erase(*it); --(*it); } DataObject *DataSet::getObject(string object) { if(!objectsLoaded()) loadObjects(); if(object.empty()) return NULL; DataProperty *dp; for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->isKey()) { dp = properties[i]; if(dp->isCaseSensitive()) { for(size_t i2 = 0; i2 < objects.size(); i2++) { if(object == objects[i2]->getProperty(dp) || object == objects[i2]->getNonlocalizedKeyProperty(dp)) { return objects[i2]; } } } else { for(size_t i2 = 0; i2 < objects.size(); i2++) { if(equalsIgnoreCase(object, objects[i2]->getProperty(dp)) || equalsIgnoreCase(object, objects[i2]->getNonlocalizedKeyProperty(dp))) { return objects[i2]; } } } } } return NULL; } DataObject *DataSet::getObject(const MathStructure &object) { if(object.isSymbolic()) return getObject(object.symbol()); if(!objectsLoaded()) loadObjects(); DataProperty *dp; for(size_t i = 0; i < properties.size(); i++) { if(properties[i]->isKey()) { dp = properties[i]; if(dp->propertyType() != PROPERTY_STRING) { const MathStructure *mstruct; for(size_t i2 = 0; i2 < objects.size(); i2++) { mstruct = objects[i2]->getPropertyStruct(dp); if(mstruct && object.equals(*mstruct)) { return objects[i2]; } } } } } return NULL; } DataObject *DataSet::getFirstObject(DataObjectIter *it) { if(!objectsLoaded()) loadObjects(); *it = objects.begin(); if(*it != objects.end()) return **it; return NULL; } DataObject *DataSet::getNextObject(DataObjectIter *it) { ++(*it); if(*it != objects.end()) return **it; return NULL; } const MathStructure *DataSet::getObjectProperyStruct(string property, string object) { DataObject *o = getObject(object); DataProperty *dp = getProperty(property); if(o && dp) { return o->getPropertyStruct(dp); } return NULL; } const string &DataSet::getObjectProperty(string property, string object) { DataObject *o = getObject(object); DataProperty *dp = getProperty(property); if(o && dp) { return o->getProperty(dp); } return empty_string; } string DataSet::getObjectPropertyInputString(string property, string object) { DataObject *o = getObject(object); DataProperty *dp = getProperty(property); if(o && dp) { return o->getPropertyInputString(dp); } return empty_string; } string DataSet::getObjectPropertyDisplayString(string property, string object) { DataObject *o = getObject(object); DataProperty *dp = getProperty(property); if(o && dp) { return o->getPropertyDisplayString(dp); } return empty_string; } string DataSet::printProperties(string object) { return printProperties(getObject(object)); } string DataSet::printProperties(DataObject *o) { if(o) { string str, stmp; str = "-------------------------------------\n"; bool started = false; for(size_t i = 0; i < properties.size(); i++) { if(!properties[i]->isHidden() && properties[i]->isKey()) { stmp = o->getPropertyDisplayString(properties[i]); if(!stmp.empty()) { if(started) str += "\n\n"; else started = true; str += properties[i]->title(); str += ":\n"; str += stmp; } } } for(size_t i = 0; i < properties.size(); i++) { if(!properties[i]->isHidden() && !properties[i]->isKey()) { stmp = o->getPropertyDisplayString(properties[i]); if(!stmp.empty()) { if(started) str += "\n\n"; else started = true; str += properties[i]->title(); str += ":\n"; str += stmp; } } } str += "\n-------------------------------------"; return str; } return empty_string; } DataPropertyArgument::DataPropertyArgument(DataSet *data_set, string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { b_text = true; o_data = data_set; } DataPropertyArgument::DataPropertyArgument(const DataPropertyArgument *arg) {set(arg); b_text = true; o_data = arg->dataSet();} DataPropertyArgument::~DataPropertyArgument() {} bool DataPropertyArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && o_data && (o_data->getProperty(value.symbol()) || equalsIgnoreCase(value.symbol(), string("info")) || equalsIgnoreCase(value.symbol(), string(_("info")))); } int DataPropertyArgument::type() const {return ARGUMENT_TYPE_DATA_PROPERTY;} Argument *DataPropertyArgument::copy() const {return new DataPropertyArgument(this);} string DataPropertyArgument::print() const {return _("data property");} string DataPropertyArgument::subprintlong() const { string str = _("name of a data property"); str += " ("; DataPropertyIter it; DataProperty *o = NULL; if(o_data) { o = o_data->getFirstProperty(&it); } if(!o) { str += _("no properties available"); } else { string stmp; size_t l_last = 0; while(true) { if(!o->isHidden()) { if(!stmp.empty()) { stmp += ", "; l_last = stmp.length(); } stmp += o->getName(); } o = o_data->getNextProperty(&it); if(!o) break; } if(stmp.empty()) { str += _("no properties available"); } else { if(l_last > 0) { stmp.insert(l_last, " "); stmp.insert(l_last, _("or")); } str += stmp; } } str += ")"; return str; } DataSet *DataPropertyArgument::dataSet() const {return o_data;} void DataPropertyArgument::setDataSet(DataSet *data_set) {o_data = data_set;} DataObjectArgument::DataObjectArgument(DataSet *data_set, string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { b_text = true; o_data = data_set; } DataObjectArgument::DataObjectArgument(const DataObjectArgument *arg) {set(arg); b_text = true; o_data = arg->dataSet();} DataObjectArgument::~DataObjectArgument() {} bool DataObjectArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(value.isSymbolic()) return true; value.eval(eo); if(value.isSymbolic()) return true; if(!o_data) return false; DataPropertyIter it; DataProperty *dp = o_data->getFirstProperty(&it); while(dp) { if(dp->isKey() && (dp->propertyType() == PROPERTY_EXPRESSION || (value.isNumber() && dp->propertyType() == PROPERTY_NUMBER))) { return true; } dp = o_data->getNextProperty(&it); } CALCULATOR->error(true, _("Data set \"%s\" has no object key that supports the provided argument type."), o_data->title().c_str(), NULL); return false; } int DataObjectArgument::type() const {return ARGUMENT_TYPE_DATA_OBJECT;} Argument *DataObjectArgument::copy() const {return new DataObjectArgument(this);} string DataObjectArgument::print() const {return _("data object");} string DataObjectArgument::subprintlong() const { string str = _("an object from"); str += " \""; str += o_data->title(); str += "\""; DataPropertyIter it; DataProperty *o = NULL; if(o_data) { o = o_data->getFirstProperty(&it); } if(o) { string stmp; size_t l_last = 0; while(true) { if(o->isKey()) { if(!stmp.empty()) { stmp += ", "; l_last = stmp.length(); } stmp += o->getName(); } o = o_data->getNextProperty(&it); if(!o) break; } if(!stmp.empty()) { if(l_last > 0) { stmp.insert(l_last, " "); stmp.insert(l_last, _("or")); } str += " ("; str += _("use"); str += " "; str += stmp; str += ")"; } } return str; } DataSet *DataObjectArgument::dataSet() const {return o_data;} void DataObjectArgument::setDataSet(DataSet *data_set) {o_data = data_set;} libqalculate-2.8.2/libqalculate/Variable.cc0000644000175000017500000005255713365430726015633 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "Variable.h" #include "util.h" #include "Calculator.h" #include "MathStructure.h" #include "Number.h" Assumptions::Assumptions() : i_type(ASSUMPTION_TYPE_NUMBER), i_sign(ASSUMPTION_SIGN_UNKNOWN), fmin(NULL), fmax(NULL), b_incl_min(true), b_incl_max(true) {} Assumptions::~Assumptions() {} bool Assumptions::isPositive() {return i_sign == ASSUMPTION_SIGN_POSITIVE || (fmin && (fmin->isPositive() || (!b_incl_min && fmin->isNonNegative())));} bool Assumptions::isNegative() {return i_sign == ASSUMPTION_SIGN_NEGATIVE || (fmax && (fmax->isNegative() || (!b_incl_max && fmax->isNonPositive())));} bool Assumptions::isNonNegative() {return i_sign == ASSUMPTION_SIGN_NONNEGATIVE || i_sign == ASSUMPTION_SIGN_POSITIVE || (fmin && fmin->isNonNegative());} bool Assumptions::isNonPositive() {return i_sign == ASSUMPTION_SIGN_NONPOSITIVE || i_sign == ASSUMPTION_SIGN_NEGATIVE || (fmax && fmax->isNonPositive());} bool Assumptions::isInteger() {return i_type >= ASSUMPTION_TYPE_INTEGER;} bool Assumptions::isNumber() {return i_type >= ASSUMPTION_TYPE_NUMBER;} bool Assumptions::isRational() {return i_type >= ASSUMPTION_TYPE_RATIONAL;} bool Assumptions::isReal() {return i_type >= ASSUMPTION_TYPE_REAL;} bool Assumptions::isComplex() {return i_type == ASSUMPTION_TYPE_COMPLEX;} bool Assumptions::isNonZero() {return i_sign == ASSUMPTION_SIGN_NONZERO || isPositive() || isNegative();} bool Assumptions::isNonMatrix() {return i_type >= ASSUMPTION_TYPE_NONMATRIX;} bool Assumptions::isScalar() {return i_type >= ASSUMPTION_TYPE_NONMATRIX;} AssumptionType Assumptions::type() {return i_type;} AssumptionSign Assumptions::sign() {return i_sign;} void Assumptions::setType(AssumptionType ant) { i_type = ant; if(i_type <= ASSUMPTION_TYPE_COMPLEX && i_sign != ASSUMPTION_SIGN_NONZERO) { i_sign = ASSUMPTION_SIGN_UNKNOWN; } if(i_type <= ASSUMPTION_TYPE_NONMATRIX) { if(fmax) delete fmax; if(fmin) delete fmin; } } void Assumptions::setSign(AssumptionSign as) { i_sign = as; if(i_type <= ASSUMPTION_TYPE_COMPLEX && i_sign != ASSUMPTION_SIGN_NONZERO && i_sign != ASSUMPTION_SIGN_UNKNOWN) { i_type = ASSUMPTION_TYPE_REAL; } } void Assumptions::setMin(const Number *nmin) { if(!nmin) { if(fmin) { delete fmin; } return; } if(i_type <= ASSUMPTION_TYPE_NONMATRIX) i_type = ASSUMPTION_TYPE_NUMBER; if(!fmin) { fmin = new Number(*nmin); } else { fmin->set(*nmin); } } void Assumptions::setIncludeEqualsMin(bool include_equals) { b_incl_min = include_equals; } bool Assumptions::includeEqualsMin() const { return b_incl_min; } const Number *Assumptions::min() const { return fmin; } void Assumptions::setMax(const Number *nmax) { if(!nmax) { if(fmax) { delete fmax; } return; } if(i_type <= ASSUMPTION_TYPE_NONMATRIX) i_type = ASSUMPTION_TYPE_NUMBER; if(!fmax) { fmax = new Number(*nmax); } else { fmax->set(*nmax); } } void Assumptions::setIncludeEqualsMax(bool include_equals) { b_incl_max = include_equals; } bool Assumptions::includeEqualsMax() const { return b_incl_max; } const Number *Assumptions::max() const { return fmax; } Variable::Variable(string cat_, string name_, string title_, bool is_local, bool is_builtin, bool is_active) : ExpressionItem(cat_, name_, title_, "", is_local, is_builtin, is_active) { setChanged(false); } Variable::Variable() : ExpressionItem() {} Variable::Variable(const Variable *variable) {set(variable);} Variable::~Variable() {} void Variable::set(const ExpressionItem *item) { ExpressionItem::set(item); } UnknownVariable::UnknownVariable(string cat_, string name_, string title_, bool is_local, bool is_builtin, bool is_active) : Variable(cat_, name_, title_, is_local, is_builtin, is_active) { setChanged(false); o_assumption = NULL; mstruct = NULL; } UnknownVariable::UnknownVariable() : Variable() { o_assumption = NULL; mstruct = NULL; } UnknownVariable::UnknownVariable(const UnknownVariable *variable) { mstruct = NULL; o_assumption = NULL; set(variable); } UnknownVariable::~UnknownVariable() { if(o_assumption) delete o_assumption; if(mstruct) mstruct->unref(); } ExpressionItem *UnknownVariable::copy() const { return new UnknownVariable(this); } void UnknownVariable::set(const ExpressionItem *item) { if(item->type() == TYPE_VARIABLE && item->subtype() == SUBTYPE_UNKNOWN_VARIABLE) { if(o_assumption) delete o_assumption; o_assumption = ((UnknownVariable*) item)->assumptions(); if(((UnknownVariable*) item)->interval().isUndefined()) { if(mstruct) mstruct->unref(); mstruct = NULL; } else { if(mstruct) mstruct->set(((UnknownVariable*) item)->interval()); else mstruct = new MathStructure(((UnknownVariable*) item)->interval()); } } ExpressionItem::set(item); } void UnknownVariable::setAssumptions(Assumptions *ass) { if(o_assumption) delete o_assumption; o_assumption = ass; } void UnknownVariable::setAssumptions(const MathStructure &mvar) { Assumptions *ass = new Assumptions(); if(mvar.representsInteger(true)) ass->setType(ASSUMPTION_TYPE_INTEGER); else if(mvar.representsRational(true)) ass->setType(ASSUMPTION_TYPE_RATIONAL); else if(mvar.representsReal(true)) ass->setType(ASSUMPTION_TYPE_REAL); else if(mvar.representsComplex(true)) ass->setType(ASSUMPTION_TYPE_COMPLEX); else if(mvar.representsNumber(true)) ass->setType(ASSUMPTION_TYPE_NUMBER); else if(mvar.representsNonMatrix()) ass->setType(ASSUMPTION_TYPE_NONMATRIX); if(mvar.representsPositive(true)) ass->setSign(ASSUMPTION_SIGN_POSITIVE); else if(mvar.representsNegative(true)) ass->setSign(ASSUMPTION_SIGN_NEGATIVE); else if(mvar.representsNonPositive(true)) ass->setSign(ASSUMPTION_SIGN_NONPOSITIVE); else if(mvar.representsNonNegative(true)) ass->setSign(ASSUMPTION_SIGN_NONNEGATIVE); else if(mvar.representsNonZero(true)) ass->setSign(ASSUMPTION_SIGN_NONZERO); if(o_assumption) delete o_assumption; o_assumption = ass; } Assumptions *UnknownVariable::assumptions() { return o_assumption; } const MathStructure &UnknownVariable::interval() const { if(mstruct) return *mstruct; return m_undefined; } void UnknownVariable::setInterval(const MathStructure &o) { setAssumptions(o); if(o.isUndefined()) { if(mstruct) mstruct->unref(); mstruct = NULL; } else { if(mstruct) mstruct->set(o); else mstruct = new MathStructure(o); if(!o_assumption->isReal() && (o.isNumber() && o.number().isInterval() && !o.number().lowerEndPoint().hasImaginaryPart() && !o.number().upperEndPoint().hasImaginaryPart())) o_assumption->setType(ASSUMPTION_TYPE_REAL); else if(!o_assumption->isNumber() && o.isNumber() && o.number().isInterval()) o_assumption->setType(ASSUMPTION_TYPE_NUMBER); } } bool UnknownVariable::representsPositive(bool b) { if(!b && mstruct) return mstruct->representsPositive(false); if(o_assumption) return o_assumption->isPositive(); return CALCULATOR->defaultAssumptions()->isPositive(); } bool UnknownVariable::representsNegative(bool b) { if(!b && mstruct) return mstruct->representsNegative(false); if(o_assumption) return o_assumption->isNegative(); return CALCULATOR->defaultAssumptions()->isNegative(); } bool UnknownVariable::representsNonNegative(bool b) { if(!b && mstruct) return mstruct->representsNonNegative(false); if(o_assumption) return o_assumption->isNonNegative(); return CALCULATOR->defaultAssumptions()->isNonNegative(); } bool UnknownVariable::representsNonPositive(bool b) { if(!b && mstruct) return mstruct->representsNonPositive(false); if(o_assumption) return o_assumption->isNonPositive(); return CALCULATOR->defaultAssumptions()->isNonPositive(); } bool UnknownVariable::representsInteger(bool b) { if(!b && mstruct) return mstruct->representsInteger(false); if(o_assumption) return o_assumption->isInteger(); return CALCULATOR->defaultAssumptions()->isInteger(); } bool UnknownVariable::representsNumber(bool b) { if(!b && mstruct) return mstruct->representsNumber(false); if(o_assumption) return o_assumption->isNumber(); return CALCULATOR->defaultAssumptions()->isNumber(); } bool UnknownVariable::representsRational(bool b) { if(!b && mstruct) return mstruct->representsRational(false); if(o_assumption) return o_assumption->isRational(); return CALCULATOR->defaultAssumptions()->isRational(); } bool UnknownVariable::representsReal(bool b) { if(!b && mstruct) return mstruct->representsReal(false); if(o_assumption) return o_assumption->isReal(); return CALCULATOR->defaultAssumptions()->isReal(); } bool UnknownVariable::representsNonComplex(bool b) { if(mstruct && (!b || (!o_assumption->isReal() && !o_assumption->isComplex()))) return mstruct->representsNonComplex(b); if(o_assumption) return o_assumption->isReal(); return CALCULATOR->defaultAssumptions()->isReal(); } bool UnknownVariable::representsComplex(bool b) { if(!b && mstruct) return mstruct->representsComplex(false); if(o_assumption) return o_assumption->isComplex(); return CALCULATOR->defaultAssumptions()->isComplex(); } bool UnknownVariable::representsNonZero(bool b) { if(!b && mstruct) return mstruct->representsNonZero(false); if(o_assumption) return o_assumption->isNonZero(); return CALCULATOR->defaultAssumptions()->isNonZero(); } bool UnknownVariable::representsNonMatrix() { if(o_assumption) return o_assumption->isNonMatrix(); return CALCULATOR->defaultAssumptions()->isNonMatrix(); } bool UnknownVariable::representsScalar() { if(o_assumption) return o_assumption->isScalar(); return CALCULATOR->defaultAssumptions()->isScalar(); } KnownVariable::KnownVariable(string cat_, string name_, const MathStructure &o, string title_, bool is_local, bool is_builtin, bool is_active) : Variable(cat_, name_, title_, is_local, is_builtin, is_active) { mstruct = new MathStructure(o); setApproximate(mstruct->isApproximate()); setPrecision(mstruct->precision()); b_expression = false; sexpression = ""; suncertainty = ""; sunit = ""; calculated_precision = -1; calculated_with_interval = false; calculated_with_units = false; setChanged(false); } KnownVariable::KnownVariable(string cat_, string name_, string expression_, string title_, bool is_local, bool is_builtin, bool is_active) : Variable(cat_, name_, title_, is_local, is_builtin, is_active) { mstruct = NULL; calculated_precision = -1; calculated_with_interval = false; calculated_with_units = false; suncertainty = ""; sunit = ""; set(expression_); setChanged(false); } KnownVariable::KnownVariable() : Variable() { mstruct = NULL; } KnownVariable::KnownVariable(const KnownVariable *variable) { mstruct = NULL; set(variable); } KnownVariable::~KnownVariable() { if(mstruct) delete mstruct; } ExpressionItem *KnownVariable::copy() const { return new KnownVariable(this); } bool KnownVariable::isExpression() const { return b_expression; } string KnownVariable::expression() const { return sexpression; } string KnownVariable::uncertainty() const { return suncertainty; } string KnownVariable::unit() const { return sunit; } void KnownVariable::set(const ExpressionItem *item) { if(item->type() == TYPE_VARIABLE && item->subtype() == SUBTYPE_KNOWN_VARIABLE) { calculated_precision = -1; calculated_with_interval = false; calculated_with_units = false; sexpression = ((KnownVariable*) item)->expression(); suncertainty = ((KnownVariable*) item)->uncertainty(); sunit = ((KnownVariable*) item)->unit(); b_expression = ((KnownVariable*) item)->isExpression(); if(!b_expression) { set(((KnownVariable*) item)->get()); } } ExpressionItem::set(item); } void KnownVariable::set(const MathStructure &o) { if(!mstruct) mstruct = new MathStructure(o); else mstruct->set(o); setApproximate(mstruct->isApproximate()); setPrecision(mstruct->precision()); calculated_precision = -1; calculated_with_interval = false; calculated_with_units = false; b_expression = false; sexpression = ""; setApproximate(o.isApproximate()); setChanged(true); } void KnownVariable::set(string expression_) { if(mstruct) { delete mstruct; } mstruct = NULL; b_expression = true; sexpression = expression_; remove_blank_ends(sexpression); calculated_precision = -1; calculated_with_interval = false; calculated_with_units = false; setChanged(true); } void KnownVariable::setUncertainty(string standard_uncertainty) { if(mstruct) { delete mstruct; } mstruct = NULL; suncertainty = standard_uncertainty; remove_blank_ends(suncertainty); calculated_precision = -1; calculated_with_interval = false; calculated_with_units = false; if(!suncertainty.empty()) setApproximate(true); setChanged(true); } void KnownVariable::setUnit(string unit_expression) { if(mstruct) { delete mstruct; } mstruct = NULL; sunit = unit_expression; remove_blank_ends(sunit); calculated_precision = -1; calculated_with_interval = false; calculated_with_units = false; setChanged(true); } bool set_precision_of_numbers(MathStructure &mstruct, int i_prec) { if(mstruct.isNumber()) { if(i_prec < 0) { if(!mstruct.number().isApproximate()) { mstruct.number().setApproximate(); mstruct.numberUpdated(); } } else if(mstruct.number().precision() < 0 || mstruct.number().precision() < i_prec) { mstruct.number().setPrecision(i_prec); mstruct.numberUpdated(); } return true; } bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(set_precision_of_numbers(mstruct[i], i_prec)) { mstruct.childUpdated(i + 1); b = true; } } return b; } extern bool create_interval(MathStructure &mstruct, const MathStructure &m1, const MathStructure &m2); bool replace_f_interval(MathStructure &mstruct) { if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_interval && mstruct.size() == 2) { if(mstruct[0].isNumber() && mstruct[1].isNumber()) { Number nr; if(nr.setInterval(mstruct[0].number(), mstruct[1].number())) { mstruct.set(nr, true); return true; } } else { MathStructure m1(mstruct[0]); MathStructure m2(mstruct[1]); if(create_interval(mstruct, m1, m2)) return true; } } else { bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(replace_f_interval(mstruct[i])) { mstruct.childUpdated(i + 1); b = true; } } return b; } return false; } const MathStructure &KnownVariable::get() { if(b_expression && ((!mstruct || mstruct->isAborted()) || calculated_with_interval != CALCULATOR->usesIntervalArithmetic() || (!sunit.empty() && calculated_with_units != CALCULATOR->variableUnitsEnabled()))) { if(mstruct) mstruct->unref(); mstruct = new MathStructure(); ParseOptions po; if(isApproximate() && precision() == -1 && suncertainty.empty()) { po.read_precision = ALWAYS_READ_PRECISION; } if(suncertainty.empty()) { mstruct->setAborted(); CALCULATOR->parse(mstruct, sexpression, po); } else { mstruct->number().set(sexpression, po); mstruct->numberUpdated(); } if(!suncertainty.empty()) { Number nr_u(suncertainty); if(mstruct->isNumber()) { mstruct->number().setUncertainty(nr_u); } else if(mstruct->isMultiplication() && mstruct->size() > 0 && (*mstruct)[0].isNumber()) { (*mstruct)[0].number().setUncertainty(nr_u); } } else if(precision() >= 0) { if(mstruct->precision() < 0 || precision() < mstruct->precision()) { if(!set_precision_of_numbers(*mstruct, precision())) mstruct->setPrecision(precision(), true); } } else if(isApproximate()) { if(!mstruct->isApproximate()) { if(!set_precision_of_numbers(*mstruct, precision())) mstruct->setApproximate(true, true); } } if(!sunit.empty() && CALCULATOR->variableUnitsEnabled()) { MathStructure *mstruct_unit = new MathStructure; mstruct_unit->setAborted(); CALCULATOR->parse(mstruct_unit, sunit, po); mstruct->multiply_nocopy(mstruct_unit); } replace_f_interval(*mstruct); calculated_with_interval = CALCULATOR->usesIntervalArithmetic(); calculated_with_units = CALCULATOR->variableUnitsEnabled(); } if(mstruct->contains(this, false, true, true) > 0) { CALCULATOR->error(true, _("Recursive variable: %s = %s"), name().c_str(), mstruct->print().c_str(), NULL); return m_undefined; } return *mstruct; } bool KnownVariable::representsPositive(bool allow_units) {return get().representsPositive(allow_units);} bool KnownVariable::representsNegative(bool allow_units) {return get().representsNegative(allow_units);} bool KnownVariable::representsNonNegative(bool allow_units) {return get().representsNonNegative(allow_units);} bool KnownVariable::representsNonPositive(bool allow_units) {return get().representsNonPositive(allow_units);} bool KnownVariable::representsInteger(bool allow_units) {return get().representsInteger(allow_units);} bool KnownVariable::representsNonInteger(bool allow_units) {return get().representsNonInteger(allow_units);} bool KnownVariable::representsFraction(bool allow_units) {return get().representsFraction(allow_units);} bool KnownVariable::representsNumber(bool allow_units) {return get().representsNumber(allow_units);} bool KnownVariable::representsRational(bool allow_units) {return get().representsRational(allow_units);} bool KnownVariable::representsReal(bool allow_units) {return get().representsReal(allow_units);} bool KnownVariable::representsNonComplex(bool allow_units) {return get().representsNonComplex(allow_units);} bool KnownVariable::representsComplex(bool allow_units) {return get().representsComplex(allow_units);} bool KnownVariable::representsNonZero(bool allow_units) {return get().representsNonZero(allow_units);} bool KnownVariable::representsEven(bool allow_units) {return get().representsEven(allow_units);} bool KnownVariable::representsOdd(bool allow_units) {return get().representsOdd(allow_units);} bool KnownVariable::representsUndefined(bool include_childs, bool include_infinite, bool be_strict) {return get().representsUndefined(include_childs, include_infinite, be_strict);} bool KnownVariable::representsBoolean() {return get().representsBoolean();} bool KnownVariable::representsNonMatrix() {return get().representsNonMatrix();} bool KnownVariable::representsScalar() {return get().representsScalar();} DynamicVariable::DynamicVariable(string cat_, string name_, string title_, bool is_local, bool is_builtin, bool is_active) : KnownVariable(cat_, name_, MathStructure(), title_, is_local, is_builtin, is_active) { mstruct = NULL; calculated_precision = -1; calculated_with_interval = false; calculated_with_units = false; always_recalculate = false; setApproximate(); setChanged(false); } DynamicVariable::DynamicVariable(const DynamicVariable *variable) { mstruct = NULL; set(variable); setApproximate(); setChanged(false); always_recalculate = false; } DynamicVariable::DynamicVariable() : KnownVariable() { mstruct = NULL; calculated_precision = -1; calculated_with_interval = false; calculated_with_units = false; setApproximate(); setChanged(false); always_recalculate = false; } DynamicVariable::~DynamicVariable() { if(mstruct) delete mstruct; } void DynamicVariable::set(const ExpressionItem *item) { ExpressionItem::set(item); } void DynamicVariable::set(const MathStructure&) {} void DynamicVariable::set(string) {} const MathStructure &DynamicVariable::get() { if(always_recalculate || calculated_with_interval != CALCULATOR->usesIntervalArithmetic() || calculated_precision != CALCULATOR->getPrecision() || !mstruct || mstruct->isAborted()) { if(mstruct) mstruct->unref(); mstruct = new MathStructure(); mstruct->setAborted(); calculated_precision = CALCULATOR->getPrecision(); calculated_with_interval = CALCULATOR->usesIntervalArithmetic(); calculate(); } return *mstruct; } int DynamicVariable::calculatedPrecision() const { return calculated_precision; } bool DynamicVariable::calculatedWithInterval() const { return calculated_with_interval; } PiVariable::PiVariable() : DynamicVariable("Constants", "pi") {} void PiVariable::calculate() const { Number nr; nr.pi(); mstruct->set(nr); } EVariable::EVariable() : DynamicVariable("Constants", "e") {} void EVariable::calculate() const { Number nr; nr.e(); mstruct->set(nr); } EulerVariable::EulerVariable() : DynamicVariable("Constants", "euler") {} void EulerVariable::calculate() const { Number nr; nr.euler(); mstruct->set(nr); } CatalanVariable::CatalanVariable() : DynamicVariable("Constants", "catalan") {} void CatalanVariable::calculate() const { Number nr; nr.catalan(); mstruct->set(nr); } PrecisionVariable::PrecisionVariable() : DynamicVariable("", "precision") { setApproximate(false); } void PrecisionVariable::calculate() const { mstruct->set(PRECISION, 1, 0); } TodayVariable::TodayVariable() : DynamicVariable("", "today") { setApproximate(false); always_recalculate = true; } void TodayVariable::calculate() const { QalculateDateTime dt; dt.setToCurrentDate(); mstruct->set(dt); } YesterdayVariable::YesterdayVariable() : DynamicVariable("", "yesterday") { setApproximate(false); always_recalculate = true; } void YesterdayVariable::calculate() const { QalculateDateTime dt; dt.setToCurrentDate(); dt.addDays(-1); mstruct->set(dt); } TomorrowVariable::TomorrowVariable() : DynamicVariable("", "tomorrow") { setApproximate(false); always_recalculate = true; } void TomorrowVariable::calculate() const { QalculateDateTime dt; dt.setToCurrentDate(); dt.addDays(1); mstruct->set(dt); } NowVariable::NowVariable() : DynamicVariable("", "now") { setApproximate(false); always_recalculate = true; } void NowVariable::calculate() const { QalculateDateTime dt; dt.setToCurrentTime(); mstruct->set(dt); } libqalculate-2.8.2/libqalculate/MathStructure.h0000644000175000017500000012204313363530623016541 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016-2018 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef MATH_STRUCTURE_H #define MATH_STRUCTURE_H #include #include #include #include class QalculateDate; /** @file */ /// Types for MathStructure typedef enum { STRUCT_MULTIPLICATION, STRUCT_INVERSE, STRUCT_DIVISION, STRUCT_ADDITION, STRUCT_NEGATE, STRUCT_POWER, STRUCT_NUMBER, STRUCT_UNIT, STRUCT_SYMBOLIC, STRUCT_FUNCTION, STRUCT_VARIABLE, STRUCT_VECTOR, STRUCT_BITWISE_AND, STRUCT_BITWISE_OR, STRUCT_BITWISE_XOR, STRUCT_BITWISE_NOT, STRUCT_LOGICAL_AND, STRUCT_LOGICAL_OR, STRUCT_LOGICAL_XOR, STRUCT_LOGICAL_NOT, STRUCT_COMPARISON, STRUCT_UNDEFINED, STRUCT_ABORTED, STRUCT_DATETIME } StructureType; enum { MULTIPLICATION_SIGN_NONE, MULTIPLICATION_SIGN_SPACE, MULTIPLICATION_SIGN_OPERATOR, MULTIPLICATION_SIGN_OPERATOR_SHORT }; /// A structure representing a mathematical value/expression/result /** * A MathStructure can both be container representing an operation with an ordered list of children or simple value representing * a number, , variable etc. The children of a container might be of any type, allowing a tree-like nested structure. * * These are the most common conatiner/operation types: * - \b Addition: contains two or more children, representing terms (x+y+...) * - \b Multiplication: contains two or more children, representing factors (x*y*...) * - \b Power: contains exactly two children, representing base and exponent (x^y) * - \b Function: contains a two or more children, representing arguments, and a reference to a MathFunction object ( f(x,y,...) ) * - \b Comparison: an equality or inequality containing exactly two children, represening the expressions right and left of the sign, specified with a ComparisonType (x=y, x!=y, x>y, ...) * - \b Vector: contains zero or more children, representing elements in a vector ( [x, y, z, ...] ) * * Also available are containers representing logical and bitwise operations. * Subtraction is represented by an addition structure with negated children and division by a multiplication structure with inverted children. * Matrices is represented by a vector with vectors as children. * * For formatted structures, the following types is also available: * - \b Negation: contains exactly one child (-x) * - \b Invertion: contains exactly one child (1/x) * - \b Division: contains exactly two children representing numerator and denominator (x/y) * * The following value types are available: * - \b Number: has a Number object, representing a rational, floating point, complex or infinite numeric value * - \b Variable: has a reference to a Variable object, with a known or unknown value * - \b Symbolic: has an associated text string, with assumptions about the represented value controlled by the default assumptions * - \b Unit: has a reference to a Unit object, and might in a formatted structure also have a reference to a Prefix object * - \b Undefined: represents an undefined value * * To create a MathStructure, you can either create a simple structure using the constructors and then expanding it with structural operations, * or use the parse or calculation functions of the global Calculator object to convert an expression string. * * The expression "(5x + 2) * 3" can be turned into a MathStructure either using * \code * MathStructure mstruct = CALCULATOR->parse("(5x + 2) * 3"); * \endcode * or * \code * MathStructure mstruct(5); * mstruct *= CALCULATOR->v_x; * mstruct += 2; * mstruct *= 3: * \endcode * The first variant is obviously simpler, but slower and allows less control. * * Then, to evaluate/calculate/simplify (whatever) a structure, eval() should normally be used. The EvaluationOptions passed to eval() allows much control over the process * and the outcome. * \code * EvaluationOptions eo; * mstruct.eval(eo); * \endcode * * After that, to display the result, you should first format the structure using format() and then display it using print(), passing the PrintOptions to both. * \code * PrintOptions po; * mstruct.format(po); * std::cout << mstruct.print(po) << std::endl; * \endcode * * Most low-level functions expect the structure to be unformatted och require that unformat() is called after an expression string has been parsed or format() has been called. * * To access a child structure either the [] operator or the safer getChild() can be used. * Note however that the index passed to the operator start at zero and the index argument for getChild() starts at one. * \code * MathStructure mstruct(5); * mstruct += 2; * std::cout << mstruct.print() << std::endl; // output: "5 + 2" * std::cout << mstruct.getChild(1)->print() << std::endl; // output: "5" * std::cout << mstruct[1].print() << std::endl; // output: "2" * \endcode * * MathStructure uses reference count for management of objects allocated with new. * Call ref() when starting to use the object and unref() when done. * Note that the reference count is initialized to 1 in the constructors, so ref() should not be called after the object creation. * This system is used for all child objects, so the following is perfectly legal: * \code * MathStructure *mchild_p = mstruct->getChild(1); * mchild_p->ref(); // mchild_p reference count = 2 * mstruct->unref(); //mstruct reference count = 0, mstruct deleted, mchild_p reference count = 1 * (...) * mchild_p->unref(); // mchild_p reference count = 0, mchild_p deleted * \endcode */ class MathStructure { protected: size_t i_ref; StructureType m_type; bool b_approx; int i_precision; vector v_subs; vector v_order; string s_sym; Number o_number; Variable *o_variable; Unit *o_unit; Prefix *o_prefix; bool b_plural; MathFunction *o_function; MathStructure *function_value; QalculateDateTime *o_datetime; ComparisonType ct_comp; bool b_protected; bool b_parentheses; bool isolate_x_sub(const EvaluationOptions &eo, EvaluationOptions &eo2, const MathStructure &x_var, MathStructure *morig = NULL); void init(); public: /** @name Constructors */ //@{ /** Create a new structure, initialized to zero. */ MathStructure(); /** Create a copy of a structure. Child structures are copied. * * @param o The structure to copy. */ MathStructure(const MathStructure &o); /** Create a new numeric structure (value=num/den*10^exp10). Equivalent to MathStructure(Number(num, den, exp10)). * * @param num The numerator of the numeric value. * @param den The denominator of the numeric value. * @param exp10 The base 10 exponent of the numeric value. */ MathStructure(int num, int den = 1, int exp10 = 0); MathStructure(long int num, long int den, long int exp10 = 0L); /** Create a new symbolic/text structure. * * @param sym Symbolic/text value. * @param force_symbol Do not check for undefined or date value. */ MathStructure(string sym, bool force_symbol = false); /** Create a new date and time structure. * * @param sym Date and time value. */ MathStructure(const QalculateDateTime &o_dt); /** Create a new numeric structure with floating point value. Uses Number::setFloat(). * * @param o Numeric value. */ MathStructure(double float_value); /** Create a new vector. * * @param o The first element (copied) in the vector. * @param ... Elements (copied) in the vector. End with NULL. */ MathStructure(const MathStructure *o, ...); /** Create a new function structure. * * @param o Function value. * @param ... Arguments (copied) to the function. End with NULL. */ MathStructure(MathFunction *o, ...); /** Create a new unit structure. * * @param u The unit value. * @param p Prefix of the unit. */ MathStructure(Unit *u, Prefix *p = NULL); /** Create a new variable structure. * * @param o Variable value. */ MathStructure(Variable *o); /** Create a new numeric structure. * * @param o Numeric value. */ MathStructure(const Number &o); ~MathStructure(); //@} /** @name Functions/operators for setting type and content */ //@{ /** Set the structure to a copy of another structure. Child structures are copied. * * @param o The structure to copy. * @param merge_precision Preserve the current precision (unless the new value has a lower precision). */ void set(const MathStructure &o, bool merge_precision = false); /** Set the structure to a copy of another structure. Pointers to child structures are copied. * * @param o The structure to copy. * @param merge_precision Preserve the current precision (unless the new value has a lower precision). */ void set_nocopy(MathStructure &o, bool merge_precision = false); /** Set the structure to a number (num/den*10^exp10). Equivalent to set(Number(num, den, exp10), precerve_precision). * * @param num The numerator of the new numeric value. * @param den The denominator of the new numeric value. * @param exp10 The base 10 exponent of the new numeric value. * @param preserve_precision Preserve the current precision (unless the new value has a lower precision). */ void set(int num, int den = 1, int exp10 = 0, bool preserve_precision = false); void set(long int num, long int den, long int exp10 = 0L, bool preserve_precision = false); /** Set the structure to a symbolic/text value. * * @param o The new symolic/text value. * @param preserve_precision Preserve the current precision. * @param force_symbol Do not check for undefined or date value. */ void set(string sym, bool preserve_precision = false, bool force_symbol = false); /** Set the structure to a date and time value. * * @param o The new data and time value. * @param preserve_precision Preserve the current precision. */ void set(const QalculateDateTime &o_dt, bool preserve_precision = false); /** Set the structure to a number with a floating point value. Uses Number::setFloat(). * * @param o The new numeric value. * @param preserve_precision Preserve the current precision (unless the new value has a lower precision). */ void set(double float_value, bool preserve_precision = false); /** Set the structure to a vector. * * @param o The first element (copied) in the new vector. * @param ... Elements (copied) in the new vector. End with NULL. */ void setVector(const MathStructure *o, ...); /** Set the structure to a mathematical function. * * @param o The new function value. * @param ... Arguments (copied) to the function. End with NULL. */ void set(MathFunction *o, ...); /** Set the structure to a unit. * * @param u The new unit value. * @param p Prefix of the unit. * @param preserve_precision Preserve the current precision (unless the new value has a lower precision). */ void set(Unit *u, Prefix *p = NULL, bool preserve_precision = false); /** Set the structure to a variable. * * @param o The new variable value. * @param preserve_precision Preserve the current precision. */ void set(Variable *o, bool preserve_precision = false); /** Set the structure to a number. * * @param o The new numeric value. * @param preserve_precision Preserve the current precision (unless the new value has a lower precision). */ void set(const Number &o, bool preserve_precision = false); /** Set the value of the structure to undefined. * * @param preserve_precision Preserve the current precision. */ void setUndefined(bool preserve_precision = false); /** Mark that calculation was aborted. * * @param preserve_precision Preserve the current precision. */ void setAborted(bool preserve_precision = false); /** Reset the value (to zero) and parameters of the structure. * * @param preserve_precision Preserve the current precision. */ void clear(bool preserve_precision = false); /** Set the structure to an empty vector. * * @param preserve_precision Preserve the current precision. */ void clearVector(bool preserve_precision = false); /** Set the structure to an empty matrix. * * @param preserve_precision Preserve the current precision. */ void clearMatrix(bool preserve_precision = false); /** Explicitely sets the type of the structure. * setType() is dangerous and might crash the program if used unwisely. * * @param mtype The new structure type */ void setType(StructureType mtype); void operator = (const MathStructure &o); void operator = (const Number &o); void operator = (int i); void operator = (Unit *u); void operator = (Variable *v); void operator = (string sym); //@} /** @name Functions to keep track of referrers */ //@{ void ref(); void unref(); size_t refcount() const; //@} /** @name Functions for numbers */ //@{ const Number &number() const; Number &number(); void numberUpdated(); //@} /** @name Functions for symbols */ //@{ const string &symbol() const; //@} /** @name Functions for date and time */ //@{ const QalculateDateTime *datetime() const; QalculateDateTime *datetime(); //@} /** @name Functions for units */ //@{ Unit *unit() const; Unit *unit_exp_unit() const; Prefix *prefix() const; Prefix *unit_exp_prefix() const; void setPrefix(Prefix *p); bool isPlural() const; void setPlural(bool is_plural); void setUnit(Unit *u); //@} /** @name Functions for mathematical functions */ //@{ void setFunction(MathFunction *f); MathFunction *function() const; const MathStructure *functionValue() const; //@} /** @name Functions for variables */ //@{ void setVariable(Variable *v); Variable *variable() const; //@} /** @name Functions for nested structures (power, muliplication, addition, vector, etc) */ //@{ /** Call this function when you have updated a child. Updates the precision. * * @param index Index (starting at 1) of the updated child. * @recursive If true, do the same for each child of the child. */ void childUpdated(size_t index, bool recursive = false); /** Call this function when you have updated children. Updates the precision. * * @recursive If true, do the same for each child of the children. */ void childrenUpdated(bool recursive = false); /** Returns a child. Does not check if a child exists at the index. * * @param index Index (starting at zero). */ MathStructure &operator [] (size_t index); /** Returns a child. Does not check if a child exists at the index. * * @param index Index (starting at zero). */ const MathStructure &operator [] (size_t index) const; MathStructure &last(); const MathStructure last() const; void setToChild(size_t index, bool merge_precision = false, MathStructure *mparent = NULL, size_t index_this = 1); void swapChildren(size_t index1, size_t index2); void childToFront(size_t index); void addChild(const MathStructure &o); void addChild_nocopy(MathStructure *o); void delChild(size_t index, bool check_size = false); void insertChild(const MathStructure &o, size_t index); void insertChild_nocopy(MathStructure *o, size_t index); void setChild(const MathStructure &o, size_t index = 1, bool merge_precision = false); void setChild_nocopy(MathStructure *o, size_t index = 1, bool merge_precision = false); const MathStructure *getChild(size_t index) const; MathStructure *getChild(size_t index); size_t countChildren() const; size_t countTotalChildren(bool count_function_as_one = true) const; size_t size() const; //@} /** @name Functions for power */ //@{ const MathStructure *base() const; const MathStructure *exponent() const; MathStructure *base(); MathStructure *exponent(); //@} /** @name Functions for comparisons */ //@{ ComparisonType comparisonType() const; void setComparisonType(ComparisonType comparison_type); //@} /** @name Functions checking type and value */ //@{ StructureType type() const; bool isAddition() const; bool isMultiplication() const; bool isPower() const; bool isSymbolic() const; bool isDateTime() const; bool isAborted() const; bool isEmptySymbol() const; bool isVector() const; bool isMatrix() const; bool isFunction() const; bool isUnit() const; bool isUnit_exp() const; bool isUnknown() const; bool isUnknown_exp() const; bool isNumber_exp() const; bool isVariable() const; bool isComparison() const; bool isBitwiseAnd() const; bool isBitwiseOr() const; bool isBitwiseXor() const; bool isBitwiseNot() const; bool isLogicalAnd() const; bool isLogicalOr() const; bool isLogicalXor() const; bool isLogicalNot() const; bool isInverse() const; bool isDivision() const; bool isNegate() const; bool isInfinity() const; bool isUndefined() const; bool isInteger() const; bool isInfinite(bool ignore_imag = true) const; bool isNumber() const; bool isZero() const; bool isApproximatelyZero() const; bool isOne() const; bool isMinusOne() const; bool hasNegativeSign() const; bool representsBoolean() const; bool representsPositive(bool allow_units = false) const; bool representsNegative(bool allow_units = false) const; bool representsNonNegative(bool allow_units = false) const; bool representsNonPositive(bool allow_units = false) const; bool representsInteger(bool allow_units = false) const; bool representsNonInteger(bool allow_units = false) const; bool representsNumber(bool allow_units = false) const; bool representsRational(bool allow_units = false) const; bool representsFraction(bool allow_units = false) const; bool representsReal(bool allow_units = false) const; bool representsNonComplex(bool allow_units = false) const; bool representsComplex(bool allow_units = false) const; bool representsNonZero(bool allow_units = false) const; bool representsZero(bool allow_units = false) const; bool representsApproximatelyZero(bool allow_units = false) const; bool representsEven(bool allow_units = false) const; bool representsOdd(bool allow_units = false) const; bool representsUndefined(bool include_children = false, bool include_infinite = false, bool be_strict = false) const; bool representsNonMatrix() const; bool representsScalar() const; //@} /** @name Functions for precision */ //@{ void setApproximate(bool is_approx = true, bool recursive = false); bool isApproximate() const; void setPrecision(int prec, bool recursive = false); int precision() const; void mergePrecision(const MathStructure &o); void mergePrecision(bool approx, int prec); //@} /** @name Operators for structural transformations and additions * These operators transforms or adds to the structure without doing any calculations */ //@{ MathStructure operator - () const; MathStructure operator * (const MathStructure &o) const; MathStructure operator / (const MathStructure &o) const; MathStructure operator + (const MathStructure &o) const; MathStructure operator - (const MathStructure &o) const; MathStructure operator ^ (const MathStructure &o) const; MathStructure operator && (const MathStructure &o) const; MathStructure operator || (const MathStructure &o) const; MathStructure operator ! () const; void operator *= (const MathStructure &o); void operator /= (const MathStructure &o); void operator += (const MathStructure &o); void operator -= (const MathStructure &o); void operator ^= (const MathStructure &o); void operator *= (const Number &o); void operator /= (const Number &o); void operator += (const Number &o); void operator -= (const Number &o); void operator ^= (const Number &o); void operator *= (int i); void operator /= (int i); void operator += (int i); void operator -= (int i); void operator ^= (int i); void operator *= (Unit *u); void operator /= (Unit *u); void operator += (Unit *u); void operator -= (Unit *u); void operator ^= (Unit *u); void operator *= (Variable *v); void operator /= (Variable *v); void operator += (Variable *v); void operator -= (Variable *v); void operator ^= (Variable *v); void operator *= (string sym); void operator /= (string sym); void operator += (string sym); void operator -= (string sym); void operator ^= (string sym); //@} /** @name Functions for structural transformations and additions * These functions transforms or adds to the structure without doing any calculations */ //@{ void add(const MathStructure &o, MathOperation op, bool append = false); void add(const MathStructure &o, bool append = false); void subtract(const MathStructure &o, bool append = false); void multiply(const MathStructure &o, bool append = false); void divide(const MathStructure &o, bool append = false); void raise(const MathStructure &o); void add(const Number &o, bool append = false); void subtract(const Number &o, bool append = false); void multiply(const Number &o, bool append = false); void divide(const Number &o, bool append = false); void raise(const Number &o); void add(int i, bool append = false); void subtract(int i, bool append = false); void multiply(int i, bool append = false); void divide(int i, bool append = false); void raise(int i); void add(Variable *v, bool append = false); void subtract(Variable *v, bool append = false); void multiply(Variable *v, bool append = false); void divide(Variable *v, bool append = false); void raise(Variable *v); void add(Unit *u, bool append = false); void subtract(Unit *u, bool append = false); void multiply(Unit *u, bool append = false); void divide(Unit *u, bool append = false); void raise(Unit *u); void add(string sym, bool append = false); void subtract(string sym, bool append = false); void multiply(string sym, bool append = false); void divide(string sym, bool append = false); void raise(string sym); void add_nocopy(MathStructure *o, MathOperation op, bool append = false); void add_nocopy(MathStructure *o, bool append = false); void subtract_nocopy(MathStructure *o, bool append = false); void multiply_nocopy(MathStructure *o, bool append = false); void divide_nocopy(MathStructure *o, bool append = false); void raise_nocopy(MathStructure *o); void inverse(); void negate(); void setLogicalNot(); void setBitwiseNot(); void transform(StructureType mtype, const MathStructure &o); void transform(StructureType mtype, const Number &o); void transform(StructureType mtype, int i); void transform(StructureType mtype, Unit *u); void transform(StructureType mtype, Variable *v); void transform(StructureType mtype, string sym); void transform_nocopy(StructureType mtype, MathStructure *o); void transform(StructureType mtype); void transform(MathFunction *o); void transform(ComparisonType ctype, const MathStructure &o); //@} /** @name Functions/operators for comparisons */ //@{ bool equals(const MathStructure &o, bool allow_interval = false, bool allow_infinity = false) const; bool equals(const Number &o, bool allow_interval = false, bool allow_infinity = false) const; bool equals(int i) const; bool equals(Unit *u) const; bool equals(Variable *v) const; bool equals(string sym) const; ComparisonResult compare(const MathStructure &o) const; ComparisonResult compareApproximately(const MathStructure &o, const EvaluationOptions &eo = default_evaluation_options) const; bool mergeInterval(const MathStructure &o, bool set_to_overlap = false); bool operator == (const MathStructure &o) const; bool operator == (const Number &o) const; bool operator == (int i) const; bool operator == (Unit *u) const; bool operator == (Variable *v) const; bool operator == (string sym) const; bool operator != (const MathStructure &o) const; //@} /** @name Functions for calculation/evaluation */ //@{ MathStructure &eval(const EvaluationOptions &eo = default_evaluation_options); bool calculateMergeIndex(size_t index, const EvaluationOptions &eo, const EvaluationOptions &feo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalOrLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalOrIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalXorLast(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalAndLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalAndIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateLogicalNot(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseNot(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateInverse(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateNegate(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateRaiseExponent(const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateRaise(const MathStructure &mexp, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseOrLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseOrIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseXorLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseXorIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseAndLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseAndIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateBitwiseAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateMultiplyLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateMultiplyIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateMultiply(const MathStructure &mmul, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateDivide(const MathStructure &mdiv, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateAddLast(const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateAddIndex(size_t index, const EvaluationOptions &eo, bool check_size = true, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateAdd(const MathStructure &madd, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateSubtract(const MathStructure &msub, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1); bool calculateFunctions(const EvaluationOptions &eo, bool recursive = true, bool do_unformat = true); int merge_addition(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_multiplication(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false, bool do_append = true); int merge_power(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_logical_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_logical_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_logical_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_bitwise_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_bitwise_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); int merge_bitwise_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent = NULL, size_t index_this = 1, size_t index_that = 2, bool reversed = false); bool calculatesub(const EvaluationOptions &eo, const EvaluationOptions &feo, bool recursive = true, MathStructure *mparent = NULL, size_t index_this = 1); void evalSort(bool recursive = false, bool absolute = false); bool integerFactorize(); //@} /** @name Functions for protection from changes when evaluating */ //@{ void setProtected(bool do_protect = true); bool isProtected() const; //@} /** @name Functions for format and display */ //@{ void sort(const PrintOptions &po = default_print_options, bool recursive = true); bool improve_division_multipliers(const PrintOptions &po = default_print_options); void setPrefixes(const PrintOptions &po = default_print_options, MathStructure *parent = NULL, size_t pindex = 0); void prefixCurrencies(); void format(const PrintOptions &po = default_print_options); void formatsub(const PrintOptions &po = default_print_options, MathStructure *parent = NULL, size_t pindex = 0, bool recursive = true, MathStructure *top_parent = NULL); void postFormatUnits(const PrintOptions &po = default_print_options, MathStructure *parent = NULL, size_t pindex = 0); bool factorizeUnits(); void unformat(const EvaluationOptions &eo = default_evaluation_options); bool needsParenthesis(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool flat_division = true, bool flat_power = true) const; int neededMultiplicationSign(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool par, bool par_prev, bool flat_division = true, bool flat_power = true) const; string print(const PrintOptions &po = default_print_options, const InternalPrintStruct &ips = top_ips) const; //@} /** @name Functions for vectors */ //@{ MathStructure &flattenVector(MathStructure &mstruct) const; bool rankVector(bool ascending = true); bool sortVector(bool ascending = true); MathStructure &getRange(int start, int end, MathStructure &mstruct) const; void resizeVector(size_t i, const MathStructure &mfill); //@} /** @name Functions for matrices */ //@{ size_t rows() const; size_t columns() const; const MathStructure *getElement(size_t row, size_t column) const; MathStructure *getElement(size_t row, size_t column); MathStructure &getArea(size_t r1, size_t c1, size_t r2, size_t c2, MathStructure &mstruct) const; MathStructure &rowToVector(size_t r, MathStructure &mstruct) const; MathStructure &columnToVector(size_t c, MathStructure &mstruct) const; MathStructure &matrixToVector(MathStructure &mstruct) const; void setElement(const MathStructure &mstruct, size_t row, size_t column); void addRows(size_t r, const MathStructure &mfill); void addColumns(size_t c, const MathStructure &mfill); void addRow(const MathStructure &mfill); void addColumn(const MathStructure &mfill); void resizeMatrix(size_t r, size_t c, const MathStructure &mfill); bool matrixIsSquare() const; bool isNumericMatrix() const; int pivot(size_t ro, size_t co, bool symbolic = true); int gaussianElimination(const EvaluationOptions &eo = default_evaluation_options, bool det = false); MathStructure &determinant(MathStructure &mstruct, const EvaluationOptions &eo) const; MathStructure &permanent(MathStructure &mstruct, const EvaluationOptions &eo) const; void setToIdentityMatrix(size_t n); MathStructure &getIdentityMatrix(MathStructure &mstruct) const; bool invertMatrix(const EvaluationOptions &eo); bool adjointMatrix(const EvaluationOptions &eo); bool transposeMatrix(); MathStructure &cofactor(size_t r, size_t c, MathStructure &mstruct, const EvaluationOptions &eo) const; //@} /** @name Functions for unit conversion */ //@{ int isUnitCompatible(const MathStructure &mstruct) const; bool syncUnits(bool sync_complex_relations = false, bool *found_complex_relations = NULL, bool calculate_new_functions = false, const EvaluationOptions &feo = default_evaluation_options); bool testDissolveCompositeUnit(Unit *u); bool testCompositeUnit(Unit *u); bool dissolveAllCompositeUnits(); bool setPrefixForUnit(Unit *u, Prefix *new_prefix); bool convertToBaseUnits(bool convert_complex_relations = false, bool *found_complex_relations = NULL, bool calculate_new_functions = false, const EvaluationOptions &feo = default_evaluation_options); bool convert(Unit *u, bool convert_complex_relations = false, bool *found_complex_relations = NULL, bool calculate_new_functions = false, const EvaluationOptions &feo = default_evaluation_options, Prefix *new_prefix = NULL); bool convert(const MathStructure unit_mstruct, bool convert_complex_relations = false, bool *found_complex_relations = NULL, bool calculate_new_functions = false, const EvaluationOptions &feo = default_evaluation_options); //@} /** @name Functions for recursive search and replace */ //@{ int contains(const MathStructure &mstruct, bool structural_only = true, bool check_variables = false, bool check_functions = false, bool loose_equals = false) const; size_t countOccurrences(const MathStructure &mstruct) const; int containsRepresentativeOf(const MathStructure &mstruct, bool check_variables = false, bool check_functions = false) const; int containsType(StructureType mtype, bool structural_only = true, bool check_variables = false, bool check_functions = false) const; int containsRepresentativeOfType(StructureType mtype, bool check_variables = false, bool check_functions = false) const; int containsFunction(MathFunction *f, bool structural_only = true, bool check_variables = false, bool check_functions = false) const; int containsInterval(bool structural_only = true, bool check_variables = false, bool check_functions = false, bool ignore_high_precision_interval = false, bool include_interval_function = false) const; int containsInfinity(bool structural_only = true, bool check_variables = false, bool check_functions = false) const; bool containsOpaqueContents() const; bool containsAdditionPower() const; bool containsUnknowns() const; bool containsDivision() const; size_t countFunctions(bool count_subfunctions = true) const; void findAllUnknowns(MathStructure &unknowns_vector); bool replace(const MathStructure &mfrom, const MathStructure &mto, bool once_only = false); bool calculateReplace(const MathStructure &mfrom, const MathStructure &mto, const EvaluationOptions &eo); bool replace(const MathStructure &mfrom1, const MathStructure &mto1, const MathStructure &mfrom2, const MathStructure &mto2); bool removeType(StructureType mtype); //@} /** @name Functions to generate vectors for plotting */ //@{ MathStructure generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector = NULL, const EvaluationOptions &eo = default_evaluation_options) const; MathStructure generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector = NULL, const EvaluationOptions &eo = default_evaluation_options) const; MathStructure generateVector(MathStructure x_mstruct, const MathStructure &x_vector, const EvaluationOptions &eo = default_evaluation_options) const; //@} /** @name Differentiation and integration */ //@{ bool differentiate(const MathStructure &x_var, const EvaluationOptions &eo); int integrate(const MathStructure &x_var, const EvaluationOptions &eo, bool simplify_first = true, int use_abs = 1, bool definite_integral = false, bool try_abs = true, int max_part_depth = 5, vector *parent_parts = NULL); //@} /** @name Functions for polynomials */ //@{ bool simplify(const EvaluationOptions &eo = default_evaluation_options, bool unfactorize = true); bool factorize(const EvaluationOptions &eo = default_evaluation_options, bool unfactorize = true, int term_combination_levels = 0, int max_msecs = 1000, bool only_integers = true, int recursive = 1, struct timeval *endtime_p = NULL, const MathStructure &force_factorization = m_undefined, bool complete_square = false, bool only_sqrfree = false, int max_degree_factor = -1); bool expandPartialFractions(const EvaluationOptions &eo); bool structure(StructuringMode structuring, const EvaluationOptions &eo, bool restore_first = true); /** If the structure represents a rational polynomial. * This is true for * - rational numbers; * - functions, units, variables and symbols that do not represent a matrix or undefined; * - a power with a positive integer exponent and any of the previous as base; * - a multiplication with the previous as factors; or * - an addition with the previous as terms. * * @returns true if structure represents a rational polynomial. */ bool isRationalPolynomial(bool allow_non_rational_coefficient = false, bool allow_interval_coefficient = false) const; const Number &overallCoefficient() const; const Number °ree(const MathStructure &xvar) const; const Number &ldegree(const MathStructure &xvar) const; void lcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const; void tcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const; void coefficient(const MathStructure &xvar, const Number &pownr, MathStructure &mcoeff) const; Number maxCoefficient(); int polynomialUnit(const MathStructure &xvar) const; void polynomialContent(const MathStructure &xvar, MathStructure &mcontent, const EvaluationOptions &eo) const; void polynomialPrimpart(const MathStructure &xvar, MathStructure &mprim, const EvaluationOptions &eo) const; void polynomialPrimpart(const MathStructure &xvar, const MathStructure &c, MathStructure &mprim, const EvaluationOptions &eo) const; void polynomialUnitContentPrimpart(const MathStructure &xvar, int &munit, MathStructure &mcontent, MathStructure &mprim, const EvaluationOptions &eo) const; //@} /** @name Functions for conversion of complex numbers */ //@{ bool complexToExponentialForm(const EvaluationOptions &eo); bool complexToPolarForm(const EvaluationOptions &eo); //@} bool calculateLimit(const MathStructure &x_var, const MathStructure &limit, const EvaluationOptions &eo_pre, int approach_direction = 0); bool decomposeFractions(const MathStructure &x_var, const EvaluationOptions &eo); static bool polynomialDivide(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args = true); static bool polynomialQuotient(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args = true); static bool lcm(const MathStructure &m1, const MathStructure &m2, MathStructure &mlcm, const EvaluationOptions &eo, bool check_args = true); static bool gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mresult, const EvaluationOptions &eo, MathStructure *ca = NULL, MathStructure *cb = NULL, bool check_args = true); /** @name Functions for equations */ //@{ const MathStructure &find_x_var() const; bool isolate_x(const EvaluationOptions &eo, const MathStructure &x_var = m_undefined, bool check_result = false); bool isolate_x(const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_var = m_undefined, bool check_result = false); //@} bool inParentheses() const; void setInParentheses(bool b = true); }; ostream& operator << (ostream &os, const MathStructure&); #endif libqalculate-2.8.2/libqalculate/includes.h0000644000175000017500000010734113360071050015530 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef INCLUDES_H #define INCLUDES_H /** @file */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define QALCULATE_MAJOR_VERSION (2) #define QALCULATE_MINOR_VERSION (6) #define QALCULATE_MICRO_VERSION (0) /// \cond using namespace std; /// \endcond static string empty_string; struct ExpressionName; class Calculator; class MathStructure; class Manager; class Unit; class Variable; class KnownVariable; class UnknownVariable; class Assumptions; class DynamicVariable; class ExpressionItem; class Number; class Prefix; class DecimalPrefix; class BinaryPrefix; class NumberPrefix; class CompositeUnit; class AliasUnit; class AliasUnit_Composite; class MathFunction; class Matrix; class Vector; class UserFunction; class EqItem; class EqNumber; class EqContainer; class Argument; class DataSet; class DataProperty; class DataObject; /// Type of ExpressionItem typedef enum { /// class Variable TYPE_VARIABLE, /// class MathFunction TYPE_FUNCTION, /// class Unit TYPE_UNIT } ExpressionItemType; #define COMPARISON_MIGHT_BE_LESS_OR_GREATER(i) (i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_NOT_EQUAL) #define COMPARISON_NOT_FULLY_KNOWN(i) (i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER) #define COMPARISON_IS_EQUAL_OR_GREATER(i) (i == COMPARISON_RESULT_EQUAL || i == COMPARISON_RESULT_GREATER || i == COMPARISON_RESULT_EQUAL_OR_GREATER) #define COMPARISON_IS_EQUAL_OR_LESS(i) (i == COMPARISON_RESULT_EQUAL || i == COMPARISON_RESULT_LESS || i == COMPARISON_RESULT_EQUAL_OR_LESS) #define COMPARISON_IS_NOT_EQUAL(i) (i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_LESS || i == COMPARISON_RESULT_GREATER) #define COMPARISON_MIGHT_BE_EQUAL(i) (i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER) #define COMPARISON_MIGHT_BE_NOT_EQUAL(i) (i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER) #define NR_OF_PRIMES 600 static const long int PRIMES[] = { 2L, 3L, 5L, 7L, 11L, 13L, 17L, 19L, 23L, 29L, 31L, 37L, 41L, 43L, 47L, 53L, 59L, 61L, 67L, 71L, 73L, 79L, 83L, 89L, 97L, 101L, 103L, 107L, 109L, 113L, 127L, 131L, 137L, 139L, 149L, 151L, 157L, 163L, 167L, 173L, 179L, 181L, 191L, 193L, 197L, 199L, 211L, 223L, 227L, 229L, 233L, 239L, 241L, 251L, 257L, 263L, 269L, 271L, 277L, 281L, 283L, 293L, 307L, 311L, 313L, 317L, 331L, 337L, 347L, 349L, 353L, 359L, 367L, 373L, 379L, 383L, 389L, 397L, 401L, 409L, 419L, 421L, 431L, 433L, 439L, 443L, 449L, 457L, 461L, 463L, 467L, 479L, 487L, 491L, 499L, 503L, 509L, 521L, 523L, 541L, 547L, 557L, 563L, 569L, 571L, 577L, 587L, 593L, 599L, 601L, 607L, 613L, 617L, 619L, 631L, 641L, 643L, 647L, 653L, 659L, 661L, 673L, 677L, 683L, 691L, 701L, 709L, 719L, 727L, 733L, 739L, 743L, 751L, 757L, 761L, 769L, 773L, 787L, 797L, 809L, 811L, 821L, 823L, 827L, 829L, 839L, 853L, 857L, 859L, 863L, 877L, 881L, 883L, 887L, 907L, 911L, 919L, 929L, 937L, 941L, 947L, 953L, 967L, 971L, 977L, 983L, 991L, 997L, 1009L, 1013L, 1019L, 1021L, 1031L, 1033L, 1039L, 1049L, 1051L, 1061L, 1063L, 1069L, 1087L, 1091L, 1093L, 1097L, 1103L, 1109L, 1117L, 1123L, 1129L, 1151L, 1153L, 1163L, 1171L, 1181L, 1187L, 1193L, 1201L, 1213L, 1217L, 1223L, 1229L, 1231L, 1237L, 1249L, 1259L, 1277L, 1279L, 1283L, 1289L, 1291L, 1297L, 1301L, 1303L, 1307L, 1319L, 1321L, 1327L, 1361L, 1367L, 1373L, 1381L, 1399L, 1409L, 1423L, 1427L, 1429L, 1433L, 1439L, 1447L, 1451L, 1453L, 1459L, 1471L, 1481L, 1483L, 1487L, 1489L, 1493L, 1499L, 1511L, 1523L, 1531L, 1543L, 1549L, 1553L, 1559L, 1567L, 1571L, 1579L, 1583L, 1597L, 1601L, 1607L, 1609L, 1613L, 1619L, 1621L, 1627L, 1637L, 1657L, 1663L, 1667L, 1669L, 1693L, 1697L, 1699L, 1709L, 1721L, 1723L, 1733L, 1741L, 1747L, 1753L, 1759L, 1777L, 1783L, 1787L, 1789L, 1801L, 1811L, 1823L, 1831L, 1847L, 1861L, 1867L, 1871L, 1873L, 1877L, 1879L, 1889L, 1901L, 1907L, 1913L, 1931L, 1933L, 1949L, 1951L, 1973L, 1979L, 1987L, 1993L, 1997L, 1999L, 2003L, 2011L, 2017L, 2027L, 2029L, 2039L, 2053L, 2063L, 2069L, 2081L, 2083L, 2087L, 2089L, 2099L, 2111L, 2113L, 2129L, 2131L, 2137L, 2141L, 2143L, 2153L, 2161L, 2179L, 2203L, 2207L, 2213L, 2221L, 2237L, 2239L, 2243L, 2251L, 2267L, 2269L, 2273L, 2281L, 2287L, 2293L, 2297L, 2309L, 2311L, 2333L, 2339L, 2341L, 2347L, 2351L, 2357L, 2371L, 2377L, 2381L, 2383L, 2389L, 2393L, 2399L, 2411L, 2417L, 2423L, 2437L, 2441L, 2447L, 2459L, 2467L, 2473L, 2477L, 2503L, 2521L, 2531L, 2539L, 2543L, 2549L, 2551L, 2557L, 2579L, 2591L, 2593L, 2609L, 2617L, 2621L, 2633L, 2647L, 2657L, 2659L, 2663L, 2671L, 2677L, 2683L, 2687L, 2689L, 2693L, 2699L, 2707L, 2711L, 2713L, 2719L, 2729L, 2731L, 2741L, 2749L, 2753L, 2767L, 2777L, 2789L, 2791L, 2797L, 2801L, 2803L, 2819L, 2833L, 2837L, 2843L, 2851L, 2857L, 2861L, 2879L, 2887L, 2897L, 2903L, 2909L, 2917L, 2927L, 2939L, 2953L, 2957L, 2963L, 2969L, 2971L, 2999L, 3001L, 3011L, 3019L, 3023L, 3037L, 3041L, 3049L, 3061L, 3067L, 3079L, 3083L, 3089L, 3109L, 3119L, 3121L, 3137L, 3163L, 3167L, 3169L, 3181L, 3187L, 3191L, 3203L, 3209L, 3217L, 3221L, 3229L, 3251L, 3253L, 3257L, 3259L, 3271L, 3299L, 3301L, 3307L, 3313L, 3319L, 3323L, 3329L, 3331L, 3343L, 3347L, 3359L, 3361L, 3371L, 3373L, 3389L, 3391L, 3407L, 3413L, 3433L, 3449L, 3457L, 3461L, 3463L, 3467L, 3469L, 3491L, 3499L, 3511L, 3517L, 3527L, 3529L, 3533L, 3539L, 3541L, 3547L, 3557L, 3559L, 3571L, 3581L, 3583L, 3593L, 3607L, 3613L, 3617L, 3623L, 3631L, 3637L, 3643L, 3659L, 3671L, 3673L, 3677L, 3691L, 3697L, 3701L, 3709L, 3719L, 3727L, 3733L, 3739L, 3761L, 3767L, 3769L, 3779L, 3793L, 3797L, 3803L, 3821L, 3823L, 3833L, 3847L, 3851L, 3853L, 3863L, 3877L, 3881L, 3889L, 3907L, 3911L, 3917L, 3919L, 3923L, 3929L, 3931L, 3943L, 3947L, 3967L, 3989L, 4001L, 4003L, 4007L, 4013L, 4019L, 4021L, 4027L, 4049L, 4051L, 4057L, 4073L, 4079L, 4091L, 4093L, 4099L, 4111L, 4127L, 4129L, 4133L, 4139L, 4153L, 4157L, 4159L, 4177L, 4201L, 4211L, 4217L, 4219L, 4229L, 4231L, 4241L, 4243L, 4253L, 4259L, 4261L, 4271L, 4273L, 4283L, 4289L, 4297L, 4327L, 4337L, 4339L, 4349L, 4357L, 4363L, 4373L, 4391L, 4397L, 4409L }; #define SQP_LT_1000 11 #define SQP_LT_2000 17 #define SQP_LT_10000 28 #define SQP_LT_25000 40 #define SQP_LT_100000 68 #define NR_OF_SQUARE_PRIMES 170 static const long int SQUARE_PRIMES[] = { 4L, 9L, 25L, 49L, 121L, 169L, 289L, 361L, 529L, 841L, 961L, 1369L, 1681L, 1849L, 2209L, 2809L, 3481L, 3721L, 4489L, 5041L, 5329L, 6241L, 6889L, 7921L, 9409L, 10201L, 10609L, 11449L, 11881L, 12769L, 16129L, 17161L, 18769L, 19321L, 22201L, 22801L, 24649L, 26569L, 27889L, 29929L, 32041L, 32761L, 36481L, 37249L, 38809L, 39601L, 44521L, 49729L, 51529L, 52441L, 54289L, 57121L, 58081L, 63001L, 66049L, 69169L, 72361L, 73441L, 76729L, 78961L, 80089L, 85849L, 94249L, 96721L, 97969L, 100489L, 109561L, 113569L, 120409L, 121801L, 124609L, 128881L, 134689L, 139129L, 143641L, 146689L, 151321L, 157609L, 160801L, 167281L, 175561L, 177241L, 185761L, 187489L, 192721L, 196249L, 201601L, 208849L, 212521L, 214369L, 218089L, 229441L, 237169L, 241081L, 249001L, 253009L, 259081L, 271441L, 273529L, 292681L, 299209L, 310249L, 316969L, 323761L, 326041L, 332929L, 344569L, 351649L, 358801L, 361201L, 368449L, 375769L, 380689L, 383161L, 398161L, 410881L, 413449L, 418609L, 426409L, 434281L, 436921L, 452929L, 458329L, 466489L, 477481L, 491401L, 502681L, 516961L, 528529L, 537289L, 546121L, 552049L, 564001L, 573049L, 579121L, 591361L, 597529L, 619369L, 635209L, 654481L, 657721L, 674041L, 677329L, 683929L, 687241L, 703921L, 727609L, 734449L, 737881L, 744769L, 769129L, 776161L, 779689L, 786769L, 822649L, 829921L, 844561L, 863041L, 877969L, 885481L, 896809L, 908209L, 935089L, 942841L, 954529L, 966289L, 982081L, 994009L, 1018081L, 1026169L }; #define LARGEST_RAISED_PRIME_EXPONENT 10 static const long int RAISED_PRIMES[][49] = { {8L, 27L, 125L, 343L, 1331L, 2197, 4913, 6859, 12167L, 24389L, 29791L, 50653L, 68921L, 79507L, 103823L, 148877L, 205379L, 226981L, 300763L, 357911L, 389017L, 493039L, 571787L, 704969L, 912673L, 1030301L, 1092727L, 1225043L, 1295029, 1442897, 2048383L, 2248091L, 2571353L, 2685619L, 3307949L, 3442951L, 3869893L, 4330747L, 4657463L, 5177717L, 5735339L, 5929741L, 6967871L, 7189057L, 7645373L, 7880599L, 9393931L, 11089567L, 0}, {16L, 81L, 625L, 2401L, 14641L, 28561L, 83521L, 130321L, 279841L, 707281L, 923521L, 1874161L, 2825761L, 3418801L, 4879681L, 7890481L, 12117361L, 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, 0, 0, 0, 0, 0, 0}, {32L, 243L, 3125L, 16807L, 161051L, 371293L, 1419857L, 2476099L, 6436343L, 20511149L, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {64L, 729L, 15625L, 117649L, 1771561L, 4826809L, 24137569L, 47045881L, 148035889L, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {128L, 2187L, 78125L, 823543L, 19487171L, 62748517L, 410338673L, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {256L, 6561L, 390625L, 5764801L, 214358881L, 815730721L, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {512L, 19683L, 1953125L, 40353607L, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1024L, 59049L, 9765625L, 282475249L, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }; /// The result of a comparison of two values typedef enum { COMPARISON_RESULT_EQUAL, COMPARISON_RESULT_GREATER, COMPARISON_RESULT_LESS, COMPARISON_RESULT_EQUAL_OR_GREATER, COMPARISON_RESULT_EQUAL_OR_LESS, COMPARISON_RESULT_NOT_EQUAL, COMPARISON_RESULT_UNKNOWN, COMPARISON_RESULT_EQUAL_LIMITS, COMPARISON_RESULT_CONTAINS, COMPARISON_RESULT_CONTAINED, COMPARISON_RESULT_OVERLAPPING_LESS, COMPARISON_RESULT_OVERLAPPING_GREATER } ComparisonResult; /// Placement of legend typedef enum { PLOT_LEGEND_NONE, PLOT_LEGEND_TOP_LEFT, PLOT_LEGEND_TOP_RIGHT, PLOT_LEGEND_BOTTOM_LEFT, PLOT_LEGEND_BOTTOM_RIGHT, PLOT_LEGEND_BELOW, PLOT_LEGEND_OUTSIDE } PlotLegendPlacement; /// Plot type/style typedef enum { PLOT_STYLE_LINES, PLOT_STYLE_POINTS, PLOT_STYLE_POINTS_LINES, PLOT_STYLE_BOXES, PLOT_STYLE_HISTOGRAM, PLOT_STYLE_STEPS, PLOT_STYLE_CANDLESTICKS, PLOT_STYLE_DOTS } PlotStyle; /// Smoothing a plotted lines typedef enum { PLOT_SMOOTHING_NONE, PLOT_SMOOTHING_UNIQUE, PLOT_SMOOTHING_CSPLINES, PLOT_SMOOTHING_BEZIER, PLOT_SMOOTHING_SBEZIER } PlotSmoothing; /// File type for saving plot to image typedef enum { PLOT_FILETYPE_AUTO, PLOT_FILETYPE_PNG, PLOT_FILETYPE_PS, PLOT_FILETYPE_EPS, PLOT_FILETYPE_LATEX, PLOT_FILETYPE_SVG, PLOT_FILETYPE_FIG, PLOT_FILETYPE_PDF } PlotFileType; /// Mathematical operations typedef enum { OPERATION_MULTIPLY, OPERATION_DIVIDE, OPERATION_ADD, OPERATION_SUBTRACT, OPERATION_RAISE, OPERATION_EXP10, OPERATION_LOGICAL_AND, OPERATION_LOGICAL_OR, OPERATION_LOGICAL_XOR, OPERATION_BITWISE_AND, OPERATION_BITWISE_OR, OPERATION_BITWISE_XOR, OPERATION_LESS, OPERATION_GREATER, OPERATION_EQUALS_LESS, OPERATION_EQUALS_GREATER, OPERATION_EQUALS, OPERATION_NOT_EQUALS } MathOperation; /// Comparison signs for comparison structures typedef enum { COMPARISON_LESS, COMPARISON_GREATER, COMPARISON_EQUALS_LESS, COMPARISON_EQUALS_GREATER, COMPARISON_EQUALS, COMPARISON_NOT_EQUALS } ComparisonType; typedef enum { SORT_DEFAULT = 1 << 0, SORT_SCIENTIFIC = 1 << 1 } SortFlags; #define BASE_ROMAN_NUMERALS -1 #define BASE_TIME -2 #define BASE_BINARY 2 #define BASE_OCTAL 8 #define BASE_DECIMAL 10 #define BASE_DUODECIMAL 12 #define BASE_HEXADECIMAL 16 #define BASE_SEXAGESIMAL 60 #define EXP_BASE_3 -3 #define EXP_PRECISION -1 #define EXP_NONE 0 #define EXP_PURE 1 #define EXP_SCIENTIFIC 3 typedef enum { /// Display numbers in decimal, not fractional, format (ex. 0.333333) FRACTION_DECIMAL, /// Display as fraction if necessary to get an exact display of the result (ex. 1/3, but 0.25) FRACTION_DECIMAL_EXACT, /// Display as fraction (ex. 4/3) FRACTION_FRACTIONAL, /// Display as an integer and a fraction (ex. 3 + 1/2) FRACTION_COMBINED } NumberFractionFormat; /// Options for ordering the parts of a mathematical expression/result before display static const struct SortOptions { /// Put currency units before quantity. Default: true bool prefix_currencies; /// If true, avoid placing negative terms first. Default: true bool minus_last; SortOptions() : prefix_currencies(true), minus_last(true) {} } default_sort_options; typedef enum { MULTIPLICATION_SIGN_ASTERISK, MULTIPLICATION_SIGN_DOT, MULTIPLICATION_SIGN_X, MULTIPLICATION_SIGN_ALTDOT } MultiplicationSign; typedef enum { DIVISION_SIGN_SLASH, DIVISION_SIGN_DIVISION_SLASH, DIVISION_SIGN_DIVISION } DivisionSign; typedef enum { BASE_DISPLAY_NONE, BASE_DISPLAY_NORMAL, BASE_DISPLAY_ALTERNATIVE } BaseDisplay; typedef enum { INTERVAL_DISPLAY_SIGNIFICANT_DIGITS, INTERVAL_DISPLAY_INTERVAL, INTERVAL_DISPLAY_PLUSMINUS, INTERVAL_DISPLAY_MIDPOINT, INTERVAL_DISPLAY_LOWER, INTERVAL_DISPLAY_UPPER } IntervalDisplay; typedef enum { DIGIT_GROUPING_NONE, DIGIT_GROUPING_STANDARD, DIGIT_GROUPING_LOCALE } DigitGrouping; typedef enum { DATE_TIME_FORMAT_ISO, DATE_TIME_FORMAT_LOCALE } DateTimeFormat; typedef enum { TIME_ZONE_UTC, TIME_ZONE_LOCAL, TIME_ZONE_CUSTOM } TimeZone; /// Options for formatting and display of mathematical structures/results. static const struct PrintOptions { int min_exp; /// Number base for displaying numbers. Default: 10 int base; /// How prefixes for numbers in non-decimal bases will be displayed BaseDisplay base_display; /// Use lower case for non-numeric characters for bases > 10. Default: false bool lower_case_numbers; /// Use lower case e for base-10 exponent (ex. 1.2e8 instead of 1.2E8). Default: false bool lower_case_e; /// If rational numbers will be displayed with decimals, as a fraction, or something in between. Default: FRACTION_DECIMAL NumberFractionFormat number_fraction_format; /// Show that the digit series of a number continues forever with three dots, instead of rounding (ex. 2/3 displays as 0.666666... instead of 0.666667). Default: false bool indicate_infinite_series; /// Show ending zeroes for approximate numbers to indicate precision (ex.1.2300000 instead of 1.23) . Default: false bool show_ending_zeroes; /// Prefer abbreviated names of variables, units, functions etc. Default: true bool abbreviate_names; /// Prefer reference names of variables, units, functions etc. Default: false bool use_reference_names; /// Isolate units at the end of the displayed expression (ex. x/y m/s instead of (x m)/(y s)). Default: true bool place_units_separately; /// Use prefixes for units when appropriate. Default: true bool use_unit_prefixes; /// Use prefixes for currencies if unit prefixes are om. Default: false bool use_prefixes_for_all_units; /// Use all decimal SI prefixes. If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will not be used automatically. Default: false bool use_prefixes_for_currencies; /// Use prefixes for all units (even imperial and similar ones). Default: false bool use_all_prefixes; /// If set to true, prefixes will be split between numerator and denominator in a unit expression (millimeter per kilogram instead of micrometer per gram). Default: true bool use_denominator_prefix; /// If true, negative exponents will be used instead of division (ex. 5/x^2 becomes 5*x^-2). Default: false bool negative_exponents; /// Avoid using multiplication sign, when appropriate. Default: true bool short_multiplication; /// Use a format compatible with ParseOptions::limit_implicit_multiplication. Default: false bool limit_implicit_multiplication; /// If it is not necessary that the displayed expression can be parsed correctly. Default: false bool allow_non_usable; /// If unicode signs can be displayed. Default: false bool use_unicode_signs; /// Sign used for display of multiplication. Default: MULTIPLICATION_SIGN_DOT MultiplicationSign multiplication_sign; /// Sign used for display of division. Default: DIVISION_SIGN_DIVISION_SLASH DivisionSign division_sign; /// If space will be used to make the output look nicer. Default: true bool spacious; /// Use parentheses even when not necessary. Default: false bool excessive_parenthesis; /// Transform raised to 1/2 to square root function. Default: true bool halfexp_to_sqrt; /// Minimum number of decimals to display for numbers. Default: 0 int min_decimals; /// Maximum number of decimals to display for numbers. A negative value disables the limit. Default: -1 int max_decimals; /// Enable use of min_decimals. False is equivalent to a min_decimals value of zero. Default: true bool use_min_decimals; /// Enable use of max_decimals. False is equivalent to a negative max_decimals value. Default: true bool use_max_decimals; /// If true round halfway numbers to nearest even number, otherwise round upwards. Default: false bool round_halfway_to_even; /// Multiply numerator and denominator to get integers (ex. (6x+y)/2z instead of (3x+0.5y)/z). Default: true bool improve_division_multipliers; /// Force use of a specific prefix for units if not NULL. Default: NULL Prefix *prefix; /// If not NULL will be set to true if the output is approximate. Default: NULL bool *is_approximate; /// Options for the order of values in the displayed expression. Default: default_sort_options SortOptions sort_options; /// Comma sign or empty string to use default comma sign. Default: empty string string comma_sign; /// Decimal sign or empty string to use default decimal sign. Default: empty string string decimalpoint_sign; /// Function that returns true if a text string with unicode signs can be properly displayed. Default: NULL bool (*can_display_unicode_string_function) (const char*, void*); /// Argument passed to can_display_unicode_string_function. Default: NULL void *can_display_unicode_string_arg; /// Replace underscores in names with spaces, unless name has suffix. Default: false bool hide_underscore_spaces; /// Preserves the format of the structure (no sorting, no changed prefixes, no improved division multipliers, etc.). Default: false bool preserve_format; /// Allows factorization to occur in the output (should be set to true if the structure has been factorized). Default: false bool allow_factorization; /// If logical operators will be spelled as AND and OR instead of && and ||. Default: false bool spell_out_logical_operators; /// Displays children of the structure with no higher precision than the parent. Default: true bool restrict_to_parent_precision; /// Restrict the length of numerators and demonitor as integers in decimal mode for fractional display of numbers. Default: false bool restrict_fraction_length; /// Transform exponentiation positive base and unit fraction exponent (if denominator < 10) to root function. Default: false bool exp_to_root; /// Use the internal precision of each number instead of global precision. Default: false bool preserve_precision; /// How number intervals will be displayed. Default: INTERVAL_DISPLAY_INTERVAL IntervalDisplay interval_display; /// Digit grouping separator. Default: DIGIT_GROUPING_NONE DigitGrouping digit_grouping; /// Format for time and date. Default: DATE_TIME_FORMAT_ISO DateTimeFormat date_time_format; /// Time zone for time and date. Default: TIME_ZONE_LOCAL TimeZone time_zone; /// Offset in minute for custom time zone. Default: 0 int custom_time_zone; /// Negative binary numbers uses two's complement representation. All binary numbers starting with 1 are negative. Default: true bool twos_complement; /// Number of bits used for binary numbers. Set to 0 for automatic. Default: 0 unsigned int binary_bits; PrintOptions() : min_exp(EXP_PRECISION), base(BASE_DECIMAL), lower_case_numbers(false), lower_case_e(false), number_fraction_format(FRACTION_DECIMAL), indicate_infinite_series(false), show_ending_zeroes(false), abbreviate_names(true), use_reference_names(false), place_units_separately(true), use_unit_prefixes(true), use_prefixes_for_all_units(false), use_prefixes_for_currencies(false), use_all_prefixes(false), use_denominator_prefix(true), negative_exponents(false), short_multiplication(true), limit_implicit_multiplication(false), allow_non_usable(false), use_unicode_signs(false), multiplication_sign(MULTIPLICATION_SIGN_DOT), division_sign(DIVISION_SIGN_DIVISION_SLASH), spacious(true), excessive_parenthesis(false), halfexp_to_sqrt(true), min_decimals(0), max_decimals(-1), use_min_decimals(true), use_max_decimals(true), round_halfway_to_even(false), improve_division_multipliers(true), prefix(NULL), is_approximate(NULL), can_display_unicode_string_function(NULL), can_display_unicode_string_arg(NULL), hide_underscore_spaces(false), preserve_format(false), allow_factorization(false), spell_out_logical_operators(false), restrict_to_parent_precision(true), restrict_fraction_length(false), exp_to_root(false), preserve_precision(false), interval_display(INTERVAL_DISPLAY_INTERVAL), digit_grouping(DIGIT_GROUPING_NONE), date_time_format(DATE_TIME_FORMAT_ISO), time_zone(TIME_ZONE_LOCAL), custom_time_zone(0), twos_complement(true), binary_bits(0) {} /// Returns the comma sign used (default sign or comma_sign) const string &comma() const; /// Returns the decimal sign used (default sign or decimalpoint_sign) const string &decimalpoint() const; /// Returns the digit grouping separator used } default_print_options; static const struct InternalPrintStruct { int depth, power_depth, division_depth; bool wrap; string *num, *den, *re, *im, *exp; bool *minus, *exp_minus; bool parent_approximate; int parent_precision; long int *iexp; InternalPrintStruct() : depth(0), power_depth(0), division_depth(0), wrap(false), num(NULL), den(NULL), re(NULL), im(NULL), exp(NULL), minus(NULL), exp_minus(NULL), parent_approximate(false), parent_precision(-1), iexp(NULL) {} } top_ips; typedef enum { /// Allow only exact results APPROXIMATION_EXACT, /// Try to make the result as exact as possible APPROXIMATION_TRY_EXACT, /// Calculate the result approximately directly APPROXIMATION_APPROXIMATE, /// Used internally APPROXIMATION_EXACT_VARIABLES } ApproximationMode; typedef enum { /// Do not do any factorization or additional simplifications STRUCTURING_NONE, /// Simplify the result as much as possible (no factorization, normally the same as STRUCTURING_NONE)) STRUCTURING_SIMPLIFY, /// Factorize the result STRUCTURING_FACTORIZE, /// Deprecated: use STRUCTURING_SIMPLIFY instead STRUCTURING_HYBRID } StructuringMode; typedef enum { /// Do not do any conversion of units in addition to syncing POST_CONVERSION_NONE, /// Convert to the least amount of units. Non-SI units are converted to SI units. POST_CONVERSION_OPTIMAL_SI, /// Convert to base units POST_CONVERSION_BASE, /// Convert to the the least amount of units. Non-SI units is kept (if optimal), but for conversion only SI units are used. POST_CONVERSION_OPTIMAL } AutoPostConversion; #define POST_CONVERSION_BEST POST_CONVERSION_OPTIMAL_SI typedef enum { MIXED_UNITS_CONVERSION_NONE, MIXED_UNITS_CONVERSION_DOWNWARDS_KEEP, MIXED_UNITS_CONVERSION_DOWNWARDS, MIXED_UNITS_CONVERSION_DEFAULT, MIXED_UNITS_CONVERSION_FORCE_INTEGER, MIXED_UNITS_CONVERSION_FORCE_ALL } MixedUnitsConversion; typedef enum { DONT_READ_PRECISION, ALWAYS_READ_PRECISION, READ_PRECISION_WHEN_DECIMALS } ReadPrecisionMode; typedef enum { ANGLE_UNIT_NONE, ANGLE_UNIT_RADIANS, ANGLE_UNIT_DEGREES, ANGLE_UNIT_GRADIANS } AngleUnit; typedef enum { COMPLEX_NUMBER_FORM_RECTANGULAR, COMPLEX_NUMBER_FORM_EXPONENTIAL, COMPLEX_NUMBER_FORM_POLAR } ComplexNumberForm; typedef enum { /// The default adaptive mode works as the "parse implicit multiplication first" mode, unless spaces are found (1/5x = 1/(5*x), but 1/5 x = (1/5)*x). In the adaptive mode unit expressions are parsed separately (5 m/5 m/s = (5*m)/(5*(m/s)) = 1 s). PARSING_MODE_ADAPTIVE, /// In the "parse implicit multiplication first" mode, implicit multiplication is parsed before explicit multiplication (12/2(1+2) = 12/(2*3) = 2, 5x/5y = (5*x)/(5*y) = x/y). PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST, /// In the conventional mode implicit multiplication does not differ from explicit multiplication (12/2(1+2) = 12/2*3 = 18, 5x/5y = 5*x/5*y = xy). PARSING_MODE_CONVENTIONAL } ParsingMode; /// Options for parsing expressions. static const struct ParseOptions { /// If variables will be parsed. Default: true bool variables_enabled; /// If functions will be parsed. Default: true bool functions_enabled; /// If left-over characters will be parsed as symbols. Default: true bool unknowns_enabled; /// If units will be parsed. Default: true bool units_enabled; /// If Reverse Polish Notation syntax will be used. Default: false bool rpn; /// Base of parsed numbers. Default: 10 int base; /// When implicit multiplication is limited variables, functions and units must be separated by a space, operator or parenthesis ("xy" does not equal "x * y"). Default: false /** * If the limit implicit multiplication mode is activated, the use of implicite multiplication when parsing expressions and displaying results will be limited to avoid confusion. For example, if this mode is not activated and "integrte(5x)" is accidently typed instead of "integrate(5x)", the expression is interpreted as "int(e * e * (5 * x) * gr * t)". If limit implicit multiplication is turned on to mistyped expression would instead show an error telling that "integrte" is not a valid variable, function or unit (unless unknowns is not enabled in which case the result will be "5 'integrate' * x". */ bool limit_implicit_multiplication; /// If and when precisions will be read from number of digits in a number. Default: DONT_READ_PRECISION ReadPrecisionMode read_precision; /// If true dots will ignored if another character is the default decimal sign, to allow dots to be used as thousand separator. Default: false bool dot_as_separator; /// If true commas will ignored if another character is the default decimal sign, to allow commas to be used as thousand separator. You should also call CALCULATOR->useDecimalPoint(true). Default: false bool comma_as_separator; ///Interpret square brackets equally to parentheses (not only for vectors/matrices). Default; false bool brackets_as_parentheses; /// Default angle unit for trigonometric functions. Default: ANGLE_UNIT_NONE AngleUnit angle_unit; /// If non-NULL will be set to unfinished function at the end of the expression (if there is one). Default: NULL MathStructure *unended_function; /// Preserve the expression structure as much as possible. Default: false bool preserve_format; /// Default dataset. Used for object.property syntax without a preceeding data set. Default: NULL DataSet *default_dataset; /// Parsing mode. Default: PARSING_MODE_ADAPTIVE ParsingMode parsing_mode; /// Negative binary numbers uses two's complement representation. All binary numbers starting with 1 are assumed to be negative. Default: false bool twos_complement; ParseOptions() : variables_enabled(true), functions_enabled(true), unknowns_enabled(true), units_enabled(true), rpn(false), base(BASE_DECIMAL), limit_implicit_multiplication(false), read_precision(DONT_READ_PRECISION), dot_as_separator(false), brackets_as_parentheses(false), angle_unit(ANGLE_UNIT_NONE), unended_function(NULL), preserve_format(false), default_dataset(NULL), parsing_mode(PARSING_MODE_ADAPTIVE), twos_complement(false) {} } default_parse_options; /// Options for calculation. static const struct EvaluationOptions { /// How exact the result must be. Default: TRY_EXACT ApproximationMode approximation; /// If units will be synced/converted to allow evaluation (ex. 1 min + 1 s=60 s+ 1 s = 61 s). Default: true bool sync_units; /// If units with complex/non-linear relations (ex. degress celsius and fahrenheit) will synced/converted. Default: true bool sync_complex_unit_relations; /// If unit prefixes in original expression will be kept. Default: false bool keep_prefixes; /// If known variables will be replaced by their value. Default: true bool calculate_variables; /// If functions will be calculated. Default: true bool calculate_functions; /// If comparisons will be evaluated (ex. 5>2 => 1). Default: true int test_comparisons; /// If a varaible will be isolated to the left side in equations/comparisons (ex. x+y=2 => x=2-y). Default: true bool isolate_x; /// If factors (and bases) containing addition will be expanded (ex. z(x+y)=zx+zy). Default: true int expand; /// Use behaviour from version <= 0.9.12 which returns (x+y)/z instead of x/y+y/z if expand = true bool combine_divisions; /// If non-numerical parts of a fraction will be reduced (ex. (5x)/(3xy) =5/(3y) . Default: true bool reduce_divisions; /// If complex numbers will be used for evaluation. Default: true bool allow_complex; /// If infinite numbers will be used for evaluation. Default: true bool allow_infinite; /// If simplification will be made easier by assuming that denominators with unknown value not is zero. Default: false int assume_denominators_nonzero; /// Warn if a denominator with unknown value was assumed non-zero (with assume_denominators_nonzero set to true) to allow simplification. Default: false bool warn_about_denominators_assumed_nonzero; /// If powers with exponent 1/2 that only have an approximate result will be split to the least base (sqrt(8) = 2 * sqrt(2)). Default: true bool split_squares; /// If units with zero quantity will be preserved. Default: true bool keep_zero_units; /// If and how units will be automatically converted. Does not affect syncing of units. Default: POST_CONVERSION_NONE AutoPostConversion auto_post_conversion; /// Shows time as h + min + s, imperial length as ft + in, etc. Default: MIXED_UNITS_CONVERSION_DEFAULT MixedUnitsConversion mixed_units_conversion; /// If the evaluation result will be simplified or factorized Default: STRUCTURING_NONE StructuringMode structuring; /// Options for parsing of expression. Default: default_parse_options ParseOptions parse_options; /// If set will decide which variable to isolate in an equation. Default: NULL const MathStructure *isolate_var; /// Use polynomial division to simplify the result. Default: true bool do_polynomial_division; /// Do not calculate the specified function. Default: NULL MathFunction *protected_function; /// Complex number form. Default: COMPLEX_NUMBER_FORM_RECTANGULAR ComplexNumberForm complex_number_form; /// Convert to local currency when optimal conversion is enabled bool local_currency_conversion; /// Mainly for internal use. Default: true bool transform_trigonometric_functions; EvaluationOptions() : approximation(APPROXIMATION_TRY_EXACT), sync_units(true), sync_complex_unit_relations(true), keep_prefixes(false), calculate_variables(true), calculate_functions(true), test_comparisons(true), isolate_x(true), expand(true), combine_divisions(false), reduce_divisions(true), allow_complex(true), allow_infinite(true), assume_denominators_nonzero(false), warn_about_denominators_assumed_nonzero(false), split_squares(true), keep_zero_units(true), auto_post_conversion(POST_CONVERSION_NONE), mixed_units_conversion(MIXED_UNITS_CONVERSION_DEFAULT), structuring(STRUCTURING_SIMPLIFY), isolate_var(NULL), do_polynomial_division(true), protected_function(NULL), complex_number_form(COMPLEX_NUMBER_FORM_RECTANGULAR), local_currency_conversion(true), transform_trigonometric_functions(true) {} } default_evaluation_options; extern MathStructure m_undefined, m_empty_vector, m_empty_matrix, m_zero, m_one, m_minus_one, m_one_i; extern Number nr_zero, nr_one, nr_two, nr_three, nr_minus_one, nr_one_i, nr_minus_i, nr_half, nr_minus_half, nr_plus_inf, nr_minus_inf; extern EvaluationOptions no_evaluation; extern ExpressionName empty_expression_name; extern Calculator *calculator; #define CALCULATOR calculator #define DEFAULT_PRECISION 8 #define PRECISION (CALCULATOR ? CALCULATOR->getPrecision() : DEFAULT_PRECISION) #define SIGN_DEGREE "°" #define SIGN_POWER_0 "â°" #define SIGN_POWER_1 "¹" #define SIGN_POWER_2 "²" #define SIGN_POWER_3 "³" #define SIGN_POWER_4 "â´" #define SIGN_POWER_5 "âµ" #define SIGN_POWER_6 "â¶" #define SIGN_POWER_7 "â·" #define SIGN_POWER_8 "â¸" #define SIGN_POWER_9 "â¹" #define SIGN_EURO "€" #define SIGN_POUND "£" #define SIGN_CENT "¢" #define SIGN_YEN "Â¥" #define SIGN_MICRO "µ" #define SIGN_PI "Ï€" #define SIGN_MULTIPLICATION "×" #define SIGN_MULTIDOT "â‹…" #define SIGN_MIDDLEDOT "·" #define SIGN_MULTIBULLET "∙" #define SIGN_SMALLCIRCLE "•" #define SIGN_DIVISION_SLASH "∕" #define SIGN_DIVISION "÷" #define SIGN_MINUS "−" #define SIGN_PLUS "+" #define SIGN_SQRT "√" #define SIGN_ALMOST_EQUAL "≈" #define SIGN_APPROXIMATELY_EQUAL "≅" #define SIGN_ZETA "ζ" #define SIGN_GAMMA "γ" #define SIGN_PHI "φ" #define SIGN_LESS_OR_EQUAL "≤" #define SIGN_GREATER_OR_EQUAL "≥" #define SIGN_NOT_EQUAL "≠" #define SIGN_CAPITAL_SIGMA "Σ" #define SIGN_CAPITAL_PI "Π" #define SIGN_CAPITAL_OMEGA "Ω" #define SIGN_CAPITAL_GAMMA "Γ" #define SIGN_CAPITAL_BETA "Î’" #define SIGN_INFINITY "∞" #define SIGN_PLUSMINUS "±" #define ID_WRAP_LEFT_CH '{' #define ID_WRAP_RIGHT_CH '}' #define DOT_CH '.' #define ZERO_CH '0' #define ONE_CH '1' #define TWO_CH '2' #define THREE_CH '3' #define FOUR_CH '4' #define FIVE_CH '5' #define SIX_CH '6' #define SEVEN_CH '7' #define EIGHT_CH '8' #define NINE_CH '9' #define PLUS_CH '+' #define MINUS_CH '-' #define MULTIPLICATION_CH '*' #define MULTIPLICATION_2_CH ' ' #define DIVISION_CH '/' #define EXP_CH 'E' #define EXP2_CH 'e' #define POWER_CH '^' #define SPACE_CH ' ' #define LEFT_PARENTHESIS_CH '(' #define RIGHT_PARENTHESIS_CH ')' #define LEFT_VECTOR_WRAP_CH '[' #define RIGHT_VECTOR_WRAP_CH ']' #define FUNCTION_VAR_PRE_CH '\\' #define COMMA_CH ',' #define NAME_NUMBER_PRE_CH '_' #define UNIT_DIVISION_CH '/' #define AND_CH '&' #define OR_CH '|' #define LESS_CH '<' #define GREATER_CH '>' #define BITWISE_NOT_CH '~' #define LOGICAL_NOT_CH '!' #define NOT_CH '!' #define EQUALS_CH '=' #define ID_WRAP_LEFT "{" #define ID_WRAP_RIGHT "}" #define ID_WRAPS "{}" #define DOT "." #define SEXADOT ":" #define COMMA "," #define COMMAS ",;" #define NUMBERS "0123456789" #define NUMBER_ELEMENTS "0123456789.:" #define SIGNS "+-*/^" #define OPERATORS "~+-*/^&|!<>=" #define PARENTHESISS "()" #define LEFT_PARENTHESIS "(" #define RIGHT_PARENTHESIS ")" #define VECTOR_WRAPS "[]" #define LEFT_VECTOR_WRAP "[" #define RIGHT_VECTOR_WRAP "]" #define SPACES " \t\n" #define SPACE " " #define RESERVED "\'@\\{}?\"" #define PLUS "+" #define MINUS "-" #define MULTIPLICATION "*" #define MULTIPLICATION_2 " " #define DIVISION "/" #define EXP "E" #define EXPS "Ee" #define POWER "^" #define LOGICAL_AND "&&" #define LOGICAL_OR "||" #define LOGICAL_NOT "!" #define BITWISE_AND "&" #define BITWISE_OR "|" #define BITWISE_NOT "~" #define SHIFT_RIGHT ">>" #define SHIFT_LEFT "<<" #define LESS "<" #define GREATER ">" #define NOT "!" #define EQUALS "=" #define SINF "INF" //#define SNAN "NAN" #define UNDERSCORE "_" #define NOT_IN_NAMES RESERVED OPERATORS SPACES SEXADOT DOT VECTOR_WRAPS PARENTHESISS COMMAS #endif libqalculate-2.8.2/libqalculate/Unit.cc0000644000175000017500000007674513372525161015026 00000000000000/* Qalculate (libary) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "Unit.h" #include "util.h" #include "Calculator.h" #include "MathStructure.h" #include "Prefix.h" Unit::Unit(string cat_, string name_, string plural_, string singular_, string title_, bool is_local, bool is_builtin, bool is_active) : ExpressionItem(cat_, "", title_, "", is_local, is_builtin, is_active) { remove_blank_ends(plural_); remove_blank_ends(singular_); if(!name_.empty()) { names.resize(1); names[0].name = name_; names[0].unicode = false; names[0].abbreviation = true; names[0].case_sensitive = true; names[0].suffix = false; names[0].avoid_input = false; names[0].reference = true; names[0].plural = false; } if(!singular_.empty()) { names.resize(names.size() + 1); names[names.size() - 1].name = singular_; names[names.size() - 1].unicode = false; names[names.size() - 1].abbreviation = false; names[names.size() - 1].case_sensitive = text_length_is_one(names[names.size() - 1].name); names[names.size() - 1].suffix = false; names[names.size() - 1].avoid_input = false; names[names.size() - 1].reference = false; names[names.size() - 1].plural = false; } if(!plural_.empty()) { names.resize(names.size() + 1); names[names.size() - 1].name = plural_; names[names.size() - 1].unicode = false; names[names.size() - 1].abbreviation = false; names[names.size() - 1].case_sensitive = text_length_is_one(names[names.size() - 1].name); names[names.size() - 1].suffix = false; names[names.size() - 1].avoid_input = false; names[names.size() - 1].reference = false; names[names.size() - 1].plural = true; } b_si = false; b_use_with_prefixes = false; } Unit::Unit() { b_si = false; b_use_with_prefixes = false; } Unit::Unit(const Unit *unit) { set(unit); } Unit::~Unit() {} ExpressionItem *Unit::copy() const { return new Unit(this); } void Unit::set(const ExpressionItem *item) { if(item->type() == TYPE_UNIT) { b_si = ((Unit*) item)->isSIUnit(); ssystem = ((Unit*) item)->system(); scountries = ((Unit*) item)->countries(); } ExpressionItem::set(item); } bool Unit::isSIUnit() const { return b_si; } void Unit::setAsSIUnit() { if(!b_si) { b_si = true; b_use_with_prefixes = true; ssystem = "SI"; setChanged(true); } } void Unit::setSystem(string s_system) { if(s_system != ssystem) { ssystem = s_system; if(ssystem == "SI" || ssystem == "si" || ssystem == "Si") { b_si = true; b_use_with_prefixes = true; } else if(ssystem == "CGS" || ssystem == "cgs" || ssystem == "Cgs") { b_si = false; b_use_with_prefixes = true; } else { b_si = false; } setChanged(true); } } const string &Unit::system() const { return ssystem; } bool Unit::useWithPrefixesByDefault() const { return b_use_with_prefixes; } void Unit::setUseWithPrefixesByDefault(bool use_with_prefixes) { b_use_with_prefixes = use_with_prefixes; } bool Unit::isCurrency() const { return baseUnit() == CALCULATOR->u_euro; } const string &Unit::countries() const {return scountries;} void Unit::setCountries(string country_names) { remove_blank_ends(country_names); if(scountries != country_names) { scountries = country_names; setChanged(true); } } bool Unit::isUsedByOtherUnits() const { return CALCULATOR->unitIsUsedByOtherUnits(this); } string Unit::print(bool plural_, bool short_, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { return preferredName(short_, use_unicode, plural_, false, can_display_unicode_string_function, can_display_unicode_string_arg).name; } const string &Unit::plural(bool return_singular_if_no_plural, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { const ExpressionName *ename = &preferredName(false, use_unicode, true, false, can_display_unicode_string_function, can_display_unicode_string_arg); if(!return_singular_if_no_plural && !ename->plural) return empty_string; return ename->name; } const string &Unit::singular(bool return_abbreviation_if_no_singular, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { const ExpressionName *ename = &preferredName(false, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg); if(!return_abbreviation_if_no_singular && ename->abbreviation) return empty_string; return ename->name; } const string &Unit::abbreviation(bool return_singular_if_no_abbreviation, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { const ExpressionName *ename = &preferredName(true, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg); if(!return_singular_if_no_abbreviation && !ename->abbreviation) return empty_string; return ename->name; } Unit* Unit::baseUnit() const { return (Unit*) this; } MathStructure &Unit::convertToBaseUnit(MathStructure &mvalue, MathStructure&) const { return mvalue; } MathStructure &Unit::convertFromBaseUnit(MathStructure &mvalue, MathStructure&) const { return mvalue; } MathStructure &Unit::convertToBaseUnit(MathStructure &mvalue) const { return mvalue; } MathStructure &Unit::convertFromBaseUnit(MathStructure &mvalue) const { return mvalue; } MathStructure Unit::convertToBaseUnit() const { return MathStructure(1, 1); } MathStructure Unit::convertFromBaseUnit() const { return MathStructure(1, 1); } int Unit::baseExponent(int exp) const { return exp; } int Unit::type() const { return TYPE_UNIT; } int Unit::subtype() const { return SUBTYPE_BASE_UNIT; } bool Unit::isChildOf(Unit*) const { return false; } bool Unit::isParentOf(Unit *u) const { return u != this && u->baseUnit() == this; } bool Unit::hasComplexRelationTo(Unit *u) const { if(u == this) return false; Unit *ub2 = u->baseUnit(); if(ub2 != this) { if(subtype() == SUBTYPE_COMPOSITE_UNIT) { const CompositeUnit *cu = (CompositeUnit*) this; for(size_t i = 1; i <= cu->countUnits(); i++) { if(cu->get(i)->hasComplexRelationTo(u)) return true; } return false; } if(ub2->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(u->hasComplexRelationTo(ub2) && (((CompositeUnit*) ub2))->containsRelativeTo(u)) return true; } return false; } Unit *fbu = u; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; while(1) { if(fbu == this) return false; if(((AliasUnit*) fbu)->hasComplexExpression()) return true; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; fbu = (Unit*) ((AliasUnit*) fbu)->firstBaseUnit(); } } MathStructure Unit::convert(Unit *u, bool *converted) const { MathStructure mexp(1, 1); MathStructure mvalue(1, 1); bool b = convert(u, mvalue, mexp); if(converted) *converted = b; return mvalue; } bool Unit::convert(Unit *u, MathStructure &mvalue) const { MathStructure mexp(1, 1); return convert(u, mvalue, mexp); } bool Unit::convert(Unit *u, MathStructure &mvalue, MathStructure &mexp) const { if(u == this) { return true; } else if(u->baseUnit() == baseUnit()) { u->convertToBaseUnit(mvalue, mexp); convertFromBaseUnit(mvalue, mexp); if(isCurrency() && u->isCurrency() && ((isBuiltin() && this != CALCULATOR->u_euro) || (u->isBuiltin() && u != CALCULATOR->u_euro))) { int i = 1; if(u == CALCULATOR->u_btc || this == CALCULATOR->u_btc) i = 2; if(u->subtype() == SUBTYPE_ALIAS_UNIT) { if(i < 2 && ((AliasUnit*) u)->firstBaseUnit() == CALCULATOR->u_btc) i = 2; else if(((AliasUnit*) u)->firstBaseUnit() != CALCULATOR->u_euro) i = 3; } if(i < 3 && subtype() == SUBTYPE_ALIAS_UNIT) { if(i < 2 && ((AliasUnit*) this)->firstBaseUnit() == CALCULATOR->u_btc) i = 2; else if(((AliasUnit*) this)->firstBaseUnit() != CALCULATOR->u_euro) i = 3; } CALCULATOR->setExchangeRatesUsed(i); } return true; } return false; } AliasUnit::AliasUnit(string cat_, string name_, string plural_, string short_name_, string title_, Unit *alias, string relation, int exp, string inverse, bool is_local, bool is_builtin, bool is_active) : Unit(cat_, name_, plural_, short_name_, title_, is_local, is_builtin, is_active) { o_unit = (Unit*) alias; remove_blank_ends(relation); remove_blank_ends(inverse); svalue = relation; sinverse = inverse; suncertainty = ""; i_exp = exp; i_mix = 0; i_mix_min = 0; } AliasUnit::AliasUnit() { o_unit = NULL; svalue = ""; sinverse = ""; suncertainty = ""; i_exp = 1; i_mix = 0; i_mix_min = 0; } AliasUnit::AliasUnit(const AliasUnit *unit) { set(unit); } AliasUnit::~AliasUnit() {} ExpressionItem *AliasUnit::copy() const { return new AliasUnit(this); } void AliasUnit::set(const ExpressionItem *item) { if(item->type() == TYPE_UNIT) { Unit::set(item); if(((Unit*) item)->subtype() == SUBTYPE_ALIAS_UNIT) { AliasUnit *u = (AliasUnit*) item; o_unit = (Unit*) u->firstBaseUnit(); i_exp = u->firstBaseExponent(); svalue = u->expression(); sinverse = u->inverseExpression(); suncertainty = u->uncertainty(); i_mix = u->mixWithBase(); i_mix_min = u->mixWithBaseMinimum(); } } else { ExpressionItem::set(item); } } Unit* AliasUnit::baseUnit() const { return o_unit->baseUnit(); } Unit* AliasUnit::firstBaseUnit() const { return o_unit; } void AliasUnit::setBaseUnit(Unit *alias) { o_unit = (Unit*) alias; setChanged(true); } string AliasUnit::expression() const { return svalue; } string AliasUnit::inverseExpression() const { return sinverse; } string AliasUnit::uncertainty() const { return suncertainty; } void AliasUnit::setExpression(string relation) { remove_blank_ends(relation); if(relation.empty()) { svalue = "1"; } else { svalue = relation; } setChanged(true); } void AliasUnit::setInverseExpression(string inverse) { remove_blank_ends(inverse); sinverse = inverse; setChanged(true); } void AliasUnit::setUncertainty(string standard_uncertainty) { remove_blank_ends(standard_uncertainty); suncertainty = standard_uncertainty; if(!suncertainty.empty()) setApproximate(true); setChanged(true); } MathStructure &AliasUnit::convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { convertToFirstBaseUnit(mvalue, mexp); return o_unit->convertToBaseUnit(mvalue, mexp); } MathStructure &AliasUnit::convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { Unit *u = (Unit*) baseUnit(); AliasUnit *u2; while(true) { u2 = (AliasUnit*) this; while(true) { if(u2->firstBaseUnit() == u) { break; } else { u2 = (AliasUnit*) u2->firstBaseUnit(); } } u = u2; u2->convertFromFirstBaseUnit(mvalue, mexp); if(u == this) break; } return mvalue; } MathStructure &AliasUnit::convertToBaseUnit(MathStructure &mvalue) const { MathStructure mexp(1, 1); return convertToBaseUnit(mvalue, mexp); } MathStructure &AliasUnit::convertFromBaseUnit(MathStructure &mvalue) const { MathStructure mexp(1, 1); return convertFromBaseUnit(mvalue, mexp); } MathStructure AliasUnit::convertToBaseUnit() const { MathStructure mexp(1, 1); MathStructure mvalue(1, 1); return convertToBaseUnit(mvalue, mexp); } MathStructure AliasUnit::convertFromBaseUnit() const { MathStructure mexp(1, 1); MathStructure mvalue(1, 1); return convertFromBaseUnit(mvalue, mexp); } int AliasUnit::baseExponent(int exp) const { return o_unit->baseExponent(exp * i_exp); } MathStructure &AliasUnit::convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { if(i_exp != 1) mexp /= i_exp; ParseOptions po; if(isApproximate() && suncertainty.empty() && precision() == -1) { if(sinverse.find(DOT) || svalue.find(DOT)) po.read_precision = READ_PRECISION_WHEN_DECIMALS; else po.read_precision = ALWAYS_READ_PRECISION; } if(sinverse.empty()) { if(svalue.find("\\x") != string::npos) { string stmp = svalue; string stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int x_id = CALCULATOR->addId(new MathStructure(mvalue), true); stmp2 += i2s(x_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\x", stmp2, stmp); stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int y_id = -1; if(svalue.find("\\y") != string::npos) { stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; y_id = CALCULATOR->addId(new MathStructure(mexp), true); stmp2 += i2s(y_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\y", stmp2, stmp); } CALCULATOR->parse(&mvalue, stmp, po); CALCULATOR->delId(x_id); if(y_id < 0) { if(!mexp.isOne()) mvalue.raise(mexp); } else { CALCULATOR->delId(y_id); } if(precision() > 0 && (mvalue.precision() < 0 || precision() < mvalue.precision())) mvalue.setPrecision(precision(), true); if(isApproximate()) mvalue.setApproximate(true, true); } else { MathStructure *mstruct = new MathStructure(); if(suncertainty.empty()) { CALCULATOR->parse(mstruct, svalue, po); } else { mstruct->number().set(svalue, po); mstruct->numberUpdated(); } if(!suncertainty.empty()) { Number nr_u(suncertainty); if(mstruct->isNumber()) { mstruct->number().setUncertainty(nr_u); } else if(mstruct->isMultiplication() && mstruct->size() > 0 && (*mstruct)[0].isNumber()) { (*mstruct)[0].number().setUncertainty(nr_u); } } else if(precision() > 0) { if(mstruct->isNumber()) { if(mstruct->number().precision() < 1 || precision() < mstruct->number().precision()) { mstruct->number().setPrecision(precision()); mstruct->numberUpdated(); } } else if(mstruct->isMultiplication() && mstruct->getChild(1)->isNumber()) { if(mstruct->getChild(1)->number().precision() < 0 || precision() < mstruct->getChild(1)->number().precision()) { mstruct->getChild(1)->number().setPrecision(precision()); mstruct->getChild(1)->numberUpdated(); mstruct->childUpdated(1); } } else if(mstruct->precision() < 0 || precision() < mstruct->precision()) { mstruct->setPrecision(precision(), true); } } else if(isApproximate() && !mstruct->isApproximate()) { mstruct->setApproximate(true, true); } if(!mexp.isOne()) mstruct->raise(mexp); mvalue.divide_nocopy(mstruct, true); } } else { if(sinverse.find("\\x") != string::npos) { string stmp = sinverse; string stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int x_id = CALCULATOR->addId(new MathStructure(mvalue), true); stmp2 += i2s(x_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\x", stmp2, stmp); int y_id = -1; if(svalue.find("\\y") != string::npos) { stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; y_id = CALCULATOR->addId(new MathStructure(mexp), true); stmp2 += i2s(y_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\y", stmp2, stmp); } CALCULATOR->parse(&mvalue, stmp, po); CALCULATOR->delId(x_id); if(y_id < 0) { if(!mexp.isOne()) mvalue.raise(mexp); } else { CALCULATOR->delId(y_id); } if(precision() > 0 && (mvalue.precision() < 0|| precision() < mvalue.precision())) mvalue.setPrecision(precision(), true); if(isApproximate()) mvalue.setApproximate(true, true); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, sinverse, po); if(precision() > 0) { if(mstruct->isNumber()) { if(mstruct->number().precision() < 0 || precision() < mstruct->number().precision()) { mstruct->number().setPrecision(precision()); mstruct->numberUpdated(); } } else if(mstruct->isMultiplication() && mstruct->getChild(1)->isNumber()) { if(mstruct->getChild(1)->number().precision() < 0 || precision() < mstruct->getChild(1)->number().precision()) { mstruct->getChild(1)->number().setPrecision(precision()); mstruct->getChild(1)->numberUpdated(); mstruct->childUpdated(1); } } else if(mstruct->precision() < 0 || precision() < mstruct->precision()) { mstruct->setPrecision(precision(), true); } } else if(isApproximate() && !mstruct->isApproximate()) { mstruct->setApproximate(true, true); } if(!mexp.isOne()) mstruct->raise(mexp); mvalue.multiply_nocopy(mstruct, true); } } return mvalue; } MathStructure &AliasUnit::convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { ParseOptions po; if(isApproximate() && suncertainty.empty() && precision() == -1) { if(svalue.find(DOT)) po.read_precision = READ_PRECISION_WHEN_DECIMALS; else po.read_precision = ALWAYS_READ_PRECISION; } if(svalue.find("\\x") != string::npos) { string stmp = svalue; string stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; int x_id = CALCULATOR->addId(new MathStructure(mvalue), true); int y_id = -1; stmp2 += i2s(x_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\x", stmp2, stmp); if(svalue.find("\\y") != string::npos) { stmp2 = LEFT_PARENTHESIS ID_WRAP_LEFT; y_id = CALCULATOR->addId(new MathStructure(mexp), true); stmp2 += i2s(y_id); stmp2 += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\y", stmp2, stmp); } CALCULATOR->parse(&mvalue, stmp, po); CALCULATOR->delId(x_id); if(y_id < 0) { if(!mexp.isOne()) mvalue.raise(mexp); } else { CALCULATOR->delId(y_id); } if(precision() >= 0 && (mvalue.precision() < 0 || precision() < mvalue.precision())) mvalue.setPrecision(precision(), true); if(isApproximate()) mvalue.setApproximate(true, true); } else { MathStructure *mstruct = new MathStructure(); if(suncertainty.empty()) { CALCULATOR->parse(mstruct, svalue, po); } else { mstruct->number().set(svalue, po); mstruct->numberUpdated(); } if(!suncertainty.empty()) { Number nr_u(suncertainty); if(mstruct->isNumber()) { mstruct->number().setUncertainty(nr_u); } else if(mstruct->isMultiplication() && mstruct->size() > 0 && (*mstruct)[0].isNumber()) { (*mstruct)[0].number().setUncertainty(nr_u); } } else if(precision() >= 0) { if(mstruct->isNumber()) { if(mstruct->number().precision() < 0 || precision() < mstruct->number().precision()) { mstruct->number().setPrecision(precision()); mstruct->numberUpdated(); } } else if(mstruct->isMultiplication() && mstruct->getChild(1)->isNumber()) { if(mstruct->getChild(1)->number().precision() < 0 || precision() < mstruct->getChild(1)->number().precision()) { mstruct->getChild(1)->number().setPrecision(precision()); mstruct->getChild(1)->numberUpdated(); mstruct->childUpdated(1); } } else if(mstruct->precision() < 0 || precision() < mstruct->precision()) { mstruct->setPrecision(precision(), true); } } else if(isApproximate() && !mstruct->isApproximate()) { mstruct->setApproximate(true, true); } if(!mexp.isOne()) mstruct->raise(mexp); mvalue.multiply_nocopy(mstruct, true); } if(i_exp != 1) mexp.multiply(i_exp); return mvalue; } void AliasUnit::setExponent(int exp) { i_exp = exp; setChanged(true); } int AliasUnit::firstBaseExponent() const { return i_exp; } int AliasUnit::mixWithBase() const {return i_mix;} int AliasUnit::mixWithBaseMinimum() const {return i_mix_min;} void AliasUnit::setMixWithBase(int mix_priority) {i_mix = mix_priority;} void AliasUnit::setMixWithBaseMinimum(int mix_minimum) {i_mix_min = mix_minimum;} int AliasUnit::subtype() const { return SUBTYPE_ALIAS_UNIT; } bool AliasUnit::isChildOf(Unit *u) const { if(u == this) return false; if(baseUnit() == u) return true; if(u->baseUnit() != baseUnit()) return false; Unit *u2 = (Unit*) this; while(1) { u2 = (Unit*) ((AliasUnit*) u2)->firstBaseUnit(); if(u == u2) return true; if(u2->subtype() != SUBTYPE_ALIAS_UNIT) return false; } return false; } bool AliasUnit::isParentOf(Unit *u) const { if(u == this) return false; if(u->baseUnit() != baseUnit()) return false; while(1) { if(u->subtype() != SUBTYPE_ALIAS_UNIT) return false; u = ((AliasUnit*) u)->firstBaseUnit(); if(u == this) return true; } return false; } bool AliasUnit::hasComplexExpression() const { return svalue.find("\\x") != string::npos; } bool AliasUnit::hasComplexRelationTo(Unit *u) const { if(u == this) return false; Unit *ub = baseUnit(); Unit *ub2 = u->baseUnit(); if(ub2 != ub) { if(ub->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(hasComplexRelationTo(ub)) return ((CompositeUnit*) ub)->containsRelativeTo(u); for(size_t i = 1; i <= ((CompositeUnit*) ub)->countUnits(); i++) { if(((CompositeUnit*) ub)->get(i)->hasComplexRelationTo(u)) return true; } return false; } if(ub2->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { if(((CompositeUnit*) ub2)->containsRelativeTo(u) && (u->hasComplexRelationTo(ub2) || hasComplexRelationTo(ub))) return true; } return false; } if(isParentOf(u)) { Unit *fbu = u; while(true) { if((const Unit*) fbu == this) return false; if(((AliasUnit*) fbu)->hasComplexExpression()) return true; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; fbu = (Unit*) ((AliasUnit*) fbu)->firstBaseUnit(); } } else if(isChildOf(u)) { Unit *fbu = (Unit*) this; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; while(true) { if((const Unit*) fbu == u) return false; if(((AliasUnit*) fbu)->hasComplexExpression()) return true; if(fbu->subtype() != SUBTYPE_ALIAS_UNIT) return false; fbu = (Unit*) ((AliasUnit*) fbu)->firstBaseUnit(); } } else { return hasComplexRelationTo(baseUnit()) || u->hasComplexRelationTo(u->baseUnit()); } } AliasUnit_Composite::AliasUnit_Composite(Unit *alias, int exp, Prefix *prefix_) : AliasUnit("", alias->name(), alias->plural(false), alias->singular(false), "", alias, "", exp, "") { prefixv = (Prefix*) prefix_; } AliasUnit_Composite::AliasUnit_Composite(const AliasUnit_Composite *unit) { set(unit); } AliasUnit_Composite::~AliasUnit_Composite() {} ExpressionItem *AliasUnit_Composite::copy() const { return new AliasUnit_Composite(this); } void AliasUnit_Composite::set(const ExpressionItem *item) { if(item->type() == TYPE_UNIT) { if(((Unit*) item)->subtype() == SUBTYPE_ALIAS_UNIT) { AliasUnit::set(item); prefixv = (Prefix*) ((AliasUnit_Composite*) item)->prefix(); } else { Unit::set(item); } } else { ExpressionItem::set(item); } } string AliasUnit_Composite::print(bool plural_, bool short_, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { string str = ""; if(prefixv) { str += prefixv->name(short_, use_unicode, can_display_unicode_string_function, can_display_unicode_string_arg); } str += preferredName(short_, use_unicode, plural_, false, can_display_unicode_string_function, can_display_unicode_string_arg).name; return str; } Prefix *AliasUnit_Composite::prefix() const { return prefixv; } int AliasUnit_Composite::prefixExponent() const { if(prefixv && prefixv->type() == PREFIX_DECIMAL) return ((DecimalPrefix*) prefixv)->exponent(); if(prefixv && prefixv->type() == PREFIX_BINARY) return ((BinaryPrefix*) prefixv)->exponent(); return 0; } void AliasUnit_Composite::set(Unit *u, int exp, Prefix *prefix_) { setBaseUnit(u); setExponent(exp); prefixv = (Prefix*) prefix_; } MathStructure &AliasUnit_Composite::convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { if(prefixv) { MathStructure *mstruct = new MathStructure(prefixv->value()); if(!mexp.isOne()) mstruct->raise(mexp); mvalue.multiply_nocopy(mstruct, true); } if(i_exp != 1) mexp.multiply(i_exp); return mvalue; } MathStructure &AliasUnit_Composite::convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const { if(i_exp != 1) mexp /= i_exp; if(prefixv) { MathStructure *mstruct = new MathStructure(prefixv->value()); if(!mexp.isOne()) mstruct->raise(mexp); mvalue.divide_nocopy(mstruct, true); } return mvalue; } CompositeUnit::CompositeUnit(string cat_, string name_, string title_, string base_expression_, bool is_local, bool is_builtin, bool is_active) : Unit(cat_, name_, "", "", title_, is_local, is_builtin, is_active) { setBaseExpression(base_expression_); setChanged(false); } CompositeUnit::CompositeUnit(const CompositeUnit *unit) { set(unit); } CompositeUnit::~CompositeUnit() { clear(); } ExpressionItem *CompositeUnit::copy() const { return new CompositeUnit(this); } void CompositeUnit::set(const ExpressionItem *item) { if(item->type() == TYPE_UNIT) { Unit::set(item); if(((Unit*) item)->subtype() == SUBTYPE_COMPOSITE_UNIT) { CompositeUnit *cu = (CompositeUnit*) item; for(size_t i = 1; i <= cu->countUnits(); i++) { int exp = 1; Prefix *p = NULL; Unit *u = cu->get(i, &exp, &p); units.push_back(new AliasUnit_Composite(u, exp, p)); } } } else { ExpressionItem::set(item); } } void CompositeUnit::add(Unit *u, int exp, Prefix *prefix) { bool b = false; for(size_t i = 0; i < units.size(); i++) { if(exp > units[i]->firstBaseExponent()) { units.insert(units.begin() + i, new AliasUnit_Composite(u, exp, prefix)); b = true; break; } } if(!b) { units.push_back(new AliasUnit_Composite(u, exp, prefix)); } } Unit *CompositeUnit::get(size_t index, int *exp, Prefix **prefix) const { if(index > 0 && index <= units.size()) { if(exp) *exp = units[index - 1]->firstBaseExponent(); if(prefix) *prefix = (Prefix*) units[index - 1]->prefix(); return (Unit*) units[index - 1]->firstBaseUnit(); } return NULL; } void CompositeUnit::setExponent(size_t index, int exp) { if(index > 0 && index <= units.size()) { bool b = exp > units[index - 1]->firstBaseExponent(); units[index - 1]->setExponent(exp); if(b) { for(size_t i = 0; i < index - 1; i++) { if(exp > units[i]->firstBaseExponent()) { AliasUnit_Composite *u = units[index - 1]; units.erase(units.begin() + (index - 1)); units.insert(units.begin() + i, u); break; } } } else { for(size_t i = units.size() - 1; i > index - 1; i--) { if(exp < units[i]->firstBaseExponent()) { AliasUnit_Composite *u = units[index - 1]; units.insert(units.begin() + i, u); units.erase(units.begin() + (index - 1)); break; } } } } } void CompositeUnit::setPrefix(size_t index, Prefix *prefix) { if(index > 0 && index <= units.size()) { units[index - 1]->set(units[index - 1]->firstBaseUnit(), units[index - 1]->firstBaseExponent(), prefix); } } size_t CompositeUnit::countUnits() const { return units.size(); } size_t CompositeUnit::find(Unit *u) const { for(size_t i = 0; i < units.size(); i++) { if(units[i]->firstBaseUnit() == u) { return i + 1; } } return 0; } void CompositeUnit::del(size_t index) { if(index > 0 && index <= units.size()) { delete units[index - 1]; units.erase(units.begin() + (index - 1)); } } string CompositeUnit::print(bool plural_, bool short_, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { string str = ""; bool b = false, b2 = false; for(size_t i = 0; i < units.size(); i++) { if(units[i]->firstBaseExponent() != 0) { if(!b && units[i]->firstBaseExponent() < 0 && i > 0) { str += "/"; b = true; if(i < units.size() - 1) { b2 = true; str += "("; } } else { // if(i > 0) str += "*"; if(i > 0) str += " "; } if(plural_ && i == 0 && units[i]->firstBaseExponent() > 0) { str += units[i]->print(true, short_, use_unicode, can_display_unicode_string_function, can_display_unicode_string_arg); } else { str += units[i]->print(false, short_, use_unicode, can_display_unicode_string_function, can_display_unicode_string_arg); } if(b) { if(units[i]->firstBaseExponent() != -1) { str += "^"; str += i2s(-units[i]->firstBaseExponent()); } } else { if(units[i]->firstBaseExponent() != 1) { str += "^"; str += i2s(units[i]->firstBaseExponent()); } } } } if(b2) str += ")"; return str; } int CompositeUnit::subtype() const { return SUBTYPE_COMPOSITE_UNIT; } bool CompositeUnit::containsRelativeTo(Unit *u) const { if(u == this) return false; CompositeUnit *cu; for(size_t i = 0; i < units.size(); i++) { if(u == units[i] || u->baseUnit() == units[i]->baseUnit()) return true; if(units[i]->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { cu = (CompositeUnit*) units[i]->baseUnit(); if(cu->containsRelativeTo(u)) return true; } } if(u->baseUnit()->subtype() == SUBTYPE_COMPOSITE_UNIT) { cu = (CompositeUnit*) u->baseUnit(); for(size_t i = 1; i <= cu->countUnits(); i++) { if(containsRelativeTo(cu->get(i)->baseUnit())) return true; } return false; } return false; } MathStructure CompositeUnit::generateMathStructure(bool make_division, bool set_null_prefixes) const { MathStructure mstruct; bool has_p = set_null_prefixes; if(!set_null_prefixes) { for(size_t i = 0; i < units.size(); i++) { if(units[i]->prefix()) { has_p = true; break; } } } MathStructure mden; for(size_t i = 0; i < units.size(); i++) { MathStructure mstruct2; if(!has_p || units[i]->prefix()) { mstruct2.set(units[i]->firstBaseUnit(), units[i]->prefix()); } else { mstruct2.set(units[i]->firstBaseUnit(), CALCULATOR->decimal_null_prefix); } if(make_division && units[i]->firstBaseExponent() < 0) { if(units[i]->firstBaseExponent() != -1) { mstruct2 ^= -units[i]->firstBaseExponent(); } } else if(units[i]->firstBaseExponent() != 1) { mstruct2 ^= units[i]->firstBaseExponent(); } if(i == 0) { if(make_division && units[i]->firstBaseExponent() < 0) { mstruct = 1; mden = mstruct2; } else { mstruct = mstruct2; } } else if(make_division && units[i]->firstBaseExponent() < 0) { if(mden.isZero()) { mden = mstruct2; } else { mden *= mstruct2; } } else { mstruct *= mstruct2; } } if(make_division && !mden.isZero()) { mstruct.transform(STRUCT_DIVISION, mden); } return mstruct; } void CompositeUnit::setBaseExpression(string base_expression_) { clear(); if(base_expression_.empty()) { setChanged(true); return; } EvaluationOptions eo; eo.approximation = APPROXIMATION_EXACT; eo.sync_units = false; eo.keep_prefixes = true; eo.structuring = STRUCTURING_NONE; eo.reduce_divisions = false; eo.do_polynomial_division = false; ParseOptions po; po.variables_enabled = false; po.functions_enabled = false; po.unknowns_enabled = true; MathStructure mstruct; bool had_errors = false; CALCULATOR->beginTemporaryStopMessages(); CALCULATOR->parse(&mstruct, base_expression_, po); mstruct.eval(eo); if(CALCULATOR->endTemporaryStopMessages() > 0) had_errors = true; if(mstruct.isUnit()) { add(mstruct.unit(), 1, mstruct.prefix()); } else if(mstruct.isPower() && mstruct[0].isUnit() && mstruct[1].isInteger()) { add(mstruct[0].unit(), mstruct[1].number().intValue(), mstruct[0].prefix()); } else if(mstruct.isMultiplication()) { for(size_t i = 0; i < mstruct.size(); i++) { if(mstruct[i].isUnit()) { add(mstruct[i].unit(), 1, mstruct[i].prefix()); } else if(mstruct[i].isPower() && mstruct[i][0].isUnit() && mstruct[i][1].isInteger()) { add(mstruct[i][0].unit(), mstruct[i][1].number().intValue(), mstruct[i][0].prefix()); } else if(mstruct[i].isMultiplication()) { for(size_t i2 = 0; i2 < mstruct.size(); i2++) { if(mstruct[i][i2].isUnit()) { add(mstruct[i][i2].unit(), 1, mstruct[i][i2].prefix()); } else if(mstruct[i][i2].isPower() && mstruct[i][i2][0].isUnit() && mstruct[i][i2][1].isInteger()) { add(mstruct[i][i2][0].unit(), mstruct[i][i2][1].number().intValue(), mstruct[i][i2][0].prefix()); } else { had_errors = true; } } } else { had_errors = true; } } } else { had_errors = true; } if(had_errors) CALCULATOR->error(false, _("Error(s) in unitexpression."), NULL); setChanged(true); } void CompositeUnit::clear() { for(size_t i = 0; i < units.size(); i++) { delete units[i]; } units.clear(); } libqalculate-2.8.2/libqalculate/util.h0000644000175000017500000001076713254136443014716 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef UTIL_H #define UTIL_H #include /* threads */ #ifdef _WIN32 # undef WINVER # undef _WIN32_WINNT # define WINVER 0x0600 # define _WIN32_WINNT 0x0600 # include # include #else # include # include #endif #ifdef _WIN32 #define srand48 srand #endif /** @file */ /// \cond struct eqstr { bool operator()(const char *s1, const char *s2) const; }; /// \endcond void sleep_ms(int milliseconds); string& gsub(const string &pattern, const string &sub, string &str); string& gsub(const char *pattern, const char *sub, string &str); string d2s(double value, int precision = 100); string i2s(int value); string i2s(long int value); string i2s(unsigned int value); string i2s(unsigned long int value); const char *b2yn(bool b, bool capital = true); const char *b2tf(bool b, bool capital = true); const char *b2oo(bool b, bool capital = true); string p2s(void *o); int s2i(const string& str); int s2i(const char *str); void *s2p(const string& str); void *s2p(const char *str); void now(int &hour, int &min, int &sec); size_t find_ending_bracket(const string &str, size_t start, int *missing = NULL); char op2ch(MathOperation op); string& wrap_p(string &str); string& remove_blanks(string &str); string& remove_duplicate_blanks(string &str); string& remove_blank_ends(string &str); string& remove_parenthesis(string &str); bool is_in(const char *str, char c); bool is_not_in(const char *str, char c); bool is_in(const string &str, char c); bool is_not_in(const string &str, char c); int sign_place(string *str, size_t start = 0); int gcd(int i1, int i2); #ifdef _WIN32 string utf8_encode(const wstring &wstr); #endif char *locale_to_utf8(const char *str); char *locale_from_utf8(const char *str); char *utf8_strdown(const char *str, int l = -1); size_t unicode_length(const string &str); size_t unicode_length(const char *str); bool text_length_is_one(const string &str); bool equalsIgnoreCase(const string &str1, const string &str2); bool equalsIgnoreCase(const string &str1, const char *str2); void parse_qalculate_version(string qalculate_version, int *qalculate_version_numbers); string getOldLocalDir(); string getLocalDir(); string getPackageDataDir(); string getGlobalDefinitionsDir(); string getPackageLocaleDir(); string getLocalDataDir(); string getLocalTmpDir(); string buildPath(string dir, string filename); string buildPath(string dir1, string dir2, string filename); string buildPath(string dir1, string dir2, string dir3, string filename); bool dirExists(string dirpath); bool fileExists(string dirpath); bool makeDir(string dirpath); bool recursiveMakeDir(string dirpath); bool removeDir(string dirpath); bool move_file(const char *from_file, const char *to_file); int checkAvailableVersion(const char *version_id, const char *current_version, string *avaible_version = NULL, int timeout = 5); class Thread { public: Thread(); virtual ~Thread(); bool start(); bool cancel(); template bool write(T data) { #ifdef _WIN32 int ret = PostThreadMessage(m_threadID, WM_USER, (WPARAM) data, 0); return (ret != 0); #else int ret = fwrite(&data, sizeof(T), 1, m_pipe_w); if(ret != 1) return false; fflush(m_pipe_w); return true; #endif } // FIXME: this is technically wrong -- needs memory barriers (std::atomic?) volatile bool running; protected: virtual void run() = 0; void enableAsynchronousCancel(); template T read() { #ifdef _WIN32 MSG msg; int ret = GetMessage(&msg, NULL, WM_USER, WM_USER); return (T) msg.wParam; #else T x; fread(&x, sizeof(T), 1, m_pipe_r); return x; #endif } template bool read(T *data) { #ifdef _WIN32 MSG msg; int ret = GetMessage(&msg, NULL, WM_USER, WM_USER); if(ret == 0 || ret == -1) return false; *data = (T) msg.wParam; return true; #else int ret = fread(data, sizeof(T), 1, m_pipe_r); return ret == 1; #endif } private: #ifdef _WIN32 static DWORD WINAPI doRun(void *data); HANDLE m_thread, m_threadReadyEvent; DWORD m_threadID; #else static void doCleanup(void *data); static void *doRun(void *data); pthread_t m_thread; pthread_attr_t m_thread_attr; FILE *m_pipe_r, *m_pipe_w; #endif }; #endif libqalculate-2.8.2/libqalculate/util.cc0000644000175000017500000005465613371514741015062 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "util.h" #include #include "Number.h" #include #include #include #include #include #include #include #ifdef HAVE_LIBCURL # include #endif #ifdef HAVE_ICU # include #endif #include #ifdef _WIN32 # include # include # include # include # include # include # include #else # ifdef HAVE_PIPE2 # include # endif # include # include # include #endif bool eqstr::operator()(const char *s1, const char *s2) const { return strcmp(s1, s2) == 0; } #ifdef HAVE_ICU UCaseMap *ucm = NULL; #endif char buffer[20000]; void sleep_ms(int milliseconds) { #ifdef _WIN32 Sleep(milliseconds); #elif _POSIX_C_SOURCE >= 199309L struct timespec ts; ts.tv_sec = milliseconds / 1000; ts.tv_nsec = (milliseconds % 1000) * 1000000; nanosleep(&ts, NULL); #else usleep(milliseconds * 1000); #endif } void now(int &hour, int &min, int &sec) { time_t t = time(NULL); struct tm *lt = localtime(&t); hour = lt->tm_hour; min = lt->tm_min; sec = lt->tm_sec; } string& gsub(const string &pattern, const string &sub, string &str) { size_t i = str.find(pattern); while(i != string::npos) { str.replace(i, pattern.length(), sub); i = str.find(pattern, i + sub.length()); } return str; } string& gsub(const char *pattern, const char *sub, string &str) { size_t i = str.find(pattern); while(i != string::npos) { str.replace(i, strlen(pattern), string(sub)); i = str.find(pattern, i + strlen(sub)); } return str; } string& remove_blanks(string &str) { size_t i = str.find_first_of(SPACES, 0); while(i != string::npos) { str.erase(i, 1); i = str.find_first_of(SPACES, i); } return str; } string& remove_duplicate_blanks(string &str) { size_t i = str.find_first_of(SPACES, 0); while(i != string::npos) { if(i == 0 || is_in(SPACES, str[i - 1])) { str.erase(i, 1); } else { i++; } i = str.find_first_of(SPACES, i); } return str; } string& remove_blank_ends(string &str) { size_t i = str.find_first_not_of(SPACES); size_t i2 = str.find_last_not_of(SPACES); if(i != string::npos && i2 != string::npos) { if(i > 0 || i2 < str.length() - 1) { str = str.substr(i, i2 - i + 1); } } else { str.resize(0); } return str; } string& remove_parenthesis(string &str) { if(str[0] == LEFT_PARENTHESIS_CH && str[str.length() - 1] == RIGHT_PARENTHESIS_CH) { str = str.substr(1, str.length() - 2); return remove_parenthesis(str); } return str; } string d2s(double value, int precision) { // qgcvt(value, precision, buffer); sprintf(buffer, "%.*G", precision, value); string stmp = buffer; // gsub("e", "E", stmp); return stmp; } string p2s(void *o) { sprintf(buffer, "%p", o); string stmp = buffer; return stmp; } string i2s(int value) { // char buffer[10]; sprintf(buffer, "%i", value); string stmp = buffer; return stmp; } string i2s(long int value) { sprintf(buffer, "%li", value); string stmp = buffer; return stmp; } string i2s(unsigned int value) { sprintf(buffer, "%u", value); string stmp = buffer; return stmp; } string i2s(unsigned long int value) { sprintf(buffer, "%lu", value); string stmp = buffer; return stmp; } const char *b2yn(bool b, bool capital) { if(capital) { if(b) return _("Yes"); return _("No"); } if(b) return _("yes"); return _("no"); } const char *b2tf(bool b, bool capital) { if(capital) { if(b) return _("True"); return _("False"); } if(b) return _("true"); return _("false"); } const char *b2oo(bool b, bool capital) { if(capital) { if(b) return _("On"); return _("Off"); } if(b) return _("on"); return _("off"); } int s2i(const string& str) { return strtol(str.c_str(), NULL, 10); } int s2i(const char *str) { return strtol(str, NULL, 10); } void *s2p(const string& str) { void *p; sscanf(str.c_str(), "%p", &p); return p; } void *s2p(const char *str) { void *p; sscanf(str, "%p", &p); return p; } size_t find_ending_bracket(const string &str, size_t start, int *missing) { int i_l = 1; while(true) { start = str.find_first_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, start); if(start == string::npos) { if(missing) *missing = i_l; return string::npos; } if(str[start] == LEFT_PARENTHESIS_CH) { i_l++; } else { i_l--; if(!i_l) { if(missing) *missing = i_l; return start; } } start++; } } char op2ch(MathOperation op) { switch(op) { case OPERATION_ADD: return PLUS_CH; case OPERATION_SUBTRACT: return MINUS_CH; case OPERATION_MULTIPLY: return MULTIPLICATION_CH; case OPERATION_DIVIDE: return DIVISION_CH; case OPERATION_RAISE: return POWER_CH; case OPERATION_EXP10: return EXP_CH; default: return ' '; } } string& wrap_p(string &str) { str.insert(str.begin(), 1, LEFT_PARENTHESIS_CH); str += RIGHT_PARENTHESIS_CH; return str; } bool is_in(const char *str, char c) { for(size_t i = 0; i < strlen(str); i++) { if(str[i] == c) return true; } return false; } bool is_not_in(const char *str, char c) { for(size_t i = 0; i < strlen(str); i++) { if(str[i] == c) return false; } return true; } bool is_in(const string &str, char c) { for(size_t i = 0; i < str.length(); i++) { if(str[i] == c) return true; } return false; } bool is_not_in(const string &str, char c) { for(size_t i = 0; i < str.length(); i++) { if(str[i] == c) return false; } return true; } int sign_place(string *str, size_t start) { size_t i = str->find_first_of(OPERATORS, start); if(i != string::npos) return i; else return -1; } int gcd(int i1, int i2) { if(i1 < 0) i1 = -i1; if(i2 < 0) i2 = -i2; if(i1 == i2) return i2; int i3; if(i2 > i1) { i3 = i2; i2 = i1; i1 = i3; } while((i3 = i1 % i2) != 0) { i1 = i2; i2 = i3; } return i2; } size_t unicode_length(const string &str) { size_t l = str.length(), l2 = 0; for(size_t i = 0; i < l; i++) { if(str[i] > 0 || (unsigned char) str[i] >= 0xC0) { l2++; } } return l2; } size_t unicode_length(const char *str) { size_t l = strlen(str), l2 = 0; for(size_t i = 0; i < l; i++) { if(str[i] > 0 || (unsigned char) str[i] >= 0xC0) { l2++; } } return l2; } bool text_length_is_one(const string &str) { if(str.empty()) return false; if(str.length() == 1) return true; if(str[0] >= 0) return false; for(size_t i = 1; i < str.length(); i++) { if(str[i] > 0 || (unsigned char) str[i] >= 0xC0) { return false; } } return true; } bool equalsIgnoreCase(const string &str1, const string &str2) { if(str1.empty() || str2.empty()) return false; for(size_t i1 = 0, i2 = 0; i1 < str1.length() || i2 < str2.length(); i1++, i2++) { if(i1 >= str1.length() || i2 >= str2.length()) return false; if((str1[i1] < 0 && i1 + 1 < str1.length()) || (str2[i2] < 0 && i2 + 1 < str2.length())) { size_t iu1 = 1, iu2 = 1; if(str1[i1] < 0) { while(iu1 + i1 < str1.length() && str1[i1 + iu1] < 0) { iu1++; } } if(str2[i2] < 0) { while(iu2 + i2 < str2.length() && str2[i2 + iu2] < 0) { iu2++; } } bool isequal = (iu1 == iu2); if(isequal) { for(size_t i = 0; i < iu1; i++) { if(str1[i1 + i] != str2[i2 + i]) { isequal = false; break; } } } if(!isequal) { char *gstr1 = utf8_strdown(str1.c_str() + (sizeof(char) * i1)); char *gstr2 = utf8_strdown(str2.c_str() + (sizeof(char) * i2)); if(!gstr1 || !gstr2) return false; bool b = strcmp(gstr1, gstr2) == 0; free(gstr1); free(gstr2); return b; } i1 += iu1 - 1; i2 += iu2 - 1; } else if(str1[i1] != str2[i2] && !((str1[i1] >= 'a' && str1[i1] <= 'z') && str1[i1] - 32 == str2[i2]) && !((str1[i1] <= 'Z' && str1[i1] >= 'A') && str1[i1] + 32 == str2[i2])) { return false; } } return true; } bool equalsIgnoreCase(const string &str1, const char *str2) { if(str1.empty() || strlen(str2) == 0) return false; for(size_t i1 = 0, i2 = 0; i1 < str1.length() || i2 < strlen(str2); i1++, i2++) { if(i1 >= str1.length() || i2 >= strlen(str2)) return false; if((str1[i1] < 0 && i1 + 1 < str1.length()) || (str2[i2] < 0 && i2 + 1 < strlen(str2))) { size_t iu1 = 1, iu2 = 1; if(str1[i1] < 0) { while(iu1 + i1 < str1.length() && str1[i1 + iu1] < 0) { iu1++; } } if(str2[i2] < 0) { while(iu2 + i2 < strlen(str2) && str2[i2 + iu2] < 0) { iu2++; } } bool isequal = (iu1 == iu2); if(isequal) { for(size_t i = 0; i < iu1; i++) { if(str1[i1 + i] != str2[i2 + i]) { isequal = false; break; } } } if(!isequal) { char *gstr1 = utf8_strdown(str1.c_str() + (sizeof(char) * i1)); char *gstr2 = utf8_strdown(str2 + (sizeof(char) * i2)); if(!gstr1 || !gstr2) return false; bool b = strcmp(gstr1, gstr2) == 0; free(gstr1); free(gstr2); return b; } i1 += iu1 - 1; i2 += iu2 - 1; } else if(str1[i1] != str2[i2] && !((str1[i1] >= 'a' && str1[i1] <= 'z') && str1[i1] - 32 == str2[i2]) && !((str1[i1] <= 'Z' && str1[i1] >= 'A') && str1[i1] + 32 == str2[i2])) { return false; } } return true; } void parse_qalculate_version(string qalculate_version, int *qalculate_version_numbers) { for(size_t i = 0; i < 3; i++) { size_t dot_i = qalculate_version.find("."); if(dot_i == string::npos) { qalculate_version_numbers[i] = s2i(qalculate_version); break; } qalculate_version_numbers[i] = s2i(qalculate_version.substr(0, dot_i)); qalculate_version = qalculate_version.substr(dot_i + 1, qalculate_version.length() - (dot_i + 1)); } } #ifdef _WIN32 string utf8_encode(const wstring &wstr) { if(wstr.empty()) return string(); int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int) wstr.size(), NULL, 0, NULL, NULL); std::string strTo(size_needed, 0); WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int) wstr.size(), &strTo[0], size_needed, NULL, NULL); return strTo; } #endif string getOldLocalDir() { #ifdef _WIN32 char path[MAX_PATH]; SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, path); string str = path; return str + "\\Qalculate"; #else const char *homedir; if ((homedir = getenv("HOME")) == NULL) { homedir = getpwuid(getuid())->pw_dir; } return string(homedir) + "/.qalculate"; #endif } string getLocalDir() { #ifdef _WIN32 char path[MAX_PATH]; SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, path); string str = path; return str + "\\Qalculate"; #else const char *homedir; if((homedir = getenv("XDG_CONFIG_HOME")) == NULL) { return string(getpwuid(getuid())->pw_dir) + "/.config/qalculate"; } return string(homedir) + "/qalculate"; #endif } string getLocalDataDir() { #ifdef _WIN32 char path[MAX_PATH]; SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, path); string str = path; return str + "\\Qalculate"; #else const char *homedir; if((homedir = getenv("XDG_DATA_HOME")) == NULL) { return string(getpwuid(getuid())->pw_dir) + "/.local/share/qalculate"; } return string(homedir) + "/qalculate"; #endif } string getLocalTmpDir() { #ifdef _WIN32 char path[MAX_PATH]; SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, path); string str = path; str += "\\cache"; _mkdir(str.c_str()); return str + "\\Qalculate"; #else const char *homedir; if((homedir = getenv("XDG_CACHE_HOME")) == NULL) { return string(getpwuid(getuid())->pw_dir) + "/.cache/qalculate"; } return string(homedir) + "/qalculate"; #endif } bool move_file(const char *from_file, const char *to_file) { #ifdef _WIN32 return MoveFile(from_file, to_file) == 0; #else ifstream source(from_file); if(source.fail()) { source.close(); return false; } ofstream dest(to_file); if(dest.fail()) { source.close(); dest.close(); return false; } dest << source.rdbuf(); source.close(); dest.close(); struct stat stats_from; if(stat(from_file, &stats_from) == 0) { struct utimbuf to_times; to_times.actime = stats_from.st_atime; to_times.modtime = stats_from.st_mtime; utime(to_file, &to_times); } remove(from_file); return true; #endif } string getPackageDataDir() { #ifndef WIN32 return PACKAGE_DATA_DIR; #else char exepath[MAX_PATH]; GetModuleFileName(NULL, exepath, MAX_PATH); string datadir(exepath); datadir.resize(datadir.find_last_of('\\')); if (datadir.substr(datadir.length() - 4) == "\\bin") { datadir.resize(datadir.find_last_of('\\')); datadir += "\\share"; } else if(datadir.substr(datadir.length() - 6) == "\\.libs") { datadir.resize(datadir.find_last_of('\\')); datadir.resize(datadir.find_last_of('\\')); } return datadir; #endif } string getGlobalDefinitionsDir() { #ifndef WIN32 return string(PACKAGE_DATA_DIR) + "/qalculate"; #else char exepath[MAX_PATH]; GetModuleFileName(NULL, exepath, MAX_PATH); string datadir(exepath); bool is_qalc = datadir.substr(datadir.length() - 8) == "qalc.exe"; datadir.resize(datadir.find_last_of('\\')); if(datadir.substr(datadir.length() - 4) == "\\bin") { datadir.resize(datadir.find_last_of('\\')); datadir += "\\share\\qalculate"; return datadir; } else if(datadir.substr(datadir.length() - 6) == "\\.libs") { datadir.resize(datadir.find_last_of('\\')); datadir.resize(datadir.find_last_of('\\')); if(!is_qalc) { datadir.resize(datadir.find_last_of('\\')); datadir += "\\libqalculate"; if(!dirExists(datadir)) { datadir += "-"; datadir += VERSION; } } return datadir + "\\data"; } return datadir + "\\definitions"; #endif } string getPackageLocaleDir() { #ifndef WIN32 return PACKAGE_LOCALE_DIR; #else char exepath[MAX_PATH]; GetModuleFileName(NULL, exepath, MAX_PATH); string datadir(exepath); datadir.resize(datadir.find_last_of('\\')); if (datadir.substr(datadir.length() - 4) == "\\bin" || datadir.substr(datadir.length() - 6) == "\\.libs") { datadir.resize(datadir.find_last_of('\\')); return datadir + "\\share\\locale"; } return datadir + "\\locale"; #endif } string buildPath(string dir, string filename) { #ifdef WIN32 return dir + '\\' + filename; #else return dir + '/' + filename; #endif } string buildPath(string dir1, string dir2, string filename) { #ifdef WIN32 return dir1 + '\\' + dir2 + '\\' + filename; #else return dir1 + '/' + dir2 + '/' + filename; #endif } string buildPath(string dir1, string dir2, string dir3, string filename) { #ifdef WIN32 return dir1 + '\\' + dir2 + '\\' + dir3 + '\\' + filename; #else return dir1 + '/' + dir2 + '/' + dir3 + '/' + filename; #endif } bool dirExists(string dirpath) { return fileExists(dirpath); } bool fileExists(string filepath) { #ifdef WIN32 struct _stat info; return _stat(filepath.c_str(), &info) == 0; #else struct stat info; return stat(filepath.c_str(), &info) == 0; #endif } bool makeDir(string dirpath) { #ifdef WIN32 return _mkdir(dirpath.c_str()) == 0; #else return mkdir(dirpath.c_str(), S_IRWXU) == 0; #endif } bool recursiveMakeDir(string dirpath) { #ifdef WIN32 return _mkdir(dirpath.c_str()) == 0; #else char tmp[256]; char *p = NULL; size_t len; snprintf(tmp, sizeof(tmp), "%s", dirpath.c_str()); len = strlen(tmp); if(tmp[len - 1] == '/') tmp[len - 1] = 0; for(p = tmp + 1; *p; p++) { if(*p == '/') { *p = 0; if(!dirExists(tmp)) mkdir(tmp, S_IRWXU); *p = '/'; } } return mkdir(tmp, S_IRWXU) == 0; #endif } bool removeDir(string dirpath) { #ifdef WIN32 return _rmdir(dirpath.c_str()) == 0; #else return rmdir(dirpath.c_str()) == 0; #endif } char *locale_from_utf8(const char *str) { iconv_t conv = iconv_open("", "UTF-8"); if(conv == (iconv_t) -1) return NULL; size_t inlength = strlen(str); size_t outlength = inlength * 4; char *dest, *buffer; buffer = dest = (char*) malloc((outlength + 4) * sizeof(char)); if(!buffer) return NULL; size_t err = iconv(conv, (char **) &str, &inlength, &buffer, &outlength); if(err != (size_t) -1) err = iconv(conv, NULL, &inlength, &buffer, &outlength); iconv_close(conv); memset(buffer, 0, 4); if(err == (size_t) -1) {free(dest); return NULL;} return dest; } char *locale_to_utf8(const char *str) { iconv_t conv = iconv_open("UTF-8", ""); if(conv == (iconv_t) -1) return NULL; size_t inlength = strlen(str); size_t outlength = inlength * 4; char *dest, *buffer; buffer = dest = (char*) malloc((outlength + 4) * sizeof(char)); if(!buffer) return NULL; size_t err = iconv(conv, (char**) &str, &inlength, &buffer, &outlength); if(err != (size_t) -1) err = iconv(conv, NULL, &inlength, &buffer, &outlength); iconv_close(conv); memset(buffer, 0, 4 * sizeof(char)); if(err == (size_t) -1) {free(dest); return NULL;} return dest; } char *utf8_strdown(const char *str, int l) { #ifdef HAVE_ICU if(!ucm) return NULL; UErrorCode err = U_ZERO_ERROR; size_t inlength = l <= 0 ? strlen(str) : (size_t) l; size_t outlength = inlength + 4; char *buffer = (char*) malloc(outlength * sizeof(char)); int32_t length = ucasemap_utf8ToLower(ucm, buffer, outlength, str, inlength, &err); if(U_SUCCESS(err)) { return buffer; } else if(err == U_BUFFER_OVERFLOW_ERROR) { outlength = length + 4; buffer = (char*) realloc(buffer, outlength * sizeof(char)); err = U_ZERO_ERROR; ucasemap_utf8ToLower(ucm, buffer, outlength, str, inlength, &err); if(U_SUCCESS(err)) { return buffer; } } return NULL; #else return NULL; #endif } extern size_t write_data(void *ptr, size_t size, size_t nmemb, string *sbuffer); int checkAvailableVersion(const char *version_id, const char *current_version, string *available_version, int timeout) { #ifdef HAVE_LIBCURL string sbuffer; char error_buffer[CURL_ERROR_SIZE]; CURL *curl; CURLcode res; long int file_time; curl_global_init(CURL_GLOBAL_DEFAULT); curl = curl_easy_init(); if(!curl) {return -1;} curl_easy_setopt(curl, CURLOPT_URL, "https://qalculate.github.io/CURRENT_VERSIONS"); curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &sbuffer); curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, error_buffer); curl_easy_setopt(curl, CURLOPT_FILETIME, &file_time); #ifdef _WIN32 char exepath[MAX_PATH]; GetModuleFileName(NULL, exepath, MAX_PATH); string datadir(exepath); datadir.resize(datadir.find_last_of('\\')); if(datadir.substr(datadir.length() - 4) != "\\bin" && datadir.substr(datadir.length() - 6) != "\\.libs") { string cainfo = buildPath(datadir, "ssl", "certs", "ca-bundle.crt"); gsub("\\", "/", cainfo); curl_easy_setopt(curl, CURLOPT_CAINFO, cainfo.c_str()); } #endif res = curl_easy_perform(curl); curl_easy_cleanup(curl); curl_global_cleanup(); if(res != CURLE_OK || sbuffer.empty()) {return -1;} size_t i = sbuffer.find(version_id); if(i == string::npos) return -1; size_t i2 = sbuffer.find('\n', i + strlen(version_id) + 1); string s_version; if(i2 == string::npos) s_version = sbuffer.substr(i + strlen(version_id) + 1); else s_version = sbuffer.substr(i + strlen(version_id) + 1, i2 - (i + strlen(version_id) + 1)); remove_blank_ends(s_version); if(s_version.empty()) return -1; if(available_version) *available_version = s_version; if(s_version != current_version) { vector version_parts_old, version_parts_new; string s_old_version = current_version; while((i = s_old_version.find('.', 0)) != string::npos) { version_parts_old.push_back(s2i(s_old_version.substr(0, i))); s_old_version = s_old_version.substr(i + 1); } i = s_old_version.find_first_not_of("0123456789", 1); if(i != string::npos) { version_parts_old.push_back(s2i(s_old_version.substr(0, i))); s_old_version = s_old_version.substr(i + 1); } version_parts_old.push_back(s2i(s_old_version)); while((i = s_version.find('.', 0)) != string::npos) { version_parts_new.push_back(s2i(s_version.substr(0, i))); s_version = s_version.substr(i + 1); } i = s_version.find_first_not_of("0123456789", 1); if(i != string::npos) { version_parts_new.push_back(s2i(s_version.substr(0, i))); s_version = s_version.substr(i + 1); } version_parts_new.push_back(s2i(s_version)); for(i = 0; i < version_parts_new.size(); i++) { if(i == version_parts_old.size() || version_parts_new[i] > version_parts_old[i]) return true; else if(version_parts_new[i] < version_parts_old[i]) return false; } } return 0; #else return -1; #endif } #ifdef _WIN32 Thread::Thread() : running(false), m_thread(NULL), m_threadReadyEvent(NULL), m_threadID(0) { m_threadReadyEvent = CreateEvent(NULL, false, false, NULL); } Thread::~Thread() { cancel(); CloseHandle(m_threadReadyEvent); } void Thread::enableAsynchronousCancel() {} DWORD WINAPI Thread::doRun(void *data) { // create thread message queue MSG msg; PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); Thread *thread = (Thread *) data; SetEvent(thread->m_threadReadyEvent); thread->run(); thread->running = false; return 0; } bool Thread::start() { m_thread = CreateThread(NULL, 0, Thread::doRun, this, 0, &m_threadID); running = (m_thread != NULL); if(!running) return false; WaitForSingleObject(m_threadReadyEvent, INFINITE); return running; } bool Thread::cancel() { if(!running) return true; // FIXME: this is dangerous int ret = TerminateThread(m_thread, 0); if(ret == 0) return false; CloseHandle(m_thread); m_thread = NULL; m_threadID = 0; running = false; return true; } #else Thread::Thread() : running(false), m_pipe_r(NULL), m_pipe_w(NULL) { pthread_attr_init(&m_thread_attr); int pipe_wr[] = {0, 0}; #ifdef HAVE_PIPE2 if(pipe2(pipe_wr, O_CLOEXEC) == 0) { #else if(pipe(pipe_wr) == 0) { #endif m_pipe_r = fdopen(pipe_wr[0], "r"); m_pipe_w = fdopen(pipe_wr[1], "w"); } } Thread::~Thread() { cancel(); fclose(m_pipe_r); fclose(m_pipe_w); pthread_attr_destroy(&m_thread_attr); } void Thread::doCleanup(void *data) { Thread *thread = (Thread *) data; thread->running = false; } void Thread::enableAsynchronousCancel() { pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); } void *Thread::doRun(void *data) { pthread_cleanup_push(&Thread::doCleanup, data); Thread *thread = (Thread *) data; thread->run(); pthread_cleanup_pop(1); return NULL; } bool Thread::start() { if(running) return true; running = pthread_create(&m_thread, &m_thread_attr, &Thread::doRun, this) == 0; return running; } bool Thread::cancel() { if(!running) return true; running = pthread_cancel(m_thread) != 0; return !running; } #endif libqalculate-2.8.2/libqalculate/Makefile.in0000644000175000017500000006567113401033103015620 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # src/libqalculate/Makefile.am for qalculate # VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libqalculate ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(libqalculateinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libqalculateincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libqalculate_la_DEPENDENCIES = am_libqalculate_la_OBJECTS = Function.lo Calculator.lo DataSet.lo \ Variable.lo ExpressionItem.lo Number.lo MathStructure.lo \ Prefix.lo util.lo Unit.lo BuiltinFunctions.lo \ QalculateDateTime.lo libqalculate_la_OBJECTS = $(am_libqalculate_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libqalculate_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libqalculate_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/BuiltinFunctions.Plo \ ./$(DEPDIR)/Calculator.Plo ./$(DEPDIR)/DataSet.Plo \ ./$(DEPDIR)/ExpressionItem.Plo ./$(DEPDIR)/Function.Plo \ ./$(DEPDIR)/MathStructure.Plo ./$(DEPDIR)/Number.Plo \ ./$(DEPDIR)/Prefix.Plo ./$(DEPDIR)/QalculateDateTime.Plo \ ./$(DEPDIR)/Unit.Plo ./$(DEPDIR)/Variable.Plo \ ./$(DEPDIR)/util.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libqalculate_la_SOURCES) DIST_SOURCES = $(libqalculate_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libqalculateinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEST = @QALCULATE_TEST@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libqalculate.la libqalculate_la_SOURCES = \ Function.cc Calculator.cc DataSet.cc \ Variable.cc ExpressionItem.cc Number.cc MathStructure.cc \ Prefix.cc support.h util.cc Unit.cc BuiltinFunctions.cc \ QalculateDateTime.cc libqalculateincludedir = $(includedir)/libqalculate libqalculateinclude_HEADERS = \ Function.h Calculator.h DataSet.h Variable.h \ ExpressionItem.h Number.h MathStructure.h Prefix.h \ util.h includes.h Unit.h BuiltinFunctions.h \ QalculateDateTime.h qalculate.h libqalculate_la_LDFLAGS = -version-info $(QALCULATE_CURRENT):$(QALCULATE_REVISION):$(QALCULATE_AGE) -no-undefined libqalculate_la_LIBADD = \ @LIBCURL_LIBS@ @LIBXML_LIBS@ @ICU_LIBS@ @LTLIBINTL@ @LTLIBICONV@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ @LIBCURL_CFLAGS@ @LIBXML_CFLAGS@ @ICU_CFLAGS@ all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libqalculate/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libqalculate/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libqalculate.la: $(libqalculate_la_OBJECTS) $(libqalculate_la_DEPENDENCIES) $(EXTRA_libqalculate_la_DEPENDENCIES) $(AM_V_CXXLD)$(libqalculate_la_LINK) -rpath $(libdir) $(libqalculate_la_OBJECTS) $(libqalculate_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BuiltinFunctions.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Calculator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DataSet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExpressionItem.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Function.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MathStructure.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Number.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Prefix.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/QalculateDateTime.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Unit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Variable.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libqalculateincludeHEADERS: $(libqalculateinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(libqalculateinclude_HEADERS)'; test -n "$(libqalculateincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libqalculateincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libqalculateincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libqalculateincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libqalculateincludedir)" || exit $$?; \ done uninstall-libqalculateincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libqalculateinclude_HEADERS)'; test -n "$(libqalculateincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libqalculateincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libqalculateincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/BuiltinFunctions.Plo -rm -f ./$(DEPDIR)/Calculator.Plo -rm -f ./$(DEPDIR)/DataSet.Plo -rm -f ./$(DEPDIR)/ExpressionItem.Plo -rm -f ./$(DEPDIR)/Function.Plo -rm -f ./$(DEPDIR)/MathStructure.Plo -rm -f ./$(DEPDIR)/Number.Plo -rm -f ./$(DEPDIR)/Prefix.Plo -rm -f ./$(DEPDIR)/QalculateDateTime.Plo -rm -f ./$(DEPDIR)/Unit.Plo -rm -f ./$(DEPDIR)/Variable.Plo -rm -f ./$(DEPDIR)/util.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libqalculateincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/BuiltinFunctions.Plo -rm -f ./$(DEPDIR)/Calculator.Plo -rm -f ./$(DEPDIR)/DataSet.Plo -rm -f ./$(DEPDIR)/ExpressionItem.Plo -rm -f ./$(DEPDIR)/Function.Plo -rm -f ./$(DEPDIR)/MathStructure.Plo -rm -f ./$(DEPDIR)/Number.Plo -rm -f ./$(DEPDIR)/Prefix.Plo -rm -f ./$(DEPDIR)/QalculateDateTime.Plo -rm -f ./$(DEPDIR)/Unit.Plo -rm -f ./$(DEPDIR)/Variable.Plo -rm -f ./$(DEPDIR)/util.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libqalculateincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES \ install-libqalculateincludeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-libqalculateincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libqalculate-2.8.2/libqalculate/QalculateDateTime.h0000644000175000017500000001024213303432253017246 00000000000000/* Qalculate Copyright (C) 2018 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef QALCULATE_DATE_TIME_H #define QALCULATE_DATE_TIME_H #include "Number.h" #include "includes.h" class QalculateDateTime { protected: long int i_year; long int i_month; long int i_day; long int i_hour; long int i_min; Number n_sec; bool b_time; public: QalculateDateTime(); QalculateDateTime(long int initialyear, int initialmonth, int initialday); QalculateDateTime(const Number &initialtimestamp); QalculateDateTime(string date_string); QalculateDateTime(const QalculateDateTime &date); bool operator > (const QalculateDateTime &date2) const; bool operator < (const QalculateDateTime &date2) const; bool operator >= (const QalculateDateTime &date2) const; bool operator <= (const QalculateDateTime &date2) const; bool operator != (const QalculateDateTime &date2) const; bool operator == (const QalculateDateTime &date2) const; bool isFutureDate() const; bool isPastDate() const; void setToCurrentDate(); void setToCurrentTime(); bool set(long int newyear, int newmonth, int newday); bool set(const Number &newtimestamp); bool set(string date_string); void set(const QalculateDateTime &date); string toISOString() const; string toLocalString() const; string print(const PrintOptions &po = default_print_options) const; long int year() const; long int month() const; long int day() const; long int hour() const; long int minute() const; const Number &second() const; void setYear(long int newyear); bool setTime(long int ihour, long int imin, const Number &nsec); bool timeIsSet() const; bool addDays(const Number &ndays); bool addMonths(const Number &nmonths); bool addYears(const Number &nyears); bool addHours(const Number &nhours); bool addMinutes(const Number &nminutes, bool remove_leap_second = true, bool convert_to_utc = true); bool addSeconds(const Number &seconds, bool count_leap_seconds = true, bool convert_to_utc = true); bool add(const QalculateDateTime &date); int weekday() const; int week(bool start_sunday = false) const; int yearday() const; Number timestamp(bool reverse_utc = false) const; Number secondsTo(const QalculateDateTime &date, bool count_leap_seconds = true, bool convert_to_utc = true) const; Number daysTo(const QalculateDateTime &date, int basis = 1, bool date_func = true, bool remove_leap_seconds = true) const; Number yearsTo(const QalculateDateTime &date, int basis = 1, bool date_func = true, bool remove_leap_seconds = true) const; string parsed_string; }; typedef enum { CALENDAR_GREGORIAN, CALENDAR_MILANKOVIC, CALENDAR_JULIAN, CALENDAR_ISLAMIC, CALENDAR_HEBREW, CALENDAR_EGYPTIAN, CALENDAR_PERSIAN, CALENDAR_COPTIC, CALENDAR_ETHIOPIAN, CALENDAR_INDIAN, CALENDAR_CHINESE } CalendarSystem; #define NUMBER_OF_CALENDARS 11 #define VERNAL_EQUINOX 0 #define SUMMER_SOLSTICE 90 #define AUTUMNAL_EXUINOX 180 #define WINTER_SOLSTICE 270 Number solarLongitude(const QalculateDateTime &date); QalculateDateTime findNextSolarLongitude(const QalculateDateTime &date, Number longitude); Number lunarPhase(const QalculateDateTime &date); QalculateDateTime findNextLunarPhase(const QalculateDateTime &date, Number phase); bool calendarToDate(QalculateDateTime &date, long int y, long int m, long int d, CalendarSystem ct); bool dateToCalendar(const QalculateDateTime &date, long int &y, long int &m, long int &d, CalendarSystem ct); int numberOfMonths(CalendarSystem ct); string monthName(long int month, CalendarSystem ct, bool append_number = false, bool append_leap = true); void chineseYearInfo(long int year, long int &cycle, long int &year_in_cycle, long int &stem, long int &branch); //epoch of 2697 BC long int chineseCycleYearToYear(long int cycle, long int year_in_cycle); int chineseStemBranchToCycleYear(long int stem, long int branch); string chineseStemName(long int stem); string chineseBranchName(long int branch); #endif libqalculate-2.8.2/libqalculate/BuiltinFunctions.h0000644000175000017500000003140413364017004017220 00000000000000 /* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef BUILTIN_FUNCTIONS_H #define BUILTIN_FUNCTIONS_H #include #include #define DECLARE_BUILTIN_FUNCTION(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ }; #define DECLARE_BUILTIN_FUNCTION_B(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsBoolean(const MathStructure&) const {return true;}\ }; #define DECLARE_BUILTIN_FUNCTION_PI(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsInteger(const MathStructure&, bool) const {return true;}\ bool representsPositive(const MathStructure&, bool) const {return true;}\ }; #define DECLARE_BUILTIN_FUNCTION_RPI(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsReal(const MathStructure&, bool) const;\ bool representsInteger(const MathStructure&, bool) const;\ bool representsNonNegative(const MathStructure&, bool) const;\ }; #define DECLARE_BUILTIN_FUNCTION_R(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsPositive(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNegative(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonNegative(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonPositive(const MathStructure &vargs, bool allow_units = false) const;\ bool representsInteger(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\ bool representsRational(const MathStructure &vargs, bool allow_units = false) const;\ bool representsReal(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonComplex(const MathStructure &vargs, bool allow_units = false) const;\ bool representsComplex(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonZero(const MathStructure &vargs, bool allow_units = false) const;\ bool representsEven(const MathStructure &vargs, bool allow_units = false) const;\ bool representsOdd(const MathStructure &vargs, bool allow_units = false) const;\ bool representsUndefined(const MathStructure &vargs) const;\ }; #define DECLARE_BUILTIN_FUNCTION_R2(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\ bool representsReal(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonComplex(const MathStructure &vargs, bool allow_units = false) const;\ }; #define DECLARE_BUILTIN_FUNCTION_R3(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\ bool representsReal(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonComplex(const MathStructure &vargs, bool allow_units = false) const;\ bool representsComplex(const MathStructure &vargs, bool allow_units = false) const;\ bool representsNonZero(const MathStructure &vargs, bool allow_units = false) const;\ }; #define DECLARE_BUILTIN_FUNCTION_R1(x) class x : public MathFunction { \ public: \ int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); \ x(); \ x(const x *function) {set(function);} \ ExpressionItem *copy() const {return new x(this);} \ bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\ }; DECLARE_BUILTIN_FUNCTION(VectorFunction) DECLARE_BUILTIN_FUNCTION(LimitsFunction) DECLARE_BUILTIN_FUNCTION(RankFunction) DECLARE_BUILTIN_FUNCTION(SortFunction) DECLARE_BUILTIN_FUNCTION(ComponentFunction) DECLARE_BUILTIN_FUNCTION_PI(DimensionFunction) DECLARE_BUILTIN_FUNCTION(MatrixFunction) DECLARE_BUILTIN_FUNCTION(MergeVectorsFunction) DECLARE_BUILTIN_FUNCTION(MatrixToVectorFunction) DECLARE_BUILTIN_FUNCTION(AreaFunction) DECLARE_BUILTIN_FUNCTION_PI(RowsFunction) DECLARE_BUILTIN_FUNCTION_PI(ColumnsFunction) DECLARE_BUILTIN_FUNCTION(RowFunction) DECLARE_BUILTIN_FUNCTION(ColumnFunction) DECLARE_BUILTIN_FUNCTION_PI(ElementsFunction) DECLARE_BUILTIN_FUNCTION(ElementFunction) DECLARE_BUILTIN_FUNCTION(TransposeFunction) DECLARE_BUILTIN_FUNCTION(IdentityFunction) DECLARE_BUILTIN_FUNCTION(DeterminantFunction) DECLARE_BUILTIN_FUNCTION(PermanentFunction) DECLARE_BUILTIN_FUNCTION(AdjointFunction) DECLARE_BUILTIN_FUNCTION(CofactorFunction) DECLARE_BUILTIN_FUNCTION(InverseFunction) DECLARE_BUILTIN_FUNCTION(MagnitudeFunction) DECLARE_BUILTIN_FUNCTION(HadamardFunction) DECLARE_BUILTIN_FUNCTION(EntrywiseFunction) DECLARE_BUILTIN_FUNCTION_R(FactorialFunction) DECLARE_BUILTIN_FUNCTION_R(DoubleFactorialFunction) DECLARE_BUILTIN_FUNCTION_R(MultiFactorialFunction) DECLARE_BUILTIN_FUNCTION(BinomialFunction) DECLARE_BUILTIN_FUNCTION(BitXorFunction) DECLARE_BUILTIN_FUNCTION_B(XorFunction) DECLARE_BUILTIN_FUNCTION(BitCmpFunction) DECLARE_BUILTIN_FUNCTION_B(OddFunction) DECLARE_BUILTIN_FUNCTION_B(EvenFunction) DECLARE_BUILTIN_FUNCTION(ShiftFunction) DECLARE_BUILTIN_FUNCTION_R(AbsFunction) DECLARE_BUILTIN_FUNCTION(GcdFunction) DECLARE_BUILTIN_FUNCTION(LcmFunction) DECLARE_BUILTIN_FUNCTION_R(SignumFunction) DECLARE_BUILTIN_FUNCTION_R(HeavisideFunction) DECLARE_BUILTIN_FUNCTION_R(DiracFunction) DECLARE_BUILTIN_FUNCTION_R(RoundFunction) DECLARE_BUILTIN_FUNCTION_R(FloorFunction) DECLARE_BUILTIN_FUNCTION_R(CeilFunction) DECLARE_BUILTIN_FUNCTION_R(TruncFunction) DECLARE_BUILTIN_FUNCTION(NumeratorFunction) DECLARE_BUILTIN_FUNCTION(DenominatorFunction) DECLARE_BUILTIN_FUNCTION(IntFunction) DECLARE_BUILTIN_FUNCTION(FracFunction) DECLARE_BUILTIN_FUNCTION(RemFunction) DECLARE_BUILTIN_FUNCTION(ModFunction) DECLARE_BUILTIN_FUNCTION(PolynomialUnitFunction) DECLARE_BUILTIN_FUNCTION(PolynomialPrimpartFunction) DECLARE_BUILTIN_FUNCTION(PolynomialContentFunction) DECLARE_BUILTIN_FUNCTION(CoeffFunction) DECLARE_BUILTIN_FUNCTION(LCoeffFunction) DECLARE_BUILTIN_FUNCTION(TCoeffFunction) DECLARE_BUILTIN_FUNCTION(DegreeFunction) DECLARE_BUILTIN_FUNCTION(LDegreeFunction) DECLARE_BUILTIN_FUNCTION_R(ReFunction) DECLARE_BUILTIN_FUNCTION_R(ImFunction) DECLARE_BUILTIN_FUNCTION_R2(ArgFunction) DECLARE_BUILTIN_FUNCTION(IntervalFunction) DECLARE_BUILTIN_FUNCTION_R(SqrtFunction) DECLARE_BUILTIN_FUNCTION(CbrtFunction) DECLARE_BUILTIN_FUNCTION_R(RootFunction) DECLARE_BUILTIN_FUNCTION(SquareFunction) DECLARE_BUILTIN_FUNCTION(ExpFunction) DECLARE_BUILTIN_FUNCTION_R(LogFunction) DECLARE_BUILTIN_FUNCTION(LognFunction) DECLARE_BUILTIN_FUNCTION_R3(LambertWFunction) DECLARE_BUILTIN_FUNCTION_R2(SinFunction) DECLARE_BUILTIN_FUNCTION_R2(CosFunction) DECLARE_BUILTIN_FUNCTION_R2(TanFunction) DECLARE_BUILTIN_FUNCTION_R1(AsinFunction) DECLARE_BUILTIN_FUNCTION_R1(AcosFunction) DECLARE_BUILTIN_FUNCTION_R2(AtanFunction) DECLARE_BUILTIN_FUNCTION_R2(SinhFunction) DECLARE_BUILTIN_FUNCTION_R2(CoshFunction) DECLARE_BUILTIN_FUNCTION_R2(TanhFunction) DECLARE_BUILTIN_FUNCTION_R2(AsinhFunction) DECLARE_BUILTIN_FUNCTION_R1(AcoshFunction) DECLARE_BUILTIN_FUNCTION(AtanhFunction) DECLARE_BUILTIN_FUNCTION_R1(Atan2Function) DECLARE_BUILTIN_FUNCTION(RadiansToDefaultAngleUnitFunction) DECLARE_BUILTIN_FUNCTION_R2(SincFunction) DECLARE_BUILTIN_FUNCTION(ZetaFunction) DECLARE_BUILTIN_FUNCTION(GammaFunction) DECLARE_BUILTIN_FUNCTION(DigammaFunction) DECLARE_BUILTIN_FUNCTION(BetaFunction) DECLARE_BUILTIN_FUNCTION(AiryFunction) DECLARE_BUILTIN_FUNCTION(BesseljFunction) DECLARE_BUILTIN_FUNCTION(BesselyFunction) DECLARE_BUILTIN_FUNCTION(ErfFunction) DECLARE_BUILTIN_FUNCTION(ErfcFunction) DECLARE_BUILTIN_FUNCTION(TotalFunction) DECLARE_BUILTIN_FUNCTION(PercentileFunction) DECLARE_BUILTIN_FUNCTION(MinFunction) DECLARE_BUILTIN_FUNCTION(MaxFunction) DECLARE_BUILTIN_FUNCTION(ModeFunction) DECLARE_BUILTIN_FUNCTION_RPI(RandFunction) DECLARE_BUILTIN_FUNCTION(DateFunction) DECLARE_BUILTIN_FUNCTION(DateTimeFunction) DECLARE_BUILTIN_FUNCTION(TimeValueFunction) DECLARE_BUILTIN_FUNCTION(TimestampFunction) DECLARE_BUILTIN_FUNCTION(TimestampToDateFunction) DECLARE_BUILTIN_FUNCTION(DaysFunction) DECLARE_BUILTIN_FUNCTION(YearFracFunction) DECLARE_BUILTIN_FUNCTION(WeekFunction) DECLARE_BUILTIN_FUNCTION(WeekdayFunction) DECLARE_BUILTIN_FUNCTION(MonthFunction) DECLARE_BUILTIN_FUNCTION(DayFunction) DECLARE_BUILTIN_FUNCTION(YearFunction) DECLARE_BUILTIN_FUNCTION(YeardayFunction) DECLARE_BUILTIN_FUNCTION(TimeFunction) DECLARE_BUILTIN_FUNCTION(AddDaysFunction) DECLARE_BUILTIN_FUNCTION(AddMonthsFunction) DECLARE_BUILTIN_FUNCTION(AddYearsFunction) DECLARE_BUILTIN_FUNCTION(LunarPhaseFunction) DECLARE_BUILTIN_FUNCTION(NextLunarPhaseFunction) DECLARE_BUILTIN_FUNCTION(BinFunction) DECLARE_BUILTIN_FUNCTION(OctFunction) DECLARE_BUILTIN_FUNCTION(HexFunction) DECLARE_BUILTIN_FUNCTION(BaseFunction) DECLARE_BUILTIN_FUNCTION(RomanFunction) DECLARE_BUILTIN_FUNCTION_PI(AsciiFunction) DECLARE_BUILTIN_FUNCTION(CharFunction) DECLARE_BUILTIN_FUNCTION_PI(LengthFunction) DECLARE_BUILTIN_FUNCTION(ConcatenateFunction) DECLARE_BUILTIN_FUNCTION(ReplaceFunction) DECLARE_BUILTIN_FUNCTION(StripUnitsFunction) DECLARE_BUILTIN_FUNCTION(GenerateVectorFunction) DECLARE_BUILTIN_FUNCTION(ForFunction) DECLARE_BUILTIN_FUNCTION(SumFunction) DECLARE_BUILTIN_FUNCTION(ProductFunction) DECLARE_BUILTIN_FUNCTION(ProcessFunction) DECLARE_BUILTIN_FUNCTION(ProcessMatrixFunction) DECLARE_BUILTIN_FUNCTION(CustomSumFunction) DECLARE_BUILTIN_FUNCTION(FunctionFunction) DECLARE_BUILTIN_FUNCTION(SelectFunction) DECLARE_BUILTIN_FUNCTION(TitleFunction) DECLARE_BUILTIN_FUNCTION(IFFunction) DECLARE_BUILTIN_FUNCTION(IsNumberFunction) DECLARE_BUILTIN_FUNCTION(IsRealFunction) DECLARE_BUILTIN_FUNCTION(IsRationalFunction) DECLARE_BUILTIN_FUNCTION(IsIntegerFunction) DECLARE_BUILTIN_FUNCTION(RepresentsNumberFunction) DECLARE_BUILTIN_FUNCTION(RepresentsRealFunction) DECLARE_BUILTIN_FUNCTION(RepresentsRationalFunction) DECLARE_BUILTIN_FUNCTION(RepresentsIntegerFunction) DECLARE_BUILTIN_FUNCTION(ErrorFunction) DECLARE_BUILTIN_FUNCTION(WarningFunction) DECLARE_BUILTIN_FUNCTION(MessageFunction) DECLARE_BUILTIN_FUNCTION(SaveFunction) DECLARE_BUILTIN_FUNCTION(LoadFunction) DECLARE_BUILTIN_FUNCTION(ExportFunction) DECLARE_BUILTIN_FUNCTION(RegisterFunction) DECLARE_BUILTIN_FUNCTION(StackFunction) DECLARE_BUILTIN_FUNCTION(DeriveFunction) DECLARE_BUILTIN_FUNCTION(IntegrateFunction) DECLARE_BUILTIN_FUNCTION(SolveFunction) DECLARE_BUILTIN_FUNCTION(SolveMultipleFunction) DECLARE_BUILTIN_FUNCTION(DSolveFunction) DECLARE_BUILTIN_FUNCTION(LimitFunction) DECLARE_BUILTIN_FUNCTION_R2(liFunction) DECLARE_BUILTIN_FUNCTION_R2(LiFunction) DECLARE_BUILTIN_FUNCTION_R2(EiFunction) DECLARE_BUILTIN_FUNCTION_R2(SiFunction) DECLARE_BUILTIN_FUNCTION_R2(CiFunction) DECLARE_BUILTIN_FUNCTION_R2(ShiFunction) DECLARE_BUILTIN_FUNCTION_R2(ChiFunction) DECLARE_BUILTIN_FUNCTION_R2(IGammaFunction) DECLARE_BUILTIN_FUNCTION_R2(GammaIncFunction) DECLARE_BUILTIN_FUNCTION(PlotFunction) #endif libqalculate-2.8.2/libqalculate/Function.cc0000644000175000017500000017730013360603307015655 00000000000000/* Qalculate Copyright (C) 2008 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "Function.h" #include "util.h" #include "Calculator.h" #include "MathStructure.h" #include "Variable.h" #include "Number.h" #include "Unit.h" #include #if HAVE_UNORDERED_MAP # include #elif defined(__GNUC__) # ifndef __has_include # define __has_include(x) 0 # endif # if (defined(__clang__) && __has_include()) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) # include namespace Sgi = std; # define unordered_map std::tr1::unordered_map # else # if __GNUC__ < 3 # include namespace Sgi { using ::hash_map; }; // inherit globals # else # include # if __GNUC__ == 3 && __GNUC_MINOR__ == 0 namespace Sgi = std; // GCC 3.0 # else namespace Sgi = ::__gnu_cxx; // GCC 3.1 and later # endif # endif # define unordered_map Sgi::hash_map # endif #else // ... there are other compilers, right? namespace Sgi = std; # define unordered_map Sgi::hash_map #endif class MathFunction_p { public: unordered_map argdefs; }; MathFunction::MathFunction(string name_, int argc_, int max_argc_, string cat_, string title_, string descr_, bool is_active) : ExpressionItem(cat_, name_, title_, descr_, false, true, is_active) { priv = new MathFunction_p; argc = argc_; if(max_argc_ < 0 || argc < 0) { if(argc < 0) argc = 0; max_argc = -1; } else if(max_argc_ < argc) { max_argc = argc; } else { max_argc = max_argc_; for(int i = 0; i < max_argc - argc; i++) { default_values.push_back("0"); } } last_argdef_index = 0; } MathFunction::MathFunction(const MathFunction *function) { priv = new MathFunction_p; set(function); } MathFunction::MathFunction() { priv = new MathFunction_p; argc = 0; max_argc = 0; last_argdef_index = 0; } MathFunction::~MathFunction() { clearArgumentDefinitions(); delete priv; } void MathFunction::set(const ExpressionItem *item) { if(item->type() == TYPE_FUNCTION) { MathFunction *f = (MathFunction*) item; argc = f->minargs(); max_argc = f->maxargs(); default_values.clear(); for(int i = argc + 1; i <= max_argc; i++) { setDefaultValue(i, f->getDefaultValue(i)); } last_argdef_index = f->lastArgumentDefinitionIndex(); scondition = f->condition(); clearArgumentDefinitions(); for(size_t i = 1; i <= f->lastArgumentDefinitionIndex(); i++) { if(f->getArgumentDefinition(i)) { setArgumentDefinition(i, f->getArgumentDefinition(i)->copy()); } } } ExpressionItem::set(item); } int MathFunction::type() const { return TYPE_FUNCTION; } int MathFunction::subtype() const { return SUBTYPE_FUNCTION; } string MathFunction::example(bool raw_format, string name_string) const { if(raw_format) return sexample; string str = sexample; gsub("$name", name_string.empty() ? name() : name_string, str); return CALCULATOR->localizeExpression(str); } void MathFunction::setExample(string new_example) { sexample = new_example; } /*int MathFunction::countArgOccurence(size_t arg_) { if((int) arg_ > argc && max_argc < 0) { arg_ = argc + 1; } if(argoccs.find(arg_) != argoccs.end()) { return argoccs[arg_]; } return 1; }*/ int MathFunction::args() const { return max_argc; } int MathFunction::minargs() const { return argc; } int MathFunction::maxargs() const { return max_argc; } string MathFunction::condition() const { return scondition; } void MathFunction::setCondition(string expression) { scondition = expression; remove_blank_ends(scondition); } bool MathFunction::testCondition(const MathStructure &vargs) { if(scondition.empty()) { return true; } UserFunction test_function("", "CONDITION_TEST_FUNCTION", scondition, false, argc, "", "", max_argc); MathStructure vargs2(vargs); MathStructure mstruct(test_function.MathFunction::calculate(vargs2)); EvaluationOptions eo; eo.approximation = APPROXIMATION_APPROXIMATE; mstruct.eval(eo); if(!mstruct.isNumber() || !mstruct.number().isPositive()) { if(CALCULATOR->showArgumentErrors() && !CALCULATOR->aborted()) { CALCULATOR->error(true, _("%s() requires that %s"), name().c_str(), printCondition().c_str(), NULL); } return false; } return true; } string MathFunction::printCondition() { if(scondition.empty() || last_argdef_index == 0) return scondition; string str = scondition; string svar, argstr; Argument *arg; int i_args = maxargs(); if(i_args < 0) { i_args = minargs() + 2; } for(int i = 0; i < i_args; i++) { svar = '\\'; if(maxargs() < 0 && i >= minargs()) { svar += (char) ('v' + i - minargs()); } else { if('x' + i > 'z') { svar += (char) ('a' + i - 3); } else { svar += 'x' + i; } } size_t i2 = 0; while(true) { if((i2 = str.find(svar, i2)) != string::npos) { if(maxargs() < 0 && i > minargs()) { arg = getArgumentDefinition(i); } else { arg = getArgumentDefinition(i + 1); } argstr = "\""; if(!arg || arg->name().empty()) { argstr += _("argument"); argstr += " "; if(maxargs() < 0 && i > minargs()) { argstr += i2s(i); } else { argstr += i2s(i + 1); } } else { argstr += arg->name(); } argstr += "\""; str.replace(i2, 2, argstr); } else { break; } } } return str; } int MathFunction::args(const string &argstr, MathStructure &vargs, const ParseOptions &parseoptions) { ParseOptions po = parseoptions; MathStructure *unended_function = po.unended_function; po.unended_function = NULL; vargs.clearVector(); int start_pos = 0; bool in_cit1 = false, in_cit2 = false; int pars = 0; int itmp = 0; string str = argstr, stmp; remove_blank_ends(str); Argument *arg; bool last_is_vctr = false, vctr_started = false; if(maxargs() > 0) { arg = getArgumentDefinition(maxargs()); last_is_vctr = arg && ((arg->type() == ARGUMENT_TYPE_VECTOR) || (maxargs() == 1 && arg->handlesVector())); } for(size_t str_index = 0; str_index < str.length(); str_index++) { switch(str[str_index]) { case LEFT_VECTOR_WRAP_CH: {} case LEFT_PARENTHESIS_CH: { if(!in_cit1 && !in_cit2) { pars++; } break; } case RIGHT_VECTOR_WRAP_CH: {} case RIGHT_PARENTHESIS_CH: { if(!in_cit1 && !in_cit2 && pars > 0) { pars--; } break; } case '\"': { if(in_cit1) { in_cit1 = false; } else if(!in_cit2) { in_cit1 = true; } break; } case '\'': { if(in_cit2) { in_cit2 = false; } else if(!in_cit1) { in_cit1 = true; } break; } case COMMA_CH: { if(pars == 0 && !in_cit1 && !in_cit2) { itmp++; if(itmp <= maxargs() || args() < 0) { stmp = str.substr(start_pos, str_index - start_pos); remove_blank_ends(stmp); arg = getArgumentDefinition(itmp); if(!arg && itmp > argc && args() < 0 && itmp > (int) last_argdef_index && last_argdef_index > 0) { arg = priv->argdefs[last_argdef_index]; } if(stmp.empty()) { if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, getDefaultValue(itmp), po); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, getDefaultValue(itmp)); vargs.addChild_nocopy(mstruct); } } else { if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, stmp, po); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, stmp, po); vargs.addChild_nocopy(mstruct); } } } else if(last_is_vctr) { if(!vctr_started) { if(!vargs[vargs.size() - 1].isVector() || vargs[vargs.size() - 1].size() != 1) { vargs[vargs.size() - 1].transform(STRUCT_VECTOR); } vctr_started = true; } stmp = str.substr(start_pos, str_index - start_pos); remove_blank_ends(stmp); if(stmp.empty()) { MathStructure *mstruct = new MathStructure(); getArgumentDefinition(maxargs())->parse(mstruct, getDefaultValue(itmp)); vargs[vargs.size() - 1].addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); getArgumentDefinition(maxargs())->parse(mstruct, stmp, po); vargs[vargs.size() - 1].addChild_nocopy(mstruct); } vargs.childUpdated(vargs.size()); } else { CALCULATOR->error(false, _("Additional arguments for function %s() was ignored. Function can only use %s argument(s)."), name().c_str(), i2s(maxargs()).c_str(), NULL); } start_pos = str_index + 1; } break; } } } if(!str.empty()) { itmp++; po.unended_function = unended_function; if(itmp <= maxargs() || args() < 0) { stmp = str.substr(start_pos, str.length() - start_pos); remove_blank_ends(stmp); arg = getArgumentDefinition(itmp); if(!arg && itmp > argc && args() < 0 && itmp > (int) last_argdef_index && last_argdef_index > 0) { arg = priv->argdefs[last_argdef_index]; } if(stmp.empty()) { if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, getDefaultValue(itmp)); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, getDefaultValue(itmp)); vargs.addChild_nocopy(mstruct); } } else { if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, stmp, po); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, stmp, po); vargs.addChild_nocopy(mstruct); } } } else if(last_is_vctr) { if(!vctr_started) { if(!vargs[vargs.size() - 1].isVector() || vargs[vargs.size() - 1].size() != 1) { vargs[vargs.size() - 1].transform(STRUCT_VECTOR); } vctr_started = true; } stmp = str.substr(start_pos, str.length() - start_pos); remove_blank_ends(stmp); if(stmp.empty()) { MathStructure *mstruct = new MathStructure(); getArgumentDefinition(maxargs())->parse(mstruct, getDefaultValue(itmp)); vargs[vargs.size() - 1].addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); getArgumentDefinition(maxargs())->parse(mstruct, stmp, po); vargs[vargs.size() - 1].addChild_nocopy(mstruct); } vargs.childUpdated(vargs.size()); } else { CALCULATOR->error(false, _("Additional arguments for function %s() was ignored. Function can only use %s argument(s)."), name().c_str(), i2s(maxargs()).c_str(), NULL); } } if(unended_function && !unended_function->isFunction()) { unended_function->set(vargs); unended_function->setType(STRUCT_FUNCTION); unended_function->setFunction(this); while((int) unended_function->size() < itmp) { unended_function->addChild(m_undefined); } } if(itmp < maxargs() && itmp >= minargs()) { int itmp2 = itmp; while(itmp2 < maxargs()) { arg = getArgumentDefinition(itmp2 + 1); if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, default_values[itmp2 - minargs()]); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, default_values[itmp2 - minargs()]); vargs.addChild_nocopy(mstruct); } itmp2++; } } return itmp; } size_t MathFunction::lastArgumentDefinitionIndex() const { return last_argdef_index; } Argument *MathFunction::getArgumentDefinition(size_t index) { if(priv->argdefs.find(index) != priv->argdefs.end()) { return priv->argdefs[index]; } return NULL; } void MathFunction::clearArgumentDefinitions() { for(unordered_map::iterator it = priv->argdefs.begin(); it != priv->argdefs.end(); ++it) { delete it->second; } priv->argdefs.clear(); last_argdef_index = 0; setChanged(true); } void MathFunction::setArgumentDefinition(size_t index, Argument *argdef) { if(priv->argdefs.find(index) != priv->argdefs.end()) { delete priv->argdefs[index]; } priv->argdefs[index] = argdef; if(index > last_argdef_index) { last_argdef_index = index; } argdef->setIsLastArgument((int) index == maxargs()); setChanged(true); } bool MathFunction::testArgumentCount(int itmp) { if(itmp >= minargs()) { if(itmp > maxargs() && maxargs() >= 0 && (maxargs() > 1 || !getArgumentDefinition(1) || !getArgumentDefinition(1)->handlesVector())) { CALCULATOR->error(false, _("Additional arguments for function %s() was ignored. Function can only use %s argument(s)."), name().c_str(), i2s(maxargs()).c_str(), NULL); } return true; } string str; Argument *arg; bool b = false; for(int i = 1; i <= minargs(); i++) { arg = getArgumentDefinition(i); if(i > 1) { str += CALCULATOR->getComma(); str += " "; } if(arg && !arg->name().empty()) { str += arg->name(); b = true; } else { str += "?"; } } if(b) { CALCULATOR->error(true, _("You need at least %s argument(s) (%s) in function %s()."), i2s(minargs()).c_str(), str.c_str(), name().c_str(), NULL); } else { CALCULATOR->error(true, _("You need at least %s argument(s) in function %s()."), i2s(minargs()).c_str(), name().c_str(), NULL); } return false; } MathStructure MathFunction::createFunctionMathStructureFromVArgs(const MathStructure &vargs) { MathStructure mstruct(this, NULL); for(size_t i = 0; i < vargs.size(); i++) { mstruct.addChild(vargs[i]); } return mstruct; } MathStructure MathFunction::createFunctionMathStructureFromSVArgs(vector &svargs) { MathStructure mstruct(this, NULL); for(size_t i = 0; i < svargs.size(); i++) { mstruct.addChild(svargs[i]); } return mstruct; } MathStructure MathFunction::calculate(const string &argv, const EvaluationOptions &eo) { /* MathStructure vargs; args(argv, vargs, eo.parse_options); return calculate(vargs, eo);*/ MathStructure fmstruct(parse(argv, eo.parse_options)); fmstruct.calculateFunctions(eo); return fmstruct; } MathStructure MathFunction::parse(const string &argv, const ParseOptions &po) { MathStructure vargs; args(argv, vargs, po); vargs.setType(STRUCT_FUNCTION); vargs.setFunction(this); return vargs; //return createFunctionMathStructureFromVArgs(vargs); } int MathFunction::parse(MathStructure &mstruct, const string &argv, const ParseOptions &po) { int n = args(argv, mstruct, po); mstruct.setType(STRUCT_FUNCTION); mstruct.setFunction(this); return n; } bool MathFunction::testArguments(MathStructure &vargs) { size_t last = 0; for(unordered_map::iterator it = priv->argdefs.begin(); it != priv->argdefs.end(); ++it) { if(it->first > last) { last = it->first; } if(it->second && it->first > 0 && it->first <= vargs.size() && !it->second->test(vargs[it->first - 1], it->first, this)) { return false; } } if(max_argc < 0 && (int) last > argc && priv->argdefs.find(last) != priv->argdefs.end()) { for(size_t i = last + 1; i <= vargs.size(); i++) { if(!priv->argdefs[last]->test(vargs[i - 1], i, this)) { return false; } } } return testCondition(vargs); } MathStructure MathFunction::calculate(MathStructure &vargs, const EvaluationOptions &eo) { int itmp = vargs.size(); if(testArgumentCount(itmp)) { appendDefaultValues(vargs); MathStructure mstruct; int ret = 0; if(!testArguments(vargs) || (ret = calculate(mstruct, vargs, eo)) < 1) { if(ret < 0) { ret = -ret; if(maxargs() > 0 && ret > maxargs()) { if(mstruct.isVector()) { for(size_t arg_i = 0; arg_i < vargs.size() && arg_i < mstruct.size(); arg_i++) { vargs.setChild(mstruct[arg_i], arg_i + 1); } } } else if(ret <= (int) vargs.size()) { vargs.setChild(mstruct, ret); } } return createFunctionMathStructureFromVArgs(vargs); } if(precision() >= 0 && (precision() < mstruct.precision() || mstruct.precision() < 1)) mstruct.setPrecision(precision(), true); if(isApproximate()) mstruct.setApproximate(true, true); return mstruct; } else { return createFunctionMathStructureFromVArgs(vargs); } } int MathFunction::calculate(MathStructure&, const MathStructure&, const EvaluationOptions&) { //mstruct = createFunctionMathStructureFromVArgs(vargs); return 0; } void MathFunction::setDefaultValue(size_t arg_, string value_) { if((int) arg_ > argc && (int) arg_ <= max_argc && (int) default_values.size() >= (int) arg_ - argc) { default_values[arg_ - argc - 1] = value_; } } const string &MathFunction::getDefaultValue(size_t arg_) const { if((int) arg_ > argc && (int) arg_ <= max_argc && (int) default_values.size() >= (int) arg_ - argc) { return default_values[arg_ - argc - 1]; } return empty_string; } void MathFunction::appendDefaultValues(MathStructure &vargs) { if((int) vargs.size() < minargs()) return; while((int) vargs.size() < maxargs()) { Argument *arg = getArgumentDefinition(vargs.size() + 1); if(arg) { MathStructure *mstruct = new MathStructure(); arg->parse(mstruct, default_values[vargs.size() - minargs()]); vargs.addChild_nocopy(mstruct); } else { MathStructure *mstruct = new MathStructure(); CALCULATOR->parse(mstruct, default_values[vargs.size() - minargs()]); vargs.addChild_nocopy(mstruct); } } } int MathFunction::stringArgs(const string &argstr, vector &svargs) { svargs.clear(); int start_pos = 0; bool in_cit1 = false, in_cit2 = false; int pars = 0; int itmp = 0; string str = argstr, stmp; remove_blank_ends(str); for(size_t str_index = 0; str_index < str.length(); str_index++) { switch(str[str_index]) { case LEFT_PARENTHESIS_CH: { if(!in_cit1 && !in_cit2) { pars++; } break; } case RIGHT_PARENTHESIS_CH: { if(!in_cit1 && !in_cit2 && pars > 0) { pars--; } break; } case '\"': { if(in_cit1) { in_cit1 = false; } else if(!in_cit2) { in_cit1 = true; } break; } case '\'': { if(in_cit2) { in_cit2 = false; } else if(!in_cit1) { in_cit1 = true; } break; } case COMMA_CH: { if(pars == 0 && !in_cit1 && !in_cit2) { itmp++; if(itmp <= maxargs() || args() < 0) { stmp = str.substr(start_pos, str_index - start_pos); remove_blank_ends(stmp); remove_parenthesis(stmp); remove_blank_ends(stmp); if(stmp.empty()) { stmp = getDefaultValue(itmp); } svargs.push_back(stmp); } start_pos = str_index + 1; } break; } } } if(!str.empty()) { itmp++; if(itmp <= maxargs() || args() < 0) { stmp = str.substr(start_pos, str.length() - start_pos); remove_blank_ends(stmp); remove_parenthesis(stmp); remove_blank_ends(stmp); if(stmp.empty()) { stmp = getDefaultValue(itmp); } svargs.push_back(stmp); } } if(itmp < maxargs() && itmp >= minargs()) { int itmp2 = itmp; while(itmp2 < maxargs()) { svargs.push_back(default_values[itmp2 - minargs()]); itmp2++; } } return itmp; } MathStructure MathFunction::produceVector(const MathStructure &vargs, int begin, int end) { if(begin < 1) { begin = minargs() + 1; if(begin < 1) begin = 1; } if(end < 1 || end >= (int) vargs.size()) { end = vargs.size(); } if(begin == 1 && vargs.size() == 1) { if(vargs[0].isVector()) { return vargs[0]; } else { return vargs; } } MathStructure mstruct; vargs.getRange(begin, end, mstruct); MathStructure mstruct2; return mstruct.flattenVector(mstruct2); } MathStructure MathFunction::produceArgumentsVector(const MathStructure &vargs, int begin, int end) { if(begin < 1) { begin = minargs() + 1; if(begin < 1) begin = 1; } if(end < 1 || end >= (int) vargs.size()) { end = vargs.size(); } if(begin == 1 && vargs.size() == 1) { return vargs; } MathStructure mstruct; return vargs.getRange(begin, end, mstruct); } bool MathFunction::representsPositive(const MathStructure&, bool) const {return false;} bool MathFunction::representsNegative(const MathStructure&, bool) const {return false;} bool MathFunction::representsNonNegative(const MathStructure &vargs, bool allow_units) const {return representsPositive(vargs, allow_units);} bool MathFunction::representsNonPositive(const MathStructure &vargs, bool allow_units) const {return representsNegative(vargs, allow_units);} bool MathFunction::representsInteger(const MathStructure &vargs, bool allow_units) const {return representsBoolean(vargs) || representsEven(vargs, allow_units) || representsOdd(vargs, allow_units);} bool MathFunction::representsNumber(const MathStructure &vargs, bool allow_units) const {return representsReal(vargs, allow_units) || representsComplex(vargs, allow_units);} bool MathFunction::representsRational(const MathStructure &vargs, bool allow_units) const {return representsInteger(vargs, allow_units);} bool MathFunction::representsNonComplex(const MathStructure &vargs, bool allow_units) const {return representsReal(vargs, allow_units);} bool MathFunction::representsReal(const MathStructure &vargs, bool allow_units) const {return representsRational(vargs, allow_units);} bool MathFunction::representsComplex(const MathStructure&, bool) const {return false;} bool MathFunction::representsNonZero(const MathStructure &vargs, bool allow_units) const {return representsPositive(vargs, allow_units) || representsNegative(vargs, allow_units);} bool MathFunction::representsEven(const MathStructure&, bool) const {return false;} bool MathFunction::representsOdd(const MathStructure&, bool) const {return false;} bool MathFunction::representsUndefined(const MathStructure&) const {return false;} bool MathFunction::representsBoolean(const MathStructure&) const {return false;} bool MathFunction::representsNonMatrix(const MathStructure &vargs) const { return representsNumber(vargs, true); } bool MathFunction::representsScalar(const MathStructure &vargs) const { return representsNonMatrix(vargs); } UserFunction::UserFunction(string cat_, string name_, string formula_, bool is_local, int argc_, string title_, string descr_, int max_argc_, bool is_active) : MathFunction(name_, argc_, max_argc_, cat_, title_, descr_, is_active) { b_local = is_local; b_builtin = false; setFormula(formula_, argc_, max_argc_); setChanged(false); } UserFunction::UserFunction(const UserFunction *function) { set(function); } string UserFunction::formula() const { return sformula; } string UserFunction::internalFormula() const { return sformula_calc; } ExpressionItem *UserFunction::copy() const { return new UserFunction(this); } void UserFunction::set(const ExpressionItem *item) { if(item->type() == TYPE_FUNCTION && item->subtype() == SUBTYPE_USER_FUNCTION) { sformula = ((UserFunction*) item)->formula(); sformula_calc = ((UserFunction*) item)->internalFormula(); v_subs.clear(); v_precalculate.clear(); for(size_t i = 1; i <= ((UserFunction*) item)->countSubfunctions(); i++) { v_subs.push_back(((UserFunction*) item)->getSubfunction(i)); v_precalculate.push_back(((UserFunction*) item)->subfunctionPrecalculated(i)); } } MathFunction::set(item); } int UserFunction::subtype() const { return SUBTYPE_USER_FUNCTION; } extern string format_and_print(const MathStructure &mstruct); bool replace_intervals_f(MathStructure &mstruct) { if(mstruct.isNumber() && (mstruct.number().isInterval(false) || (CALCULATOR->usesIntervalArithmetic() && mstruct.number().precision() >= 0))) { Variable *v = new KnownVariable("", format_and_print(mstruct), mstruct); v->ref(); mstruct.set(v, true); v->destroy(); return true; } bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(replace_intervals_f(mstruct[i])) { mstruct.childUpdated(i + 1); b = true; } } return b; } extern bool create_interval(MathStructure &mstruct, const MathStructure &m1, const MathStructure &m2); bool replace_f_interval(MathStructure &mstruct, const EvaluationOptions &eo) { if(mstruct.isFunction() && mstruct.function() == CALCULATOR->f_interval && mstruct.size() == 2) { if(mstruct[0].isNumber() && mstruct[1].isNumber()) { Number nr; if(nr.setInterval(mstruct[0].number(), mstruct[1].number())) { mstruct.set(nr, true); return true; } } else { MathStructure m1(mstruct[0]); MathStructure m2(mstruct[1]); if(create_interval(mstruct, m1, m2)) return true; m1.eval(eo); m2.eval(eo); if(create_interval(mstruct, m1, m2)) return true; } return false; } bool b = false; for(size_t i = 0; i < mstruct.size(); i++) { if(replace_f_interval(mstruct[i], eo)) { mstruct.childUpdated(i + 1); b = true; } } return b; } int UserFunction::calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo) { ParseOptions po; if(b_local) po.angle_unit = eo.parse_options.angle_unit; if(args() != 0) { string stmp = sformula_calc; string svar; string v_str, w_str; vector v_strs; vector v_id; size_t i2 = 0; int i_args = maxargs(); if(i_args < 0) { i_args = minargs(); } for(int i = 0; i < i_args; i++) { if(vargs[i].containsInterval(true) || vargs[i].containsFunction(CALCULATOR->f_interval, true)) { MathStructure *mv = new MathStructure(vargs[i]); replace_f_interval(*mv, eo); replace_intervals_f(*mv); v_id.push_back(CALCULATOR->addId(mv, true)); } else { v_id.push_back(CALCULATOR->addId(new MathStructure(vargs[i]), true)); } v_strs.push_back(LEFT_PARENTHESIS ID_WRAP_LEFT); v_strs[i] += i2s(v_id[i]); v_strs[i] += ID_WRAP_RIGHT RIGHT_PARENTHESIS; } if(maxargs() < 0) { if(stmp.find("\\v") != string::npos) { v_id.push_back(CALCULATOR->addId(new MathStructure(produceVector(vargs)), true)); v_str = LEFT_PARENTHESIS ID_WRAP_LEFT; v_str += i2s(v_id[v_id.size() - 1]); v_str += ID_WRAP_RIGHT RIGHT_PARENTHESIS; } if(stmp.find("\\w") != string::npos) { v_id.push_back(CALCULATOR->addId(new MathStructure(produceArgumentsVector(vargs)), true)); w_str = LEFT_PARENTHESIS ID_WRAP_LEFT; w_str += i2s(v_id[v_id.size() - 1]); w_str += ID_WRAP_RIGHT RIGHT_PARENTHESIS; } } for(size_t i = 0; i < v_subs.size(); i++) { if(subfunctionPrecalculated(i + 1)) { string str = v_subs[i]; for(int i3 = 0; i3 < i_args; i3++) { svar = '\\'; if('x' + i3 > 'z') { svar += (char) ('a' + i3 - 3); } else { svar += 'x' + i3; } i2 = 0; while(true) { if((i2 = str.find(svar, i2)) != string::npos) { if(i2 != 0 && str[i2 - 1] == '\\') { i2 += 2; } else { str.replace(i2, 2, v_strs[i3]); } } else { break; } } } if(maxargs() < 0) { i2 = 0; while(true) { if((i2 = str.find("\\v")) != string::npos) { if(i2 != 0 && str[i2 - 1] == '\\') { i2 += 2; } else { str.replace(i2, 2, v_str); } } else { break; } } i2 = 0; while(true) { if((i2 = str.find("\\w")) != string::npos) { if(i2 != 0 && str[i2 - 1] == '\\') { i2 += 2; } else { str.replace(i2, 2, w_str); } } else { break; } } } MathStructure *v_mstruct = new MathStructure(); CALCULATOR->parse(v_mstruct, str, po); v_mstruct->eval(eo); v_id.push_back(CALCULATOR->addId(v_mstruct, true)); str = LEFT_PARENTHESIS ID_WRAP_LEFT; str += i2s(v_id[v_id.size() - 1]); str += ID_WRAP_RIGHT RIGHT_PARENTHESIS; i2 = 0; svar = '\\'; svar += i2s(i + 1); while(true) { if((i2 = stmp.find(svar, i2)) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += 2; } else { stmp.replace(i2, 2, str); } } else { break; } } } else { i2 = 0; svar = '\\'; svar += i2s(i + 1); while(true) { if((i2 = stmp.find(svar, i2)) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += svar.size(); } else { stmp.replace(i2, svar.size(), v_subs[i]); } } else { break; } } } } for(int i = 0; i < i_args; i++) { svar = '\\'; if('x' + i > 'z') { svar += (char) ('a' + i - 3); } else { svar += 'x' + i; } i2 = 0; while(true) { if((i2 = stmp.find(svar, i2)) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += 2; } else { stmp.replace(i2, 2, v_strs[i]); } } else { break; } } } if(maxargs() < 0) { i2 = 0; while(true) { if((i2 = stmp.find("\\v")) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += 2; } else { stmp.replace(i2, 2, v_str); } } else { break; } } i2 = 0; while(true) { if((i2 = stmp.find("\\w")) != string::npos) { if(i2 != 0 && stmp[i2 - 1] == '\\') { i2 += 2; } else { stmp.replace(i2, 2, w_str); } } else { break; } } } while(true) { if((i2 = stmp.find("\\\\")) != string::npos) { stmp.replace(i2, 2, "\\"); } else { break; } } CALCULATOR->parse(&mstruct, stmp, po); for(size_t i = 0; i < v_id.size(); i++) { CALCULATOR->delId(v_id[i]); } if(precision() >= 0) mstruct.setPrecision(precision(), true); if(isApproximate()) mstruct.setApproximate(true, true); } else { CALCULATOR->parse(&mstruct, sformula_calc, po); if(precision() >= 0) mstruct.setPrecision(precision(), true); if(isApproximate()) mstruct.setApproximate(true, true); } return 1; } void UserFunction::setFormula(string new_formula, int argc_, int max_argc_) { setChanged(true); sformula = new_formula; default_values.clear(); if(sformula.empty() && v_subs.empty()) { sformula_calc = new_formula; argc = 0; max_argc = 0; return; } if(argc_ < 0) { argc_ = 0, max_argc_ = 0; string svar, svar_o, svar_v; bool optionals = false, b; size_t i3 = 0, i4 = 0, i5 = 0; size_t i2 = 0; for(int i = 0; i < 26; i++) { begin_loop_in_set_formula: i4 = 0; i5 = 0; svar = '\\'; svar_o = '\\'; if('x' + i > 'z') svar += (char) ('a' + i - 3); else svar += 'x' + i; if('X' + i > 'Z') svar_o += (char) ('A' + i - 3); else svar_o += 'X' + i; before_find_in_set_formula: if(i < 24 && (i2 = new_formula.find(svar_o, i4)) != string::npos) { if(i2 > 0 && new_formula[i2 - 1] == '\\') { i4 = i2 + 2; goto before_find_in_set_formula; } i3 = 0; if(new_formula.length() > i2 + 2 && new_formula[i2 + 2] == ID_WRAP_LEFT_CH) { if((i3 = new_formula.find(ID_WRAP_RIGHT_CH, i2 + 2)) != string::npos) { svar_v = new_formula.substr(i2 + 3, i3 - (i2 + 3)); i3 -= i2 + 1; } else i3 = 0; } if(i3) { default_values.push_back(svar_v); } else { default_values.push_back("0"); } new_formula.replace(i2, 2 + i3, svar); while((i2 = new_formula.find(svar_o, i2 + 1)) != string::npos) { if(i2 > 0 && new_formula[i2 - 1] == '\\') { i2++; } else { new_formula.replace(i2, 2, svar); } } for(size_t sub_i = 0; sub_i < v_subs.size(); sub_i++) { i2 = 0; while((i2 = v_subs[sub_i].find(svar_o, i2 + 1)) != string::npos) { if(i2 > 0 && v_subs[sub_i][i2 - 1] == '\\') { i2++; } else { v_subs[sub_i].replace(i2, 2, svar); } } } optionals = true; } else if((i2 = new_formula.find(svar, i5)) != string::npos) { if(i2 > 0 && new_formula[i2 - 1] == '\\') { i5 = i2 + 2; goto before_find_in_set_formula; } } else { b = false; for(size_t sub_i = 0; sub_i < v_subs.size(); sub_i++) { before_find_in_vsubs_set_formula: if(i < 24 && (i2 = v_subs[sub_i].find(svar_o, i4)) != string::npos) { if(i2 > 0 && v_subs[sub_i][i2 - 1] == '\\') { i4 = i2 + 2; goto before_find_in_vsubs_set_formula; } i3 = 0; if(v_subs[sub_i].length() > i2 + 2 && v_subs[sub_i][i2 + 2] == ID_WRAP_LEFT_CH) { if((i3 = v_subs[sub_i].find(ID_WRAP_RIGHT_CH, i2 + 2)) != string::npos) { svar_v = v_subs[sub_i].substr(i2 + 3, i3 - (i2 + 3)); i3 -= i2 + 1; } else i3 = 0; } if(i3) { default_values.push_back(svar_v); } else { default_values.push_back("0"); } v_subs[sub_i].replace(i2, 2 + i3, svar); while((i2 = v_subs[sub_i].find(svar_o, i2 + 1)) != string::npos) { if(i2 > 0 && v_subs[sub_i][i2 - 1] == '\\') { i2++; } else { v_subs[sub_i].replace(i2, 2, svar); } } optionals = true; b = true; } else if((i2 = v_subs[sub_i].find(svar, i5)) != string::npos) { if(i2 > 0 && v_subs[sub_i][i2 - 1] == '\\') { i5 = i2 + 2; goto before_find_in_vsubs_set_formula; } b = true; } } if(!b) { if(i < 24 && !optionals) { i = 24; goto begin_loop_in_set_formula; } break; } } if(i >= 24) { max_argc_ = -1; } else { if(optionals) { max_argc_++; } else { max_argc_++; argc_++; } } } } if(argc_ > 24) { argc_ = 24; } if(max_argc_ > 24) { max_argc_ = 24; } if(max_argc_ < 0 || argc_ < 0) { max_argc_ = -1; if(argc_ < 0) argc_ = 0; } else if(max_argc_ < argc_) { max_argc_ = argc_; } while((int) default_values.size() < max_argc_ - argc_) { default_values.push_back("0"); } if(max_argc_ > 0) default_values.resize(max_argc_ - argc_); sformula_calc = new_formula; argc = argc_; max_argc = max_argc_; } void UserFunction::addSubfunction(string subfunction, bool precalculate) { setChanged(true); v_subs.push_back(subfunction); v_precalculate.push_back(precalculate); } void UserFunction::setSubfunction(size_t index, string subfunction) { if(index > 0 && index <= v_subs.size()) { setChanged(true); v_subs[index - 1] = subfunction; } } void UserFunction::delSubfunction(size_t index) { if(index > 0 && index <= v_subs.size()) { setChanged(true); v_subs.erase(v_subs.begin() + (index - 1)); } if(index > 0 && index <= v_precalculate.size()) { setChanged(true); v_precalculate.erase(v_precalculate.begin() + (index - 1)); } } void UserFunction::clearSubfunctions() { setChanged(true); v_subs.clear(); v_precalculate.clear(); } void UserFunction::setSubfunctionPrecalculated(size_t index, bool precalculate) { if(index > 0 && index <= v_precalculate.size()) { setChanged(true); v_precalculate[index - 1] = precalculate; } } size_t UserFunction::countSubfunctions() const { return v_subs.size(); } const string &UserFunction::getSubfunction(size_t index) const { if(index > 0 && index <= v_subs.size()) { return v_subs[index - 1]; } return empty_string; } bool UserFunction::subfunctionPrecalculated(size_t index) const { if(index > 0 && index <= v_precalculate.size()) { return v_precalculate[index - 1]; } return false; } Argument::Argument(string name_, bool does_test, bool does_error) { sname = name_; remove_blank_ends(sname); scondition = ""; b_zero = true; b_test = does_test; b_matrix = false; b_text = false; b_error = does_error; b_rational = false; b_last = false; b_handle_vector = false; } Argument::Argument(const Argument *arg) { b_text = false; set(arg); } Argument::~Argument() {} Argument *Argument::copy() const { return new Argument(this); } string Argument::print() const {return "";} string Argument::subprintlong() const {return _("a free value");} string Argument::printlong() const { string str = subprintlong(); if(!b_zero) { str += " "; str += _("that is nonzero"); } if(b_rational) { if(!b_zero) { str += " "; str += _("and"); } str += " "; str += _("that is rational (polynomial)"); } if(!scondition.empty()) { if(!b_zero || b_rational) { str += " "; str += _("and"); } str += " "; str += _("that fulfills the condition:"); str += " \""; string str2 = scondition; if(name().empty()) gsub("\\x", _("Argument"), str2); else gsub("\\x", name(), str2); str += str2; str += "\""; } return str; } void Argument::set(const Argument *arg) { sname = arg->name(); scondition = arg->getCustomCondition(); b_zero = !arg->zeroForbidden(); b_test = arg->tests(); b_matrix = arg->matrixAllowed(); b_rational = arg->rationalPolynomial(); b_last = arg->isLastArgument(); b_handle_vector = arg->handlesVector(); } bool Argument::test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo) const { if(!b_test) { return true; } bool evaled = false; bool b = subtest(value, eo); if(b && !b_zero) { if(!value.isNumber() && !value.representsNonZero()) { value.eval(eo); evaled = true; } b = value.representsNonZero(); } if(b && b_rational) { if(!evaled) { value.eval(eo); evaled = true; } b = value.isRationalPolynomial(); } if(!b && b_matrix) { if(!evaled && !value.isMatrix()) { value.eval(eo); evaled = true; } b = value.isMatrix(); } if(b && !scondition.empty()) { string expression = scondition; int id = CALCULATOR->addId(new MathStructure(value), true); string ids = LEFT_PARENTHESIS ID_WRAP_LEFT; ids += i2s(id); ids += ID_WRAP_RIGHT RIGHT_PARENTHESIS; gsub("\\x", ids, expression); b = CALCULATOR->testCondition(expression); CALCULATOR->delId(id); } if(!b && b_handle_vector) { if(!evaled && !value.isVector()) { value.eval(eo); evaled = true; } if(value.isVector()) return false; } if(!b) { if(b_error) { if(sname.empty()) { CALCULATOR->error(true, _("Argument %s in %s() must be %s."), i2s(index).c_str(), f->name().c_str(), printlong().c_str(), NULL); } else { CALCULATOR->error(true, _("Argument %s, %s, in %s() must be %s."), i2s(index).c_str(), sname.c_str(), f->name().c_str(), printlong().c_str(), NULL); } } return false; } return true; } MathStructure Argument::parse(const string &str, const ParseOptions &po) const { MathStructure mstruct; parse(&mstruct, str, po); return mstruct; } void Argument::parse(MathStructure *mstruct, const string &str, const ParseOptions &po) const { if(b_text) { size_t pars = 0; while(true) { size_t pars2 = 1; size_t i = pars; if(str.length() >= 2 + pars * 2 && str[pars] == LEFT_PARENTHESIS_CH && str[str.length() - 1 - pars] == RIGHT_PARENTHESIS_CH) { while(true) { i = str.find_first_of(LEFT_PARENTHESIS RIGHT_PARENTHESIS, i + 1); if(i == string::npos || i >= str.length() - 1 - pars) { break; } else if(str[i] == LEFT_PARENTHESIS_CH) { pars2++; } else if(str[i] == RIGHT_PARENTHESIS_CH) { pars2--; if(pars2 == 0) { break; } } } if(pars2 > 0) { pars++; } } else { break; } if(pars2 == 0) break; } if(str.length() >= 2 + pars * 2) { if(str[pars] == ID_WRAP_LEFT_CH && str[str.length() - 1 - pars] == ID_WRAP_RIGHT_CH && str.find(ID_WRAP_RIGHT, pars + 1) == str.length() - 1 - pars) { CALCULATOR->parse(mstruct, str.substr(pars, str.length() - pars * 2), po); if(mstruct->isDateTime() && !mstruct->datetime()->parsed_string.empty()) mstruct->set(mstruct->datetime()->parsed_string, false, true); return; } if(str[pars] == '\\' && str[str.length() - 1 - pars] == '\\') { CALCULATOR->parse(mstruct, str.substr(1 + pars, str.length() - 2 - pars * 2), po); if(mstruct->isDateTime() && !mstruct->datetime()->parsed_string.empty()) mstruct->set(mstruct->datetime()->parsed_string, false, true); return; } if((str[pars] == '\"' && str[str.length() - 1 - pars] == '\"') || (str[pars] == '\'' && str[str.length() - 1 - pars] == '\'')) { size_t i = pars + 1, cits = 0; while(i < str.length() - 1 - pars) { i = str.find(str[pars], i); if(i >= str.length() - 1 - pars) { break; } cits++; i++; } if((cits / 2) % 2 == 0) { i = str.find(ID_WRAP_LEFT, 1 + pars); if(i == string::npos || i >= str.length() - (1 + pars)) { mstruct->set(str.substr(1 + pars, str.length() - 2 - pars * 2)); return; } string str2 = str.substr(1 + pars, str.length() - 2 - pars * 2); string str3; i = 0; size_t i2 = 0; int id = 0; while((i = str2.find(ID_WRAP_LEFT, i)) != string::npos) { i2 = str2.find(ID_WRAP_RIGHT, i + 1); if(i2 == string::npos) break; id = s2i(str2.substr(i + 1, i2 - (i + 1))); MathStructure *m_temp = CALCULATOR->getId((size_t) id); str3 = "("; if(!m_temp) { CALCULATOR->error(true, _("Internal id %s does not exist."), i2s(id).c_str(), NULL); str3 += CALCULATOR->v_undef->preferredInputName(true, false, false, true).name; } else { str3 += m_temp->print(CALCULATOR->save_printoptions).c_str(); m_temp->unref(); } str3 += ")"; str2.replace(i, i2 - i + 1, str3); i += str3.length(); } mstruct->set(str2, false, true); return; } } } size_t i = str.find(ID_WRAP_LEFT, pars); if(i == string::npos || i >= str.length() - pars) { mstruct->set(str.substr(pars, str.length() - pars * 2), false, true); return; } string str2 = str.substr(pars, str.length() - pars * 2); string str3; i = 0; size_t i2 = 0; int id = 0; while((i = str2.find(ID_WRAP_LEFT, i)) != string::npos) { i2 = str2.find(ID_WRAP_RIGHT, i + 1); if(i2 == string::npos) break; id = s2i(str2.substr(i + 1, i2 - (i + 1))); MathStructure *m_temp = CALCULATOR->getId((size_t) id); str3 = "("; if(!m_temp) { CALCULATOR->error(true, _("Internal id %s does not exist."), i2s(id).c_str(), NULL); str3 += CALCULATOR->v_undef->preferredInputName(true, false, false, true).name; } else { str3 += m_temp->print(CALCULATOR->save_printoptions).c_str(); m_temp->unref(); } str3 += ")"; str2.replace(i, i2 - i + 1, str3); i += str3.length(); } mstruct->set(str2, false, true); return; } else { CALCULATOR->parse(mstruct, str, po); } } bool Argument::subtest(MathStructure&, const EvaluationOptions&) const { return true; } string Argument::name() const { return sname; } void Argument::setName(string name_) { sname = name_; remove_blank_ends(sname); } void Argument::setCustomCondition(string condition) { scondition = condition; remove_blank_ends(scondition); } string Argument::getCustomCondition() const { return scondition; } bool Argument::zeroForbidden() const { return !b_zero; } void Argument::setZeroForbidden(bool forbid_zero) { b_zero = !forbid_zero; } bool Argument::tests() const { return b_test; } void Argument::setTests(bool does_test) { b_test = does_test; } bool Argument::alerts() const { return b_error; } void Argument::setAlerts(bool does_error) { b_error = does_error; } bool Argument::suggestsQuotes() const {return false;} int Argument::type() const { return ARGUMENT_TYPE_FREE; } bool Argument::matrixAllowed() const {return b_matrix;} void Argument::setMatrixAllowed(bool allow_matrix) {b_matrix = allow_matrix;} bool Argument::handlesVector() const {return b_handle_vector;} void Argument::setHandleVector(bool handle_vector) {b_handle_vector = handle_vector;} bool Argument::isLastArgument() const {return b_last;} void Argument::setIsLastArgument(bool is_last) {b_last = is_last;} bool Argument::rationalPolynomial() const {return b_rational;} void Argument::setRationalPolynomial(bool rational_polynomial) {b_rational = rational_polynomial;} NumberArgument::NumberArgument(string name_, ArgumentMinMaxPreDefinition minmax, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { fmin = NULL; fmax = NULL; b_incl_min = true; b_incl_max = true; b_complex = true; b_rational_number = false; switch(minmax) { case ARGUMENT_MIN_MAX_POSITIVE: { fmin = new Number(); b_incl_min = false; break; } case ARGUMENT_MIN_MAX_NEGATIVE: { fmax = new Number(); b_incl_max = false; break; } case ARGUMENT_MIN_MAX_NONNEGATIVE: { fmin = new Number(); break; } case ARGUMENT_MIN_MAX_NONZERO: { setZeroForbidden(true); break; } default: {} } b_handle_vector = does_test; } NumberArgument::NumberArgument(const NumberArgument *arg) { fmin = NULL; fmax = NULL; set(arg); } NumberArgument::~NumberArgument() { if(fmin) { delete fmin; } if(fmax) { delete fmax; } } void NumberArgument::setMin(const Number *nmin) { if(!nmin) { if(fmin) { delete fmin; } return; } if(!fmin) { fmin = new Number(*nmin); } else { fmin->set(*nmin); } } void NumberArgument::setIncludeEqualsMin(bool include_equals) { b_incl_min = include_equals; } bool NumberArgument::includeEqualsMin() const { return b_incl_min; } const Number *NumberArgument::min() const { return fmin; } void NumberArgument::setMax(const Number *nmax) { if(!nmax) { if(fmax) { delete fmax; } return; } if(!fmax) { fmax = new Number(*nmax); } else { fmax->set(*nmax); } } void NumberArgument::setIncludeEqualsMax(bool include_equals) { b_incl_max = include_equals; } bool NumberArgument::includeEqualsMax() const { return b_incl_max; } const Number *NumberArgument::max() const { return fmax; } bool NumberArgument::complexAllowed() const { return b_complex; } void NumberArgument::setComplexAllowed(bool allow_complex) { b_complex = allow_complex; } bool NumberArgument::rationalNumber() const { return b_rational_number; } void NumberArgument::setRationalNumber(bool rational_number) { b_rational_number = rational_number; } bool NumberArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isNumber()) { value.eval(eo); } if(!value.isNumber() || (b_rational_number && !value.number().isRational())) { return false; } if(!b_complex && value.number().hasImaginaryPart()) { if(!value.number().imaginaryPartIsNonZero()) value.number().clearImaginary(); else return false; } if(fmin) { ComparisonResult cmpr = fmin->compare(value.number()); if(!(cmpr == COMPARISON_RESULT_GREATER || (b_incl_min && COMPARISON_IS_EQUAL_OR_GREATER(cmpr)))) { return false; } } if(fmax) { ComparisonResult cmpr = fmax->compare(value.number()); if(!(cmpr == COMPARISON_RESULT_LESS || (b_incl_max && COMPARISON_IS_EQUAL_OR_LESS(cmpr)))) { return false; } } return true; } int NumberArgument::type() const { return ARGUMENT_TYPE_NUMBER; } Argument *NumberArgument::copy() const { return new NumberArgument(this); } void NumberArgument::set(const Argument *arg) { if(arg->type() == ARGUMENT_TYPE_NUMBER) { const NumberArgument *farg = (const NumberArgument*) arg; b_incl_min = farg->includeEqualsMin(); b_incl_max = farg->includeEqualsMax(); b_complex = farg->complexAllowed(); b_rational_number = farg->rationalNumber(); if(fmin) { delete fmin; fmin = NULL; } if(fmax) { delete fmax; fmax = NULL; } if(farg->min()) { fmin = new Number(*farg->min()); } if(farg->max()) { fmax = new Number(*farg->max()); } } Argument::set(arg); } string NumberArgument::print() const { return _("number"); } string NumberArgument::subprintlong() const { string str; if(b_rational_number) { str += _("a rational number"); } else if(b_complex) { str += _("a number"); } else { str += _("a real number"); } if(fmin) { str += " "; if(b_incl_min) { str += _(">="); } else { str += _(">"); } str += " "; str += fmin->print(); } if(fmax) { if(fmin) { str += " "; str += _("and"); } str += " "; if(b_incl_max) { str += _("<="); } else { str += _("<"); } str += " "; str += fmax->print(); } return str; } IntegerArgument::IntegerArgument(string name_, ArgumentMinMaxPreDefinition minmax, bool does_test, bool does_error, IntegerType integer_type) : Argument(name_, does_test, does_error) { imin = NULL; imax = NULL; i_inttype = integer_type; switch(minmax) { case ARGUMENT_MIN_MAX_POSITIVE: { imin = new Number(1, 1); break; } case ARGUMENT_MIN_MAX_NEGATIVE: { imax = new Number(-1, 1); break; } case ARGUMENT_MIN_MAX_NONNEGATIVE: { imin = new Number(); break; } case ARGUMENT_MIN_MAX_NONZERO: { setZeroForbidden(true); break; } default: {} } b_handle_vector = does_test; } IntegerArgument::IntegerArgument(const IntegerArgument *arg) { imin = NULL; imax = NULL; i_inttype = INTEGER_TYPE_NONE; set(arg); } IntegerArgument::~IntegerArgument() { if(imin) { delete imin; } if(imax) { delete imax; } } IntegerType IntegerArgument::integerType() const {return i_inttype;} void IntegerArgument::setIntegerType(IntegerType integer_type) {i_inttype = integer_type;} void IntegerArgument::setMin(const Number *nmin) { if(!nmin) { if(imin) { delete imin; } return; } if(!imin) { imin = new Number(*nmin); } else { imin->set(*nmin); } } const Number *IntegerArgument::min() const { return imin; } void IntegerArgument::setMax(const Number *nmax) { if(!nmax) { if(imax) { delete imax; } return; } if(!imax) { imax = new Number(*nmax); } else { imax->set(*nmax); } } const Number *IntegerArgument::max() const { return imax; } bool IntegerArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isNumber()) { value.eval(eo); } if(!value.isNumber() || !value.number().isInteger(i_inttype)) { return false; } if(imin) { ComparisonResult cmpr = imin->compare(value.number()); if(!(COMPARISON_IS_EQUAL_OR_GREATER(cmpr))) { return false; } } if(imax) { ComparisonResult cmpr = imax->compare(value.number()); if(!(COMPARISON_IS_EQUAL_OR_LESS(cmpr))) { return false; } } return true; } int IntegerArgument::type() const { return ARGUMENT_TYPE_INTEGER; } Argument *IntegerArgument::copy() const { return new IntegerArgument(this); } void IntegerArgument::set(const Argument *arg) { if(arg->type() == ARGUMENT_TYPE_INTEGER) { const IntegerArgument *iarg = (const IntegerArgument*) arg; if(imin) { delete imin; imin = NULL; } if(imax) { delete imax; imax = NULL; } if(iarg->min()) { imin = new Number(*iarg->min()); } if(iarg->max()) { imax = new Number(*iarg->max()); } i_inttype = iarg->integerType(); } Argument::set(arg); } string IntegerArgument::print() const { return _("integer"); } string IntegerArgument::subprintlong() const { string str = _("an integer"); if(imin) { str += " "; str += _(">="); str += " "; str += imin->print(); } else if(i_inttype != INTEGER_TYPE_NONE) { str += " "; str += _(">="); str += " "; switch(i_inttype) { case INTEGER_TYPE_SIZE: {} case INTEGER_TYPE_UINT: {str += "0"; break;} case INTEGER_TYPE_SINT: {str += i2s(INT_MIN); break;} case INTEGER_TYPE_ULONG: {str += "0"; break;} case INTEGER_TYPE_SLONG: {str += i2s(LONG_MIN); break;} default: {} } } if(imax) { if(imin || i_inttype != INTEGER_TYPE_NONE) { str += " "; str += _("and"); } str += " "; str += _("<="); str += " "; str += imax->print(); } else if(i_inttype != INTEGER_TYPE_NONE) { str += " "; str += _("and"); str += " "; str += _("<="); str += " "; switch(i_inttype) { case INTEGER_TYPE_SIZE: {} case INTEGER_TYPE_UINT: {str += i2s(UINT_MAX); break;} case INTEGER_TYPE_SINT: {str += i2s(INT_MAX); break;} case INTEGER_TYPE_ULONG: {str += i2s(ULONG_MAX); break;} case INTEGER_TYPE_SLONG: {str += i2s(LONG_MAX); break;} default: {} } } return str; } SymbolicArgument::SymbolicArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {} SymbolicArgument::SymbolicArgument(const SymbolicArgument *arg) {set(arg);} SymbolicArgument::~SymbolicArgument() {} bool SymbolicArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic() && (!value.isVariable() || value.variable()->isKnown())) { value.eval(eo); } return value.isSymbolic() || value.isVariable(); } int SymbolicArgument::type() const {return ARGUMENT_TYPE_SYMBOLIC;} Argument *SymbolicArgument::copy() const {return new SymbolicArgument(this);} string SymbolicArgument::print() const {return _("symbol");} string SymbolicArgument::subprintlong() const {return _("an unknown variable/symbol");} TextArgument::TextArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} TextArgument::TextArgument(const TextArgument *arg) {set(arg); b_text = true;} TextArgument::~TextArgument() {} bool TextArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic(); } int TextArgument::type() const {return ARGUMENT_TYPE_TEXT;} Argument *TextArgument::copy() const {return new TextArgument(this);} string TextArgument::print() const {return _("text");} string TextArgument::subprintlong() const {return _("a text string");} bool TextArgument::suggestsQuotes() const {return false;} DateArgument::DateArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {} DateArgument::DateArgument(const DateArgument *arg) {set(arg);} DateArgument::~DateArgument() {} void DateArgument::parse(MathStructure *mstruct, const string &str, const ParseOptions &po) const { QalculateDateTime dt_test; if(dt_test.set(str)) { mstruct->set(dt_test); } else { Argument::parse(mstruct, str, po); } } bool DateArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isDateTime()) { value.eval(eo); } return value.isDateTime(); } int DateArgument::type() const {return ARGUMENT_TYPE_DATE;} Argument *DateArgument::copy() const {return new DateArgument(this);} string DateArgument::print() const {return string(_("date")) + " (Y-M-D)";} string DateArgument::subprintlong() const {return string(_("a date")) + " (Y-M-D)";} VectorArgument::VectorArgument(string name_, bool does_test, bool allow_matrix, bool does_error) : Argument(name_, does_test, does_error) { setMatrixAllowed(allow_matrix); b_argloop = true; } VectorArgument::VectorArgument(const VectorArgument *arg) { set(arg); b_argloop = arg->reoccuringArguments(); size_t i = 1; while(true) { if(!arg->getArgument(i)) break; subargs.push_back(arg->getArgument(i)->copy()); i++; } } VectorArgument::~VectorArgument() { for(size_t i = 0; i < subargs.size(); i++) { delete subargs[i]; } } bool VectorArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { //if(!value.isVector()) { value.eval(eo); //} if(!value.isVector()) { if(isLastArgument()) value.transform(STRUCT_VECTOR); else return false; } if(b_argloop && subargs.size() > 0) { for(size_t i = 0; i < value.countChildren(); i++) { if(!subargs[i % subargs.size()]->test(value[i], 1, NULL, eo)) { return false; } } } else { for(size_t i = 0; i < subargs.size() && i < value.countChildren(); i++) { if(!subargs[i]->test(value[i], 1, NULL, eo)) { return false; } } } return true; } int VectorArgument::type() const {return ARGUMENT_TYPE_VECTOR;} Argument *VectorArgument::copy() const {return new VectorArgument(this);} string VectorArgument::print() const {return _("vector");} string VectorArgument::subprintlong() const { if(subargs.size() > 0) { string str = _("a vector with "); for(size_t i = 0; i < subargs.size(); i++) { if(i > 0) { str += ", "; } str += subargs[i]->printlong(); } if(b_argloop) { str += ", ..."; } return str; } else { return _("a vector"); } } bool VectorArgument::reoccuringArguments() const { return b_argloop; } void VectorArgument::setReoccuringArguments(bool reocc) { b_argloop = reocc; } void VectorArgument::addArgument(Argument *arg) { arg->setAlerts(false); subargs.push_back(arg); } void VectorArgument::delArgument(size_t index) { if(index > 0 && index <= subargs.size()) { subargs.erase(subargs.begin() + (index - 1)); } } size_t VectorArgument::countArguments() const { return subargs.size(); } Argument *VectorArgument::getArgument(size_t index) const { if(index > 0 && index <= subargs.size()) { return subargs[index - 1]; } return NULL; } MatrixArgument::MatrixArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { b_square = false; } MatrixArgument::MatrixArgument(const MatrixArgument *arg) { set(arg); b_square = arg->squareDemanded(); } MatrixArgument::~MatrixArgument() {} bool MatrixArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { //if(!value.isMatrix()) { value.eval(eo); //} return value.isMatrix() && (!b_square || value.matrixIsSquare()); } bool MatrixArgument::squareDemanded() const {return b_square;} void MatrixArgument::setSquareDemanded(bool square) {b_square = square;} int MatrixArgument::type() const {return ARGUMENT_TYPE_MATRIX;} Argument *MatrixArgument::copy() const {return new MatrixArgument(this);} string MatrixArgument::print() const {return _("matrix");} string MatrixArgument::subprintlong() const { if(b_square) { return _("a square matrix"); } else { return _("a matrix"); } } ExpressionItemArgument::ExpressionItemArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} ExpressionItemArgument::ExpressionItemArgument(const ExpressionItemArgument *arg) {set(arg); b_text = true;} ExpressionItemArgument::~ExpressionItemArgument() {} bool ExpressionItemArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && CALCULATOR->getExpressionItem(value.symbol()); } int ExpressionItemArgument::type() const {return ARGUMENT_TYPE_EXPRESSION_ITEM;} Argument *ExpressionItemArgument::copy() const {return new ExpressionItemArgument(this);} string ExpressionItemArgument::print() const {return _("object");} string ExpressionItemArgument::subprintlong() const {return _("a valid function, unit or variable name");} FunctionArgument::FunctionArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} FunctionArgument::FunctionArgument(const FunctionArgument *arg) {set(arg); b_text = true;} FunctionArgument::~FunctionArgument() {} bool FunctionArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && CALCULATOR->getActiveFunction(value.symbol()); } int FunctionArgument::type() const {return ARGUMENT_TYPE_FUNCTION;} Argument *FunctionArgument::copy() const {return new FunctionArgument(this);} string FunctionArgument::print() const {return _("function");} string FunctionArgument::subprintlong() const {return _("a valid function name");} UnitArgument::UnitArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} UnitArgument::UnitArgument(const UnitArgument *arg) {set(arg); b_text = true;} UnitArgument::~UnitArgument() {} bool UnitArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && CALCULATOR->getActiveUnit(value.symbol()); } int UnitArgument::type() const {return ARGUMENT_TYPE_UNIT;} Argument *UnitArgument::copy() const {return new UnitArgument(this);} string UnitArgument::print() const {return _("unit");} string UnitArgument::subprintlong() const {return _("a valid unit name");} VariableArgument::VariableArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} VariableArgument::VariableArgument(const VariableArgument *arg) {set(arg); b_text = true;} VariableArgument::~VariableArgument() {} bool VariableArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic() && CALCULATOR->getActiveVariable(value.symbol()); } int VariableArgument::type() const {return ARGUMENT_TYPE_VARIABLE;} Argument *VariableArgument::copy() const {return new VariableArgument(this);} string VariableArgument::print() const {return _("variable");} string VariableArgument::subprintlong() const {return _("a valid variable name");} FileArgument::FileArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {b_text = true;} FileArgument::FileArgument(const FileArgument *arg) {set(arg); b_text = true;} FileArgument::~FileArgument() {} bool FileArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isSymbolic()) { value.eval(eo); } return value.isSymbolic(); } int FileArgument::type() const {return ARGUMENT_TYPE_FILE;} Argument *FileArgument::copy() const {return new FileArgument(this);} string FileArgument::print() const {return _("file");} string FileArgument::subprintlong() const {return _("a valid file name");} BooleanArgument::BooleanArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {} BooleanArgument::BooleanArgument(const BooleanArgument *arg) {set(arg);} BooleanArgument::~BooleanArgument() {} bool BooleanArgument::subtest(MathStructure &value, const EvaluationOptions &eo) const { if(!value.isNumber()) { value.eval(eo); } return value.isZero() || value.isOne(); } int BooleanArgument::type() const {return ARGUMENT_TYPE_BOOLEAN;} Argument *BooleanArgument::copy() const {return new BooleanArgument(this);} string BooleanArgument::print() const {return _("boolean");} string BooleanArgument::subprintlong() const {return _("a boolean (0 or 1)");} AngleArgument::AngleArgument(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) {} AngleArgument::AngleArgument(const AngleArgument *arg) {set(arg);} AngleArgument::~AngleArgument() {} bool AngleArgument::subtest(MathStructure&, const EvaluationOptions&) const { return true; } int AngleArgument::type() const {return ARGUMENT_TYPE_ANGLE;} Argument *AngleArgument::copy() const {return new AngleArgument(this);} string AngleArgument::print() const {return _("angle");} string AngleArgument::subprintlong() const {return _("an angle or a number (using the default angle unit)");} void AngleArgument::parse(MathStructure *mstruct, const string &str, const ParseOptions &po) const { CALCULATOR->parse(mstruct, str, po); if(po.angle_unit != ANGLE_UNIT_NONE) { if(mstruct->contains(CALCULATOR->getDegUnit(), false, true, true) > 0) return; if(mstruct->contains(CALCULATOR->getGraUnit(), false, true, true) > 0) return; if(mstruct->contains(CALCULATOR->getRadUnit(), false, true, true) > 0) return; } switch(po.angle_unit) { case ANGLE_UNIT_DEGREES: { mstruct->multiply(CALCULATOR->getDegUnit()); break; } case ANGLE_UNIT_GRADIANS: { mstruct->multiply(CALCULATOR->getGraUnit()); break; } case ANGLE_UNIT_RADIANS: { mstruct->multiply(CALCULATOR->getRadUnit()); break; } default: {} } } ArgumentSet::ArgumentSet(string name_, bool does_test, bool does_error) : Argument(name_, does_test, does_error) { } ArgumentSet::ArgumentSet(const ArgumentSet *arg) { set(arg); size_t i = 1; while(true) { if(!arg->getArgument(i)) break; subargs.push_back(arg->getArgument(i)->copy()); i++; } } ArgumentSet::~ArgumentSet() { for(size_t i = 0; i < subargs.size(); i++) { delete subargs[i]; } } bool ArgumentSet::subtest(MathStructure &value, const EvaluationOptions &eo) const { for(size_t i = 0; i < subargs.size(); i++) { if(subargs[i]->test(value, 1, NULL, eo)) { return true; } } return false; } int ArgumentSet::type() const {return ARGUMENT_TYPE_SET;} Argument *ArgumentSet::copy() const {return new ArgumentSet(this);} string ArgumentSet::print() const { string str = ""; for(size_t i = 0; i < subargs.size(); i++) { if(i > 0) { if(i == subargs.size() - 1) { str += " "; str += _("or"); str += " "; } else { str += ", "; } } str += subargs[i]->print(); } return str; } string ArgumentSet::subprintlong() const { string str = ""; for(size_t i = 0; i < subargs.size(); i++) { if(i > 0) { if(i == subargs.size() - 1) { str += " "; str += _("or"); str += " "; } else { str += ", "; } } str += subargs[i]->printlong(); } return str; } void ArgumentSet::addArgument(Argument *arg) { arg->setAlerts(false); subargs.push_back(arg); } void ArgumentSet::delArgument(size_t index) { if(index > 0 && index <= subargs.size()) { subargs.erase(subargs.begin() + (index - 1)); } } size_t ArgumentSet::countArguments() const { return subargs.size(); } Argument *ArgumentSet::getArgument(size_t index) const { if(index > 0 && index <= subargs.size()) { return subargs[index - 1]; } return NULL; } libqalculate-2.8.2/libqalculate/Prefix.h0000644000175000017500000001666013127506715015176 00000000000000/* Qalculate (library) Copyright (C) 2003-2006, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef PREFIX_H #define PREFIX_H #include #include /** @file */ ///Types for prefix classes. typedef enum { PREFIX_DECIMAL, PREFIX_BINARY, PREFIX_NUMBER } PrefixType; ///Abstract class for prefixes. /** A prefix is prepended to a unit to specificy a quantity multiplicator. A prefix has a numerical value which raised to the units power defines the quantity. In for example the expression "3 kilometers", meter is the unit, 3 is regular quantity, and kilo is a prefix with a value 1000, thus the example equals "3000 meters". If the unit instead had been squared, the value of the prefix would have been raised by two and the total quantity would have been 3.000.000. Prefixes can have up to free different three names -- a long name, a short name and a short unicode name. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed. The names or used to reference the prefix in mathematical expressions and to display a prefix in a result. */ class Prefix { protected: string l_name, s_name, u_name; public: /** Create a prefix. * * @param long_name Long name. * @param short_name Short name. * @param unicode_name Unicode name. */ Prefix(string long_name, string short_name = "", string unicode_name = ""); virtual ~Prefix(); /** Returns the short name of the prefix. * * @param return_long_if_no_short If the long name shall be returned if the prefix has not got a short name (if it is empty). * @param use_unicode If a unicode version of the name is allowed and preferred. * @returns The short name of the prefix. */ const string &shortName(bool return_long_if_no_short = true, bool use_unicode = false) const; /** Returns the long name of the prefix. * * @param return_short_if_no_long If the short name shall be returned if the prefix has not got a long name (if it is empty). * @param use_unicode If a unicode version of the name is allowed and preferred. * @returns The long name of the prefix. */ const string &longName(bool return_short_if_no_long = true, bool use_unicode = false) const; /** Returns the unicode name of the prefix. * * @param return_short_if_no_uni If the short name shall be returned if the prefix has not got a unicode name (if it is empty). * @returns The unicode name of the prefix. */ const string &unicodeName(bool return_short_if_no_uni = true) const; /** Sets the short name of the prefix. * * @param short_name The new short name for the prefix. */ void setShortName(string short_name); /** Sets the long name of the prefix. * * @param long_name The new long name for the prefix. */ void setLongName(string long_name); /** Sets the unicode name of the prefix. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed. * * @param unicode_name The new unicode name for the prefix. */ void setUnicodeName(string unicode_name); /** Returns a preferred name of the prefix. * * @param short_default If a short name is preferred. * @param use_unicode If a unicode name is preferred. * @param can_display_unicode_string_function Function that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected. * @param can_display_unicode_string_arg Argument to pass to the above test function. * @returns A preferred name. */ const string &name(bool short_default = true, bool use_unicode = false, bool (*can_display_unicode_string_function) (const char*, void*) = NULL, void *can_display_unicode_string_arg = NULL) const; /** Returns the value of the prefix. * * @param nexp The power of the prefixed unit. * @returns The value of the prefix. */ virtual Number value(const Number &nexp) const = 0; /** Returns the value of the prefix. * * @param iexp The power of the prefixed unit. * @returns The value of the prefix. */ virtual Number value(int iexp) const = 0; /** Returns the value of the prefix. * * @returns The value of the prefix. */ virtual Number value() const = 0; /** Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix. * * @returns The type of the prefix. */ virtual int type() const = 0; }; ///A decimal (metric) prefix. /** A metric or decimal prefix has an integer exponent which with a base of ten constitutes the value of the prefix (value=10^exponent). */ class DecimalPrefix : public Prefix { protected: int exp; public: /** Create a decimal prefix. * * @param exp10 Exponent for the value. * @param long_name Long name. * @param short_name Short name. * @param unicode_name Unicode name. */ DecimalPrefix(int exp10, string long_name, string short_name = "", string unicode_name = ""); ~DecimalPrefix(); /** Returns the exponent. * * @param iexp Exponent of the unit. * @returns The exponent of the prefix. */ int exponent(int iexp = 1) const; /** Returns the exponent. * * @param nexp Exponent of the unit. * @returns The exponent of the prefix. */ Number exponent(const Number &nexp) const; /** Sets the exponent of the prefix. * * @param iexp New exponent for the prefix. */ void setExponent(int iexp); Number value(const Number &nexp) const; Number value(int iexp) const; Number value() const; int type() const; }; ///A binary prefix. /** A Binary prefix has an integer exponent which with a base of two constitutes the value of the prefix (value=2^exponent). */ class BinaryPrefix : public Prefix { protected: int exp; public: /** Create a binary prefix. * * @param exp2 Exponent for the value. * @param long_name Long name. * @param short_name Short name. * @param unicode_name Unicode name. */ BinaryPrefix(int exp2, string long_name, string short_name = "", string unicode_name = ""); ~BinaryPrefix(); /** Returns the exponent. * * @param iexp Exponent of the unit. * @returns The exponent of the prefix. */ int exponent(int iexp = 1) const; /** Returns the exponent. * * @param nexp Exponent of the unit. * @returns The exponent of the prefix. */ Number exponent(const Number &nexp) const; /** Sets the exponent of the prefix. * * @param iexp New exponent for the prefix. */ void setExponent(int iexp); Number value(const Number &nexp) const; Number value(int iexp) const; Number value() const; int type() const; }; ///A prefix with a free numerical value. /** A prefix without any predefined base, which can use any number. */ class NumberPrefix : public Prefix { protected: Number o_number; public: /** Create a number prefix. * * @param nr Value of the prefix. * @param long_name Long name. * @param short_name Short name. * @param unicode_name Unicode name. */ NumberPrefix(const Number &nr, string long_name, string short_name = "", string unicode_name = ""); ~NumberPrefix(); /** Sets the value of the prefix. * * @param nr New value for the prefix. */ void setValue(const Number &nr); Number value(const Number &nexp) const; Number value(int iexp) const; Number value() const; int type() const; }; #endif libqalculate-2.8.2/libqalculate/support.h0000644000175000017500000000120712715271142015437 00000000000000#ifndef SUPPORT_H #define SUPPORT_H #ifdef HAVE_CONFIG_H # include #endif /* * Standard gettext macros. */ #ifdef ENABLE_NLS # include # undef _ # define _(String) dgettext (GETTEXT_PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #endif libqalculate-2.8.2/libqalculate/Prefix.cc0000644000175000017500000001042113127507146015320 00000000000000/* Qalculate (library) Copyright (C) 2003-2006, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "Prefix.h" #include "Calculator.h" #include "Number.h" Prefix::Prefix(string long_name, string short_name, string unicode_name) { l_name = long_name; s_name = short_name; u_name = unicode_name; } Prefix::~Prefix() { } const string &Prefix::shortName(bool return_long_if_no_short, bool use_unicode) const { if(use_unicode && !u_name.empty()) return u_name; if(return_long_if_no_short && s_name.empty()) { return l_name; } return s_name; } const string &Prefix::longName(bool return_short_if_no_long, bool use_unicode) const { if(return_short_if_no_long && l_name.empty()) { if(use_unicode && !u_name.empty()) return u_name; return s_name; } return l_name; } const string &Prefix::unicodeName(bool return_short_if_no_unicode) const { if(return_short_if_no_unicode && u_name.empty()) { return s_name; } return u_name; } void Prefix::setShortName(string short_name) { s_name = short_name; CALCULATOR->prefixNameChanged(this); } void Prefix::setLongName(string long_name) { l_name = long_name; CALCULATOR->prefixNameChanged(this); } void Prefix::setUnicodeName(string unicode_name) { u_name = unicode_name; CALCULATOR->prefixNameChanged(this); } const string &Prefix::name(bool short_default, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { if(short_default) { if(use_unicode && !u_name.empty() && (!can_display_unicode_string_function || (*can_display_unicode_string_function) (u_name.c_str(), can_display_unicode_string_arg))) return u_name; if(s_name.empty()) { return l_name; } return s_name; } if(l_name.empty()) { if(use_unicode && !u_name.empty() && (!can_display_unicode_string_function || (*can_display_unicode_string_function) (u_name.c_str(), can_display_unicode_string_arg))) return u_name; return s_name; } return l_name; } DecimalPrefix::DecimalPrefix(int exp10, string long_name, string short_name, string unicode_name) : Prefix(long_name, short_name, unicode_name) { exp = exp10; } DecimalPrefix::~DecimalPrefix() { } int DecimalPrefix::exponent(int iexp) const { return exp * iexp; } Number DecimalPrefix::exponent(const Number &nexp) const { return nexp * exp; } void DecimalPrefix::setExponent(int iexp) { exp = iexp; } Number DecimalPrefix::value(const Number &nexp) const { Number nr(exponent(nexp)); nr.exp10(); return nr; } Number DecimalPrefix::value(int iexp) const { Number nr(exponent(iexp)); nr.exp10(); return nr; } Number DecimalPrefix::value() const { Number nr(exp); nr.exp10(); return nr; } int DecimalPrefix::type() const { return PREFIX_DECIMAL; } BinaryPrefix::BinaryPrefix(int exp2, string long_name, string short_name, string unicode_name) : Prefix(long_name, short_name, unicode_name) { exp = exp2; } BinaryPrefix::~BinaryPrefix() { } int BinaryPrefix::exponent(int iexp) const { return exp * iexp; } Number BinaryPrefix::exponent(const Number &nexp) const { return nexp * exp; } void BinaryPrefix::setExponent(int iexp) { exp = iexp; } Number BinaryPrefix::value(const Number &nexp) const { Number nr(exponent(nexp)); nr.exp2(); return nr; } Number BinaryPrefix::value(int iexp) const { Number nr(exponent(iexp)); nr.exp2(); return nr; } Number BinaryPrefix::value() const { Number nr(exp); nr.exp2(); return nr; } int BinaryPrefix::type() const { return PREFIX_BINARY; } NumberPrefix::NumberPrefix(const Number &nr, string long_name, string short_name, string unicode_name) : Prefix(long_name, short_name, unicode_name) { o_number = nr; } NumberPrefix::~NumberPrefix() { } void NumberPrefix::setValue(const Number &nr) { o_number = nr; } Number NumberPrefix::value(const Number &nexp) const { Number nr(o_number); nr.raise(nexp); return nr; } Number NumberPrefix::value(int iexp) const { Number nr(o_number); nr.raise(iexp); return nr; } Number NumberPrefix::value() const { return o_number; } int NumberPrefix::type() const { return PREFIX_NUMBER; } libqalculate-2.8.2/libqalculate/Function.h0000644000175000017500000006344313262104372015520 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef FUNCTION_H #define FUNCTION_H #include #include #include /** @file */ ///Argument types typedef enum { ARGUMENT_TYPE_FREE, ARGUMENT_TYPE_SYMBOLIC, ARGUMENT_TYPE_TEXT, ARGUMENT_TYPE_DATE, ARGUMENT_TYPE_FILE, ARGUMENT_TYPE_INTEGER, ARGUMENT_TYPE_NUMBER, ARGUMENT_TYPE_VECTOR, ARGUMENT_TYPE_MATRIX, ARGUMENT_TYPE_EXPRESSION_ITEM, ARGUMENT_TYPE_FUNCTION, ARGUMENT_TYPE_UNIT, ARGUMENT_TYPE_BOOLEAN, ARGUMENT_TYPE_VARIABLE, ARGUMENT_TYPE_ANGLE, ARGUMENT_TYPE_SET, ARGUMENT_TYPE_DATA_OBJECT, ARGUMENT_TYPE_DATA_PROPERTY } ArgumentType; ///Predefined max and min values for number and integer arguments. typedef enum { ARGUMENT_MIN_MAX_NONE, ARGUMENT_MIN_MAX_POSITIVE, ARGUMENT_MIN_MAX_NONZERO, ARGUMENT_MIN_MAX_NONNEGATIVE, ARGUMENT_MIN_MAX_NEGATIVE } ArgumentMinMaxPreDefinition; /// Type of mathematical function typedef enum { /// class MathFunction SUBTYPE_FUNCTION, /// class UseFunction SUBTYPE_USER_FUNCTION, /// class DataSet SUBTYPE_DATA_SET } FunctionSubtype; class MathFunction_p; /// Abstract base class for mathematical functions. /** * A mathemical function, subclassed from MathFunction, should at least reimplement * calculate(MathStructure&, const MathStructure&, const EvaluationOptions&) and copy(), and preferably also the represents* functions. * Argument definitions should be added in the constructor. */ class MathFunction : public ExpressionItem { protected: MathFunction_p *priv; int argc; int max_argc; vector default_values; size_t last_argdef_index; bool testArguments(MathStructure &vargs); virtual MathStructure createFunctionMathStructureFromVArgs(const MathStructure &vargs); virtual MathStructure createFunctionMathStructureFromSVArgs(vector &svargs); string scondition; string sexample; public: MathFunction(string name_, int argc_, int max_argc_ = 0, string cat_ = "", string title_ = "", string descr_ = "", bool is_active = true); MathFunction(const MathFunction *function); MathFunction(); virtual ~MathFunction(); virtual ExpressionItem *copy() const = 0; virtual void set(const ExpressionItem *item); virtual int type() const; /** Returns the subtype of the mathematical function, corresponding to which subsubclass the object belongs to. * * @returns ::FunctionSubtype. */ virtual int subtype() const; string example(bool raw_format = false, string name_string = "") const; void setExample(string new_example); bool testArgumentCount(int itmp); virtual MathStructure calculate(const string &eq, const EvaluationOptions &eo = default_evaluation_options); virtual MathStructure parse(const string &eq, const ParseOptions &po = default_parse_options); virtual int parse(MathStructure &mstruct, const string &eq, const ParseOptions &po = default_parse_options); virtual MathStructure calculate(MathStructure &vargs, const EvaluationOptions &eo = default_evaluation_options); /** * The main function for subclasses to reimplement. * Calculates a value from arguments in vargs and puts it in mstruct. * * This function expects the number of arguments to be equal to the maximum number of arguments, and checked by the argument definitions. * * If the return value is negative, then argument -(return value) has been evaluated in mstruct. * If -(return value) is greater than max arguments, then mstruct is a vector of evaluated argument values. * * @param[out] mstruct Structure that is set with the result of the calculation. * @param vargs Arguments passed to the mathematical function. * @param eo Evaluation options. * @returns 1 if the calculation was successful. */ virtual int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); /** Returns the functions condition expression. * * @returns The function's condition expression */ string condition() const; /** Print the function's condition expression with argument names. * * @returns The printed condition */ string printCondition(); /** Sets the functions condition expression. * * @param expression The function's new condition expression */ void setCondition(string expression); /** Test if arguments fulfil the function's condition expression. * * @param vargs Vector with arguments. * @returns true if the arguments fulfil the function's condition expression */ bool testCondition(const MathStructure &vargs); /** Returns the maximum number of arguments that the function accepts or -1 if the number of arguments is unlimited. */ int args() const; /** Returns the minimum number of arguments for the function. */ int minargs() const; /** Returns the maximum number of arguments that the function accepts or -1 if the number of arguments is unlimited. */ int maxargs() const; /** Parses arguments from a text string and places them in a vector. The text string should be a comma separated list of arguments. * * @param str The argument string to parse. * @param vargs Vector to store parsed arguments in. * @param po Parse options. * @returns The number of parsed arguments. */ int args(const string &str, MathStructure &vargs, const ParseOptions &po = default_parse_options); /** Returns the index of the last argument definition. * * @returns The index of the last argument definition */ size_t lastArgumentDefinitionIndex() const; /** Returns the argument definition for an argument index. * * @param index Argument index. * @returns The argument definition for the index or NULL if no the argument was not defined for the index */ Argument *getArgumentDefinition(size_t index); /** Removes all argument definitions for the function. */ void clearArgumentDefinitions(); /** Set the argument definition for an argument index. * * @param index Argument index. * @param argdef A newly allocated argument definition */ void setArgumentDefinition(size_t index, Argument *argdef); int stringArgs(const string &str, vector &svargs); void setDefaultValue(size_t arg_, string value_); const string &getDefaultValue(size_t arg_) const; void appendDefaultValues(MathStructure &vargs); MathStructure produceVector(const MathStructure &vargs, int begin = -1, int end = -1); MathStructure produceArgumentsVector(const MathStructure &vargs, int begin = -1, int end = -1); virtual bool representsPositive(const MathStructure&, bool = false) const; virtual bool representsNegative(const MathStructure&, bool = false) const; virtual bool representsNonNegative(const MathStructure&, bool = false) const; virtual bool representsNonPositive(const MathStructure&, bool = false) const; virtual bool representsInteger(const MathStructure&, bool = false) const; virtual bool representsNumber(const MathStructure&, bool = false) const; virtual bool representsRational(const MathStructure&, bool = false) const; virtual bool representsNonComplex(const MathStructure&, bool = false) const; virtual bool representsReal(const MathStructure&, bool = false) const; virtual bool representsComplex(const MathStructure&, bool = false) const; virtual bool representsNonZero(const MathStructure&, bool = false) const; virtual bool representsEven(const MathStructure&, bool = false) const; virtual bool representsOdd(const MathStructure&, bool = false) const; virtual bool representsUndefined(const MathStructure&) const; virtual bool representsBoolean(const MathStructure&) const; virtual bool representsNonMatrix(const MathStructure&) const; virtual bool representsScalar(const MathStructure&) const; }; /// A user defined mathematical function. /** * User functions are functions defined using expression strings, representing mathematical formulas. * * The expression/formula of a function is basically a normal expression with placeholders for arguments. * These placeholders consists of a backslash and a letter — x, y, z for the 1st, 2nd and 3rd arguments and a to u for argument 4 to 24. * They are replaced by entered arguments when a function is calculated. * The placeholders naturally also decide the number of arguments that a function requires. * For example the function for triangle area ("base * height / 2") has the name triangle and the formula "(\x*\y)/2", * which gives that "triangle(2, 3)" equals "(2*3) / 2" and returns "3" as result. * An argument can be used more than one time and all arguments must not necessarily be in order in the formula. * * Additionally, optional arguments can be put in the formula with upper-case (X, Y, Z, ...) instead of lower-case letters (x, y, z, ...). * The default value can be put in brackets after the letter (ex. "\X{2}"). * The default value may be omitted and is then zero. All additional arguments after an optional argument must also be optional. * * To simplify the formula and make it more efficient, subfunctions can be used. * These works just like the main formula, using the arguments of it. * Subfunctions are referenced in the formula using \index ('\2', '\2', '\3', ...). * Even though it would be quite meaningless, the formula for triangle function could for example have a subfunction "\x*\y" and the formula "\1/2". * Subfunctions must be added before the main formula is set. */ class UserFunction : public MathFunction { protected: string sformula, sformula_calc; vector v_subs; vector v_precalculate; public: UserFunction(string cat_, string name_, string formula_, bool is_local = true, int argc_ = -1, string title_ = "", string descr_ = "", int max_argc_ = 0, bool is_active = true); UserFunction(const UserFunction *function); void set(const ExpressionItem *item); ExpressionItem *copy() const; /** Returns the external representation of the formula. */ string formula() const; /** Returns the internal representation of the formula. */ string internalFormula() const; int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); /** Sets the formula of the mathematical function. * * @param new_formula Formula/expression. * @param arc_ Minimum number of arguments or -1 to read from formula. * @param max_argc_ Maximum number of arguments (ignored if argc_ < 0) */ void setFormula(string new_formula, int argc_ = -1, int max_argc_ = 0); void addSubfunction(string subfunction, bool precalculate = true); /** Sets the formula for a subfunction. * * @param index Index (starting at 1). * @param subfunction Formula/expression. */ void setSubfunction(size_t index, string subfunction); void delSubfunction(size_t index); void clearSubfunctions(); size_t countSubfunctions() const; void setSubfunctionPrecalculated(size_t index, bool precalculate); const string &getSubfunction(size_t index) const; bool subfunctionPrecalculated(size_t index) const; int subtype() const; }; /// A mathematical function argument definition with free value and base class for all argument definitions. /** Free arguments accepts any value. */ class Argument { protected: string sname, scondition; bool b_zero, b_test, b_matrix, b_text, b_error, b_rational, b_last, b_handle_vector; /** This function is called from Argument::test() and performs validation specific to the argument definition type. * Should be reimplemented by all subclasses. * * @param value Value to test. * @param eo Evaluation options to use if the value needs to be evaluated. * @returns true if the value is valid for the argument definition. */ virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; /** This function is called from Argument::printlong() and returns description specific the argument definition type. * Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" * and Argument::printlong() might append " that fulfills the condition: even(\x)". * * @returns Long description. */ virtual string subprintlong() const; public: /** Creates a new argument definition. * * @param name Name/title of the argument definition. * @param does_test If argument values will be tested. * @param does_error If an error will issued if the value tests false. */ Argument(string name_ = "", bool does_test = true, bool does_error = true); /** Creates a copy of an argument definition. * * @param arg Argument to copy. */ Argument(const Argument *arg); /** Destructor */ virtual ~Argument(); /** Sets the argument to a copy of an argument definition. * * @param arg Argument to copy. */ virtual void set(const Argument *arg); /** Returns a copy of the argument definition. * * @returns A copy. */ virtual Argument *copy() const; /** Resturns a short description of the argument definition. * Ex. "number" for NumberArgument. * * @returns Short description. */ virtual string print() const; /** Resturns a long description of the argument definition. * Ex. "A real number > 2". * * @returns Long description. */ string printlong() const; /** Tests if a value fulfils the requirements of the argument definition. * The value might change if it has not been fully evaluated. * * @param value Value to test. * @param f Mathematical function that the value is an argument for. * @param eo Evaluation options to use if the value needs to be evaluated. * @returns true if the value is valid for the argument definition. */ bool test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo = default_evaluation_options) const; /** Parses an expression for an argument value. * The default behavior is to use Calculator::parse() directly. * * @param str Expression. * @param po Parse options. * @returns A new mathematical structure with the parsed expression. */ virtual MathStructure parse(const string &str, const ParseOptions &po = default_parse_options) const; /** Parses an expression for an argument value. * The default behavior is to use Calculator::parse() directly. * * @param mstruct Mathematical structure to set with the parsed expression. * @param str Expression. * @param po Parse options. */ virtual void parse(MathStructure *mstruct, const string &str, const ParseOptions &po = default_parse_options) const; /** Returns the name/title of the argument definition. * * @returns Name/title. */ string name() const; /** Sets the name/title of the argument definition. * * @param name_ New name/title. */ void setName(string name_); /** Sets a custom condition for argument values. * '\x' is replaced by the argument value in the expression. * * @param condition Condition expression. */ void setCustomCondition(string condition); /** Returns the custom condition expression set for argument values. * * @returns Custom condition for argument values. */ string getCustomCondition() const; /** If the value for the argument will be tested. If not, the argument only works as an suggestion and any value is allowed. * * @returns true if the argument value will be tested. */ bool tests() const; void setTests(bool does_error); /** If an error message will be presented to the user if the value for the argument is not allowed. * * @returns true if error messages will be shown. */ bool alerts() const; void setAlerts(bool does_error); /** If an argument value of zero is forbidden. * * @returns true if zero argument value is forbidden. */ bool zeroForbidden() const; /** Sets if a value of zero is forbidden for the argument value. * * @param forbid_zero If zero shall be forbidden. */ void setZeroForbidden(bool forbid_zero); bool matrixAllowed() const; void setMatrixAllowed(bool allow_matrix); bool handlesVector() const; void setHandleVector(bool handle_vector); bool isLastArgument() const; void setIsLastArgument(bool is_last); /** If only rational polynomials are allowed as argument value. * * @see MathStructure::isRationalPolynomial() * @returns true if only rational polynomials is allowed. */ bool rationalPolynomial() const; void setRationalPolynomial(bool rational_polynomial); virtual bool suggestsQuotes() const; /** Returns the type of the argument, corresponding to which subclass the object belongs to. * * @returns ::ArgumentType. */ virtual int type() const; }; /// A definition for numerical arguments. /** These arguments allows numerical values. The value can be restricted to real or rational numbers (defaults to allow all numbers, including complex), and a max and/or min value. */ class NumberArgument : public Argument { protected: Number *fmin, *fmax; bool b_incl_min, b_incl_max; bool b_complex, b_rational_number; protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: NumberArgument(string name_ = "", ArgumentMinMaxPreDefinition minmax = ARGUMENT_MIN_MAX_NONE, bool does_test = true, bool does_error = true); NumberArgument(const NumberArgument *arg); virtual ~NumberArgument(); virtual void set(const Argument *arg); virtual Argument *copy() const; virtual string print() const; void setMin(const Number *nmin); void setIncludeEqualsMin(bool include_equals); bool includeEqualsMin() const; const Number *min() const; void setMax(const Number *nmax); void setIncludeEqualsMax(bool include_equals); bool includeEqualsMax() const; const Number *max() const; bool complexAllowed() const; void setComplexAllowed(bool allow_complex); bool rationalNumber() const; void setRationalNumber(bool rational_number); virtual int type() const; }; /// A definition for integer arguments. /** These arguments allows numerical integer values. The value can be restricted to a max and/or min value. */ class IntegerArgument : public Argument { protected: Number *imin, *imax; IntegerType i_inttype; protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: IntegerArgument(string name_ = "", ArgumentMinMaxPreDefinition minmax = ARGUMENT_MIN_MAX_NONE, bool does_test = true, bool does_error = true, IntegerType integer_type = INTEGER_TYPE_NONE); IntegerArgument(const IntegerArgument *arg); virtual ~IntegerArgument(); IntegerType integerType() const; void setIntegerType(IntegerType integer_type); virtual void set(const Argument *arg); virtual Argument *copy() const; virtual string print() const; void setMin(const Number *nmin); const Number *min() const; void setMax(const Number *nmax); const Number *max() const; virtual int type() const; }; /// A symbolic argument. /** Accepts variables and symbolic structures. */ class SymbolicArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: SymbolicArgument(string name_ = "", bool does_test = true, bool does_error = true); SymbolicArgument(const SymbolicArgument *arg); virtual ~SymbolicArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A text argument. /** Accepts text (symbolic) structures. Argument values are parsed as text, unless surrounded by back slashes (which are then removed). Surrounding Parentheses and first quotation marks are removed. */ class TextArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: TextArgument(string name_ = "", bool does_test = true, bool does_error = true); TextArgument(const TextArgument *arg); virtual ~TextArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; virtual bool suggestsQuotes() const; }; /// A date argument. /** A text argument representing a date. */ class DateArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: DateArgument(string name_ = "", bool does_test = true, bool does_error = true); DateArgument(const DateArgument *arg); virtual ~DateArgument(); virtual void parse(MathStructure *mstruct, const string &str, const ParseOptions &po = default_parse_options) const; virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A vector argument. /** */ class VectorArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; vector subargs; bool b_argloop; public: VectorArgument(string name_ = "", bool does_test = true, bool allow_matrix = false, bool does_error = true); VectorArgument(const VectorArgument *arg); virtual ~VectorArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; bool reoccuringArguments() const; void setReoccuringArguments(bool reocc); void addArgument(Argument *arg); void delArgument(size_t index); size_t countArguments() const; Argument *getArgument(size_t index) const; }; /// A matrix argument. /** */ class MatrixArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; bool b_square; public: MatrixArgument(string name_ = "", bool does_test = true, bool does_error = true); MatrixArgument(const MatrixArgument *arg); virtual bool squareDemanded() const; virtual void setSquareDemanded(bool square); virtual ~MatrixArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// Argument for functions, variables and units. /** Text string representing a function, variable or unit name. */ class ExpressionItemArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: ExpressionItemArgument(string name_ = "", bool does_test = true, bool does_error = true); ExpressionItemArgument(const ExpressionItemArgument *arg); virtual ~ExpressionItemArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A function argument. /** */ class FunctionArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: FunctionArgument(string name_ = "", bool does_test = true, bool does_error = true); FunctionArgument(const FunctionArgument *arg); virtual ~FunctionArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A boolean argument. /** Accepts zero or one. */ class BooleanArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: BooleanArgument(string name_ = "", bool does_test = true, bool does_error = true); BooleanArgument(const BooleanArgument *arg); virtual ~BooleanArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; class UnitArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: UnitArgument(string name_ = "", bool does_test = true, bool does_error = true); UnitArgument(const UnitArgument *arg); virtual ~UnitArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; class AngleArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: AngleArgument(string name_ = "", bool does_test = true, bool does_error = true); AngleArgument(const AngleArgument *arg); virtual ~AngleArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; virtual void parse(MathStructure *mstruct, const string &str, const ParseOptions &po = default_parse_options) const; }; class VariableArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: VariableArgument(string name_ = "", bool does_test = true, bool does_error = true); VariableArgument(const VariableArgument *arg); virtual ~VariableArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; class FileArgument : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: FileArgument(string name_ = "", bool does_test = true, bool does_error = true); FileArgument(const FileArgument *arg); virtual ~FileArgument(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; }; /// A set of accepted arguments. /** This is used when several different type of argments shall be accepted by a function. */ class ArgumentSet : public Argument { protected: virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; vector subargs; public: ArgumentSet(string name_ = "", bool does_test = true, bool does_error = true); ArgumentSet(const ArgumentSet *arg); virtual ~ArgumentSet(); virtual int type() const; virtual Argument *copy() const; virtual string print() const; void addArgument(Argument *arg); void delArgument(size_t index); size_t countArguments() const; Argument *getArgument(size_t index) const; }; #endif libqalculate-2.8.2/libqalculate/ExpressionItem.cc0000644000175000017500000003776313227072130017052 00000000000000/* Qalculate (library) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include "ExpressionItem.h" #include "Calculator.h" #include "util.h" ExpressionName::ExpressionName(string sname) : suffix(false), unicode(false), plural(false), reference(false), avoid_input(false), completion_only(false) { name = sname; if(text_length_is_one(sname)) { abbreviation = true; case_sensitive = true; } else { abbreviation = false; case_sensitive = false; } } ExpressionName::ExpressionName() : abbreviation(false), suffix(false), unicode(false), plural(false), reference(false), avoid_input(false), case_sensitive(false), completion_only(false) { } void ExpressionName::operator = (const ExpressionName &ename) { name = ename.name; abbreviation = ename.abbreviation; case_sensitive = ename.case_sensitive; suffix = ename.suffix; unicode = ename.unicode; plural = ename.plural; reference = ename.reference; avoid_input = ename.avoid_input; completion_only = ename.completion_only; } bool ExpressionName::operator == (const ExpressionName &ename) const { return name == ename.name && abbreviation == ename.abbreviation && case_sensitive == ename.case_sensitive && suffix == ename.suffix && unicode == ename.unicode && plural == ename.plural && reference == ename.reference && avoid_input == ename.avoid_input && completion_only == ename.completion_only; } bool ExpressionName::operator != (const ExpressionName &ename) const { return name != ename.name || abbreviation != ename.abbreviation || case_sensitive != ename.case_sensitive || suffix != ename.suffix || unicode != ename.unicode || plural != ename.plural || reference != ename.reference || avoid_input != ename.avoid_input || completion_only != ename.completion_only; } ExpressionItem::ExpressionItem(string cat_, string name_, string title_, string descr_, bool is_local, bool is_builtin, bool is_active) { b_local = is_local; b_builtin = is_builtin; remove_blank_ends(name_); remove_blank_ends(cat_); remove_blank_ends(title_); if(!name_.empty()) { names.resize(1); names[0].name = name_; names[0].unicode = false; names[0].abbreviation = false; names[0].case_sensitive = text_length_is_one(names[0].name); names[0].suffix = false; names[0].avoid_input = false; names[0].reference = true; names[0].plural = false; } stitle = title_; scat = cat_; sdescr = descr_; b_changed = false; b_approx = false; i_precision = -1; b_active = is_active; b_registered = false; b_hidden = false; b_destroyed = false; i_ref = 0; } ExpressionItem::ExpressionItem() { b_changed = false; b_approx = false; i_precision = -1; b_active = true; b_local = true; b_builtin = false; b_registered = false; b_hidden = false; b_destroyed = false; i_ref = 0; } ExpressionItem::~ExpressionItem() { } void ExpressionItem::set(const ExpressionItem *item) { b_changed = item->hasChanged(); b_approx = item->isApproximate(); i_precision = item->precision(); b_active = item->isActive(); for(size_t i = 1; i <= item->countNames(); i++) { names.push_back(item->getName(1)); } stitle = item->title(false); scat = item->category(); sdescr = item->description(); b_local = item->isLocal(); b_builtin = item->isBuiltin(); b_hidden = item->isHidden(); } bool ExpressionItem::destroy() { CALCULATOR->expressionItemDeleted(this); if(v_refs.size() > 0) { return false; } else if(i_ref > 0) { b_destroyed = true; } else { delete this; } return true; } bool ExpressionItem::isRegistered() const { return b_registered; } void ExpressionItem::setRegistered(bool is_registered) { b_registered = is_registered; } const string &ExpressionItem::title(bool return_name_if_no_title, bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { if(return_name_if_no_title && stitle.empty()) { return preferredName(false, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg).name; } return stitle; } void ExpressionItem::setTitle(string title_) { remove_blank_ends(title_); if(stitle != title_) { stitle = title_; b_changed = true; } } const string &ExpressionItem::description() const { return sdescr; } void ExpressionItem::setDescription(string descr_) { remove_blank_ends(descr_); if(sdescr != descr_) { sdescr = descr_; b_changed = true; } } const string &ExpressionItem::name(bool use_unicode, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { bool undisplayable_uni = false; for(size_t i = 0; i < names.size(); i++) { if(names[i].unicode == use_unicode && (!names[i].completion_only || i + 1 == names.size())) { if(use_unicode && can_display_unicode_string_function && !((*can_display_unicode_string_function) (names[i].name.c_str(), can_display_unicode_string_arg))) { undisplayable_uni = true; } else { return names[i].name; } } } if(undisplayable_uni) return name(false); if(names.size() > 0) return names[0].name; return empty_string; } const string &ExpressionItem::referenceName() const { for(size_t i = 0; i < names.size(); i++) { if(names[i].reference) { return names[i].name; } } if(names.size() > 0) return names[0].name; return empty_string; } const ExpressionName &ExpressionItem::preferredName(bool abbreviation, bool use_unicode, bool plural, bool reference, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { if(names.size() == 1) return names[0]; int index = -1; for(size_t i = 0; i < names.size(); i++) { if((!reference || names[i].reference) && names[i].abbreviation == abbreviation && names[i].unicode == use_unicode && names[i].plural == plural && !names[i].completion_only && (!use_unicode || !can_display_unicode_string_function || (*can_display_unicode_string_function) (names[i].name.c_str(), can_display_unicode_string_arg))) return names[i]; if(index < 0) { index = i; } else if(names[i].completion_only != names[index].completion_only) { if(!names[i].completion_only) index = i; } else if(reference && names[i].reference != names[index].reference) { if(names[i].reference) index = i; } else if(!use_unicode && names[i].unicode != names[index].unicode) { if(!names[i].unicode) index = i; } else if(names[i].abbreviation != names[index].abbreviation) { if(names[i].abbreviation == abbreviation) index = i; } else if(names[i].plural != names[index].plural) { if(names[i].plural == plural) index = i; } else if(use_unicode && names[i].unicode != names[index].unicode) { if(names[i].unicode) index = i; } } if(use_unicode && names[index].unicode && can_display_unicode_string_function && !((*can_display_unicode_string_function) (names[index].name.c_str(), can_display_unicode_string_arg))) { return preferredName(abbreviation, false, plural, reference, can_display_unicode_string_function, can_display_unicode_string_arg); } if(index >= 0) return names[index]; return empty_expression_name; } const ExpressionName &ExpressionItem::preferredInputName(bool abbreviation, bool use_unicode, bool plural, bool reference, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { if(names.size() == 1) return names[0]; int index = -1; for(size_t i = 0; i < names.size(); i++) { if((!reference || names[i].reference) && names[i].abbreviation == abbreviation && names[i].unicode == use_unicode && names[i].plural == plural && !names[i].avoid_input && !names[i].completion_only) return names[i]; if(index < 0) { index = i; } else if(names[i].completion_only != names[index].completion_only) { if(!names[i].completion_only) index = i; } else if(reference && names[i].reference != names[index].reference) { if(names[i].reference) index = i; } else if(!use_unicode && names[i].unicode != names[index].unicode) { if(!names[i].unicode) index = i; } else if(names[i].avoid_input != names[index].avoid_input) { if(!names[i].avoid_input) index = i; } else if(abbreviation && names[i].abbreviation != names[index].abbreviation) { if(names[i].abbreviation) index = i; } else if(plural && names[i].plural != names[index].plural) { if(names[i].plural) index = i; } else if(!abbreviation && names[i].abbreviation != names[index].abbreviation) { if(!names[i].abbreviation) index = i; } else if(!plural && names[i].plural != names[index].plural) { if(!names[i].plural) index = i; } else if(use_unicode && names[i].unicode != names[index].unicode) { if(names[i].unicode) index = i; } } if(use_unicode && names[index].unicode && can_display_unicode_string_function && !((*can_display_unicode_string_function) (names[index].name.c_str(), can_display_unicode_string_arg))) { return preferredInputName(abbreviation, false, plural, reference, can_display_unicode_string_function, can_display_unicode_string_arg); } if(index >= 0) return names[index]; return empty_expression_name; } const ExpressionName &ExpressionItem::preferredDisplayName(bool abbreviation, bool use_unicode, bool plural, bool reference, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { return preferredName(abbreviation, use_unicode, plural, reference, can_display_unicode_string_function, can_display_unicode_string_arg); } const ExpressionName &ExpressionItem::getName(size_t index) const { if(index > 0 && index <= names.size()) return names[index - 1]; return empty_expression_name; } void ExpressionItem::setName(const ExpressionName &ename, size_t index, bool force) { if(index < 1) addName(ename, 1); if(index > names.size()) addName(ename); if(b_registered && names[index - 1].name != ename.name) { names[index - 1] = ename; names[index - 1].name = CALCULATOR->getName(ename.name, this, force); b_changed = true; CALCULATOR->nameChanged(this); } else if(ename != names[index - 1]) { names[index - 1] = ename; b_changed = true; } } void ExpressionItem::setName(string sname, size_t index, bool force) { if(index < 1) addName(sname, 1); if(index > names.size()) addName(sname); if(b_registered && names[index - 1].name != sname) { names[index - 1].name = CALCULATOR->getName(sname, this, force); b_changed = true; CALCULATOR->nameChanged(this); } else if(sname != names[index - 1].name) { names[index - 1].name = sname; b_changed = true; } } void ExpressionItem::addName(const ExpressionName &ename, size_t index, bool force) { if(index < 1 || index > names.size()) { names.push_back(ename); index = names.size(); } else { names.insert(names.begin() + (index - 1), ename); } if(b_registered) { names[index - 1].name = CALCULATOR->getName(names[index - 1].name, this, force); CALCULATOR->nameChanged(this); } b_changed = true; } void ExpressionItem::addName(string sname, size_t index, bool force) { if(index < 1 || index > names.size()) { names.push_back(ExpressionName(sname)); index = names.size(); } else { names.insert(names.begin() + (index - 1), ExpressionName(sname)); } if(b_registered) { names[index - 1].name = CALCULATOR->getName(names[index - 1].name, this, force); CALCULATOR->nameChanged(this); } b_changed = true; } size_t ExpressionItem::countNames() const { return names.size(); } void ExpressionItem::clearNames() { if(names.size() > 0) { names.clear(); if(b_registered) { CALCULATOR->nameChanged(this); } b_changed = true; } } void ExpressionItem::clearNonReferenceNames() { bool b = false; for(vector::iterator it = names.begin(); it != names.end(); ++it) { if(!it->reference) { it = names.erase(it); --it; b = true; } } if(b) { if(b_registered) { CALCULATOR->nameChanged(this); } b_changed = true; } } void ExpressionItem::removeName(size_t index) { if(index > 0 && index <= names.size()) { names.erase(names.begin() + (index - 1)); if(b_registered) { CALCULATOR->nameChanged(this); } b_changed = true; } } size_t ExpressionItem::hasName(const string &sname, bool case_sensitive) const { for(size_t i = 0; i < names.size(); i++) { if(case_sensitive && names[i].case_sensitive && sname == names[i].name) return i + 1; if((!case_sensitive || !names[i].case_sensitive) && equalsIgnoreCase(names[i].name, sname)) return i + 1; } return 0; } size_t ExpressionItem::hasNameCaseSensitive(const string &sname) const { for(size_t i = 0; i < names.size(); i++) { if(sname == names[i].name) return i + 1; } return 0; } const ExpressionName &ExpressionItem::findName(int abbreviation, int use_unicode, int plural, bool (*can_display_unicode_string_function) (const char*, void*), void *can_display_unicode_string_arg) const { for(size_t i = 0; i < names.size(); i++) { if((abbreviation < 0 || names[i].abbreviation == abbreviation) && (use_unicode < 0 || names[i].unicode == use_unicode) && (plural < 0 || names[i].plural == plural) && (!names[i].unicode || !can_display_unicode_string_function || ((*can_display_unicode_string_function) (names[i].name.c_str(), can_display_unicode_string_arg)))) return names[i]; } return empty_expression_name; } const string &ExpressionItem::category() const { return scat; } void ExpressionItem::setCategory(string cat_) { remove_blank_ends(cat_); if(scat != cat_) { scat = cat_; b_changed = true; } } bool ExpressionItem::isLocal() const { return b_local; } bool ExpressionItem::setLocal(bool is_local, int will_be_active) { if(b_builtin) return false; if(is_local != b_local) { if(!b_local) { bool was_active = b_active; b_active = false; ExpressionItem *item = copy(); b_local = is_local; b_active = was_active; if(will_be_active) { setActive(true); } else if(will_be_active == 0) { setActive(false); } CALCULATOR->addExpressionItem(item); if(was_active != item->isActive()) { item->setChanged(true); } if(was_active && will_be_active == 0) { item->setActive(true); } } b_local = is_local; } else if(will_be_active >= 0) { setActive(will_be_active); } return true; } bool ExpressionItem::isBuiltin() const { return b_builtin; } bool ExpressionItem::hasChanged() const { return b_changed; } void ExpressionItem::setChanged(bool has_changed) { b_changed = has_changed; } bool ExpressionItem::isApproximate() const { return b_approx; } void ExpressionItem::setApproximate(bool is_approx) { if(is_approx != b_approx) { b_approx = is_approx; if(!b_approx) i_precision = -1; b_changed = true; } } int ExpressionItem::precision() const { return i_precision; } void ExpressionItem::setPrecision(int prec) { if(i_precision != prec) { i_precision = prec; if(i_precision >= 0) b_approx = true; b_changed = true; } } bool ExpressionItem::isActive() const { return b_active; } void ExpressionItem::setActive(bool is_active) { if(is_active != b_active) { b_active = is_active; if(b_registered) { if(is_active) { CALCULATOR->expressionItemActivated(this); } else { CALCULATOR->expressionItemDeactivated(this); } } b_changed = true; } } bool ExpressionItem::isHidden() const { return b_hidden; } void ExpressionItem::setHidden(bool is_hidden) { if(is_hidden != b_hidden) { b_hidden = is_hidden; b_changed = true; } } int ExpressionItem::refcount() const { return i_ref; } void ExpressionItem::ref() { i_ref++; } void ExpressionItem::unref() { i_ref--; if(b_destroyed && i_ref <= 0) { delete this; } } void ExpressionItem::ref(ExpressionItem *o) { i_ref++; v_refs.push_back(o); } void ExpressionItem::unref(ExpressionItem *o) { for(size_t i = 0; i < v_refs.size(); i++) { if(v_refs[i] == o) { i_ref--; v_refs.erase(v_refs.begin() + i); break; } } } ExpressionItem *ExpressionItem::getReferencer(size_t index) const { if(index > 0 && index <= v_refs.size()) { return v_refs[index - 1]; } return NULL; } bool ExpressionItem::changeReference(ExpressionItem*, ExpressionItem*) { return false; } libqalculate-2.8.2/libqalculate/Makefile.am0000644000175000017500000000160013257361377015617 00000000000000# # src/libqalculate/Makefile.am for qalculate # lib_LTLIBRARIES = libqalculate.la libqalculate_la_SOURCES = \ Function.cc Calculator.cc DataSet.cc \ Variable.cc ExpressionItem.cc Number.cc MathStructure.cc \ Prefix.cc support.h util.cc Unit.cc BuiltinFunctions.cc \ QalculateDateTime.cc libqalculateincludedir = $(includedir)/libqalculate libqalculateinclude_HEADERS = \ Function.h Calculator.h DataSet.h Variable.h \ ExpressionItem.h Number.h MathStructure.h Prefix.h \ util.h includes.h Unit.h BuiltinFunctions.h \ QalculateDateTime.h qalculate.h libqalculate_la_LDFLAGS = -version-info $(QALCULATE_CURRENT):$(QALCULATE_REVISION):$(QALCULATE_AGE) -no-undefined libqalculate_la_LIBADD = \ @LIBCURL_LIBS@ @LIBXML_LIBS@ @ICU_LIBS@ @LTLIBINTL@ @LTLIBICONV@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ @LIBCURL_CFLAGS@ @LIBXML_CFLAGS@ @ICU_CFLAGS@ libqalculate-2.8.2/libqalculate/DataSet.h0000644000175000017500000002354513127506766015274 00000000000000/* Qalculate (library) Copyright (C) 2004-2006, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #ifndef DATA_SET_H #define DATA_SET_H #include #include /** @file */ typedef vector::iterator DataObjectPropertyIter; /// A a data set object. /** Data objects consist of property-value pairs. */ class DataObject { protected: vector properties; vector s_properties; vector s_nonlocalized_properties; vector m_properties; vector a_properties; DataSet *parent; bool b_uchanged; public: /** Create a data object. * * @param parent_set Data set that the object will belong to. */ DataObject(DataSet *parent_set); /** Unset (erase value) a property. * * @param property Property to unset. */ void eraseProperty(DataProperty *property); /** Set value for a property. * * @param property Property to set (must belong to parent data set). * @param s_vale Value for the property. * @param is_approximate If the value is approximate. 1 for approximate, 0 for exact, -1 for property default. */ void setProperty(DataProperty *property, string s_value, int is_approximate = -1); /** Set an untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key. * * @param property Property to set (must belong to parent data set). * @param s_vale Value for the property. */ void setNonlocalizedKeyProperty(DataProperty *property, string s_value); /** Returns parsed value for a property. Parses the text string value if not parsed before * * @param property Property to read. * @returns Parsed value or NULL if property value is not set. */ const MathStructure *getPropertyStruct(DataProperty *property); /** Returns unparsed value for a property. * * @param property Property to read. * @param[out] is_approximate If the value is approximate. Is set to 1 for approximate, 0 for exact, -1 for property default, if not NULL. * @returns Unparsed value or empty string if property value is not set. */ const string &getProperty(DataProperty *property, int *is_approximate = NULL); /** Returns unparsed untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key. * * @param property Property to read. * @returns Unparsed untranslated value or empty string if property value is not set. */ const string &getNonlocalizedKeyProperty(DataProperty *property); /** Returns value for a property in a format suitable for use in expressions with unit appended. * * @param property Property to read. * @returns Value in input format or empty string if property value is not set. */ string getPropertyInputString(DataProperty *property); /** Returns value for a property in a format suitable for display with unit appended. * * @param property Property to read. * @returns Value in display format or empty string if property value is not set. */ string getPropertyDisplayString(DataProperty *property); /** If the object has been modified by the end user (if setUserModified() has been called). * * @returns true if the object has been modified by the user. */ bool isUserModified() const; /** Specify if the object has been modified by the end user. * * @param user_modified true if the object has been modified by the user. */ void setUserModified(bool user_modified = true); /** Returns the data set that the object belongs to. * * @returns Parent data set. */ DataSet *parentSet() const; }; typedef enum { PROPERTY_EXPRESSION, PROPERTY_NUMBER, PROPERTY_STRING } PropertyType; /// A data set property. /** Property definitions for use with data set objects. */ class DataProperty { protected: vector names; vector name_is_ref; string sdescr, stitle, sunit; MathStructure *m_unit; bool b_approximate, b_brackets, b_key, b_case, b_hide; DataSet *parent; PropertyType ptype; bool b_uchanged; public: /** Create a data property. * * @param s_name Property name (initial) used for reference. * @param s_title Descriptive name/title. * @param s_description Description. */ DataProperty(DataSet *parent_set, string s_name = "", string s_title = "", string s_description = ""); DataProperty(const DataProperty &dp); void set(const DataProperty &dp); void setName(string s_name, bool is_ref = false); void setNameIsReference(size_t index = 1, bool is_ref = true); bool nameIsReference(size_t index = 1) const; void clearNames(); void addName(string s_name, bool is_ref = false, size_t index = 0); size_t hasName(const string &s_name); size_t countNames() const; const string &getName(size_t index = 1) const; const string &getReferenceName() const; void setTitle(string s_title); const string &title(bool return_name_if_no_title = true) const; void setDescription(string s_description); const string &description() const; void setUnit(string s_unit); const string &getUnitString() const; const MathStructure *getUnitStruct(); string getInputString(const string &valuestr); string getDisplayString(const string &valuestr); MathStructure *generateStruct(const string &valuestr, int is_approximate = -1); void setKey(bool is_key = true); bool isKey() const; void setHidden(bool is_hidden = true); bool isHidden() const; void setCaseSensitive(bool is_case_sensitive = true); bool isCaseSensitive() const; void setUsesBrackets(bool uses_brackets = true); bool usesBrackets() const; void setApproximate(bool is_approximate = true); bool isApproximate() const; void setPropertyType(PropertyType property_type); PropertyType propertyType() const; bool isUserModified() const; void setUserModified(bool user_modified = true); DataSet *parentSet() const; }; typedef vector::iterator DataPropertyIter; typedef vector::iterator DataObjectIter; /// A data set. /** This is a simple database class for storage of many grouped values, when ordinary variables is not practical. * * A data set consists of properties and objects, with values for the properties. Qalculate! includes for example a "Planets" data set with properties such as name, mass, speed and density, and an object for each planet in solar system. * * A data set is also mathemtical function, dataset(object, property), which retrieves values for objects and properties. * Data sets can be saved and loaded from a XML file. */ class DataSet : public MathFunction { protected: string sfile, scopyright; bool b_loaded; vector properties; vector objects; public: DataSet(string s_category = "", string s_name = "", string s_default_file = "", string s_title = "", string s_description = "", bool is_local = true); DataSet(const DataSet *o); ExpressionItem *copy() const; void set(const ExpressionItem *item); int subtype() const; void setCopyright(string s_copyright); const string ©right() const; void setDefaultDataFile(string s_file); const string &defaultDataFile() const; void setDefaultProperty(string property); const string &defaultProperty() const; virtual int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo); bool loadObjects(const char *file_name = NULL, bool is_user_defs = true); int saveObjects(const char *file_name = NULL, bool save_global = false); bool objectsLoaded() const; void setObjectsLoaded(bool objects_loaded); void addProperty(DataProperty *dp); void delProperty(DataProperty *dp); void delProperty(DataPropertyIter *it); DataProperty *getPrimaryKeyProperty(); DataProperty *getProperty(string property); DataProperty *getFirstProperty(DataPropertyIter *it); DataProperty *getNextProperty(DataPropertyIter *it); const string &getFirstPropertyName(DataPropertyIter *it); const string &getNextPropertyName(DataPropertyIter *it); void addObject(DataObject *o); void delObject(DataObject *o); void delObject(DataObjectIter *it); DataObject *getObject(string object); DataObject *getObject(const MathStructure &object); DataObject *getFirstObject(DataObjectIter *it); DataObject *getNextObject(DataObjectIter *it); const MathStructure *getObjectProperyStruct(string property, string object); const string &getObjectProperty(string property, string object); string getObjectPropertyInputString(string property, string object); string getObjectPropertyDisplayString(string property, string object); string printProperties(string object); string printProperties(DataObject *o); }; /// Data property function argument. class DataPropertyArgument : public Argument { protected: DataSet *o_data; virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: DataPropertyArgument(DataSet *data_set, string name_ = "", bool does_test = true, bool does_error = true); DataPropertyArgument(const DataPropertyArgument *arg); ~DataPropertyArgument(); int type() const; Argument *copy() const; string print() const; DataSet *dataSet() const; void setDataSet(DataSet *data_set); }; /// Data object function argument. class DataObjectArgument : public Argument { protected: DataSet *o_data; virtual bool subtest(MathStructure &value, const EvaluationOptions &eo) const; virtual string subprintlong() const; public: DataObjectArgument(DataSet *data_set, string name_ = "", bool does_test = true, bool does_error = true); DataObjectArgument(const DataObjectArgument *arg); ~DataObjectArgument(); int type() const; Argument *copy() const; string print() const; DataSet *dataSet() const; void setDataSet(DataSet *data_set); }; #endif libqalculate-2.8.2/Makefile.in0000644000175000017500000007257113401033103013153 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = libqalculate.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/libqalculate.pc.in ABOUT-NLS AUTHORS COPYING \ ChangeLog INSTALL NEWS README TODO compile config.guess \ config.rpath config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEST = @QALCULATE_TEST@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = libqalculate src data po po-defs docs EXTRA_DIST = config.rpath \ autogen.sh \ README.translate \ libqalculate.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libqalculate.pc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 libqalculate.pc: $(top_builddir)/config.status $(srcdir)/libqalculate.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libqalculate-2.8.2/ChangeLog0000644000175000017500000036425213401031701012662 000000000000002018-12-02 Hanna Knutsson * Fix missing prefix for gram when exponent of gram is not one and automatic prefixes is off 2018-11-13 Hanna Knutsson * Fixes for units with non-linear relation * Use single quotation marks for unknowns with one character 2018-11-12 Hanna Knutsson * Improve line breaks * UTF-8 algorithms tweaks 2018-11-09 Hanna Knutsson * Fix handling of unicode chars for \a (="a") syntax * Only use italics for quoted single characters 2018-11-07 Hanna Knutsson * Improve appearance of x*m/s and similar * Hectare/decare improvements 2018-11-06 Hanna Knutsson * Proper line breaks in qalc * Fix (x+y)^a (was not expanded!) 2018-11-05 Hanna Knutsson * Line count fixes 2018-11-04 Hanna Knutsson * Do not transform rational numbers to integers in numerator and denominator if the resulting integers is not displayed in exact format * Add set options shortcuts and add option descriptions to help set, in qalc * Set restrict_fraction_length to true for 'set fractions fraction' in qalc * Hectare and decare units (in addition to ha/da and hectoare/decaare) 2018-11-01 Hanna Knutsson * Fix roman() when used for reversed conversion with number that includes zero (issue #93) 2018-10-31 Hanna Knutsson * Fix compilation without readline 2018-10-30 Hanna Knutsson * Always interpret expression that begins with '/' as a command in qalc * Interpret a character preceded by '\' as an unknown variable (same as in quotation marks) * Replace text in quotation marks with italic text in qalc * Always enable units for expressions that ends with "to [unit expression]", "to optimal", or similar 2018-10-29 Hanna Knutsson * Group options in qalc * Fix values for x when log(x) and Li(x) represents positive * Fix a*b^x+cx=d * Fixes for interval calculations with complex derivative * Improve trigonometric interval calculations 2018-10-28 Hanna Knutsson * Simplify e^(a*pi*i) to (-1)^a and apply further simplifications to (-1)^a instead * raised the to power" => "raised to the power" * Fix atanh(x)=a when im(a) < 0 (no solution exists) * Fix temporarily activated interval arithmetics leading to lasting deactivation * Fix magnitude() definition 2018-10-27 Hanna Knutsson * Solve a^(2x)+a^x=b, a^(-x)+a^x=b, and similar * Solve a*sinh(x)+b*cosh(x)=c * Fix atan(i) and atan(-i) * Simplify e^(i*atan(a)) to (1+a*i)/sqrt(a^2+1) * Generalize e^(a*pi*i) for all rational a * Simplify (a/b)^c to a^c/b^c if a and b are integers * Fix unrecognized gcd failure * Fix segfault on n*1^infinity * Fix atan(i) and atan(-i) * Fix atanh(x)=a when im(a) < 0 (no solution exists) * Fix temporarily activated interval arithmetics leading to lasting deactivation 2018-10-26 Hanna Knutsson * Fixes for default angle unit other than radians * Solve a^(b*x)+x=c in exact mode * ln(a*i+b) interval fix * Fix for trigonometric functions with division by argument * Improve polynomial exponentiation limit calculation 2018-10-25 Hanna Knutsson * Simplify arg(e^(a*i)), ln(e^(a*i)) and (e^(a*i))^b * Calculate approximate value to determine sign in abs(), arg(), sgn(), heaviside and dirac(), in exact mode * Use ln()=ln(abs(x))+arg(x)i in more cases in exact mode * Fix infinite loop in trigonometric simplifications * Only remove near zero part of complex number interval if interval includes zero 2018-10-24 Hanna Knutsson * Remove probably zero imaginary part from numbers in plot data * ln() simplifications for complex arguments * Fix approximate comparison between rational number and interval * Fix never ending loop in polynomial division * Fix (-x)^(-2/3) and similar when x is assumed negative * abs(a^(b*i))=1 if a is positive and b is real * Fix endless loop with abs(interval) base and polynomial power 2018-10-23 Hanna Knutsson * Fix endless loop with (x^8)^(52^(1/10)) and similar if x is assumed negative * Fix simplification of a*log(b)+c*log(d) when b or d is complex * Fix "E-" in +/- number interval specification * Fix segfault in interval variable factorization 2018-10-22 Hanna Knutsson * Simplify (e^(a*i))^(b) when a and b are real numbers, and b equals 1/2 or abs(a) < pi * Test result for ln(x)=a if a is complex * Solutions for x*ln(a*x)=b and x^2*ln(a*x)=b, and a*x+ln(b*x)=c * Fix precision property for a^(+/-infinity) 2018-10-21 Hanna Knutsson * Newton-raphson fixes/improvements * Use Lambert W branches for complex solutions * Add solution for a*b^x+cx=d when d != 0 * Calculate all complex solutions for x^(a/b)=c * Make n variable available to user 2018-10-20 Hanna Knutsson * Univariate factorization (non-square free) for polynomial factors with degree >= 2 (simple algorithm based on Kronecker method) * Add branch argument to lambertw() (only the principal branch is calculated) * Fix segfault in gcd with very large polynomial degree (restrict to < 1000) 2018-10-18 Hanna Knutsson * Improve a*x*b^(c*x)=d * Solve a*b^x+cx=0 * Improve x^(a*x^b)=c * Simplification and factorization fixes * sqrt(a)/a=1/sqrt(a) for rational numbers * Fix a^x=b for complex x, and (-1)^x=1 and (-1)^x=1 for real x 2018-10-17 Hanna Knutsson * Allow interval and infinity when determining if equal for logical and, and or * Improve a^x=b * Return exact result for x^x=a in some cases 2018-10-16 Hanna Knutsson * Fix a^x=b when a is zero * Fix abs(x)=-a * Fix segfault on 1^(a/b) in exact mode when a or b are extremely large * 1^a always exactly 1 if not a is infinite * Set maximum argument for cosh and sinh calculation (< 2^28) * Set maximum order for bessely() to 1000 (too slow above) * Fix log(a^x, b) when a is negative or x is complex * Fix parsing of thin space in numbers 2018-10-15 Hanna Knutsson * Fix adaptive interval display (when +/- in expression) * Fix E-notation for +/- (parse 1E4+/-1E2 as 10000+/-100) * Improve precision of asin(a*i); Fix ln(a*ln(pi)) * Fix segfault in polynomial division * Fix polynomial division in some complex cases 2018-10-14 Hanna Knutsson * sin(i*x)=i*sinh(x), etc. * a^(b*c)!=(a^b)^c if b is complex * Replace with temporary variable in replace() if replacement value is interval * Replace n with single possible value in equation result for unknown variable with interval 2018-10-13 Hanna Knutsson * Fix radian unit with prefix in trigonometric functions * Fix critically slow handling of many AND OR combinations * Fix segfault in aborted sort * Fix rounding in some cases with intervals * Fix display of zero with strict exp mode * Fix factorization segfault * Trigonometric simplification fix 2018-10-12 Hanna Knutsson * Fix illegal vales for acos(x)=a * Fix atanh(-infinity*i) * Set exact value for atanh() with infinite argument * Fix root(-ax, n) when n is even * Fix sinh(x)=a * Use parentheses for complex numbers (not used if formatted) * Do not use prefixes for angle units by default * Set PrintOptions for messages * Fix 'n' and 'C' variable assumptions * Fix various segfaults * Always place number/zero on right side of comparison in formatted result 2018-10-11 Hanna Knutsson * Use quadratic equation formula directly for ax^d+bx^(2d)=c (solve for x^d) * Fix/improve trigonometric transformations 2018-10-10 Hanna Knutsson * Fix segfault in during formatting * Fix 1/x=0 when x may be infinite * Improve comparison tests * Fix factorization segfault * Fix MathStructure::unformat() 2018-10-09 Hanna Knutsson * Improve precision of ax+bx^2=0 * Improve formatting of values in error/warning output * Use kilo as prefix for gram if automatic prefix is off * Set max exponent for use of mpfr_pow_z * Fix logical AND segfaults * asin() fixes for complex interval 2018-10-08 Hanna Knutsson * Fix acosh(x)=a * Add random expression testing * Fix segfault on 0^(-e) and similar * Fix asin() and acos() for complex numbers * Restrict maximum argument value for sin(), cos() and tan() using current precision * Trigonometric simplification improvements 2018-10-05 Hanna Knutsson * sqrt(a)/a=1/sqrt(a) for integers 2018-10-02 Hanna Knutsson * a*sin(x)+b*cos(x)=a*sqrt((b/a)^2+1)*sin(x+atan(b/a)); sin(sqrt(3)/2)=pi/3, tan(sqrt(3)/3)=pi/6, etc. 2018-09-30 Hanna Knutsson * sin(acos(x))=sqrt(1-x^2) and similar 2018-09-29 Hanna Knutsson * Solve equations with trigonometric functions * sin(a*i)=i*sinh(a), cos(a*i)=cosh(a), tan(a*i)=i*tanh(a) 2018-09-28 Hanna Knutsson * If x might be complex solution for a^x = b is x = (i*pi*n + ln(a)) / ln(b) and similar * Add "C" (for integrals) and "n" (integer) unknown variables (not user accessible) * Trigonometric functions improvements/fixes 2018-09-25 Hanna Knutsson * f(a.b*pi+x) equals (-) f(0.b*pi+x) for sin(), cos() and tan(), e.g. sin(3.37pi+x)=-sin(0.37pi+x) 2018-09-24 Hanna Knutsson * Remove negative sign from trigonometric function argument (e.g. sin(-x)=-sin(x)) 2018-09-20 Hanna Knutsson * Parse |x| and ||x|| as abs(x) and magnitude(x) * Fix Avogadro constant uncertainty 2018-09-18 Hanna Knutsson * Add magnitude(), entrywise() and hadamard() functions 2018-08-10 Hanna Knutsson * Option to disable automatic conversion to local currency (when optimal conversion activated) 2018-08-09 Hanna Knutsson * Fix f(x)+a=a (e.g. x+1=1) * Fix automatic unit conversion after RPN stack calculations 2018-08-08 Hanna Knutsson * Polar and exponential complex number forms 2018-08-01 Hanna Knutsson * Fix ignore comma for RPN syntax 2018-07-22 Hanna Knutsson * Fix ln(-i) 2018-07-09 Hanna Knutsson * Fix display of negative number interval with +/- interval display when uncertainty is lower than global precision * Fix display of addition with negative non-integer number (show "x - a" instead of "x + -a") 2018-06-11 Hanna Knutsson * Do not automatically update all exchange rates sources if not needed 2018-06-09 Hanna Knutsson * Use mycurrency.net html instead of the json data, which has not been for a month 2018-06-04 Hanna Knutsson * Only use two's complement representation for integers * Use a * base^b for extremely long numbers in bases other than decimal 2018-06-02 Hanna Knutsson * When using two's complement representation on negative non-integers, use the same number of decimals as without two's complement representation * Fix round() for negative rational numbers! 2018-06-01 Hanna Knutsson * Interpret 5m 7cm (and similar, for m and L) as 5m+7cm, and 3h 5min (and similar) as 3h+5min * Interpret m2 and m3 as m^2 and m^3 (as before), but m4 as m*4 2018-05-31 Hanna Knutsson * Treat definitions in non-standard user files as global (not directly editable), in order to avoid duplication * Add Calculator::calculateAndPrint() function 2018-05-30 Hanna Knutsson * Add "to base #" conversion * Lunar phase functions 2018-05-27 Hanna Knutsson * Calendar conversion * Add "to" conversion for display of numbers in roman, sexagesimal, or time format 2018-05-21 Hanna Knutsson * Search for matching functions, variables and units using 'list' (or 'find') command in qalc * Improved ln() simplifications 2018-05-19 Hanna Knutsson * Do not automatically convert to broken down composite unit c for x*a+x*b (and similar), if a and b are both aliases for c * Allow 1°2'3" format for degree, arminute and arcsecond * Add arcsec and armin reference name to Arcminute and Arcsecond * Use prime symbols for sexagesimal output format 2018-05-18 Hanna Knutsson * Fix crash when expression contains '>', '<' or '=', and libqalculate is compiled with -D_GLIBCXX_ASSERTIONS * Allow 5'8" format for feet and inches 2018-05-16 Hanna Knutsson * Treat rates.json with "Internal Server Error" message as failed exchange rates download 2018-05-14 Hanna Knutsson * Ignore empty lines and lines beginning with # or // in batch file 2018-05-13 Hanna Knutsson * Fix never ending loop in (-x)^(2/3) if x is assumed negative * Fix x/(x^(3/4)+x) and similar when x is assumed positive 2018-05-06 Hanna Knutsson * Improved series titles in plot() * Derivative for bessely() * Improved product log deriative 2018-05-03 Hanna Knutsson * Add titles to currency list in qalc 2018-05-01 Hanna Knutsson * Add countries property to currencies * Add "(obsolote)" to relevant currencies titles 2018-04-26 Hanna Knutsson * Enhanced interval arithmetic with dependent intervals 2018-04-24 Hanna Knutsson * New currency names and titles (contributed by majumeke) 2018-04-19 Hanna Knutsson * Two's complement representation * bitcmp() function * Option to interprete binary number using two's complement representation in bin() * Allow all rational numbers for second argument of root() 2018-04-18 Hanna Knutsson * Fix a^infinity when a > 1 * limit() function 2018-04-11 Hanna Knutsson * Fix segfault when prefix is set in some cases 2018-04-09 Hanna Knutsson * "to"-conversion for physical constants 2018-04-06 Hanna Knutsson * Calculate each vector element (and each extra argument) separately in many functions (e.g. sin(5, 2, 3) = [-0.95892427, 0.90929743, 0.14112001]) 2018-04-05 Hanna Knutsson * Only remove quotation marks at beginning and end of command line expression if they are the only ones 2018-04-03 Hanna Knutsson * Direct date and time calculation * Return date and time in stamptodate() * Time zone conversion 2018-04-02 Hanna Knutsson * Use local currency as "optimal" currency unit 2018-04-01 Hanna Knutsson * Allow user to change decimal separator (and consequently argument separator) * Fix lambertw() 2018-03-31 Hanna Knutsson * Fix display of parsed sexagesimal number * Do not remove spaces within quotation marks 2018-02-29 Hanna Knutsson * Change how percent (and permille, permyriad) addition and subtract is calculated (100+20%=120) 2018-03-28 Hanna Knutsson * Allow ParseOptions::comma_as_separator to have effect on unlocalizeExpression() and localizeExpression() even if Calculator::useDecimalPoint(true) has not been called. 2018-03-26 Hanna Knutsson * Fix complex atan() * Derivative of arg() * ln(x^a)=ln(x)*a if 1>a>-1 and a!=0 2018-03-24 Hanna Knutsson * Fix segmentation fault when calculating arg(-x) 2018-03-22 Hanna Knutsson * Derivative of gamma(), besselj(), heaviside(), Ci(), Si(), Shi(), Chi(), Ei(), Li(), li(), erf(), erfc(), sinc(), factorial and comparisons, and use dirac() for derative of sgn(). * Complete the square when factorizing 2018-03-20 Hanna Knutsson * --version (-v) command line option for qalc * Make data and config directories recursively 2018-03-15 Hanna Knutsson * Always display rational exponents as fractions if numerator and denominator is less than ten * Fix endless loop when factorizing expression with sgn() * Number display fixes 2018-03-11 Hanna Knutsson * Fix endless loop with (5^x)^(1/3)*5^x * Precalculate in replace() function if original value not found 2018-03-07 Hanna Knutsson * Fix segmentation fault root() in some cases 2018-03-06 Hanna Knutsson * ln(x^a)=a*ln(x) only when x is positive 2018-03-05 Hanna Knutsson * Increase efficieny of trigonometric functions in some cases * Fix 1^x * Allow final interval expansion for high precision intervals 2018-03-02 Hanna Knutsson * Fix endless loop when solving (x^(1/3))^3 * (x^(1/3))^2 + (x^(1/3))^2!=0 and similar with variable substitution 2018-02-27 Hanna Knutsson * Improved handling of blocked messages * sin(x)^2+cos(x)^2=1 2018-03-23 Hanna Knutsson * Partial fractional decomposition * << operator for MathStructure and Number 2018-02-19 Hanna Knutsson * Enhanced integration * Numerical approximation of definitive integral (using Simpson's rule) * Fix exact (-a)^(-b/c) * Fix derivative of acosh 2018-02-10 Hanna Knutsson * dsolve() function for differential equations * Simplify result inbetween each run for high order derivatives to increase performance 2018-02-08 Hanna Knutsson Show a more informative message and fail in autogen.sh when doxygen and API docs is missing 2018-02-02 Hanna Knutsson * Icelandic Krónur added to ECB data 2018-01-26 Hanna Knutsson Use mpfr_rootn_ui with mpfr version >= 4.0.0 2018-01-24 Hanna Knutsson * Support negative exponents and k > n in binomial function 2018-01-23 Hanna Knutsson * Set Gnuplot samples to avoid unsmooth smoothed curve 2018-01-19 Hanna Knutsson * Check if plot data is continuous 2018-01-18 Hanna Knutsson * Use auto_y_min/auto_y_max/y_min/y_max plot parameters * Increase default number of plot samples 2018-01-15 Hanna Knutsson * Add vacuum_permeability and vacuum_permittivity as names for magnetic and electric constants * Add completion only names to enable completion of greek letters from the roman letter names 2018-01-14 Hanna Knutsson * Fix segfault on extremum(cot(x),x) 2018-01-04 Hanna Knutsson * Fix variables (including electric constant) with units parameter and pi in expression 2018-01-02 Hanna Knutsson * Fix unicode signs in expressions with quotations 2017-12-11 Hanna Knutsson * sinc() function 2017-12-08 Hanna Knutsson * Suppress gnuplot error output in terminal 2017-12-05 Hanna Knutsson * Fix x = 0 m && x != 0 2017-12-01 Hanna Knutsson * Fix exact calculation of sqrt(-1/8) 2017-11-30 Hanna Knutsson * Infinity fixes/enhancements. Unsigned infinity removed. 2017-11-27 Hanna Knutsson * Fix (a+b*i)^0 2017-11-22 Hanna Knutsson * Enhanced display of repeating decimals * Fix numbers less than 1 when max decimals is 0 * Enhanced display of parsed expression * Digit grouping 2017-11-16 Hanna Knutsson * Option to disable units in physical constants 2017-11-13 Hanna Knutsson * Fix engineering mode (exp mode < -1) for rational numbers < 1 with few decimals * Fix complex number multiplication (a+b*i)*(c+d*i) 2017-11-12 Hanna Knutsson * Interval arithmetic 2017-10-09 Hanna Knutsson * Bitcoins * Use 'X' and 'E' (or approprioate unicode characters) instead of 'A' and 'B' in duodecimal numbers * Set approximate flag in zeta 2017-09-26 Hanna Knutsson * Enhanced simplification of expressions with polynomial division * Data with invalid values are plotted as discontinuous function 2017-09-24 Hanna Knutsson * Fix thread not terminated on Calculator deletion (issue #45) 2017-09-23 Hanna Knutsson * Fix 5/(x−y)−3/(2x−2y)=7(2x-2y) * Factorization fixes * sqrt(-a)=sqrt(a)*i 2017-09-19 Hanna Knutsson * Fix convert cbrt(L) to optimal unit * Fix automatic prefixes for negative numbers 2017-09-18 Hanna Knutsson * Fix ^4 and ^5 unicode signs * Fix for sqrt(a)=b*sqrt(c) * Calculate all complex roots for x^a=b * arg() enhancements 2017-09-15 Hanna Knutsson * Comparison functions for date class 2017-09-14 Hanna Knutsson * Version check function 2017-09-12 Hanna Knutsson * Additional exchange rates source (mycurrency.net with over 100 additional currencies) * Enhanced equation solving 2017-09-09 Hanna Knutsson * abs() and sgn() enhancements 2017-09-02 Hanna Knutsson * cbrt() and root() now always returns real root 2017-08-30 Hanna Knutsson * Fix solving of (a+x)/(b+x)=c 2017-08-25 Hanna Knutsson * Duplicate the RPN register at the top, instead of pushing zeroes, on RPN enter with empty expression (fixes qalculate-gtk issue #22) * Implementation of all R algorithms in percentile function * Use a formula for exponentiation with a complex power that preserves precision better 2017-08-24 Hanna Knutsson * Fix inconsistent parsing - x^22x=x^22*x, x^2x=x^(2*x) (now x^2x=x^2*x) * Do not round exact integers in EXP_NONE/"Simple" mode (its only annoying) 2017-08-23 Hanna Knutsson * Remove duplicate history entries in qalc * Fix factorization issues 2017-08-22 Hanna Knutsson * Precision variable 2017-08-20 Hanna Knutsson * Fix sum(x/x,0,10) and avoid warning for sum(x/x,1,10), and similar * Unicode ellipsis * Return zero for plot() 2017-08-19 Hanna Knutsson * Enable plotting on Windows (gnuplot must be installed separately) * Support middle dot (00B7) as multiplication sign 2017-08-17 Hanna Knutsson * Ability to apply functions with multiple arguments to the rpn stack (including using the whole stack for functions with a vector as argument) * Fix clang compilation 2017-08-16 Hanna Knutsson * Fix compilation on Ubuntu 16.04 * Move function in fincance to parent category and update description of pmt() 2017-08-14 Hanna Knutsson * Derivatives of inverse and hyberbolic functions * Make for() more efficient 2017-08-11 Hanna Knutsson * Enhance gamma(). Add digamma(), arg(), conj(), besselj(), bessely(), airy(), erf(), erfc() 2017-08-10 Hanna Knutsson * Fix decimal exact fractional format for large numerators and denominators * Avoid display of numbers with extremely large number of digits (> 10000000) for all options 2017-08-09 Hanna Knutsson * Fix trigonometric functions with angle unit other than radian 2017-08-07 Hanna Knutsson * Include system-wide exchange rates file to avoid issues with missing currencies and the need to ask first-time users questions * Reactivate deactivated global variables, units and functions after conflicting local object has been removed 2017-08-06 Hanna Knutsson * Set argument min/max from requested integer type 2017-08-05 Hanna Knutsson * Fixes for MS Windows (now compiles, and runs without apparent issues, with MinGW) 2017-08-04 Hanna Knutsson * Rewritten date functions with support for larger numbers * Check if variable exists in save (:=) function * Fix case insensitive comparison where upper and lower case string have different length 2017-08-03 Hanna Knutsson * Use libcurl instead of gvfs/wget * Remove glib dependency (require instead iconv and icu) 2017-08-02 Hanna Knutsson * Handle errors on thread read and write (seems to solve issue #38) 2017-08-01 Hanna Knutsson * Fix max decimals 2017-07-31 Hanna Knutsson * Use default evaluation options with approximate calculation in plot function * Use GMP and MPFR instead of CLN 2017-07-29 Hanna Knutsson * Fix 3(x+1)(x+y)^3 to factors = 81((x + y) / 3)^3 * (x + 1) 2017-07-27 Hanna Knutsson * Fix engineering exp mode in qalc and allow divisors other than 3 * Do not round digits before decimal point for exact values with exp mode off * Fix sin(pi+x) and cos(pi+x) 2017-07-22 Hanna Knutsson * Fix multiplication of matrix by (row) vector 2017-07-21 Hanna Knutsson * Interpret 1e.1 as 1^10*0.1 instead of 1*e*0.1, and enable use of 'e' as unknown 2017-07-20 Hanna Knutsson * Example property for functions 2017-07-19 Hanna Knutsson * More efficient factorials * Fix Number::print() not able to terminate with very large numbers (halted at cln::expt_pos with y = 0) * Fix termination of MathStructure::print() and format() with very large size * Add extra termination points for MathStructure with large size and do not sort numbers when aborted * Fix display of large integers in fractional modes * Make product() and sum() more efficient * Fix for() * Check that step size gives finite number of data points and set max data points to 1000000 * Increase speed of Number::print() with huge numbers 2017-07-18 Hanna Knutsson * Add option to use step size instead of sampling rate for plot function * Fix non-decimal numbers with rpn syntax 2017-07-17 Hanna Knutsson * Prefer non-hidden composite units over alternatives with multiple units, in optimal unit conversion (5 m/s^2 instead of 0.005 N/g) 2017-07-16 Hanna Knutsson * New Calculator::calculate() variant that calculates a parsed expression * Command line option for maximum calculation and display time 2017-07-15 Hanna Knutsson * Fix formatting of (x^2)/(10y) (was (1*x^2)/(10y)) * STRUCT_ABORTED MathStructure type 2017-07-10 Hanna Knutsson * Rename Calculator::printMathStructureTimeOut() to Calculator::print() 2017-07-09 Hanna Knutsson * Do not convert temperature units if other units are converted, when converting to optimal or base units * More efficient conversion to base units that solves issues with temperature units in conversion to base and optimal units * Lower the maximum exponent to avoid slow division 2017-07-06 Hanna Knutsson * Prefer positive exponents over negative, unless the result includes a another unit with positive exponent (fixes Hz) 2017-07-02 Hanna Knutsson * Do not convert to composite units in mixed units conversion * Fix mixed units forced by default in separate unit conversion 2017-07-01 Hanna Knutsson * Update elements data set * Do not try to calculate zeta for values larger than 100 000 * Controlled termination of plot() 2017-06-30 Hanna Knutsson * Fix x^-y (=x^(-y)) 2017-06-28 Hanna Knutsson * Do not try to calculate extreme exponentiations 2017-06-27 Hanna Knutsson * Controlled calculation termination handling points 2017-06-26 Hanna Knutsson * Polynomial gcd fixes * Do not crash when factorizing 1 * Use clock_gettime() instead of gettimeofday() if avaiable 2017-06-17 Hanna Knutsson * Remove "none" and "non-matrix" assumptions from qalc and when loading definitions from previous versions (<= 0.9.12) * Fix transpose() and (matrix+1)*(matrix-1) * For cases when 0x cannot be assumed to zero, the same should be true for 0x^b 2017-06-12 Hanna Knutsson * Enhanced factorization/simplifaction (including hybrid mode) 2017-06-07 Hanna Knutsson * Revised temperature unit handling 2017-06-05 Hanna Knutsson * Updated automatic conversion - controls that new units really is better than old (fixes V^3) and splits up POST_CONVERSION_BEST in POST_CONVERSION_OPTIMAL_IS and POST_CONVERSION_OPTIMAL (prioritises original units) 2017-05-14 Hanna Knutsson * Use gio when available instead of deprecated gvfs-copy * Save default preferences when running qalc the first time even if in non-interactive mode * Fix ask if fetch exchange rates first qalc run 2017-05-05 Hanna Knutsson * unit/unit/unit = (unit/unit)/unit with adaptive parsing * Fix "1 W Ohm /K/K" 2017-03-31 Hanna Knutsson * Build fixes (Check for libtoolize instead of libtool in autogen.sh; Include Doxyfile in dist files) 2017-03-19 Hanna Knutsson * Merge Windows support fork (chengsun) 2017-02-20 Hanna Knutsson * Use top of the stack twice (instead of zero) for operations (except subtract) when only one value is available 2017-02-18 Hanna Knutsson * "Pop", "copy", "rotate", "move" commands for RPN stack manipulation in qalc * Enable both (or one of) RPN stack and syntax with the "rpn" command in qalc 2017-02-17 Hanna Knutsson * Fix functions with RPN syntax * Swap command for RPN stack manipulation in qalc 2017-02-16 Hanna Knutsson * Do not always reparse expression when parse options have changed * Introduce message categories and stages * Hide parsing stage messages when only recalculating or angle unit has changed in qalc 2017-02-15 Hanna Knutsson * Fix transform last arguments to vector, when only one last argument (fixes function("1+\x"; 1)) 2017-02-14 Hanna Knutsson * New commands for creation of simple functions and variables (with specified expression) in qalc * Do not allow empty names 2017-02-10 Hanna Knutsson * Fix and increase the size of the list of prime numbers * Handle recursive variables (give error and return undefined) * Replace ans with ans2 in ans (and ans2 in ans2...) in qalc 2017-02-08 Hanna Knutsson * Fix set rpn syntax in qalc * Fix set command, in qalc, for variables with spaces 2017-01-26 Hanna Knutsson * Do not raise by exponent numerator larger than 10 000 or smaller than -10 000, when exact exponantiation has failed (fixes slow calculation of for example 2^0.333333333 in "try exact" mode). 2016-12-13 Hanna Knutsson * Do not save mode changes in batches file * Add 'comma as separator' option to qalc and only show 'dot as separator' when dot is not used as decimal separator 2016-12-11 Hanna Knutsson * Use https://www.ecb.europa.eu insead of http://www.ecb.int 2016-11-09 Hanna Knutsson * Add symbol for Czeck koruna 2016-10-30 Hanna Knutsson * Fix u and 1/u to optimal, and handle unforeseen situations better in optimal units conversion 2016-09-07 Hanna Knutsson * Plot functions 2016-09-02 Hanna Knutsson * Fix saving of precision of unit relation 2016-09-01 Hanna Knutsson * Fix "to base" * Mixed units conversion (e.g. 75.2 min = 1 h + 15 min + 12 s) 2016-08-23 Hanna Knutsson * Fix unit conversion (e.g. 1/s to ms) * Fix unit conversion (e.g. 1/ns to GHz) 2016-08-08 Hanna Knutsson * Fix degree sign 2016-08-05 Hanna Knutsson * Fix compilation without readline 2016-07-21 Hanna Knutsson * Do not use unicode signs in definitions list and show both abbreviated and long name 2016-07-20 Hanna Knutsson * 'delete' command, for removal of user-defined variables, in qalc 2016-07-18 Hanna Knutsson * Option to list all functions, variables or units in qalc 2016-07-17 Hanna Knutsson * 'list' command, which displays a list of user defined variables, functions and units, in qalc 2016-07-12 Hanna Knutsson * Avoid warning message if exchange rates file does not exist 2016-07-08 Hanna Knutsson * Fix errors and warnings when compiling with clang, and fix unordered_map/hash_map issues 2016-07-06 Hanna Knutsson * Fix crash when using locale missing on system 2016-06-29 Hanna Knutsson * Fix parsing of "today" and add "tomorrow" and "yesterday" 2016-06-11 Hanna Knutsson * Show actual number of days since last exchange rates update 2016-06-10 Hanna Knutsson * Fix localization of command line arguments 2016-06-09 Hanna Knutsson * Improve exchange rates handling * Add interactive command line option to qalc. Exit after commands from file have been executed unless interactive mode has been explicitly selected. 2016-06-07 Hanna Knutsson * Do not check if exchange rates is up to date when using currencies with fixed exchange rate (currencies replaced by euro) * Warn about old exchange rates again after one week if the application has not been restarted (Calculator object not recreated) * Make sure precision and if approximate is not lost from units, functions and variables * Update physical constants from CODATA Recommended Values 2014 * Fix unit precision from definitions 2016-06-03 Hanna Knutsson * sqrt(7/4) = sqrt(7)/2, sqrt(2)/2−(1/sqrt(2)) equals exactly zero 2016-05-27 Hanna Knutsson * Allow special "to" commands directly in expression * New "to" commands: factors and fraction * Fix segmentation fault when aborting non-interactive qalc (do not use readline) 2016-05-26 Hanna Knutsson * to bin, oct, hex, bases commands in qalc 2016-05-25 Hanna Knutsson * Use ? or 0 in front of unit expression to control if missing prefix should be set 2016-05-24 Hanna Knutsson * Use MULTIPLICATION_SIGN_X by default * Use prefix for more units, add centigrades name for celsius, add Dalton unit and move units to new Atomic Mass category 2016-05-23 Hanna Knutsson * Add unicode signs for powers 0 and 4-9, and cube root 2016-05-20 Hanna Knutsson * Redesigned parsing of spaces in multiplication and division and new parse options to ignore whitespace or not treat implicit multiplication differently from explicit 2016-05-19 Hanna Knutsson * Fix stack editing 2016-05-17 Hanna Knutsson * New print safer abort/timeout system 2016-05-15 Hanna Knutsson * Add thread cancellation point in factorize number function to make crash less likely * Attempt to make print thread cancellation less crash prone 2016-05-11 Hanna Knutsson * Do not add default angle unit if one is already present * Disable inclomplete uncertainty propagation support for now 2016-05-10 Hanna Knutsson * Do not keep zero radians * Always simplify before integration 2016-05-08 Hanna Knutsson * Fix bug #108 by not checking for x in function arguments when isolating x, thus stopping infinite loop * Fix sqrt(x)*sqrt(x) 2016-05-05 Hanna Knutsson * Fix endless loops in gcd functions (solves bug #64) 2016-05-03 Hanna Knutsson * Use standard location for data and configuration (~/.local and ~/.conf) 2016-05-02 Hanna Knutsson * An attempt to solve the convert to unit issues: - Transform Kelvin, Celsius, Farenheit to builtin units. - Convert to kelvin when parsing, to make the conversion visible to the user, after implicit multiplication. - Fix s/g to kg = s*kg/g^2. - Do not set new prefix when converting to unit expression without prefix. * Add Hartree and Rydberg units 2016-04-30 Hanna Knutsson * Update build files and increment version number 2016-04-29 Hanna Knutsson * Update currencies (fix currencies recently recplaced by euro, add new currencies and add additional unicode signs) * Allow decimals in sexagesimal numbers (request #26) 2016-04-28 Hanna Knutsson * Catch CLN exceptions (fixes various bugs) * Fix bug #79 and #127 * Option to ignore commas * Apply most of the portability patch in bug #124 2016-04-26 Hanna Knutsson * Fix preservation of case sensitivity in translated names * Do not append zeroes to decimals if number is approximate or is shown approximately 2016-04-25 Hanna Knutsson * Clarify how "Payment for a loan" works * Fix "function" function when argument vector is too small * Fix result for unsuccessful integration with limits * Fix self-referencing in save function 2016-04-24 Hanna Knutsson * Fix fibonacci function. Remove from program code and use the golden ratio. 2016-04-21 Hanna Knutsson * Fix conversion to unit with prefix (bug #150) * Fix conversion from unit with prefix (bug #97 and #104) 2016-04-19 Hanna Knutsson * Introduce use_with_prefix property for units, to not use prefixes by defaults for units outside SI and CGS systems (solves bug #66) * Partially revert commit [83fe08] * Warn about bad integrate function * Fix abbreviation for Rydberg constant (bug #140) 2016-04-18 Hanna Knutsson * Include for std::sort() * Use unordered_map instead of hash_map for new gcc versions * Fix warnings (including bug #143) * Provide a proper fix for bug 3020050 / #121 (without removing valid warning messages) * Fix parsing of (0xff) (bug #102) * Warn when raising zero by imaginary power (bug #141) * Fix incorrect factorization (bug #130) 2009-01-05 Jonathan Stickel * General build updates and bug fixes, including the ability to build against cln >= 1.2. * Bug fix for segfaults with some uses of integrate() (bug 2537772). 2008-03-17 Hanna Knutsson * Fix reduction of vector size. Fixes bug 1913388. 2007-08-27 Hanna Knutsson * Begin work on propagation of uncertainties * Allow parentheses for vectors (a bit stricter parsing) * brackets_as_parentheses parse option 2007-08-23 Hanna Knutsson * 2/5m = 2/(5m); 2/5 m = (2/5)*m 2007-08-22 Hanna Knutsson * Make DataSet::calculate virtual * dataset.object.property and object.property (with parse_options.default_dataset set) syntax 2007-08-21 Hanna Knutsson * Fix crash with unsupported operator in RPN syntax (bug 1778267) 2007-08-07 Hanna Knutsson * New Simplified Chinese translation (Roy Qu ) 2007-06-17 Hanna Knutsson * Miscellaneous fixes before release 2007-04-27 Hanna Knutsson * New functions: addTime(), isNumber(), isReal(), isRational(), isInteger(), representsNumber(), representsReal(), representsRational(), representsInteger() * Show argument name instead of \x in argument condition 2007-04-26 Hanna Knutsson * Use Lambert W to solve equations * Fix infinite loop when solving some equations * New functions: addDays(), addMonths(), addYear() 2007-04-19 Hanna Knutsson * Enhance lambertw() * Add the Omega constant 2007-04-18 Hanna Knutsson * Implement the Lambert W function 2007-04-17 Hanna Knutsson * Avoid floating point underflow by, in approximate mode, checking against the value of pi in sin() and cos() * Add more exact values for sin() and cos() 2007-04-15 Hanna Knutsson * Fix simplification of (1-1/x)^3 and similar 2007-03-31 Hanna Knutsson * Add grams of TNT (gTNT/gramTNT) and tons of TNT (tTNT/tonTNT) units 2007-03-29 Hanna Knutsson * Fix parsing of unit expressions (when converting) such as W/(m K) * Expand data on elements 2007-03-20 Hanna Knutsson * Fix clumsy mistakes in setPrefixes() leading to crashes * Add typographic units * Add some old french length units * Add alternative name "variations" for permutations * Fix atomic mass unit being put in second density category 2006-12-16 Hanna Knutsson * New French translation (Nicolas Laug ) 2006-11-18 Hanna Knutsson * Update Swedish translation 2006-11-07 Hanna Knutsson * Update Dutch translation (Jaap Woldringh ) 2006-11-02 Hanna Knutsson * Use "name := value" as shortcut for save(value; name) * Return value in save() 2006-09-10 Hanna Knutsson * Group integer factors in powers 2006-09-05 Hanna Knutsson * Integer factorization * Heaviside Step Function, Rectangular Function, Triangular Function, and Ramp Function * Kronecker Delta, Sigmoid, and Logit Transformation 2006-08-18 Hanna Knutsson * Generate API docs from autogen.sh * Radius instead of diameter as argument for circumference() 2006-07-21 Hanna Knutsson * Interpret 0x[0-9,a-f] as hexadecimal number (do not require first digit to be 0-9) 2006-07-03 Hanna Knutsson * Add optional upper and lower limit arguments to integrate() for definite integrals * Add cross() function * Handle powers with multiplication as base when setting prefixes * Split powers with units when placing units separately * Increment version number 2006-06-21 Hanna Knutsson * Fix parsing of "x!)!" * Use Julian year for light-year value 2006-06-20 Hanna Knutsson * Use "Display units separately" also for quantities with multiple terms 2006-06-10 Hanna Knutsson * Add base 3 exponent mode * Add "Engineering" display mode 2006-06-06 Hanna Knutsson * Unevaluated arguments were used when checking for numerical arguments in logn(), which caused log2(16/2) to first be evaluated to ln(16/2)/ln(2). 2006-06-01 Hanna Knutsson * Polishing before 0.9.4 release 2006-05-18 Hanna Knutsson * Fix libqalculate.so unresolved symbols with patch from Thomas de Grenier de Latour, add GLIB_LIBS to LIBADD 2006-05-09 Hanna Knutsson * Add additional localization options for use in KDE GUI 2006-05-03 Hanna Knutsson * Update API documentation * Clean up Unit API * More function descriptions * tetrahedron(), tetrahedron_sa(), tetrahedron_height(), sqpyramid(), sqpyramid_sa() and sqpyramid_height() functions * Do not update the stack until the calculation is finished * stack() and register() functions * Add true RPN mode to qalc * Add "rpn", "stack" and "clear stack" commands, and "lowercase e", "lowercase numbers", "spell out logical", "dot as separator" and "rpn" set command options in qalc * Update Swedish translation 2006-04-28 Hanna Knutsson * Update API documentation * equation => formula in MathFunction * Do less in setFormula() if formula is empty 2006-04-27 Hanna Knutsson * Fix parsed expression for RPN operation * Remove capitalization from argument titles 2006-04-24 Hanna Knutsson * Fix bug #1475373 ("1 kg m/s" was simplified to "1000 m/s") 2006-04-23 Hanna Knutsson * README.translate with information for translators * Update Swedish translation 2006-04-22 Hanna Knutsson * Prepend !category! to strings, which might have different translations in different contexts, in data files 2006-04-21 Hanna Knutsson * Add the completed Dutch translation * New name format in data files * Update Dutch translation to new name format 2006-04-13 Hanna Knutsson * Fix horrible, horrible bug that caused all number arguments to require numbers to be rational 2006-04-09 Hanna Knutsson * Ignore definition names beginning with colon, for plural names where the original name does not differ * Set vectors and matrices as the first argument by default * Add more function descriptions 2006-04-08 Hanna Knutsson * Options to use dot as thousands separator when it is not the default decimal sign * require_translation property for definitions, used in the large numbers category 2006-04-06 Hanna Knutsson * Update RPN functions * Update API documentation * Change usecs argument to msecs 2006-04-04 Hanna Knutsson * Plugins * True RPN mode 2006-04-03 Hanna Knutsson * Set min and max in argument definition for zeta() * Set exact value for zeta with argument 2, 4, 6, 8 or 10 and set infinity for 1 2006-04-02 Hanna Knutsson * Symmetric matrix => Square matrix * Some text string changes * Accept vectors in elements function 2006-04-01 Hanna Knutsson * Interpret 0x..., 0o... and 0b... as hexadecimal, octal and binary numbers, respectively, when base is decimal 2006-03-29 Hanna Knutsson * Remove deleted data set from the data set list, not only the function list (fix crash on delete and update list view) 2006-03-28 Hanna Knutsson * Fix contains... functions (and thereby integration) 2006-03-25 Hanna Knutsson * Ignore commas in numbers * Start API documentation 2006-03-13 Hanna Knutsson * Approximate comparison fixes * Add PrintOptions->restrict_to_parent_precision (default true) * Do not produce a result with multiplications inside multiplications (fixes prefixes with simplification) 2006-02-26 Hanna Knutsson * Approximate comparison * Avoid floating point overflow and underflow by not lowering precision in comparison and always using long floats * Use floating point raise more often in approximate mode 2006-02-21 Hanna Knutsson * Fix show ending zeroes when max decimals is set to off by a max value below zero 2006-02-11 Hanna Knutsson * Do not use "Read Precision" in plot 2005-01-30 Hanna Knutsson * isodate(), localdate(), timestamp(), stamptodate() functions 2005-01-27 Hanna Knutsson * cos(x*pi*rad) equals 1 if x is even, not -1 2005-12-20 Hanna Knutsson * Warn about denominators assumed non-zero option 2005-12-19 Hanna Knutsson * Various fixes and enhancements * Update Swedish translation 2005-12-14 Hanna Knutsson * Fix ln(e^x) * Isolate x in log(x) for inequalities * Factorize x^2-y^2 and x^3-y^3 2005-12-13 Hanna Knutsson * Isolate x fixes * Fix merging of common factor with multiplication 2005-12-12 Hanna Knutsson * Assume that simple unit relations do not negate * Fix ?+(+infinity) 2005-12-11 Hanna Knutsson * Fix non-commutative multiplication (multiplication with possible matrices) 2005-12-09 Hanna Knutsson * Fix isolate x with "x^2 > -5" and similar * Do not calculate y in "x && y" and "x || y" if x is false or true, respectively 2005-12-08 Hanna Knutsson * New assumption type "non-matrix" for unknowns with commutative multiplication * Finish isolate x / solve changes 2005-12-06 Hanna Knutsson * Isolate x and solve fixes * Fix matrix multiplication 2005-12-04 Hanna Knutsson * Isolate x updates * Put AND within OR (to get nicer inequalities) 2005-12-03 Hanna Knutsson * Isolate x using AND and OR instead of vector * Enhanced inequalities handling in isolate x * Simplify AND and OR with comparisons (ex x < 5 && x < 3 = x < 3) * Display "x < 3 && x > 1" as "1 < x < 3" 2005-12-01 Hanna Knutsson * Incorporate ginac sqrfree updates between version 1.2.3 and 1.3.3 * Assorted fixes 2005-11-30 Hanna Knutsson * Only treat e as E if preceded by number * Do not test float number for infinite series * Check factorized numerators and denominators for negative powers 2005-11-29 Hanna Knutsson * Parse -x/y as (-x)/y instead of -(x/y) * Print multiplication in negation with parentheses when excessive parentheses is on * Do not display (x)(y)^z with multiplication sign * Sort x^2*y^3 + 10xy - 3x + 8 instead of x^2*y^3 - 3x + 10xy + 8 2005-11-28 Hanna Knutsson * Updated function arguments parsing ignoring space after function name and not stopping parsing of single argument without parentheses until space or right parenthesis without corresponding left parenthesis * Be more strict with 0/x if x is not non-zero * Fix 1E-1 = 1e-1 * Calculate as float when 1.0001 > base < 0.9999 and exponent is greater than 10000 or less than -10000 2005-11-27 Hanna Knutsson * Unknown variable with sign non-negative or non-positive represents real number * Update assumption type after setting sign and vice versa * Assume again when dividing that units do not convert to zero * "Einstein per Meter per Second" => "Einstein per Meter Squared per Second" 2005-11-26 Hanna Knutsson * Be more restrictive with unknown variables/symbols with unknown type (might be unit or vector) 2005-11-25 Hanna Knutsson * Update qalc with new factorization and some more * Option for qalc to read commands from a file first * Fix unit comparisons * Fix handling of units with function in relation saved in approximate variable 2005-11-24 Hanna Knutsson * Sort out some power transformations 2005-11-23 Hanna Knutsson * More fixes (I'm not very good at keeping track of them) 2005-11-22 Hanna Knutsson * Preserve factorization print option (for (3/4*(x+1))/(y+1)) 2005-11-21 Hanna Knutsson * Lots of evaluation and factorization fixes * Pass parent to some functions so the reference can be replaced for the whole child * New MathStructure sorting algorithm using the fact that the structure usually already is well sorted, reducing the time to factorize (x+y)^50 to a third 2005-11-19 Hanna Knutsson * Add rational polynomial parameter to arguments * Add rational number parameter to number arguments * Add polynomial functions -- coeff(), lcoeff(), pcontent(), degree(), etc. * Fix lcoefficient (confused by l in ldegree mening low and l in coefficient leading) * A more efficient differentiate function for sqrfree 2005-11-18 Hanna Knutsson * Fixes * Determinant from GiNaC * Only use the new inverse function for numeric matrices 2005-11-17 Hanna Knutsson * "borrow" sqrfree factorization and related functions from GiNaC * Make evaluation more efficient (avoid recalculations) 2005-11-10 Hanna Knutsson * MathStructure gcd() and lcm() * New simplification using factorization and factorization combing denominators * Increment library soname number (QALCULATE_CURRENT) 2005-11-07 Hanna Knutsson * Much more efficient determinant calculation * Fix x*y^-1*y^-1+x*y^-1 * Fix cases when (x-1)^-1*(x-1)^-1 not returned (x-1)^-2 * Much more efficient inverse matrix calculation 2005-11-06 Hanna Knutsson * Use quotient rule in differentation to possible get simpler results then if always using the product rule * Fix fetching of exchange rates with gnome-vfs < 2.10 * Fix display of fractions in fractional mode "Decimal (Try Exact)" * Differentiation fixes * Do unicode stuff correctly (a sequence of unicode characters was sometimes counted as one) 2005-11-05 Hanna Knutsson * Fix (x+1)/x (= 1 + 1/x) * Simplification by combining divisions * Reversed polynomial division (ex. (x+1)/(x^2+2x+1) = 1/(x+1)) 2005-11-04 Hanna Knutsson * Compile without warnings with -pedantic and -Wextra 2005-11-03 Hanna Knutsson * Fix simplification of (ax^b+cx^d)/x * Fix (xy/z)+1/z * Fix suggested multiplication sign before and after power 2005-11-02 Hanna Knutsson * More parse polishing * Fix for cln-1.1.10 and remove all "obfuscating" cln operators * Builtin function's represents...() was not used because of missing const in declaration 2005-10-31 Hanna Knutsson * Cleaner parsing (same result but looks nicer) 2005-10-30 Hanna Knutsson * Add metre/metres for meter/meters * nounit() function 2005-10-29 Hanna Knutsson * Fix Kibit interpretation (was kibitonne, is now kibibit) and similar * Update setting of parsed structure and to expression in calculate function * Update qalc 2005-10-28 Hanna Knutsson * Option to reduce transformation when parsing and print formating * Support for binary and other prefixes * Information units (bit, byte, etc.) and binary prefixes * Neper and Bel units 2005-10-26 Hanna Knutsson * Update Swedish translation * light_year => lightyear * Fix unended function information when optional arguments 2005-10-22 Hanna Knutsson * Add SIGN_SMALLCIRCLE and SIGN_MULTIBULLET to utf8_pos_is_valid_in_name to fix completion 2005-10-21 Hanna Knutsson * Lots of new units 2005-10-20 Hanna Knutsson * Only give "Error in unit expression" message on errors in CompositeUnit parsing * Do not accumulate the error count between levels for temporary stop messages 2005-10-19 Hanna Knutsson * Add arguments past max arguments to unended_function 2005-10-18 Hanna Knutsson * Put seperation of unit expression to string in calculate function in a separate function * Add stopped warnings count 2005-10-17 Hanna Knutsson * Print option to hide underscores (if not for suffix) in names * Adjust precision of constants 2005-10-16 Hanna Knutsson * Add unended_function to parse_options and put unended function there when parsing 2005-10-15 Hanna Knutsson * mmHg unit * Ideal Gas Constant 2005-10-13 Hanna Knutsson * Fortnight unit * More composite units for convenience * Foot-Candle unit * Fix conversion footcandle <-> lux * Einstein unit 2005-10-11 Hanna Knutsson * More composite units for convenience (km, mm, ml, km/h, etc.) 2005-10-08 Hanna Knutsson * Move currency definitions to currencies.xml * Functions for loading sepearate global definitions files * Create angle units if not loaded from definitions files 2005-10-05 Hanna Knutsson * Do not create qalculate symlink to qalc (confusing when installing GUI in other location) * Use gnomevfs-copy instead of wget if available * Allow user to specify wget arguments * Update currencies 2005-09-21 Hanna Knutsson * mph and mpg units 2005-08-21 Hanna Knutsson * Fix (1/2)^n < 0.5 * Fix replacement of unicode signs when skipping quotes * Fix 0 oC to oF (0*unit != 0) 2005-06-11 Hanna Knutsson * Remove requirement glib-2.0 >= 2.4 and require libxml2 >= 2.3.8 * Do not let << take precedence over >> read from left to right 2005-06-10 Hanna Knutsson * Do not use unicode prefix names for long names * xor() and bitxor() is NOT algebra * Add even() and odd() functions * shift() function and operators ("<<" and ">>") * Add functins for getting exchange rates url and file name to allow interface to do the downloading themselves 2005-06-09 Hanna Knutsson * Support for "e" instead of "E" in result 2005-06-07 Hanna Knutsson * SIGN_POWER_1, ... => "^(1)", ... instead of "^1", ... 2005-06-06 Hanna Knutsson * Update Swedish translation 2005-06-05 Hanna Knutsson * Reminder => Remainder * Reminder (mod) => Modulus * Bitwise NOT (~) * xor() and bitXor() * Clean up expression such (x && y) > 0 * Update currencies (more added) * Warn the use that objects with '~' in name will be lost * Keep loading/saving after error * Do not crash when saving data sets (initialize cat_i_prev) * Do not load nameless objects 2005-06-02 Hanna Knutsson * Bitwise AND (&), OR (|), XOR * Remove old giac stuff 2005-06-01 Hanna Knutsson * Non-static getElement() function * Initialize saved_locale before use 2005-05-15 Hanna Knutsson * Max values seem to have been lost a long time ago -- add them again 2005-05-07 Hanna Knutsson * Initialize ids_i * Fix documentation typos * Fix includes.h for gcc-4.0 2005-03-06 Hanna Knutsson * 5e2 = 5E2 = 500 and 5e = 5*e 2005-02-08 Hanna Knutsson * Update solve2() 2005-02-06 Hanna Knutsson * Dialog with buttons works in gtk+-2.6.2 * Do not look at function arguments in contains... functions 2005-02-02 Hanna Knutsson * Update integration and differentiation (sin(x) != sin(x)*rad) after change in sin() and cos() behaviour 2005-01-25 Hanna Knutsson * Fix RPN crash and don't add lonely stack value to itself * Workaround freeze with message dialog without buttons 2005-01-24 Hanna Knutsson * Use the last operator for leftover stack values 2004-11-30 Hanna Knutsson * Show base (if not decimal, hexadecimal or non-standard) as subscript 2004-11-26 Hanna Knutsson * Fix "Convert result" button * Use singular instead of abbreviated name for completion 2004-11-21 Hanna Knutsson * Fix draw unit * Add alternative multiplication dot signs * Enhance preferences safety 2004-11-16 Hanna Knutsson * Check if unicode characters can be displayed 2004-11-10 Hanna Knutsson * Revert back somewhat to the old behaviour of not rounding exact numbers not in exponential format 2004-10-25 Hanna Knutsson * Generate vector function 2004-10-24 Hanna Knutsson * Rearrange plot dialog * Do not update plot data when not changed * Make x variable separate for each plot function 2004-10-22 Hanna Knutsson * Fix angle arguments by adding option default angle unit none where angle units must be specified * Represents... for some functions * Some tweaks 2004-10-21 Hanna Knutsson * Fix 0.5! 2004-10-20 Hanna Knutsson * Fix comparison of unit with unknown * Try with assumptions set to unknown in solve function if not successful 2004-10-19 Hanna Knutsson * Fix when size_t not is unsigned int 2004-10-17 Hanna Knutsson * Disable plural forms not at the end of text strings (metersqrt(5) = meter * sqrt(5) instead of meters * qrt(5)) * Replace new lines with in definition xml files until we have a better solution 2004-10-14 Hanna Knutsson * Speed-up csum when component(i, "v") is used * Give messages in the right order (reversed) * Update obsolete plot documentation * Clean up parsing * Add limit implicit multiplication mode * Fix unit conversion * Fix m*s -> 1 m*s 2004-10-13 Hanna Knutsson * More speed-ups 2004-10-12 Hanna Knutsson * Limit qalc history to 100 entries * Increase qalculate-gtk history to 25 entries * Store children i math structures as pointers to reduce copying of large vectors 2004-10-11 Hanna Knutsson * Help buttons in variable edit, unit edit, function edit and plot dialogs * Make definitions loading more than twice as fast * -set command line option for qalc 2004-10-10 Hanna Knutsson * defs2doc program for generation of definition list in help * Make help book and add appendix for lists of functions, variables and units * Fix broken CVS 2004-10-09 Hanna Knutsson * promille -> permille * Permille sign * permyriad * Fix atan() ignoring angle unit * Add exact value for atan(1) = 1/4 pi and atan(-1) = -1/4 pi 2004-10-08 Hanna Knutsson * Install headers * Added pkgconfig file libqalculate.pc * Remove inclusion of config.h in installed headers * Include library headers with * Rename src/calclib src/libqalculate 2004-10-07 Hanna Knutsson * Update exchange rates command in qalc * Update Swedish translation * Add last set options to qalc * Allow user to type - when unicode signs is disabled * Division sign selection * Use selected multiplication and division sign in text printing 2004-10-06 Hanna Knutsson * Fix qalc Ctrl+D crash (exit when read line is NULL) * Do not require two tabs to show completion list * Do not show all output directly if terminal is too small * Split out localization of definitions into po-defs * Add full support for non-utf8 local characters in qalc * Various qalc tweaks 2004-10-05 Hanna Knutsson * Fix equalsIgnoreCase() for unicode chars and make more efficient * Make qalc case insensitive and add extend localization * Change package name to qalculate 2004-10-04 Hanna Knutsson * Use readline for qalc * Change class Function to MathFunction * Only use plural name when short multiplication * qalc completion * Autoconf updates -- make compilation of qalc and qalculate-gtk optional as well as readline * qalc save variable, set assumptions, and more 2004-10-03 Hanna Knutsson * Ask if exchange rates shall be downloaded the first qalculate run * Number base 1 makes no sense * More work on qalc 2004-10-02 Hanna Knutsson * Change n for micro to u * Command line program "qalc" * Get rid of traces of separate angle unit variable 2004-10-01 Hanna Knutsson * Add filter to save result to image file dialog * Install libqalculate as a shared library 2004-09-30 Hanna Knutsson * Alternative to use step size instead of sampling rate for generation of plot data * Big approximate and precision check and fix * Message about the limited functionality of the gamma function 2004-09-29 Hanna Knutsson * Gamma for rational numbers with denominator 2 * Double and multi factorials * Tweak parsing of !-factorials * Modify CLN error message * hyperfactorial() and superfactorial() * Make factorials more efficient by using CLN numbers directly 2004-09-28 Hanna Knutsson * Allow arguments to only be used in sub functions * Remove countArgOccurence() as it is not needed any more * Drop support for gtk+ < 2.4 * Fix large integers displayed inexact was reported as exact * Stop gamma() if argument is not an integer * Read precision from zero with decimals (0.000...) * Set precision from function and its arguments after function calculation 2004-09-27 Hanna Knutsson * "Inverse" -> "Matrix Inverse" * Fix isolate_x() when comparison type is not equals * Make plot non-numerical error more informative and include non-reals * No use to have if() arguments as text, as they now only are parsed initially * Fix trimmean() and winsormean() * Localize "timed out" * Version 0.6.4 2004-09-26 Hanna Knutsson * Fix selection of variable to solve * New solve2() function * New multisolve() function * Do not add modified data object once more * Do not check against new data objects for duplicates * Get a default name for new vector/matrix just as with other known variables * Display error when plot data contains non-numerical values * Show function condition in function description * Update Swedish translation * We need to sort fully recursively before merging factors in factorize() * Fix factorization with duplicate factor with a in (ax+b) greater than one * Add new expression to expression history after set unknowns * Use g_find_program_in_path() to check if gnuplot and wget is available to avoid terminal output 2004-09-25 Hanna Knutsson * unitedit_glade was used in variable dialogs * Use factorization in isolate_x() * Improve isolate_x() * Check if terms is equal (or a = -b) with the current precision in subtract and add to be able to find very small numbers that really are zero * isolate_x() fixes * Preserve evaluation options through factorization 2004-09-24 Hanna Knutsson * Include both "liter" and "litre" to avoid confusion * Add "tonne" for metric ton * Prefer keeping the original unit if equally good when converting to best unit * Merge infinite numbers with somewhat known structures * Be a bit more strict with undefined values * Ohm and farad are SI units 2004-09-23 Hanna Knutsson * Increase space after imaginary i by 1 * Fix never ending loop in getBestPrefix() * Fix (2x)/(5(yz)) --> (2x)/(5yz) * Take into account place_units_separately in improve_division_multipliers() * Increase space at end of parenthesis by 1 * Change components() to dimension() * Set correl() as a different name for pearson() instead of a separate function * Check that the dimension of vectors is equal in pearson() and spearman() * Test if polynomial division reduces the size of the expression * Stop after editing data set from edit function function * Tweak data set info printing removing tabs * Save Image -> Save Image... 2004-09-22 Hanna Knutsson * Fix data object edit option menu * Do not show error when global data file cannot be loaded for local data set * Update data property list also when the data set is new * Fix setting data set function name * Set default argument names for data set when entries are empty * Do not delete original property and add new -- set original with new to not invalidate references in objects * Position progress dialog center parent, and set unknowns and convert to unit expression under mouse * Once again, fix prefix selection when prefix is first before/after zero 2004-09-21 Hanna Knutsson * Rational factorization of higher degree polynomials 2004-09-20 Hanna Knutsson * Some result display tweaks * Update function titles and argument names * Update Swedish translation * Update documentation * Print quotation marks for symbolic structures when not allow unusable * Display e*e^x with multiplication sign 2004-09-19 Hanna Knutsson * Full factorization of quadratic polynomials * Transform sqrt(8) to 2*sqrt(2) (and similar) in exact mode * Fix xy-xy=xy !!! * Fix repeated apply in unknowns dialog 2004-09-18 Hanna Knutsson * Updated result sorting * (-x-y)/z --> -(x+y)/z 2004-09-17 Hanna Knutsson * Set unknowns dialog * More refined selection of popup menu items to show * Polynomial division * More reliable internal sorting 2004-09-16 Hanna Knutsson * Extensive enhancements of symbolic division * Alternative to assume that unknown denominators are non-zero 2004-09-12 Hanna Knutsson * Ex. 1/(x+10)=5, test if x+10 is zero after solve 2004-09-11 Hanna Knutsson * Evaluation options was not always preserved when converting to best units * Display x^(5/2) as x^2*sqrt(x) 2004-09-10 Hanna Knutsson * Internal sorting fixes * Update documentation * Update Swedish translation * Use displayed name when sorting 2004-09-09 Hanna Knutsson * Make factorization more functional 2004-09-08 Hanna Knutsson * Integration fixes * Use representsNonZero() for arguments that must be non-zero 2004-09-07 Hanna Knutsson * "times", "plus", "minus", "per", "AND", "OR" 2004-09-06 Hanna Knutsson * Finish GUI and user modifications for data sets 2004-09-01 Hanna Knutsson * rm -f qalculate; $(LN_S) qalculate-gtk qalculate 2004-08-28 Hanna Knutsson * Edit and save data objects * Finish system property of units * Clean up some left over plural and singular stuff * Add unit system to edit GUI 2004-08-26 Hanna Knutsson * Planets data set * Day and Julian Year * Fix set icon * Do not always make Calculator message window transient for main window * Save and load accel map 2004-08-25 Hanna Knutsson * data collection -> data set * Complete data set GUI 2004-08-24 Hanna Knutsson * Complete most of the data collection stuff * Move elements to data collection format 2004-08-23 Hanna Knutsson * Fix diff() with variables and functions that contains x * Simple integration 2004-08-22 Hanna Knutsson * ans2, ans3, ans4 and ans5 * google/googleplex -> googol/googolplex * thousand and hundred * Reduce min result area height * Put angle mode in evalution options * Status text * Save to image * Initial work on data collection concept 2004-08-20 Hanna Knutsson * Fix RPN mode * include errno.h 2004-08-16 Hanna Knutsson * Remove giac arguments * Update documentation 2004-08-15 Hanna Knutsson * Fix prefix selection when first positive/negative exponent prefix * No prefix in result prefix menu * Only left parenthesis where added around vector! * Make the title for mils more descriptive * FIx matrix multiplication 2004-08-14 Hanna Knutsson * Make no comparison to solve error message more informative * Do not factorize if factor is not non-zero * Fix prefix selection with negative exponent prefixes * Fix prefix selection with denominator prefix enabled 2004-08-13 Hanna Knutsson * Fix concatenate() * Add localized full name to ans variable * Make sure that completion pops down when going back in history * Set minimum arguments to 1 for mergevectors() 2004-08-12 Hanna Knutsson * Fix derangements() which was broken due to changed interpretation of -1^x * CALCULATOR->u_rad was null * True and False variables * "yes" -> "Yes" and "no" -> "No" * Localize "True" and "False" radio buttons * Add *.xml.in files to the dist tar sources * Complete exp1 in "2+5exp1" * Add undefined variable * Fix ids in text arguments when function is used in other function (fixes distribution functions) * Show classification in atom() dialog 2004-08-11 Hanna Knutsson * Remove double decimal points * Nicer unit printing * Warn in name edit dialog if name is used * Update documentation * Use gtk-paste instead of gtk-go-forward icon for insert * Properties dialog for atoms in periodic table * Respect max decimals with show ending zeroes * Fix precision typos which made objects with undefined precision approximate * Make element properties selectable * Paste function instead of value of element property * Display classification in element dialog * Unformat parsed function expression * Make sure that no unwanted prefixes are left when function expression has been parsed * BMI (Body Mass index) function added (just to prove that Qalculate! is more than a scientific calculator) 2004-08-10 Hanna Knutsson * Reduce number of element properties for now and verify * Periodic table * Update Swedish translation 2004-08-09 Hanna Knutsson * Do not be backwards compatible for definitions saved with the current version * Update Swedish translation * Where there is approximate there shall also be precision * More physical constants * Fix formatting of x/unit * Add atomic mass unit, u * Add si again * Elements! * Ignore initial zeroes for precision 2004-08-08 Hanna Knutsson * Finish names GUI * Finish new number precision system * Menu item for read precision * Option to show ending decimals (to see actual precision) * Fix parsing of numbers with base < 10 and decimal point 2004-08-07 Hanna Knutsson * Initial work on GUI for new name system * Treat whole ending number as suffix (for log10) 2004-08-06 Hanna Knutsson * More work on name system * Remove quarter unit * Regenerate definition files * Remove duplicate names 2004-08-05 Hanna Knutsson * Do not prefix currencies in all locales 2004-08-04 Hanna Knutsson * New system for variable, unit and function names * Solve quadratic equations 2004-07-31 Hanna Knutsson * System property for units ("si" value only used for now) * Optional automatic conversion to best or base units * Update version number in global definition files * Add CGS units 2004-07-30 Hanna Knutsson * Mark SI units * Convert to best unit now only converts to SI units * Mass Fraction (kg/kg) * Fix insert and edit composite unit 2004-07-29 Hanna Knutsson * Electron Volt is approximate 2004-07-21 Hanna Knutsson * Fix arg() * ...and disable it as it does not work correctly * Fix i being display multiple times 2004-07-20 Hanna Knutsson * Focus tweaks 2004-07-19 Hanna Knutsson * -5^2 = (-5)^2 -> = -(5^2) * Beautify 2 * -1 * Fix not 2004-07-18 Hanna Knutsson * Show if precalculation display is approximate * Show if approximate conversion in units manager * Enable unicode signs in from-unit label * Deillion -> Decillion * Refine when to update result and display of result * Ability to disable complex results * Ability to disable infinite results 2004-07-17 Hanna Knutsson * Update variable lists in GUI after save function has been called * Do not let the user type any braces in the expression entry * Select added plot series and let enter in plot expression entry modify selected (if any selected) * Fix rad unit being dropped in unsolved sin/cos function * Fix plus/minus before id * Show precalculation result in history view 2004-07-16 Hanna Knutsson * Oops! operators does not include parenthesis * Use unicode operators in text printing * base == 10 -> base >= 2 && base <= 10 (in parsing) * Refine CSV export dialog * Sort out some getActive... vs get... * Fix too many arguments warning * Increase function parsing efficiency (decrease number of MathStructure copies) * Produce vector imediately on parse * Export button in variables dialog * Split number base expression and export csv dialogs from main.glade * Remove lines * Update Swedish translation * Update documentation * Fix nameTaken() * Fix overwriting variable * Remove deleted items from recent units/variables/functions * Do not try to insert deleted variable 2004-07-15 Hanna Knutsson * More work on base in parse options * Fix E in rpn mode * Parsing tweaking * GUI for number base in expression 2004-07-14 Hanna Knutsson * Alternative to round halfway integers to even (instead of upwards) * Make qalculate symlink from qalculate-gtk * Fix addColumns() and import of CSV file to matrix * Export to CSV file * if, function, error, warning, load, save and title functions were not activated (oops!) * Let argument definitions parse default values * Do not parse ! as factorial if functions is disabled * Ability to set number base for expression parsing * Allow full expressions in base functions 2004-07-13 Hanna Knutsson * Ability to set all number bases from 2 to 36 from GUI * Documentation updates * Alternative to use lower case letters in numbers * Fix double decimal point with integers * Fix decimal reduction rounding * Fix precision rounding * Fix approximate indication with multiple numbers * Fix printing of empty vector 2004-07-12 Hanna Knutsson * Update documentation * Force use of -O2 instead of -Os * Revert back to a^b^c = a^(b^z) (I don't remember changing it) * Unknowns disabled by default * Copy subfunctions * GUI for subfunctions 2004-07-11 Hanna Knutsson * Do not segfault on exit * Fix compilation warnings 2004-07-10 Hanna Knutsson * Do not try to fetch exchange rates everytime they are missing * Set fetch timeout to 5 seconds on first run * Inform user that we are trying to fetch exchange rates * Update fetch exchange rates at startup in preferences dialog 2004-07-05 Hanna Knutsson * Follow ISO 8601 standard for week numbers (glib doesn't) * Sort out approximation with rounding 2004-07-03 Hanna Knutsson * Fix input of numbers in bases > 10 * Is approximate? fixes * usleep() is obsolete. use nanosleep() instead * Terminate threads before exit * Include unistd.h in main.cc for pipes 2004-06-24 Hanna Knutsson * definitions -> subfunctions * save subfunctions * Function::countSubfunctions() * Fix for() * Fix creation of vectors with zero or one component * Pass parse options to function parsing * Variables might contain functions * Fix approximate integer printing * Fix try exact 2004-06-23 Hanna Knutsson * Release v. 0.6 * Do not create a new thread for every calculation and printing 2004-06-21 Hanna Knutsson * ... 2004-06-18 Hanna Knutsson * Continue converting to new internal structures 2004-06-14 Hanna Knutsson * Continue converting to new internal structures 2004-05-25 Hanna Knutsson * Converting to new internal structures 2004-05-12 Hanna Knutsson * New internal structures (Manager -> MathStructure) 2004-04-05 Hanna Knutsson * Find linear function * Do not automatically recalculate on precision spinbutton update and add recalculate button to avoid annoying problems * More multiple root updates * Do not just clear the window, clear the pixbuf too * MatrixArgument->type should not return TEXT_ARGUMENT * Multiple roots updates 2004-04-04 Hanna Knutsson * Put in some restrictions and enable multiple roots * Disable multiple roots * Remove 0 == any number from Manager->equals * try x^(y+z) = x^y*x^z and x^(yz) = x^y^z 2004-04-03 Hanna Knutsson * Capitulate in search for exact as long as possible to fix alternatives * Recalculate directly on angle unit change * Enable multiple roots again * Do not ignore unsolvable comparison * Remove imaginary or real part present because of approximate floating point numbers * Do not display errors for arguments in exact precalculation * Do not display extra trailing zeros * Make comparison between floats in lower precision (but not less than user defined precision) * Fix printing of toplevel negative complex number * Return -(x^(1/3)) for (-x)^(1/3) 2004-04-02 Hanna Knutsson * Remove integrate parts that does not work * Do not crash on i^4 * Disable broken multiple roots 2004-04-01 Hanna Knutsson * Hyperbolic and inverse does not take angle arguments * Fix raise by matrix * Fix raise by alternatives * Fix drawing of function 2004-03-31 Hanna Knutsson * More solve work * Fix sorting of alternatives * Fix wrong add alternatives to alternatives logic * Clean after multiplication raise... (serious bug) * Quadratic equations * Non-giac solve function and automatic "solving" of comparisons * Better comparison equals printing * Minimal non-giac integrate function 2004-03-30 Hanna Knutsson * Finance -> Economics/Finance * Demand Elasticity function * Fix that all arguments wanted text after function editing * Free temporary composite units * Fix sin(x)/tan(x) * No (+ -) in printing with complex numbers * Fix sorting of complex numbers 2004-03-29 Hanna Knutsson * Release v. 0.5 * More extensive, verbose and fault-tolerant roman input 2004-03-28 Hanna Knutsson * Set exact button for edit variable * Fix diff() with power without x * Fix compilation with gtk+ < 2.3 * Do not crash on abort sum() (memory leak is better) * Change line width instead of drawing multiple lines * Use barckets instead of parenthesis when drawing matrix * Use commas for vector drawing * Fix matrix text printing 2004-03-27 Hanna Knutsson * Do not let user disable loading of global definitions * Do not raise if makes approximate in exact mode * Cleanup unused functions * Fix hypotenuse and make non-builtin * Automatically act on "calculate variables" * Set e as default second argument in log() 2004-03-26 Hanna Knutsson * time() * week(), weekday(), year(), month(), day() * Allow "today" for dates * Use both localized and non-localized "to" * Sexagesimal number display * Fix prefixes with simple display format * Sexagesimal number input * (2 > 0) + (2 > 0) = 2 * (2 > 0) * Polynomial division refinements 2004-03-25 Hanna Knutsson * Roman numerals * Polynomial division 2004-03-24 Hanna Knutsson * Fix printing of complex numbers with negative imaginary part and no real part * re() and im() * Fix unit conversion * Imperial and U.S. capacity units * Fix nested product() and sum() * Correct treatment of (), "", '', and {} in text argument 2004-03-23 Hanna Knutsson * Symbols for sum, product and ohm * derangements() * sum() and product() corresponding to the signs * sum() -> total() * Reorganisation of function categories 2004-03-22 Hanna Knutsson * Complete convert to best unit 2004-03-21 Hanna Knutsson * Make result context menu context sensitive * Protect intValue and longIntValue against overflow * Fix printing of exponent 1E... * Convert to best unit (beginning) * Convert to base units 2004-03-20 Hanna Knutsson * Define sin and cos as expressions * e^(i*pi) = -1 ... * ln -1 = i*pi, ln i = i*pi/2, ln -i = -i*pi/2 * permanent() * Print short currency unit before value * Factorize independent of giac * Make my own derive function default 2004-03-19 Hanna Knutsson * asec, acsc, acot, sech, csch, coth, asech, acsch, acoth * cis * As we now have complex number, define inverse trigonometric functions as expressions * sec, csc, cot * "CAS" -> "Calculus" * Update my own derive function and enable it if giac is not used * Fix ln() argument so that e can pass through 2004-03-18 Hanna Knutsson * Show error when custom condition is not met * area, ascii and char functions * Limits function should accept negative numbers for end. Fixes trimmed, weighted and winsorized mean. * Nicer text printing of matrices and vectors 2004-03-17 Hanna Knutsson * Save size of history dialog * Show a nice little help message the first time Qalculate! is started * Update Swedish translation * "quaert" -> "quart" * Do not insert parenthesis when completing if they already are there * New error message when matrix has no inverse * Make abort messages localized and nicer * Limit width of result display text * Use transparent pixbuf for result to not look ugly with pixmap themes * Support newer Giac versions 2004-03-16 Hanna Knutsson * Serious try to fix the localized decimal point and comma once and for all * Use [] for vectors and matrices * Use Page Up and Page Down for expression history instead to allow completion to use Up and Down keys * huh! do not sort functions. * "European 30/365" -> "European 30/360" * Fix date calculations * Add "allow_complex" property for number arguments * Fix abs (for complex numbers) 2004-03-15 Hanna Knutsson * Handle CLN errors better * Font selection for expression entry * Replace Fraction and Integer with new Number class 2004-03-12 Hanna Knutsson * Set selected font in custom font dialog * Save time by first destroying completion then updating list then creating new completion on update * Do not crash when updating completion after new variable * Bring up user interface as soon as possible * Make completion block work * Move recent objects to to the top of object menus * "buttons" -> "keypad" * Completion finished * Ugly fix to not complete on completed * Add units to completion if not composite * Use g_utf8_next_char and g_utf8_prev_char 2004-03-11 Hanna Knutsson * Advanced completion in expression * Popup menu for resultview 2004-03-10 Hanna Knutsson * Lower default precision * Make history button a regular button * Reworked GUI -- menubar, expander, history window... * Release 0.4.2a * Set correct name on separator again * Fix some compiler warnings * Fix compilation without Giac 2004-03-08 Hanna Knutsson * Release 0.4.2 * Proofread manual * Allow currencies to be put in front of quantity * Cent, yen, pound and dollar signs * Remove debug output related to Giac * Fix some troubles printing complex numbers 2004-03-07 Hanna Knutsson * Update Swedish translation * First manual draft finished * Remove compiler warnings 2004-03-06 Hanna Knutsson * Gnuplot does not like quotation signs * Do not abort when locale not supported by C library 2004-03-05 Hanna Knutsson * Fix unit conversion of ex. ch^2 to acre * Some menu fixes * More user documentation 2004-03-04 Hanna Knutsson * Move calculate multiple roots option to result menu * Move unit display options to a unit display submenu * Begin writing the manual * Add help menu item if libgnome is available * Add build structure for gnome style user documentation 2004-03-03 Hanna Knutsson * Fix exponential display in non-fractional mode with negative exponents * Fix big mistake in log (if negative exact result, returned zero) * Use "tab" for tab ("\t") a separator in load 2004-03-01 Hanna Knutsson * Load CSV file as matrix function (load) * File argument * Replace localized decimal point with dot in plot data * Save history (20 rows) * Expression entry history * "Save Result" -> "Store Result" 2004-02-28 Hanna Knutsson * Calculate command line expression 2004-02-26 Hanna Knutsson * Release 0.4.1 * Fix parsing of text arguments * Replace strptime with g_date_set_parse 2004-02-24 Hanna Knutsson * Destroy widgets after autoconnect 2004-02-19 Hanna Knutsson * Use the new file chooser * "Select file to import" --> "Select file to export" 2004-02-18 Hanna Knutsson * Release 0.4 * Fix tanh 2004-02-15 Hanna Knutsson * Reenable checks for arguments that results in infinity * Fix comparison with complex numbers (not solvable) 2004-02-12 Hanna Knutsson * Add giac functions in functions.xml 2004-02-11 Hanna Knutsson * Fix binomial arguments * Update Swedish translation 2004-02-10 Hanna Knutsson * Remove PACKAGE and VERSION warnings with giac * Permutations and combinations 2004-02-09 Hanna Knutsson * Start even if gnuplot is not present 2004-02-08 Hanna Knutsson * Complex numbers: log, pow, root 2004-02-07 Hanna Knutsson * Filter out all duplicate errors * Fix compilation without giac * Forward: "Copy Result" menu item * Forward: Correctly calculate divison by root with multiple solutions. * Forward: Remove unused non-portable function. 2003-11-02 Hanna Knutsson * Complex numbers... * Complex number printing * Use Newton's Binomial Formula for raised addition manager * Binomial function * Manager::set(const Integer*) * Start work on complex numbers 2003-10-30 Hanna Knutsson * Show argument names when too few arguments * Really no need to have exp, exp2 and exp10 as builtins * Log tweaks * More trigonometric tweaks * Giac might actually return -1*1 (we prefer -1) * Catch giac errors * Define tan, asinh, acosh, atanh as sin(x)/cos(x), log(x+sqrt(x^2+1)), ... * Handle pi correctly in trigonometric functions * Delay calculation of inexact values * New variable manager 2003-10-29 Hanna Knutsson * Giac function * Factorize in result menu * New functions: diff, integrate, solve * Giac support * Do not crash when printing a manager with matrix 2003-10-27 Hanna Knutsson * Release Qalculate-GTK version 0.3.1 * Left over missing setPrecise() in builtin functions * Fix printing of function manager * Fix display of only number in numerator * Parenthesis adjustments * Update swedish translation * More extensive error handling for misplaced operators * Replace "**" with "^" * Fix parenthesis in Manager::print() * Recreated Manager::print() from gtk drawing function * Optional prefix for denominator * Reworked composite unit printing * Reworked prefix handling * Reworked drawing of MULTIPLICATION_MANAGER * Fix loadLocalDefinitions() * Year and Century units * Fix parsec, light year, astronomical unit, and torr * Plural fixes * Draw unit names with "_" replaced by space 2003-10-24 Hanna Knutsson * Compability fixes for Unit.cc * change strold to strol in HEX() * remove ld2s() * provide another workaround for strptime * some warnings left * remove llpow() as it only creates problems * __USE_XOPEN for strptime * Replace insert(0, 1, ...) with insert(begin(), 1, ...) * Fix ALL warnings * Ignore blanks in BIN(), OCT(), HEX(), BASE() * Fix number bases dialog 2003-10-23 Hanna Knutsson * Do not use scandir as Solaris does not support it * Access hash_map header properly * Update POTFILES.in for new glade files * Remove #include from Calculator.h 2003-10-22 Hanna Knutsson * Split up glade file * minute -> min * Now function can have the same name as a unit or variable, but units and variables cannot have the same name 2003-10-21 Hanna Knutsson * Release Qalculate-GTK version 0.3 * Disable convert in units dialog when no unit selected * Revert fractional button to use combined fractional display, but treat it as normal fractional display for regular text * Draw parenthesis around not alone manager (not power) with childs in denominator * Add a bit more space behind italic text to not cut tall chars off * More drawing fixes 2003-10-20 Hanna Knutsson * Include all bytes in unicode char for unknown variables in setFunctionsAndVariables() * Fix Manager->print(), and as below * Display x^-y as 1/x^y in non-scientific mode * Draw multiplication manager fixes * Put menus before items * More TODO * Also add icon.xpm * Add qalculate.h to Makefile.am to get it included in dist * Accel fixes and additions * Move "convert number basis" to the other menu * Reorder some buttons to follow HIG * Make convert unit dialog non-modal 2003-10-19 Hanna Knutsson * Display ^0.5 as square root * Fix display of ugly -x^-0.5 (still ugly but no duplicate ones and spaces) * Stop display errors a bit more... 2003-10-18 Hanna Knutsson * Do not delete selection on sqrt button clicked but act as with the other functions * Make answer variables a special case which cannot be edited and does not display result in variable dialog * Change "first"/"second" axis to "primary"/"secondary" * Put axis after smooth * Fix rms(), stdev(), stdevp() * Fix error in setFunctionsAndVariables that stopped unknown variables after something was set * Remove CVS version title * Write something in AUTHORS and NEWS * Hidden property in function and unit edit dialogs * Hide some annoying composite units (m/m and m2/m2) * Hide hidden items in menus * New hidden property for ExpressionItem (meant for some composite units and sub functions) 2003-10-17 Hanna Knutsson * Finally implement angle units and allow direct specification of angle unit in trigonometric functions * rem and rad units renamed to rem_radioactivity and rad_radioactivity * Some swedish translation updates * Some tooltip updates * Some TODO updates * Fill in the last argument titles and add some descriptions * Set min arguments to zero if lower (and max to -1) * Argument names and descriptions for matrix and vector functions * Rename title "Power" with "X raised to Y" to solve translation conflict with the category "Power" * Fix 0^0 warning 2003-10-16 Hanna Knutsson * If add argument button is not sensitive, modify argument instead on enter * Fix arguments for process() * Titles for functions and arguments in utilities category * Put buttons in first tab * Default to show buttons * Remove quotes from default values in insert function dialog * Matrix multiplication error message * Better error message for misplaced operators * Updated swedish translation * More argument names * Fix category selection after editing * Argument names for all geometry functions * Do not use "free" for argument == NULL but printlong() of default argument 2003-10-15 Hanna Knutsson * Do not add extra space after matrix in GTK widget * Update rank() and sort() to new comparison that not only allows fractions * Update min() and max() to new comparison that not only allows fractions * Go back to builtin sum() function as sum() is used often and csum() is rather slow * eurocent and cent * Fix yearfrac() for basis = 1 * More TODO * Category "Matrices" -> "Matrices & Vectors", "Financial" -> "Finance" 2003-10-13 Hanna Knutsson * Finally make class variables in Manager protected * setPrecise(fraction()->isPrecise()) after operation directly on Manager::fraction() * Change output of "log" button to log10 * Write more in TODO 2003-10-11 Hanna Knutsson * Update plot on add/modify/remove * Use only one gnuplot process/window and close it on exit * Fix crach on create new variable dialog * Delete the submenus, not the menu item, when updating * Do not update treeviews if not created * Save plot settings * Switch to enums for style and smoothing 2003-10-10 Hanna Knutsson * More plot stuff * Change step to steps * Make that the second tab page is realised * Save plot as postscript, eps, png, svg, fig or latex * Set a nicer font for gnuplot * Plot dialog: tabwidget, paired matrix, save * Plots: logscale, style, separate smoothing for each line, title, grid, color, linewidth, borders * Set timeout for wget and error on fail * Check if wget and gnuplot is available 2003-10-08 Hanna Knutsson * Plot dialog * Lots of plotting stuff * Hide on destroy and delete events for non-modal windows * Place terms with negative sign in the back when not using scientific sorting * Do not display more than one minus * Change compare() in Manager to sortCompare() and add real compare() function * Plot vector * Plotting with gnuplot * Fix crash with no argument definitions and variable number of arguments * Do not recreate currencies, just change the relation 2003-10-07 Hanna Knutsson * Fully enable builtin units * Do not print the same error message more than once * Fetch exchange rates from ECB * Fix crash by removing new line for alternative manager and gettextize the "or" while we are at it * Root functions non-abs * Fix argument check on alternative manager * Remove unnecessary gtk_main_iteration() as they create lots of problems * Do not unref wrong Manager in conversion in units dialog * Fix check of arguments in functions with unlimited number of arguments * Remove (again) prepended "1" for composite units * Fix prefixes 2003-10-06 Hanna Knutsson * Allow disabling of multiple roots * "Recently Used"-menu * Fix rounding of negative numbers * Fix adding ALTERNATIVE_MANAGER to ALTERNATIVE_MANAGER * Change GUI code to allow unrestrained category depth * Load builtin unit definitions even if we have no such * Do not write active and precise attributes when true * Organize definitions files in a category tree structure * Make execute button in insert function dialog non-stock * Change button text to "Insert" * Fix insert function with undefined arguments * Use a frame for description in insert function dialog 2003-10-02 Hanna Knutsson * Use & for & * Fix NOT * Fix signedness function (and comparisons) * Replace "<" with "<" and ">" with ">" * Display NOT_MANAGER * Make it configurable in preferences * Do not use annoying prefixes (hekto, deka, centi, deci) by default * Change unit conversion from printing value to using a value id as was originally intended * Delete string alternative "," when switching locale * #ifdef out fenv.h and floating point exceptions as they are only obstructing portability when using CLN * Cleanup * Warning function * Disable message function for now 2003-10-01 Hanna Knutsson * Updated swedish translation * Do not actually lower the precision below 10 to prohibit overflow * Do not act when setting the initial value of spinbuttons * Precision and decimals dialog need not be modal * Actually load the correct nodes for the locale * New simpler algorithm for reading function arguments, which handles citations correctly * Accept zero length strings * Concatenate and Length functions * Save function 2003-09-30 Hanna Knutsson * Execute expression when updating result display if expression has changed * Do not display more than 1500 digits in result display widget and not more than 500000 digits in history (works for me at least) * Restrict display time in variables dialog * Restrict value length if variables dialog * Delay calculation of variables * Remove signs menu * Try to speed up determinant (not very succeful) 2003-09-29 Hanna Knutsson * A little icon for the window * Update display outside of thread * Do not reverse order when transforming manager * Merge boolean operations into Manager class to enable unsolved operations * Make sure that thread actually is canceled before resuming * Change log to log10 and logn to log * Ignore syntax error function without parentesis are space before argument * New better algorithm for Calculator::setFunctionsAndVariables() * Nicer functions, variables and units dialogs * Show a nice progress dialog * More information (syntax and arguments) in description in functions dialog * Sort categories in edit dialogs 2003-09-27 Hanna Knutsson * Safer threads * Switch unit->name() to short name and add singular to enable translation * Enable xml data translation * Use less attributes in xml * Implement GUI editing of argument rules * Replace empty optional value with default value * Fill in default values in insert function dialog * Add ability to abort long calculations * ...and slow result display 2003-09-25 Hanna Knutsson * New condition for functions which can test the relation between arguments * Error function * Boolean operators * For (loop) function * Fix crash on delete inactive definition in GUI * Definition edit fixes 2003-09-24 Hanna Knutsson * Move defintions to library and PACKAGE_DATA_DIR/qalculate * Place local definitions in ~/.qalculate/definitions and load everything in that directory * XML definitions files * Update function edit dialog to new argument definitions, and turn function expression entry into a textview * Furthering argument definitions: new Argument classes that tests type and value * Fix parenthesis madness and handle missing left parenthesis 2003-09-22 Hanna Knutsson * ExpressionItem::isRegistered() * Once again constants -- new DynamicVariable class that recalculates value when precision has changed * Fix ...E-... * Fix root for negative results * Fix log for negative results * Fix display of ...E... * Fix infinite loop with prefixes <= 10E-1 * Check file format and version of definitions file 2003-09-21 Hanna Knutsson * Fix error message when too many arguments * Change "years_between_dates" to "yearfrac" * Fix day counting basis (hopefully gnumeric has done it right) * More financial functions * Fix mod, rem and frac * Better RPN support 2003-09-20 Hanna Knutsson * RPN Mode * Clean up EqItem.cc * Add variables for constants functions * Load definitions in exact mode * Reset (and restore) mode when loading definitions * Lots of tooltips (too many perhaps?) * Some definitions fixes * Function edit dialog: turn argument entry into a list view and add argument type * Do not locally save global deactivations 2003-09-18 Hanna Knutsson * Big restructuring to fix editing of global definitions, including deactivation of definitions and a new virtual ExpressionItem class * More error messages in matrix functions * Check if matrix operations were successful * Correct bad setPrecise(false) call in matrix * Speed up csum function for large vectors in statistical functions * Fix addition^integer * Fix display of 1/-x * Fix sqrt() * Fix display of fraction with 'E' * Fix display of 5*5^x * Fix detection of long prefixes * Fix 'E' (now we can have it in names) * Type label, spin buttons, date picker etc. in insert function dialog * Argument type 2003-09-15 Hanna Knutsson * Fix insert function dialog * Add scrollbars to table in matrix edit dialog * CSV file import * Lots of statistical functions: range, harmonic mean, geometric mean, trimmed mean, winsorized mean, quadratic mean, quartile, decile, percentile, interquartile range, variance, standard error, mean deviation, pearson, spearman's rho, covariance, correlation, pooled variance, paired t-test, unpaired t-test... * Add limits to custom sum function and allow references to other than current element (x_i-1) * Limits * Clean up base conversion functions * Fix If function 2003-09-11 Hanna Knutsson * Sort function * Buttons to set if precise in variable and unit edit dialogs * Exact mode * Use vectors in max, min, mode and median * Make constants functions for more flexible precision 2003-09-10 Hanna Knutsson * Change behavior of decimals settings * CLN support (requirement for now, in place of GMP) * Disable gnome support in glade file 2003-09-09 Hanna Knutsson * More accurate roots using Newton's Method with the libc function as initial value * Require GMP (it is not a priority right now to fix my own integer implementation) * GUI for edit/create matrix/vector * Remove repaint artifacts * Rank function 2003-09-08 Hanna Knutsson * Pearson Correlation and Spearman's rho (still needs rank function) * Replace hardcoded statistical functions * Utility functions: csum (Custom sum), process (Process vector components) * Vector (\v) in user functions * Function function for immediate creation and execution of a custom function * Indicate infinite sequence of decimals (configurable) * Custom font selection * Vector * Better alignment 2003-09-07 Hanna Knutsson * Use GtkDrawingArea to make result display nicer * More matrix functions: cofactor, adjoint, inverse 2003-09-03 Hanna Knutsson * Matrix functions: determinant (det), identity, transpose, element, columns, rows, matrix * Multiple solutions (4^0.5 = 2 or -2) * More work on matrices 2003-09-02 Hanna Knutsson * Beginning of matrix support * Fix zero division 2003-09-01 Hanna Knutsson * factorial function and ! * frac and int functions * Menu items for fractional representation * Turn "use prefixes" into check menu item 2003-08-31 Hanna Knutsson * Move builtin functions to fraction system * Reactivate display modes, decimals and precision * Use GMP if available in Integer class (much faster) 2003-08-30 Hanna Knutsson * Show if result is exact or not * Arbitrary precision * Move from long double to Fraction 2003-08-24 Hanna Knutsson * Decimal string to fraction * Date functions (for financial functions) * Fixes 2003-08-23 Hanna Knutsson * Localized dot and more 2003-08-22 Hanna Knutsson * Fractions and restructuring 2003-08-20 Hanna Knutsson * CALCULATOR macro (removes Calculator object from all classes) * New Prefix class and new get/add prefix functions; prefixes stored in a sorted vector * New get Function/Variable/Unit(index) functions 2003-08-20 Hanna Knutsson * Fraction button * Fraction Manager * New Fraction class 2003-08-19 Hanna Knutsson * Add title label to insert function dialog * Remove duplicate adding of answer variables, and remove from global definitions file... and gettextize 2003-08-18 Hanna Knutsson * Qalculate! version 0.2 released * Last minute fixes * More unicode * Fix display of exponent of exponent * Put unicode chars on buttons in code and add option to disable unicode signs * Unicode math operators * Save version info to configuration file * Update version number 2003-08-17 Hanna Knutsson * Only put "1 " in front of unit in toplevel * Fix 5*5^m (endless loop in Manager::convert) * Unscientific mode gives inexact result display -- disable for now * Disable installation of old German translation (will enable again after v0.2) * Create en_GB and en_US locales to get that nice square root sign * Do not shrink result label on clear * Do not expand menu buttons * Make functions dialog a bit nicer * Make units dialog a bit nicer * More energy and pressure units * Some constants * Write variables to file with maximum precision * Show variable title in menu and tree * Unit expression conversion fixes * Make operators wrap selection in parenthesis instead of deleting it, thus they operate on the result after execute * Insert ^ directly instead of waiting for another key press. * Fix annoying repositioning of text cursor in n-bases dialog * Update conversion in units dialog after focus out event in entries * Remove empty parenthesis after zero argument functions * Fix disabling of units * Fix unclosed brackets * restrict abs() to numbers * Change Function::name(string), Unit::title(string), etc. to setTitle(), setName() 2003-08-16 Hanna Knutsson * Google style in expression conversion (ex. 5 m to ft = 16.4 ft) * Small unit conversion fix (1 km/1 kg => 1 km/kg). * More units. * Fix loading of alias unit that is defined before its base unit in file * Modify priotrity for calculations so that inexplicit multiplication is calculated before division (2/2(x) = 2/(2*x)) and functions (sin 2x(x) = sin (2x*x), but sin(2x)(x) is still sin(2x)*x) * Some restructuring * Unbreak brokeness from last fix * Move three small dialogs to Glade * Convert button 2003-08-15 Hanna Knutsson * Fix bracket madness breaking unbrackened division (!) * About dialog 2003-08-14 Hanna Knutsson * Fix loading of argument names for builtin functions * Do not add argument names in code for builtin functions, read from definitions file instead * Fix crash when creating new unit * Disable OK button for editing global definitions until structure is sorted out * Beautify dialogs * Functions, variables and units buttons in main window * Sorting menus * Tree lists implemented for units, variables and functions dialogs * Submenus implemented for unit, variable and function menus * Connect "convert to"-button in unit managaer to new conversion system * Complete set of SI units * Various fixes 2003-08-13 Hanna Knutsson * Remove duplicate functions * Do not save unchanged global definitions in users definitions files * Selectable prefix in result * Fully functional unit conversion! 2003-08-12 Hanna Knutsson * Interpret "apple" as an unknown variable named apple * Add base conversion dialog * Beautify units dialog * Store pointer to unit in GUI to simplify the Unit/ComplexUnit mess * Enable editing/creation of composite units * New Greatest Common Divisor (gcd) function * First try at differentiation * Fix division 2003-08-11 Hanna Knutsson * Beautify insert function dialog * Populate category combos * Turn base unit combo into entry as it probably is not a good idea to fill the combo with all units * Gladeify the variable and function edit dialogs hidden callbacks.cc (gladeification finished?) * Beautification of dialogs * Huge gladeification of signals and widget references 2003-08-10 Sven Herzberg * data/qalculate.glade: don't know what exactly, but i'm sure that we got rid of one c dialog more * src/callbacks.cc: * src/interface.cc: 2003-08-10 Hanna Knutsson * Use for all exponents for consistency * New elegant and intelligent sorting, not only for internal purposes * Updated swedish translation. * Gettextized error messages. * Updaterad Calculator::error(). * Only enable prefixes in front of units * Fix disable/enable variables/functions/units/unknown * Found true evil in Manager::sort(). This should solve many problems. :-) * Enable binary output for larger numbers * Fix nested functions * Fix prefix followed be unit * Fix functions without parenthesis * correct widget name (units_option_menu_to_unit) * handle long result by making the window not resizable and the result label wrap 2003-08-09 Hanna Knutsson * Swedish translation * More strings to translate * Binary output * Fix BASE() * Fix prefixes in expression * Added ability to disable unknown variables * Support unsolved function -- now log(x) returns log(x) instead of the result of log(0) * Fix prefix display mode (only use in front of units to avoid confusion and support exponents) 2003-08-08 Hanna Knutsson * Set LC_NUMERIC to "C" to make strold() happy * Minor restructuring in preparation for different decimal points * Comment out debug output. Now (x+y)^50 takes 1 instead of 100 seconds. For those interested, the result of (x+y)^100 is 24287 pixels wide... 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/interface.cc: glade-ified the preferences dialog 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/interface.cc: glade-ified the units dialog * po/de.po: updated translation 2003-08-08 Sven Herzberg * src/interface.cc: removed unneccessary variables 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/interface.cc: glade-ified the variables dialog 2003-08-08 Sven Herzberg * src/interface.cc: removed unneccessary variables 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/callbacks.cc, * src/interface.cc: finished moving the menus 2003-08-08 Sven Herzberg * data/qalculate.glade, * src/callbacks.cc, * src/interface.cc: moving the menus to a (hidden) menubar to solve a warning regarding an accelerator group 2003-08-08 Hanna Knutsson * Move generated menus one step up * Add finalize() after conversion in callbacks.cc 2003-08-08 Hanna Knutsson * Some more fixes that I do not remember * Fix (x+y)^(6+n) * Fix kWs = W^2 * s^2 in Calculator.cc * Do not convert units during the whole calculation, do it in finalize() afterwards instead * Make units work even better. * Move OCT, HEX, BIN and BASE functions to category "Number Bases" 2003-08-08 Sven Herzberg * configure.in: added -Wall stuff again (was just a typo) * src/interface.cc: removed some unneccessary variables from create_window 2003-08-08 Sven Herzberg * data/qalculate.glade: includes the complete main window now * src/callbacks.cc: removed the GtkHSeparator (the're not used anymore) * src/interface.cc: moved the whole main window to the glade file 2003-08-07 Sven Herzberg * data/qalculate.glade: added the expression menu and the result menu * po/de.po: updated translation * src/callbacks.cc: glade updates * src/interface.cc: glade updates 2003-08-07 Sven Herzberg * src/interface.cc, * src/interface.h, * src/main.cc: as the return value of create_window was only used to display the widget, made create_window a void method and display widget from there 2003-08-07 Sven Herzberg * configure.in: added libglade dependency * data/Makefile.am: added glade file * data/qalculate.glade: user interface definition * src/callbacks.cc: removed the extern GtkWidget *window * src/interface.cc: started migration to glade * src/interface.h: started migration to glade * src/main.cc: started migration to glade 2003-08-07 Sven Herzberg * .cvsignore: cvs update has less warnings now * configure.in: added de to ALL_LINGUAS * data/qalculate.desktop.in: fixed the starter * po/.cvsignore: cvs update has less warnings now * po/de.po: updated german translation 2003-08-07 Sven Herzberg * data/Makefile.am: added fixes for kde pre-3.2 (aka stable) 2003-08-07 Sven Herzberg * .cvsignore: cvs update has less warnings now * configure.in: some beautification (will fix -Wall later this day) * data/.cvsignore: cvs update has less warnings now * data/Makefile.am: added desktop file * data/qalculate.desktop.in: desktop file template * po/.cvsignore: cvs update has less warnings now * po/POTFILES.in: added data/qalculate.desktop * po/de.po: added german translation 2003-08-07 Sven Herzberg * src/main.cc: some beautification * src/main.h: made enums from #defines (are the values relevant?) 2003-08-06 Hanna Knutsson * Removed some debug output * Fix (x+y)^5, but unfortunately not (x+y)^6... * Even better unit conversion. * Change Ctrl+V to Ctrl+M for manage variables 2003-08-06 Sven Herzberg * Makefile.am: make dist works now * configure.in: added data/Makefile.am * data/.cvsignore: cvs update has less warnings now * data/Makefile.am: make dist works now, make install too * po/.cvsignore: cvs update has less warnings now 2003-08-06 Sven Herzberg * .cvsignore: cvs update has less warnings now * Makefile.am: added data as subdir * acconfig.h: removed (templates are deprecated) * configure.in: added libtool * data/Makefile.am: added config file installation * po/.cvsignore: cvs update has less warnings now * src/.cvsignore: cvs update has less warnings now * src/Makefile.am: switched to libtool now * src/calclib/.cvsignore: cvs update has less warnings now * src/calclib/Makefile.am: using libtool now 2003-08-04 Hanna Knutsson * Optional arguments for functions * More functions... * Implemented if...then...else function * "config" -> "definition" * Added Execute button to insert function dialog * Added some financial functions libqalculate-2.8.2/README.translate0000644000175000017500000001514013227073274013772 00000000000000The Qalculate! developer(s) are thankful for every possible translation and willing to answer any questions or help with any problems you may have as a translator. Please read through this document before starting the translation. Qalculate! is split up in one library package (libqalculate, which also includes the text interface) and GUI packages (currently only qalculate-gtk). The GUI packages contains translations for the GUI text as usual in the po directory. The libqalculate translations is split up in two -- translation of error messages, type information and the text interface in po, and translation of definitions of functions, variables, units, etc. in po-defs (merged with the data files in data). The source packages for libqalculate and qalculate-gtk do not include any .pot files. Instead the pot file is created with "intltool-update --pot". You can then run "msginit --locale=??" or just copy the pot-file to ??.po. The translation file is updated with "intltool-update language code" (ex. intltool-update sv, for the Swedish translation) from the po directories. intltool-update is distributed with intltool. The translation of the libqalculate message strings in po-defs require some further knowledge. These are merged with the xml data files in libqalculate/data. The different types of message strings in these files are: Data objects: Values of text properties Data sets: Categories, titles, names, descriptions, property titles, property names and property descriptions Functions: Categories, titles, names, descriptions and argument titles Variables/constants: Categories, titles and names Units: Categories, titles and names To distinguish equal text strings with different meaning (for example "Mercury" as a planet and as a chemical element), some text strings is preceded by "!type!" (for example "!units!" for units). Everything between and including a exclamation mark in the beginning and the second exclamation mark is not displayed in the application. Translators do not need include to include "!type!" in the translation. Names require some special considerations from the translator. The names are used to reference an object in a mathematical expression and to display them in a result. An object can have any number of names but each must be fully unique, with the exception that functions can have names used by other types of objects (for example "min" is used as a name for the minute unit but also for a function returning smallest value in a vector). The translation does not need to have the same number of names as the the untranslated object. There are some characters which are reserved for other purposes (mainly mathematical operators) and may not be included in names. These are - ~ + - * / ^ & | ! <> = ' @ ? \ { } " . , ; : ( ) [ ], - spaces, tabs and newline characters, and - unicode signs for operators. No name may begin with a digit and units are not allowed to contain a digit anywhere. All names of a object is contained in one text string. The names are separated by commas (','). The order of names decides their priority, which name is by default used for display and input. Each name may be preceeded by a a number of properties before a colon (':'). The format of the names strings is thus [properties1:]name1,[properties2:]name2,... The possible properties are - 'a': the name is an abbreviation, - 'c': the name is case-sensitive, - 'i': the name should not be presented to the user for input (but looks good for display), - 'o': the name is appropriate for completion, but should never be presented to the user, - 'p':the name is in plural form, - 'r': the name is used as reference, - 's': the name ends with a suffix (the text after the last '_' will displayed as subscript with the '_' removed, often used in combination with 'i'), and - 'u': the name contains a unicode sign. All properties is off by default, except for names with only one sign which are interpreted as abbreviations by default, and for abbreviations which by default are case-sensitive. A property can be turned off by preceeding it with a minus '-'. The reference property tells that the name will be available to all users regardless of the language used. If a reference name is not included in the translated list of names, it is appended at the end by the program. The translator can inlcude the reference names to select the position of the name and change all properties except 'r', 'c' and 'u'. All untranslated first names has the reference property explicitely specified, so names can easily be distinguished from other text strings by the preceeding properties and colon. Most functions and variables have only one name. Units usually have an abbreviated name, a normal name and a name in plural form. Units should always have a name in plural form if it differs from the singular form. Names string that is the same translated as untranslated should preferably not be copied but left empty or replaced by "-" (so that it is marked as translated), to allow the size of the definitions data files to be reduced. Property names works like the names described above except that 'r' for reference is the only possible property. Below follows some examples from the Swedish translation. msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "a:m,meter" The meter unit has the abbreviated reference name "m" (case-sensitive), a normal name "meter" and a plural form "meters". Meter does also in addition have a different spelling in English. The Swedish name for meter is the same as in English but the plural form is the same as the singular, and no alternative spelling exist. msgid "r:mean" msgstr "medel" The name of the mean function is translated to "medel", but since "mean" is specified as a reference name it is appended by the program as the second name (results in "medel,r:mean"). msgid "ar:SEK" msgstr "a-c:kr,a:SEK,krona,p:kronor" The English version can only use the three character code for the Swedish currency since the other names can be used for other currencies, but the translation can assume that the user refers to the local currency. msgid "-r:billion" msgstr "miljard,p:miljarder" The constants for large numbers follows two different systems in different countries. With the "short scale" billion means 1e9, while it with the "long scale" means 1e12. Therefor, these constants do not have any reference name. The short scale is used in most English-speaking countries, while in Sweden the long scale is used. msgid "r:sqrt" msgstr "-" The untranslated string is kept. qalc commands and options to commands in libqalculate/po/ follows the same principles as reference names, meaning that the untranslated message string is kept in addition to the translated. libqalculate-2.8.2/configure0000755000175000017500000272023413401033103013013 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libqalculate 2.8.2. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libqalculate' PACKAGE_TARNAME='libqalculate' PACKAGE_VERSION='2.8.2' PACKAGE_STRING='libqalculate 2.8.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="libqalculate/Calculator.cc" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gt_needs= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS INTLTOOL_QALCULATE_DEFINITIONS_RULE POSUB LTLIBINTL LIBINTL INTLLIBS INTL_MACOSX_LIBS XGETTEXT_EXTRA_OPTIONS XGETTEXT_015 GMSGFMT_015 MSGFMT_015 GETTEXT_MACRO_VERSION GETTEXT_PACKAGE QALCULATE_TEST QALCULATE_DEFS2DOC LN_QALCULATE QALCULATE_TEXT READLINE_LIBS LTLIBICONV LIBICONV LIBXML_LIBS LIBXML_CFLAGS ICU_LIBS ICU_CFLAGS LIBCURL_LIBS LIBCURL_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG QALCULATE_AGE QALCULATE_REVISION QALCULATE_CURRENT CXXCPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL ALL_LINGUAS INTLTOOL_PERL GMSGFMT MSGFMT MSGMERGE XGETTEXT INTLTOOL_POLICY_RULE INTLTOOL_SERVICE_RULE INTLTOOL_THEME_RULE INTLTOOL_SCHEMAS_RULE INTLTOOL_CAVES_RULE INTLTOOL_XML_NOMERGE_RULE INTLTOOL_XML_RULE INTLTOOL_KBD_RULE INTLTOOL_XAM_RULE INTLTOOL_UI_RULE INTLTOOL_SOUNDLIST_RULE INTLTOOL_SHEET_RULE INTLTOOL_SERVER_RULE INTLTOOL_PONG_RULE INTLTOOL_OAF_RULE INTLTOOL_PROP_RULE INTLTOOL_KEYS_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_DESKTOP_RULE intltool__v_merge_options_0 intltool__v_merge_options_ INTLTOOL_V_MERGE_OPTIONS INTLTOOL__v_MERGE_0 INTLTOOL__v_MERGE_ INTLTOOL_V_MERGE INTLTOOL_EXTRACT INTLTOOL_MERGE INTLTOOL_UPDATE USE_NLS EGREP GREP CPP LN_S am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_textport enable_defs2doc enable_tests enable_dependency_tracking enable_nls enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_libcurl with_icu enable_rpath with_libiconv_prefix with_readline with_libintl_prefix ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP LT_SYS_LIBRARY_PATH CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR LIBCURL_CFLAGS LIBCURL_LIBS ICU_CFLAGS ICU_LIBS LIBXML_CFLAGS LIBXML_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libqalculate 2.8.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libqalculate] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libqalculate 2.8.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-textport Disable compiling the text port --enable-defs2doc Enable compiling the definitions documentation generator --enable-tests Enable compiling test programs --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-nls do not use Native Language Support --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-rpath do not hardcode runtime library paths Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-libcurl support for built-in retrieval of exchange rates --with-icu support for case-insensitive unicode strings --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-readline turn on readline default=yes, default tries -lncurses, -lcurses, -ltermcap --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path LIBCURL_CFLAGS C compiler flags for LIBCURL, overriding pkg-config LIBCURL_LIBS linker flags for LIBCURL, overriding pkg-config ICU_CFLAGS C compiler flags for ICU, overriding pkg-config ICU_LIBS linker flags for ICU, overriding pkg-config LIBXML_CFLAGS C compiler flags for LIBXML, overriding pkg-config LIBXML_LIBS linker flags for LIBXML, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libqalculate configure 2.8.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_check_member LINENO AGGR MEMBER VAR INCLUDES # ------------------------------------------------------ # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_cxx_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libqalculate $as_me 2.8.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libqalculate' VERSION='2.8.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Check whether --enable-textport was given. if test "${enable_textport+set}" = set; then : enableval=$enable_textport; enable_textport=$enableval else enable_textport="yes" fi # Check whether --enable-defs2doc was given. if test "${enable_defs2doc+set}" = set; then : enableval=$enable_defs2doc; enable_defs2doc=$enableval else enable_defs2doc="no" fi # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then : enableval=$enable_tests; enable_tests=$enableval else enable_tests="no" fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 $as_echo_n "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } case "$am__api_version" in 1.01234) as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5 ;; *) ;; esac INTLTOOL_REQUIRED_VERSION_AS_INT=`echo | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` if test -n ""; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= " >&5 $as_echo_n "checking for intltool >= ... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5 $as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; } test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || as_fn_error $? "Your intltool is too old. You need intltool or later." "$LINENO" 5 fi # Extract the first word of "intltool-update", so it can be a program name with args. set dummy intltool-update; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_UPDATE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_UPDATE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE if test -n "$INTLTOOL_UPDATE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5 $as_echo "$INTLTOOL_UPDATE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-merge", so it can be a program name with args. set dummy intltool-merge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_MERGE+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_MERGE in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE if test -n "$INTLTOOL_MERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5 $as_echo "$INTLTOOL_MERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "intltool-extract", so it can be a program name with args. set dummy intltool-extract; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_EXTRACT+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_EXTRACT in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT if test -n "$INTLTOOL_EXTRACT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5 $as_echo "$INTLTOOL_EXTRACT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5 fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " $@;' INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< $@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< $@' else INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM && mkdir $$_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u $$_it_tmp_dir $< $@ && rmdir $$_it_tmp_dir' fi INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' # Check the gettext tools to make sure they are GNU # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case $XGETTEXT in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XGETTEXT=$ac_cv_path_XGETTEXT if test -n "$XGETTEXT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case $MSGMERGE in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGMERGE=$ac_cv_path_MSGMERGE if test -n "$MSGMERGE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $MSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MSGFMT=$ac_cv_path_MSGFMT if test -n "$MSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5 fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_INTLTOOL_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $INTLTOOL_PERL in [\\/]* | ?:[\\/]*) ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL if test -n "$INTLTOOL_PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5 $as_echo "$INTLTOOL_PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$INTLTOOL_PERL"; then as_fn_error $? "perl not found" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5 $as_echo_n "checking for perl >= 5.8.1... " >&6; } $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then as_fn_error $? "perl 5.8.1 is required for intltool" "$LINENO" 5 else IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5 $as_echo "$IT_PERL_VERSION" >&6; } fi if test "x" != "xno-xml"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5 $as_echo_n "checking for XML::Parser... " >&6; } if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else as_fn_error $? "XML::Parser perl module is required for intltool" "$LINENO" 5 fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6.42-b88ce' macro_revision='2.4.6.42' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes file_list_spec_CXX='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: if test "x$GCC" = "xyes"; then case $CFLAGS in *-Os*) CFLAGS="$CFLAGS -O2" ;; esac case $CXXFLAGS in *-Os*) CXXFLAGS="$CXXFLAGS -O2" ;; esac fi if test "x$GCC" = "xyes"; then case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac fi $as_echo "#define HAVE_PTHREADS 1" >>confdefs.h QALCULATE_CURRENT=20 QALCULATE_REVISION=2 QALCULATE_AGE=0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : LIBS="$LIBS -lpthread" fi for ac_header in mpfr.h do : ac_fn_c_check_header_mongrel "$LINENO" "mpfr.h" "ac_cv_header_mpfr_h" "$ac_includes_default" if test "x$ac_cv_header_mpfr_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MPFR_H 1 _ACEOF LIBS="$LIBS -lmpfr -lgmp" else as_fn_error $? "Unable to find mpfr header" "$LINENO" 5 fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu for ac_header in unordered_map do : ac_fn_cxx_check_header_mongrel "$LINENO" "unordered_map" "ac_cv_header_unordered_map" "$ac_includes_default" if test "x$ac_cv_header_unordered_map" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNORDERED_MAP 1 _ACEOF fi done for ac_func in pipe2 do : ac_fn_cxx_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" if test "x$ac_cv_func_pipe2" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PIPE2 1 _ACEOF fi done # Check whether --with-libcurl was given. if test "${with_libcurl+set}" = set; then : withval=$with_libcurl; else with_libcurl=yes fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi if test "x$with_libcurl" = "xyes"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCURL" >&5 $as_echo_n "checking for LIBCURL... " >&6; } if test -n "$LIBCURL_CFLAGS"; then pkg_cv_LIBCURL_CFLAGS="$LIBCURL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBCURL_CFLAGS=`$PKG_CONFIG --cflags "libcurl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBCURL_LIBS"; then pkg_cv_LIBCURL_LIBS="$LIBCURL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBCURL_LIBS=`$PKG_CONFIG --libs "libcurl" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBCURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcurl" 2>&1` else LIBCURL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcurl" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBCURL_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libcurl) were not met: $LIBCURL_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBCURL_CFLAGS and LIBCURL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBCURL_CFLAGS and LIBCURL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LIBCURL_CFLAGS=$pkg_cv_LIBCURL_CFLAGS LIBCURL_LIBS=$pkg_cv_LIBCURL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define HAVE_LIBCURL 1" >>confdefs.h fi # Check whether --with-icu was given. if test "${with_icu+set}" = set; then : withval=$with_icu; else with_icu=yes fi if test "x$with_icu" = "xyes"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICU" >&5 $as_echo_n "checking for ICU... " >&6; } if test -n "$ICU_CFLAGS"; then pkg_cv_ICU_CFLAGS="$ICU_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc\""; } >&5 ($PKG_CONFIG --exists --print-errors "icu-uc") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-uc" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$ICU_LIBS"; then pkg_cv_ICU_LIBS="$ICU_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc\""; } >&5 ($PKG_CONFIG --exists --print-errors "icu-uc") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-uc" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-uc" 2>&1` else ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-uc" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$ICU_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (icu-uc) were not met: $ICU_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables ICU_CFLAGS and ICU_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables ICU_CFLAGS and ICU_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else ICU_CFLAGS=$pkg_cv_ICU_CFLAGS ICU_LIBS=$pkg_cv_ICU_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define HAVE_ICU 1" >>confdefs.h fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBXML" >&5 $as_echo_n "checking for LIBXML... " >&6; } if test -n "$LIBXML_CFLAGS"; then pkg_cv_LIBXML_CFLAGS="$LIBXML_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.3.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.3.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBXML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.3.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBXML_LIBS"; then pkg_cv_LIBXML_LIBS="$LIBXML_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.3.8\""; } >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.3.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBXML_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.3.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBXML_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0 >= 2.3.8" 2>&1` else LIBXML_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0 >= 2.3.8" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBXML_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libxml-2.0 >= 2.3.8) were not met: $LIBXML_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBXML_CFLAGS and LIBXML_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBXML_CFLAGS and LIBXML_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else LIBXML_CFLAGS=$pkg_cv_LIBXML_CFLAGS LIBXML_LIBS=$pkg_cv_LIBXML_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then : enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 $as_echo_n "checking for 64-bit host... " >&6; } if ${gl_cv_solaris_64bit+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then : gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 $as_echo "$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : am_cv_func_iconv_works=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi QALCULATE_TEXT="" LN_QALCULATE="" USE_READLINE="yes" READLINE_LIBS="" if test "x$enable_textport" = "xyes" ; then QALCULATE_TEXT="qalc$EXEEXT" LN_QALCULATE="qalc" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use readline" >&5 $as_echo_n "checking whether to use readline... " >&6; } # Check whether --with-readline was given. if test "${with_readline+set}" = set; then : withval=$with_readline; case "${withval}" in yes) USE_READLINE="yes" ; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; no) USE_READLINE="no" ; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; only) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS=" " { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using only readline)" >&5 $as_echo "yes (using only readline)" >&6; } ;; *) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS="${withval}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using extra libraries ${withval})" >&5 $as_echo "yes (using extra libraries ${withval})" >&6; } ;; esac else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${USE_READLINE}" >&5 $as_echo "${USE_READLINE}" >&6; } fi if test "$USE_READLINE" = yes ; then for ac_header in readline/readline.h readline/history.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "x${ac_cv_header_readline_readline_h}" != "xyes" -o "x${ac_cv_header_readline_history_h}" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find the headers for libreadline." >&5 $as_echo "$as_me: WARNING: Could not find the headers for libreadline." >&2;} else if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then unset ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lncurses" EXTRA_LIBREADLINE_DEPS=-lncurses $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h else unset ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lcurses" EXTRA_LIBREADLINE_DEPS=-lcurses $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h else unset ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline -ltermcap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -ltermcap" EXTRA_LIBREADLINE_DEPS=-ltermcap $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h else unset ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h fi fi fi fi else unset ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline ${EXTRA_LIBREADLINE_DEPS} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : HAVE_LIBREADLINE=true else HAVE_LIBREADLINE=false fi if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}" $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h fi fi if test x${HAVE_LIBREADLINE} = xtrue; then READLINE_LIBS="-lreadline -lhistory ${EXTRA_LIBREADLINE_DEPS}" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find libreadline." >&5 $as_echo "$as_me: WARNING: Could not find libreadline." >&2;} fi fi fi fi QALCULATE_DEFS2DOC="" if test "x$enable_defs2doc" = "xyes" ; then QALCULATE_DEFS2DOC="defs2doc$EXEEXT" fi QALCULATE_TEST="" if test "x$enable_tests" = "xyes" ; then QALCULATE_TEST="test$EXEEXT" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5 $as_echo_n "checking for library containing nanosleep... " >&6; } if ${ac_cv_search_nanosleep+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char nanosleep (); int main () { return nanosleep (); ; return 0; } _ACEOF for ac_lib in '' rt posix4; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_nanosleep=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_nanosleep+:} false; then : break fi done if ${ac_cv_search_nanosleep+:} false; then : else ac_cv_search_nanosleep=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5 $as_echo "$ac_cv_search_nanosleep" >&6; } ac_res=$ac_cv_search_nanosleep if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi GETTEXT_PACKAGE=libqalculate cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" _ACEOF ALL_LINGUAS="fr nl sv zh_CN" GETTEXT_MACRO_VERSION=0.19 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : gt_cv_func_CFPreferencesCopyAppValue=yes else gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 $as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { CFLocaleCopyCurrent(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : gt_cv_func_CFLocaleCopyCurrent=yes else gt_cv_func_CFLocaleCopyCurrent=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 $as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } if test $gt_cv_func_CFLocaleCopyCurrent = yes; then $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 $as_echo_n "checking for GNU gettext in libc... " >&6; } if eval \${$gt_func_gnugettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libc=yes" else eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if ${am_cv_func_iconv+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if ${am_cv_func_iconv_works+:} false; then : $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do if test "$cross_compiling" = yes; then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : am_cv_func_iconv_works=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$gt_func_gnugettext_libintl=yes" else eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 $as_echo_n "checking whether to use NLS... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 $as_echo "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 $as_echo_n "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 $as_echo "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 $as_echo_n "checking how to link with libintl... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 $as_echo "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h $as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" { $as_echo "$as_me:${as_lineno-$LINENO}: checking locale directory" >&5 $as_echo_n "checking locale directory... " >&6; } if test "x$prefix" = "xNONE"; then PACKAGE_LOCALE_DIR=$ac_default_prefix/share/locale else PACKAGE_LOCALE_DIR=$prefix/share/locale fi ac_fn_cxx_check_member "$LINENO" "struct lconv" "int_p_cs_precedes" "ac_cv_member_struct_lconv_int_p_cs_precedes" "$ac_includes_default #include " if test "x$ac_cv_member_struct_lconv_int_p_cs_precedes" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_LCONV_INT_P_CS_PRECEDES 1 _ACEOF fi ac_fn_cxx_check_member "$LINENO" "struct lconv" "int_n_cs_precedes" "ac_cv_member_struct_lconv_int_n_cs_precedes" "$ac_includes_default #include " if test "x$ac_cv_member_struct_lconv_int_n_cs_precedes" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_LCONV_INT_N_CS_PRECEDES 1 _ACEOF fi cat >>confdefs.h <<_ACEOF #define PACKAGE_LOCALE_DIR "$PACKAGE_LOCALE_DIR" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$PACKAGE_LOCALE_DIR\"" >&5 $as_echo "\"$PACKAGE_LOCALE_DIR\"" >&6; } INTLTOOL_QALCULATE_DEFINITIONS_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po-defs/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po-defs/.intltool-merge-cache $(top_srcdir)/po-defs $< $@' ac_config_files="$ac_config_files Makefile src/Makefile libqalculate/Makefile data/Makefile po/Makefile.in po-defs/Makefile docs/Makefile docs/reference/Makefile libqalculate.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi ac_config_commands="$ac_config_commands po/stamp-it" : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libqalculate $as_me 2.8.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libqalculate config.status 2.8.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "libqalculate/Makefile") CONFIG_FILES="$CONFIG_FILES libqalculate/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "po-defs/Makefile") CONFIG_FILES="$CONFIG_FILES po-defs/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/reference/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/Makefile" ;; "libqalculate.pc") CONFIG_FILES="$CONFIG_FILES libqalculate.pc" ;; "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; "po/stamp-it":C) if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5 fi rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" >"po/stamp-it.tmp" sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES" sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r po/POTFILES } ' "po/Makefile.in" >"po/Makefile" rm -f "po/Makefile.tmp" mv "po/stamp-it.tmp" "po/stamp-it" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi libqalculate-2.8.2/config.rpath0000755000175000017500000004421613141107436013425 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2016 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd[23].*) library_names_spec='$libname$shrext$versuffix' ;; freebsd* | dragonfly*) library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <]], [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in Mac OS X 10.3. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFLocaleCopyCurrent();]])], [gt_cv_func_CFLocaleCopyCurrent=yes], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) # serial 42 IT_PROG_INTLTOOL AC_DEFUN([IT_PROG_INTLTOOL], [ AC_PREREQ([2.50])dnl AC_REQUIRE([AM_NLS])dnl case "$am__api_version" in 1.[01234]) AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool]) ;; *) ;; esac INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` if test -n "$1"; then AC_MSG_CHECKING([for intltool >= $1]) AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) fi AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi AC_SUBST([AM_DEFAULT_VERBOSITY]) INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))' INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))' INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;' AC_SUBST(INTLTOOL_V_MERGE) AC_SUBST(INTLTOOL__v_MERGE_) AC_SUBST(INTLTOOL__v_MERGE_0) INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))' intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))' intltool__v_merge_options_0='-q' AC_SUBST(INTLTOOL_V_MERGE_OPTIONS) AC_SUBST(intltool__v_merge_options_) AC_SUBST(intltool__v_merge_options_0) INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@' INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@' else INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir' fi INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' _IT_SUBST(INTLTOOL_DESKTOP_RULE) _IT_SUBST(INTLTOOL_DIRECTORY_RULE) _IT_SUBST(INTLTOOL_KEYS_RULE) _IT_SUBST(INTLTOOL_PROP_RULE) _IT_SUBST(INTLTOOL_OAF_RULE) _IT_SUBST(INTLTOOL_PONG_RULE) _IT_SUBST(INTLTOOL_SERVER_RULE) _IT_SUBST(INTLTOOL_SHEET_RULE) _IT_SUBST(INTLTOOL_SOUNDLIST_RULE) _IT_SUBST(INTLTOOL_UI_RULE) _IT_SUBST(INTLTOOL_XAM_RULE) _IT_SUBST(INTLTOOL_KBD_RULE) _IT_SUBST(INTLTOOL_XML_RULE) _IT_SUBST(INTLTOOL_XML_NOMERGE_RULE) _IT_SUBST(INTLTOOL_CAVES_RULE) _IT_SUBST(INTLTOOL_SCHEMAS_RULE) _IT_SUBST(INTLTOOL_THEME_RULE) _IT_SUBST(INTLTOOL_SERVICE_RULE) _IT_SUBST(INTLTOOL_POLICY_RULE) # Check the gettext tools to make sure they are GNU AC_PATH_PROG(XGETTEXT, xgettext) AC_PATH_PROG(MSGMERGE, msgmerge) AC_PATH_PROG(MSGFMT, msgfmt) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`" mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`" mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`" if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi AC_PATH_PROG(INTLTOOL_PERL, perl) if test -z "$INTLTOOL_PERL"; then AC_MSG_ERROR([perl not found]) fi AC_MSG_CHECKING([for perl >= 5.8.1]) $INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1 if test $? -ne 0; then AC_MSG_ERROR([perl 5.8.1 is required for intltool]) else IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"` AC_MSG_RESULT([$IT_PERL_VERSION]) fi if test "x$2" != "xno-xml"; then AC_MSG_CHECKING([for XML::Parser]) if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then AC_MSG_RESULT([ok]) else AC_MSG_ERROR([XML::Parser perl module is required for intltool]) fi fi # Substitute ALL_LINGUAS so we can use it in po/Makefile AC_SUBST(ALL_LINGUAS) IT_PO_SUBDIR([po]) ]) # IT_PO_SUBDIR(DIRNAME) # --------------------- # All po subdirs have to be declared with this macro; the subdir "po" is # declared by IT_PROG_INTLTOOL. # AC_DEFUN([IT_PO_SUBDIR], [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. dnl dnl The following CONFIG_COMMANDS should be executed at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.]) fi rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp" >"$1/stamp-it.tmp" [sed '/^#/d s/^[[].*] *// /^[ ]*$/d '"s|^| $ac_top_srcdir/|" \ "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES" ] [sed '/^POTFILES =/,/[^\\]$/ { /^POTFILES =/!d r $1/POTFILES } ' "$1/Makefile.in" >"$1/Makefile"] rm -f "$1/Makefile.tmp" mv "$1/stamp-it.tmp" "$1/stamp-it" ]) ])dnl ]) # _IT_SUBST(VARIABLE) # ------------------- # Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST # AC_DEFUN([_IT_SUBST], [ AC_SUBST([$1]) m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])]) ] ) # deprecated macros AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL]) # A hint is needed for aclocal from Automake <= 1.9.4: # AC_DEFUN([AC_PROG_INTLTOOL], ...) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 11 (pkg-config-0.29.1) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------ dnl dnl Prepare a "--with-" configure option using the lowercase dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) m4_pushdef([description], [m4_default([$5], [build with ]with_arg[ support])]) m4_pushdef([def_arg], [m4_default([$6], [auto])]) m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) m4_case(def_arg, [yes],[m4_pushdef([with_without], [--without-]with_arg)], [m4_pushdef([with_without],[--with-]with_arg)]) AC_ARG_WITH(with_arg, AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, [AS_TR_SH([with_]with_arg)=def_arg]) AS_CASE([$AS_TR_SH([with_]with_arg)], [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], [auto],[PKG_CHECK_MODULES([$1],[$2], [m4_n([def_action_if_found]) $3], [m4_n([def_action_if_not_found]) $4])]) m4_popdef([with_arg]) m4_popdef([description]) m4_popdef([def_arg]) ])dnl PKG_WITH_MODULES dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ----------------------------------------------- dnl dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) ])dnl PKG_HAVE_WITH_MODULES dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------------------ dnl dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/gettext.m4]) m4_include([m4/iconv.m4]) m4_include([m4/lib-ld.m4]) m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/nls.m4]) m4_include([m4/po.m4]) m4_include([m4/progtest.m4]) libqalculate-2.8.2/m4/0000755000175000017500000000000013401033232011475 500000000000000libqalculate-2.8.2/m4/lib-prefix.m40000644000175000017500000002042213141107437013732 00000000000000# lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) libqalculate-2.8.2/m4/ltoptions.m40000644000175000017500000003426213401033077013730 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2018 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) libqalculate-2.8.2/m4/lt~obsolete.m40000644000175000017500000001377413401033100014237 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2018 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) libqalculate-2.8.2/m4/iconv.m40000644000175000017500000002207213141107437013012 00000000000000# iconv.m4 serial 19 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif ]], [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; ]])], [am_cv_func_iconv_works=yes], , [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) fi ]) libqalculate-2.8.2/m4/ltsugar.m40000644000175000017500000001044013401033077013346 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2018 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) libqalculate-2.8.2/m4/lib-ld.m40000644000175000017500000000714313141107437013041 00000000000000# lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 , 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) libqalculate-2.8.2/m4/po.m40000644000175000017500000004503113141107437012312 00000000000000# po.m4 serial 24 (gettext-0.19) dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <. ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS libqalculate-2.8.2/m4/nls.m40000644000175000017500000000230713141107437012467 00000000000000# nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) libqalculate-2.8.2/m4/gettext.m40000644000175000017500000003676313141107437013374 00000000000000# gettext.m4 serial 68 (gettext-0.19.8) dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value '$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], []) libqalculate-2.8.2/m4/ltversion.m40000644000175000017500000000132313401033077013712 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2018 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4221 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6.42-b88ce]) m4_define([LT_PACKAGE_REVISION], [2.4.6.42]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6.42-b88ce' macro_revision='2.4.6.42' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) libqalculate-2.8.2/m4/lib-link.m40000644000175000017500000010044313141107437013374 00000000000000# lib-link.m4 serial 26 (gettext-0.18.2) dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[m4_translit([$1],[./+-], [____])]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes popdef([NAME]) popdef([Name]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. The missing-message dnl defaults to 'no' and may contain additional hints for the user. dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[m4_translit([$1],[./+-], [____])]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, dnl because these -l options might require -L options that are present in dnl LIBS. -l options benefit only from the -L options listed before it. dnl Otherwise, add it to the front of LIBS, because it may be a static dnl library that depends on another static library that is present in LIBS. dnl Static libraries benefit only from the static libraries listed after dnl it. case " $LIB[]NAME" in *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *) LIBS="$LIB[]NAME $LIBS" ;; esac AC_LINK_IFELSE( [AC_LANG_PROGRAM([[$3]], [[$4]])], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) popdef([NAME]) popdef([Name]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_libname_spec, dnl acl_library_names_spec, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) libqalculate-2.8.2/compile0000755000175000017500000001632713350174156012502 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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 General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libqalculate-2.8.2/configure.ac0000644000175000017500000002150513401032762013375 00000000000000dnl dnl configure.in for libqalculate dnl dnl ---------------------- dnl | initialize autotools |--------------------------------------------------- dnl ---------------------- AC_INIT([libqalculate], [2.8.2]) AC_CONFIG_SRCDIR(libqalculate/Calculator.cc) AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_CONFIG_MACRO_DIRS([m4]) AC_ARG_ENABLE(textport, [ --disable-textport Disable compiling the text port], enable_textport=$enableval, enable_textport="yes") AC_ARG_ENABLE(defs2doc, [ --enable-defs2doc Enable compiling the definitions documentation generator], enable_defs2doc=$enableval, enable_defs2doc="no") AC_ARG_ENABLE(tests, [ --enable-tests Enable compiling test programs], enable_tests=$enableval, enable_tests="no") dnl ------------------------------- dnl | check for neccessary programs |------------------------------------------ dnl ------------------------------- AC_ISC_POSIX AC_PROG_CC AC_PROG_CXX AM_PROG_CC_STDC AC_PROG_LN_S AC_HEADER_STDC AC_PROG_INTLTOOL AM_PROG_LIBTOOL dnl ------------------------------------ dnl | check for compiler characteristics |------------------------------------- dnl ------------------------------------ dnl Replace -Os with -O2 to stop segfault on startup if test "x$GCC" = "xyes"; then case $CFLAGS in *-Os*) CFLAGS="$CFLAGS -O2" ;; esac case $CXXFLAGS in *-Os*) CXXFLAGS="$CXXFLAGS -O2" ;; esac fi dnl Use -Wall if we have gcc. changequote(,)dnl if test "x$GCC" = "xyes"; then case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac fi changequote([,])dnl dnl check for threading model dnl TODO AC_DEFINE([HAVE_PTHREADS],1, [Define if pthreads are present.]) dnl libtool versioning for libqalculate dnl increment if the interface has additions, changes, removals. QALCULATE_CURRENT=20 dnl increment any time the source changes; set to dnl 0 if you increment CURRENT QALCULATE_REVISION=2 dnl increment if any interfaces have been added; set to 0 dnl if any interfaces have been removed. removal has dnl precedence over adding, so set to 0 if both happened. QALCULATE_AGE=0 AC_SUBST(QALCULATE_CURRENT) AC_SUBST(QALCULATE_REVISION) AC_SUBST(QALCULATE_AGE) dnl -------------------------------- dnl | check for neccessary libraries |----------------------------------------- dnl -------------------------------- AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"]) AC_CHECK_HEADERS(mpfr.h, [LIBS="$LIBS -lmpfr -lgmp"], [AC_MSG_ERROR([Unable to find mpfr header])]) AC_LANG([C++]) AC_CHECK_HEADERS([unordered_map]) AC_CHECK_FUNCS([pipe2]) AC_ARG_WITH([libcurl], AS_HELP_STRING([--with-libcurl], [support for built-in retrieval of exchange rates]), [], [with_libcurl=yes]) AS_IF([test "x$with_libcurl" = "xyes"], [ PKG_CHECK_MODULES([LIBCURL], [libcurl]) AC_DEFINE([HAVE_LIBCURL], [1], [Use libcurl]) AC_SUBST(LIBCURL_CFLAGS) AC_SUBST(LIBCURL_LIBS) ]) AC_ARG_WITH([icu], AS_HELP_STRING([--with-icu], [support for case-insensitive unicode strings]), [], [with_icu=yes]) AS_IF([test "x$with_icu" = "xyes"], [ PKG_CHECK_MODULES([ICU], [icu-uc]) AC_DEFINE([HAVE_ICU], [1], [Use icu]) AC_SUBST(ICU_CFLAGS) AC_SUBST(ICU_LIBS) ]) PKG_CHECK_MODULES(LIBXML, [libxml-2.0 >= 2.3.8]) AC_SUBST(LIBXML_CFLAGS) AC_SUBST(LIBXML_LIBS) AM_ICONV_LINK() dnl -------------------------------- dnl | check for readline |----------------------------------------- dnl -------------------------------- QALCULATE_TEXT="" LN_QALCULATE="" USE_READLINE="yes" READLINE_LIBS="" if test "x$enable_textport" = "xyes" ; then QALCULATE_TEXT="qalc$EXEEXT" LN_QALCULATE="qalc" AC_MSG_CHECKING([whether to use readline]) AC_ARG_WITH(readline, [ --with-readline turn on readline [default=yes, default tries -lncurses, -lcurses, -ltermcap]], [case "${withval}" in yes) USE_READLINE="yes" ; AC_MSG_RESULT([yes]) ;; no) USE_READLINE="no" ; AC_MSG_RESULT([no]) ;; only) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS=" " AC_MSG_RESULT([yes (using only readline)]) ;; *) USE_READLINE="yes" EXTRA_LIBREADLINE_DEPS="${withval}" AC_MSG_RESULT([yes (using extra libraries ${withval})]) ;; esac],[AC_MSG_RESULT([${USE_READLINE}])]) dnl Checks for libraries. dnl When checking readline, check using extra libraries first. dnl We want to protect against the link somehow succeeding, but only dnl failing at runtime, as seems to happen on some BSD systems. if test "$USE_READLINE" = yes ; then AC_CHECK_HEADERS(readline/readline.h readline/history.h) if test "x${ac_cv_header_readline_readline_h}" != "xyes" -o "x${ac_cv_header_readline_history_h}" != "xyes"; then AC_MSG_WARN([Could not find the headers for libreadline.]) else if test "$EXTRA_LIBREADLINE_DEPS" = "" ; then unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false, -lncurses) if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lncurses" EXTRA_LIBREADLINE_DEPS=-lncurses AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) else unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false, -lcurses) if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -lcurses" EXTRA_LIBREADLINE_DEPS=-lcurses AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) else unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false, -ltermcap) if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline -ltermcap" EXTRA_LIBREADLINE_DEPS=-ltermcap AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) else unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false) if test x${HAVE_LIBREADLINE} = xtrue ; then AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) fi fi fi fi else unset ac_cv_lib_readline_readline AC_CHECK_LIB(readline, readline, HAVE_LIBREADLINE=true, HAVE_LIBREADLINE=false, ${EXTRA_LIBREADLINE_DEPS}) if test x${HAVE_LIBREADLINE} = xtrue ; then echo " Using -lreadline ${EXTRA_LIBREADLINE_DEPS}" AC_DEFINE(HAVE_LIBREADLINE, [1], [Define if the text port uses readline]) fi fi if test x${HAVE_LIBREADLINE} = xtrue; then READLINE_LIBS="-lreadline -lhistory ${EXTRA_LIBREADLINE_DEPS}" else AC_MSG_WARN([Could not find libreadline.]) fi fi fi fi AC_SUBST(READLINE_LIBS) AC_SUBST(QALCULATE_TEXT) AC_SUBST(LN_QALCULATE) QALCULATE_DEFS2DOC="" if test "x$enable_defs2doc" = "xyes" ; then QALCULATE_DEFS2DOC="defs2doc$EXEEXT" fi AC_SUBST(QALCULATE_DEFS2DOC) QALCULATE_TEST="" if test "x$enable_tests" = "xyes" ; then QALCULATE_TEST="test$EXEEXT" fi AC_SUBST(QALCULATE_TEST) AC_SEARCH_LIBS([nanosleep],[rt posix4]) dnl ------------------------------------- dnl | internationalization (i18n) support |------------------------------------ dnl ------------------------------------- GETTEXT_PACKAGE=libqalculate AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The package name for gettext]) dnl Please keep this in alphabetical order ALL_LINGUAS="fr nl sv zh_CN" AM_GNU_GETTEXT(external) AM_GNU_GETTEXT_VERSION([0.19.8]) dnl AM_GLIB_GNU_GETTEXT sets $DATADIRNAME AC_MSG_CHECKING(locale directory) if test "x$prefix" = "xNONE"; then PACKAGE_LOCALE_DIR=$ac_default_prefix/share/locale else PACKAGE_LOCALE_DIR=$prefix/share/locale fi dnl lconv AC_CHECK_MEMBERS([struct lconv.int_p_cs_precedes,] dnl [struct lconv.int_n_cs_precedes],[],[],[AC_INCLUDES_DEFAULT #include ]) AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "$PACKAGE_LOCALE_DIR", [The directory in which qalculate's locale data will be stored]) AC_MSG_RESULT("$PACKAGE_LOCALE_DIR") INTLTOOL_QALCULATE_DEFINITIONS_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po-defs/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po-defs/.intltool-merge-cache $(top_srcdir)/po-defs $< [$]@' AC_SUBST(INTLTOOL_QALCULATE_DEFINITIONS_RULE) dnl -------- dnl | output |----------------------------------------------------------------- dnl -------- AC_OUTPUT([ Makefile src/Makefile libqalculate/Makefile data/Makefile po/Makefile.in po-defs/Makefile docs/Makefile docs/reference/Makefile libqalculate.pc ]) libqalculate-2.8.2/depcomp0000755000175000017500000005602013350174156012473 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, 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 General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libqalculate-2.8.2/src/0000755000175000017500000000000013401033232011744 500000000000000libqalculate-2.8.2/src/qalc.cc0000644000175000017500000065300413401033056013127 00000000000000/* Qalculate (CLI) Copyright (C) 2003-2007, 2008, 2016 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include #include #include #include #include #include #include #include #include #ifdef HAVE_LIBREADLINE # include # include #endif #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN # include #endif class ViewThread : public Thread { protected: virtual void run(); }; class CommandThread : public Thread { protected: virtual void run(); }; MathStructure *mstruct, *parsed_mstruct; KnownVariable *vans[5]; string result_text, parsed_text; bool load_global_defs, fetch_exchange_rates_at_startup, first_time, save_mode_on_exit, save_defs_on_exit; int auto_update_exchange_rates; PrintOptions printops, saved_printops; EvaluationOptions evalops, saved_evalops; AssumptionType saved_assumption_type; AssumptionSign saved_assumption_sign; int saved_precision; bool saved_interval, saved_adaptive_interval_display, saved_variable_units_enabled; bool adaptive_interval_display; Thread *view_thread, *command_thread; bool command_aborted = false; volatile bool b_busy = false; string expression_str; bool expression_executed = false; bool avoid_recalculation = false; bool hide_parse_errors = false; bool rpn_mode; bool use_readline = true; bool interactive_mode; bool ask_questions; bool canfetch = true; int b_decimal_comma = -1; long int i_maxtime = 0; struct timeval t_end; bool result_only; static char buffer[1000]; void setResult(Prefix *prefix = NULL, bool update_parse = false, bool goto_input = true, size_t stack_index = 0, bool register_moved = false, bool noprint = false); void execute_expression(bool goto_input = true, bool do_mathoperation = false, MathOperation op = OPERATION_ADD, MathFunction *f = NULL, bool do_stack = false, size_t stack_index = 0, bool check_exrates = true); void execute_command(int command_type, bool show_result = true); void load_preferences(); bool save_preferences(bool mode = false); bool save_mode(); void set_saved_mode(); bool save_defs(); void result_display_updated(); void result_format_updated(); void result_action_executed(); void result_prefix_changed(Prefix *prefix = NULL); void expression_format_updated(bool reparse); void expression_calculation_updated(); bool display_errors(bool goto_input = false, int cols = 0); void replace_quotation_marks(string &result_text); FILE *cfile; enum { COMMAND_FACTORIZE, COMMAND_SIMPLIFY, COMMAND_EXPAND_PARTIAL_FRACTIONS, COMMAND_EVAL }; #define EQUALS_IGNORECASE_AND_LOCAL(x,y,z) (equalsIgnoreCase(x, y) || equalsIgnoreCase(x, z)) bool contains_unicode_char(const char *str) { for(int i = strlen(str) - 1; i >= 0; i--) { if(str[i] < 0) return true; } return false; } #define PUTS_UNICODE(x) if(printops.use_unicode_signs || !contains_unicode_char(x)) {puts(x);} else {char *gstr = locale_from_utf8(x); if(gstr) {puts(gstr); free(gstr);} else {puts(x);}} #define FPUTS_UNICODE(x, y) if(printops.use_unicode_signs || !contains_unicode_char(x)) {fputs(x, y);} else {char *gstr = locale_from_utf8(x); if(gstr) {fputs(gstr, y); free(gstr);} else {fputs(x, y);}} size_t unicode_length_check(const char *str) { /*if(printops.use_unicode_signs) return unicode_length(str); return strlen(str);*/ return unicode_length(str); } int s2b(const string &str) { if(str.empty()) return -1; if(EQUALS_IGNORECASE_AND_LOCAL(str, "yes", _("yes"))) return 1; if(EQUALS_IGNORECASE_AND_LOCAL(str, "no", _("no"))) return 0; if(EQUALS_IGNORECASE_AND_LOCAL(str, "true", _("true"))) return 1; if(EQUALS_IGNORECASE_AND_LOCAL(str, "false", _("false"))) return 0; if(EQUALS_IGNORECASE_AND_LOCAL(str, "on", _("on"))) return 1; if(EQUALS_IGNORECASE_AND_LOCAL(str, "off", _("off"))) return 0; if(str.find_first_not_of(SPACES NUMBERS) != string::npos) return -1; int i = s2i(str); if(i > 0) return 1; return 0; } bool is_answer_variable(Variable *v) { return v == vans[0] || v == vans[1] || v == vans[2] || v == vans[3] || v == vans[4]; } bool equalsIgnoreCaseFirst(const string &str1, const char *str2) { if(str1.length() < 1 || strlen(str2) < 1) return false; if((str1[0] < 0 && str1.length() > 1) || (str2[0] < 0 && strlen(str2) > 1)) { size_t iu1 = 1, iu2 = 1; if(str1[0] < 0) { while(iu1 < str1.length() && str1[iu1] < 0) { iu1++; } } if(str2[0] < 0) { while(iu2 < strlen(str2) && str2[iu2] < 0) { iu2++; } } bool isequal = (iu1 == iu2); if(isequal) { for(size_t i = 0; i < iu1; i++) { if(str1[i] != str2[i]) { isequal = false; break; } } } if(!isequal) { char *gstr1 = utf8_strdown(str1.c_str(), iu1); char *gstr2 = utf8_strdown(str2, iu2); if(!gstr1 || !gstr2) return false; bool b = strcmp(gstr1, gstr2) == 0; free(gstr1); free(gstr2); return b; } } else if(str1.length() != 1 || (str1[0] != str2[0] && !((str1[0] >= 'a' && str1[0] <= 'z') && str1[0] - 32 == str2[0]) && !((str1[0] <= 'Z' && str1[0] >= 'A') && str1[0] + 32 == str2[0]))) { return false; } return true; } bool ask_question(const char *question, bool default_answer = false) { FPUTS_UNICODE(question, stdout); while(true) { #ifdef HAVE_LIBREADLINE char *rlbuffer = readline(" "); string str = rlbuffer; free(rlbuffer); #else fputs(" ", stdout); if(!fgets(buffer, 1000, stdin)) return false; string str = buffer; #endif remove_blank_ends(str); if(equalsIgnoreCaseFirst(str, "yes") || equalsIgnoreCaseFirst(str, _("yes")) || EQUALS_IGNORECASE_AND_LOCAL(str, "yes", _("yes"))) { return true; } else if(equalsIgnoreCaseFirst(str, "no") || equalsIgnoreCaseFirst(str, _("no")) || EQUALS_IGNORECASE_AND_LOCAL(str, "no", _("no"))) { return false; } else if(str.empty()) { return default_answer; } else { FPUTS_UNICODE(_("Please answer yes or no"), stdout); FPUTS_UNICODE(":", stdout); } } } void set_assumption(const string &str, bool last_of_two = false) { if(EQUALS_IGNORECASE_AND_LOCAL(str, "unknown", _("unknown")) || str == "0") { if(!last_of_two) { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_UNKNOWN); } else { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_NUMBER); } } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "real", _("real"))) { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_REAL); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "number", _("number")) || str == "num") { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_NUMBER); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "rational", _("rational")) || str == "rat") { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_RATIONAL); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "integer", _("integer")) || str == "int") { CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_INTEGER); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "non-zero", _("non-zero")) || str == "nz") { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_NONZERO); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "positive", _("positive")) || str == "pos") { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_POSITIVE); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "non-negative", _("non-negative")) || str == "nneg") { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_NONNEGATIVE); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "negative", _("negative")) || str == "neg") { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_NEGATIVE); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "non-positive", _("non-positive")) || str == "npos") { CALCULATOR->defaultAssumptions()->setSign(ASSUMPTION_SIGN_NONPOSITIVE); } else { PUTS_UNICODE(_("Unrecognized assumption.")); return; } } vector matches; #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_LIBREADLINE char *qalc_completion(const char *text, int index) { if(index == 0) { if(strlen(text) < 1) return NULL; matches.clear(); bool b_match; size_t l = strlen(text); for(size_t i = 0; i < CALCULATOR->functions.size(); i++) { if(CALCULATOR->functions[i]->isActive()) { ExpressionItem *item = CALCULATOR->functions[i]; const ExpressionName *ename = NULL; b_match = false; for(size_t name_i = 1; name_i <= item->countNames() && !b_match; name_i++) { ename = &item->getName(name_i); if(ename && l <= ename->name.length()) { b_match = true; for(size_t i2 = 0; i2 < l; i2++) { if(ename->name[i2] != text[i2]) { b_match = false; break; } } } } if(b_match && ename) { if(ename->completion_only) ename = &item->preferredInputName(ename->abbreviation, printops.use_unicode_signs); matches.push_back(&ename->name); } } } for(size_t i = 0; i < CALCULATOR->variables.size(); i++) { if(CALCULATOR->variables[i]->isActive()) { ExpressionItem *item = CALCULATOR->variables[i]; const ExpressionName *ename = NULL; b_match = false; for(size_t name_i = 1; name_i <= item->countNames() && !b_match; name_i++) { ename = &item->getName(name_i); if(ename && l <= ename->name.length()) { b_match = true; for(size_t i2 = 0; i2 < l; i2++) { if(ename->name[i2] != text[i2]) { b_match = false; break; } } } } if(b_match && ename) { if(ename->completion_only) ename = &item->preferredInputName(ename->abbreviation, printops.use_unicode_signs); matches.push_back(&ename->name); } } } for(size_t i = 0; i < CALCULATOR->units.size(); i++) { if(CALCULATOR->units[i]->isActive() && CALCULATOR->units[i]->subtype() != SUBTYPE_COMPOSITE_UNIT) { ExpressionItem *item = CALCULATOR->units[i]; const ExpressionName *ename = NULL; b_match = false; for(size_t name_i = 1; name_i <= item->countNames() && !b_match; name_i++) { ename = &item->getName(name_i); if(ename && l <= ename->name.length()) { b_match = true; for(size_t i2 = 0; i2 < l; i2++) { if(ename->name[i2] != text[i2]) { b_match = false; break; } } } } if(b_match && ename) { if(ename->completion_only) ename = &item->preferredInputName(ename->abbreviation, printops.use_unicode_signs); matches.push_back(&ename->name); } } } } if(index >= 0 && index < (int) matches.size()) { char *cstr = (char*) malloc(sizeof(char) *matches[index]->length() + 1); strcpy(cstr, matches[index]->c_str()); return cstr; } return NULL; } #endif #ifdef __cplusplus } #endif int enable_unicode = -1; void handle_exit() { CALCULATOR->abort(); if(enable_unicode >= 0) { printops.use_unicode_signs = !enable_unicode; } if(interactive_mode) { if(save_mode_on_exit) { save_mode(); } else { save_preferences(); } if(save_defs_on_exit) { save_defs(); } } if(!view_thread->write(NULL)) view_thread->cancel(); if(command_thread->running && (!command_thread->write(0) || !command_thread->write(NULL))) command_thread->cancel(); CALCULATOR->terminateThreads(); } #ifdef HAVE_LIBREADLINE int rlcom_tab(int, int) { rl_complete_internal('!'); return 0; } #endif int countRows(const char *str, int cols) { int l = strlen(str); if(l == 0) return 1; int r = 1, c = 0; for(int i = 0; i < l; i++) { if(str[i] == '\033') { do { i++; } while(i < l && str[i] != 'm'); if(i >= l) break; } if(str[i] > 0 || (unsigned char) str[i] >= 0xC0) { if(str[i] == '\n') { r++; c = 0; } else { if(c == cols) { r++; c = 0; } c++; } } } return r; } int addLineBreaks(string &str, int cols, bool expr = false, size_t indent = 0, size_t result_start = 0) { if(cols <= 0) return 1; int r = 1; size_t c = 0; size_t lb_point = string::npos; size_t or_point = string::npos; int b_or = 0; if(expr && str.find("||") != string::npos) b_or = 2; else if(expr && str.find(_("or")) != string::npos) b_or = 1; for(size_t i = 0; i < str.length(); i++) { if(r != 1 && c == indent) { if(str[i] == ' ') { str.erase(i, 1); if(i < result_start) result_start--; if(i >= str.length()) break; } else if(expr && printops.use_unicode_signs && printops.digit_grouping != DIGIT_GROUPING_NONE && str[i] <= 0 && (unsigned char) str[i] >= 0xC0) { size_t l = 1; while(i + l < str.length() && str[i + l] <= 0 && (unsigned char) str[i + l] < 0xC0) l++; if(str.substr(i, l) == " ") { str.erase(i, l); if(i < result_start) result_start--; if(i >= str.length()) break; } } } if(str[i] == '\033') { do { i++; } while(i < str.length() && str[i] != 'm'); if(i >= str.length()) break; } if(str[i] > 0 || (unsigned char) str[i] >= 0xC0) { if(str[i] == '\n') { r++; c = 0; lb_point = string::npos; } else { if(c > indent) { if(is_in(" \t", str[i])) { if(!expr || printops.digit_grouping == DIGIT_GROUPING_NONE || i + 1 == str.length() || is_not_in("0123456789", str[i + 1]) || is_not_in("0123456789", str[i - 1])) { if(expr || (c - indent) > (cols - indent) / 2) lb_point = i; if(i > result_start && b_or == 1 && str.length() > i + strlen("or") + 2 && str.substr(i + 1, strlen(_("or"))) == _("or") && str[i + strlen(_("or")) + 1] == ' ') or_point = i + strlen(_("or")) + 1; else if(i > result_start && b_or == 2 && str.length() > i + 2 + 2 && str.substr(i + 1, 2) == "||" && str[i + 2 + 1] == ' ') or_point = i + 2 + 1; } } else if(expr && !printops.spacious && (c - indent) > (cols - indent) / 2 && c < (size_t) cols && is_in("+-*", str[i]) && i + 1 != str.length() && str[i - 1] != '^' && str[i - 1] != ' ' && str[i - 1] != '=' && is_not_in(" \t.;,", str[i + 1])) { lb_point = i + 1; } } if(c == (size_t) cols || or_point != string::npos) { if(or_point != string::npos) lb_point = or_point; if(lb_point == string::npos) { if(expr && printops.digit_grouping != DIGIT_GROUPING_NONE) { if(i > 3 && str[i] <= '9' && str[i] >= '0' && str[i - 1] <= '9' && str[i - 1] >= '0') { if(str[i - 2] == ' ' && str[i - 3] <= '9' && str[i - 3] >= '0') i -= 2; else if(str[i - 3] == ' ' && str[i - 4] <= '9' && str[i - 4] >= '0') i -= 3; else if((str[i - 2] == '.' || str[i - 2] == ',') && str[i - 3] <= '9' && str[i - 3] >= '0') i--; else if((str[i - 3] == '.' || str[i - 3] == ',') && str[i - 4] <= '9' && str[i - 4] >= '0') i -= 2; else if(printops.use_unicode_signs && i > 6) { size_t i2 = str.find(" ", i - 6); if(i2 != string::npos && i2 > 0 && i2 < i && str[i2 - 1] <= '9' && str[i2 - 1] >= '0') { i = i2; } } } else if(i > 4 && (str[i] == '.' || str[i] == ',') && str[i - 1] <= '9' && str[i - 1] >= '0' && str[i - 4] == str[i] && str[i - 5] <= '9' && str[i - 5] >= '0') { i -= 3; } } str.insert(i, "\n"); result_start++; for(size_t i2 = 0; i2 < indent; i2++) { i++; if(i < result_start) result_start++; str.insert(i, " "); } c = indent; } else if(str[lb_point] == ' ' || str[lb_point] == '\t') { str[lb_point] = '\n'; for(size_t i2 = 0; i2 < indent; i2++) { lb_point++; if(i < result_start) result_start++; str.insert(lb_point, " "); } i = lb_point; c = indent; } else { str.insert(lb_point, "\n"); result_start++; for(size_t i2 = 0; i2 < indent; i2++) { lb_point++; if(i < result_start) result_start++; str.insert(lb_point, " "); } i = lb_point; c = indent; } lb_point = string::npos; or_point = string::npos; r++; } else { if(str[i] == '\t') c += 8; else c++; } } } else if(expr && !printops.spacious && printops.use_unicode_signs && i + 1 < str.length() && (str[i + 1] > 0 || (unsigned char) str[i + 1] >= 0xC0)) { if(c > indent && (c - indent) > (cols - indent) / 2 && is_not_in(" \t.;,", str[i + 1])) { size_t index = i; while(index > 0 && str[index - 1] <= 0) { index--; if((unsigned char) str[index] >= 0xC0) break; } if(index > 0 && str[index - 1] != '^' && str[index - 1] != ' ' && str[index - 1] != '=') { string unichar = str.substr(index, i - index + 1); if(unichar == SIGN_MULTIPLICATION || unichar == SIGN_MULTIDOT || unichar == SIGN_MIDDLEDOT || unichar == SIGN_MULTIBULLET || unichar == SIGN_SMALLCIRCLE || unichar == SIGN_DIVISION_SLASH || unichar == SIGN_DIVISION || unichar == SIGN_MINUS || unichar == SIGN_PLUS) lb_point = i + 1; } } } } return r; } bool check_exchange_rates() { int i = CALCULATOR->exchangeRatesUsed(); if(i == 0) return false; if(CALCULATOR->checkExchangeRatesDate(auto_update_exchange_rates > 0 ? auto_update_exchange_rates : 7, false, auto_update_exchange_rates == 0 || (auto_update_exchange_rates < 0 && !ask_questions), i)) return false; if(auto_update_exchange_rates == 0 || (auto_update_exchange_rates < 0 && !ask_questions)) return false; bool b = false; if(auto_update_exchange_rates < 0) { char buffer[1000]; string ask_str; int cx = snprintf(buffer, 1000, _("It has been %s day(s) since the exchange rates last were updated."), i2s((int) floor(difftime(time(NULL), CALCULATOR->getExchangeRatesTime(i)) / 86400)).c_str()); if(cx >= 0 && cx < 1000) { ask_str = buffer; ask_str += "\n"; } ask_str += _("Do you wish to update the exchange rates now?"); b = ask_question(ask_str.c_str()); } if(b || auto_update_exchange_rates > 0) { if(auto_update_exchange_rates <= 0) i = -1; CALCULATOR->fetchExchangeRates(15, i); CALCULATOR->loadExchangeRates(); return true; } return false; } #ifdef HAVE_LIBREADLINE # define CHECK_IF_SCREEN_FILLED if(check_sf) {rcount++; if(rcount + 2 >= rows) {FPUTS_UNICODE(_("\nPress Enter to continue."), stdout); fflush(stdout); sf_c = rl_read_key(); if(sf_c != '\n') {check_sf = false;} else {puts(""); rcount = 1;}}} # define CHECK_IF_SCREEN_FILLED_PUTS_RP(x, rplus) {str_lb = x; int cr = 0; if(!cfile) {cr = addLineBreaks(str_lb, cols);} if(check_sf) {if(rcount + cr + 1 + rplus >= rows) {rcount += 2; while(rcount < rows) {puts(""); rcount++;} FPUTS_UNICODE(_("\nPress Enter to continue."), stdout); fflush(stdout); sf_c = rl_read_key(); if(sf_c != '\n') {check_sf = false;} else {rcount = 0; if(str_lb.empty() || str_lb[0] != '\n') {puts(""); rcount++;}}} if(check_sf) {rcount += cr;}} PUTS_UNICODE(str_lb.c_str());} # define CHECK_IF_SCREEN_FILLED_PUTS(x) CHECK_IF_SCREEN_FILLED_PUTS_RP(x, 0) # define INIT_SCREEN_CHECK int rows, cols, rcount = 0; bool check_sf = (cfile == NULL); char sf_c; string str_lb; if(!cfile) rl_get_screen_size(&rows, &cols); # define CHECK_IF_SCREEN_FILLED_HEADING_S(x) str = "\n"; if(!cfile) {str += "\033[4m";} str += x; if(!cfile) {str += "\033[0m";} CHECK_IF_SCREEN_FILLED_PUTS_RP(str.c_str(), 1); # define CHECK_IF_SCREEN_FILLED_HEADING(x) str = "\n"; if(!cfile) {str += "\033[4m"; str += "\033[1m";} str += x; if(!cfile) {str += "\033[0m"; str += "\033[0m";} CHECK_IF_SCREEN_FILLED_PUTS_RP(str.c_str(), 1); #else # define CHECK_IF_SCREEN_FILLED # define CHECK_IF_SCREEN_FILLED_PUTS(x) str_lb = x; if(!cfile) {addLineBreaks(str_lb, cols);} PUTS_UNICODE(str_lb.c_str()); # define INIT_SCREEN_CHECK string str_lb; int cols = 80; # define CHECK_IF_SCREEN_FILLED_HEADING_S(x) str = "\n"; if(!cfile) {str += "\033[4m";} str += x; if(!cfile) {str += "\033[0m";} PUTS_UNICODE(str.c_str()); # define CHECK_IF_SCREEN_FILLED_HEADING(x) puts(""); str = "\n"; if(!cfile) {str += "\033[4m"; str += "\033[1m";} str += x; if(!cfile) {str += "\033[0m"; str += "\033[0m";} PUTS_UNICODE(str.c_str()); #endif #define SET_BOOL(x) {int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else if(x != v) {x = v;}} #define SET_BOOL_D(x) {int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else if(x != v) {x = v; result_display_updated();}} #define SET_BOOL_E(x) {int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else if(x != v) {x = v; expression_calculation_updated();}} #define SET_BOOL_PV(x) {int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else if(x != v) {x = v; expression_format_updated(v);}} #define SET_BOOL_PT(x) {int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else if(x != v) {x = v; expression_format_updated(true);}} #define SET_BOOL_PF(x) {int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else if(x != v) {x = v; expression_format_updated(false);}} void set_option(string str) { remove_blank_ends(str); string svalue, svar; size_t i_underscore = str.find("_"); size_t index; if(i_underscore != string::npos) { index = str.find_first_of(SPACES); if(index != string::npos && i_underscore > index) i_underscore = string::npos; } if(i_underscore == string::npos) index = str.find_last_of(SPACES); if(index != string::npos) { svar = str.substr(0, index); remove_blank_ends(svar); svalue = str.substr(index + 1); remove_blank_ends(svalue); } else { svar = str; } if(i_underscore != string::npos) gsub("_", " ", svar); set_option_place: if(EQUALS_IGNORECASE_AND_LOCAL(svar, "base", _("base")) || EQUALS_IGNORECASE_AND_LOCAL(svar, "input base", _("input base")) || svar == "inbase" || EQUALS_IGNORECASE_AND_LOCAL(svar, "output base", _("output base")) || svar == "outbase") { int v = 0; bool b_in = EQUALS_IGNORECASE_AND_LOCAL(svar, "input base", _("input base")) || svar == "inbase"; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "roman", _("roman"))) v = BASE_ROMAN_NUMERALS; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "time", _("time"))) {if(b_in) v = 0; else v = BASE_TIME;} else if(equalsIgnoreCase(svalue, "hex") || EQUALS_IGNORECASE_AND_LOCAL(svalue, "hexadecimal", _("hexadecimal"))) v = BASE_HEXADECIMAL; else if(equalsIgnoreCase(svalue, "duo") || EQUALS_IGNORECASE_AND_LOCAL(svalue, "duodecimal", _("duodecimal"))) v = 12; else if(equalsIgnoreCase(svalue, "bin") || EQUALS_IGNORECASE_AND_LOCAL(svalue, "binary", _("binary"))) v = BASE_BINARY; else if(equalsIgnoreCase(svalue, "oct") || EQUALS_IGNORECASE_AND_LOCAL(svalue, "octal", _("octal"))) v = BASE_OCTAL; else if(equalsIgnoreCase(svalue, "dec") || EQUALS_IGNORECASE_AND_LOCAL(svalue, "decimal", _("decimal"))) v = BASE_DECIMAL; else if(equalsIgnoreCase(svalue, "sexa") || EQUALS_IGNORECASE_AND_LOCAL(svalue, "sexagesimal", _("sexagesimal"))) {if(b_in) v = 0; else v = BASE_SEXAGESIMAL;} else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); if((v < 2 || v > 36) && (b_in || v != 60)) { v = 0; } } if(v == 0) { if((index = svalue.find_first_of(SPACES)) != string::npos) { str = svalue; svalue = str.substr(index + 1, str.length() - (index + 1)); remove_blank_ends(svalue); svar += " "; str = str.substr(0, index); remove_blank_ends(str); svar += str; gsub("_", " ", svar); if(EQUALS_IGNORECASE_AND_LOCAL(svar, "base display", _("base display"))) { goto set_option_place; } } PUTS_UNICODE(_("Illegal base.")); } else if(b_in) { evalops.parse_options.base = v; expression_format_updated(false); } else { printops.base = v; result_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "assumptions", _("assumptions")) || svar == "ass") { size_t i = svalue.find_first_of(SPACES); if(i != string::npos) { set_assumption(svalue.substr(0, i), false); set_assumption(svalue.substr(i + 1, svalue.length() - (i + 1)), true); } else { set_assumption(svalue, false); } string value; switch(CALCULATOR->defaultAssumptions()->sign()) { case ASSUMPTION_SIGN_POSITIVE: {value = _("positive"); break;} case ASSUMPTION_SIGN_NONPOSITIVE: {value = _("non-positive"); break;} case ASSUMPTION_SIGN_NEGATIVE: {value = _("negative"); break;} case ASSUMPTION_SIGN_NONNEGATIVE: {value = _("non-negative"); break;} case ASSUMPTION_SIGN_NONZERO: {value = _("non-zero"); break;} default: {} } if(!value.empty() && CALCULATOR->defaultAssumptions()->type() != ASSUMPTION_TYPE_NONE) value += " "; switch(CALCULATOR->defaultAssumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: {value += _("integer"); break;} case ASSUMPTION_TYPE_RATIONAL: {value += _("rational"); break;} case ASSUMPTION_TYPE_REAL: {value += _("real"); break;} case ASSUMPTION_TYPE_COMPLEX: {value += _("complex"); break;} case ASSUMPTION_TYPE_NUMBER: {value += _("number"); break;} case ASSUMPTION_TYPE_NONMATRIX: {value += _("non-matrix"); break;} default: {} } if(value.empty()) value = _("unknown"); FPUTS_UNICODE(_("assumptions"), stdout); fputs(": ", stdout); PUTS_UNICODE(value.c_str()); expression_calculation_updated(); } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "all prefixes", _("all prefixes")) || svar == "allpref") SET_BOOL_D(printops.use_all_prefixes) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "complex numbers", _("complex numbers")) || svar == "cplx") SET_BOOL_E(evalops.allow_complex) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "excessive parentheses", _("excessive parentheses")) || svar == "expar") SET_BOOL_D(printops.excessive_parenthesis) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "functions", _("functions")) || svar == "func") SET_BOOL_PV(evalops.parse_options.functions_enabled) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "infinite numbers", _("infinite numbers")) || svar == "inf") SET_BOOL_E(evalops.allow_infinite) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "show negative exponents", _("show negative exponents")) || svar == "negexp") SET_BOOL_D(printops.negative_exponents) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "assume nonzero denominators", _("assume nonzero denominators")) || svar == "nzd") SET_BOOL_E(evalops.assume_denominators_nonzero) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "warn nonzero denominators", _("warn nonzero denominators")) || svar == "warnnzd") SET_BOOL_E(evalops.warn_about_denominators_assumed_nonzero) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "prefixes", _("prefixes")) || svar == "pref") SET_BOOL_D(printops.use_unit_prefixes) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "denominator prefixes", _("denominator prefixes")) || svar == "denpref") SET_BOOL_D(printops.use_denominator_prefix) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "place units separately", _("place units separately")) || svar == "unitsep") SET_BOOL_D(printops.place_units_separately) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "calculate variables", _("calculate variables")) || svar == "calcvar") SET_BOOL_E(evalops.calculate_variables) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "calculate functions", _("calculate functions")) || svar == "calcfunc") SET_BOOL_E(evalops.calculate_functions) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "sync units", _("sync units")) || svar == "sync") SET_BOOL_E(evalops.sync_units) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "round to even", _("round to even")) || svar == "rndeven") SET_BOOL_D(printops.round_halfway_to_even) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "rpn syntax", _("rpn syntax")) || svar == "rpnsyn") SET_BOOL_PF(evalops.parse_options.rpn) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "rpn", _("rpn")) && svalue.find(" ") == string::npos) {SET_BOOL(rpn_mode) if(!rpn_mode) CALCULATOR->clearRPNStack();} else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "short multiplication", _("short multiplication")) || svar == "shortmul") SET_BOOL_D(printops.short_multiplication) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "lowercase e", _("lowercase e")) || svar == "lowe") SET_BOOL_D(printops.lower_case_e) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "lowercase numbers", _("lowercase numbers")) || svar == "lownum") SET_BOOL_D(printops.lower_case_numbers) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "base display", _("base display")) || svar == "basedisp") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "none", _("none"))) v = BASE_DISPLAY_NONE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "normal", _("normal"))) v = BASE_DISPLAY_NORMAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "alternative", _("alternative"))) v = BASE_DISPLAY_ALTERNATIVE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { printops.base_display = (BaseDisplay) v; result_display_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "two's complement", _("two's complement")) || svar == "twos") SET_BOOL_D(printops.twos_complement) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "digit grouping", _("digit grouping")) || svar =="group") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = DIGIT_GROUPING_NONE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "none", _("none"))) v = DIGIT_GROUPING_NONE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "standard", _("standard")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "on", _("on"))) v = DIGIT_GROUPING_STANDARD; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "locale", _("locale"))) v = DIGIT_GROUPING_LOCALE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < DIGIT_GROUPING_NONE || v > DIGIT_GROUPING_LOCALE) { PUTS_UNICODE(_("Illegal value.")); } else { printops.digit_grouping = (DigitGrouping) v; result_display_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "spell out logical", _("spell out logical")) || svar == "spellout") SET_BOOL_D(printops.spell_out_logical_operators) else if((EQUALS_IGNORECASE_AND_LOCAL(svar, "ignore dot", _("ignore dot")) || svar == "nodot") && CALCULATOR->getDecimalPoint() != DOT) SET_BOOL_PF(evalops.parse_options.dot_as_separator) else if((EQUALS_IGNORECASE_AND_LOCAL(svar, "ignore comma", _("ignore comma")) || svar == "nocomma") && CALCULATOR->getDecimalPoint() != COMMA) { SET_BOOL(evalops.parse_options.comma_as_separator) CALCULATOR->useDecimalPoint(evalops.parse_options.comma_as_separator); expression_format_updated(false); } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "decimal comma", _("decimal comma"))) { int v = -2; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = 0; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "on", _("on"))) v = 1; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "locale", _("locale"))) v = -1; else if(svalue.find_first_not_of(SPACES MINUS NUMBERS) == string::npos) { v = s2i(svalue); } if(v < -1 || v > 1) { PUTS_UNICODE(_("Illegal value.")); } else { b_decimal_comma = v; if(b_decimal_comma > 0) CALCULATOR->useDecimalComma(); else if(b_decimal_comma == 0) CALCULATOR->useDecimalPoint(evalops.parse_options.comma_as_separator); if(v >= 0) { expression_format_updated(false); result_display_updated(); } } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "limit implicit multiplication", _("limit implicit multiplication")) || svar == "limimpl") { int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else {printops.limit_implicit_multiplication = v; evalops.parse_options.limit_implicit_multiplication = v; expression_format_updated(true);} } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "spacious", _("spacious")) || svar == "space") SET_BOOL_D(printops.spacious) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "unicode", _("unicode")) || svar == "uni") { int v = s2b(svalue); if(v < 0) {PUTS_UNICODE(_("Illegal value"));} else {printops.use_unicode_signs = v; result_display_updated();} enable_unicode = -1; } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "units", _("units")) || svar == "unit") SET_BOOL_PV(evalops.parse_options.units_enabled) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "unknowns", _("unknowns")) || svar == "unknown") SET_BOOL_PV(evalops.parse_options.unknowns_enabled) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "variables", _("variables")) || svar == "var") SET_BOOL_PV(evalops.parse_options.variables_enabled) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "abbreviations", _("abbreviations")) || svar == "abbr" || svar == "abbrev") SET_BOOL_D(printops.abbreviate_names) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "show ending zeroes", _("show ending zeroes")) || svar == "zeroes") SET_BOOL_D(printops.show_ending_zeroes) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "repeating decimals", _("repeating decimals")) || svar == "repdeci") SET_BOOL_D(printops.indicate_infinite_series) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "angle unit", _("angle unit")) || svar == "angle") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "rad", _("rad")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "radians", _("radians"))) v = ANGLE_UNIT_RADIANS; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "deg", _("deg")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "degrees", _("degrees"))) v = ANGLE_UNIT_DEGREES; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "gra", _("gra")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "gradians", _("gradians"))) v = ANGLE_UNIT_GRADIANS; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "none", _("none"))) v = ANGLE_UNIT_NONE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 3) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.parse_options.angle_unit = (AngleUnit) v; hide_parse_errors = true; expression_format_updated(true); hide_parse_errors = false; } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "parsing mode", _("parsing mode")) || svar == "parse") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "adaptive", _("adaptive"))) v = PARSING_MODE_ADAPTIVE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "implicit first", _("implicit first"))) v = PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "conventional", _("conventional"))) v = PARSING_MODE_CONVENTIONAL; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.parse_options.parsing_mode = (ParsingMode) v; expression_format_updated(true); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "update exchange rates", _("update exchange rates")) || svar == "upxrates") { if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "never", _("never"))) { auto_update_exchange_rates = 0; } else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "ask", _("ask"))) { auto_update_exchange_rates = -1; } else { int v = s2i(svalue); if(v < 0) auto_update_exchange_rates = -1; else auto_update_exchange_rates = v; } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "multiplication sign", _("multiplication sign")) || svar == "mulsign") { int v = -1; if(svalue == SIGN_MULTIDOT || svalue == ".") v = MULTIPLICATION_SIGN_DOT; else if(svalue == SIGN_MULTIPLICATION || svalue == "x") v = MULTIPLICATION_SIGN_X; else if(svalue == "*") v = MULTIPLICATION_SIGN_ASTERISK; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { printops.multiplication_sign = (MultiplicationSign) v; result_display_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "division sign", _("division sign")) || svar == "divsign") { int v = -1; if(svalue == SIGN_DIVISION_SLASH) v = DIVISION_SIGN_DIVISION_SLASH; else if(svalue == SIGN_DIVISION) v = DIVISION_SIGN_DIVISION; else if(svalue == "/") v = DIVISION_SIGN_SLASH; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { printops.division_sign = (DivisionSign) v; result_display_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "approximation", _("approximation")) || svar == "appr" || svar == "approx") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "exact", _("exact"))) v = APPROXIMATION_EXACT; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "try exact", _("try exact")) || svalue == "try") v = APPROXIMATION_TRY_EXACT; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "approximate", _("approximate")) || svalue == "approx") v = APPROXIMATION_APPROXIMATE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.approximation = (ApproximationMode) v; expression_calculation_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "autoconversion", _("autoconversion")) || svar == "conv") { int v = -1; MixedUnitsConversion muc = MIXED_UNITS_CONVERSION_DEFAULT; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "none", _("none"))) {v = POST_CONVERSION_NONE; muc = MIXED_UNITS_CONVERSION_NONE;} else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "best", _("best"))) v = POST_CONVERSION_OPTIMAL_SI; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "optimalsi", _("optimalsi")) || svalue == "si") v = POST_CONVERSION_OPTIMAL_SI; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "optimal", _("optimal"))) v = POST_CONVERSION_OPTIMAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "base", _("base"))) v = POST_CONVERSION_BASE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "mixed", _("mixed"))) v = POST_CONVERSION_NONE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v == POST_CONVERSION_OPTIMAL + 1) { v = POST_CONVERSION_NONE; muc = MIXED_UNITS_CONVERSION_DEFAULT; } if(v < 0 || v > POST_CONVERSION_OPTIMAL) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.auto_post_conversion = (AutoPostConversion) v; evalops.mixed_units_conversion = muc; expression_calculation_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "currency conversion", _("currency conversion")) || svar == "curconv") SET_BOOL_E(evalops.local_currency_conversion) else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "algebra mode", _("algebra mode")) || svar == "alg") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "none", _("none"))) v = STRUCTURING_NONE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "simplify", _("simplify"))) v = STRUCTURING_SIMPLIFY; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "factorize", _("factorize")) || svalue == "factor") v = STRUCTURING_FACTORIZE; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > STRUCTURING_FACTORIZE) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.structuring = (StructuringMode) v; printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); expression_calculation_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "exact", _("exact"))) { int v = s2b(svalue); if(v < 0) { PUTS_UNICODE(_("Illegal value")); } else if(v > 0) { evalops.approximation = APPROXIMATION_EXACT; expression_calculation_updated(); } else { evalops.approximation = APPROXIMATION_TRY_EXACT; expression_calculation_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "save mode", _("save mode"))) { int v = s2b(svalue); if(v < 0) { PUTS_UNICODE(_("Illegal value")); } else if(v > 0) { save_mode_on_exit = true; } else { save_mode_on_exit = false; } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "save definitions", _("save definitions")) || svar == "save defs") { int v = s2b(svalue); if(v < 0) { PUTS_UNICODE(_("Illegal value")); } else if(v > 0) { save_defs_on_exit = true; } else { save_defs_on_exit = false; } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "scientific notation", _("scientific notation")) || svar == "exp mode" || svar == "exp") { int v = -1; bool valid = true; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = EXP_NONE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "auto", _("auto"))) v = EXP_PRECISION; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "pure", _("pure"))) v = EXP_PURE; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "scientific", _("scientific"))) v = EXP_SCIENTIFIC; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "engineering", _("engineering"))) v = EXP_BASE_3; else if(svalue.find_first_not_of(SPACES NUMBERS MINUS) == string::npos) v = s2i(svalue); else valid = false; if(valid) { printops.min_exp = v; result_format_updated(); } else { PUTS_UNICODE(_("Illegal value.")); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "precision", _("precision")) || svar == "prec") { int v = 0; if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) v = s2i(svalue); if(v < 1) { PUTS_UNICODE(_("Illegal value.")); } else { CALCULATOR->setPrecision(v); expression_calculation_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "interval display", _("interval display")) || svar == "ivdisp") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "adaptive", _("adaptive"))) v = 0; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "significant", _("significant"))) v = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS + 1; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "interval", _("interval"))) v = INTERVAL_DISPLAY_INTERVAL + 1; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "plusminus", _("plusminus"))) v = INTERVAL_DISPLAY_PLUSMINUS + 1; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "midpoint", _("midpoint"))) v = INTERVAL_DISPLAY_MIDPOINT + 1; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "upper", _("upper"))) v = INTERVAL_DISPLAY_UPPER + 1; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "lower", _("lower"))) v = INTERVAL_DISPLAY_LOWER + 1; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v == 0) { adaptive_interval_display = true; printops.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; result_format_updated(); } else { v--; if(v < INTERVAL_DISPLAY_SIGNIFICANT_DIGITS || v > INTERVAL_DISPLAY_UPPER) { PUTS_UNICODE(_("Illegal value.")); } else { adaptive_interval_display = false; printops.interval_display = (IntervalDisplay) v; result_format_updated(); } } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "interval arithmetic", _("interval arithmetic")) || svar == "iv" || svar == "ia" || svar == "interval") { bool b = CALCULATOR->usesIntervalArithmetic(); SET_BOOL(b) if(b != CALCULATOR->usesIntervalArithmetic()) { CALCULATOR->useIntervalArithmetic(b); expression_calculation_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "variable units", _("variable units")) || svar == "varunits") { bool b = CALCULATOR->variableUnitsEnabled(); SET_BOOL(b) if(b != CALCULATOR->variableUnitsEnabled()) { CALCULATOR->setVariableUnitsEnabled(b); expression_calculation_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "max decimals", _("max decimals")) || svar == "maxdeci") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = -1; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) v = s2i(svalue); if(v < 0) { printops.use_max_decimals = false; result_format_updated(); } else { printops.max_decimals = v; printops.use_max_decimals = true; result_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "min decimals", _("min decimals")) || svar == "mindeci") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = -1; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) v = s2i(svalue); if(v < 0) { printops.min_decimals = 0; printops.use_min_decimals = false; result_format_updated(); } else { printops.min_decimals = v; printops.use_min_decimals = true; result_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "fractions", _("fractions")) || svar == "fr") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = FRACTION_DECIMAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "exact", _("exact"))) v = FRACTION_DECIMAL_EXACT; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "on", _("on"))) v = FRACTION_FRACTIONAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "combined", _("combined"))) v = FRACTION_COMBINED; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "long", _("long"))) v = FRACTION_COMBINED + 1; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > FRACTION_COMBINED + 1) { PUTS_UNICODE(_("Illegal value.")); } else { printops.restrict_fraction_length = (v == FRACTION_FRACTIONAL); if(v == 4) v = FRACTION_FRACTIONAL; printops.number_fraction_format = (NumberFractionFormat) v; result_format_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "complex form", _("complex form")) || svar == "cplxform") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "rectangular", _("rectangular")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "cartesian", _("cartesian")) || svalue == "rect") v = COMPLEX_NUMBER_FORM_RECTANGULAR; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "exponential", _("exponential")) || svalue == "exp") v = COMPLEX_NUMBER_FORM_EXPONENTIAL; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "polar", _("polar"))) v = COMPLEX_NUMBER_FORM_POLAR; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.complex_number_form = (ComplexNumberForm) v; expression_calculation_updated(); } } else if(EQUALS_IGNORECASE_AND_LOCAL(svar, "read precision", _("read precision")) || svar == "readprec") { int v = -1; if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "off", _("off"))) v = DONT_READ_PRECISION; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "always", _("always"))) v = ALWAYS_READ_PRECISION; else if(EQUALS_IGNORECASE_AND_LOCAL(svalue, "when decimals", _("when decimals")) || EQUALS_IGNORECASE_AND_LOCAL(svalue, "on", _("on"))) v = READ_PRECISION_WHEN_DECIMALS; else if(svalue.find_first_not_of(SPACES NUMBERS) == string::npos) { v = s2i(svalue); } if(v < 0 || v > 2) { PUTS_UNICODE(_("Illegal value.")); } else { evalops.parse_options.read_precision = (ReadPrecisionMode) v; expression_format_updated(true); } } else { if(i_underscore == string::npos && index != string::npos) { if((index = svar.find_last_of(SPACES)) != string::npos) { svar = svar.substr(0, index); remove_blank_ends(svar); str = str.substr(index + 1); remove_blank_ends(str); svalue = str; gsub("_", " ", svar); goto set_option_place; } } PUTS_UNICODE(_("Unrecognized option.")); } } #define STR_AND_TABS(x) str = x; pctl = unicode_length(str); if(pctl >= 32) {str += "\t";} else if(pctl >= 24) {str += "\t\t";} else if(pctl >= 16) {str += "\t\t\t";} else if(pctl >= 8) {str += "\t\t\t\t";} else {str += "\t\t\t\t\t";} #define STR_AND_TABS_T1(x) str = x; pctl = unicode_length(str); str += "\t"; #define STR_AND_TABS_T2(x) str = x; pctl = unicode_length(str); if(pctl >= 8) {str += "\t";} else {str += "\t\t";} #define STR_AND_TABS_T3(x) str = x; pctl = unicode_length(str); if(pctl >= 16) {str += "\t";} else if(pctl >= 8) {str += "\t\t";} else {str += "\t\t\t";} #define STR_AND_TABS_T4(x) str = x; pctl = unicode_length(str); if(pctl >= 24) {str += "\t";} else if(pctl >= 16) {str += "\t\t";} else if(pctl >= 8) {str += "\t\t\t";} else {str += "\t\t\t\t";} #define PUTS_BOLD(x) if(cfile) {str = x;} else {str = "\033[1m"; str += x; str += "\033[0m";} PUTS_UNICODE(str.c_str()); #define PUTS_UNDERLINED(x) if(cfile) {str = x;} else {str = "\033[4m"; str += x; str += "\033[0m";} PUTS_UNICODE(str.c_str()); bool equalsIgnoreCase(const string &str1, const string &str2, size_t i2, size_t i2_end, size_t minlength) { if(str1.empty() || str2.empty()) return false; size_t l = 0; if(i2_end == string::npos) i2_end = str2.length(); for(size_t i1 = 0;; i1++, i2++) { if(i2 >= i2_end) { return i1 >= str1.length(); } if(i1 >= str1.length()) break; if((str1[i1] < 0 && i1 + 1 < str1.length()) || (str2[i2] < 0 && i2 + 1 < str2.length())) { size_t iu1 = 1, iu2 = 1; if(str1[i1] < 0) { while(iu1 + i1 < str1.length() && str1[i1 + iu1] < 0) { iu1++; } } if(str2[i2] < 0) { while(iu2 + i2 < str2.length() && str2[i2 + iu2] < 0) { iu2++; } } bool isequal = (iu1 == iu2); if(isequal) { for(size_t i = 0; i < iu1; i++) { if(str1[i1 + i] != str2[i2 + i]) { isequal = false; break; } } } if(!isequal) { char *gstr1 = utf8_strdown(str1.c_str() + (sizeof(char) * i1), iu1); char *gstr2 = utf8_strdown(str2.c_str() + (sizeof(char) * i2), iu2); if(!gstr1 || !gstr2) return false; bool b = strcmp(gstr1, gstr2) == 0; free(gstr1); free(gstr2); if(!b) return false; } i1 += iu1 - 1; i2 += iu2 - 1; } else if(str1[i1] != str2[i2] && !((str1[i1] >= 'a' && str1[i1] <= 'z') && str1[i1] - 32 == str2[i2]) && !((str1[i1] <= 'Z' && str1[i1] >= 'A') && str1[i1] + 32 == str2[i2])) { return false; } l++; } return l >= minlength; } bool title_matches(ExpressionItem *item, const string &str, size_t minlength = 0) { const string &title = item->title(true); size_t i = 0; while(true) { while(true) { if(i >= title.length()) return false; if(title[i] != ' ') break; i++; } size_t i2 = title.find(' ', i); if(equalsIgnoreCase(str, title, i, i2, minlength)) { return true; } if(i2 == string::npos) break; i = i2 + 1; } return false; } bool name_matches(ExpressionItem *item, const string &str) { for(size_t i2 = 1; i2 <= item->countNames(); i2++) { if(item->getName(i2).case_sensitive) { if(str == item->getName(i2).name.substr(0, str.length())) { return true; } } else { if(equalsIgnoreCase(str, item->getName(i2).name, 0, str.length(), 0)) { return true; } } } return false; } bool country_matches(Unit *u, const string &str, size_t minlength = 0) { const string &countries = u->countries(); size_t i = 0; while(true) { while(true) { if(i >= countries.length()) return false; if(countries[i] != ' ') break; i++; } size_t i2 = countries.find(',', i); if(equalsIgnoreCase(str, countries, i, i2, minlength)) { return true; } if(i2 == string::npos) break; i = i2 + 1; } return false; } void show_calendars(const QalculateDateTime &date, bool indentation = true) { string str, calstr; int pctl; bool b_fail; long int y, m, d; STR_AND_TABS((indentation ? string(" ") + _("Calendar") : _("Calendar"))); str += _("Day"); str += ", "; str += _("Month"); str += ", "; str += _("Year"); PUTS_UNICODE(str.c_str()); #define PUTS_CALENDAR(x, c) calstr = ""; if(!cfile) {calstr += "\033[1m";} STR_AND_TABS((indentation ? string(" ") + x : x)); calstr += str; if(!cfile) {calstr += "\033[0m";} b_fail = !dateToCalendar(date, y, m, d, c); if(b_fail) {calstr += _("failed");} else {calstr += i2s(d); calstr += " "; calstr += monthName(m, c, true); calstr += " "; calstr += i2s(y);} FPUTS_UNICODE(calstr.c_str(), stdout); PUTS_CALENDAR(string(_("Gregorian:")), CALENDAR_GREGORIAN); puts(""); PUTS_CALENDAR(string(_("Hebrew:")), CALENDAR_HEBREW); puts(""); PUTS_CALENDAR(string(_("Islamic:")), CALENDAR_ISLAMIC); puts(""); PUTS_CALENDAR(string(_("Persian:")), CALENDAR_PERSIAN); puts(""); PUTS_CALENDAR(string(_("Indian national:")), CALENDAR_INDIAN); puts(""); PUTS_CALENDAR(string(_("Chinese:")), CALENDAR_CHINESE); long int cy, yc, st, br; chineseYearInfo(y, cy, yc, st, br); if(!b_fail) {FPUTS_UNICODE((string(" (") + chineseStemName(st) + string(" ") + chineseBranchName(br) + ")").c_str(), stdout);} puts(""); PUTS_CALENDAR(string(_("Julian:")), CALENDAR_JULIAN); puts(""); PUTS_CALENDAR(string(_("Revised julian:")), CALENDAR_MILANKOVIC); puts(""); PUTS_CALENDAR(string(_("Coptic:")), CALENDAR_COPTIC); puts(""); PUTS_CALENDAR(string(_("Ethiopian:")), CALENDAR_ETHIOPIAN); puts(""); //PUTS_CALENDAR(string(_("Egyptian:")), CALENDAR_EGYPTIAN); } void list_defs(bool in_interactive, char list_type = 0, string search_str = "") { #ifdef HAVE_LIBREADLINE int rows, cols, rcount = 0; bool check_sf = (cfile == NULL); char sf_c; if(in_interactive && !cfile) { rl_get_screen_size(&rows, &cols); } else { cols = 80; } #else int cols = 80; #endif string str_lb; string str; if(!search_str.empty()) { int max_l = 0; list name_list; int i_end = 0; size_t i2 = 0; if(list_type == 'v') i2 = 1; else if(list_type == 'u' || list_type == 'c') i2 = 2; for(; i2 <= 2; i2++) { if(i2 == 0) i_end = CALCULATOR->functions.size(); else if(i2 == 1) i_end = CALCULATOR->variables.size(); else if(i2 == 2) i_end = CALCULATOR->units.size(); ExpressionItem *item = NULL; string name_str, name_str2; for(int i = 0; i < i_end; i++) { if(i2 == 0) item = CALCULATOR->functions[i]; else if(i2 == 1) item = CALCULATOR->variables[i]; else if(i2 == 2) item = CALCULATOR->units[i]; if((!item->isHidden() || (i2 == 2 && ((Unit*) item)->isCurrency())) && item->isActive() && (i2 != 2 || (item->subtype() != SUBTYPE_COMPOSITE_UNIT)) && (list_type != 'c' || ((Unit*) item)->isCurrency())) { bool b_match = name_matches(item, search_str); if(!b_match && title_matches(item, search_str, list_type == 'c' ? 0 : 3)) b_match = true; if(!b_match && i2 == 2 && country_matches((Unit*) item, search_str, list_type == 'c' ? 0 : 3)) b_match = true; if(b_match) { const ExpressionName &ename1 = item->preferredInputName(false, false); name_str = ename1.name; size_t name_i = 1; while(true) { const ExpressionName &ename = item->getName(name_i); if(ename == empty_expression_name) break; if(ename != ename1 && !ename.avoid_input && !ename.plural && (!ename.unicode || printops.use_unicode_signs) && !ename.completion_only) { name_str += " / "; name_str += ename.name; } name_i++; } if(!item->title(false).empty()) { name_str += " ("; name_str += item->title(false); name_str += ")"; } if((int) name_str.length() > max_l) max_l = name_str.length(); name_list.push_front(name_str); } } } if(list_type != 0) break; } name_list.sort(); list::iterator it = name_list.begin(); list::iterator it_e = name_list.end(); int c = 0; int max_tabs = (max_l / 8) + 1; int max_c = cols / (max_tabs * 8); if(cfile) max_c = 0; while(it != it_e) { c++; if(c >= max_c) { c = 0; if(max_c == 1 && in_interactive) {CHECK_IF_SCREEN_FILLED} PUTS_UNICODE(it->c_str()); } else { if(c == 1 && in_interactive) {CHECK_IF_SCREEN_FILLED} int l = unicode_length_check(it->c_str()); int nr_of_tabs = max_tabs - (l / 8); for(int tab_nr = 0; tab_nr < nr_of_tabs; tab_nr++) { *it += "\t"; } FPUTS_UNICODE(it->c_str(), stdout); } ++it; } if(c > 0) puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} if(in_interactive) {CHECK_IF_SCREEN_FILLED_PUTS(_("For more information about a specific function, variable or unit, please use the info command (in interactive mode)."));} else {PUTS_UNICODE(_("For more information about a specific function, variable or unit, please use the info command (in interactive mode)."));} puts(""); } else if(list_type == 0) { puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED;} bool b_variables = false, b_functions = false, b_units = false; for(size_t i = 0; i < CALCULATOR->variables.size(); i++) { Variable *v = CALCULATOR->variables[i]; if((v->isLocal() || v->hasChanged()) && v->isActive() && (!is_answer_variable(v) || !v->representsUndefined())) { int pctl; if(!b_variables) { b_variables = true; PUTS_BOLD(_("Variables:")); if(in_interactive) {CHECK_IF_SCREEN_FILLED} STR_AND_TABS(_("Name")) str += _("Value"); PUTS_UNICODE(str.c_str()); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } STR_AND_TABS(v->preferredInputName(false, false).name.c_str()) FPUTS_UNICODE(str.c_str(), stdout); string value; if(v->isKnown()) { if(((KnownVariable*) v)->isExpression()) { value = CALCULATOR->localizeExpression(((KnownVariable*) v)->expression()); if(!((KnownVariable*) v)->uncertainty().empty()) { value += "±"; value += CALCULATOR->localizeExpression(((KnownVariable*) v)->uncertainty()); } if(!((KnownVariable*) v)->unit().empty()) { value += " "; value += CALCULATOR->localizeExpression(((KnownVariable*) v)->unit()); } if(value.length() > 40) { value = value.substr(0, 30); value += "..."; } } else { if(((KnownVariable*) v)->get().isMatrix()) { value = _("matrix"); } else if(((KnownVariable*) v)->get().isVector()) { value = _("vector"); } else { PrintOptions po; po.interval_display = INTERVAL_DISPLAY_PLUSMINUS; value = CALCULATOR->print(((KnownVariable*) v)->get(), 30, po); } } } else { if(((UnknownVariable*) v)->assumptions()) { switch(((UnknownVariable*) v)->assumptions()->sign()) { case ASSUMPTION_SIGN_POSITIVE: {value = _("positive"); break;} case ASSUMPTION_SIGN_NONPOSITIVE: {value = _("non-positive"); break;} case ASSUMPTION_SIGN_NEGATIVE: {value = _("negative"); break;} case ASSUMPTION_SIGN_NONNEGATIVE: {value = _("non-negative"); break;} case ASSUMPTION_SIGN_NONZERO: {value = _("non-zero"); break;} default: {} } if(!value.empty() && ((UnknownVariable*) v)->assumptions()->type() != ASSUMPTION_TYPE_NONE) value += " "; switch(((UnknownVariable*) v)->assumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: {value += _("integer"); break;} case ASSUMPTION_TYPE_RATIONAL: {value += _("rational"); break;} case ASSUMPTION_TYPE_REAL: {value += _("real"); break;} case ASSUMPTION_TYPE_COMPLEX: {value += _("complex"); break;} case ASSUMPTION_TYPE_NUMBER: {value += _("number"); break;} case ASSUMPTION_TYPE_NONMATRIX: {value += _("non-matrix"); break;} default: {} } if(value.empty()) value = _("unknown"); } else { value = _("default assumptions"); } } FPUTS_UNICODE(value.c_str(), stdout); if(v->isApproximate()) { fputs(" (", stdout); FPUTS_UNICODE(_("approximate"), stdout); fputs(")", stdout); } puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } } for(size_t i = 0; i < CALCULATOR->functions.size(); i++) { MathFunction *f = CALCULATOR->functions[i]; if((f->isLocal() || f->hasChanged()) && f->isActive()) { if(!b_functions) { if(b_variables) puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} if(in_interactive) {CHECK_IF_SCREEN_FILLED} b_functions = true; PUTS_BOLD(_("Functions:")); } puts(f->preferredInputName(false, false).name.c_str()); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } } for(size_t i = 0; i < CALCULATOR->units.size(); i++) { Unit *u = CALCULATOR->units[i]; if((u->isLocal() || u->hasChanged()) && u->isActive()) { if(!b_units) { if(b_variables || b_functions) puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} if(in_interactive) {CHECK_IF_SCREEN_FILLED} b_units = true; PUTS_BOLD(_("Units:")); } puts(u->preferredInputName(false, false).name.c_str()); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } } if(!b_variables && !b_functions && !b_units) { puts(_("No local variables, functions or units have been defined.")); if(in_interactive) {CHECK_IF_SCREEN_FILLED} } puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} if(in_interactive) {CHECK_IF_SCREEN_FILLED_PUTS(_("For more information about a specific function, variable or unit, please use the info command (in interactive mode)."));} else {PUTS_UNICODE(_("For more information about a specific function, variable or unit, please use the info command (in interactive mode)."));} puts(""); } else { int max_l = 0; list name_list; int i_end = 0; if(list_type == 'f') i_end = CALCULATOR->functions.size(); if(list_type == 'v') i_end = CALCULATOR->variables.size(); if(list_type == 'u') i_end = CALCULATOR->units.size(); if(list_type == 'c') i_end = CALCULATOR->units.size(); ExpressionItem *item = NULL; string name_str, name_str2; for(int i = 0; i < i_end; i++) { if(list_type == 'f') item = CALCULATOR->functions[i]; if(list_type == 'v') item = CALCULATOR->variables[i]; if(list_type == 'u') item = CALCULATOR->units[i]; if(list_type == 'c') item = CALCULATOR->units[i]; if((!item->isHidden() || list_type == 'c') && item->isActive() && (list_type != 'u' || (item->subtype() != SUBTYPE_COMPOSITE_UNIT && ((Unit*) item)->baseUnit() != CALCULATOR->u_euro)) && (list_type != 'c' || ((Unit*) item)->isCurrency())) { const ExpressionName &ename1 = item->preferredInputName(false, false); name_str = ename1.name; size_t name_i = 1; while(true) { const ExpressionName &ename = item->getName(name_i); if(ename == empty_expression_name) break; if(ename != ename1 && !ename.avoid_input && !ename.plural && (!ename.unicode || printops.use_unicode_signs) && !ename.completion_only) { name_str += " / "; name_str += ename.name; } name_i++; } if(list_type == 'c' && !item->title(false).empty()) { name_str += " ("; name_str += item->title(false); name_str += ")"; } if((int) name_str.length() > max_l) max_l = name_str.length(); name_list.push_front(name_str); } } name_list.sort(); list::iterator it = name_list.begin(); list::iterator it_e = name_list.end(); int c = 0; int max_tabs = (max_l / 8) + 1; int max_c = cols / (max_tabs * 8); if(cfile) max_c = 0; while(it != it_e) { c++; if(c >= max_c) { c = 0; if(max_c == 1 && in_interactive) {CHECK_IF_SCREEN_FILLED} PUTS_UNICODE(it->c_str()); } else { if(c == 1 && in_interactive) {CHECK_IF_SCREEN_FILLED} int l = unicode_length_check(it->c_str()); int nr_of_tabs = max_tabs - (l / 8); for(int tab_nr = 0; tab_nr < nr_of_tabs; tab_nr++) { *it += "\t"; } FPUTS_UNICODE(it->c_str(), stdout); } ++it; } if(c > 0) puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} puts(""); if(in_interactive) {CHECK_IF_SCREEN_FILLED} if(in_interactive) {CHECK_IF_SCREEN_FILLED_PUTS(_("For more information about a specific function, variable or unit, please use the info command (in interactive mode)."));} else {PUTS_UNICODE(_("For more information about a specific function, variable or unit, please use the info command (in interactive mode)."));} puts(""); } } int main(int argc, char *argv[]) { string calc_arg; vector set_option_strings; bool calc_arg_begun = false; string command_file; cfile = NULL; interactive_mode = false; result_only = false; bool load_units = true, load_functions = true, load_variables = true, load_currencies = true, load_datasets = true; load_global_defs = true; printops.use_unicode_signs = false; fetch_exchange_rates_at_startup = false; char list_type = 'n'; string search_str; #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, getPackageLocaleDir().c_str()); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif setlocale(LC_ALL, ""); for(int i = 1; i < argc; i++) { if(calc_arg_begun) { calc_arg += " "; } if(!calc_arg_begun && (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-help") == 0 || strcmp(argv[i], "--help") == 0)) { PUTS_UNICODE(_("usage: qalc [options] [expression]")); printf("\n"); PUTS_UNICODE(_("where options are:")); fputs("\n\t-b, -base", stdout); fputs(" ", stdout); FPUTS_UNICODE(_("BASE"), stdout); fputs("\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("set the result number base")); #ifdef HAVE_LIBCURL fputs("\n\t-e, -exrates\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("update exchange rates")); #endif fputs("\n\t-f, -file", stdout); fputs(" ", stdout); FPUTS_UNICODE(_("FILE"), stdout); fputs("\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("executes commands from a file first")); fputs("\n\t-i, -interactive\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("start in interactive mode")); fputs("\n\t-l, -list", stdout); fputs(" [", stdout); FPUTS_UNICODE(_("SEARCH TERM"), stdout); fputs("]\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("displays a list of all user-defined or matching variables, functions and units.")); fputs("\n\t--list-functions", stdout); fputs(" [", stdout); FPUTS_UNICODE(_("SEARCH TERM"), stdout); fputs("]\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("displays a list of all or matching functions.")); fputs("\n\t--list-units", stdout); fputs(" [", stdout); FPUTS_UNICODE(_("SEARCH TERM"), stdout); fputs("]\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("displays a list of all or matching units.")); fputs("\n\t--list-variables", stdout); fputs(" [", stdout); FPUTS_UNICODE(_("SEARCH TERM"), stdout); fputs("]\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("displays a list of all or matching variables.")); fputs("\n\t-m, -time", stdout); fputs(" ", stdout); FPUTS_UNICODE(_("MILLISECONDS"), stdout); fputs("\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("terminate calculation and display of result after specified amount of time")); fputs("\n\t-n, -nodefs\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any functions, units, or variables from file")); fputs("\n\t-nocurrencies\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global currencies from file")); fputs("\n\t-nodatasets\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global data sets from file")); fputs("\n\t-nofunctions\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global functions from file")); fputs("\n\t-nounits\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global units from file")); fputs("\n\t-novariables\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("do not load any global variables from file")); fputs("\n\t-s, -set", stdout); fputs(" \"", stdout); FPUTS_UNICODE(_("OPTION"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("VALUE"), stdout); fputs("\"\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("as set command in interactive program session (ex. -set \"base 16\")")); fputs("\n\t-t, -terse\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("reduces output to just the result of the input expression")); fputs("\n\t-/+u8\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("turn on/off unicode support")); fputs("\n\t-v, -version\n", stdout); fputs("\t", stdout); PUTS_UNICODE(_("show application version and exit")); puts(""); PUTS_UNICODE(_("The program will start in interactive mode if no expression and no file is specified (or interactive mode is explicitly selected).")); puts(""); return 0; } else if(!calc_arg_begun && strcmp(argv[i], "-u8") == 0) { enable_unicode = 1; } else if(!calc_arg_begun && strcmp(argv[i], "+u8") == 0) { enable_unicode = 0; #ifdef HAVE_LIBCURL } else if(!calc_arg_begun && (strcmp(argv[i], "-exrates") == 0 || strcmp(argv[i], "--exrates") == 0 || strcmp(argv[i], "-e") == 0)) { fetch_exchange_rates_at_startup = true; #endif } else if(!calc_arg_begun && (strcmp(argv[i], "-base") == 0 || strcmp(argv[i], "--base") == 0 || strcmp(argv[i], "-b") == 0)) { i++; string set_base_str = "base "; if(i < argc) { set_base_str += argv[i]; } set_option_strings.push_back(set_base_str); } else if(!calc_arg_begun && (strcmp(argv[i], "-terse") == 0 || strcmp(argv[i], "--terse") == 0 || strcmp(argv[i], "-t") == 0)) { result_only = true; } else if(!calc_arg_begun && (strcmp(argv[i], "-version") == 0 || strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-v") == 0)) { puts(VERSION); return 0; } else if(!calc_arg_begun && (strcmp(argv[i], "-interactive") == 0 || strcmp(argv[i], "--interactive") == 0 || strcmp(argv[i], "-i") == 0)) { interactive_mode = true; } else if(!calc_arg_begun && (strcmp(argv[i], "-list") == 0 || strcmp(argv[i], "--list") == 0 || strcmp(argv[i], "-l") == 0)) { list_type = 0; if(i + 1 < argc && strlen(argv[i + 1]) > 0 && argv[i + 1][0] != '-' && argv[i + 1][0] != '+') { i++; search_str = argv[i]; remove_blank_ends(search_str); } } else if(!calc_arg_begun && strcmp(argv[i], "--list-functions") == 0) { list_type = 'f'; if(i + 1 < argc && strlen(argv[i + 1]) > 0 && argv[i + 1][0] != '-' && argv[i + 1][0] != '+') { i++; search_str = argv[i]; remove_blank_ends(search_str); } } else if(!calc_arg_begun && strcmp(argv[i], "--list-units") == 0) { list_type = 'u'; if(i + 1 < argc && strlen(argv[i + 1]) > 0 && argv[i + 1][0] != '-' && argv[i + 1][0] != '+') { i++; search_str = argv[i]; remove_blank_ends(search_str); } } else if(!calc_arg_begun && strcmp(argv[i], "--list-variables") == 0) { list_type = 'v'; if(i + 1 < argc && strlen(argv[i + 1]) > 0 && argv[i + 1][0] != '-' && argv[i + 1][0] != '+') { i++; search_str = argv[i]; remove_blank_ends(search_str); } } else if(!calc_arg_begun && strcmp(argv[i], "-nounits") == 0) { load_units = false; } else if(!calc_arg_begun && strcmp(argv[i], "-nocurrencies") == 0) { load_currencies = false; } else if(!calc_arg_begun && strcmp(argv[i], "-nofunctions") == 0) { load_functions = false; } else if(!calc_arg_begun && strcmp(argv[i], "-novariables") == 0) { load_variables = false; } else if(!calc_arg_begun && strcmp(argv[i], "-nodatasets") == 0) { load_datasets = false; } else if(!calc_arg_begun && (strcmp(argv[i], "-nodefs") == 0 || strcmp(argv[i], "-n") == 0)) { load_global_defs = false; } else if(!calc_arg_begun && (strcmp(argv[i], "-time") == 0 || strcmp(argv[i], "--time") == 0 || strcmp(argv[i], "-m") == 0)) { i++; if(i < argc) { i_maxtime += strtol(argv[i], NULL, 10); if(i_maxtime < 0) i_maxtime = 0; } } else if(!calc_arg_begun && (strcmp(argv[i], "-set") == 0 || strcmp(argv[i], "--set") == 0 || strcmp(argv[i], "-s") == 0)) { i++; if(i < argc) { set_option_strings.push_back(argv[i]); } else { puts(_("No option and value specified for set command.")); } } else if(!calc_arg_begun && (strcmp(argv[i], "-file") == 0 || strcmp(argv[i], "-f") == 0 || strcmp(argv[i], "--file") == 0)) { i++; if(i < argc) { command_file = argv[i]; remove_blank_ends(command_file); } else { puts(_("No file specified.")); } } else { calc_arg += argv[i]; calc_arg_begun = true; } } b_busy = false; //create the almighty Calculator object new Calculator(); //load application specific preferences load_preferences(); for(size_t i = 0; i < set_option_strings.size(); i++) { set_option(set_option_strings[i]); } if(enable_unicode >= 0) { if(printops.use_unicode_signs == enable_unicode) { enable_unicode = -1; } else { printops.use_unicode_signs = enable_unicode; } } mstruct = new MathStructure(); parsed_mstruct = new MathStructure(); canfetch = CALCULATOR->canFetch(); string str; #ifdef HAVE_LIBREADLINE static char* rlbuffer; #endif ask_questions = (command_file.empty() || interactive_mode) && !result_only; //exchange rates if(fetch_exchange_rates_at_startup && canfetch) { CALCULATOR->fetchExchangeRates(15); int cols = 0; if(!command_file.empty()) { #ifdef HAVE_LIBREADLINE int rows = 0; rl_get_screen_size(&rows, &cols); #else cols = 80; #endif } display_errors(false, cols); } if(load_global_defs && load_currencies && canfetch) { CALCULATOR->setExchangeRatesWarningEnabled(!interactive_mode && (!command_file.empty() || (result_only && !calc_arg.empty()))); CALCULATOR->loadExchangeRates(); } string ans_str = _("ans"); vans[0] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str, m_undefined, _("Last Answer"), false)); vans[0]->addName(_("answer")); vans[0]->addName(ans_str + "1"); vans[1] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "2", m_undefined, _("Answer 2"), false)); vans[2] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "3", m_undefined, _("Answer 3"), false)); vans[3] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "4", m_undefined, _("Answer 4"), false)); vans[4] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "5", m_undefined, _("Answer 5"), false)); //load global definitions if(load_global_defs) { bool b = true; if(load_units && !CALCULATOR->loadGlobalPrefixes()) b = false; if(load_units && !CALCULATOR->loadGlobalUnits()) b = false; else if(!load_units && load_currencies && !CALCULATOR->loadGlobalCurrencies()) b = false; if(load_functions && !CALCULATOR->loadGlobalFunctions()) b = false; if(load_datasets && !CALCULATOR->loadGlobalDataSets()) b = false; if(load_variables && !CALCULATOR->loadGlobalVariables()) b = false; if(!b) {PUTS_UNICODE(_("Failed to load global definitions!"));} } //load local definitions CALCULATOR->loadLocalDefinitions(); if(list_type != 'n') { CALCULATOR->terminateThreads(); list_defs(false, list_type, search_str); return 0; } //reset result_text = "0"; parsed_text = "0"; view_thread = new ViewThread; command_thread = new CommandThread; if(!command_file.empty()) { if(command_file == "-") { cfile = stdin; } else { cfile = fopen(command_file.c_str(), "r"); if(!cfile) { printf(_("Could not open \"%s\".\n"), command_file.c_str()); if(!interactive_mode) { if(!view_thread->write(NULL)) view_thread->cancel(); CALCULATOR->terminateThreads(); return 0; } } } } if(i_maxtime > 0) { #ifndef CLOCK_MONOTONIC gettimeofday(&t_end, NULL); #else struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); t_end.tv_sec = ts.tv_sec; t_end.tv_usec = ts.tv_nsec / 1000; #endif long int usecs = t_end.tv_usec + (long int) i_maxtime * 1000; t_end.tv_usec = usecs % 1000000; t_end.tv_sec += usecs / 1000000; } if(!cfile && !calc_arg.empty()) { if(calc_arg.length() > 2 && ((calc_arg[0] == '\"' && calc_arg.find('\"', 1) == calc_arg.length() - 1) || (calc_arg[0] == '\'' && calc_arg.find('\'', 1) == calc_arg.length() - 1))) { calc_arg = calc_arg.substr(1, calc_arg.length() - 2); } if(!printops.use_unicode_signs && contains_unicode_char(calc_arg.c_str())) { char *gstr = locale_to_utf8(calc_arg.c_str()); if(gstr) { expression_str = gstr; free(gstr); } else { expression_str = calc_arg; } } else { expression_str = calc_arg; } size_t index = expression_str.find_first_of(ID_WRAPS); if(index != string::npos) { printf(_("Illegal character, \'%c\', in expression."), expression_str[index]); puts(""); } else { use_readline = false; execute_expression(interactive_mode); } if(!interactive_mode) { if(!view_thread->write(NULL)) view_thread->cancel(); CALCULATOR->terminateThreads(); return 0; } i_maxtime = 0; use_readline = true; } else if(!cfile) { ask_questions = !result_only; interactive_mode = true; i_maxtime = 0; } #ifdef HAVE_LIBREADLINE rl_catch_signals = 1; rl_catch_sigwinch = rl_readline_version >= 0x0500; rl_readline_name = "qalc"; rl_basic_word_break_characters = NOT_IN_NAMES NUMBERS; rl_completion_entry_function = qalc_completion; rl_bind_key('\t', rlcom_tab); #endif string scom; size_t slen, ispace; while(true) { if(cfile) { if(i_maxtime < 0 || !fgets(buffer, 1000, cfile)) { if(cfile != stdin) { fclose(cfile); } cfile = NULL; if(!calc_arg.empty()) { if(!printops.use_unicode_signs && contains_unicode_char(calc_arg.c_str())) { char *gstr = locale_to_utf8(calc_arg.c_str()); if(gstr) { expression_str = gstr; free(gstr); } else { expression_str = calc_arg; } } else { expression_str = calc_arg; } size_t index = expression_str.find_first_of(ID_WRAPS); if(index != string::npos) { printf(_("Illegal character, \'%c\', in expression."), expression_str[index]); puts(""); } else { execute_expression(interactive_mode); } } if(!interactive_mode) break; i_maxtime = 0; continue; } if(!printops.use_unicode_signs && contains_unicode_char(buffer)) { char *gstr = locale_to_utf8(buffer); if(gstr) { str = gstr; free(gstr); } else { str = buffer; } } else { str = buffer; } remove_blank_ends(str); if(str.empty() || str[0] == '#' || (str.length() >= 2 && str[0] == '/' && str[1] == '/')) continue; } else { #ifdef HAVE_LIBREADLINE rlbuffer = readline("> "); if(rlbuffer == NULL) break; if(!printops.use_unicode_signs && contains_unicode_char(rlbuffer)) { char *gstr = locale_to_utf8(rlbuffer); if(gstr) { str = gstr; free(gstr); } else { str = rlbuffer; } } else { str = rlbuffer; } #else fputs("> ", stdout); if(!fgets(buffer, 1000, stdin)) { str = ""; } else if(!printops.use_unicode_signs && contains_unicode_char(buffer)) { char *gstr = locale_to_utf8(buffer); if(gstr) { str = gstr; free(gstr); } else { str = buffer; } } else { str = buffer; } #endif } bool explicit_command = (!str.empty() && str[0] == '/'); if(explicit_command) str.erase(0, 1); remove_blank_ends(str); slen = str.length(); ispace = str.find_first_of(SPACES); if(ispace == string::npos) { scom = ""; } else { scom = str.substr(0, ispace); } //The qalc command "set" as in "set precision 10". The original text string for commands is kept in addition to the translation. if(EQUALS_IGNORECASE_AND_LOCAL(scom, "set", _("set"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); set_option(str); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "save", _("save")) || EQUALS_IGNORECASE_AND_LOCAL(scom, "store", _("store"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); if(EQUALS_IGNORECASE_AND_LOCAL(str, "mode", _("mode"))) { if(save_mode()) { PUTS_UNICODE(_("mode saved")); } } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "definitions", _("definitions"))) { if(save_defs()) { PUTS_UNICODE(_("definitions saved")); } } else { string name = str, cat, title; if(str[0] == '\"') { size_t i = str.find('\"', 1); if(i != string::npos) { name = str.substr(1, i - 1); str = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(str); } else { str = ""; } } else { size_t i = str.find_first_of(SPACES, 1); if(i != string::npos) { name = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(str); } else { str = ""; } } bool catset = false; if(str.empty()) { cat = _("Temporary"); } else { if(str[0] == '\"') { size_t i = str.find('\"', 1); if(i != string::npos) { cat = str.substr(1, i - 1); title = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(title); } } else { size_t i = str.find_first_of(SPACES, 1); if(i != string::npos) { cat = str.substr(0, i); title = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(title); } } catset = true; } bool b = true; if(!CALCULATOR->variableNameIsValid(name)) { name = CALCULATOR->convertToValidVariableName(name); size_t l = name.length() + strlen(_("Illegal name. Save as %s instead (default: no)?")); char *cstr = (char*) malloc(sizeof(char) * (l + 1)); snprintf(cstr, l, _("Illegal name. Save as %s instead (default: no)?"), name.c_str()); if(!ask_question(cstr)) { b = false; } free(cstr); } if(b && CALCULATOR->variableNameTaken(name)) { if(!ask_question(_("An unit or variable with the same name already exists.\nDo you want to overwrite it (default: no)?"))) { b = false; } } if(b) { Variable *v = CALCULATOR->getActiveVariable(name); if(v && v->isLocal() && v->isKnown()) { if(catset) v->setCategory(cat); if(!title.empty()) v->setTitle(title); ((KnownVariable*) v)->set(*mstruct); if(v->countNames() == 0) { ExpressionName ename(name); ename.reference = true; v->setName(ename, 1); } else { v->setName(name, 1); } } else { CALCULATOR->addVariable(new KnownVariable(cat, name, *mstruct, title)); } } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "variable", _("variable"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); string name = str, expr; if(str[0] == '\"') { size_t i = str.find('\"', 1); if(i != string::npos) { name = str.substr(1, i - 1); str = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(str); } else { str = ""; } } else { size_t i = str.find_first_of(SPACES, 1); if(i != string::npos) { name = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(str); } else { str = ""; } } if(str.length() >= 2 && str[0] == '\"' && str[str.length() - 1] == '\"') str = str.substr(1, str.length() - 2); expr = str; bool b = true; if(!CALCULATOR->variableNameIsValid(name)) { name = CALCULATOR->convertToValidVariableName(name); size_t l = name.length() + strlen(_("Illegal name. Save as %s instead (default: no)?")); char *cstr = (char*) malloc(sizeof(char) * (l + 1)); snprintf(cstr, l, _("Illegal name. Save as %s instead (default: no)?"), name.c_str()); if(!ask_question(cstr)) { b = false; } free(cstr); } if(b && CALCULATOR->variableNameTaken(name)) { if(!ask_question(_("An unit or variable with the same name already exists.\nDo you want to overwrite it (default: no)?"))) { b = false; } } if(b) { Variable *v = CALCULATOR->getActiveVariable(name); if(v && v->isLocal() && v->isKnown()) { ((KnownVariable*) v)->set(expr); if(v->countNames() == 0) { ExpressionName ename(name); ename.reference = true; v->setName(ename, 1); } else { v->setName(name, 1); } } else { CALCULATOR->addVariable(new KnownVariable("", name, expr)); } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "function", _("function"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); string name = str, expr; if(str[0] == '\"') { size_t i = str.find('\"', 1); if(i != string::npos) { name = str.substr(1, i - 1); str = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(str); } else { str = ""; } } else { size_t i = str.find_first_of(SPACES, 1); if(i != string::npos) { name = str.substr(0, i); str = str.substr(i + 1, str.length() - (i + 1)); remove_blank_ends(str); } else { str = ""; } } if(str.length() >= 2 && str[0] == '\"' && str[str.length() - 1] == '\"') str = str.substr(1, str.length() - 2); expr = str; bool b = true; if(!CALCULATOR->functionNameIsValid(name)) { name = CALCULATOR->convertToValidFunctionName(name); size_t l = name.length() + strlen(_("Illegal name. Save as %s instead (default: no)?")); char *cstr = (char*) malloc(sizeof(char) * (l + 1)); snprintf(cstr, l, _("Illegal name. Save as %s instead (default: no)?"), name.c_str()); if(!ask_question(cstr)) { b = false; } free(cstr); } if(b && CALCULATOR->functionNameTaken(name)) { if(!ask_question(_("An function with the same name already exists.\nDo you want to overwrite it (default: no)?"))) { b = false; } } if(b) { MathFunction *f = CALCULATOR->getActiveFunction(name); if(f && f->isLocal() && f->subtype() == SUBTYPE_USER_FUNCTION) { ((UserFunction*) f)->setFormula(expr); if(f->countNames() == 0) { ExpressionName ename(name); ename.reference = true; f->setName(ename, 1); } else { f->setName(name, 1); } } else { CALCULATOR->addFunction(new UserFunction("", name, expr)); } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "delete", _("delete"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); Variable *v = CALCULATOR->getActiveVariable(str); if(v && v->isLocal()) { v->destroy(); } else { MathFunction *f = CALCULATOR->getActiveFunction(str); if(f && f->isLocal()) { f->destroy(); } else { PUTS_UNICODE(_("No user-defined variable or function with the specified name exist.")); } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "assume", _("assume"))) { string str2 = "assumptions "; set_option(str2 + str.substr(ispace + 1, slen - (ispace + 1))); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "base", _("base"))) { set_option(str); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "rpn", _("rpn"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); if(EQUALS_IGNORECASE_AND_LOCAL(str, "syntax", _("syntax"))) { if(!evalops.parse_options.rpn) { evalops.parse_options.rpn = true; expression_format_updated(false); } rpn_mode = false; CALCULATOR->clearRPNStack(); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "stack", _("stack"))) { if(evalops.parse_options.rpn) { evalops.parse_options.rpn = false; expression_format_updated(false); } rpn_mode = true; } else { int v = s2b(str); if(v < 0) { PUTS_UNICODE(_("Illegal value")); } else { rpn_mode = v; } if(evalops.parse_options.rpn != rpn_mode) { evalops.parse_options.rpn = rpn_mode; expression_format_updated(false); } if(!rpn_mode) CALCULATOR->clearRPNStack(); } //qalc command } else if(canfetch && EQUALS_IGNORECASE_AND_LOCAL(str, "exrates", _("exrates"))) { CALCULATOR->fetchExchangeRates(15); CALCULATOR->loadExchangeRates(); int cols = 0; if(cfile) { #ifdef HAVE_LIBREADLINE int rows = 0; rl_get_screen_size(&rows, &cols); #else cols = 80; #endif } display_errors(false, cols); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "stack", _("stack"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else { puts(""); MathStructure m; for(size_t i = 1; i <= CALCULATOR->RPNStackSize(); i++) { m = *CALCULATOR->getRPNRegister(i); m.format(printops); string regstr = m.print(printops); if(!cfile) replace_quotation_marks(regstr); printf(" %i:\t%s\n", (int) i, regstr.c_str()); } puts(""); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "swap", _("swap"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else if(CALCULATOR->RPNStackSize() == 1) { PUTS_UNICODE(_("The RPN stack only contains one value.")); } else { CALCULATOR->moveRPNRegisterUp(2); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "swap", _("swap"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else if(CALCULATOR->RPNStackSize() == 1) { PUTS_UNICODE(_("The RPN stack only contains one value.")); } else { int index1 = 0, index2 = 0; str = str.substr(ispace + 1, slen - (ispace + 1)); string str2 = ""; remove_blank_ends(str); ispace = str.find_first_of(SPACES); if(ispace != string::npos) { str2 = str.substr(ispace + 1, str.length() - (ispace + 1)); str = str.substr(0, ispace); remove_blank_ends(str2); remove_blank_ends(str); } index1 = s2i(str); if(str2.empty()) index2 = 1; else index2 = s2i(str2); if(index1 < 0) index1 = (int) CALCULATOR->RPNStackSize() + 1 + index1; if(index2 < 0) index2 = (int) CALCULATOR->RPNStackSize() + 1 + index2; if(index1 <= 0 || index1 > (int) CALCULATOR->RPNStackSize() || (!str2.empty() && (index2 <= 0 || index2 > (int) CALCULATOR->RPNStackSize()))) { PUTS_UNICODE(_("The specified RPN stack index does not exist.")); } else if(index1 > index2) { CALCULATOR->moveRPNRegister((size_t) index2, (size_t) index1); CALCULATOR->moveRPNRegister((size_t) index1 - 1, (size_t) index2); } else if(index1 != index2) { CALCULATOR->moveRPNRegister((size_t) index1, (size_t) index2); CALCULATOR->moveRPNRegister((size_t) index2 - 1, (size_t) index1); } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "move", _("move"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else if(CALCULATOR->RPNStackSize() == 1) { PUTS_UNICODE(_("The RPN stack only contains one value.")); } else { int index1 = 0, index2 = 0; str = str.substr(ispace + 1, slen - (ispace + 1)); string str2 = ""; remove_blank_ends(str); ispace = str.find_first_of(SPACES); if(ispace != string::npos) { str2 = str.substr(ispace + 1, str.length() - (ispace + 1)); str = str.substr(0, ispace); remove_blank_ends(str2); remove_blank_ends(str); } index1 = s2i(str); if(str2.empty()) index2 = 1; else index2 = s2i(str2); if(index1 < 0) index1 = (int) CALCULATOR->RPNStackSize() + 1 + index1; if(index2 < 0) index2 = (int) CALCULATOR->RPNStackSize() + 1 + index2; if(index1 <= 0 || index1 > (int) CALCULATOR->RPNStackSize() || (!str2.empty() && (index2 <= 0 || index2 > (int) CALCULATOR->RPNStackSize()))) { PUTS_UNICODE(_("The specified RPN stack index does not exist.")); } else { CALCULATOR->moveRPNRegister((size_t) index1, (size_t) index2); } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "rotate", _("rotate"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else if(CALCULATOR->RPNStackSize() == 1) { PUTS_UNICODE(_("The RPN stack only contains one value.")); } else { CALCULATOR->moveRPNRegister(1, CALCULATOR->RPNStackSize()); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "rotate", _("rotate"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else if(CALCULATOR->RPNStackSize() == 1) { PUTS_UNICODE(_("The RPN stack only contains one value.")); } else { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); if(EQUALS_IGNORECASE_AND_LOCAL(str, "up", _("up"))) { CALCULATOR->moveRPNRegister(1, CALCULATOR->RPNStackSize()); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "down", _("down"))) { CALCULATOR->moveRPNRegister(CALCULATOR->RPNStackSize(), 1); } else { PUTS_UNICODE(_("Illegal value")); } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "copy", _("copy"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else { CALCULATOR->RPNStackEnter(new MathStructure(*CALCULATOR->getRPNRegister(1))); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "copy", _("copy"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); int index1 = s2i(str); if(index1 < 0) index1 = (int) CALCULATOR->RPNStackSize() + 1 + index1; if(index1 <= 0 || index1 > (int) CALCULATOR->RPNStackSize()) { PUTS_UNICODE(_("The specified RPN stack index does not exist.")); } else { CALCULATOR->RPNStackEnter(new MathStructure(*CALCULATOR->getRPNRegister((size_t) index1))); } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "clear stack", _("clear stack"))) { CALCULATOR->clearRPNStack(); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "pop", _("pop"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else { CALCULATOR->deleteRPNRegister(1); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "pop", _("pop"))) { if(CALCULATOR->RPNStackSize() == 0) { PUTS_UNICODE(_("The RPN stack is empty.")); } else { str = str.substr(ispace + 1, slen - (ispace + 1)); int index1 = s2i(str); if(index1 < 0) index1 = (int) CALCULATOR->RPNStackSize() + 1 + index1; if(index1 <= 0 || index1 > (int) CALCULATOR->RPNStackSize()) { PUTS_UNICODE(_("The specified RPN stack index does not exist.")); } else { CALCULATOR->deleteRPNRegister((size_t) index1); } } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "exact", _("exact"))) { if(evalops.approximation != APPROXIMATION_EXACT) { evalops.approximation = APPROXIMATION_EXACT; expression_calculation_updated(); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "approximate", _("approximate")) || str == "approx") { if(evalops.approximation != APPROXIMATION_TRY_EXACT) { evalops.approximation = APPROXIMATION_TRY_EXACT; expression_calculation_updated(); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "convert", _("convert")) || EQUALS_IGNORECASE_AND_LOCAL(scom, "to", _("to"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); string str1, str2; size_t ispace2 = str.find_first_of(SPACES); if(ispace2 != string::npos) { str1 = str.substr(0, ispace2); remove_blank_ends(str1); str2 = str.substr(ispace2 + 1); remove_blank_ends(str2); } remove_duplicate_blanks(str); if(equalsIgnoreCase(str, "hex") || EQUALS_IGNORECASE_AND_LOCAL(str, "hexadecimal", _("hexadecimal"))) { int save_base = printops.base; printops.base = BASE_HEXADECIMAL; setResult(NULL, false); printops.base = save_base; } else if(equalsIgnoreCase(str, "bin") || EQUALS_IGNORECASE_AND_LOCAL(str, "binary", _("binary"))) { int save_base = printops.base; printops.base = BASE_BINARY; setResult(NULL, false); printops.base = save_base; } else if(equalsIgnoreCase(str, "oct") || EQUALS_IGNORECASE_AND_LOCAL(str, "octal", _("octal"))) { int save_base = printops.base; printops.base = BASE_OCTAL; setResult(NULL, false); printops.base = save_base; } else if(equalsIgnoreCase(str, "duo") || EQUALS_IGNORECASE_AND_LOCAL(str, "duodecimal", _("duodecimal"))) { int save_base = printops.base; printops.base = BASE_DUODECIMAL; setResult(NULL, false); printops.base = save_base; } else if(equalsIgnoreCase(str, "roman") || equalsIgnoreCase(str, _("roman"))) { int save_base = printops.base; printops.base = BASE_ROMAN_NUMERALS; setResult(NULL, false); printops.base = save_base; } else if(equalsIgnoreCase(str, "sexa") || EQUALS_IGNORECASE_AND_LOCAL(str, "sexagesimal", _("sexagesimal"))) { int save_base = printops.base; printops.base = BASE_SEXAGESIMAL; setResult(NULL, false); printops.base = save_base; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "time", _("time"))) { int save_base = printops.base; printops.base = BASE_TIME; setResult(NULL, false); printops.base = save_base; } else if(equalsIgnoreCase(str, "utc") || equalsIgnoreCase(str, "gmt")) { printops.time_zone = TIME_ZONE_UTC; setResult(NULL, false); printops.time_zone = TIME_ZONE_LOCAL; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "rectangular", _("rectangular")) || EQUALS_IGNORECASE_AND_LOCAL(str, "cartesian", _("cartesian")) || str == "rect") { avoid_recalculation = false; ComplexNumberForm cnf_bak = evalops.complex_number_form; evalops.complex_number_form = COMPLEX_NUMBER_FORM_EXPONENTIAL; hide_parse_errors = true; if(rpn_mode) execute_command(COMMAND_EVAL); else execute_expression(); hide_parse_errors = false; evalops.complex_number_form = cnf_bak; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "exponential", _("exponential")) || str == "exp") { avoid_recalculation = false; ComplexNumberForm cnf_bak = evalops.complex_number_form; evalops.complex_number_form = COMPLEX_NUMBER_FORM_EXPONENTIAL; hide_parse_errors = true; if(rpn_mode) execute_command(COMMAND_EVAL); else execute_expression(); hide_parse_errors = false; evalops.complex_number_form = cnf_bak; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "polar", _("polar"))) { avoid_recalculation = false; ComplexNumberForm cnf_bak = evalops.complex_number_form; evalops.complex_number_form = COMPLEX_NUMBER_FORM_POLAR; hide_parse_errors = true; if(rpn_mode) execute_command(COMMAND_EVAL); else execute_expression(); hide_parse_errors = false; evalops.complex_number_form = cnf_bak; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "bases", _("bases"))) { int save_base = printops.base; string save_result_text = result_text; string base_str; int cols = 0; if(interactive_mode && !cfile) { base_str = "\n "; #ifdef HAVE_LIBREADLINE int rows = 0; rl_get_screen_size(&rows, &cols); #else cols = 80; #endif } base_str += result_text; if(save_base != BASE_BINARY) { base_str += " = "; printops.base = BASE_BINARY; setResult(NULL, false, true, 0, false, true); base_str += result_text; } if(save_base != BASE_OCTAL) { base_str += " = "; printops.base = BASE_OCTAL; setResult(NULL, false, true, 0, false, true); base_str += result_text; } if(save_base != BASE_DECIMAL) { base_str += " = "; printops.base = BASE_DECIMAL; setResult(NULL, false, true, 0, false, true); base_str += result_text; } if(save_base != BASE_HEXADECIMAL) { base_str += " = "; printops.base = BASE_HEXADECIMAL; setResult(NULL, false, true, 0, false, true); base_str += result_text; } if(interactive_mode && !cfile) { base_str += "\n"; addLineBreaks(base_str, cols, true, 2, base_str.length()); replace_quotation_marks(base_str); } PUTS_UNICODE(base_str.c_str()); printops.base = save_base; result_text = save_result_text; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "calendar", _("calendars"))) { QalculateDateTime date; if(mstruct->isDateTime()) { date.set(*mstruct->datetime()); } else { date.setToCurrentDate(); } puts(""); show_calendars(date); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "fraction", _("fraction")) || str == "frac") { NumberFractionFormat save_format = printops.number_fraction_format; bool save_rfl = printops.restrict_fraction_length; printops.restrict_fraction_length = false; if(mstruct->isNumber()) printops.number_fraction_format = FRACTION_COMBINED; else printops.number_fraction_format = FRACTION_FRACTIONAL; setResult(NULL, false); printops.restrict_fraction_length = save_rfl; printops.number_fraction_format = save_format; } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "factors", _("factors")) || str == "factor") { execute_command(COMMAND_FACTORIZE); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "partial fraction", _("partial fraction")) || str == "partial") { execute_command(COMMAND_EXPAND_PARTIAL_FRACTIONS); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "best", _("best")) || EQUALS_IGNORECASE_AND_LOCAL(str, "optimal", _("optimal"))) { CALCULATOR->resetExchangeRatesUsed(); MathStructure mstruct_new(CALCULATOR->convertToBestUnit(*mstruct, evalops, true)); if(check_exchange_rates()) mstruct->set(CALCULATOR->convertToBestUnit(*mstruct, evalops, true)); else mstruct->set(mstruct_new); result_action_executed(); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "base", _("base"))) { CALCULATOR->resetExchangeRatesUsed(); MathStructure mstruct_new(CALCULATOR->convertToBaseUnits(*mstruct, evalops)); if(check_exchange_rates()) mstruct->set(CALCULATOR->convertToBaseUnits(*mstruct, evalops)); else mstruct->set(mstruct_new); result_action_executed(); } else if(EQUALS_IGNORECASE_AND_LOCAL(str1, "base", _("base")) && s2i(str2) >= 2 && (s2i(str2) <= 36 || s2i(str2) == BASE_SEXAGESIMAL)) { int save_base = printops.base; printops.base = s2i(str2); setResult(NULL, false); printops.base = save_base; } else { CALCULATOR->resetExchangeRatesUsed(); MathStructure mstruct_new(CALCULATOR->convert(*mstruct, CALCULATOR->unlocalizeExpression(str, evalops.parse_options), evalops)); if(check_exchange_rates()) mstruct->set(CALCULATOR->convert(*mstruct, CALCULATOR->unlocalizeExpression(str, evalops.parse_options), evalops)); else mstruct->set(mstruct_new); result_action_executed(); } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "factor", _("factor"))) { execute_command(COMMAND_FACTORIZE); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "partial fraction", _("partial fraction"))) { execute_command(COMMAND_EXPAND_PARTIAL_FRACTIONS); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "simplify", _("simplify"))) { execute_command(COMMAND_SIMPLIFY); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "mode", _("mode"))) { INIT_SCREEN_CHECK int pctl; CHECK_IF_SCREEN_FILLED_HEADING(_("Algebraic Mode")); #define PRINT_AND_COLON_TABS(x, s) str = x; pctl = unicode_length_check(x); if(strlen(s) > 0) {str += " (" s ")"; pctl += unicode_length_check(" (" s ")");} do {str += '\t'; pctl += 8;} while(pctl < 48); PRINT_AND_COLON_TABS(_("algebra mode"), "alg"); switch(evalops.structuring) { case STRUCTURING_NONE: {str += _("none"); break;} case STRUCTURING_FACTORIZE: {str += _("factorize"); break;} default: {str += _("simplify"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("assume nonzero denominators"), "nzd"); str += b2oo(evalops.assume_denominators_nonzero, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("warn nonzero denominators"), "warnnzd"); str += b2oo(evalops.warn_about_denominators_assumed_nonzero, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) string value; switch(CALCULATOR->defaultAssumptions()->sign()) { case ASSUMPTION_SIGN_POSITIVE: {value = _("positive"); break;} case ASSUMPTION_SIGN_NONPOSITIVE: {value = _("non-positive"); break;} case ASSUMPTION_SIGN_NEGATIVE: {value = _("negative"); break;} case ASSUMPTION_SIGN_NONNEGATIVE: {value = _("non-negative"); break;} case ASSUMPTION_SIGN_NONZERO: {value = _("non-zero"); break;} default: {} } if(!value.empty() && CALCULATOR->defaultAssumptions()->type() != ASSUMPTION_TYPE_NONE) value += " "; switch(CALCULATOR->defaultAssumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: {value += _("integer"); break;} case ASSUMPTION_TYPE_RATIONAL: {value += _("rational"); break;} case ASSUMPTION_TYPE_REAL: {value += _("real"); break;} case ASSUMPTION_TYPE_COMPLEX: {value += _("complex"); break;} case ASSUMPTION_TYPE_NUMBER: {value += _("number"); break;} case ASSUMPTION_TYPE_NONMATRIX: {value += _("non-matrix"); break;} default: {} } if(value.empty()) value = _("unknown"); PRINT_AND_COLON_TABS(_("assumptions"), "ass"); str += value; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) CHECK_IF_SCREEN_FILLED_HEADING(_("Calculation")); PRINT_AND_COLON_TABS(_("angle unit"), "angle"); switch(evalops.parse_options.angle_unit) { case ANGLE_UNIT_RADIANS: {str += _("rad"); break;} case ANGLE_UNIT_DEGREES: {str += _("rad"); break;} case ANGLE_UNIT_GRADIANS: {str += _("gra"); break;} default: {str += _("none"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("approximation"), "appr"); switch(evalops.approximation) { case APPROXIMATION_EXACT: {str += _("exact"); break;} case APPROXIMATION_TRY_EXACT: {str += _("try exact"); break;} default: {str += _("approximate"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("interval arithmetic"), "iv"); str += b2oo(CALCULATOR->usesIntervalArithmetic(), false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("precision"), "prec") str += i2s(CALCULATOR->getPrecision()); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) CHECK_IF_SCREEN_FILLED_HEADING(_("Enabled Objects")); PRINT_AND_COLON_TABS(_("calculate functions"), "calcfunc"); str += b2oo(evalops.calculate_functions, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("calculate variables"), "calcvar"); str += b2oo(evalops.calculate_variables, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("complex numbers"), "cplx"); str += b2oo(evalops.allow_complex, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("functions"), "func"); str += b2oo(evalops.parse_options.functions_enabled, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("infinite numbers"), "inf"); str += b2oo(evalops.allow_infinite, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("units"), ""); str += b2oo(evalops.parse_options.units_enabled, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("unknowns"), ""); str += b2oo(evalops.parse_options.unknowns_enabled, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("variables"), "var"); str += b2oo(evalops.parse_options.variables_enabled, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("variable units"), "varunit"); str += b2oo(CALCULATOR->variableUnitsEnabled(), false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) CHECK_IF_SCREEN_FILLED_HEADING(_("Generic Display Options")); PRINT_AND_COLON_TABS(_("abbreviations"), "abbr"); str += b2oo(printops.abbreviate_names, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("division sign"), "divsign"); switch(printops.division_sign) { case DIVISION_SIGN_DIVISION_SLASH: {str += SIGN_DIVISION_SLASH; break;} case DIVISION_SIGN_DIVISION: {str += SIGN_DIVISION; break;} default: {str += "/"; break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("excessive parentheses"), "expar"); str += b2oo(printops.excessive_parenthesis, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("multiplication sign"), "mulsign"); switch(printops.multiplication_sign) { case MULTIPLICATION_SIGN_X: {str += SIGN_MULTIPLICATION; break;} case MULTIPLICATION_SIGN_DOT: {str += SIGN_MULTIDOT; break;} default: {str += "*"; break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("show negative exponents"), "negexp"); str += b2oo(printops.negative_exponents, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("short multiplication"), "shortmul"); str += b2oo(printops.short_multiplication, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("spacious"), "space"); str += b2oo(printops.spacious, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("spell out logical"), "spellout"); str += b2oo(printops.spell_out_logical_operators, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("unicode"), "uni"); str += b2oo(printops.use_unicode_signs, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) CHECK_IF_SCREEN_FILLED_HEADING(_("Numerical Display")); PRINT_AND_COLON_TABS(_("base"), ""); switch(printops.base) { case BASE_ROMAN_NUMERALS: {str += _("roman"); break;} case BASE_SEXAGESIMAL: {str += _("sexagesimal"); break;} case BASE_TIME: {str += _("time"); break;} default: {str += i2s(printops.base);} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("base display"), "basedisp"); switch(printops.base_display) { case BASE_DISPLAY_NONE: {str += _("none"); break;} case BASE_DISPLAY_NORMAL: {str += _("normal"); break;} case BASE_DISPLAY_ALTERNATIVE: {str += _("alternative"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("complex form"), "cplxform"); switch(evalops.complex_number_form) { case COMPLEX_NUMBER_FORM_RECTANGULAR: {str += _("rectangular"); break;} case COMPLEX_NUMBER_FORM_EXPONENTIAL: {str += _("exponential"); break;} case COMPLEX_NUMBER_FORM_POLAR: {str += _("polar"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("decimal comma"), ""); if(b_decimal_comma < 0) {str += _("locale");} else if(b_decimal_comma == 0) {str += _("off");} else {str += _("on");} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("digit grouping"), "group"); switch(printops.digit_grouping) { case DIGIT_GROUPING_NONE: {str += _("off"); break;} case DIGIT_GROUPING_STANDARD: {str += _("standard"); break;} case DIGIT_GROUPING_LOCALE: {str += _("locale"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("scientific notation"), "exp"); switch(printops.min_exp) { case EXP_NONE: {str += _("off"); break;} case EXP_PRECISION: {str += _("auto"); break;} case EXP_PURE: {str += _("pure"); break;} case EXP_SCIENTIFIC: {str += _("scientific"); break;} case EXP_BASE_3: {str += _("engineering"); break;} default: {str += i2s(printops.min_exp); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("fractions"), "fr"); switch(printops.number_fraction_format) { case FRACTION_DECIMAL: {str += _("off"); break;} case FRACTION_DECIMAL_EXACT: {str += _("exact"); break;} case FRACTION_FRACTIONAL: {if(printops.restrict_fraction_length) {str += _("on");} else {str += _("long");} break;} case FRACTION_COMBINED: {str += _("combined"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("interval display"), "ivdisp"); if(adaptive_interval_display) { str += _("adaptive"); } else { switch(printops.interval_display) { case INTERVAL_DISPLAY_SIGNIFICANT_DIGITS: {str += _("significant"); break;} case INTERVAL_DISPLAY_INTERVAL: {str += _("interval"); break;} case INTERVAL_DISPLAY_PLUSMINUS: {str += _("plusminus"); break;} case INTERVAL_DISPLAY_MIDPOINT: {str += _("midpoint"); break;} case INTERVAL_DISPLAY_LOWER: {str += _("lower"); break;} case INTERVAL_DISPLAY_UPPER: {str += _("upper"); break;} default: {str += i2s(printops.interval_display + 1); break;} } } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("lowercase e"), "lowe"); str += b2oo(printops.lower_case_e, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("lowercase numbers"), "lownum"); str += b2oo(printops.lower_case_numbers, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("max decimals"), "maxdeci"); if(printops.use_max_decimals && printops.max_decimals >= 0) { str += i2s(printops.max_decimals); } else { str += _("off"); } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("min decimals"), "mindeci"); if(printops.use_min_decimals && printops.min_decimals > 0) { str += i2s(printops.min_decimals); } else { str += _("off"); } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("repeating decimals"), "repdeci"); str += b2oo(printops.indicate_infinite_series, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("round to even"), "rndeven"); str += b2oo(printops.round_halfway_to_even, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("show ending zeroes"), "zeroes"); str += b2oo(printops.show_ending_zeroes, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("two's complement"), "twos"); str += b2oo(printops.twos_complement, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) CHECK_IF_SCREEN_FILLED_HEADING(_("Parsing")); PRINT_AND_COLON_TABS(_("decimal comma"), ""); if(b_decimal_comma < 0) {str += _("locale");} else if(b_decimal_comma == 0) {str += _("off");} else {str += _("on");} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) if(CALCULATOR->getDecimalPoint() != COMMA) { PRINT_AND_COLON_TABS(_("ignore comma"), ""); str += b2oo(evalops.parse_options.comma_as_separator, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) } if(CALCULATOR->getDecimalPoint() != DOT) { PRINT_AND_COLON_TABS(_("ignore dot"), ""); str += b2oo(evalops.parse_options.dot_as_separator, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) } PRINT_AND_COLON_TABS(_("input base"), "inbase"); switch(evalops.parse_options.base) { case BASE_ROMAN_NUMERALS: {str += _("roman"); break;} default: {str += i2s(evalops.parse_options.base);} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("limit implicit multiplication"), "limimpl"); str += b2oo(evalops.parse_options.limit_implicit_multiplication, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("parsing mode"), "parse"); switch(evalops.parse_options.parsing_mode) { case PARSING_MODE_ADAPTIVE: {str += _("adaptive"); break;} case PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST: {str += _("implicit first"); break;} case PARSING_MODE_CONVENTIONAL: {str += _("conventional"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("read precision"), "readprec"); switch(evalops.parse_options.read_precision) { case DONT_READ_PRECISION: {str += _("off"); break;} case ALWAYS_READ_PRECISION: {str += _("always"); break;} case READ_PRECISION_WHEN_DECIMALS: {str += _("when decimals"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("rpn syntax"), "rpnsyn"); str += b2oo(evalops.parse_options.rpn, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) CHECK_IF_SCREEN_FILLED_HEADING(_("Units")); PRINT_AND_COLON_TABS(_("all prefixes"), "allpref"); str += b2oo(printops.use_all_prefixes, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("autoconversion"), "conv"); switch(evalops.auto_post_conversion) { case POST_CONVERSION_NONE: { if(evalops.mixed_units_conversion > MIXED_UNITS_CONVERSION_NONE) {str += _("mixed");} else {str += _("none");} break; } case POST_CONVERSION_OPTIMAL: {str += _("optimal"); break;} case POST_CONVERSION_BASE: {str += _("base"); break;} case POST_CONVERSION_OPTIMAL_SI: {str += _("optimalsi"); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("currency conversion"), "curconv"); str += b2oo(evalops.local_currency_conversion, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("denominator prefixes"), "denpref"); str += b2oo(printops.use_denominator_prefix, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("place units separately"), "unitsep"); str += b2oo(printops.place_units_separately, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("prefixes"), "pref"); str += b2oo(printops.use_unit_prefixes, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("sync units"), "sync"); str += b2oo(evalops.sync_units, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("update exchange rates"), "upxrates"); switch(auto_update_exchange_rates) { case -1: {str += _("ask"); break;} case 0: {str += _("never"); break;} default: {str += i2s(auto_update_exchange_rates); break;} } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) CHECK_IF_SCREEN_FILLED_HEADING(_("Other")); PRINT_AND_COLON_TABS(_("rpn"), ""); str += b2oo(rpn_mode, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("save definitions"), ""); str += b2yn(save_defs_on_exit, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) PRINT_AND_COLON_TABS(_("save mode"), ""); str += b2yn(save_mode_on_exit, false); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()) puts(""); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "help", _("help")) || str == "?") { INIT_SCREEN_CHECK CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Enter a mathematical expression or a command and press enter.")); CHECK_IF_SCREEN_FILLED_PUTS(_("Complete functions, units and variables with the tabulator key.")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Available commands are:")); CHECK_IF_SCREEN_FILLED_PUTS(""); PUTS_UNICODE(_("approximate")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("assume"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("ASSUMPTIONS")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("base"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("BASE")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("delete"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("NAME")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("exact")); CHECK_IF_SCREEN_FILLED if(canfetch) { FPUTS_UNICODE(_("exrates"), stdout); } puts(""); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("factor")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("find"), stdout); fputs("/", stdout); PUTS_UNICODE(_("list")); CHECK_IF_SCREEN_FILLED; FPUTS_UNICODE(_("function"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("NAME"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("EXPRESSION")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("info")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("mode")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("partial fraction")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("save"), stdout); fputs("/", stdout); FPUTS_UNICODE(_("store"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("NAME"), stdout); fputs(" [", stdout); FPUTS_UNICODE(_("CATEGORY"), stdout); fputs("] [", stdout); FPUTS_UNICODE(_("TITLE"), stdout); puts("]"); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("save definitions")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("save mode")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("set"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("OPTION"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("VALUE")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("simplify")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("to"), stdout); fputs("/", stdout); FPUTS_UNICODE(_("convert"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("UNIT or \"TO\" COMMAND")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("variable"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("NAME"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("EXPRESSION"), stdout); CHECK_IF_SCREEN_FILLED_PUTS(""); FPUTS_UNICODE(_("quit"), stdout); fputs("/", stdout); PUTS_UNICODE(_("exit")); CHECK_IF_SCREEN_FILLED_PUTS(""); PUTS_UNICODE(_("Commands for RPN mode:")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("rpn"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("STATE")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("stack")); CHECK_IF_SCREEN_FILLED PUTS_UNICODE(_("clear stack")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("copy"), stdout); fputs(" [", stdout); FPUTS_UNICODE(_("INDEX"), stdout); puts("]"); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("move"), stdout); fputs(" ", stdout); FPUTS_UNICODE(_("INDEX 1"), stdout); fputs(" ", stdout); PUTS_UNICODE(_("INDEX 2")); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("pop"), stdout); fputs(" [", stdout); FPUTS_UNICODE(_("INDEX"), stdout); puts("]"); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("rotate"), stdout); fputs(" [", stdout); FPUTS_UNICODE(_("DIRECTION"), stdout); puts("]"); CHECK_IF_SCREEN_FILLED FPUTS_UNICODE(_("swap"), stdout); fputs(" [", stdout); FPUTS_UNICODE(_("INDEX 1"), stdout); fputs("] [", stdout); FPUTS_UNICODE(_("INDEX 2"), stdout); puts("]"); CHECK_IF_SCREEN_FILLED CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Type help COMMAND for more information (example: help save).")); CHECK_IF_SCREEN_FILLED_PUTS(_("Type info NAME for information about a function, variable or unit (example: info sin).")); CHECK_IF_SCREEN_FILLED_PUTS(_("When a line begins with '/', the following text is always interpreted as a command.")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("For more information about mathematical expression, different options, and a complete list of functions, variables and units, see the relevant sections in the manual of the graphical user interface (available at http://qalculate.github.io/manual/index.html).")); puts(""); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "list", _("list"))) { list_defs(true); } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "list", _("list")) || EQUALS_IGNORECASE_AND_LOCAL(scom, "find", _("find"))) { str = str.substr(ispace + 1); remove_blank_ends(str); size_t i = str.find_first_of(SPACES); string str1, str2; if(i == string::npos) { str1 = str; } else { str1 = str.substr(0, i); str2 = str.substr(i + 1); remove_blank_ends(str2); } char list_type = 0; if(EQUALS_IGNORECASE_AND_LOCAL(str1, "currencies", _("currencies"))) list_type = 'c'; else if(EQUALS_IGNORECASE_AND_LOCAL(str1, "functions", _("functions"))) list_type = 'f'; else if(EQUALS_IGNORECASE_AND_LOCAL(str1, "variables", _("variables"))) list_type = 'v'; else if(EQUALS_IGNORECASE_AND_LOCAL(str1, "units", _("units"))) list_type = 'u'; else if(!str2.empty()) { if(equalsIgnoreCase(str, _("currencies"))) list_type = 'c'; else if(equalsIgnoreCase(str, _("functions"))) list_type = 'f'; else if(equalsIgnoreCase(str, _("variables"))) list_type = 'v'; else if(equalsIgnoreCase(str, _("units"))) list_type = 'u'; if(list_type != 0) str2 = ""; } else str2 = str; list_defs(true, list_type, str2); //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "info", _("info"))) { int pctl; #define PRINT_AND_COLON_TABS_INFO(x) FPUTS_UNICODE(x, stdout); pctl = unicode_length_check(x); if(pctl >= 23) fputs(":\t", stdout); else if(pctl >= 15) fputs(":\t\t", stdout); else if(pctl >= 7) fputs(":\t\t\t", stdout); else fputs(":\t\t\t\t", stdout); str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); show_info: ExpressionItem *item = CALCULATOR->getActiveExpressionItem(str); if(!item) { PUTS_UNICODE(_("No function, variable or unit with specified name exist.")); } else { switch(item->type()) { case TYPE_FUNCTION: { INIT_SCREEN_CHECK CHECK_IF_SCREEN_FILLED_PUTS(""); MathFunction *f = (MathFunction*) item; Argument *arg; Argument default_arg; string str2; str = _("Function"); if(!f->title(false).empty()) { str += ": "; str += f->title(); } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); CHECK_IF_SCREEN_FILLED_PUTS(""); const ExpressionName *ename = &f->preferredName(false, printops.use_unicode_signs); str = ename->name; int iargs = f->maxargs(); if(iargs < 0) { iargs = f->minargs() + 1; } str += "("; if(iargs != 0) { for(int i2 = 1; i2 <= iargs; i2++) { if(i2 > f->minargs()) { str += "["; } if(i2 > 1) { str += CALCULATOR->getComma(); str += " "; } arg = f->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { str2 = arg->name(); } else { str2 = _("argument"); str2 += " "; str2 += i2s(i2); } str += str2; if(i2 > f->minargs()) { str += "]"; } } if(f->maxargs() < 0) { str += CALCULATOR->getComma(); str += " ..."; } } str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); for(size_t i2 = 1; i2 <= f->countNames(); i2++) { if(&f->getName(i2) != ename) { CHECK_IF_SCREEN_FILLED_PUTS(f->getName(i2).name.c_str()); } } if(f->subtype() == SUBTYPE_DATA_SET) { CHECK_IF_SCREEN_FILLED_PUTS(""); snprintf(buffer, 1000, _("Retrieves data from the %s data set for a given object and property. If \"info\" is typed as property, all properties of the object will be listed."), f->title().c_str()); CHECK_IF_SCREEN_FILLED_PUTS(buffer); } if(!f->description().empty()) { CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(f->description().c_str()); } if(!f->example(true).empty()) { CHECK_IF_SCREEN_FILLED_PUTS(""); str = _("Example:"); str += " "; str += f->example(false, ename->name); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); } if(f->subtype() == SUBTYPE_DATA_SET && !((DataSet*) f)->copyright().empty()) { CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(((DataSet*) f)->copyright().c_str()); } if(iargs) { CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Arguments")); for(int i2 = 1; i2 <= iargs; i2++) { arg = f->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { str = arg->name(); } else { str = i2s(i2); } str += ": "; if(arg) { str2 = arg->printlong(); } else { str2 = default_arg.printlong(); } if(i2 > f->minargs()) { str2 += " ("; //optional argument, in description str2 += _("optional"); if(!f->getDefaultValue(i2).empty()) { str2 += ", "; //argument default, in description str2 += _("default: "); str2 += f->getDefaultValue(i2); } str2 += ")"; } str += str2; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); } } if(!f->condition().empty()) { CHECK_IF_SCREEN_FILLED_PUTS(""); str = _("Requirement"); str += ": "; str += f->printCondition(); CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); } if(f->subtype() == SUBTYPE_DATA_SET) { DataSet *ds = (DataSet*) f; CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Properties")); DataPropertyIter it; DataProperty *dp = ds->getFirstProperty(&it); while(dp) { if(!dp->isHidden()) { if(!dp->title(false).empty()) { str = dp->title(); str += ": "; } for(size_t i = 1; i <= dp->countNames(); i++) { if(i > 1) str += ", "; str += dp->getName(i); } if(dp->isKey()) { str += " ("; str += _("key"); str += ")"; } if(!dp->description().empty()) { str += "\n"; str += dp->description(); } CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); } dp = ds->getNextProperty(&it); } } CHECK_IF_SCREEN_FILLED_PUTS(""); break; } case TYPE_UNIT: { puts(""); if(!item->title(false).empty()) { PRINT_AND_COLON_TABS_INFO(_("Unit")); FPUTS_UNICODE(item->title().c_str(), stdout); } else { FPUTS_UNICODE(_("Unit"), stdout); } puts(""); PRINT_AND_COLON_TABS_INFO(_("Names")); if(item->subtype() != SUBTYPE_COMPOSITE_UNIT) { const ExpressionName *ename = &item->preferredName(true, printops.use_unicode_signs); FPUTS_UNICODE(ename->name.c_str(), stdout); for(size_t i2 = 1; i2 <= item->countNames(); i2++) { if(&item->getName(i2) != ename && !item->getName(i2).completion_only) { fputs(" / ", stdout); FPUTS_UNICODE(item->getName(i2).name.c_str(), stdout); } } } puts(""); switch(item->subtype()) { case SUBTYPE_BASE_UNIT: { break; } case SUBTYPE_ALIAS_UNIT: { AliasUnit *au = (AliasUnit*) item; PRINT_AND_COLON_TABS_INFO(_("Base Unit")); FPUTS_UNICODE(au->firstBaseUnit()->preferredDisplayName(printops.abbreviate_names, printops.use_unicode_signs).name.c_str(), stdout); if(au->firstBaseExponent() != 1) { fputs(POWER, stdout); printf("%i", au->firstBaseExponent()); } puts(""); PRINT_AND_COLON_TABS_INFO(_("Relation")); FPUTS_UNICODE(CALCULATOR->localizeExpression(au->expression()).c_str(), stdout); if(item->isApproximate()) { fputs(" (", stdout); FPUTS_UNICODE(_("approximate"), stdout); fputs(")", stdout); } if(!au->inverseExpression().empty()) { puts(""); PRINT_AND_COLON_TABS_INFO(_("Inverse Relation")); FPUTS_UNICODE(CALCULATOR->localizeExpression(au->inverseExpression()).c_str(), stdout); if(item->isApproximate()) { fputs(" (", stdout); FPUTS_UNICODE(_("approximate"), stdout); fputs(")", stdout); } } puts(""); break; } case SUBTYPE_COMPOSITE_UNIT: { PRINT_AND_COLON_TABS_INFO(_("Base Units")); PUTS_UNICODE(((CompositeUnit*) item)->print(false, true, printops.use_unicode_signs).c_str()); break; } } if(!item->description().empty()) { puts(""); PUTS_UNICODE(item->description().c_str()); } puts(""); break; } case TYPE_VARIABLE: { puts(""); if(!item->title(false).empty()) { PRINT_AND_COLON_TABS_INFO(_("Variable")); FPUTS_UNICODE(item->title().c_str(), stdout); } else { FPUTS_UNICODE(_("Variable"), stdout); } puts(""); PRINT_AND_COLON_TABS_INFO(_("Names")); const ExpressionName *ename = &item->preferredName(false, printops.use_unicode_signs); FPUTS_UNICODE(ename->name.c_str(), stdout); for(size_t i2 = 1; i2 <= item->countNames(); i2++) { if(&item->getName(i2) != ename && !item->getName(i2).completion_only) { fputs(" / ", stdout); FPUTS_UNICODE(item->getName(i2).name.c_str(), stdout); } } Variable *v = (Variable*) item; string value; if(is_answer_variable(v)) { value = _("a previous result"); } else if(v->isKnown()) { if(((KnownVariable*) v)->isExpression()) { value = CALCULATOR->localizeExpression(((KnownVariable*) v)->expression()); } else { if(((KnownVariable*) v)->get().isMatrix()) { value = _("matrix"); } else if(((KnownVariable*) v)->get().isVector()) { value = _("vector"); } else { PrintOptions po; po.interval_display = INTERVAL_DISPLAY_PLUSMINUS; value = CALCULATOR->print(((KnownVariable*) v)->get(), 30, po); } } } else { if(((UnknownVariable*) v)->assumptions()) { switch(((UnknownVariable*) v)->assumptions()->sign()) { case ASSUMPTION_SIGN_POSITIVE: {value = _("positive"); break;} case ASSUMPTION_SIGN_NONPOSITIVE: {value = _("non-positive"); break;} case ASSUMPTION_SIGN_NEGATIVE: {value = _("negative"); break;} case ASSUMPTION_SIGN_NONNEGATIVE: {value = _("non-negative"); break;} case ASSUMPTION_SIGN_NONZERO: {value = _("non-zero"); break;} default: {} } if(!value.empty() && ((UnknownVariable*) v)->assumptions()->type() != ASSUMPTION_TYPE_NONE) value += " "; switch(((UnknownVariable*) v)->assumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: {value += _("integer"); break;} case ASSUMPTION_TYPE_RATIONAL: {value += _("rational"); break;} case ASSUMPTION_TYPE_REAL: {value += _("real"); break;} case ASSUMPTION_TYPE_COMPLEX: {value += _("complex"); break;} case ASSUMPTION_TYPE_NUMBER: {value += _("number"); break;} case ASSUMPTION_TYPE_NONMATRIX: {value += _("non-matrix"); break;} default: {} } if(value.empty()) value = _("unknown"); } else { value = _("default assumptions"); } } puts(""); PRINT_AND_COLON_TABS_INFO(_("Value")); FPUTS_UNICODE(value.c_str(), stdout); if(v->isKnown() && ((KnownVariable*) v)->isExpression() && !((KnownVariable*) v)->uncertainty().empty()) { puts(""); PRINT_AND_COLON_TABS_INFO(_("Uncertainty")); PUTS_UNICODE(CALCULATOR->localizeExpression(((KnownVariable*) v)->uncertainty()).c_str()) } else if(item->isApproximate()) { fputs(" (", stdout); FPUTS_UNICODE(_("approximate"), stdout); fputs(")", stdout); puts(""); } else { puts(""); } if(v->isKnown() && ((KnownVariable*) v)->isExpression() && !((KnownVariable*) v)->unit().empty()) { PRINT_AND_COLON_TABS_INFO(_("Unit")); PUTS_UNICODE(CALCULATOR->localizeExpression(((KnownVariable*) v)->unit()).c_str()) } if(!item->description().empty()) { fputs("\n", stdout); FPUTS_UNICODE(item->description().c_str(), stdout); fputs("\n", stdout); } puts(""); break; } } } } else if(EQUALS_IGNORECASE_AND_LOCAL(scom, "help", _("help"))) { str = str.substr(ispace + 1, slen - (ispace + 1)); remove_blank_ends(str); remove_duplicate_blanks(str); if(EQUALS_IGNORECASE_AND_LOCAL(str, "factor", _("factor"))) { puts(""); PUTS_UNICODE(_("Factorizes the current result.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "partial fraction", _("partial fraction"))) { puts(""); PUTS_UNICODE(_("Applies partial fraction decomposition to the current result.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "simplify", _("simplify"))) { puts(""); PUTS_UNICODE(_("Simplifies the current result.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "set", _("set"))) { INIT_SCREEN_CHECK #define STR_AND_TABS_SET(x, s) str = "- "; if(!cfile) {str += "\033[1m";} str += x; if(!cfile) {str += "\033[0m";} if(strlen(s) > 0) {str += " ("; str += s; str += ")";} str += "\n"; #define SET_DESCRIPTION(s) if(strlen(s) > 0) {if(!cfile) {str += "\033[3m";} str += s; if(!cfile) {str += "\033[23m";} str += "\n";} #define STR_AND_TABS_BOOL(s, sh, d, v) STR_AND_TABS_SET(s, sh); SET_DESCRIPTION(d); str += "("; str += _("on"); if(v) {str += "*";} str += ", "; str += _("off"); if(!v) {str += "*";} str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); #define STR_AND_TABS_YESNO(s, sh, d, v) STR_AND_TABS_SET(s, sh); SET_DESCRIPTION(d); str += "("; str += _("yes"); if(v) {str += "*";} str += ", "; str += _("no"); if(!v) {str += "*";} str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); #define STR_AND_TABS_2(s, sh, d, v, s0, s1, s2) STR_AND_TABS_SET(s, sh); SET_DESCRIPTION(d); str += "(0"; if(v == 0) {str += "*";} str += " = "; str += s0; str += ", 1"; if(v == 1) {str += "*";} str += " = "; str += s1; str += ", 2"; if(v == 2) {str += "*";} str += " = "; str += s2; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); #define STR_AND_TABS_3(s, sh, d, v, s0, s1, s2, s3) STR_AND_TABS_SET(s, sh); SET_DESCRIPTION(d); str += "(0"; if(v == 0) {str += "*";} str += " = "; str += s0; str += ", 1"; if(v == 1) {str += "*";} str += " = "; str += s1; str += ", 2"; if(v == 2) {str += "*";} str += " = "; str += s2; str += ", 3"; if(v == 3) {str += "*";} str += " = "; str += s3; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); #define STR_AND_TABS_4(s, sh, d, v, s0, s1, s2, s3, s4) STR_AND_TABS_SET(s, sh); SET_DESCRIPTION(d); str += "(0"; if(v == 0) {str += "*";} str += " = "; str += s0; str += ", 1"; if(v == 1) {str += "*";} str += " = "; str += s1; str += ", 2"; if(v == 2) {str += "*";} str += " = "; str += s2; str += ", 3"; if(v == 3) {str += "*";} str += " = "; str += s3; str += ", 4"; if(v == 4) {str += "*";} str += " = "; str += s4; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); #define STR_AND_TABS_7(s, sh, d, v, s0, s1, s2, s3, s4, s5, s6) STR_AND_TABS_SET(s, sh); SET_DESCRIPTION(d); str += "(0"; if(v == 0) {str += "*";} str += " = "; str += s0; str += ", 1"; if(v == 1) {str += "*";} str += " = "; str += s1; str += ", 2"; if(v == 2) {str += "*";} str += " = "; str += s2; str += ", 3"; if(v == 3) {str += "*";} str += " = "; str += s3; str += ", 4"; if(v == 4) {str += "*";} str += " = "; str += s4; str += ", 5"; if(v == 5) {str += "*";} str += " = "; str += s5; str += ", 6"; if(v == 6) {str += "*";} str += " = "; str += s6; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Sets the value of an option.")); CHECK_IF_SCREEN_FILLED_PUTS(_("Example: set base 16.")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Available options and accepted values are (the current value is marked with '*'):")); CHECK_IF_SCREEN_FILLED_HEADING_S(_("Algebraic Mode")); STR_AND_TABS_2(_("algebra mode"), "alg", _("Determines if the expression is simplified or factorized after calculation."), evalops.structuring, _("none"), _("simplify"), _("factorize")); STR_AND_TABS_BOOL(_("assume nonzero denominators"), "nzd", _("Determines if unknown values will be assumed non-zero (x/x=1)."), evalops.assume_denominators_nonzero); STR_AND_TABS_BOOL(_("warn nonzero denominators"), "warnnzd", _("Display a message after a value has been assumed non-zero."), evalops.warn_about_denominators_assumed_nonzero); Assumptions *ass = CALCULATOR->defaultAssumptions(); STR_AND_TABS_SET(_("assumptions"), "ass"); SET_DESCRIPTION(_("Default assumptions for unknown variables.")); str += "("; str += _("unknown"); if(ass->sign() == ASSUMPTION_SIGN_UNKNOWN) str += "*"; str += ", "; str += _("non-zero"); if(ass->sign() == ASSUMPTION_SIGN_NONZERO) str += "*"; str += ", "; str += _("positive"); if(ass->sign() == ASSUMPTION_SIGN_POSITIVE) str += "*"; str += ", "; str += _("negative"); if(ass->sign() == ASSUMPTION_SIGN_NEGATIVE) str += "*"; str += ", "; str += _("non-positive"); if(ass->sign() == ASSUMPTION_SIGN_NONPOSITIVE) str += "*"; str += ", "; str += _("non-negative"); if(ass->sign() == ASSUMPTION_SIGN_NONNEGATIVE) str += "*"; str += " + "; str += _("number"); if(ass->type() == ASSUMPTION_TYPE_NUMBER) str += "*"; str += ", "; str += _("real"); if(ass->type() == ASSUMPTION_TYPE_REAL) str += "*"; str += ", "; str += _("rational"); if(ass->type() == ASSUMPTION_TYPE_RATIONAL) str += "*"; str += ", "; str += _("integer"); if(ass->type() == ASSUMPTION_TYPE_INTEGER) str += "*"; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); CHECK_IF_SCREEN_FILLED_HEADING_S(_("Calculation")); STR_AND_TABS_3(_("angle unit"), "angle", "Default angle unit for trigonometric functions.", evalops.parse_options.angle_unit, _("none"), _("radians"), _("degrees"), _("gradians")); STR_AND_TABS_2(_("approximation"), "appr", _("How approximate variables and calculations are handled. In exact mode approximate values will not be calculated."), evalops.approximation, _("exact"), _("try exact"), _("approximate")); STR_AND_TABS_BOOL(_("interval arithmetic"), "iv", _("If activated, interval arithmetic determines the final precision of calculations. Avoids wrong results after loss of significance. Especially recommended with physical constants and/or 'read precision'."), CALCULATOR->usesIntervalArithmetic()); STR_AND_TABS_SET(_("precision"), "prec"); SET_DESCRIPTION(_("Specifies the default number of significant digits displayed and determines the precision used for approximate calculations.")); str += "(> 0) "; str += i2s(CALCULATOR->getPrecision()); str += "*"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); CHECK_IF_SCREEN_FILLED_HEADING_S(_("Enabled Objects")); STR_AND_TABS_BOOL(_("calculate functions"), "calcfunc", "", evalops.calculate_functions); STR_AND_TABS_BOOL(_("calculate variables"), "calcvar", "", evalops.calculate_variables); STR_AND_TABS_BOOL(_("complex numbers"), "cplx", "", evalops.allow_complex); STR_AND_TABS_BOOL(_("functions"), "func", "", evalops.parse_options.functions_enabled); STR_AND_TABS_BOOL(_("infinite numbers"), "inf", "", evalops.allow_infinite); STR_AND_TABS_BOOL(_("units"), "", "", evalops.parse_options.units_enabled); STR_AND_TABS_BOOL(_("unknowns"), "", _("Interprete undefined symbols in expressions as unknown variables."), evalops.parse_options.unknowns_enabled); STR_AND_TABS_BOOL(_("variables"), "var", "", evalops.parse_options.variables_enabled); STR_AND_TABS_BOOL(_("variable units"), "varunit", _("If activated physical constants include units (e.g. c = 299 792 458 m∕s)."), CALCULATOR->variableUnitsEnabled()); CHECK_IF_SCREEN_FILLED_HEADING_S(_("Generic Display Options")); STR_AND_TABS_BOOL(_("abbreviations"), "abbr", _("Use abbreviated names for units and variables."), printops.abbreviate_names); STR_AND_TABS_2(_("division sign"), "divsign", "", printops.division_sign, "/", SIGN_DIVISION_SLASH, SIGN_DIVISION); STR_AND_TABS_BOOL(_("excessive parentheses"), "expar", "", printops.excessive_parenthesis); STR_AND_TABS_2(_("multiplication sign"), "mulsign", "", printops.multiplication_sign, "*", SIGN_MULTIDOT, SIGN_MULTIPLICATION); STR_AND_TABS_BOOL(_("show negative exponents"), "negexp", _("Use negative exponents instead of division in result (x/y = xy^-1)."), printops.negative_exponents); STR_AND_TABS_BOOL(_("short multiplication"), "shortmul", "", printops.short_multiplication); STR_AND_TABS_BOOL(_("spacious"), "space", _("Add extra space around operators."), printops.spacious); STR_AND_TABS_BOOL(_("spell out logical"), "spellout", "", printops.spell_out_logical_operators); STR_AND_TABS_BOOL(_("unicode"), "uni", _("Display Unicode characters."), printops.use_unicode_signs); CHECK_IF_SCREEN_FILLED_HEADING_S(_("Numerical Display")); STR_AND_TABS_SET(_("base"), ""); str += "(2 - 36"; str += ", "; str += _("bin"); if(printops.base == BASE_BINARY) str += "*"; str += ", "; str += _("oct"); if(printops.base == BASE_OCTAL) str += "*"; str += ", "; str += _("dec"); if(printops.base == BASE_DECIMAL) str += "*"; str += ", "; str += _("hex"); if(printops.base == BASE_HEXADECIMAL) str += "*"; str += ", "; str += _("sexa"); if(printops.base == BASE_SEXAGESIMAL) str += "*"; str += ", "; str += _("time"); if(printops.base == BASE_TIME) str += "*"; str += ", "; str += _("roman"); if(printops.base == BASE_ROMAN_NUMERALS) str += "*"; str += ")"; if(printops.base > 2 && printops.base <= 36 && printops.base != BASE_OCTAL && printops.base != BASE_DECIMAL && printops.base != BASE_HEXADECIMAL) {str += " "; str += i2s(printops.base); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_2(_("base display"), "basedisp", "", printops.base_display, _("none"), _("normal"), _("alternative")); STR_AND_TABS_2(_("complex form"), "cplxform", "", evalops.complex_number_form, _("rectangular"), _("exponential"), _("polar")); STR_AND_TABS_SET(_("decimal comma"), ""); SET_DESCRIPTION(_("Determines the default decimal separator.")); str += "("; str += _("locale"); if(b_decimal_comma < 0) str += "*"; str += ", "; str += _("off"); if(b_decimal_comma == 0) str += "*"; str += ", "; str += _("on"); if(b_decimal_comma > 0) str += "*"; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_2(_("digit grouping"), "group", "", printops.digit_grouping, _("off"), _("standard"), _("locale")); STR_AND_TABS_SET(_("scientific notation"), "exp"); SET_DESCRIPTION(_("Determines how scientific notation are used (e.g. 5 543 000 = 5.543E6).")); str += "("; str += _("off"); if(printops.min_exp == EXP_NONE) str += "*"; str += ", "; str += _("auto"); if(printops.min_exp == EXP_PRECISION) str += "*"; str += ", "; str += _("engineering"); if(printops.min_exp == EXP_BASE_3) str += "*"; str += ", "; str += _("pure"); if(printops.min_exp == EXP_PURE) str += "*"; str += ", "; str += _("scientific"); if(printops.min_exp == EXP_SCIENTIFIC) str += "*"; str += ", >= 0)"; if(printops.min_exp != EXP_NONE && printops.min_exp != EXP_NONE && printops.min_exp != EXP_PRECISION && printops.min_exp != EXP_BASE_3 && printops.min_exp != EXP_PURE && printops.min_exp != EXP_SCIENTIFIC) {str += " "; str += i2s(printops.min_exp); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_4(_("fractions"), "fr", _("Determines how rational numbers are displayed (e.g. 5/4 = 1 + 1/4 = 1.25). 'long' removes limits on the size of the numerator and denonimator."), printops.number_fraction_format, _("off"), _("exact"), _("on"), _("combined"), _("long")); STR_AND_TABS_7(_("interval display"), "ivdisp", "", (adaptive_interval_display ? 0 : printops.interval_display + 1), _("adaptive"), _("significant"), _("interval"), _("plusminus"), _("midpoint"), _("upper"), _("lower")) STR_AND_TABS_BOOL(_("lowercase e"), "lowe", _("Use lowercase e for E-notation (5e2 = 5 * 10^2)."), printops.lower_case_e); STR_AND_TABS_BOOL(_("lowercase numbers"), "lownum", _("Use lowercase letters for number bases > 10."), printops.lower_case_numbers); STR_AND_TABS_SET(_("max decimals"), "maxdeci"); str += "("; str += _("off"); if(printops.max_decimals < 0) str += "*"; str += ", >= 0)"; if(printops.max_decimals >= 0) {str += " "; str += i2s(printops.max_decimals); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_SET(_("min decimals"), "mindeci"); str += "("; str += _("off"); if(printops.min_decimals < 0) str += "*"; str += ", >= 0)"; if(printops.min_decimals >= 0) {str += " "; str += i2s(printops.min_decimals); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_BOOL(_("repeating decimals"), "repdec", _("If activated, 1/6 is displayed as '0.1 666...', otherwise as '0.166667'."), printops.indicate_infinite_series); STR_AND_TABS_BOOL(_("round to even"), "rndeven", _("Determines whether halfway numbers are rounded upwards or towards the nearest even integer."), printops.round_halfway_to_even); STR_AND_TABS_BOOL(_("show ending zeroes"), "zeroes", _("If actived, zeroes are kept at the end of approximate numbers."), printops.show_ending_zeroes); STR_AND_TABS_BOOL(_("two's complement"), "twos", _("Enables two's complement representation for display of negative binary numbers."), printops.twos_complement); CHECK_IF_SCREEN_FILLED_HEADING_S(_("Parsing")); STR_AND_TABS_SET(_("decimal comma"), ""); SET_DESCRIPTION(_("Determines the default decimal separator.")); str += "("; str += _("locale"); if(b_decimal_comma < 0) str += "*"; str += ", "; str += _("off"); if(b_decimal_comma == 0) str += "*"; str += ", "; str += _("on"); if(b_decimal_comma > 0) str += "*"; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); if(CALCULATOR->getDecimalPoint() != COMMA) { STR_AND_TABS_BOOL(_("ignore comma"), "", _("Allows use of ',' as thousands separator."), evalops.parse_options.comma_as_separator); } if(CALCULATOR->getDecimalPoint() != DOT) { STR_AND_TABS_BOOL(_("ignore dot"), "", _("Allows use of '.' as thousands separator."), evalops.parse_options.dot_as_separator); } STR_AND_TABS_SET(_("input base"), "inbase"); str += "(2 - 36"; str += ", "; str += _("bin"); if(evalops.parse_options.base == BASE_BINARY) str += "*"; str += ", "; str += _("oct"); if(evalops.parse_options.base == BASE_OCTAL) str += "*"; str += ", "; str += _("dec"); if(evalops.parse_options.base == BASE_DECIMAL) str += "*"; str += ", "; str += _("hex"); if(evalops.parse_options.base == BASE_HEXADECIMAL) str += "*"; str += ", "; str += _("roman"); if(evalops.parse_options.base == BASE_ROMAN_NUMERALS) str += "*"; str += ")"; if(evalops.parse_options.base > 2 && evalops.parse_options.base != BASE_OCTAL && evalops.parse_options.base != BASE_DECIMAL && evalops.parse_options.base != BASE_HEXADECIMAL) {str += " "; str += i2s(evalops.parse_options.base); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_BOOL(_("limit implicit multiplication"), "limimpl", "", evalops.parse_options.limit_implicit_multiplication); STR_AND_TABS_2(_("parsing mode"), "parse", _("See 'help parsing mode'."), evalops.parse_options.parsing_mode, _("adaptive"), _("implicit first"), _("conventional")); STR_AND_TABS_2(_("read precision"), "readprec", _("If activated, numbers be interpreted as approximate with precision equal to the number of significant digits. Most useful in combination with 'interval arithmetic' (3.20 = 3.20+/-0.0005)."), evalops.parse_options.read_precision, _("off"), _("always"), _("when decimals")) STR_AND_TABS_BOOL(_("rpn syntax"), "rpnsyn", "", evalops.parse_options.rpn); CHECK_IF_SCREEN_FILLED_HEADING_S(_("Units")); STR_AND_TABS_BOOL(_("all prefixes"), "allpref", _("Enables automatic use of hecto, deca, deci, and centi."), printops.use_all_prefixes); STR_AND_TABS_SET(_("autoconversion"), "conv"); SET_DESCRIPTION(_("Controls automatic unit conversion of the result. 'optimalsi' always converts non-SI units, while 'optimal' only converts to more optimal unit expressions, with less units and exponents.")); str += "("; str += (_("none")); if(evalops.auto_post_conversion == POST_CONVERSION_NONE && evalops.mixed_units_conversion == MIXED_UNITS_CONVERSION_NONE) str += "*"; str += ", "; str += _("optimal"); if(evalops.auto_post_conversion == POST_CONVERSION_OPTIMAL) str += "*"; str += ", "; str += _("base"); if(evalops.auto_post_conversion == POST_CONVERSION_BASE) str += "*"; str += ", "; str += _("optimalsi"); if(evalops.auto_post_conversion == POST_CONVERSION_OPTIMAL_SI) str += "*"; str += ", "; str += _("mixed"); if(evalops.auto_post_conversion == POST_CONVERSION_NONE && evalops.mixed_units_conversion > MIXED_UNITS_CONVERSION_NONE) str += "*"; str += ")"; CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); STR_AND_TABS_BOOL(_("currency conversion"), "curconv", _("Enables automatic conversion to the local currency when optimal unit conversion is enabled."), evalops.local_currency_conversion); STR_AND_TABS_BOOL(_("denominator prefixes"), "denpref", _("Enables automatic use of prefixes in the denominator of unit expressions."), printops.use_denominator_prefix); STR_AND_TABS_BOOL(_("place units separately"), "unitsep", _("If activated, units are separated from variables at the end of the result."), printops.place_units_separately); STR_AND_TABS_BOOL(_("prefixes"), "pref", _("Enables automatic use of prefixes in the result."), printops.use_unit_prefixes); STR_AND_TABS_BOOL(_("sync units"), "sync", "", evalops.sync_units); STR_AND_TABS_SET(_("update exchange rates"), "upxrates"); str += "(-1 = "; str += _("ask"); if(auto_update_exchange_rates < 0) str += "*"; str += ", 0 = "; str += _("never"); if(auto_update_exchange_rates == 0) str += "*"; str += ", > 0 = "; str += _("days"); str += ")"; if(auto_update_exchange_rates > 0) {str += " "; str += i2s(auto_update_exchange_rates); str += "*";} CHECK_IF_SCREEN_FILLED_PUTS(str.c_str()); CHECK_IF_SCREEN_FILLED_HEADING_S(_("Other")); STR_AND_TABS_BOOL(_("rpn"), "", _("Activates the Reverse Polish Notation stack."), rpn_mode); STR_AND_TABS_YESNO(_("save definitions"), "", _("Save functions, units, and variables on exit."), save_defs_on_exit); STR_AND_TABS_YESNO(_("save mode"), "", _("Save settings on exit."), save_mode_on_exit); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "assume", _("assume"))) { puts(""); PUTS_UNICODE(_("Set default assumptions for unknown variables.")); Assumptions *ass = CALCULATOR->defaultAssumptions(); str = "("; str += _("unknown"); if(ass->sign() == ASSUMPTION_SIGN_UNKNOWN) str += "*"; str += ", "; str += _("non-zero"); if(ass->sign() == ASSUMPTION_SIGN_NONZERO) str += "*"; str += ", "; str += _("positive"); if(ass->sign() == ASSUMPTION_SIGN_POSITIVE) str += "*"; str += ", "; str += _("negative"); if(ass->sign() == ASSUMPTION_SIGN_NEGATIVE) str += "*"; str += ", "; str += _("non-positive"); if(ass->sign() == ASSUMPTION_SIGN_NONPOSITIVE) str += "*"; str += ", "; str += _("non-negative"); if(ass->sign() == ASSUMPTION_SIGN_NONNEGATIVE) str += "*"; str += " +\n"; str += _("number"); if(ass->type() == ASSUMPTION_TYPE_NUMBER) str += "*"; str += ", "; str += _("real"); if(ass->type() == ASSUMPTION_TYPE_REAL) str += "*"; str += ", "; str += _("rational"); if(ass->type() == ASSUMPTION_TYPE_RATIONAL) str += "*"; str += ", "; str += _("integer"); if(ass->type() == ASSUMPTION_TYPE_INTEGER) str += "*"; str += ")"; PUTS_UNICODE(str.c_str()); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "save", _("save")) || EQUALS_IGNORECASE_AND_LOCAL(str, "store", _("store"))) { puts(""); PUTS_UNICODE(_("Saves the current result in a variable with the specified name. You may optionally also provide a category (default \"Temporary\") and a title.")); PUTS_UNICODE(_("If name equals \"mode\" or \"definitions\", the current mode and definitions, respectively, will be saved.")); puts(""); PUTS_UNICODE(_("Example: store var1.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "variable", _("variable"))) { puts(""); PUTS_UNICODE(_("Create a variables with the specified name and expression.")); puts(""); PUTS_UNICODE(_("Example: variable var1 pi / 2.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "function", _("function"))) { puts(""); PUTS_UNICODE(_("Creates a function with the specified name and expression.")); PUTS_UNICODE(_("Use '\\x', '\\y', '\\z', '\\a', etc. for arguments in the expression.")); puts(""); PUTS_UNICODE(_("Example: function func1 5*\\x.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "delete", _("delete"))) { puts(""); PUTS_UNICODE(_("Removes the user-defined variable or function with the specified name.")); puts(""); PUTS_UNICODE(_("Example: delete var1.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "mode", _("mode"))) { puts(""); PUTS_UNICODE(_("Displays the current mode.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "list", _("list")) || EQUALS_IGNORECASE_AND_LOCAL(str, "find", _("find"))) { puts(""); PUTS_UNICODE(_("Displays a list of variables, functions and units.")); PUTS_UNICODE(_("Enter with argument 'currencies', 'functions', 'variables' or 'units' to show a list of all currencies, functions, variables or units. Enter a search term to find matching variables, functions, and/or units. If command is called with no argument all user-definied objects are listed.")); puts(""); PUTS_UNICODE(_("Example: list functions.")); PUTS_UNICODE(_("Example: find dinar.")); PUTS_UNICODE(_("Example: find variables planck.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "info", _("info"))) { puts(""); PUTS_UNICODE(_("Displays information about a function, variable or unit.")); puts(""); PUTS_UNICODE(_("Example: info sin.")); puts(""); } else if(canfetch && EQUALS_IGNORECASE_AND_LOCAL(str, "exrates", _("exrates"))) { puts(""); PUTS_UNICODE(_("Downloads current exchange rates from the Internet.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "rpn", _("rpn"))) { puts(""); PUTS_UNICODE(_("(De)activates the Reverse Polish Notation stack and syntax.")); puts(""); PUTS_UNICODE(_("\"syntax\" activates only the RPN syntax and \"stack\" enables the RPN stack.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "clear stack", _("clear stack"))) { puts(""); PUTS_UNICODE(_("Clears the entire RPN stack.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "pop", _("pop"))) { puts(""); PUTS_UNICODE(_("Removes the top of the RPN stack or the value at the specified index.")); puts(""); PUTS_UNICODE(_("Index 1 is the top of stack and negative index values counts from the bottom of the stack.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "stack", _("stack"))) { puts(""); PUTS_UNICODE(_("Displays the RPN stack.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "swap", _("swap"))) { puts(""); PUTS_UNICODE(_("Swaps position of values on the RPN stack.")); puts(""); FPUTS_UNICODE(_("If no index is specified, the values on the top of the stack (index 1 and index 2) will be swapped and if only one index is specified, the value at this index will be swapped with the top value."), stdout); fputs(" ", stdout); PUTS_UNICODE(_("Index 1 is the top of stack and negative index values counts from the bottom of the stack.")); puts(""); PUTS_UNICODE(_("Example: swap 2 4")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "copy", _("copy"))) { puts(""); PUTS_UNICODE(_("Duplicates a value on the RPN stack to the top of the stack.")); puts(""); FPUTS_UNICODE(_("If no index is specified, the top of the stack is duplicated."), stdout); fputs(" ", stdout); PUTS_UNICODE(_("Index 1 is the top of stack and negative index values counts from the bottom of the stack.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "rotate", _("rotate"))) { puts(""); PUTS_UNICODE(_("Rotates the RPN stack up (default) or down.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "move", _("move"))) { puts(""); PUTS_UNICODE(_("Changes the position of a value on the RPN stack.")); puts(""); PUTS_UNICODE(_("Index 1 is the top of stack and negative index values counts from the bottom of the stack.")); puts(""); PUTS_UNICODE(_("Example: move 2 4")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "base", _("base"))) { puts(""); PUTS_UNICODE(_("Sets the result number base (equivalent to set base).")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "exact", _("exact"))) { puts(""); PUTS_UNICODE(_("Equivalent to set approximation exact.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "approximate", _("approximate"))) { puts(""); PUTS_UNICODE(_("Equivalent to set approximation try exact.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "convert", _("convert")) || EQUALS_IGNORECASE_AND_LOCAL(str, "to", _("to"))) { INIT_SCREEN_CHECK CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Converts units or changes number base in current result.")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Possible values:")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("- a unit (e.g. meter)")); CHECK_IF_SCREEN_FILLED_PUTS(_("prepend with ? to request the optimal prefix")); CHECK_IF_SCREEN_FILLED_PUTS(_("prepend with + or - to force/disable use of mixed units")); CHECK_IF_SCREEN_FILLED_PUTS(_("- a unit expression (e.g. km/h)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- a physical constant (e.g. c)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- base (convert to base units)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- optimal (convert to optimal unit)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- mixed (convert to mixed units, e.g. hours + minutes)")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("- bin / binary (show as binary number)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- oct / octal (show as octal number)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- duo / duodecimal (show as duodecimal number)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- hex / hexadecimal (show as hexadecimal number)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- sex / sexagesimal (show as sexagesimal number)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- roman (show as roman numerals)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- time (show in time format)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- bases (show as binary, octal, decimal and hexadecimal number)")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("- rectangular / cartesian (show complex numbers in rectangular form)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- exponential (show complex numbers in exponential form)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- polar (show complex numbers in polar form)")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("- fraction (show result in combined fractional format)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- factors (factorize result)")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("- utc (show UTC date)")); CHECK_IF_SCREEN_FILLED_PUTS(_("- calendars")); CHECK_IF_SCREEN_FILLED_PUTS(""); CHECK_IF_SCREEN_FILLED_PUTS(_("Example: to ?g")); CHECK_IF_SCREEN_FILLED_PUTS(""); if(EQUALS_IGNORECASE_AND_LOCAL(str, "to", _("to"))) { CHECK_IF_SCREEN_FILLED_PUTS(_("This command can also be typed directly at the end of the mathematical expression.")); CHECK_IF_SCREEN_FILLED_PUTS(""); } } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "quit", _("quit")) || EQUALS_IGNORECASE_AND_LOCAL(str, "exit", _("exit"))) { puts(""); PUTS_UNICODE(_("Terminates this program.")); puts(""); } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "parsing mode", _("parsing mode"))) { puts(""); PUTS_BOLD(_("conventional")); puts(_("Implicit multiplication does not differ from explicit multiplication (\"12/2(1+2) = 12/2*3 = 18\", \"5x/5y = 5*x/5*y = xy\").")); puts(""); PUTS_BOLD(_("implicit first")); puts(_("Implicit multiplication is parsed before explicit multiplication (\"12/2(1+2) = 12/(2*3) = 2\", \"5x/5y = (5*x)/(5*y) = x/y\").")); puts(""); PUTS_BOLD(_("adaptive")); puts(_("The default adaptive mode works as the \"implicit first\" mode, unless spaces are found (\"1/5x = 1/(5*x)\", but \"1/5 x = (1/5)*x\"). In the adaptive mode unit expressions are parsed separately (\"5 m/5 m/s = (5*m)/(5*(m/s)) = 1 s\").")); puts(""); puts(_("Function arguments without parentheses are an exception, where implicit multiplication in front of variables and units is parsed first regardless of mode (\"sqrt 2x = sqrt(2x)\").")); puts(""); } else { goto show_info; } //qalc command } else if(EQUALS_IGNORECASE_AND_LOCAL(str, "quit", _("quit")) || EQUALS_IGNORECASE_AND_LOCAL(str, "exit", _("exit"))) { #ifdef HAVE_LIBREADLINE if(!cfile) { free(rlbuffer); } #endif break; } else if(explicit_command) { PUTS_UNICODE(_("Unknown command.")); puts(""); } else { size_t index = str.find_first_of(ID_WRAPS); if(index != string::npos) { printf(_("Illegal character, \'%c\', in expression."), str[index]); puts(""); } else { expression_str = str; execute_expression(); } } #ifdef HAVE_LIBREADLINE if(!cfile) { for(int i = history_length - 1; i >= 0; i--) { HIST_ENTRY *hist = history_get(i + history_base); if(hist && hist->line && strcmp(hist->line, rlbuffer) == 0) { hist = remove_history(i); if(hist) free_history_entry(hist); break; } } add_history(rlbuffer); free(rlbuffer); } #endif } if(cfile && cfile != stdin) { fclose(cfile); } handle_exit(); return 0; } void RPNRegisterAdded(string, int = 0) {} void RPNRegisterRemoved(int) {} void RPNRegisterChanged(string, int) {} bool display_errors(bool goto_input, int cols) { if(!CALCULATOR->message()) return false; while(true) { if(!hide_parse_errors || (CALCULATOR->message()->stage() != MESSAGE_STAGE_PARSING && CALCULATOR->message()->stage() != MESSAGE_STAGE_CONVERSION_PARSING)) { MessageType mtype = CALCULATOR->message()->type(); string str; if(goto_input) str += " "; if(mtype == MESSAGE_ERROR) { str += _("error"); str += ": "; } else if(mtype == MESSAGE_WARNING) { str += _("warning"); str += ": "; } str += CALCULATOR->message()->message(); if(cols) addLineBreaks(str, cols, true, goto_input ? 2 : 0, str.length()); PUTS_UNICODE(str.c_str()) } if(!CALCULATOR->nextMessage()) break; } return true; } void on_abort_display() { CALCULATOR->abort(); } void replace_quotation_marks(string &str) { if(cfile) return; size_t i1 = 0, i2 = 0; while(i1 + 2 < str.length()) { i1 = str.find_first_of("\"\'", i1); if(i1 == string::npos) break; i2 = str.find(str[i1], i1 + 1); if(i2 == string::npos) break; if(i2 - i1 > 2) { if(!text_length_is_one(str.substr(i1 + 1, i2 - i1 - 1))) { i1 = i2 + 1; continue; } } if(i1 > 1 && str[i1 - 1] == ' ' && is_not_in(OPERATORS SPACES, str[i1 - 2])) { if(printops.use_unicode_signs && str[i1 - 2] < 0) { size_t i3 = i1 - 2; while(i3 > 0 && str[i3] < 0 && (unsigned char) str[i3] < 0xC0) i3--; string str2 = str.substr(i3, i1 - i3 - 1); if(str2 != SIGN_DIVISION && str2 != SIGN_DIVISION_SLASH && str2 != SIGN_MULTIPLICATION && str2 != SIGN_MULTIDOT && str2 != SIGN_SMALLCIRCLE && str2 != SIGN_MULTIBULLET && str2 != SIGN_MINUS && str2 != SIGN_PLUS && str2 != SIGN_NOT_EQUAL && str2 != SIGN_GREATER_OR_EQUAL && str2 != SIGN_LESS_OR_EQUAL) { str.replace(i1 - 1, 2, "\033[3m"); i2 += 2; } else { str.replace(i1, 1, "\033[3m"); i2 += 3; } } else { str.replace(i1 - 1, 2, "\033[3m"); i2 += 2; } } else { str.replace(i1, 1, "\033[3m"); i2 += 3; } str.replace(i2, 1, "\033[23m"); i1 = i2 + 5; } } void ViewThread::run() { while(true) { void *x = NULL; if(!read(&x) || !x) break; MathStructure m(*((MathStructure*) x)); x = NULL; if(!read(&x)) break; CALCULATOR->startControl(); if(x) { PrintOptions po; po.preserve_format = true; po.show_ending_zeroes = evalops.parse_options.read_precision != DONT_READ_PRECISION && !CALCULATOR->usesIntervalArithmetic(); po.lower_case_e = printops.lower_case_e; po.lower_case_numbers = printops.lower_case_numbers; po.base_display = printops.base_display; po.twos_complement = printops.twos_complement; po.base = evalops.parse_options.base; po.abbreviate_names = false; po.digit_grouping = printops.digit_grouping; po.use_unicode_signs = printops.use_unicode_signs; po.multiplication_sign = printops.multiplication_sign; po.division_sign = printops.division_sign; po.short_multiplication = false; po.excessive_parenthesis = true; po.improve_division_multipliers = false; po.restrict_to_parent_precision = false; po.spell_out_logical_operators = printops.spell_out_logical_operators; po.interval_display = INTERVAL_DISPLAY_PLUSMINUS; MathStructure mp(*((MathStructure*) x)); read(&po.is_approximate); mp.format(po); parsed_text = mp.print(po); } printops.allow_non_usable = false; m.format(printops); result_text = m.print(printops); if(result_text == _("aborted")) { *printops.is_approximate = false; } b_busy = false; CALCULATOR->stopControl(); } } static bool wait_for_key_press(int timeout_ms) { #ifdef _WIN32 return WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), timeout_ms) == WAIT_OBJECT_0; #else fd_set in_set; struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = timeout_ms*1000; FD_ZERO(&in_set); FD_SET(STDIN_FILENO, &in_set); return select(FD_SETSIZE, &in_set, NULL, NULL, &timeout) > 0; #endif } void setResult(Prefix *prefix, bool update_parse, bool goto_input, size_t stack_index, bool register_moved, bool noprint) { if(i_maxtime < 0) return; b_busy = true; if(!view_thread->running && !view_thread->start()) {b_busy = false; return;} if(!interactive_mode || cfile) goto_input = false; string prev_result_text = result_text; result_text = "?"; if(update_parse) { parsed_text = _("aborted"); } if(!rpn_mode) stack_index = 0; if(stack_index != 0) { update_parse = false; } if(register_moved) { update_parse = false; } if(register_moved) { result_text = _("RPN Register Moved"); } printops.prefix = prefix; bool parsed_approx = false; if(stack_index == 0) { if(!view_thread->write((void*) mstruct)) {b_busy = false; view_thread->cancel(); return;} } else { MathStructure *mreg = CALCULATOR->getRPNRegister(stack_index + 1); if(!view_thread->write((void*) mreg)) {b_busy = false; view_thread->cancel(); return;} } if(update_parse) { if(adaptive_interval_display) { if(parsed_mstruct && parsed_mstruct->containsFunction(CALCULATOR->f_interval)) printops.interval_display = INTERVAL_DISPLAY_INTERVAL; else if(expression_str.find("+/-") != string::npos || expression_str.find("+/" SIGN_MINUS) != string::npos || expression_str.find("±") != string::npos) printops.interval_display = INTERVAL_DISPLAY_PLUSMINUS; else printops.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; } if(!view_thread->write((void *) parsed_mstruct)) {b_busy = false; view_thread->cancel(); return;} bool *parsed_approx_p = &parsed_approx; if(!view_thread->write(parsed_approx_p)) {b_busy = false; view_thread->cancel(); return;} } else { if(!view_thread->write((void *) NULL)) {b_busy = false; view_thread->cancel(); return;} } bool has_printed = false; if(i_maxtime != 0) { #ifndef CLOCK_MONOTONIC struct timeval tv; gettimeofday(&tv, NULL); long int i_timeleft = ((long int) t_end.tv_sec - tv.tv_sec) * 1000 + (t_end.tv_usec - tv.tv_usec) / 1000; #else struct timespec tv; clock_gettime(CLOCK_MONOTONIC, &tv); long int i_timeleft = ((long int) t_end.tv_sec - tv.tv_sec) * 1000 + (t_end.tv_usec - tv.tv_nsec / 1000) / 1000; #endif while(b_busy && view_thread->running && i_timeleft > 0) { sleep_ms(10); i_timeleft -= 10; } if(b_busy && view_thread->running) { on_abort_display(); i_maxtime = -1; } } else { int i = 0; while(b_busy && view_thread->running && i < 75) { sleep_ms(10); i++; } i = 0; if(b_busy && view_thread->running && !cfile) { if(!result_only) { FPUTS_UNICODE(_("Processing (press Enter to abort)"), stdout); has_printed = true; fflush(stdout); } } #ifdef HAVE_LIBREADLINE int c = 0; #else char c = 0; #endif while(b_busy && view_thread->running) { if(cfile) { sleep_ms(100); } else { if(wait_for_key_press(100)) { #ifdef HAVE_LIBREADLINE if(use_readline) { c = rl_read_key(); } else { if(read(STDIN_FILENO, &c, 1) == -1) c = 0; } #else if(read(STDIN_FILENO, &c, 1) == -1) c = 0; #endif if(c == '\n') { on_abort_display(); has_printed = false; } } else { if(!result_only) { printf("."); fflush(stdout); } sleep_ms(100); } } } } printops.prefix = NULL; if(noprint) { return; } b_busy = true; if(has_printed) printf("\n"); if(goto_input) printf("\n"); if(register_moved) { update_parse = true; parsed_text = result_text; } int cols = 0; if(goto_input) { #ifdef HAVE_LIBREADLINE int rows = 0; rl_get_screen_size(&rows, &cols); #else cols = 80; #endif } if(!result_only) display_errors(goto_input, cols); if(stack_index != 0) { RPNRegisterChanged(result_text, stack_index); } else { string strout; if(goto_input) strout += " "; size_t i_result = 0, i_result_u = 0; if(!result_only) { if(mstruct->isComparison()) strout += LEFT_PARENTHESIS; if(update_parse) { strout += parsed_text; } else { strout += prev_result_text; } if(mstruct->isComparison()) strout += RIGHT_PARENTHESIS; if(!(*printops.is_approximate) && !mstruct->isApproximate()) { strout += " = "; i_result_u = unicode_length(strout); i_result = strout.length(); } else { if(printops.use_unicode_signs) { strout += " " SIGN_ALMOST_EQUAL " "; i_result_u = unicode_length(strout); i_result = strout.length(); } else { strout += " = "; i_result_u = unicode_length(strout); i_result = strout.length(); strout += _("approx."); strout += " "; } } } if(!result_only && mstruct->isComparison()) { strout += LEFT_PARENTHESIS; strout += result_text.c_str(); strout += RIGHT_PARENTHESIS; } else { strout += result_text.c_str(); } if(goto_input) { if(!result_only && i_result_u > (size_t) cols / 2 && unicode_length(strout) > (size_t) cols) { strout[i_result - 1] = '\n'; strout.insert(i_result, " "); i_result_u = 2; } addLineBreaks(strout, cols, true, result_only ? 2 : i_result_u, i_result); replace_quotation_marks(strout); strout += "\n"; } PUTS_UNICODE(strout.c_str()); } b_busy = false; } void viewresult(Prefix *prefix = NULL) { setResult(prefix); } void result_display_updated() { IntervalDisplay ivdisp = printops.interval_display; printops.interval_display = INTERVAL_DISPLAY_PLUSMINUS; CALCULATOR->setMessagePrintOptions(printops); printops.interval_display = ivdisp; if(expression_executed) setResult(NULL, false); } void result_format_updated() { if(expression_executed) setResult(NULL, false); } void result_action_executed() { if(expression_executed) { printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); setResult(NULL, false); } } void result_prefix_changed(Prefix *prefix) { if(expression_executed) setResult(prefix, false); } void expression_calculation_updated() { if(expression_executed && !avoid_recalculation && !rpn_mode) { hide_parse_errors = true; execute_expression(); hide_parse_errors = false; } } void expression_format_updated(bool reparse) { if(rpn_mode) reparse = false; if(!reparse && !rpn_mode) { avoid_recalculation = true; } if(reparse) { execute_expression(); } } void on_abort_command() { CALCULATOR->abort(); int msecs = 5000; while(b_busy && msecs > 0) { sleep_ms(10); msecs -= 10; } if(b_busy) { command_thread->cancel(); b_busy = false; CALCULATOR->stopControl(); command_aborted = true; } } void CommandThread::run() { enableAsynchronousCancel(); while(true) { int command_type = 0; if(!read(&command_type)) break; void *x = NULL; if(!read(&x) || !x) break; CALCULATOR->startControl(); switch(command_type) { case COMMAND_FACTORIZE: { if(!((MathStructure*) x)->integerFactorize()) { ((MathStructure*) x)->factorize(evalops, true, 1, 0, true, 2, NULL, m_undefined, true, false, -1); } break; } case COMMAND_EXPAND_PARTIAL_FRACTIONS: { ((MathStructure*) x)->expandPartialFractions(evalops); break; } case COMMAND_SIMPLIFY: { ((MathStructure*) x)->simplify(evalops); break; } case COMMAND_EVAL: { ((MathStructure*) x)->eval(evalops); break; } } b_busy = false; CALCULATOR->stopControl(); } } void execute_command(int command_type, bool show_result) { if(i_maxtime < 0) return; b_busy = true; command_aborted = false; if(!command_thread->running && !command_thread->start()) {b_busy = false; return;} if(!command_thread->write(command_type)) {command_thread->cancel(); b_busy = false; return;} MathStructure *mfactor = new MathStructure(*mstruct); if(!command_thread->write((void *) mfactor)) {command_thread->cancel(); mfactor->unref(); b_busy = false; return;} if(i_maxtime != 0) { #ifndef CLOCK_MONOTONIC struct timeval tv; gettimeofday(&tv, NULL); long int i_timeleft = ((long int) t_end.tv_sec - tv.tv_sec) * 1000 + (t_end.tv_usec - tv.tv_usec) / 1000; #else struct timespec tv; clock_gettime(CLOCK_MONOTONIC, &tv); long int i_timeleft = ((long int) t_end.tv_sec - tv.tv_sec) * 1000 + (t_end.tv_usec - tv.tv_nsec / 1000) / 1000; #endif while(b_busy && command_thread->running && i_timeleft > 0) { sleep_ms(10); i_timeleft -= 10; } if(b_busy && command_thread->running) { on_abort_command(); i_maxtime = -1; printf(_("aborted")); printf("\n"); } } else { int i = 0; bool has_printed = false; while(b_busy && command_thread->running && i < 75) { sleep_ms(10); i++; } i = 0; if(b_busy && command_thread->running && !cfile) { if(!result_only) { switch(command_type) { case COMMAND_FACTORIZE: { FPUTS_UNICODE(_("Factorizing (press Enter to abort)"), stdout); break; } case COMMAND_EXPAND_PARTIAL_FRACTIONS: { FPUTS_UNICODE(_("Expanding partial fractions…"), stdout); break; } case COMMAND_SIMPLIFY: { FPUTS_UNICODE(_("Simplifying (press Enter to abort)"), stdout); break; } case COMMAND_EVAL: { FPUTS_UNICODE(_("Calculating (press Enter to abort)"), stdout); break; } } has_printed = true; fflush(stdout); } } #ifdef HAVE_LIBREADLINE int c = 0; #else char c = 0; #endif while(b_busy && command_thread->running) { if(cfile) { sleep_ms(100); } else { if(wait_for_key_press(100)) { #ifdef HAVE_LIBREADLINE if(use_readline) { c = rl_read_key(); } else { if(read(STDIN_FILENO, &c, 1) == -1) c = 0; } #else if(read(STDIN_FILENO, &c, 1) == -1) c = 0; #endif if(c == '\n') { on_abort_command(); } } else { if(!result_only) { printf("."); fflush(stdout); } sleep_ms(100); } } } if(has_printed) printf("\n"); } b_busy = false; if(!command_aborted) { mstruct->unref(); mstruct = mfactor; switch(command_type) { case COMMAND_FACTORIZE: { printops.allow_factorization = true; break; } case COMMAND_SIMPLIFY: { printops.allow_factorization = false; break; } default: { printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); } } if(show_result) setResult(NULL, false); } } void execute_expression(bool goto_input, bool do_mathoperation, MathOperation op, MathFunction *f, bool do_stack, size_t stack_index, bool check_exrates) { if(i_maxtime < 0) return; string str; bool do_bases = false, do_factors = false, do_fraction = false, do_pfe = false, do_calendars = false; avoid_recalculation = false; if(!interactive_mode) goto_input = false; if(do_stack) { } else { str = expression_str; string from_str = str, to_str; if(CALCULATOR->separateToExpression(from_str, to_str, evalops, true)) { remove_duplicate_blanks(to_str); string to_str1, to_str2; size_t ispace = to_str.find_first_of(SPACES); if(ispace != string::npos) { to_str1 = to_str.substr(0, ispace); remove_blank_ends(to_str1); to_str2 = to_str.substr(ispace + 1); remove_blank_ends(to_str2); } if(equalsIgnoreCase(to_str, "hex") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "hexadecimal", _("hexadecimal"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_HEXADECIMAL; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; return; } else if(equalsIgnoreCase(to_str, "bin") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "binary", _("binary"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_BINARY; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; return; } else if(equalsIgnoreCase(to_str, "oct") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "octal", _("octal"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_OCTAL; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; return; } else if(equalsIgnoreCase(to_str, "duo") || EQUALS_IGNORECASE_AND_LOCAL(to_str, "duodecimal", _("duodecimal"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_DUODECIMAL; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; return; } else if(equalsIgnoreCase(to_str, "roman") || equalsIgnoreCase(to_str, _("roman"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_ROMAN_NUMERALS; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; return; } else if(equalsIgnoreCase(to_str, "sexa") || equalsIgnoreCase(to_str, "sexagesimal") || equalsIgnoreCase(to_str, _("sexagesimal"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_SEXAGESIMAL; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; return; } else if(equalsIgnoreCase(to_str, "time") || equalsIgnoreCase(to_str, _("time"))) { int save_base = printops.base; expression_str = from_str; printops.base = BASE_TIME; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; return; } else if(equalsIgnoreCase(to_str, "utc") || equalsIgnoreCase(to_str, "gmt")) { expression_str = from_str; printops.time_zone = TIME_ZONE_UTC; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.time_zone = TIME_ZONE_LOCAL; expression_str = str; return; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "fraction", _("fraction")) || to_str == "frac") { str = from_str; do_fraction = true; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "factors", _("factors")) || to_str == "factor") { str = from_str; do_factors = true; } else if(equalsIgnoreCase(to_str, "partial fraction") || equalsIgnoreCase(to_str, _("partial fraction")) || to_str == "partial") { str = from_str; do_pfe = true; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "bases", _("bases"))) { do_bases = true; str = from_str; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "calendars", _("calendars"))) { do_calendars = true; str = from_str; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "rectangular", _("rectangular")) || EQUALS_IGNORECASE_AND_LOCAL(to_str, "cartesian", _("cartesian")) || to_str == "rect") { expression_str = from_str; ComplexNumberForm save_complex_number_form = evalops.complex_number_form; evalops.complex_number_form = COMPLEX_NUMBER_FORM_RECTANGULAR; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); evalops.complex_number_form = save_complex_number_form; expression_str = str; return; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "exponential", _("exponential")) || to_str == "exp") { expression_str = from_str; ComplexNumberForm save_complex_number_form = evalops.complex_number_form; evalops.complex_number_form = COMPLEX_NUMBER_FORM_EXPONENTIAL; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); evalops.complex_number_form = save_complex_number_form; expression_str = str; return; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "polar", _("polar"))) { expression_str = from_str; ComplexNumberForm save_complex_number_form = evalops.complex_number_form; evalops.complex_number_form = COMPLEX_NUMBER_FORM_POLAR; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); evalops.complex_number_form = save_complex_number_form; expression_str = str; return; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "optimal", _("optimal"))) { expression_str = from_str; bool b_units_saved = evalops.parse_options.units_enabled; evalops.parse_options.units_enabled = true; AutoPostConversion save_auto_post_conversion = evalops.auto_post_conversion; evalops.auto_post_conversion = POST_CONVERSION_OPTIMAL_SI; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); evalops.auto_post_conversion = save_auto_post_conversion; expression_str = str; evalops.parse_options.units_enabled = b_units_saved; return; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "base", _("base"))) { expression_str = from_str; bool b_units_saved = evalops.parse_options.units_enabled; evalops.parse_options.units_enabled = true; AutoPostConversion save_auto_post_conversion = evalops.auto_post_conversion; evalops.auto_post_conversion = POST_CONVERSION_BASE; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); evalops.auto_post_conversion = save_auto_post_conversion; expression_str = str; evalops.parse_options.units_enabled = b_units_saved; return; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str1, "base", _("base")) && s2i(to_str2) >= 2 && (s2i(to_str2) <= 32 || s2i(to_str2) == BASE_SEXAGESIMAL)) { int save_base = printops.base; expression_str = from_str; printops.base = s2i(to_str2); execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); printops.base = save_base; expression_str = str; return; } else if(EQUALS_IGNORECASE_AND_LOCAL(to_str, "mixed", _("mixed"))) { expression_str = from_str; bool b_units_saved = evalops.parse_options.units_enabled; evalops.parse_options.units_enabled = true; AutoPostConversion save_auto_post_conversion = evalops.auto_post_conversion; MixedUnitsConversion save_mixed_units_conversion = evalops.mixed_units_conversion; evalops.auto_post_conversion = POST_CONVERSION_NONE; evalops.mixed_units_conversion = MIXED_UNITS_CONVERSION_FORCE_INTEGER; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); evalops.auto_post_conversion = save_auto_post_conversion; evalops.mixed_units_conversion = save_mixed_units_conversion; expression_str = str; evalops.parse_options.units_enabled = b_units_saved; return; } else if(!evalops.parse_options.units_enabled) { evalops.parse_options.units_enabled = true; execute_expression(goto_input, do_mathoperation, op, f, do_stack, stack_index); evalops.parse_options.units_enabled = false; return; } } } expression_executed = true; b_busy = true; size_t stack_size = 0; CALCULATOR->resetExchangeRatesUsed(); if(do_stack) { stack_size = CALCULATOR->RPNStackSize(); CALCULATOR->setRPNRegister(stack_index + 1, CALCULATOR->unlocalizeExpression(str, evalops.parse_options), 0, evalops, parsed_mstruct, NULL); } else if(rpn_mode) { stack_size = CALCULATOR->RPNStackSize(); if(do_mathoperation) { if(f) CALCULATOR->calculateRPN(f, 0, evalops, parsed_mstruct); else CALCULATOR->calculateRPN(op, 0, evalops, parsed_mstruct); } else { string str2 = CALCULATOR->unlocalizeExpression(str, evalops.parse_options); CALCULATOR->parseSigns(str2); remove_blank_ends(str2); if(str2.length() == 1) { do_mathoperation = true; switch(str2[0]) { case '^': {CALCULATOR->calculateRPN(OPERATION_RAISE, 0, evalops, parsed_mstruct); break;} case '+': {CALCULATOR->calculateRPN(OPERATION_ADD, 0, evalops, parsed_mstruct); break;} case '-': {CALCULATOR->calculateRPN(OPERATION_SUBTRACT, 0, evalops, parsed_mstruct); break;} case '*': {CALCULATOR->calculateRPN(OPERATION_MULTIPLY, 0, evalops, parsed_mstruct); break;} case '/': {CALCULATOR->calculateRPN(OPERATION_DIVIDE, 0, evalops, parsed_mstruct); break;} case '&': {CALCULATOR->calculateRPN(OPERATION_BITWISE_AND, 0, evalops, parsed_mstruct); break;} case '|': {CALCULATOR->calculateRPN(OPERATION_BITWISE_OR, 0, evalops, parsed_mstruct); break;} case '~': {CALCULATOR->calculateRPNBitwiseNot(0, evalops, parsed_mstruct); break;} case '!': {CALCULATOR->calculateRPN(CALCULATOR->f_factorial, 0, evalops, parsed_mstruct); break;} case '>': {CALCULATOR->calculateRPN(OPERATION_GREATER, 0, evalops, parsed_mstruct); break;} case '<': {CALCULATOR->calculateRPN(OPERATION_LESS, 0, evalops, parsed_mstruct); break;} case '=': {CALCULATOR->calculateRPN(OPERATION_EQUALS, 0, evalops, parsed_mstruct); break;} default: {do_mathoperation = false;} } } else if(str2.length() == 2) { if(str2 == "**") { CALCULATOR->calculateRPN(OPERATION_RAISE, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == "!!") { CALCULATOR->calculateRPN(CALCULATOR->f_factorial2, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == "!=" || str == "=!" || str == "<>") { CALCULATOR->calculateRPN(OPERATION_NOT_EQUALS, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == "<=" || str == "=<") { CALCULATOR->calculateRPN(OPERATION_EQUALS_LESS, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == ">=" || str == "=>") { CALCULATOR->calculateRPN(OPERATION_EQUALS_GREATER, 0, evalops, parsed_mstruct); do_mathoperation = true; } else if(str2 == "==") { CALCULATOR->calculateRPN(OPERATION_EQUALS, 0, evalops, parsed_mstruct); do_mathoperation = true; } } if(!do_mathoperation) { bool had_nonnum = false, test_function = true; int in_par = 0; for(size_t i = 0; i < str2.length(); i++) { if(is_in(NUMBERS, str2[i])) { if(!had_nonnum || in_par) { test_function = false; break; } } else if(str2[i] == '(') { if(in_par || !had_nonnum) { test_function = false; break; } in_par = i; } else if(str2[i] == ')') { if(i != str2.length() - 1) { test_function = false; break; } } else if(str2[i] == ' ') { if(!in_par) { test_function = false; break; } } else if(is_in(NOT_IN_NAMES, str2[i])) { test_function = false; break; } else { if(in_par) { test_function = false; break; } had_nonnum = true; } } f = NULL; if(test_function) { if(in_par) f = CALCULATOR->getActiveFunction(str2.substr(0, in_par)); else f = CALCULATOR->getActiveFunction(str2); } if(f && f->minargs() > 0) { do_mathoperation = true; CALCULATOR->calculateRPN(f, 0, evalops, parsed_mstruct); } else { CALCULATOR->RPNStackEnter(str2, 0, evalops, parsed_mstruct, NULL); } } } } else { CALCULATOR->calculate(mstruct, CALCULATOR->unlocalizeExpression(str, evalops.parse_options), 0, evalops, parsed_mstruct, NULL); } bool has_printed = false; if(i_maxtime != 0) { #ifndef CLOCK_MONOTONIC struct timeval tv; gettimeofday(&tv, NULL); long int i_timeleft = ((long int) t_end.tv_sec - tv.tv_sec) * 1000 + (t_end.tv_usec - tv.tv_usec) / 1000; #else struct timespec tv; clock_gettime(CLOCK_MONOTONIC, &tv); long int i_timeleft = ((long int) t_end.tv_sec - tv.tv_sec) * 1000 + (t_end.tv_usec - tv.tv_nsec / 1000) / 1000; #endif while(CALCULATOR->busy() && i_timeleft > 0) { sleep_ms(10); i_timeleft -= 10; } if(CALCULATOR->busy()) { CALCULATOR->abort(); i_maxtime = -1; printf(_("aborted")); printf("\n"); } } else { int i = 0; while(CALCULATOR->busy() && i < 75) { sleep_ms(10); i++; } i = 0; if(CALCULATOR->busy() && !cfile) { if(!result_only) { FPUTS_UNICODE(_("Calculating (press Enter to abort)"), stdout); fflush(stdout); has_printed = true; } } #ifdef HAVE_LIBREADLINE int c = 0; #else char c = 0; #endif while(CALCULATOR->busy()) { if(cfile) { sleep_ms(100); } else { if(wait_for_key_press(100)) { #ifdef HAVE_LIBREADLINE if(use_readline) { c = rl_read_key(); } else { if(read(STDIN_FILENO, &c, 1) == -1) c = 0; } #else if(read(STDIN_FILENO, &c, 1) == -1) c = 0; #endif if(c == '\n') { CALCULATOR->abort(); avoid_recalculation = true; has_printed = false; } } else { if(!result_only) { printf("."); fflush(stdout); } sleep_ms(100); } } } if(has_printed) printf("\n"); } b_busy = false; if(rpn_mode && (!do_stack || stack_index == 0)) { mstruct->unref(); mstruct = CALCULATOR->getRPNRegister(1); if(!mstruct) mstruct = new MathStructure(); else mstruct->ref(); } if(!do_mathoperation && check_exrates && check_exchange_rates()) { execute_expression(goto_input, do_mathoperation, op, f, rpn_mode, do_stack ? stack_index : 0, false); return; } if(do_factors || do_pfe) { if(do_stack && stack_index != 0) { MathStructure *save_mstruct = mstruct; mstruct = CALCULATOR->getRPNRegister(stack_index + 1); execute_command(do_pfe ? COMMAND_EXPAND_PARTIAL_FRACTIONS : COMMAND_FACTORIZE, false); mstruct = save_mstruct; } else { execute_command(do_pfe ? COMMAND_EXPAND_PARTIAL_FRACTIONS : COMMAND_FACTORIZE, false); } } //update "ans" variables if(!do_stack || stack_index == 0) { MathStructure m4(vans[3]->get()); m4.replace(vans[4], vans[4]->get()); vans[4]->set(m4); MathStructure m3(vans[2]->get()); m3.replace(vans[3], vans[4]); vans[3]->set(m3); MathStructure m2(vans[1]->get()); m2.replace(vans[2], vans[3]); vans[2]->set(m2); MathStructure m1(vans[0]->get()); m1.replace(vans[1], vans[2]); vans[1]->set(m1); mstruct->replace(vans[0], vans[1]); vans[0]->set(*mstruct); } if(do_stack && stack_index > 0) { } else if(rpn_mode && do_mathoperation) { result_text = _("RPN Operation"); } else { result_text = str; } printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); if(rpn_mode && (!do_stack || stack_index == 0)) { if(CALCULATOR->RPNStackSize() < stack_size) { RPNRegisterRemoved(1); } else if(CALCULATOR->RPNStackSize() > stack_size) { RPNRegisterAdded(""); } } if(do_calendars && mstruct->isDateTime()) { setResult(NULL, (!do_stack || stack_index == 0), false, do_stack ? stack_index : 0, false, true); if(goto_input) printf("\n"); show_calendars(*mstruct->datetime(), goto_input); if(goto_input) printf("\n"); } else if(do_bases) { int save_base = printops.base; printops.base = BASE_BINARY; setResult(NULL, (!do_stack || stack_index == 0), false, do_stack ? stack_index : 0, false, true); string base_str = result_text; base_str += " = "; printops.base = BASE_OCTAL; setResult(NULL, false, false, do_stack ? stack_index : 0, false, true); base_str += result_text; base_str += " = "; printops.base = BASE_DECIMAL; setResult(NULL, false, false, do_stack ? stack_index : 0, false, true); base_str += result_text; base_str += " = "; printops.base = BASE_HEXADECIMAL; setResult(NULL, false, false, do_stack ? stack_index : 0, false, true); base_str += result_text; if(has_printed) printf("\n"); if(goto_input) { base_str.insert(0, " "); printf("\n"); } if(!result_only) { string prestr = parsed_text; if(!(*printops.is_approximate) && !mstruct->isApproximate()) { prestr += " = "; } else { if(printops.use_unicode_signs) { prestr += " " SIGN_ALMOST_EQUAL " "; } else { prestr += " = "; prestr += _("approx."); prestr += " "; } } base_str = prestr + base_str; } result_text = base_str; if(goto_input) { int cols = 0; #ifdef HAVE_LIBREADLINE int rows = 0; rl_get_screen_size(&rows, &cols); #else cols = 80; #endif addLineBreaks(base_str, cols, false, 2, base_str.length()); replace_quotation_marks(base_str); } PUTS_UNICODE(base_str.c_str()); printops.base = save_base; if(goto_input) printf("\n"); } else if(do_fraction) { NumberFractionFormat save_format = printops.number_fraction_format; bool save_rfl = printops.restrict_fraction_length; printops.restrict_fraction_length = false; if(((!do_stack || stack_index == 0) && mstruct->isNumber()) || (do_stack && stack_index != 0 && CALCULATOR->getRPNRegister(stack_index + 1)->isNumber())) printops.number_fraction_format = FRACTION_COMBINED; else printops.number_fraction_format = FRACTION_FRACTIONAL; setResult(NULL, (!do_stack || stack_index == 0), goto_input, do_stack ? stack_index : 0); printops.restrict_fraction_length = save_rfl; printops.number_fraction_format = save_format; } else { setResult(NULL, (!do_stack || stack_index == 0), goto_input, do_stack ? stack_index : 0); } } /* save mode to file */ bool save_mode() { return save_preferences(true); } /* remember current mode */ void set_saved_mode() { saved_precision = CALCULATOR->getPrecision(); saved_interval = CALCULATOR->usesIntervalArithmetic(); saved_adaptive_interval_display = adaptive_interval_display; saved_variable_units_enabled = CALCULATOR->variableUnitsEnabled(); saved_printops = printops; saved_printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); saved_evalops = evalops; saved_assumption_type = CALCULATOR->defaultAssumptions()->type(); saved_assumption_sign = CALCULATOR->defaultAssumptions()->sign(); } void load_preferences() { printops.is_approximate = new bool(false); printops.prefix = NULL; printops.use_min_decimals = false; printops.use_denominator_prefix = true; printops.min_decimals = 0; printops.use_max_decimals = false; printops.max_decimals = 2; printops.base = 10; printops.min_exp = EXP_PRECISION; printops.negative_exponents = false; printops.sort_options.minus_last = true; printops.indicate_infinite_series = false; printops.show_ending_zeroes = false; printops.digit_grouping = DIGIT_GROUPING_NONE; printops.round_halfway_to_even = false; printops.number_fraction_format = FRACTION_DECIMAL; printops.restrict_fraction_length = false; printops.abbreviate_names = true; printops.use_unicode_signs = false; printops.use_unit_prefixes = true; printops.spacious = true; printops.short_multiplication = true; printops.limit_implicit_multiplication = false; printops.place_units_separately = true; printops.use_all_prefixes = false; printops.excessive_parenthesis = false; printops.allow_non_usable = false; printops.lower_case_numbers = false; printops.lower_case_e = false; printops.base_display = BASE_DISPLAY_NORMAL; printops.twos_complement = true; printops.division_sign = DIVISION_SIGN_SLASH; printops.multiplication_sign = MULTIPLICATION_SIGN_ASTERISK; printops.allow_factorization = false; printops.spell_out_logical_operators = true; printops.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; evalops.parse_options.parsing_mode = PARSING_MODE_ADAPTIVE; evalops.approximation = APPROXIMATION_TRY_EXACT; evalops.sync_units = true; evalops.structuring = STRUCTURING_SIMPLIFY; evalops.parse_options.unknowns_enabled = false; evalops.parse_options.read_precision = DONT_READ_PRECISION; evalops.parse_options.base = BASE_DECIMAL; evalops.allow_complex = true; evalops.allow_infinite = true; evalops.auto_post_conversion = POST_CONVERSION_OPTIMAL; evalops.assume_denominators_nonzero = true; evalops.warn_about_denominators_assumed_nonzero = true; evalops.parse_options.angle_unit = ANGLE_UNIT_RADIANS; evalops.parse_options.dot_as_separator = CALCULATOR->default_dot_as_separator; evalops.parse_options.comma_as_separator = false; evalops.mixed_units_conversion = MIXED_UNITS_CONVERSION_DEFAULT; evalops.complex_number_form = COMPLEX_NUMBER_FORM_RECTANGULAR; evalops.local_currency_conversion = true; b_decimal_comma = -1; adaptive_interval_display = true; CALCULATOR->useIntervalArithmetic(false); rpn_mode = false; save_mode_on_exit = true; save_defs_on_exit = true; auto_update_exchange_rates = -1; first_time = false; FILE *file = NULL; #ifdef HAVE_LIBREADLINE string historyfile = buildPath(getLocalDir(), "qalc.history"); string oldhistoryfile; #endif string oldfilename; string filename = buildPath(getLocalDir(), "qalc.cfg"); file = fopen(filename.c_str(), "r"); if(!file) { #ifndef _WIN32 oldfilename = buildPath(getOldLocalDir(), "qalc.cfg"); file = fopen(oldfilename.c_str(), "r"); #endif if(!file) { first_time = true; save_preferences(true); IntervalDisplay ivdisp = printops.interval_display; printops.interval_display = INTERVAL_DISPLAY_PLUSMINUS; CALCULATOR->setMessagePrintOptions(printops); printops.interval_display = ivdisp; return; } #ifdef HAVE_LIBREADLINE oldhistoryfile = buildPath(getOldLocalDir(), "qalc.history"); #endif makeDir(getLocalDir()); } #ifdef HAVE_LIBREADLINE stifle_history(100); if(!oldhistoryfile.empty()) { read_history(oldhistoryfile.c_str()); move_file(oldhistoryfile.c_str(), historyfile.c_str()); } else { read_history(historyfile.c_str()); } #endif int version_numbers[] = {2, 8, 2}; if(file) { char line[10000]; string stmp, svalue, svar; size_t i; int v; while(true) { if(fgets(line, 10000, file) == NULL) break; stmp = line; remove_blank_ends(stmp); if((i = stmp.find_first_of("=")) != string::npos) { svar = stmp.substr(0, i); remove_blank_ends(svar); svalue = stmp.substr(i + 1, stmp.length() - (i + 1)); remove_blank_ends(svalue); v = s2i(svalue); if(svar == "version") { parse_qalculate_version(svalue, version_numbers); } else if(svar == "save_mode_on_exit") { save_mode_on_exit = v; } else if(svar == "save_definitions_on_exit") { save_defs_on_exit = v; } else if(svar == "fetch_exchange_rates_at_startup") { if(auto_update_exchange_rates < 0 && v) auto_update_exchange_rates = 1; } else if(svar == "auto_update_exchange_rates") { auto_update_exchange_rates = v; } else if(svar == "min_deci") { printops.min_decimals = v; } else if(svar == "use_min_deci") { printops.use_min_decimals = v; } else if(svar == "max_deci") { printops.max_decimals = v; } else if(svar == "use_max_deci") { printops.use_max_decimals = v; } else if(svar == "precision") { CALCULATOR->setPrecision(v); } else if(svar == "interval_arithmetic") { CALCULATOR->useIntervalArithmetic(v); } else if(svar == "interval_display") { if(v == 0) { adaptive_interval_display = true; printops.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; } else { v--; if(v >= INTERVAL_DISPLAY_SIGNIFICANT_DIGITS && v <= INTERVAL_DISPLAY_UPPER) { printops.interval_display = (IntervalDisplay) v; adaptive_interval_display = false; } } } else if(svar == "min_exp") { printops.min_exp = v; } else if(svar == "negative_exponents") { printops.negative_exponents = v; } else if(svar == "sort_minus_last") { printops.sort_options.minus_last = v; } else if(svar == "spacious") { printops.spacious = v; } else if(svar == "excessive_parenthesis") { printops.excessive_parenthesis = v; } else if(svar == "short_multiplication") { printops.short_multiplication = v; } else if(svar == "limit_implicit_multiplication") { evalops.parse_options.limit_implicit_multiplication = v; printops.limit_implicit_multiplication = v; } else if(svar == "parsing_mode") { if(v >= PARSING_MODE_ADAPTIVE && v <= PARSING_MODE_CONVENTIONAL) { evalops.parse_options.parsing_mode = (ParsingMode) v; } } else if(svar == "place_units_separately") { printops.place_units_separately = v; } else if(svar == "variable_units_enabled") { CALCULATOR->setVariableUnitsEnabled(v); } else if(svar == "use_prefixes") { printops.use_unit_prefixes = v; } else if(svar == "use_prefixes_for_all_units") { printops.use_prefixes_for_all_units = v; } else if(svar == "use_prefixes_for_currencies") { printops.use_prefixes_for_currencies = v; } else if(svar == "number_fraction_format") { if(v >= FRACTION_DECIMAL && v <= FRACTION_COMBINED) { printops.number_fraction_format = (NumberFractionFormat) v; printops.restrict_fraction_length = (v == FRACTION_FRACTIONAL); } else if(v == FRACTION_COMBINED + 1) { printops.number_fraction_format = FRACTION_FRACTIONAL; printops.restrict_fraction_length = false; } } else if(svar == "complex_number_form") { if(v >= COMPLEX_NUMBER_FORM_RECTANGULAR && v <= COMPLEX_NUMBER_FORM_POLAR) { evalops.complex_number_form = (ComplexNumberForm) v; } } else if(svar == "number_base") { printops.base = v; } else if(svar == "number_base_expression") { evalops.parse_options.base = v; } else if(svar == "read_precision") { if(v >= DONT_READ_PRECISION && v <= READ_PRECISION_WHEN_DECIMALS) { evalops.parse_options.read_precision = (ReadPrecisionMode) v; } } else if(svar == "assume_denominators_nonzero") { if(version_numbers[0] == 0 && (version_numbers[1] < 9 || (version_numbers[1] == 9 && version_numbers[2] == 0))) { v = true; } evalops.assume_denominators_nonzero = v; } else if(svar == "warn_about_denominators_assumed_nonzero") { evalops.warn_about_denominators_assumed_nonzero = v; } else if(svar == "structuring") { if(v >= STRUCTURING_NONE && v <= STRUCTURING_FACTORIZE) { evalops.structuring = (StructuringMode) v; printops.allow_factorization = (evalops.structuring == STRUCTURING_FACTORIZE); } } else if(svar == "angle_unit") { if(version_numbers[0] == 0 && (version_numbers[1] < 7 || (version_numbers[1] == 7 && version_numbers[2] == 0))) { v++; } if(v >= ANGLE_UNIT_NONE && v <= ANGLE_UNIT_GRADIANS) { evalops.parse_options.angle_unit = (AngleUnit) v; } } else if(svar == "functions_enabled") { evalops.parse_options.functions_enabled = v; } else if(svar == "variables_enabled") { evalops.parse_options.variables_enabled = v; } else if(svar == "calculate_variables") { evalops.calculate_variables = v; } else if(svar == "calculate_functions") { evalops.calculate_functions = v; } else if(svar == "sync_units") { evalops.sync_units = v; } else if(svar == "unknownvariables_enabled") { evalops.parse_options.unknowns_enabled = v; } else if(svar == "units_enabled") { evalops.parse_options.units_enabled = v; } else if(svar == "allow_complex") { evalops.allow_complex = v; } else if(svar == "allow_infinite") { evalops.allow_infinite = v; } else if(svar == "use_short_units") { printops.abbreviate_names = v; } else if(svar == "abbreviate_names") { printops.abbreviate_names = v; } else if(svar == "all_prefixes_enabled") { printops.use_all_prefixes = v; } else if(svar == "denominator_prefix_enabled") { printops.use_denominator_prefix = v; } else if(svar == "auto_post_conversion") { if(v >= POST_CONVERSION_NONE && v <= POST_CONVERSION_OPTIMAL) { evalops.auto_post_conversion = (AutoPostConversion) v; } if(v == POST_CONVERSION_NONE && version_numbers[0] == 0 && (version_numbers[1] < 9 || (version_numbers[1] == 9 && version_numbers[2] <= 12))) { evalops.auto_post_conversion = POST_CONVERSION_OPTIMAL; } } else if(svar == "mixed_units_conversion") { if(v >= MIXED_UNITS_CONVERSION_NONE && v <= MIXED_UNITS_CONVERSION_FORCE_ALL) { evalops.mixed_units_conversion = (MixedUnitsConversion) v; } } else if(svar == "local_currency_conversion") { evalops.local_currency_conversion = v; } else if(svar == "use_unicode_signs") { printops.use_unicode_signs = v; } else if(svar == "lower_case_numbers") { printops.lower_case_numbers = v; } else if(svar == "lower_case_e") { printops.lower_case_e = v; } else if(svar == "base_display") { if(v >= BASE_DISPLAY_NONE && v <= BASE_DISPLAY_ALTERNATIVE) printops.base_display = (BaseDisplay) v; } else if(svar == "twos_complement") { printops.twos_complement = v; } else if(svar == "spell_out_logical_operators") { printops.spell_out_logical_operators = v; } else if(svar == "decimal_comma") { b_decimal_comma = v; if(v == 0) CALCULATOR->useDecimalPoint(evalops.parse_options.comma_as_separator); else if(v > 0) CALCULATOR->useDecimalComma(); } else if(svar == "dot_as_separator") { evalops.parse_options.dot_as_separator = v; } else if(svar == "comma_as_separator") { evalops.parse_options.comma_as_separator = v; if(CALCULATOR->getDecimalPoint() != COMMA) { CALCULATOR->useDecimalPoint(evalops.parse_options.comma_as_separator); } } else if(svar == "multiplication_sign") { if(v >= MULTIPLICATION_SIGN_ASTERISK && v <= MULTIPLICATION_SIGN_X) printops.multiplication_sign = (MultiplicationSign) v; } else if(svar == "division_sign") { if(v >= DIVISION_SIGN_SLASH && v <= DIVISION_SIGN_DIVISION) printops.division_sign = (DivisionSign) v; } else if(svar == "indicate_infinite_series") { printops.indicate_infinite_series = v; } else if(svar == "show_ending_zeroes") { printops.show_ending_zeroes = v; } else if(svar == "digit_grouping") { if(v >= DIGIT_GROUPING_NONE && v <= DIGIT_GROUPING_LOCALE) { printops.digit_grouping = (DigitGrouping) v; } } else if(svar == "round_halfway_to_even") { printops.round_halfway_to_even = v; } else if(svar == "approximation") { if(v >= APPROXIMATION_EXACT && v <= APPROXIMATION_APPROXIMATE) { evalops.approximation = (ApproximationMode) v; } } else if(svar == "in_rpn_mode") { rpn_mode = v; } else if(svar == "rpn_syntax") { evalops.parse_options.rpn = v; } else if(svar == "default_assumption_type") { if(v >= ASSUMPTION_TYPE_NONE && v <= ASSUMPTION_TYPE_INTEGER) { if(v < ASSUMPTION_TYPE_NUMBER && version_numbers[0] < 1) v = ASSUMPTION_TYPE_NUMBER; if(v == ASSUMPTION_TYPE_COMPLEX && version_numbers[0] < 2) v = ASSUMPTION_TYPE_NUMBER; CALCULATOR->defaultAssumptions()->setType((AssumptionType) v); } } else if(svar == "default_assumption_sign") { if(v >= ASSUMPTION_SIGN_UNKNOWN && v <= ASSUMPTION_SIGN_NONZERO) { if(v == ASSUMPTION_SIGN_NONZERO && version_numbers[0] == 0 && (version_numbers[1] < 9 || (version_numbers[1] == 9 && version_numbers[2] == 0))) { v = ASSUMPTION_SIGN_UNKNOWN; } CALCULATOR->defaultAssumptions()->setSign((AssumptionSign) v); } } } } fclose(file); if(!oldfilename.empty()) { move_file(oldfilename.c_str(), filename.c_str()); } IntervalDisplay ivdisp = printops.interval_display; printops.interval_display = INTERVAL_DISPLAY_PLUSMINUS; CALCULATOR->setMessagePrintOptions(printops); printops.interval_display = ivdisp; } else { first_time = true; save_preferences(true); IntervalDisplay ivdisp = printops.interval_display; printops.interval_display = INTERVAL_DISPLAY_PLUSMINUS; CALCULATOR->setMessagePrintOptions(printops); printops.interval_display = ivdisp; return; } //remember start mode for when we save preferences set_saved_mode(); } /* save preferences to ~/.config/qalculate/qalc.cfg set mode to true to save current calculator mode */ bool save_preferences(bool mode) { FILE *file = NULL; makeDir(getLocalDir()); #ifdef HAVE_LIBREADLINE write_history(buildPath(getLocalDir(), "qalc.history").c_str()); #endif string filename = buildPath(getLocalDir(), "qalc.cfg"); file = fopen(filename.c_str(), "w+"); if(file == NULL) { fprintf(stderr, _("Couldn't write preferences to\n%s"), filename.c_str()); return false; } fprintf(file, "\n[General]\n"); fprintf(file, "version=%s\n", VERSION); fprintf(file, "save_mode_on_exit=%i\n", save_mode_on_exit); fprintf(file, "save_definitions_on_exit=%i\n", save_defs_on_exit); fprintf(file, "auto_update_exchange_rates=%i\n", auto_update_exchange_rates); fprintf(file, "spacious=%i\n", printops.spacious); fprintf(file, "excessive_parenthesis=%i\n", printops.excessive_parenthesis); fprintf(file, "short_multiplication=%i\n", printops.short_multiplication); fprintf(file, "use_unicode_signs=%i\n", printops.use_unicode_signs); fprintf(file, "lower_case_numbers=%i\n", printops.lower_case_numbers); fprintf(file, "lower_case_e=%i\n", printops.lower_case_e); fprintf(file, "base_display=%i\n", printops.base_display); fprintf(file, "twos_complement=%i\n", printops.twos_complement); fprintf(file, "spell_out_logical_operators=%i\n", printops.spell_out_logical_operators); fprintf(file, "digit_grouping=%i\n", printops.digit_grouping); fprintf(file, "decimal_comma=%i\n", b_decimal_comma); fprintf(file, "dot_as_separator=%i\n", evalops.parse_options.dot_as_separator); fprintf(file, "comma_as_separator=%i\n", evalops.parse_options.comma_as_separator); fprintf(file, "multiplication_sign=%i\n", printops.multiplication_sign); fprintf(file, "division_sign=%i\n", printops.division_sign); if(mode) set_saved_mode(); fprintf(file, "\n[Mode]\n"); fprintf(file, "min_deci=%i\n", saved_printops.min_decimals); fprintf(file, "use_min_deci=%i\n", saved_printops.use_min_decimals); fprintf(file, "max_deci=%i\n", saved_printops.max_decimals); fprintf(file, "use_max_deci=%i\n", saved_printops.use_max_decimals); fprintf(file, "precision=%i\n", saved_precision); fprintf(file, "interval_arithmetic=%i\n", saved_interval); if(saved_adaptive_interval_display) fprintf(file, "interval_display=%i\n", 0); else fprintf(file, "interval_display=%i\n", saved_printops.interval_display + 1); fprintf(file, "min_exp=%i\n", saved_printops.min_exp); fprintf(file, "negative_exponents=%i\n", saved_printops.negative_exponents); fprintf(file, "sort_minus_last=%i\n", saved_printops.sort_options.minus_last); fprintf(file, "number_fraction_format=%i\n", !saved_printops.restrict_fraction_length && saved_printops.number_fraction_format == FRACTION_FRACTIONAL ? FRACTION_COMBINED + 1 : saved_printops.number_fraction_format); fprintf(file, "complex_number_form=%i\n", saved_evalops.complex_number_form); fprintf(file, "use_prefixes=%i\n", saved_printops.use_unit_prefixes); fprintf(file, "use_prefixes_for_all_units=%i\n", saved_printops.use_prefixes_for_all_units); fprintf(file, "use_prefixes_for_currencies=%i\n", saved_printops.use_prefixes_for_currencies); fprintf(file, "abbreviate_names=%i\n", saved_printops.abbreviate_names); fprintf(file, "all_prefixes_enabled=%i\n", saved_printops.use_all_prefixes); fprintf(file, "denominator_prefix_enabled=%i\n", saved_printops.use_denominator_prefix); fprintf(file, "place_units_separately=%i\n", saved_printops.place_units_separately); fprintf(file, "auto_post_conversion=%i\n", saved_evalops.auto_post_conversion); fprintf(file, "mixed_units_conversion=%i\n", saved_evalops.mixed_units_conversion); fprintf(file, "local_currency_conversion=%i\n", saved_evalops.local_currency_conversion); fprintf(file, "number_base=%i\n", saved_printops.base); fprintf(file, "number_base_expression=%i\n", saved_evalops.parse_options.base); fprintf(file, "read_precision=%i\n", saved_evalops.parse_options.read_precision); fprintf(file, "assume_denominators_nonzero=%i\n", saved_evalops.assume_denominators_nonzero); fprintf(file, "warn_about_denominators_assumed_nonzero=%i\n", saved_evalops.warn_about_denominators_assumed_nonzero); fprintf(file, "structuring=%i\n", saved_evalops.structuring); fprintf(file, "angle_unit=%i\n", saved_evalops.parse_options.angle_unit); fprintf(file, "functions_enabled=%i\n", saved_evalops.parse_options.functions_enabled); fprintf(file, "variables_enabled=%i\n", saved_evalops.parse_options.variables_enabled); fprintf(file, "calculate_variables=%i\n", saved_evalops.calculate_variables); fprintf(file, "calculate_functions=%i\n", saved_evalops.calculate_functions); fprintf(file, "variable_units_enabled=%i\n", saved_variable_units_enabled); fprintf(file, "sync_units=%i\n", saved_evalops.sync_units); fprintf(file, "unknownvariables_enabled=%i\n", saved_evalops.parse_options.unknowns_enabled); fprintf(file, "units_enabled=%i\n", saved_evalops.parse_options.units_enabled); fprintf(file, "allow_complex=%i\n", saved_evalops.allow_complex); fprintf(file, "allow_infinite=%i\n", saved_evalops.allow_infinite); fprintf(file, "indicate_infinite_series=%i\n", saved_printops.indicate_infinite_series); fprintf(file, "show_ending_zeroes=%i\n", saved_printops.show_ending_zeroes); fprintf(file, "round_halfway_to_even=%i\n", saved_printops.round_halfway_to_even); fprintf(file, "approximation=%i\n", saved_evalops.approximation); fprintf(file, "in_rpn_mode=%i\n", rpn_mode); fprintf(file, "rpn_syntax=%i\n", saved_evalops.parse_options.rpn); fprintf(file, "limit_implicit_multiplication=%i\n", evalops.parse_options.limit_implicit_multiplication); fprintf(file, "parsing_mode=%i\n", evalops.parse_options.parsing_mode); fprintf(file, "default_assumption_type=%i\n", CALCULATOR->defaultAssumptions()->type()); fprintf(file, "default_assumption_sign=%i\n", CALCULATOR->defaultAssumptions()->sign()); fclose(file); return true; } /* save definitions to ~/.qalculate/qalculate.cfg the hard work is done in the Calculator class */ bool save_defs() { if(!CALCULATOR->saveDefinitions()) { PUTS_UNICODE(_("Couldn't write definitions")); return false; } return true; } libqalculate-2.8.2/src/defs2doc.cc0000644000175000017500000006361513272561675013726 00000000000000/* Qalculate Copyright (C) 2004 Hanna Knutsson (hanna.knutsson@protonmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include "support.h" #include #include #include #include #include #include #include #include #include KnownVariable *vans[5]; PrintOptions printops; EvaluationOptions evalops; char buffer[1000]; FILE *ffile, *vfile, *ufile; bool is_answer_variable(Variable *v) { return v == vans[0] || v == vans[1] || v == vans[2] || v == vans[3] || v == vans[4]; } string fix(string str) { gsub("&", "&", str); gsub("<", "<", str); gsub(">", ">", str); gsub("\n", "", str); return str; } string fixcat(string str) { gsub(" ", "-", str); gsub(".", "", str); gsub("&", "", str); gsub("<", "", str); gsub(">", "", str); return str; } struct tree_struct { string item; list items; list::iterator it; list::reverse_iterator rit; vector objects; tree_struct *parent; void sort() { items.sort(); for(list::iterator it = items.begin(); it != items.end(); ++it) { it->sort(); } } bool operator < (tree_struct &s1) const { return item < s1.item; } }; tree_struct function_cats, unit_cats, variable_cats; vector ia_units, ia_variables, ia_functions; void generate_units_tree_struct() { size_t cat_i, cat_i_prev; bool b; string str, cat, cat_sub; Unit *u = NULL; unit_cats.items.clear(); unit_cats.objects.clear(); unit_cats.parent = NULL; ia_units.clear(); list::iterator it; for(size_t i = 0; i < CALCULATOR->units.size(); i++) { if(!CALCULATOR->units[i]->isActive()) { b = false; for(size_t i3 = 0; i3 < ia_units.size(); i3++) { u = (Unit*) ia_units[i3]; if(CALCULATOR->units[i]->title() < u->title()) { b = true; ia_units.insert(ia_units.begin() + i3, (void*) CALCULATOR->units[i]); break; } } if(!b) ia_units.push_back((void*) CALCULATOR->units[i]); } else { tree_struct *item = &unit_cats; if(!CALCULATOR->units[i]->category().empty()) { cat = CALCULATOR->units[i]->category(); cat_i = cat.find("/"); cat_i_prev = 0; b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(it = item->items.begin(); it != item->items.end(); ++it) { if(cat_sub == it->item) { item = &*it; b = true; break; } } if(!b) { tree_struct cat; item->items.push_back(cat); it = item->items.end(); --it; it->parent = item; item = &*it; item->item = cat_sub; } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } b = false; for(size_t i3 = 0; i3 < item->objects.size(); i3++) { u = (Unit*) item->objects[i3]; if(CALCULATOR->units[i]->title() < u->title()) { b = true; item->objects.insert(item->objects.begin() + i3, (void*) CALCULATOR->units[i]); break; } } if(!b) item->objects.push_back((void*) CALCULATOR->units[i]); } } unit_cats.sort(); } void generate_variables_tree_struct() { size_t cat_i, cat_i_prev; bool b; string str, cat, cat_sub; Variable *v = NULL; variable_cats.items.clear(); variable_cats.objects.clear(); variable_cats.parent = NULL; ia_variables.clear(); list::iterator it; for(size_t i = 0; i < CALCULATOR->variables.size(); i++) { if(!CALCULATOR->variables[i]->isActive()) { //deactivated variable b = false; for(size_t i3 = 0; i3 < ia_variables.size(); i3++) { v = (Variable*) ia_variables[i3]; if(CALCULATOR->variables[i]->title() < v->title()) { b = true; ia_variables.insert(ia_variables.begin() + i3, (void*) CALCULATOR->variables[i]); break; } } if(!b) ia_variables.push_back((void*) CALCULATOR->variables[i]); } else { tree_struct *item = &variable_cats; if(!CALCULATOR->variables[i]->category().empty()) { cat = CALCULATOR->variables[i]->category(); cat_i = cat.find("/"); cat_i_prev = 0; b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(it = item->items.begin(); it != item->items.end(); ++it) { if(cat_sub == it->item) { item = &*it; b = true; break; } } if(!b) { tree_struct cat; item->items.push_back(cat); it = item->items.end(); --it; it->parent = item; item = &*it; item->item = cat_sub; } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } b = false; for(size_t i3 = 0; i3 < item->objects.size(); i3++) { v = (Variable*) item->objects[i3]; if(CALCULATOR->variables[i]->title() < v->title()) { b = true; item->objects.insert(item->objects.begin() + i3, (void*) CALCULATOR->variables[i]); break; } } if(!b) item->objects.push_back((void*) CALCULATOR->variables[i]); } } variable_cats.sort(); } void generate_functions_tree_struct() { size_t cat_i, cat_i_prev; bool b; string str, cat, cat_sub; MathFunction *f = NULL; function_cats.items.clear(); function_cats.objects.clear(); function_cats.parent = NULL; ia_functions.clear(); list::iterator it; for(size_t i = 0; i < CALCULATOR->functions.size(); i++) { if(!CALCULATOR->functions[i]->isActive()) { //deactivated function b = false; for(size_t i3 = 0; i3 < ia_functions.size(); i3++) { f = (MathFunction*) ia_functions[i3]; if(CALCULATOR->functions[i]->title() < f->title()) { b = true; ia_functions.insert(ia_functions.begin() + i3, (void*) CALCULATOR->functions[i]); break; } } if(!b) ia_functions.push_back((void*) CALCULATOR->functions[i]); } else { tree_struct *item = &function_cats; if(!CALCULATOR->functions[i]->category().empty()) { cat = CALCULATOR->functions[i]->category(); cat_i = cat.find("/"); cat_i_prev = 0; b = false; while(true) { if(cat_i == string::npos) { cat_sub = cat.substr(cat_i_prev, cat.length() - cat_i_prev); } else { cat_sub = cat.substr(cat_i_prev, cat_i - cat_i_prev); } b = false; for(it = item->items.begin(); it != item->items.end(); ++it) { if(cat_sub == it->item) { item = &*it; b = true; break; } } if(!b) { tree_struct cat; item->items.push_back(cat); it = item->items.end(); --it; it->parent = item; item = &*it; item->item = cat_sub; } if(cat_i == string::npos) { break; } cat_i_prev = cat_i + 1; cat_i = cat.find("/", cat_i_prev); } } b = false; for(size_t i3 = 0; i3 < item->objects.size(); i3++) { f = (MathFunction*) item->objects[i3]; if(CALCULATOR->functions[i]->title() < f->title()) { b = true; item->objects.insert(item->objects.begin() + i3, (void*) CALCULATOR->functions[i]); break; } } if(!b) item->objects.push_back((void*) CALCULATOR->functions[i]); } } function_cats.sort(); } void print_function(MathFunction *f) { string str; fputs("\n", ffile); fprintf(ffile, "%s\n", f->title(false).c_str()); fputs("\n", ffile); Argument *arg; Argument default_arg; string str2; const ExpressionName *ename = &f->preferredName(false, printops.use_unicode_signs); str = ename->name; int iargs = f->maxargs(); if(iargs < 0) { iargs = f->minargs() + 1; } str += "("; if(iargs != 0) { for(int i2 = 1; i2 <= iargs; i2++) { if(i2 > f->minargs()) { str += "["; } if(i2 > 1) { str += CALCULATOR->getComma(); str += " "; } arg = f->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { str2 = arg->name(); } else { str2 = _("argument"); str2 += " "; str2 += i2s(i2); } str += str2; if(i2 > f->minargs()) { str += "]"; } } if(f->maxargs() < 0) { str += CALCULATOR->getComma(); str += " ..."; } } str += ")"; fprintf(ffile, "%s\n", str.c_str()); for(size_t i2 = 1; i2 <= f->countNames(); i2++) { if(&f->getName(i2) != ename && !f->getName(i2).completion_only) { fprintf(ffile, "%s", f->getName(i2).name.c_str()); } } if(f->subtype() == SUBTYPE_DATA_SET) { fputs("", ffile); fprintf(ffile, _("Retrieves data from the %s data set for a given object and property. If \"info\" is typed as property, all properties of the object will be listed."), f->title().c_str()); fputs("", ffile); } if(!f->description().empty()) { fprintf(ffile, "%s\n", fix(f->description()).c_str()); } if(!f->example(true).empty()) { str = _("Example:"); str += " "; str += fix(f->example(false, ename->name)); fprintf(ffile, "%s\n", str.c_str()); } if(f->subtype() == SUBTYPE_DATA_SET && !((DataSet*) f)->copyright().empty()) { fprintf(ffile, "%s\n", fix(((DataSet*) f)->copyright()).c_str()); } if(iargs) { fputs("\n", ffile); fprintf(ffile, "%s", _("Arguments")); fputs("\n", ffile); for(int i2 = 1; i2 <= iargs; i2++) { arg = f->getArgumentDefinition(i2); if(arg && !arg->name().empty()) { str = arg->name(); } else { str = i2s(i2); } str += ": "; if(arg) { str2 = fix(arg->printlong()); } else { str2 = fix(default_arg.printlong()); } if(i2 > f->minargs()) { str2 += " ("; str2 += _("optional"); if(!f->getDefaultValue(i2).empty()) { str2 += ", "; str2 += _("default: "); str2 += f->getDefaultValue(i2); } str2 += ")"; } str += str2; fprintf(ffile, "%s\n", str.c_str()); } fputs("\n", ffile); fputs("\n", ffile); } if(!f->condition().empty()) { fputs("\n", ffile); fprintf(ffile, "%s", _("Requirement")); fputs("\n", ffile); fputs(fix(f->printCondition()).c_str(), ffile); fputs("\n", ffile); fputs("\n", ffile); fputs("\n", ffile); } if(f->subtype() == SUBTYPE_DATA_SET) { DataSet *ds = (DataSet*) f; fputs("\n", ffile); fprintf(ffile, "%s", _("Properties")); fputs("\n", ffile); DataPropertyIter it; DataProperty *dp = ds->getFirstProperty(&it); while(dp) { if(!dp->isHidden()) { if(!dp->title(false).empty()) { str = dp->title(); str += ": "; } for(size_t i = 1; i <= dp->countNames(); i++) { if(i > 1) str += ", "; str += dp->getName(i); } if(dp->isKey()) { str += " ("; str += _("key"); str += ")"; } if(!dp->description().empty()) { str += ""; str += fix(dp->description()); } fprintf(ffile, "%s\n", str.c_str()); } dp = ds->getNextProperty(&it); } fputs("\n", ffile); fputs("\n", ffile); } fputs("\n", ffile); fputs("\n", ffile); } void print_variable(Variable *v) { string value, str; fputs("\n", vfile); fprintf(vfile, "%s\n", v->title().c_str()); bool b_first = true; for(size_t i2 = 1; i2 <= v->countNames(); i2++) { if(!v->getName(i2).completion_only) { if(!b_first) str += " / "; b_first = false; str += v->getName(i2).name; } } fprintf(vfile, "%s\n", str.c_str()); value = ""; if(is_answer_variable(v)) { value = _("a previous result"); } else if(v->isKnown()) { if(v == CALCULATOR->v_precision) { value = _("current precision"); } else if(((KnownVariable*) v)->isExpression()) { value = fix(CALCULATOR->localizeExpression(((KnownVariable*) v)->expression())); if(!((KnownVariable*) v)->uncertainty().empty()) { value += "±"; value += fix(CALCULATOR->localizeExpression(((KnownVariable*) v)->uncertainty())); } if(!((KnownVariable*) v)->unit().empty()) { value += " "; value += fix(CALCULATOR->localizeExpression(((KnownVariable*) v)->unit())); } if(value.length() > 40) { value = value.substr(0, 30); value += "..."; } } else { if(((KnownVariable*) v)->get().isMatrix()) { value = _("matrix"); } else if(((KnownVariable*) v)->get().isVector()) { value = _("vector"); } else { value = fix(CALCULATOR->print(((KnownVariable*) v)->get(), 30)); } } } else { if(((UnknownVariable*) v)->assumptions()) { switch(((UnknownVariable*) v)->assumptions()->sign()) { case ASSUMPTION_SIGN_POSITIVE: {value = _("positive"); break;} case ASSUMPTION_SIGN_NONPOSITIVE: {value = _("non-positive"); break;} case ASSUMPTION_SIGN_NEGATIVE: {value = _("negative"); break;} case ASSUMPTION_SIGN_NONNEGATIVE: {value = _("non-negative"); break;} case ASSUMPTION_SIGN_NONZERO: {value = _("non-zero"); break;} default: {} } if(!value.empty() && ((UnknownVariable*) v)->assumptions()->type() != ASSUMPTION_TYPE_NONE) value += " "; switch(((UnknownVariable*) v)->assumptions()->type()) { case ASSUMPTION_TYPE_INTEGER: {value += _("integer"); break;} case ASSUMPTION_TYPE_RATIONAL: {value += _("rational"); break;} case ASSUMPTION_TYPE_REAL: {value += _("real"); break;} case ASSUMPTION_TYPE_COMPLEX: {value += _("complex"); break;} case ASSUMPTION_TYPE_NUMBER: {value += _("number"); break;} case ASSUMPTION_TYPE_NONMATRIX: {value += _("non-matrix"); break;} default: {} } if(value.empty()) value = _("unknown"); } else { value = _("default assumptions"); } } if(v->isApproximate()) { if(v == CALCULATOR->v_pi || v == CALCULATOR->v_e || v == CALCULATOR->v_euler || v == CALCULATOR->v_catalan) { value += " ("; value += _("variable precision"); value += ")"; } else { value += " ("; value += _("approximate"); value += ")"; } } fprintf(vfile, "%s\n", value.c_str()); fputs("\n", vfile); } void print_unit(Unit *u) { string str, base_unit, relation; fputs("\n", ufile); fprintf(ufile, "%s\n", u->title().c_str()); bool b_first = true; for(size_t i2 = 1; i2 <= u->countNames(); i2++) { if(!u->getName(i2).completion_only) { if(!b_first) str += " / "; b_first = false; str += u->getName(i2).name; } } if(u->subtype() == SUBTYPE_COMPOSITE_UNIT) { fprintf(ufile, "(%s)\n", str.c_str()); } else { fprintf(ufile, "%s\n", str.c_str()); } switch(u->subtype()) { case SUBTYPE_BASE_UNIT: { base_unit = ""; relation = ""; break; } case SUBTYPE_ALIAS_UNIT: { AliasUnit *au = (AliasUnit*) u; base_unit = au->firstBaseUnit()->preferredDisplayName(printops.abbreviate_names, printops.use_unicode_signs).name; if(au->firstBaseExponent() != 1) { base_unit += POWER; base_unit += i2s(au->firstBaseExponent()); } if(au->baseUnit() == CALCULATOR->u_euro && au->isBuiltin()) { relation = "exchange rate"; } else { relation = fix(CALCULATOR->localizeExpression(au->expression()).c_str()); if(!au->uncertainty().empty()) { relation += "±"; relation += fix(CALCULATOR->localizeExpression(au->uncertainty())); } } if(u->isApproximate()) { relation += " ("; relation += _("approximate"); relation += ")"; } break; } case SUBTYPE_COMPOSITE_UNIT: { base_unit = fix(((CompositeUnit*) u)->print(false, true, printops.use_unicode_signs)); relation = ""; break; } } fprintf(ufile, "%s\n", base_unit.c_str()); fprintf(ufile, "%s\n", relation.c_str()); fputs("\n", ufile); } int main(int, char *[]) { #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, getPackageLocaleDir().c_str()); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); #endif //create the almighty Calculator object new Calculator(); ffile = fopen("appendixa.xml", "w+"); vfile = fopen("appendixb.xml", "w+"); ufile = fopen("appendixc.xml", "w+"); string str; CALCULATOR->loadExchangeRates(); string ans_str = _("ans"); vans[0] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str, m_undefined, _("Last Answer"), false)); vans[0]->addName(_("answer")); vans[0]->addName(ans_str + "1"); vans[1] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "2", m_undefined, _("Answer 2"), false)); vans[2] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "3", m_undefined, _("Answer 3"), false)); vans[3] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "4", m_undefined, _("Answer 4"), false)); vans[4] = (KnownVariable*) CALCULATOR->addVariable(new KnownVariable(_("Temporary"), ans_str + "5", m_undefined, _("Answer 5"), false)); //load global definitions if(!CALCULATOR->loadGlobalDefinitions()) { printf(_("Failed to load global definitions!\n")); } printops.use_unicode_signs = true; generate_functions_tree_struct(); generate_variables_tree_struct(); generate_units_tree_struct(); fputs("\n", ffile); fputs("Function List\n", ffile); tree_struct *item, *item2; function_cats.it = function_cats.items.begin(); if(function_cats.it != function_cats.items.end()) { item = &*function_cats.it; ++function_cats.it; item->it = item->items.begin(); } else { item = NULL; } str = ""; int level = 1; while(item) { fprintf(ffile, "\n", level, level, fixcat(item->item).c_str()); fprintf(ffile, "%s\n", fix(item->item).c_str()); if(item->objects.size() > 0) { fputs("\n", ffile); for(size_t i = 0; i < item->objects.size(); i++) { print_function((MathFunction*) item->objects[i]); } fputs("\n", ffile); } while(item && item->it == item->items.end()) { item = item->parent; if(item) { fprintf(ffile, "\n", level); level--; } } if(item) { item2 = &*item->it; ++item->it; item = item2; item->it = item->items.begin(); level++; } } if(!function_cats.objects.empty()) { fputs("\n", ffile); fprintf(ffile, "%s\n", _("Uncategorized")); fputs("\n", ffile); for(size_t i = 0; i < function_cats.objects.size(); i++) { print_function((MathFunction*) function_cats.objects[i]); } fputs("\n", ffile); fputs("\n", ffile); } fputs("\n", ffile); fclose(ffile); fputs("\n", vfile); fputs("Variable List\n", vfile); variable_cats.it = variable_cats.items.begin(); if(variable_cats.it != variable_cats.items.end()) { item = &*variable_cats.it; ++variable_cats.it; item->it = item->items.begin(); } else { item = NULL; } str = ""; level = 1; while(item) { fprintf(vfile, "\n", level, level, fixcat(item->item).c_str()); fprintf(vfile, "%s\n", fix(item->item).c_str()); if(item->objects.size() > 0) { fprintf(vfile, "\n", fixcat(item->item).c_str()); fprintf(vfile, "Variables: %s\n", fix(item->item).c_str()); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("Title\n", vfile); fputs("Names\n", vfile); fputs("Value\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); for(size_t i = 0; i < item->objects.size(); i++) { print_variable((Variable*) item->objects[i]); } fputs("\n", vfile); fputs("\n", vfile); fputs("
\n", vfile); } while(item && item->it == item->items.end()) { item = item->parent; if(item) { fprintf(vfile, "
\n", level); level--; } } if(item) { item2 = &*item->it; ++item->it; item = item2; item->it = item->items.begin(); level++; } } if(!variable_cats.objects.empty()) { fputs("\n", vfile); fprintf(vfile, "%s\n", _("Uncategorized")); fprintf(vfile, "\n", _("Uncategorized")); fprintf(vfile, "Variables: %s\n", _("Uncategorized")); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("Title\n", vfile); fputs("Names\n", vfile); fputs("Value\n", vfile); fputs("\n", vfile); fputs("\n", vfile); fputs("\n", vfile); for(size_t i = 0; i < variable_cats.objects.size(); i++) { print_variable((Variable*) function_cats.objects[i]); } fputs("\n", vfile); fputs("\n", vfile); fputs("
\n", vfile); fputs("
\n", vfile); } fputs("
\n", vfile); fclose(vfile); fputs("\n", ufile); fputs("Unit List\n", ufile); unit_cats.it = unit_cats.items.begin(); if(unit_cats.it != unit_cats.items.end()) { item = &*unit_cats.it; ++unit_cats.it; item->it = item->items.begin(); } else { item = NULL; } str = ""; level = 1; while(item) { fprintf(ufile, "\n", level, level, fixcat(item->item).c_str()); fprintf(ufile, "%s\n", fix(item->item).c_str()); if(item->objects.size() > 0) { fprintf(ufile, "\n", fixcat(item->item).c_str()); fprintf(ufile, "Units: %s\n", fix(item->item).c_str()); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("Title\n", ufile); fputs("Names\n", ufile); fputs("Base Unit(s)\n", ufile); fputs("Relation\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); for(size_t i = 0; i < item->objects.size(); i++) { print_unit((Unit*) item->objects[i]); } fputs("\n", ufile); fputs("\n", ufile); fputs("
\n", ufile); } while(item && item->it == item->items.end()) { item = item->parent; if(item) { fprintf(ufile, "
\n", level); level--; } } if(item) { item2 = &*item->it; ++item->it; item = item2; item->it = item->items.begin(); level++; } } if(!unit_cats.objects.empty()) { fputs("\n", ufile); fprintf(ufile, "%s\n", _("Uncategorized")); fprintf(ufile, "\n", _("Uncategorized")); fprintf(ufile, "Units: %s\n", _("Uncategorized")); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("Title\n", ufile); fputs("Names\n", ufile); fputs("Base Unit(s)\n", ufile); fputs("Relation\n", ufile); fputs("\n", ufile); fputs("\n", ufile); fputs("\n", ufile); for(size_t i = 0; i < unit_cats.objects.size(); i++) { print_unit((Unit*) function_cats.objects[i]); } fputs("\n", ufile); fputs("\n", ufile); fputs("
\n", ufile); fputs("
\n", ufile); } fputs("
\n", ufile); fclose(ufile); return 0; } libqalculate-2.8.2/src/test.cc0000644000175000017500000015752513365546642013220 00000000000000#include bool display_errors(bool show_only_errors = false) { if(!CALCULATOR->message()) return false; bool b_ret = false; while(true) { MessageType mtype = CALCULATOR->message()->type(); if(!show_only_errors || mtype == MESSAGE_ERROR) { if(mtype == MESSAGE_ERROR) cout << "error: "; else if(mtype == MESSAGE_WARNING) cout << "warning: "; cout << CALCULATOR->message()->message() << endl; b_ret = true; } if(!CALCULATOR->nextMessage()) break; } return b_ret; } void clear_errors() { if(!CALCULATOR->message()) return; while(true) { if(!CALCULATOR->nextMessage()) break; } } void test_integration4(const MathStructure &mstruct) { MathStructure x_var(CALCULATOR->v_x); cout << "Integration test: " << mstruct.print() << endl; MathStructure mstruct2(mstruct); EvaluationOptions eo; eo.parse_options.angle_unit = ANGLE_UNIT_RADIANS; eo.assume_denominators_nonzero = true; mstruct2.integrate(x_var, eo, true, 1); mstruct2.eval(eo); if(mstruct2.containsFunction(CALCULATOR->f_integrate)) {clear_errors(); return;} mstruct2.differentiate(x_var, eo); MathStructure mstruct3(mstruct2); mstruct3.eval(eo); mstruct3.replace(x_var, 3); mstruct3.eval(eo); display_errors(); string str1 = mstruct3.print(); cout << str1 << endl; mstruct3 = mstruct; mstruct3.replace(x_var, 3); mstruct3.eval(eo); display_errors(); string str2 = mstruct3.print(); cout << str2 << endl; if(str1 != str2) cout << "!!!" << endl; mstruct3 = mstruct2; mstruct3.replace(x_var, -5); mstruct3.eval(eo); display_errors(); str1 = mstruct3.print(); cout << str1 << endl; mstruct3 = mstruct; mstruct3.replace(x_var, -5); mstruct3.eval(eo); display_errors(); str2 = mstruct3.print(); cout << str2 << endl; if(str1 != str2) cout << "!!!" << endl; cout << "________________________________________________" << endl; } void test_integration3(const MathStructure &mstruct, const MathStructure &mstruct_arg) { MathStructure mstruct2(mstruct); test_integration4(mstruct2); mstruct2 = mstruct; mstruct2 *= CALCULATOR->v_x; test_integration4(mstruct2); mstruct2.last() ^= nr_two; test_integration4(mstruct2); mstruct2.last()[1] = nr_minus_one; test_integration4(mstruct2); mstruct2 = mstruct; mstruct2 *= mstruct_arg; test_integration4(mstruct2); mstruct2 = mstruct; mstruct2 *= mstruct; test_integration4(mstruct2); } void test_integration2(const MathStructure &mstruct) { MathStructure mstruct2(mstruct); mstruct2.transform(CALCULATOR->f_ln); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2 *= CALCULATOR->getRadUnit(); mstruct2.transform(CALCULATOR->f_sin); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2 *= CALCULATOR->getRadUnit(); mstruct2.transform(CALCULATOR->f_cos); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2 *= CALCULATOR->getRadUnit(); mstruct2.transform(CALCULATOR->f_tan); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2.transform(CALCULATOR->f_asin); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2.transform(CALCULATOR->f_acos); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2.transform(CALCULATOR->f_atan); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2.transform(CALCULATOR->f_sinh); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2.transform(CALCULATOR->f_cosh); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2.transform(CALCULATOR->f_tanh); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2.transform(CALCULATOR->f_asinh); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2.transform(CALCULATOR->f_acosh); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2.transform(CALCULATOR->f_atanh); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2 ^= nr_two; test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2 ^= nr_minus_one; test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2 ^= Number(-2, 1); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2 ^= Number(3, 1); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2 ^= Number(-3, 1); test_integration3(mstruct2, mstruct); mstruct2 = mstruct; mstruct2 ^= Number(1, 3); test_integration3(mstruct2, mstruct); } void test_integration() { MathStructure mstruct; CALCULATOR->parse(&mstruct, "4x+5"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "-2x+7"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "4.7x-5.2"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "-4.3x-5"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "4x"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "-2.3x"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "x+6"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "x-7"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "x"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "x^2"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "2x^2+5"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "-2x^2-5"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "sqrt(x)"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "sqrt(3x+3)"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "5*sqrt(3x)-2"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "cbrt(3x+3)"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "(3x+3)^(1/3)"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "cbrt(x)"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "x^(1/3)"); test_integration2(mstruct); CALCULATOR->parse(&mstruct, "5^x"); test_integration2(mstruct); } void test_intervals(bool use_interval) { CALCULATOR->useIntervalArithmetic(use_interval); PrintOptions po; //po.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; vector nrs; nrs.push_back(nr_plus_inf); nrs.push_back(nr_minus_inf); nrs.push_back(nr_zero); nrs.push_back(nr_half); nrs.push_back(nr_minus_half); nrs.push_back(nr_one); nrs.push_back(nr_minus_one); nrs.push_back(nr_two); Number nr; #define INCLUDES_INFINITY(x) (x.includesInfinity()) #define IS_INTERVAL(x) (x.isInterval(false)) nr.setInterval(nr_minus_half, nr_half); nrs.push_back(nr); nr.setImaginaryPart(nr_one); nrs.push_back(nr); nr.setImaginaryPart(nr_minus_half); nrs.push_back(nr); nr.setImaginaryPart(nr_plus_inf); nrs.push_back(nr); nr.setInterval(nr_minus_one, nr_half); nrs.push_back(nr); nr.setInterval(nr_minus_half, nr_one); nrs.push_back(nr); nr.setInterval(nr_minus_one, nr_one); nrs.push_back(nr); nr.setInterval(Number(-2, 1), nr_two); nrs.push_back(nr); nr.setInterval(nr_zero, nr_half); nrs.push_back(nr); nr.setImaginaryPart(nrs[nrs.size() - 2]); nrs.push_back(nr); nr.setImaginaryPart(nr_one); nrs.push_back(nr); nr.setImaginaryPart(nr_minus_half); nrs.push_back(nr); nr.setImaginaryPart(nr_plus_inf); nrs.push_back(nr); nr.setInterval(nr_minus_half, nr_zero); nrs.push_back(nr); nr.setInterval(nr_zero, nr_two); nrs.push_back(nr); nr.setInterval(nr_half, nr_one); nrs.push_back(nr); nr.setImaginaryPart(nrs[nrs.size() - 2]); nrs.push_back(nr); nr.setInterval(nr_one, nr_two); nrs.push_back(nr); nr.setInterval(nr_two, nr_three); nrs.push_back(nr); nr.setInterval(nr_minus_one, nr_minus_half); nrs.push_back(nr); nr.setImaginaryPart(nrs[nrs.size() - 2]); nrs.push_back(nr); nr.setInterval(nr_minus_one, Number(-2, 1)); nrs.push_back(nr); nr.setInterval(Number(-2, 1), Number(-3, 1)); nrs.push_back(nr); nr.setInterval(nr_minus_inf, nr_minus_one); nrs.push_back(nr); nr.setInterval(nr_minus_inf, nr_one); nrs.push_back(nr); nr.setInterval(nr_minus_inf, nr_plus_inf); nrs.push_back(nr); nr.setInterval(nr_plus_inf, nr_minus_one); nrs.push_back(nr); nr.setInterval(nr_plus_inf, nr_one); nrs.push_back(nr); nr.setImaginaryPart(nrs[nrs.size() - 2]); nrs.push_back(nr); nr.setImaginaryPart(nr_one); nrs.push_back(nr); nr.setImaginaryPart(nr_minus_inf); nrs.push_back(nr); nr.setFloat(0.5); nrs.push_back(nr); nr.setFloat(-0.5); nrs.push_back(nr); nr.setImaginaryPart(nrs[nrs.size() - 2]); nr.setImaginaryPart(nr_one); nrs.push_back(nr); nr.setFloat(1.5); nrs.push_back(nr); nr.setFloat(-1.5); nrs.push_back(nr); Number nrsum1, nrsum2, nrsum3; for(size_t i = 0; i < nrs.size(); i++) { for(size_t i2 = 0; i2 < nrs.size(); i2++) { cout << nrs[i].print(po) << " * " << nrs[i2].print(po) << " = "; nr.set(nrs[i]); if(nr.multiply(nrs[i2])) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } if(!INCLUDES_INFINITY(nrs[i])) { nrsum1 *= nrs[i]; if(!IS_INTERVAL(nrs[i])) nrsum2 *= nrs[i]; } } cout << "SUM1:" << nrsum1.print(po) << endl; cout << "SUM2:" << nrsum2.print(po) << endl; cout << "SUM3:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(size_t i2 = 0; i2 < nrs.size(); i2++) { cout << nrs[i].print(po) << " + " << nrs[i2].print(po) << " = "; nr.set(nrs[i]); if(nr.add(nrs[i2])) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } if(!INCLUDES_INFINITY(nrs[i])) { nrsum1 += nrs[i]; if(!IS_INTERVAL(nrs[i])) nrsum2 += nrs[i]; } } cout << "SUM1:" << nrsum1.print(po) << endl; cout << "SUM2:" << nrsum2.print(po) << endl; cout << "SUM3:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(size_t i2 = 0; i2 < nrs.size(); i2++) { cout << nrs[i].print(po) << " - " << nrs[i2].print(po) << " = "; nr.set(nrs[i]); if(nr.subtract(nrs[i2])) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } if(!INCLUDES_INFINITY(nrs[i])) { nrsum1 -= nrs[i]; if(!IS_INTERVAL(nrs[i])) nrsum2 -= nrs[i]; } } cout << "SUM1:" << nrsum1.print(po) << endl; cout << "SUM2:" << nrsum2.print(po) << endl; cout << "SUM3:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(size_t i2 = 0; i2 < nrs.size(); i2++) { cout << nrs[i].print(po) << " / " << nrs[i2].print(po) << " = "; nr.set(nrs[i]); if(nr.divide(nrs[i2])) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } if(!INCLUDES_INFINITY(nrs[i])) { nrsum1 /= nrs[i]; if(!IS_INTERVAL(nrs[i])) nrsum2 /= nrs[i]; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(size_t i2 = 0; i2 < nrs.size(); i2++) { cout << nrs[i].print(po) << " ^ " << nrs[i2].print(po) << " = "; nr.set(nrs[i]); if(nr.raise(nrs[i2])) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(size_t i2 = 0; i2 < nrs.size(); i2++) { cout << nrs[i].print(po) << " log " << nrs[i2].print(po) << " = "; nr.set(nrs[i]); if(nr.log(nrs[i2])) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(size_t i2 = 0; i2 < nrs.size(); i2++) { cout << nrs[i].print(po) << " atan2 " << nrs[i2].print(po) << " = "; nr.set(nrs[i]); if(nr.atan2(nrs[i2])) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(size_t i2 = 2; i2 < 10; i2++) { cout << nrs[i].print(po) << " root " << i2 << " = "; nr.set(nrs[i]); if(nr.root(i2)) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(long int i2 = -3; i2 <= 3; i2++) { cout << nrs[i].print(po) << " + " << i2 << " = "; nr.set(nrs[i]); if(nr.add(i2)) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(long int i2 = -3; i2 <= 3; i2++) { cout << nrs[i].print(po) << " - " << i2 << " = "; nr.set(nrs[i]); if(nr.subtract(i2)) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(long int i2 = -3; i2 <= 3; i2++) { cout << nrs[i].print(po) << " * " << i2 << " = "; nr.set(nrs[i]); if(nr.multiply(i2)) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(long int i2 = -3; i2 <= 3; i2++) { cout << nrs[i].print(po) << " / " << i2 << " = "; nr.set(nrs[i]); if(nr.divide(i2)) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { for(long int i2 = -3; i2 <= 3; i2++) { cout << nrs[i].print(po) << " + " << i2 << " = "; nr.set(nrs[i]); if(nr.add(i2)) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "inv(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.recip()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "neg(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.negate()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "abs(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.abs()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "sq(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.square()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "sqrt(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.sqrt()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "cbrt(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.cbrt()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "sin(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.sin()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "asin(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.asin()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "sinh(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.sinh()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "asinh(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.asinh()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "cos(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.cos()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "acos(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.acos()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "cosh(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.cosh()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "acosh(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.acosh()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "tan(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.tan()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "atan(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.atan()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "tanh(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.tanh()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "atanh(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.atanh()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "ln(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.ln()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "gamma(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.gamma()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "digamma(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.digamma()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "besselj(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.besselj(1)) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "bessely(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.bessely(1)) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "erf(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.erf()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "erfc(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.erfc()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } cout << "SUM:" << nrsum3.print(po) << endl; cout << "________________________________________________" << endl; for(size_t i = 0; i < nrs.size(); i++) { cout << "arg(" << nrs[i].print(po) << ") = "; nr.set(nrs[i]); if(nr.arg()) cout << nr.print(po) << endl; else cout << "FAILED" << endl; if(!INCLUDES_INFINITY(nr)) nrsum3 += nr; } /*Number nr1, nr2, nr3, nr4, nr5; nr1.setInterval(Number(1, 1), Number(2, 1)); nr2.setInterval(Number(3, 1), Number(4, 1)); nr3.setInterval(Number(-2, 1), Number(1, 1)); nr4.setInterval(Number(-1, 1), Number(-2, 1)); nr5.setInterval(Number(-3, 1), Number(-4, 1)); Number n1(2, 1), n2(4, 1), n3(-2, 1), n4(1, 2); Number nrm; cout << "square" << endl; nrm = nr1; nrm.square(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.square(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.square(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.square(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.square(); cout << "5: " << nrm.print() << endl; cout << "abs" << endl; nrm = nr1; nrm.abs(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.abs(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.abs(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.abs(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.abs(); cout << "5: " << nrm.print() << endl; cout << "sin" << endl; nrm = nr1; nrm.sin(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.sin(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.sin(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.sin(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.sin(); cout << "5: " << nrm.print() << endl; cout << "asin" << endl; nrm = nr1; nrm.asin(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.asin(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.asin(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.asin(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.asin(); cout << "5: " << nrm.print() << endl; cout << "asinh" << endl; nrm = nr1; nrm.asinh(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.asinh(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.asinh(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.asinh(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.asinh(); cout << "5: " << nrm.print() << endl; cout << "sinh" << endl; nrm = nr1; nrm.sinh(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.sinh(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.sinh(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.sinh(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.sinh(); cout << "5: " << nrm.print() << endl; cout << "cos" << endl; nrm = nr1; nrm.cos(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.cos(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.cos(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.cos(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.cos(); cout << "5: " << nrm.print() << endl; cout << "acos" << endl; nrm = nr1; nrm.acos(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.acos(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.acos(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.acos(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.acos(); cout << "5: " << nrm.print() << endl; cout << "acosh" << endl; nrm = nr1; nrm.acosh(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.acosh(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.acosh(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.acosh(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.acosh(); cout << "5: " << nrm.print() << endl; cout << "cosh" << endl; nrm = nr1; nrm.cosh(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.cosh(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.cosh(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.cosh(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.cosh(); cout << "5: " << nrm.print() << endl; cout << "tan" << endl; nrm = nr1; nrm.tan(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.tan(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.tan(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.tan(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.tan(); cout << "5: " << nrm.print() << endl; cout << "atan" << endl; nrm = nr1; nrm.atan(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.atan(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.atan(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.atan(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.atan(); cout << "5: " << nrm.print() << endl; cout << "atanh" << endl; nrm = nr1; nrm.atanh(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.atanh(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.atanh(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.atanh(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.atanh(); cout << "5: " << nrm.print() << endl; cout << "tanh" << endl; nrm = nr1; nrm.tanh(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.tanh(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.tanh(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.tanh(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.tanh(); cout << "5: " << nrm.print() << endl; cout << "gamma" << endl; nrm = nr1; nrm.gamma(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.gamma(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.gamma(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.gamma(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.gamma(); cout << "5: " << nrm.print() << endl; cout << "digamma" << endl; nrm = nr1; nrm.digamma(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.digamma(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.digamma(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.digamma(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.digamma(); cout << "5: " << nrm.print() << endl; cout << "erf" << endl; nrm = nr1; nrm.erf(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.erf(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.erf(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.erf(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.erf(); cout << "5: " << nrm.print() << endl; cout << "erfc" << endl; nrm = nr1; nrm.erfc(); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.erfc(); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.erfc(); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.erfc(); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.erfc(); cout << "5: " << nrm.print() << endl; cout << "misc" << endl; nrm = nr1; nrm.multiply(2); cout << "1: " << nrm.print() << endl; nrm = nr2; nrm.multiply(-2); cout << "2: " << nrm.print() << endl; nrm = nr3; nrm.subtract(2); cout << "3: " << nrm.print() << endl; nrm = nr4; nrm.divide(-2); cout << "4: " << nrm.print() << endl; nrm = nr5; nrm.add(-2); cout << "5: " << nrm.print() << endl;*/ } string rnd_expression(bool allow_unknowns, bool allow_functions, int length_factor1 = 10, int length_factor2 = 5, bool allow_units = false, bool allow_variables = false); string rnd_unit() { int r = rand() % CALCULATOR->units.size(); Unit *u = CALCULATOR->units[r]; if(u->subtype() == SUBTYPE_COMPOSITE_UNIT) return ((CompositeUnit*) u)->print(false, true); string str; if(rand() % 3 == 0) { r = rand() % CALCULATOR->prefixes.size(); str += CALCULATOR->prefixes[r]->name(); } str += u->referenceName(); if(rand() % 3 == 0) { str += "^"; str += ('2' + rand() % 2); } return str; } string rnd_var() { int r = rand() % CALCULATOR->variables.size(); return CALCULATOR->variables[r]->name(); } string rnd_number(bool use_par = true, bool only_integers = false, bool only_positive = false, bool allow_complex = true) { string str; bool par = false; bool dot = only_integers; bool started = false; if(!only_positive && rand() % 3 == 0) {str += '-'; par = true;} while(true) { int r = rand(); if(!started) r = r % (only_positive ? 9 + 1 : 10 + 1); else if(str.back() == '.') r = r % 10; else r = r % ((dot ? 19 : 20) + str.length() * 10); if(r > (dot ? 9 : 15)) break; if((r >= 10 && r <= 15) || (!dot && !started && r == 0)) {if(!started) str += '0'; str += '.'; dot = true;} else str += char('0' + r); started = true; } if(allow_complex && !only_integers && rand() % 10 == 0) {str += 'i'; par = true;} if(par && use_par) {str += ')'; str.insert(0, "(");} return str; } string rnd_item(int &par, bool allow_function = true, int allow_unknown = 1, int allow_unit = false, int allow_variable = false) { int r = rand() % (2 + (allow_unknown > 0)) + 1; string str; if(r != 1 || (!allow_unknown && !allow_function && !allow_unit && !allow_variable)) { str = rnd_number(); } else { if(allow_unit && (rand() % (2 + allow_function + allow_unknown + allow_variable)) == 0) { str = rnd_unit(); } else if(allow_variable && (rand() % (2 + allow_function + allow_unknown)) == 0) { if(!allow_function && !allow_unknown && !allow_variable && rand() % 2 == 0) str = rnd_number(); else str = rnd_var(); } else { if(!allow_unknown) { if(allow_function) r = rand() % 20 + 4; else r = rand() % 2 + 4; } else { int au2 = 3 - allow_unknown % 3; r = (rand() % ((allow_function ? 22 : 5) - au2)) + 4 - allow_unknown; if(r < 4 - allow_unknown % 3) { if(r < 0) r = -r; if(allow_unknown % 3 == 1) r = 3; else if(allow_unknown % 3 == 2) r = 2 + r % 2; else r = 1 + r % 3; } } switch(r) { case 1: {str = "z"; break;} case 2: {str = "y"; break;} case 3: {str = "x"; break;} case 4: {str = "pi"; break;} case 5: {str = "e"; break;} case 6: {str = "root("; str += rnd_expression(allow_unknown, allow_function, 6, 3, allow_unit, allow_variable); str += ','; str += rnd_number(true, true, true, false); str += ')'; return str; } case 7: {str = "log("; str += rnd_expression(allow_unknown, allow_function, 6, 3, allow_unit, allow_variable); str += ','; str += rnd_number(true, true, true, false); str += ')'; return str; } case 8: {str = "sin("; break;} case 9: {str = "cos("; break;} case 10: {str = "tan("; break;} case 11: {str = "sinh("; break;} case 12: {str = "cosh("; break;} case 13: {str = "tanh("; break;} case 14: {str = "asin("; break;} case 15: {str = "acos("; break;} case 16: {str = "atan("; break;} case 17: {str = "asinh("; break;} case 18: {str = "acosh("; break;} case 19: {str = "atanh("; break;} case 20: {str = "ln("; break;} case 21: {str = "abs("; break;} case 22: {str = "sqrt("; break;} case 23: {str = "cbrt("; break;} case 24: {str = "erf("; break;} case 25: {str = "erfc("; break;} case 26: {str = "airy("; break;} case 27: {str = "Si("; break;} case 28: {str = "Shi("; break;} case 29: {str = "im("; break;} case 30: {str = "re("; break;} } if(r > 5) { if(allow_unknown && rand() % 2 == 1) { str += "x)"; if(rand() % 3 == 1) str += "^2"; } else { str += rnd_item(par, true, allow_unknown, allow_unit, allow_variable); par++; } } } } r = rand() % (5 * (par + 1)) + 1; if(r == 1) { str.insert(0, "("); par++; } return str; } string rnd_operator(int &par, bool allow_pow = true) { int r = rand() % (par ? 10 : 5) + 1; string str; if(par > 0 && r > 5) { par--; str = ")"; r -= 5; } if(r == 5 && !allow_pow) r = rand() % 4 + 1; switch(r) { case 1: return str + "+"; case 2: return str + "-"; case 3: return str + "*"; case 4: return str + "/"; case 5: { switch(rand() % 4 + 1) { case 1: return str + "^"; case 2: return str + "^2" + rnd_operator(par, false); case 3: return str + "^3" + rnd_operator(par, false); case 4: return str + "^-1" + rnd_operator(par, false); } } } return ""; } string rnd_expression(bool allow_unknowns, bool allow_functions, int length_factor1, int length_factor2, bool allow_unit, bool allow_variable) { int par = 0; string str; while(str.empty() || rand() % ((length_factor1 - (int) str.length() / length_factor2 < 2) ? 2 : (length_factor1 - (int) str.length() / length_factor2)) != 0) { str += rnd_item(par, allow_functions, allow_unknowns, allow_unit, allow_variable); str += rnd_operator(par); } if(str.back() != ')') str += rnd_item(par, false, allow_unknowns, allow_unit, allow_variable); while(par > 0) { str += ")"; par--; } return str; } KnownVariable *v; int rt1 = 0, rt2 = 0, rt3 = 0, rt4 = 0, rt5 = 0, rt6 = 0, rt7 = 0, rt8 = 0, rt9 = 0; void rnd_test(EvaluationOptions eo, int allow_unknowns, bool allow_functions, bool test_interval = true, bool test_equation = true, bool allow_unit = false, bool allow_variable = false) { bool b_iv = CALCULATOR->usesIntervalArithmetic(); cerr << "A0" << endl; string str = rnd_expression(allow_unknowns, allow_functions, 8, 4, allow_unit, allow_variable); cerr << "A2:" << str << endl; PrintOptions po; po.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; MathStructure mp, m1, m2; CALCULATOR->parse(&mp, str, eo.parse_options); eo.approximation = APPROXIMATION_APPROXIMATE; m1 = mp; cerr << "A3" << endl; cerr << mp << endl; CALCULATOR->calculate(&m1, 5000, eo); if(m1.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED1" << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} eo.approximation = APPROXIMATION_EXACT; m2 = mp; CALCULATOR->calculate(&m2, 5000, eo); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED2" << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} eo.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->calculate(&m2, 5000, eo); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED3" << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m1.isNumber() && m2.isNumber()) { rt1++; if(m1 != m2 && m1.print(po) != m2.print(po)) { rt2++; cout << str << " => " << mp << endl; cout << "UNEQUAL1: " << m1.print(po) << ":" << m2.print(po) << endl; } } cerr << "A" << endl; if(b_iv != CALCULATOR->usesIntervalArithmetic()) { cout << "INTERVAL ARITHMETIC CHANGED1: " << str << " => " << mp << endl; CALCULATOR->useIntervalArithmetic(b_iv); } if(mp.contains(CALCULATOR->v_x)) { rt3++; Number nr(rnd_number(false)); if(nr.hasImaginaryPart() && rand() % 2 == 0) nr += Number(rnd_number(false)); m1 = mp; m1.replace(CALCULATOR->v_x, nr); CALCULATOR->calculate(&m1, 5000, eo); if(m1.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED4: " << nr << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} m2 = mp; CALCULATOR->v_x->setAssumptions(nr); eo.approximation = APPROXIMATION_EXACT; CALCULATOR->calculate(&m2, 5000, eo); CALCULATOR->v_x->setAssumptions(NULL); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED5: " << nr << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} m2.replace(CALCULATOR->v_x, nr); eo.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->calculate(&m2, 5000, eo); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED6: " << nr << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m1.isNumber() && m2.isNumber()) { rt4++; if(m1 != m2 && m1.print(po) != m2.print(po)) { rt5++; cout << str << " => " << mp << ":" << nr << endl; cout << "UNEQUAL2: " << m1.print(po) << ":" << m2.print(po) << endl; } } if(b_iv != CALCULATOR->usesIntervalArithmetic()) { cout << "INTERVAL ARITHMETIC CHANGED3: " << str << " => " << mp << endl; CALCULATOR->useIntervalArithmetic(b_iv); } if(test_interval) { m1 = mp; if(nr.hasImaginaryPart()) nr = rand() % 100 - 50; nr.setPrecision(5); Number nr_iv = nr; nr_iv.precisionToInterval(); cerr << "I1: " << nr_iv << endl; v->set(nr_iv); m1.replace(CALCULATOR->v_x, v); m2 = m1; CALCULATOR->useIntervalArithmetic(true); CALCULATOR->calculate(&m1, 5000, eo); if(m1.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED9"; CALCULATOR->useIntervalArithmetic(b_iv); return;} CALCULATOR->useIntervalArithmetic(false); v->set(nr); cerr << "I2" << endl; CALCULATOR->calculate(&m2, 5000, eo); CALCULATOR->useIntervalArithmetic(b_iv); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED10"; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m1.isNumber() && m2.isNumber() && m1.number().precision(true) > 2) { rt8++; PrintOptions po; po.min_exp = 1; po.max_decimals = 2; po.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; if(m1 != m2) { string si1 = m1.number().imaginaryPart().print(po); string si2 = m2.number().imaginaryPart().print(po); string sr1 = m1.number().realPart().print(po); string sr2 = m2.number().realPart().print(po); if(si1 != si2 && si1 == "0") { nr = m2.number().imaginaryPart(); nr.abs(); nr.log(10); if(nr < -20) { si2 = "0"; } } if(sr1 != sr2 && sr1 == "0") { nr = m2.number().realPart(); nr.abs(); nr.log(10); if(nr < -20) { sr2 = "0"; } } if(si1 != si2 && si2 == "0") { nr = m1.number().imaginaryPart(); nr.abs(); nr.log(10); if(nr < -20) { si1 = "0"; } } if(sr1 != sr2 && sr2 == "0") { nr = m1.number().realPart(); nr.abs(); nr.log(10); if(nr < -20) { sr1 = "0"; } } if((sr1 != sr2 && sr1.length() < 10) || (si1 != si2 && si1.length() < 10)) { po.max_decimals = 1; if(sr1 != sr2) sr2 = m2.number().realPart().print(po); if(si1 != si2) si2 = m2.number().imaginaryPart().print(po); if((sr1 != sr2 && sr1.length() < 10) || (si1 != si2 && si1.length() < 10)) { rt9++; cout << str << " => " << mp << ":" << nr_iv << endl; cout << "UNEQUAL4: " << m1.print(po) << ":" << m2.print(po) << endl; } } } } } if(test_equation) { m1 = mp; cerr << "B" << endl; m1.transform(COMPARISON_EQUALS, m_zero); eo.approximation = APPROXIMATION_EXACT; CALCULATOR->calculate(&m1, 5000, eo); if(m1.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED7"; CALCULATOR->useIntervalArithmetic(b_iv); return;} m1.replace(CALCULATOR->v_n, 3); if(m1.isComparison() && m1.comparisonType() == COMPARISON_EQUALS && m1[0] == CALCULATOR->v_x) { m2 = mp; m2.replace(CALCULATOR->v_x, m1[1]); eo.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->calculate(&m2, 5000, eo); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED8: " << m1[1] << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m2.isNumber()) { rt6++; if(m2.number().isNonZero()) { nr = m2.number(); nr.abs(); nr.log(10); if(nr > -10) { rt7++; cout << str << " => " << mp << endl; cout << "UNEQUAL3: " << m1.print(po) << ":" << m2.print(po) << endl; } } } } else if(!m1.isComparison()) { bool b = true; if(m1.type() == STRUCT_LOGICAL_AND) { for(size_t i = 0; i < m1.size(); i++) { if(m1[i].isComparison() && m1[i].comparisonType() != COMPARISON_EQUALS) { eo.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->calculate(&m1[i], 5000, eo); if(m1[i].isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED9: " << m1[i] << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m1[i].isZero()) { b = false; break; } } } } if(b) { for(size_t i = 0; i < m1.size(); i++) { if(m1[i].isComparison() && m1[i].comparisonType() == COMPARISON_EQUALS && m1[i][0] == CALCULATOR->v_x) { m2 = mp; m2.replace(CALCULATOR->v_x, m1[i][1]); eo.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->calculate(&m2, 5000, eo); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED8: " << m1[i][1] << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m2.isNumber()) { rt6++; if(m2.number().isNonZero()) { nr = m2.number(); nr.abs(); nr.log(10); if(nr > -10) { rt7++; cout << str << " => " << mp << endl; cout << "UNEQUAL3: " << m1[i].print(po) << ":" << m2.print(po) << endl; } } } } else if(!m1[i].isComparison()) { b = true; if(m1[i].type() == STRUCT_LOGICAL_AND) { for(size_t i2 = 0; i2 < m1[i].size(); i2++) { if(m1[i][i2].isComparison() && m1[i][i2].comparisonType() != COMPARISON_EQUALS) { eo.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->calculate(&m1[i][i2], 5000, eo); if(m1[i][i2].isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED9: " << m1[i][i2] << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m1[i][i2].isZero()) { b = false; break; } } } } if(b) { for(size_t i2 = 0; i2 < m1[i].size(); i2++) { if(m1[i][i2].isComparison() && m1[i][i2].comparisonType() == COMPARISON_EQUALS && m1[i][i2][0] == CALCULATOR->v_x) { m2 = mp; m2.replace(CALCULATOR->v_x, m1[i][i2][1]); eo.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->calculate(&m2, 5000, eo); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED8: " << m1[i][i2][1] << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m2.isNumber()) { rt6++; if(m2.number().isNonZero()) { nr = m2.number(); nr.abs(); nr.log(10); if(nr > -10) { rt7++; cout << str << " => " << mp << endl; cout << "UNEQUAL3: " << m1[i][i2].print(po) << ":" << m2.print(po) << endl; } } } } } } } } } if(b_iv != CALCULATOR->usesIntervalArithmetic()) { cout << "INTERVAL ARITHMETIC CHANGED5: " << str << " => " << mp << endl; CALCULATOR->useIntervalArithmetic(b_iv); } } } } string str2 = rnd_expression(allow_unknowns, allow_functions, 6, 5, allow_unit, allow_variable); str.insert(0, "("); str += ") / ("; str += str2; str += ")"; MathStructure mp2; CALCULATOR->parse(&mp2, str2, eo.parse_options); mp /= mp2; eo.approximation = APPROXIMATION_APPROXIMATE; m1 = mp; cerr << mp << endl; CALCULATOR->calculate(&m1, 5000, eo); if(m1.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED1" << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} eo.approximation = APPROXIMATION_EXACT; m2 = mp; CALCULATOR->calculate(&m2, 5000, eo); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED2" << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} eo.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->calculate(&m2, 5000, eo); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED3" << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m1.isNumber() && m2.isNumber()) { rt1++; if(m1 != m2 && m1.print(po) != m2.print(po)) { rt2++; cout << str << " => " << mp << endl; cout << "UNEQUAL1: " << m1.print(po) << ":" << m2.print(po) << endl; } } if(b_iv != CALCULATOR->usesIntervalArithmetic()) { cout << "INTERVAL ARITHMETIC CHANGED12 " << str << " => " << mp << endl; CALCULATOR->useIntervalArithmetic(b_iv); } cerr << "C" << endl; if(mp.contains(CALCULATOR->v_x)) { rt3++; Number nr(rnd_number(false)); if(nr.hasImaginaryPart() && rand() % 2 == 0) nr += Number(rnd_number(false)); m1 = mp; m1.replace(CALCULATOR->v_x, nr); CALCULATOR->calculate(&m1, 5000, eo); if(m1.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED4: " << nr << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} m2 = mp; eo.approximation = APPROXIMATION_EXACT; CALCULATOR->v_x->setAssumptions(nr); CALCULATOR->calculate(&m2, 5000, eo); CALCULATOR->v_x->setAssumptions(NULL); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED5: " << nr << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} m2.replace(CALCULATOR->v_x, nr); eo.approximation = APPROXIMATION_APPROXIMATE; CALCULATOR->calculate(&m2, 5000, eo); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED6: " << nr << endl; CALCULATOR->useIntervalArithmetic(b_iv); return;} if(m1.isNumber() && m2.isNumber()) { rt4++; if(m1 != m2 && m1.print(po) != m2.print(po)) { rt5++; cout << str << " => " << mp << ":" << nr << endl; cout << "UNEQUAL2: " << m1.print(po) << ":" << m2.print(po) << endl; } } if(b_iv != CALCULATOR->usesIntervalArithmetic()) { cout << "INTERVAL ARITHMETIC CHANGED4: " << str << " => " << mp << endl; CALCULATOR->useIntervalArithmetic(b_iv); } if(test_interval) { m1 = mp; if(nr.hasImaginaryPart()) nr = rand() % 100 - 50; nr.setPrecision(5); Number nr_iv = nr; nr_iv.precisionToInterval(); cerr << "I1: " << nr_iv << endl; v->set(nr_iv); m1.replace(CALCULATOR->v_x, v); m2 = m1; CALCULATOR->useIntervalArithmetic(true); CALCULATOR->calculate(&m1, 5000, eo); if(m1.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED9"; CALCULATOR->useIntervalArithmetic(b_iv); return;} CALCULATOR->useIntervalArithmetic(false); v->set(nr); cerr << "I2" << endl; CALCULATOR->calculate(&m2, 5000, eo); CALCULATOR->useIntervalArithmetic(b_iv); if(m2.isAborted()) {cout << str << " => " << mp << endl; cout << "ABORTED10"; return;} if(m1.isNumber() && m2.isNumber() && m1.number().precision(true) > 2) { rt8++; PrintOptions po; po.min_exp = 1; po.max_decimals = 2; po.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; if(m1 != m2) { string si1 = m1.number().imaginaryPart().print(po); string si2 = m2.number().imaginaryPart().print(po); string sr1 = m1.number().realPart().print(po); string sr2 = m2.number().realPart().print(po); if(si1 != si2 && si1 == "0") { nr = m2.number().imaginaryPart(); nr.abs(); nr.log(10); if(nr < -20) { si2 = "0"; } } if(sr1 != sr2 && sr1 == "0") { nr = m2.number().realPart(); nr.abs(); nr.log(10); if(nr < -20) { sr2 = "0"; } } if(si1 != si2 && si2 == "0") { nr = m1.number().imaginaryPart(); nr.abs(); nr.log(10); if(nr < -20) { si1 = "0"; } } if(sr1 != sr2 && sr2 == "0") { nr = m1.number().realPart(); nr.abs(); nr.log(10); if(nr < -20) { sr1 = "0"; } } if((sr1 != sr2 && sr1.length() < 10) || (si1 != si2 && si1.length() < 10)) { po.max_decimals = 1; if(sr1 != sr2) sr2 = m2.number().realPart().print(po); if(si1 != si2) si2 = m2.number().imaginaryPart().print(po); if((sr1 != sr2 && sr1.length() < 10) || (si1 != si2 && si1.length() < 10)) { rt9++; cout << str << " => " << mp << ":" << nr_iv << endl; cout << "UNEQUAL4: " << m1.print(po) << ":" << m2.print(po) << endl; } } } } } } cerr << "D" << endl; //if(display_errors(true)) cout << str << ":" << str2 << endl; } void speed_test() { /*UserFunction f1("", "", "x^2/3"); UserFunction f2("", "", "1/x"); UserFunction f3("", "", "x/4-3"); UserFunction f4("", "", "sin(x rad)"); MathStructure v; v.clearVector(); MathStructure m1 = f1.calculate*/ //Number nr(1); //Number nr_change(1, 8000); /*for(size_t i = 0; i < 800000; i++) { Number n(nr); n ^= 2; n /= 3; nr += nr_change; } nr.set(1); for(size_t i = 0; i < 800000; i++) { Number n(nr); n.recip(); nr += nr_change; } nr.set(1); for(size_t i = 0; i < 800000; i++) { Number n(nr); n /= 4; n -= 3; nr += nr_change; }*/ /*nr.set(1); for(size_t i = 0; i < 800000; i++) { Number n(nr); n.sin(); n *= 2; n -= nr; n.cos(); nr += nr_change; }*/ /*mpfr_set_default_prec(32); mpfr_t nr; mpfr_init(nr); mpfr_set_ui(nr, 1, MPFR_RNDN); mpfr_t nr_change; mpfr_init(nr_change); mpfr_set_ui(nr_change, 1, MPFR_RNDN); mpfr_div_ui(nr_change, nr_change, 8000, MPFR_RNDN); mpfr_t n; mpfr_init(n);*/ /*for(size_t i = 0; i < 800000; i++) { mpfr_pow_ui(n, nr, 2, MPFR_RNDN); mpfr_div_ui(n, n, 3, MPFR_RNDN); mpfr_add(nr, nr, nr_change, MPFR_RNDN); } mpfr_set_ui(nr, 1, MPFR_RNDN); for(size_t i = 0; i < 800000; i++) { mpfr_ui_div(n, 1, nr, MPFR_RNDN); mpfr_add(nr, nr, nr_change, MPFR_RNDN); } mpfr_set_ui(nr, 1, MPFR_RNDN); for(size_t i = 0; i < 800000; i++) { mpfr_div_ui(n, nr, 4, MPFR_RNDN); mpfr_sub_ui(n, n, 3, MPFR_RNDN); mpfr_add(nr, nr, nr_change, MPFR_RNDN); }*/ /*mpfr_set_ui(nr, 1, MPFR_RNDN); for(size_t i = 0; i < 800000; i++) { mpfr_sin(n, nr, MPFR_RNDN); mpfr_mul_ui(n, nr, 2, MPFR_RNDN); mpfr_sub(n, n, nr, MPFR_RNDN); mpfr_cos(n, n, MPFR_RNDN); mpfr_add(nr, nr, nr_change, MPFR_RNDN); }*/ /*double nr = 1.0; double change = 1.0 / 8000; double n; for(size_t i = 0; i < 800000; i++) { n = pow(nr, 2); n /= 3; nr += change; } nr = 1.0; for(size_t i = 0; i < 800000; i++) { n = 1.0 / nr; nr += change; } nr = 1.0; for(size_t i = 0; i < 800000; i++) { n = nr / 4.0; n -= 3.0; nr += change; } nr = 1.0; for(size_t i = 0; i < 800000; i++) { n = sin(nr); nr += change; }*/ EvaluationOptions eo; eo.parse_options.angle_unit = ANGLE_UNIT_RADIANS; eo.approximation = APPROXIMATION_APPROXIMATE; //eo.sync_units = false; /*Number n1; for(size_t i = 0; i < 4000000; i++) { n1 += nr_one; }*/ /*MathStructure m1; for(size_t i = 0; i < 1000000; i++) { m1.calculateAdd(m_one, eo); }*/ /*for(size_t i = 0; i < 2000000; i++) { MathStructure *m1 = new MathStructure(); }*/ /*for(size_t i = 0; i < 2000000; i++) { Number *m1 = new Number(); }*/ /*MathStructure m = CALCULATOR->parse("x^2/2+sin(x+3)^2", eo.parse_options); m.eval(eo); MathStructure mx(CALCULATOR->v_x); Number nr; nr.setFloat(4.0); MathStructure mnr(nr); for(size_t i = 0; i < 1000000; i++) { MathStructure r(m); r.replace(mx, mnr); r.eval(eo); }*/ /*MathStructure m = CALCULATOR->parse("sin('y')+'y'+'y'+'x'^2/3+'x'+'y'", eo.parse_options); MathStructure mx("x"); MathStructure my("y"); for(size_t i = 0; i < 500000; i++) { MathStructure m2(m); //m2.replace(mx, m_one); //m2.replace(my, m_one); m2.replace(mx, m_one, my, m_one); }*/ /*MathStructure m = CALCULATOR->parse("x^2/3", eo.parse_options); eo.expand = false; m.eval(eo); MathStructure v1 = m.generateVector(CALCULATOR->v_x, 1, 100, 800000, NULL, eo); m = CALCULATOR->parse("1/x"); m.eval(eo); MathStructure v2 = m.generateVector(CALCULATOR->v_x, 1, 100, 800000, NULL, eo); m = CALCULATOR->parse("x/4-3"); m.eval(eo); MathStructure v3 = m.generateVector(CALCULATOR->v_x, 1, 100, 800000, NULL, eo); m = CALCULATOR->parse("sin(x)", eo.parse_options); m.eval(eo); MathStructure v4 = m.generateVector(CALCULATOR->v_x, 1, 100, 800000, NULL, eo);*/ //cout << v4.size() << ":" << v4[0] << ":" << v4[v4.size() - 1] << endl; } int main(int argc, char *argv[]) { new Calculator(); CALCULATOR->loadGlobalDefinitions(); CALCULATOR->loadLocalDefinitions(); CALCULATOR->setPrecision(40); EvaluationOptions evalops; /*evalops.approximation = APPROXIMATION_TRY_EXACT; evalops.sync_units = true; evalops.structuring = STRUCTURING_SIMPLIFY; evalops.parse_options.unknowns_enabled = false; evalops.parse_options.read_precision = DONT_READ_PRECISION;*/ /*evalops.parse_options.base = BASE_DECIMAL; evalops.allow_complex = true; evalops.allow_infinite = true;*/ //evalops.auto_post_conversion = POST_CONVERSION_OPTIMAL; evalops.assume_denominators_nonzero = true; //evalops.warn_about_denominators_assumed_nonzero = true; //evalops.parse_options.limit_implicit_multiplication = false; //evalops.parse_options.parsing_mode = PARSING_MODE_ADAPTIVE; evalops.parse_options.angle_unit = ANGLE_UNIT_RADIANS; /*evalops.parse_options.dot_as_separator = CALCULATOR->default_dot_as_separator; evalops.parse_options.comma_as_separator = false;*/ evalops.mixed_units_conversion = MIXED_UNITS_CONVERSION_DEFAULT; evalops.auto_post_conversion = POST_CONVERSION_OPTIMAL; /*MathStructure mstruct = CALCULATOR->calculate("atanh(2x^2+5)*x^2", evalops); cout << mstruct.integrate(CALCULATOR->v_x, evalops) << endl; mstruct.eval(evalops); cout << mstruct << endl;*/ /*mstruct = CALCULATOR->calculate("atanh(3x-2)*x", evalops); mstruct.integrate(CALCULATOR->v_x, evalops); mstruct.eval(evalops); cout << mstruct << endl;*/ //speed_test(); //test_integration(); //test_intervals(true); CALCULATOR->setVariableUnitsEnabled(false); PrintOptions po = CALCULATOR->messagePrintOptions(); po.interval_display = INTERVAL_DISPLAY_SIGNIFICANT_DIGITS; CALCULATOR->setMessagePrintOptions(po); v = new KnownVariable("", "v", m_zero); //CALCULATOR->defaultAssumptions()->setType(ASSUMPTION_TYPE_NUMBER); CALCULATOR->useIntervalArithmetic(); for(size_t i = 0; i <= 10000; i++) { rnd_test(evalops, 4, true, true, true, false, false); if(i % 1000 == 0) cout << endl << rt1 << ":" << rt2 << ":" << rt3 << ":" << rt4 << ":" << rt5 << ":" << rt6 << ":" << rt7 << ":" << rt8 << ":" << rt9 << endl << endl; } cout << endl << endl << "-----------------------------------------" << endl << endl << endl; return 0; } libqalculate-2.8.2/src/Makefile.in0000644000175000017500000005637113401033103013742 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # src/Makefile.am for qalculate # VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ EXTRA_PROGRAMS = qalc$(EXEEXT) defs2doc$(EXEEXT) test$(EXEEXT) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_defs2doc_OBJECTS = defs2doc.$(OBJEXT) defs2doc_OBJECTS = $(am_defs2doc_OBJECTS) defs2doc_DEPENDENCIES = ../libqalculate/libqalculate.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_qalc_OBJECTS = qalc.$(OBJEXT) qalc_OBJECTS = $(am_qalc_OBJECTS) qalc_DEPENDENCIES = ../libqalculate/libqalculate.la am_test_OBJECTS = test.$(OBJEXT) test_OBJECTS = $(am_test_OBJECTS) test_DEPENDENCIES = ../libqalculate/libqalculate.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/defs2doc.Po ./$(DEPDIR)/qalc.Po \ ./$(DEPDIR)/test.Po am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(defs2doc_SOURCES) $(qalc_SOURCES) $(test_SOURCES) DIST_SOURCES = $(defs2doc_SOURCES) $(qalc_SOURCES) $(test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEST = @QALCULATE_TEST@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -I$(top_srcdir) \ -I$(top_srcdir)/libqalculate \ @LIBCURL_CFLAGS@ @LIBXML_CFLAGS@ @ICU_CFLAGS@ bin_PROGRAMS = @QALCULATE_TEXT@ noinst_PROGRAMS = @QALCULATE_DEFS2DOC@ @QALCULATE_TEST@ qalc_SOURCES = qalc.cc qalc_LDADD = \ @LIBXML_LIBS@ \ @LIBCURL_LIBS@ \ @ICU_LIBS@ \ @READLINE_LIBS@ \ @LTLIBINTL@ \ @LTLIBICONV@ \ ../libqalculate/libqalculate.la defs2doc_SOURCES = defs2doc.cc defs2doc_LDADD = \ @LIBXML_LIBS@ \ @LIBCURL_LIBS@ \ @ICU_LIBS@ \ @LTLIBINTL@ \ @LTLIBICONV@ \ ../libqalculate/libqalculate.la test_SOURCES = test.cc test_LDADD = \ @LIBXML_LIBS@ \ @LIBCURL_LIBS@ \ @ICU_LIBS@ \ @LTLIBINTL@ \ @LTLIBICONV@ \ ../libqalculate/libqalculate.la all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list defs2doc$(EXEEXT): $(defs2doc_OBJECTS) $(defs2doc_DEPENDENCIES) $(EXTRA_defs2doc_DEPENDENCIES) @rm -f defs2doc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(defs2doc_OBJECTS) $(defs2doc_LDADD) $(LIBS) qalc$(EXEEXT): $(qalc_OBJECTS) $(qalc_DEPENDENCIES) $(EXTRA_qalc_DEPENDENCIES) @rm -f qalc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(qalc_OBJECTS) $(qalc_LDADD) $(LIBS) test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES) @rm -f test$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defs2doc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qalc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/defs2doc.Po -rm -f ./$(DEPDIR)/qalc.Po -rm -f ./$(DEPDIR)/test.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/defs2doc.Po -rm -f ./$(DEPDIR)/qalc.Po -rm -f ./$(DEPDIR)/test.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile #install-exec-local: # cd $(DESTDIR)$(bindir) && rm -f qalculate; $(LN_S) @LN_QALCULATE@ qalculate # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libqalculate-2.8.2/src/Makefile.am0000644000175000017500000000161213210471336013731 00000000000000# # src/Makefile.am for qalculate # AM_CPPFLAGS = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -I$(top_srcdir) \ -I$(top_srcdir)/libqalculate \ @LIBCURL_CFLAGS@ @LIBXML_CFLAGS@ @ICU_CFLAGS@ bin_PROGRAMS = @QALCULATE_TEXT@ noinst_PROGRAMS = @QALCULATE_DEFS2DOC@ @QALCULATE_TEST@ EXTRA_PROGRAMS = qalc defs2doc test qalc_SOURCES = qalc.cc qalc_LDADD = \ @LIBXML_LIBS@ \ @LIBCURL_LIBS@ \ @ICU_LIBS@ \ @READLINE_LIBS@ \ @LTLIBINTL@ \ @LTLIBICONV@ \ ../libqalculate/libqalculate.la defs2doc_SOURCES = defs2doc.cc defs2doc_LDADD = \ @LIBXML_LIBS@ \ @LIBCURL_LIBS@ \ @ICU_LIBS@ \ @LTLIBINTL@ \ @LTLIBICONV@ \ ../libqalculate/libqalculate.la test_SOURCES = test.cc test_LDADD = \ @LIBXML_LIBS@ \ @LIBCURL_LIBS@ \ @ICU_LIBS@ \ @LTLIBINTL@ \ @LTLIBICONV@ \ ../libqalculate/libqalculate.la #install-exec-local: # cd $(DESTDIR)$(bindir) && rm -f qalculate; $(LN_S) @LN_QALCULATE@ qalculate libqalculate-2.8.2/libqalculate.pc.in0000644000175000017500000000031013141111403014460 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libqalculate Description: libqalculate Version: @VERSION@ Libs: -L${libdir} -lqalculate Cflags: -I${includedir}libqalculate-2.8.2/Makefile.am0000644000175000017500000000043513141107437013145 00000000000000## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 SUBDIRS = libqalculate src data po po-defs docs EXTRA_DIST = config.rpath \ autogen.sh \ README.translate \ libqalculate.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libqalculate.pc libqalculate-2.8.2/docs/0000755000175000017500000000000013401033233012106 500000000000000libqalculate-2.8.2/docs/Makefile.in0000644000175000017500000004767213401033103014107 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # docs/Makefile.am for qalculate # VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEST = @QALCULATE_TEST@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = reference all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libqalculate-2.8.2/docs/Makefile.am0000644000175000017500000000007212705146643014101 00000000000000# # docs/Makefile.am for qalculate # SUBDIRS = reference libqalculate-2.8.2/docs/reference/0000755000175000017500000000000013401033233014044 500000000000000libqalculate-2.8.2/docs/reference/Doxyfile0000644000175000017500000014750013401033023015476 00000000000000# Doxyfile 1.5.3 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # 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. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = libqalculate-2.8.2 # 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 control system is used. PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, # Italian, Japanese, Japanese-en (Japanese with English messages), Korean, # Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, # Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) 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. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = ../../ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" 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. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to # include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be extracted # and appear in the documentation as a namespace called 'anonymous_namespace{file}', # where file will be replaced with the base name of the file that contains the anonymous # namespace. By default anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from the # version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = NO # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = NO # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = NO # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = 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 and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text " # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../../libqalculate # This tag can be used to specify the character encoding of the source files that # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default # input encoding. 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. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py FILE_PATTERNS = *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = ../../libqalculate/BuiltinFunctions.h # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the output. # The symbol name can be a fully qualified name, a word, or if the wildcard * is used, # a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH # then you must also enable this option. If you don't then doxygen will produce # a warning and turn it on anyway SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = NO # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = 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 http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # 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. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = 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. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # 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. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see 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. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to # produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to # specify the directory where the mscgen tool resides. If left empty the tool is assumed to # be found in the default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will # generate a caller dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected # functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the number # of direct children of the root node in a graph is already larger than # MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO libqalculate-2.8.2/docs/reference/html/0000755000175000017500000000000013401033233015010 500000000000000libqalculate-2.8.2/docs/reference/html/classMathFunction.html0000644000175000017500000022660113401033110021244 00000000000000 libqalculate-2.8.2: MathFunction Class Reference
libqalculate-2.8.2

Abstract base class for mathematical functions. More...

#include <Function.h>

Inheritance diagram for MathFunction:
ExpressionItem DataSet UserFunction

Public Member Functions

 MathFunction (string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true)
 
 MathFunction (const MathFunction *function)
 
virtual ExpressionItemcopy () const =0
 
virtual void set (const ExpressionItem *item)
 
virtual int type () const
 
virtual int subtype () const
 
string example (bool raw_format=false, string name_string="") const
 
void setExample (string new_example)
 
bool testArgumentCount (int itmp)
 
virtual MathStructure calculate (const string &eq, const EvaluationOptions &eo=default_evaluation_options)
 
virtual MathStructure parse (const string &eq, const ParseOptions &po=default_parse_options)
 
virtual int parse (MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options)
 
virtual MathStructure calculate (MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options)
 
virtual int calculate (MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)
 
string condition () const
 
string printCondition ()
 
void setCondition (string expression)
 
bool testCondition (const MathStructure &vargs)
 
int args () const
 
int minargs () const
 
int maxargs () const
 
int args (const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)
 
size_t lastArgumentDefinitionIndex () const
 
ArgumentgetArgumentDefinition (size_t index)
 
void clearArgumentDefinitions ()
 
void setArgumentDefinition (size_t index, Argument *argdef)
 
int stringArgs (const string &str, vector< string > &svargs)
 
void setDefaultValue (size_t arg_, string value_)
 
const string & getDefaultValue (size_t arg_) const
 
void appendDefaultValues (MathStructure &vargs)
 
MathStructure produceVector (const MathStructure &vargs, int begin=-1, int end=-1)
 
MathStructure produceArgumentsVector (const MathStructure &vargs, int begin=-1, int end=-1)
 
virtual bool representsPositive (const MathStructure &, bool=false) const
 
virtual bool representsNegative (const MathStructure &, bool=false) const
 
virtual bool representsNonNegative (const MathStructure &, bool=false) const
 
virtual bool representsNonPositive (const MathStructure &, bool=false) const
 
virtual bool representsInteger (const MathStructure &, bool=false) const
 
virtual bool representsNumber (const MathStructure &, bool=false) const
 
virtual bool representsRational (const MathStructure &, bool=false) const
 
virtual bool representsNonComplex (const MathStructure &, bool=false) const
 
virtual bool representsReal (const MathStructure &, bool=false) const
 
virtual bool representsComplex (const MathStructure &, bool=false) const
 
virtual bool representsNonZero (const MathStructure &, bool=false) const
 
virtual bool representsEven (const MathStructure &, bool=false) const
 
virtual bool representsOdd (const MathStructure &, bool=false) const
 
virtual bool representsUndefined (const MathStructure &) const
 
virtual bool representsBoolean (const MathStructure &) const
 
virtual bool representsNonMatrix (const MathStructure &) const
 
virtual bool representsScalar (const MathStructure &) const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Member Functions

bool testArguments (MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromVArgs (const MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromSVArgs (vector< string > &svargs)
 

Protected Attributes

MathFunction_p * priv
 
int argc
 
int max_argc
 
vector< string > default_values
 
size_t last_argdef_index
 
string scondition
 
string sexample
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

Abstract base class for mathematical functions.

A mathemical function, subclassed from MathFunction, should at least reimplement calculate(MathStructure&, const MathStructure&, const EvaluationOptions&) and copy(), and preferably also the represents* functions. Argument definitions should be added in the constructor.

Member Function Documentation

◆ args() [1/2]

int MathFunction::args ( ) const

Returns the maximum number of arguments that the function accepts or -1 if the number of arguments is unlimited.

◆ args() [2/2]

int MathFunction::args ( const string &  str,
MathStructure vargs,
const ParseOptions po = default_parse_options 
)

Parses arguments from a text string and places them in a vector. The text string should be a comma separated list of arguments.

Parameters
strThe argument string to parse.
vargsVector to store parsed arguments in.
poParse options.
Returns
The number of parsed arguments.

◆ calculate()

virtual int MathFunction::calculate ( MathStructure mstruct,
const MathStructure vargs,
const EvaluationOptions eo 
)
virtual

The main function for subclasses to reimplement. Calculates a value from arguments in vargs and puts it in mstruct.

This function expects the number of arguments to be equal to the maximum number of arguments, and checked by the argument definitions.

If the return value is negative, then argument -(return value) has been evaluated in mstruct. If -(return value) is greater than max arguments, then mstruct is a vector of evaluated argument values.

Parameters
[out]mstructStructure that is set with the result of the calculation.
vargsArguments passed to the mathematical function.
eoEvaluation options.
Returns
1 if the calculation was successful.

Reimplemented in UserFunction, and DataSet.

◆ clearArgumentDefinitions()

void MathFunction::clearArgumentDefinitions ( )

Removes all argument definitions for the function.

◆ condition()

string MathFunction::condition ( ) const

Returns the functions condition expression.

Returns
The function's condition expression

◆ getArgumentDefinition()

Argument* MathFunction::getArgumentDefinition ( size_t  index)

Returns the argument definition for an argument index.

Parameters
indexArgument index.
Returns
The argument definition for the index or NULL if no the argument was not defined for the index

◆ lastArgumentDefinitionIndex()

size_t MathFunction::lastArgumentDefinitionIndex ( ) const

Returns the index of the last argument definition.

Returns
The index of the last argument definition

◆ maxargs()

int MathFunction::maxargs ( ) const

Returns the maximum number of arguments that the function accepts or -1 if the number of arguments is unlimited.

◆ minargs()

int MathFunction::minargs ( ) const

Returns the minimum number of arguments for the function.

◆ printCondition()

string MathFunction::printCondition ( )

Print the function's condition expression with argument names.

Returns
The printed condition

◆ setArgumentDefinition()

void MathFunction::setArgumentDefinition ( size_t  index,
Argument argdef 
)

Set the argument definition for an argument index.

Parameters
indexArgument index.
argdefA newly allocated argument definition

◆ setCondition()

void MathFunction::setCondition ( string  expression)

Sets the functions condition expression.

Parameters
expressionThe function's new condition expression

◆ subtype()

virtual int MathFunction::subtype ( ) const
virtual

Returns the subtype of the mathematical function, corresponding to which subsubclass the object belongs to.

Returns
FunctionSubtype.

Implements ExpressionItem.

Reimplemented in UserFunction, and DataSet.

◆ testCondition()

bool MathFunction::testCondition ( const MathStructure vargs)

Test if arguments fulfil the function's condition expression.

Parameters
vargsVector with arguments.
Returns
true if the arguments fulfil the function's condition expression

◆ type()

virtual int MathFunction::type ( ) const
virtual

Returns the type of the expression item, corresponding to which subclass the object belongs to.

Returns
ExpressionItemType.

Implements ExpressionItem.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classAngleArgument-members.html0000644000175000017500000003421213401033110023021 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
AngleArgument Member List

This is the complete list of members for AngleArgument, including all inherited members.

alerts() constArgument
AngleArgument(string name_="", bool does_test=true, bool does_error=true) (defined in AngleArgument)AngleArgument
AngleArgument(const AngleArgument *arg) (defined in AngleArgument)AngleArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constAngleArgumentvirtual
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constAngleArgumentvirtual
Argument::parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constAngleArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constAngleArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constAngleArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constAngleArgumentvirtual
zeroForbidden() constArgument
~AngleArgument() (defined in AngleArgument)AngleArgumentvirtual
~Argument()Argumentvirtual
libqalculate-2.8.2/docs/reference/html/globals_eval.html0000644000175000017500000001750013401033110020245 00000000000000 libqalculate-2.8.2: File Members
libqalculate-2.8.2
 

- a -

- f -

- p -

- s -

- t -

libqalculate-2.8.2/docs/reference/html/classNowVariable-members.html0000644000175000017500000012076213401033110022507 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
NowVariable Member List

This is the complete list of members for NowVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
always_recalculate (defined in DynamicVariable)DynamicVariableprotected
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_expression (defined in KnownVariable)KnownVariableprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculated_precision (defined in KnownVariable)KnownVariableprotected
calculated_with_interval (defined in KnownVariable)KnownVariableprotected
calculated_with_units (defined in KnownVariable)KnownVariableprotected
calculatedPrecision() constDynamicVariable
calculatedWithInterval() const (defined in DynamicVariable)DynamicVariable
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const (defined in NowVariable)NowVariableinlinevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
DynamicVariable(string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true) (defined in DynamicVariable)DynamicVariable
DynamicVariable(const DynamicVariable *variable) (defined in DynamicVariable)DynamicVariable
DynamicVariable() (defined in DynamicVariable)DynamicVariable
expression() constKnownVariablevirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
get()DynamicVariablevirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isExpression() constKnownVariablevirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() constKnownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
KnownVariable(string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable(string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable()KnownVariable
KnownVariable(const KnownVariable *variable)KnownVariable
mstruct (defined in KnownVariable)KnownVariableprotected
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
NowVariable() (defined in NowVariable)NowVariable
NowVariable(const NowVariable *variable) (defined in NowVariable)NowVariableinline
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsComplex(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsEven(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsFraction(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsInteger(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonComplex(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonInteger(bool=false) (defined in NowVariable)NowVariableinlinevirtual
representsNonMatrix() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonNegative(bool=false) (defined in NowVariable)NowVariableinlinevirtual
representsNonPositive(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonZero(bool b=false) (defined in NowVariable)NowVariableinlinevirtual
representsNumber(bool b=false) (defined in NowVariable)NowVariableinlinevirtual
representsOdd(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsPositive(bool=false)NowVariableinlinevirtual
representsRational(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsReal(bool b=false) (defined in NowVariable)NowVariableinlinevirtual
representsScalar() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in DynamicVariable)DynamicVariablevirtual
set(const MathStructure &o)DynamicVariablevirtual
set(string expression_)DynamicVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
setUncertainty(string standard_uncertainty) (defined in KnownVariable)KnownVariablevirtual
setUnit(string unit_expression) (defined in KnownVariable)KnownVariablevirtual
sexpression (defined in KnownVariable)KnownVariableprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constKnownVariableinlinevirtual
suncertainty (defined in KnownVariable)KnownVariableprotected
sunit (defined in KnownVariable)KnownVariableprotected
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constVariableinlinevirtual
uncertainty() const (defined in KnownVariable)KnownVariablevirtual
unit() const (defined in KnownVariable)KnownVariablevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~DynamicVariable() (defined in DynamicVariable)DynamicVariablevirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~KnownVariable() (defined in KnownVariable)KnownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-2.8.2/docs/reference/html/classPrecisionVariable-members.html0000644000175000017500000012130413401033110023670 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
PrecisionVariable Member List

This is the complete list of members for PrecisionVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
always_recalculate (defined in DynamicVariable)DynamicVariableprotected
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_expression (defined in KnownVariable)KnownVariableprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculated_precision (defined in KnownVariable)KnownVariableprotected
calculated_with_interval (defined in KnownVariable)KnownVariableprotected
calculated_with_units (defined in KnownVariable)KnownVariableprotected
calculatedPrecision() constDynamicVariable
calculatedWithInterval() const (defined in DynamicVariable)DynamicVariable
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const (defined in PrecisionVariable)PrecisionVariableinlinevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
DynamicVariable(string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true) (defined in DynamicVariable)DynamicVariable
DynamicVariable(const DynamicVariable *variable) (defined in DynamicVariable)DynamicVariable
DynamicVariable() (defined in DynamicVariable)DynamicVariable
expression() constKnownVariablevirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
get()DynamicVariablevirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isExpression() constKnownVariablevirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() constKnownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
KnownVariable(string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable(string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable()KnownVariable
KnownVariable(const KnownVariable *variable)KnownVariable
mstruct (defined in KnownVariable)KnownVariableprotected
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() constExpressionItemvirtual
PrecisionVariable() (defined in PrecisionVariable)PrecisionVariable
PrecisionVariable(const PrecisionVariable *variable) (defined in PrecisionVariable)PrecisionVariableinline
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsComplex(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsEven(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsFraction(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsInteger(bool=false) (defined in PrecisionVariable)PrecisionVariableinlinevirtual
representsNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonComplex(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonInteger(bool=false) (defined in PrecisionVariable)PrecisionVariableinlinevirtual
representsNonMatrix() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonPositive(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonZero(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNumber(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsOdd(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsPositive(bool=false)DynamicVariableinlinevirtual
representsRational(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsReal(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsScalar() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in DynamicVariable)DynamicVariablevirtual
set(const MathStructure &o)DynamicVariablevirtual
set(string expression_)DynamicVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
setUncertainty(string standard_uncertainty) (defined in KnownVariable)KnownVariablevirtual
setUnit(string unit_expression) (defined in KnownVariable)KnownVariablevirtual
sexpression (defined in KnownVariable)KnownVariableprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constKnownVariableinlinevirtual
suncertainty (defined in KnownVariable)KnownVariableprotected
sunit (defined in KnownVariable)KnownVariableprotected
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constVariableinlinevirtual
uncertainty() const (defined in KnownVariable)KnownVariablevirtual
unit() const (defined in KnownVariable)KnownVariablevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~DynamicVariable() (defined in DynamicVariable)DynamicVariablevirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~KnownVariable() (defined in KnownVariable)KnownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-2.8.2/docs/reference/html/classDataObjectArgument.png0000644000175000017500000000104113401033110022155 00000000000000‰PNG  IHDRP æèPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2°IDATxíaŽë „‡AÊýüšƒÝ@ T}T+¯:Å1†üEŒ1."I.”8ÁC‚@’4è?Nž"|àhCz¦8¹ÿNC{“ú$y¯a‚3ÚüdÈGHóf"É{M•¦Ä´ Iv4N°ÿõ’Ïw¤º9°V’ìhšÀ–ÃØKpV^)@‰{ž… G’Í߉O/(’¬iŽ ç‚$?ÔdF¯’ìÈ¿Nð31ƸRð‘6XªåÛ¶a9Á `1Âz? NàNàN@ýœÀ œÀ œÀ þA!,,”8!He© ö¸¨± sxú*y5½¬Zä½»?Z1N‡‡U‚gáòP/g¬h7YâJþ2M(Å3Ϫäiª'¦<®L¥‘(ÚWp QY£žƒK\ÓkÀ)‚"ã_ånåÞeÅwS©ä;µô ÁÝ.S%e:Xkõ,\”©Ï -‡¡]È÷Aú\I¹–Ýhž…³ÎÞʱTø2?ÁMÞ‰c3F×ýÁÝõÀü&F&Øšòo£ü A!¬Ô?}=öH IEND®B`‚libqalculate-2.8.2/docs/reference/html/sync_off.png0000644000175000017500000000152513401033110017241 00000000000000‰PNG  IHDRàw=øIDATxíÝKhTWÀñÿä1I&3™8M¦Iš™†I3Ú©b$cÌ I1V1±-(Tö±±Ð.* t!‚K[¥Ä¥ˆ„¨´f£`l(øl©"Y”¤6ÆgÌTú}·sgîܹ ±d{8?æÌ¹÷;çÜuíÚ`:!±F¬¢BäŠ?ŰÄm'yÊÅ>ÑlU¯½üý‰è_‹?€Œê ]€Y(ŠNñ±8fý1°Öqún-eâ¨øtºmâÈ Ó0}b›ù%·©µ×Œ®=Ÿ0´³?Š1sŸ‹0€¯8À‘;_ ‹W|%\ Zð— >舽ln¨p©.aÇ{ )t;Ú b nŸš¯›65°¢¡2çÅÔ?Žž>Oдàuönm¤¢Ì`×­Z¬WjC~>‘Ö¾0+á {{©fÝ×Mæ·æÅ•ìÙ¼˜` Ý›%uA6´½ÅÆö¨Á,]k¢ÄW¼™u±›]‹ˆ7§¯iòh€ ¶¶¬ÏÖu1 ló —Ҷ̺–:ÞÍ\ÄcãÏxøhR²Êè‡Qt$¿ß§¨ ª fdºü<4BÿÙ[•f¸d7=.Mé9/—éªÃëù/ÿO Üaàò}€,‘j?Ÿõ.5Úšm?œÿŸ®ŽXÿ2¬#¸d píæ(£?cÛú¼!½›a1¥Þ—ŽòØ©ܾ7dÔK:‚ùÒ‰ì)Ê3‚Ü™àÌà]€,±H€µ+køöäu<|`·LhC7¹ÔeÍ Ÿ×Ÿ˜tÜ‹ óH$^2%l.êaeÐäýE”ÌÉ|ÅÜìî‰Ýsä }¸ýDû^hzé~ðR›¦Ã¡¿]|#ü¯@×—Ö‡[k¹–<|š(Ç*€Ý¹dÇtMé:Ýñø«Ø,êÅû¢]”' øXÓ_nò¡Æ|Øý /c§fžâOIEND®B`‚libqalculate-2.8.2/docs/reference/html/classSymbolicArgument.png0000644000175000017500000000103313401033110021737 00000000000000‰PNG  IHDRuP»Ê PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2ªIDATxíé’ƒ ›ª¼ÿ#oÂ%Ôݪ°•^”06#ù‹÷Þ_^’.fX%©'ÿØê$éÍñ{¬î¨ö«Öкø?>»\?»c׫‰×’´Æk2aòkИû2IZãubj&m$i•=Ö×_ËÇ|Ïš÷´™«ýV’V9aµÛÛi…­5UÏTDÙ•j¸LH’V9s6=4$ÉrÔZr–¤Óε}HRƒñ›#I=ù1«÷Þ_ ÀI—s‹õñ¸C{‹õ)½A{õ§jxXº2¬=V€ž +@O† 'à Гaèɰ´qιËÁ\̰ôänk(-‹í{Þ™Ž£SNã‹54 ™Y?Z©EkjCF)­çEœPhrgZ–GW1S| |5ïq!¨¶†añÂ<¬º)”AÕÀ_î«í©×(gƒÃ|­Õ ÍšñóYÏkÙš+pËǬX«è½V³%[¹ÚowY·ó·Æ÷ö —÷5ûógµ†­5UÏTD³±iBËo܇ÕÞйõ¬tÊ`›™õ|¦Ë'*ÀŒñKГ³:çÜÕüq¾¢÷Û¯IEND®B`‚libqalculate-2.8.2/docs/reference/html/classAssumptions.html0000644000175000017500000003467013401033110021175 00000000000000 libqalculate-2.8.2: Assumptions Class Reference
libqalculate-2.8.2

An assumption about an unknown mathematical value. More...

#include <Variable.h>

Public Member Functions

bool isPositive ()
 
bool isNegative ()
 
bool isNonNegative ()
 
bool isNonPositive ()
 
bool isInteger ()
 
bool isNumber ()
 
bool isRational ()
 
bool isReal ()
 
bool isComplex ()
 
bool isNonZero ()
 
bool isNonMatrix ()
 
bool isScalar ()
 
AssumptionType type ()
 
AssumptionSign sign ()
 
void setType (AssumptionType ant)
 
void setSign (AssumptionSign as)
 
void setMin (const Number *nmin)
 
void setIncludeEqualsMin (bool include_equals)
 
bool includeEqualsMin () const
 
const Numbermin () const
 
void setMax (const Number *nmax)
 
void setIncludeEqualsMax (bool include_equals)
 
bool includeEqualsMax () const
 
const Numbermax () const
 

Protected Attributes

AssumptionType i_type
 
AssumptionSign i_sign
 
Numberfmin
 
Numberfmax
 
bool b_incl_min
 
bool b_incl_max
 

Detailed Description

An assumption about an unknown mathematical value.

Assumptions have a type and a sign. The type describes the type of the value – if it represents a number or something else, and what type of number is represented. The sign restricts the signedness of a number. The sign generally only applies the assumptions representing a number. The assumption class also includes max and min values, which however are not used anywhere yet.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/functions_p.html0000644000175000017500000001704113401033110020142 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- p -

libqalculate-2.8.2/docs/reference/html/tab_a.png0000644000175000017500000000021613401033110016475 00000000000000‰PNG  IHDR$ÇÇ[UIDATxíK €0C'o¤(Šˆ[Žà%Üxÿ#Ù©­ç ùÁöó¦W¦e# 3t I 3+¼øEã~\D½9¯Ûàè’wM·¿öÿ}Yõ_êA4Yžã}IEND®B`‚libqalculate-2.8.2/docs/reference/html/classCompositeUnit-members.html0000644000175000017500000011435013401033110023074 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
CompositeUnit Member List

This is the complete list of members for CompositeUnit, including all inherited members.

abbreviation(bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
add(Unit *u, int exp=1, Prefix *prefix=NULL)CompositeUnitvirtual
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
b_si (defined in Unit)Unitprotected
b_use_with_prefixes (defined in Unit)Unitprotected
baseExponent(int exp=1) const (defined in Unit)Unitvirtual
baseUnit() const (defined in Unit)Unitvirtual
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clear()CompositeUnitvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
CompositeUnit(string cat_, string name_, string title_="", string base_expression_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in CompositeUnit)CompositeUnit
CompositeUnit(const CompositeUnit *unit) (defined in CompositeUnit)CompositeUnit
containsRelativeTo(Unit *u) constCompositeUnitvirtual
convert(Unit *u, MathStructure &mvalue, MathStructure &exp) constUnit
convert(Unit *u, MathStructure &mvalue) constUnit
convert(Unit *u, bool *converted=NULL) const (defined in Unit)Unit
convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unitvirtual
convertFromBaseUnit(MathStructure &mvalue) const (defined in Unit)Unitvirtual
convertFromBaseUnit() const (defined in Unit)Unitvirtual
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unitvirtual
convertToBaseUnit(MathStructure &mvalue) const (defined in Unit)Unitvirtual
convertToBaseUnit() const (defined in Unit)Unitvirtual
copy() const (defined in CompositeUnit)CompositeUnitvirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
countries() const (defined in Unit)Unit
countUnits() constCompositeUnitvirtual
del(size_t index) (defined in CompositeUnit)CompositeUnitvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
find(Unit *u) const (defined in CompositeUnit)CompositeUnitvirtual
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
generateMathStructure(bool make_division=false, bool set_null_prefixes=false) constCompositeUnitvirtual
get(size_t index, int *exp=NULL, Prefix **prefix=NULL) constCompositeUnitvirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasComplexRelationTo(Unit *u) const (defined in Unit)Unitvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isChildOf(Unit *u) constUnitvirtual
isCurrency() constUnit
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isParentOf(Unit *u) constUnitvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() constUnit
isUsedByOtherUnits() const (defined in Unit)Unitvirtual
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
plural(bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
print(bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constCompositeUnitvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
scountries (defined in Unit)Unitprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in CompositeUnit)CompositeUnitvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAsSIUnit()Unit
setBaseExpression(string base_expression_) (defined in CompositeUnit)CompositeUnitvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setCountries(string country_names) (defined in Unit)Unit
setDescription(string descr_)ExpressionItemvirtual
setExponent(size_t index, int exp) (defined in CompositeUnit)CompositeUnitvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setPrefix(size_t index, Prefix *prefix) (defined in CompositeUnit)CompositeUnitvirtual
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItemvirtual
setUseWithPrefixesByDefault(bool use_with_prefixes)Unit
singular(bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
sshort (defined in CompositeUnit)CompositeUnitprotected
ssystem (defined in Unit)Unitprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constCompositeUnitvirtual
system() constUnit
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constUnitvirtual
Unit(string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Unit)Unit
Unit() (defined in Unit)Unit
Unit(const Unit *unit) (defined in Unit)Unit
units (defined in CompositeUnit)CompositeUnitprotected
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
useWithPrefixesByDefault() constUnit
v_refs (defined in ExpressionItem)ExpressionItemprotected
~CompositeUnit() (defined in CompositeUnit)CompositeUnitvirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~Unit() (defined in Unit)Unitvirtual
libqalculate-2.8.2/docs/reference/html/classAliasUnit.png0000644000175000017500000000154313401033110020352 00000000000000‰PNG  IHDR~Àõ='¿PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2òIDATxíÑ’« ›C•ÿÿÉ7Š hܸšÝs·2‰-‚ƒ-Ã$Ï䜳²$¹½$™øOõiúHÒ vqssõ’t™wé§&ßõjLLÉÏzž˜¯Öf,“$iϫ՗™Ó³fÙìKÒæh·cã!I;^î}]^OyÜznFwú/6ãåÞïõí{­·ŸêKä}·Ž•6f»R%Õ£¤ž“¥·…$mŽ·&¿dnWùkU~W­ÍÖ|O/©9îý HÒ¡—$¡—$~}Î9Û¸Ãàë«ß«Ø~³þÃ+?ô.B`"ô&B`"ô&B`"ô&Bp•œsöA–$¡—$SŸÖÓÒ­I:Ë{ôÛŽ$â¦>)—csÉW_ÒîJ~Yzè?I?Vú¬^ô¿Yù’ôB/I&B/I&üúœs¶p‡À‡W? V¿Wÿ°;ýfý‡W~è\„ÀDèL„ÀDèL„ÀDèL„à*)¥äƒà"ô&þ¾D>ÎÛ)S¿>‰xÆ7ôsè“øýøêÇvüÍNM£D”î|àkÎëOÑwW«¾xÁU}·Ç]V~J?ýG¶É/ÍïèÛ²¯¦&ýfïM?÷\mu'jÄÛ+àí„ÀDèLøõ)¥dà€¯~¬~¯þawúÍú¯üи=€‰Ð˜=€‰Ð˜=€‰Ð˜=ÀUrÎùCÎ9_‡,I.B/I&þ#}ZÎå¢~¦~ÜD¤ÇG’N°{v£O[Í‘¾ïM’¤'œÐí¼¤é\Ççn³Þ&)ËÍù%xó ©W§Wýâ)³»«UßôúeƤ킕´=–iGún§º¬¼ÒïÐ=èP?—PM~iÞ£_Tr¿dÕo^¯¾a›üz)5Ç®ôžë7{ÿDÿüæ·÷~·9µ€êN4ùÛÿîÛ½«?“íOè¨ò%éœú+¸¬Ÿêç«¿»ŸÕKÒ—˜õ’ô’ÐK’ ¿>çœmügpLúÛ ÐÖIEND®B`‚libqalculate-2.8.2/docs/reference/html/structElement.html0000644000175000017500000001124713401033110020453 00000000000000 libqalculate-2.8.2: Element Struct Reference
libqalculate-2.8.2
Element Struct Reference

Public Attributes

string symbol
 
string name
 
int number
 
int group
 
string weight
 
int x_pos
 
int y_pos
 

The documentation for this struct was generated from the following file:
libqalculate-2.8.2/docs/reference/html/Calculator_8h.html0000644000175000017500000002467113401033110020312 00000000000000 libqalculate-2.8.2: libqalculate/Calculator.h File Reference
libqalculate-2.8.2
Calculator.h File Reference
#include <libqalculate/includes.h>
#include <libqalculate/util.h>
#include <sys/time.h>
#include <libqalculate/MathStructure.h>

Classes

struct  PlotParameters
 Parameters passed to plotting functions. More...
 
struct  PlotDataParameters
 Parameters for plot data series. More...
 
class  CalculatorMessage
 A message with information to the user. Primarily used for errors and warnings. More...
 
struct  Element
 
class  Calculator
 The almighty calculator class. More...
 

Macros

#define MESSAGE_STAGE_CONVERSION   -4
 Message stages.
 
#define MESSAGE_STAGE_CONVERSION_PARSING   -3
 
#define MESSAGE_STAGE_CALCULATION   -2
 
#define MESSAGE_STAGE_PARSING   -1
 
#define MESSAGE_STAGE_UNSET   0
 
#define MESSAGE_CATEGORY_NONE   0
 Message categories.
 
#define MESSAGE_CATEGORY_PARSING   1
 
#define UFV_LENGTHS   20
 

Typedefs

typedef vector< Prefix * > p_type
 

Enumerations

enum  MessageType { MESSAGE_INFORMATION, MESSAGE_WARNING, MESSAGE_ERROR }
 Message types.
 
enum  {
  ELEMENT_CLASS_NOT_DEFINED, ALKALI_METALS, ALKALI_EARTH_METALS, LANTHANIDES,
  ACTINIDES, TRANSITION_METALS, METALS, METALLOIDS,
  NONMETALS, HALOGENS, NOBLE_GASES, TRANSACTINIDES
}
 
libqalculate-2.8.2/docs/reference/html/functions_vars.html0000644000175000017500000004722313401033110020663 00000000000000 libqalculate-2.8.2: Class Members - Variables
libqalculate-2.8.2
 

- a -

- b -

- c -

- d -

- e -

- f -

- g -

- h -

- i -

- k -

- l -

- m -

- n -

- p -

- r -

- s -

- t -

- u -

- v -

- w -

- x -

- y -

libqalculate-2.8.2/docs/reference/html/classBooleanArgument-members.html0000644000175000017500000003426513401033110023362 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
BooleanArgument Member List

This is the complete list of members for BooleanArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
BooleanArgument(string name_="", bool does_test=true, bool does_error=true) (defined in BooleanArgument)BooleanArgument
BooleanArgument(const BooleanArgument *arg) (defined in BooleanArgument)BooleanArgument
copy() constBooleanArgumentvirtual
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constBooleanArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constBooleanArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constBooleanArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constBooleanArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~BooleanArgument() (defined in BooleanArgument)BooleanArgumentvirtual
libqalculate-2.8.2/docs/reference/html/functions_v.html0000644000175000017500000000505113401033110020146 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- v -

libqalculate-2.8.2/docs/reference/html/classTomorrowVariable.html0000644000175000017500000017025713401033110022150 00000000000000 libqalculate-2.8.2: TomorrowVariable Class Reference
libqalculate-2.8.2
TomorrowVariable Class Reference
Inheritance diagram for TomorrowVariable:
DynamicVariable KnownVariable Variable ExpressionItem

Public Member Functions

 TomorrowVariable (const TomorrowVariable *variable)
 
ExpressionItemcopy () const
 
virtual bool representsPositive (bool=false)
 
virtual bool representsNonNegative (bool=false)
 
virtual bool representsNonInteger (bool=false)
 
virtual bool representsNumber (bool b=false)
 
virtual bool representsReal (bool b=false)
 
virtual bool representsNonZero (bool b=false)
 
- Public Member Functions inherited from DynamicVariable
 DynamicVariable (string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true)
 
 DynamicVariable (const DynamicVariable *variable)
 
void set (const ExpressionItem *item)
 
const MathStructureget ()
 
void set (const MathStructure &o)
 
void set (string expression_)
 
int calculatedPrecision () const
 
bool calculatedWithInterval () const
 
virtual bool representsNegative (bool=false)
 
virtual bool representsNonPositive (bool=false)
 
virtual bool representsInteger (bool=false)
 
virtual bool representsRational (bool=false)
 
virtual bool representsComplex (bool=false)
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
virtual bool representsNonMatrix ()
 
virtual bool representsScalar ()
 
- Public Member Functions inherited from KnownVariable
 KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable ()
 
 KnownVariable (const KnownVariable *variable)
 
bool isKnown () const
 
virtual bool isExpression () const
 
virtual string expression () const
 
virtual string uncertainty () const
 
virtual string unit () const
 
int subtype () const
 
virtual void setUncertainty (string standard_uncertainty)
 
virtual void setUnit (string unit_expression)
 
virtual bool representsFraction (bool=false)
 
virtual bool representsNonComplex (bool=false)
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Additional Inherited Members

- Protected Attributes inherited from DynamicVariable
bool always_recalculate
 
- Protected Attributes inherited from KnownVariable
MathStructuremstruct
 
bool b_expression
 
int calculated_precision
 
bool calculated_with_interval
 
bool calculated_with_units
 
string sexpression
 
string suncertainty
 
string sunit
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Member Function Documentation

◆ representsPositive()

virtual bool TomorrowVariable::representsPositive ( bool  = false)
inlinevirtual

Returns if the variable represents a positive value.

Reimplemented from DynamicVariable.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/nav_g.png0000644000175000017500000000013713401033110016523 00000000000000‰PNG  IHDRô1&IDATxíÝ1 ÁOHf„á_ ->~¸åM iËMèÀƒS½ü‚<IEND®B`‚libqalculate-2.8.2/docs/reference/html/classBinaryPrefix.html0000644000175000017500000005316613401033110021253 00000000000000 libqalculate-2.8.2: BinaryPrefix Class Reference
libqalculate-2.8.2

A binary prefix. More...

#include <Prefix.h>

Inheritance diagram for BinaryPrefix:
Prefix

Public Member Functions

 BinaryPrefix (int exp2, string long_name, string short_name="", string unicode_name="")
 
int exponent (int iexp=1) const
 
Number exponent (const Number &nexp) const
 
void setExponent (int iexp)
 
Number value (const Number &nexp) const
 
Number value (int iexp) const
 
Number value () const
 
int type () const
 
- Public Member Functions inherited from Prefix
 Prefix (string long_name, string short_name="", string unicode_name="")
 
const string & shortName (bool return_long_if_no_short=true, bool use_unicode=false) const
 
const string & longName (bool return_short_if_no_long=true, bool use_unicode=false) const
 
const string & unicodeName (bool return_short_if_no_uni=true) const
 
void setShortName (string short_name)
 
void setLongName (string long_name)
 
void setUnicodeName (string unicode_name)
 
const string & name (bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 

Protected Attributes

int exp
 
- Protected Attributes inherited from Prefix
string l_name
 
string s_name
 
string u_name
 

Detailed Description

A binary prefix.

A Binary prefix has an integer exponent which with a base of two constitutes the value of the prefix (value=2^exponent).

Constructor & Destructor Documentation

◆ BinaryPrefix()

BinaryPrefix::BinaryPrefix ( int  exp2,
string  long_name,
string  short_name = "",
string  unicode_name = "" 
)

Create a binary prefix.

Parameters
exp2Exponent for the value.
long_nameLong name.
short_nameShort name.
unicode_nameUnicode name.

Member Function Documentation

◆ exponent() [1/2]

int BinaryPrefix::exponent ( int  iexp = 1) const

Returns the exponent.

Parameters
iexpExponent of the unit.
Returns
The exponent of the prefix.

◆ exponent() [2/2]

Number BinaryPrefix::exponent ( const Number nexp) const

Returns the exponent.

Parameters
nexpExponent of the unit.
Returns
The exponent of the prefix.

◆ setExponent()

void BinaryPrefix::setExponent ( int  iexp)

Sets the exponent of the prefix.

Parameters
iexpNew exponent for the prefix.

◆ type()

int BinaryPrefix::type ( ) const
virtual

Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix.

Returns
The type of the prefix.

Implements Prefix.

◆ value() [1/3]

Number BinaryPrefix::value ( const Number nexp) const
virtual

Returns the value of the prefix.

Parameters
nexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implements Prefix.

◆ value() [2/3]

Number BinaryPrefix::value ( int  iexp) const
virtual

Returns the value of the prefix.

Parameters
iexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implements Prefix.

◆ value() [3/3]

Number BinaryPrefix::value ( ) const
virtual

Returns the value of the prefix.

Returns
The value of the prefix.

Implements Prefix.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classUnknownVariable.html0000644000175000017500000016357213401033110021761 00000000000000 libqalculate-2.8.2: UnknownVariable Class Reference
libqalculate-2.8.2

A variable with unknown value. More...

#include <Variable.h>

Inheritance diagram for UnknownVariable:
Variable ExpressionItem

Public Member Functions

 UnknownVariable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 UnknownVariable ()
 
 UnknownVariable (const UnknownVariable *variable)
 
virtual ExpressionItemcopy () const
 
virtual void set (const ExpressionItem *item)
 
bool isKnown () const
 
void setAssumptions (Assumptions *ass)
 
void setAssumptions (const MathStructure &mvar)
 
Assumptionsassumptions ()
 
const MathStructureinterval () const
 
void setInterval (const MathStructure &o)
 
virtual int subtype () const
 
virtual bool representsPositive (bool=false)
 
virtual bool representsNegative (bool=false)
 
virtual bool representsNonNegative (bool=false)
 
virtual bool representsNonPositive (bool=false)
 
virtual bool representsInteger (bool=false)
 
virtual bool representsNumber (bool=false)
 
virtual bool representsRational (bool=false)
 
virtual bool representsReal (bool=false)
 
virtual bool representsNonComplex (bool=false)
 
virtual bool representsComplex (bool=false)
 
virtual bool representsNonZero (bool=false)
 
virtual bool representsNonMatrix ()
 
virtual bool representsScalar ()
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
virtual bool representsNonInteger (bool=false)
 
virtual bool representsFraction (bool=false)
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Attributes

Assumptionso_assumption
 
MathStructuremstruct
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

A variable with unknown value.

Unknown variables have an associated assumption object.

Constructor & Destructor Documentation

◆ UnknownVariable() [1/3]

UnknownVariable::UnknownVariable ( string  cat_,
string  name_,
string  title_ = "",
bool  is_local = true,
bool  is_builtin = false,
bool  is_active = true 
)

Create an unknown.

Parameters
cat_Category that the variable belongs to.
name_Initial name of the variable.
title_Descriptive name.
is_localIf the variable is local/user-defined or global.
is_builtinIf the variable is builtin and not modifiable.
is_activeIf the variable is active and can be used in expressions.

◆ UnknownVariable() [2/3]

UnknownVariable::UnknownVariable ( )

Create an empty unknown variable.

◆ UnknownVariable() [3/3]

UnknownVariable::UnknownVariable ( const UnknownVariable variable)

Create a copy of an unknown variable.

Parameters
variableUnknown variable to copy.

Member Function Documentation

◆ assumptions()

Assumptions* UnknownVariable::assumptions ( )

Returns the assumptions of the unknown variable.

Returns
Assumptions of the unknown variable.

◆ isKnown()

bool UnknownVariable::isKnown ( ) const
inlinevirtual

Returns if the variable has a known value (as oppossed to assumptions).

Returns
true if the variable is of class KnownVariable, false if UnknownVariable.

Implements Variable.

◆ representsPositive()

virtual bool UnknownVariable::representsPositive ( bool  = false)
virtual

Returns if the variable represents a positive value.

Reimplemented from Variable.

◆ setAssumptions()

void UnknownVariable::setAssumptions ( Assumptions ass)

Sets the assumptions of the unknown variable.

Parameters
assAssumptions.

◆ subtype()

virtual int UnknownVariable::subtype ( ) const
inlinevirtual

Returns the subtype of the variable, corresponding to which subsubclass the object belongs to.

Returns
VariableSubtype.

Reimplemented from Variable.

References SUBTYPE_UNKNOWN_VARIABLE.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classNumberPrefix.png0000644000175000017500000000066213401033110021070 00000000000000‰PNG  IHDRYPEÚ)UPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2AIDATx펬 EO/‰ÿÿÉë (Î#;öewSÓ Xä´¶|)¥ä"’$9(È?‚l¯GRg«çⓤ^ÿ"ÃÉ'Iï5KÎiæü·aSRµirÆeÕémö³u.¸†œƒIÒfr®y—Jr~¤ƒµ•¹Ï%é› r%i$WrJ)y`Z €‹ÜÈËâ…v#¯`'´ùWÞ Õ‚d€‘‚d€‘‚d€‘þ>ÙÌÌE€ƒ‚üŸÉÛ43råÖ­/C%çy’<ð_#Õœ_‹UÇt¬KÐ=v9RöÊÆ6´1ïÉ™¸-÷þÚ¿tSl½Ý'—“xüÀu/K×Á¦ÕÊ?çC»ê¡mãr ëÈÝr\ZSƒj§:ȵÙÃ6m1hìt7Nä²qOxTA2ÀH®d33}ëôäÜ5J–IEND®B`‚libqalculate-2.8.2/docs/reference/html/nav_f.png0000644000175000017500000000023113401033110016515 00000000000000‰PNG  IHDR8³»`IDATxíÝK€ EÑ–·[†øBÑmkâÄÂH—prÓ¼.‚Žó‚ꎤR6Z VI±E‚5j³„lóš›iI˜¬ÞêçJ0ŒÑÑ/Žû›™uøñóÞ¿6sH ÝõyIEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_func_s.html0000644000175000017500000003173613401033110021167 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- s -

libqalculate-2.8.2/docs/reference/html/structEvaluationOptions.html0000644000175000017500000005015713401033110022550 00000000000000 libqalculate-2.8.2: EvaluationOptions Struct Reference
libqalculate-2.8.2
EvaluationOptions Struct Reference

Options for calculation. More...

#include <includes.h>

Public Attributes

ApproximationMode approximation
 How exact the result must be. Default: TRY_EXACT.
 
bool sync_units
 If units will be synced/converted to allow evaluation (ex. 1 min + 1 s=60 s+ 1 s = 61 s). Default: true.
 
bool sync_complex_unit_relations
 If units with complex/non-linear relations (ex. degress celsius and fahrenheit) will synced/converted. Default: true.
 
bool keep_prefixes
 If unit prefixes in original expression will be kept. Default: false.
 
bool calculate_variables
 If known variables will be replaced by their value. Default: true.
 
bool calculate_functions
 If functions will be calculated. Default: true.
 
int test_comparisons
 If comparisons will be evaluated (ex. 5>2 => 1). Default: true.
 
bool isolate_x
 If a varaible will be isolated to the left side in equations/comparisons (ex. x+y=2 => x=2-y). Default: true.
 
int expand
 If factors (and bases) containing addition will be expanded (ex. z(x+y)=zx+zy). Default: true.
 
bool combine_divisions
 Use behaviour from version <= 0.9.12 which returns (x+y)/z instead of x/y+y/z if expand = true.
 
bool reduce_divisions
 If non-numerical parts of a fraction will be reduced (ex. (5x)/(3xy) =5/(3y) . Default: true.
 
bool allow_complex
 If complex numbers will be used for evaluation. Default: true.
 
bool allow_infinite
 If infinite numbers will be used for evaluation. Default: true.
 
int assume_denominators_nonzero
 If simplification will be made easier by assuming that denominators with unknown value not is zero. Default: false.
 
bool warn_about_denominators_assumed_nonzero
 Warn if a denominator with unknown value was assumed non-zero (with assume_denominators_nonzero set to true) to allow simplification. Default: false.
 
bool split_squares
 If powers with exponent 1/2 that only have an approximate result will be split to the least base (sqrt(8) = 2 * sqrt(2)). Default: true.
 
bool keep_zero_units
 If units with zero quantity will be preserved. Default: true.
 
AutoPostConversion auto_post_conversion
 If and how units will be automatically converted. Does not affect syncing of units. Default: POST_CONVERSION_NONE.
 
MixedUnitsConversion mixed_units_conversion
 Shows time as h + min + s, imperial length as ft + in, etc. Default: MIXED_UNITS_CONVERSION_DEFAULT.
 
StructuringMode structuring
 If the evaluation result will be simplified or factorized Default: STRUCTURING_NONE.
 
ParseOptions parse_options
 Options for parsing of expression. Default: default_parse_options.
 
const MathStructureisolate_var
 If set will decide which variable to isolate in an equation. Default: NULL.
 
bool do_polynomial_division
 Use polynomial division to simplify the result. Default: true.
 
MathFunctionprotected_function
 Do not calculate the specified function. Default: NULL.
 
ComplexNumberForm complex_number_form
 Complex number form. Default: COMPLEX_NUMBER_FORM_RECTANGULAR.
 
bool local_currency_conversion
 Convert to local currency when optimal conversion is enabled.
 
bool transform_trigonometric_functions
 Mainly for internal use. Default: true.
 

Detailed Description

Options for calculation.


The documentation for this struct was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classArgument-members.html0000644000175000017500000003216413401033110022056 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
Argument Member List

This is the complete list of members for Argument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constArgumentvirtual
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
libqalculate-2.8.2/docs/reference/html/classes.html0000644000175000017500000003146013401033110017251 00000000000000 libqalculate-2.8.2: Class Index
libqalculate-2.8.2
Class Index
a | b | c | d | e | f | i | k | m | n | p | q | s | t | u | v | y
  a  
DataObjectArgument   InternalPrintStruct   PlotParameters   UnitArgument   
DataProperty   
  k  
PrecisionVariable   UnknownVariable   
AliasUnit   DataPropertyArgument   Prefix   UserFunction   
AliasUnit_Composite   DataSet   KnownVariable   PrintOptions   
  v  
AngleArgument   DateArgument   
  m  
  q  
Argument   DecimalPrefix   Variable   
ArgumentSet   DynamicVariable   MathFunction   QalculateDateTime   VariableArgument   
Assumptions   
  e  
MathStructure   
  s  
VectorArgument   
  b  
MatrixArgument   
  y  
Element   
  n  
SortOptions   
BinaryPrefix   EvaluationOptions   SymbolicArgument   YesterdayVariable   
BooleanArgument   ExpressionItem   NowVariable   
  t  
  c  
ExpressionItemArgument   Number   
ExpressionName   NumberArgument   TextArgument   
Calculator   
  f  
NumberPrefix   Thread   
CalculatorMessage   
  p  
TodayVariable   
CompositeUnit   FileArgument   TomorrowVariable   
  d  
FunctionArgument   ParseOptions   
  u  
  i  
PlotDataParameters   
DataObject   Unit   
IntegerArgument   
a | b | c | d | e | f | i | k | m | n | p | q | s | t | u | v | y
libqalculate-2.8.2/docs/reference/html/classMathStructure.html0000644000175000017500000073572213401033110021470 00000000000000 libqalculate-2.8.2: MathStructure Class Reference
libqalculate-2.8.2

A structure representing a mathematical value/expression/result. More...

#include <MathStructure.h>

Public Member Functions

bool calculateLimit (const MathStructure &x_var, const MathStructure &limit, const EvaluationOptions &eo_pre, int approach_direction=0)
 
bool decomposeFractions (const MathStructure &x_var, const EvaluationOptions &eo)
 
bool inParentheses () const
 
void setInParentheses (bool b=true)
 
Constructors
 MathStructure ()
 
 MathStructure (const MathStructure &o)
 
 MathStructure (int num, int den=1, int exp10=0)
 
 MathStructure (long int num, long int den, long int exp10=0L)
 
 MathStructure (string sym, bool force_symbol=false)
 
 MathStructure (const QalculateDateTime &o_dt)
 
 MathStructure (double float_value)
 
 MathStructure (const MathStructure *o,...)
 
 MathStructure (MathFunction *o,...)
 
 MathStructure (Unit *u, Prefix *p=NULL)
 
 MathStructure (Variable *o)
 
 MathStructure (const Number &o)
 
 ~MathStructure ()
 
Functions/operators for setting type and content
void set (const MathStructure &o, bool merge_precision=false)
 
void set_nocopy (MathStructure &o, bool merge_precision=false)
 
void set (int num, int den=1, int exp10=0, bool preserve_precision=false)
 
void set (long int num, long int den, long int exp10=0L, bool preserve_precision=false)
 
void set (string sym, bool preserve_precision=false, bool force_symbol=false)
 
void set (const QalculateDateTime &o_dt, bool preserve_precision=false)
 
void set (double float_value, bool preserve_precision=false)
 
void setVector (const MathStructure *o,...)
 
void set (MathFunction *o,...)
 
void set (Unit *u, Prefix *p=NULL, bool preserve_precision=false)
 
void set (Variable *o, bool preserve_precision=false)
 
void set (const Number &o, bool preserve_precision=false)
 
void setUndefined (bool preserve_precision=false)
 
void setAborted (bool preserve_precision=false)
 
void clear (bool preserve_precision=false)
 
void clearVector (bool preserve_precision=false)
 
void clearMatrix (bool preserve_precision=false)
 
void setType (StructureType mtype)
 
void operator= (const MathStructure &o)
 
void operator= (const Number &o)
 
void operator= (int i)
 
void operator= (Unit *u)
 
void operator= (Variable *v)
 
void operator= (string sym)
 
Functions to keep track of referrers
void ref ()
 
void unref ()
 
size_t refcount () const
 
Functions for numbers
const Numbernumber () const
 
Numbernumber ()
 
void numberUpdated ()
 
Functions for symbols
const string & symbol () const
 
Functions for date and time
const QalculateDateTimedatetime () const
 
QalculateDateTimedatetime ()
 
Functions for units
Unitunit () const
 
Unitunit_exp_unit () const
 
Prefixprefix () const
 
Prefixunit_exp_prefix () const
 
void setPrefix (Prefix *p)
 
bool isPlural () const
 
void setPlural (bool is_plural)
 
void setUnit (Unit *u)
 
Functions for mathematical functions
void setFunction (MathFunction *f)
 
MathFunctionfunction () const
 
const MathStructurefunctionValue () const
 
Functions for variables
void setVariable (Variable *v)
 
Variablevariable () const
 
Functions for nested structures (power, muliplication, addition, vector, etc)
void childUpdated (size_t index, bool recursive=false)
 
void childrenUpdated (bool recursive=false)
 
MathStructureoperator[] (size_t index)
 
const MathStructureoperator[] (size_t index) const
 
MathStructurelast ()
 
const MathStructure last () const
 
void setToChild (size_t index, bool merge_precision=false, MathStructure *mparent=NULL, size_t index_this=1)
 
void swapChildren (size_t index1, size_t index2)
 
void childToFront (size_t index)
 
void addChild (const MathStructure &o)
 
void addChild_nocopy (MathStructure *o)
 
void delChild (size_t index, bool check_size=false)
 
void insertChild (const MathStructure &o, size_t index)
 
void insertChild_nocopy (MathStructure *o, size_t index)
 
void setChild (const MathStructure &o, size_t index=1, bool merge_precision=false)
 
void setChild_nocopy (MathStructure *o, size_t index=1, bool merge_precision=false)
 
const MathStructuregetChild (size_t index) const
 
MathStructuregetChild (size_t index)
 
size_t countChildren () const
 
size_t countTotalChildren (bool count_function_as_one=true) const
 
size_t size () const
 
Functions for power
const MathStructurebase () const
 
const MathStructureexponent () const
 
MathStructurebase ()
 
MathStructureexponent ()
 
Functions for comparisons
ComparisonType comparisonType () const
 
void setComparisonType (ComparisonType comparison_type)
 
Functions checking type and value
StructureType type () const
 
bool isAddition () const
 
bool isMultiplication () const
 
bool isPower () const
 
bool isSymbolic () const
 
bool isDateTime () const
 
bool isAborted () const
 
bool isEmptySymbol () const
 
bool isVector () const
 
bool isMatrix () const
 
bool isFunction () const
 
bool isUnit () const
 
bool isUnit_exp () const
 
bool isUnknown () const
 
bool isUnknown_exp () const
 
bool isNumber_exp () const
 
bool isVariable () const
 
bool isComparison () const
 
bool isBitwiseAnd () const
 
bool isBitwiseOr () const
 
bool isBitwiseXor () const
 
bool isBitwiseNot () const
 
bool isLogicalAnd () const
 
bool isLogicalOr () const
 
bool isLogicalXor () const
 
bool isLogicalNot () const
 
bool isInverse () const
 
bool isDivision () const
 
bool isNegate () const
 
bool isInfinity () const
 
bool isUndefined () const
 
bool isInteger () const
 
bool isInfinite (bool ignore_imag=true) const
 
bool isNumber () const
 
bool isZero () const
 
bool isApproximatelyZero () const
 
bool isOne () const
 
bool isMinusOne () const
 
bool hasNegativeSign () const
 
bool representsBoolean () const
 
bool representsPositive (bool allow_units=false) const
 
bool representsNegative (bool allow_units=false) const
 
bool representsNonNegative (bool allow_units=false) const
 
bool representsNonPositive (bool allow_units=false) const
 
bool representsInteger (bool allow_units=false) const
 
bool representsNonInteger (bool allow_units=false) const
 
bool representsNumber (bool allow_units=false) const
 
bool representsRational (bool allow_units=false) const
 
bool representsFraction (bool allow_units=false) const
 
bool representsReal (bool allow_units=false) const
 
bool representsNonComplex (bool allow_units=false) const
 
bool representsComplex (bool allow_units=false) const
 
bool representsNonZero (bool allow_units=false) const
 
bool representsZero (bool allow_units=false) const
 
bool representsApproximatelyZero (bool allow_units=false) const
 
bool representsEven (bool allow_units=false) const
 
bool representsOdd (bool allow_units=false) const
 
bool representsUndefined (bool include_children=false, bool include_infinite=false, bool be_strict=false) const
 
bool representsNonMatrix () const
 
bool representsScalar () const
 
Functions for precision
void setApproximate (bool is_approx=true, bool recursive=false)
 
bool isApproximate () const
 
void setPrecision (int prec, bool recursive=false)
 
int precision () const
 
void mergePrecision (const MathStructure &o)
 
void mergePrecision (bool approx, int prec)
 
Operators for structural transformations and additions

These operators transforms or adds to the structure without doing any calculations

MathStructure operator- () const
 
MathStructure operator* (const MathStructure &o) const
 
MathStructure operator/ (const MathStructure &o) const
 
MathStructure operator+ (const MathStructure &o) const
 
MathStructure operator- (const MathStructure &o) const
 
MathStructure operator^ (const MathStructure &o) const
 
MathStructure operator&& (const MathStructure &o) const
 
MathStructure operator|| (const MathStructure &o) const
 
MathStructure operator! () const
 
void operator*= (const MathStructure &o)
 
void operator/= (const MathStructure &o)
 
void operator+= (const MathStructure &o)
 
void operator-= (const MathStructure &o)
 
void operator^= (const MathStructure &o)
 
void operator*= (const Number &o)
 
void operator/= (const Number &o)
 
void operator+= (const Number &o)
 
void operator-= (const Number &o)
 
void operator^= (const Number &o)
 
void operator*= (int i)
 
void operator/= (int i)
 
void operator+= (int i)
 
void operator-= (int i)
 
void operator^= (int i)
 
void operator*= (Unit *u)
 
void operator/= (Unit *u)
 
void operator+= (Unit *u)
 
void operator-= (Unit *u)
 
void operator^= (Unit *u)
 
void operator*= (Variable *v)
 
void operator/= (Variable *v)
 
void operator+= (Variable *v)
 
void operator-= (Variable *v)
 
void operator^= (Variable *v)
 
void operator*= (string sym)
 
void operator/= (string sym)
 
void operator+= (string sym)
 
void operator-= (string sym)
 
void operator^= (string sym)
 
Functions for structural transformations and additions

These functions transforms or adds to the structure without doing any calculations

void add (const MathStructure &o, MathOperation op, bool append=false)
 
void add (const MathStructure &o, bool append=false)
 
void subtract (const MathStructure &o, bool append=false)
 
void multiply (const MathStructure &o, bool append=false)
 
void divide (const MathStructure &o, bool append=false)
 
void raise (const MathStructure &o)
 
void add (const Number &o, bool append=false)
 
void subtract (const Number &o, bool append=false)
 
void multiply (const Number &o, bool append=false)
 
void divide (const Number &o, bool append=false)
 
void raise (const Number &o)
 
void add (int i, bool append=false)
 
void subtract (int i, bool append=false)
 
void multiply (int i, bool append=false)
 
void divide (int i, bool append=false)
 
void raise (int i)
 
void add (Variable *v, bool append=false)
 
void subtract (Variable *v, bool append=false)
 
void multiply (Variable *v, bool append=false)
 
void divide (Variable *v, bool append=false)
 
void raise (Variable *v)
 
void add (Unit *u, bool append=false)
 
void subtract (Unit *u, bool append=false)
 
void multiply (Unit *u, bool append=false)
 
void divide (Unit *u, bool append=false)
 
void raise (Unit *u)
 
void add (string sym, bool append=false)
 
void subtract (string sym, bool append=false)
 
void multiply (string sym, bool append=false)
 
void divide (string sym, bool append=false)
 
void raise (string sym)
 
void add_nocopy (MathStructure *o, MathOperation op, bool append=false)
 
void add_nocopy (MathStructure *o, bool append=false)
 
void subtract_nocopy (MathStructure *o, bool append=false)
 
void multiply_nocopy (MathStructure *o, bool append=false)
 
void divide_nocopy (MathStructure *o, bool append=false)
 
void raise_nocopy (MathStructure *o)
 
void inverse ()
 
void negate ()
 
void setLogicalNot ()
 
void setBitwiseNot ()
 
void transform (StructureType mtype, const MathStructure &o)
 
void transform (StructureType mtype, const Number &o)
 
void transform (StructureType mtype, int i)
 
void transform (StructureType mtype, Unit *u)
 
void transform (StructureType mtype, Variable *v)
 
void transform (StructureType mtype, string sym)
 
void transform_nocopy (StructureType mtype, MathStructure *o)
 
void transform (StructureType mtype)
 
void transform (MathFunction *o)
 
void transform (ComparisonType ctype, const MathStructure &o)
 
Functions/operators for comparisons
bool equals (const MathStructure &o, bool allow_interval=false, bool allow_infinity=false) const
 
bool equals (const Number &o, bool allow_interval=false, bool allow_infinity=false) const
 
bool equals (int i) const
 
bool equals (Unit *u) const
 
bool equals (Variable *v) const
 
bool equals (string sym) const
 
ComparisonResult compare (const MathStructure &o) const
 
ComparisonResult compareApproximately (const MathStructure &o, const EvaluationOptions &eo=default_evaluation_options) const
 
bool mergeInterval (const MathStructure &o, bool set_to_overlap=false)
 
bool operator== (const MathStructure &o) const
 
bool operator== (const Number &o) const
 
bool operator== (int i) const
 
bool operator== (Unit *u) const
 
bool operator== (Variable *v) const
 
bool operator== (string sym) const
 
bool operator!= (const MathStructure &o) const
 
Functions for calculation/evaluation
MathStructureeval (const EvaluationOptions &eo=default_evaluation_options)
 
bool calculateMergeIndex (size_t index, const EvaluationOptions &eo, const EvaluationOptions &feo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateLogicalOrLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateLogicalOrIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateLogicalOr (const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateLogicalXorLast (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateLogicalXor (const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateLogicalAndLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateLogicalAndIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateLogicalAnd (const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateLogicalNot (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseNot (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateInverse (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateNegate (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateRaiseExponent (const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateRaise (const MathStructure &mexp, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseOrLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseOrIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseOr (const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseXorLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseXorIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseXor (const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseAndLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseAndIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateBitwiseAnd (const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateMultiplyLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateMultiplyIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateMultiply (const MathStructure &mmul, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateDivide (const MathStructure &mdiv, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateAddLast (const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateAddIndex (size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateAdd (const MathStructure &madd, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateSubtract (const MathStructure &msub, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1)
 
bool calculateFunctions (const EvaluationOptions &eo, bool recursive=true, bool do_unformat=true)
 
int merge_addition (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
 
int merge_multiplication (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false, bool do_append=true)
 
int merge_power (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
 
int merge_logical_and (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
 
int merge_logical_or (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
 
int merge_logical_xor (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
 
int merge_bitwise_and (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
 
int merge_bitwise_or (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
 
int merge_bitwise_xor (MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false)
 
bool calculatesub (const EvaluationOptions &eo, const EvaluationOptions &feo, bool recursive=true, MathStructure *mparent=NULL, size_t index_this=1)
 
void evalSort (bool recursive=false, bool absolute=false)
 
bool integerFactorize ()
 
Functions for protection from changes when evaluating
void setProtected (bool do_protect=true)
 
bool isProtected () const
 
Functions for format and display
void sort (const PrintOptions &po=default_print_options, bool recursive=true)
 
bool improve_division_multipliers (const PrintOptions &po=default_print_options)
 
void setPrefixes (const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0)
 
void prefixCurrencies ()
 
void format (const PrintOptions &po=default_print_options)
 
void formatsub (const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0, bool recursive=true, MathStructure *top_parent=NULL)
 
void postFormatUnits (const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0)
 
bool factorizeUnits ()
 
void unformat (const EvaluationOptions &eo=default_evaluation_options)
 
bool needsParenthesis (const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool flat_division=true, bool flat_power=true) const
 
int neededMultiplicationSign (const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool par, bool par_prev, bool flat_division=true, bool flat_power=true) const
 
string print (const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const
 
Functions for vectors
MathStructureflattenVector (MathStructure &mstruct) const
 
bool rankVector (bool ascending=true)
 
bool sortVector (bool ascending=true)
 
MathStructuregetRange (int start, int end, MathStructure &mstruct) const
 
void resizeVector (size_t i, const MathStructure &mfill)
 
Functions for matrices
size_t rows () const
 
size_t columns () const
 
const MathStructuregetElement (size_t row, size_t column) const
 
MathStructuregetElement (size_t row, size_t column)
 
MathStructuregetArea (size_t r1, size_t c1, size_t r2, size_t c2, MathStructure &mstruct) const
 
MathStructurerowToVector (size_t r, MathStructure &mstruct) const
 
MathStructurecolumnToVector (size_t c, MathStructure &mstruct) const
 
MathStructurematrixToVector (MathStructure &mstruct) const
 
void setElement (const MathStructure &mstruct, size_t row, size_t column)
 
void addRows (size_t r, const MathStructure &mfill)
 
void addColumns (size_t c, const MathStructure &mfill)
 
void addRow (const MathStructure &mfill)
 
void addColumn (const MathStructure &mfill)
 
void resizeMatrix (size_t r, size_t c, const MathStructure &mfill)
 
bool matrixIsSquare () const
 
bool isNumericMatrix () const
 
int pivot (size_t ro, size_t co, bool symbolic=true)
 
int gaussianElimination (const EvaluationOptions &eo=default_evaluation_options, bool det=false)
 
MathStructuredeterminant (MathStructure &mstruct, const EvaluationOptions &eo) const
 
MathStructurepermanent (MathStructure &mstruct, const EvaluationOptions &eo) const
 
void setToIdentityMatrix (size_t n)
 
MathStructuregetIdentityMatrix (MathStructure &mstruct) const
 
bool invertMatrix (const EvaluationOptions &eo)
 
bool adjointMatrix (const EvaluationOptions &eo)
 
bool transposeMatrix ()
 
MathStructurecofactor (size_t r, size_t c, MathStructure &mstruct, const EvaluationOptions &eo) const
 
Functions for unit conversion
int isUnitCompatible (const MathStructure &mstruct) const
 
bool syncUnits (bool sync_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options)
 
bool testDissolveCompositeUnit (Unit *u)
 
bool testCompositeUnit (Unit *u)
 
bool dissolveAllCompositeUnits ()
 
bool setPrefixForUnit (Unit *u, Prefix *new_prefix)
 
bool convertToBaseUnits (bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options)
 
bool convert (Unit *u, bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options, Prefix *new_prefix=NULL)
 
bool convert (const MathStructure unit_mstruct, bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options)
 
Functions for recursive search and replace
int contains (const MathStructure &mstruct, bool structural_only=true, bool check_variables=false, bool check_functions=false, bool loose_equals=false) const
 
size_t countOccurrences (const MathStructure &mstruct) const
 
int containsRepresentativeOf (const MathStructure &mstruct, bool check_variables=false, bool check_functions=false) const
 
int containsType (StructureType mtype, bool structural_only=true, bool check_variables=false, bool check_functions=false) const
 
int containsRepresentativeOfType (StructureType mtype, bool check_variables=false, bool check_functions=false) const
 
int containsFunction (MathFunction *f, bool structural_only=true, bool check_variables=false, bool check_functions=false) const
 
int containsInterval (bool structural_only=true, bool check_variables=false, bool check_functions=false, bool ignore_high_precision_interval=false, bool include_interval_function=false) const
 
int containsInfinity (bool structural_only=true, bool check_variables=false, bool check_functions=false) const
 
bool containsOpaqueContents () const
 
bool containsAdditionPower () const
 
bool containsUnknowns () const
 
bool containsDivision () const
 
size_t countFunctions (bool count_subfunctions=true) const
 
void findAllUnknowns (MathStructure &unknowns_vector)
 
bool replace (const MathStructure &mfrom, const MathStructure &mto, bool once_only=false)
 
bool calculateReplace (const MathStructure &mfrom, const MathStructure &mto, const EvaluationOptions &eo)
 
bool replace (const MathStructure &mfrom1, const MathStructure &mto1, const MathStructure &mfrom2, const MathStructure &mto2)
 
bool removeType (StructureType mtype)
 
Functions to generate vectors for plotting
MathStructure generateVector (MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector=NULL, const EvaluationOptions &eo=default_evaluation_options) const
 
MathStructure generateVector (MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector=NULL, const EvaluationOptions &eo=default_evaluation_options) const
 
MathStructure generateVector (MathStructure x_mstruct, const MathStructure &x_vector, const EvaluationOptions &eo=default_evaluation_options) const
 
Differentiation and integration
bool differentiate (const MathStructure &x_var, const EvaluationOptions &eo)
 
int integrate (const MathStructure &x_var, const EvaluationOptions &eo, bool simplify_first=true, int use_abs=1, bool definite_integral=false, bool try_abs=true, int max_part_depth=5, vector< MathStructure *> *parent_parts=NULL)
 
Functions for polynomials
bool simplify (const EvaluationOptions &eo=default_evaluation_options, bool unfactorize=true)
 
bool factorize (const EvaluationOptions &eo=default_evaluation_options, bool unfactorize=true, int term_combination_levels=0, int max_msecs=1000, bool only_integers=true, int recursive=1, struct timeval *endtime_p=NULL, const MathStructure &force_factorization=m_undefined, bool complete_square=false, bool only_sqrfree=false, int max_degree_factor=-1)
 
bool expandPartialFractions (const EvaluationOptions &eo)
 
bool structure (StructuringMode structuring, const EvaluationOptions &eo, bool restore_first=true)
 
bool isRationalPolynomial (bool allow_non_rational_coefficient=false, bool allow_interval_coefficient=false) const
 
const NumberoverallCoefficient () const
 
const Numberdegree (const MathStructure &xvar) const
 
const Numberldegree (const MathStructure &xvar) const
 
void lcoefficient (const MathStructure &xvar, MathStructure &mcoeff) const
 
void tcoefficient (const MathStructure &xvar, MathStructure &mcoeff) const
 
void coefficient (const MathStructure &xvar, const Number &pownr, MathStructure &mcoeff) const
 
Number maxCoefficient ()
 
int polynomialUnit (const MathStructure &xvar) const
 
void polynomialContent (const MathStructure &xvar, MathStructure &mcontent, const EvaluationOptions &eo) const
 
void polynomialPrimpart (const MathStructure &xvar, MathStructure &mprim, const EvaluationOptions &eo) const
 
void polynomialPrimpart (const MathStructure &xvar, const MathStructure &c, MathStructure &mprim, const EvaluationOptions &eo) const
 
void polynomialUnitContentPrimpart (const MathStructure &xvar, int &munit, MathStructure &mcontent, MathStructure &mprim, const EvaluationOptions &eo) const
 
Functions for conversion of complex numbers
bool complexToExponentialForm (const EvaluationOptions &eo)
 
bool complexToPolarForm (const EvaluationOptions &eo)
 
Functions for equations
const MathStructurefind_x_var () const
 
bool isolate_x (const EvaluationOptions &eo, const MathStructure &x_var=m_undefined, bool check_result=false)
 
bool isolate_x (const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_var=m_undefined, bool check_result=false)
 

Static Public Member Functions

static bool polynomialDivide (const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args=true)
 
static bool polynomialQuotient (const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args=true)
 
static bool lcm (const MathStructure &m1, const MathStructure &m2, MathStructure &mlcm, const EvaluationOptions &eo, bool check_args=true)
 
static bool gcd (const MathStructure &m1, const MathStructure &m2, MathStructure &mresult, const EvaluationOptions &eo, MathStructure *ca=NULL, MathStructure *cb=NULL, bool check_args=true)
 

Protected Member Functions

bool isolate_x_sub (const EvaluationOptions &eo, EvaluationOptions &eo2, const MathStructure &x_var, MathStructure *morig=NULL)
 
void init ()
 

Protected Attributes

size_t i_ref
 
StructureType m_type
 
bool b_approx
 
int i_precision
 
vector< MathStructure * > v_subs
 
vector< size_t > v_order
 
string s_sym
 
Number o_number
 
Variableo_variable
 
Unito_unit
 
Prefixo_prefix
 
bool b_plural
 
MathFunctiono_function
 
MathStructurefunction_value
 
QalculateDateTimeo_datetime
 
ComparisonType ct_comp
 
bool b_protected
 
bool b_parentheses
 

Detailed Description

A structure representing a mathematical value/expression/result.

A MathStructure can both be container representing an operation with an ordered list of children or simple value representing a number, , variable etc. The children of a container might be of any type, allowing a tree-like nested structure.

These are the most common conatiner/operation types:

  • Addition: contains two or more children, representing terms (x+y+...)
  • Multiplication: contains two or more children, representing factors (x*y*...)
  • Power: contains exactly two children, representing base and exponent (x^y)
  • Function: contains a two or more children, representing arguments, and a reference to a MathFunction object ( f(x,y,...) )
  • Comparison: an equality or inequality containing exactly two children, represening the expressions right and left of the sign, specified with a ComparisonType (x=y, x!=y, x>y, ...)
  • Vector: contains zero or more children, representing elements in a vector ( [x, y, z, ...] )

Also available are containers representing logical and bitwise operations. Subtraction is represented by an addition structure with negated children and division by a multiplication structure with inverted children. Matrices is represented by a vector with vectors as children.

For formatted structures, the following types is also available:

  • Negation: contains exactly one child (-x)
  • Invertion: contains exactly one child (1/x)
  • Division: contains exactly two children representing numerator and denominator (x/y)

The following value types are available:

  • Number: has a Number object, representing a rational, floating point, complex or infinite numeric value
  • Variable: has a reference to a Variable object, with a known or unknown value
  • Symbolic: has an associated text string, with assumptions about the represented value controlled by the default assumptions
  • Unit: has a reference to a Unit object, and might in a formatted structure also have a reference to a Prefix object
  • Undefined: represents an undefined value

To create a MathStructure, you can either create a simple structure using the constructors and then expanding it with structural operations, or use the parse or calculation functions of the global Calculator object to convert an expression string.

The expression "(5x + 2) * 3" can be turned into a MathStructure either using

MathStructure mstruct = CALCULATOR->parse("(5x + 2) * 3");

or

MathStructure mstruct(5);
mstruct *= CALCULATOR->v_x;
mstruct += 2;
mstruct *= 3:

The first variant is obviously simpler, but slower and allows less control.

Then, to evaluate/calculate/simplify (whatever) a structure, eval() should normally be used. The EvaluationOptions passed to eval() allows much control over the process and the outcome.

mstruct.eval(eo);

After that, to display the result, you should first format the structure using format() and then display it using print(), passing the PrintOptions to both.

mstruct.format(po);
std::cout << mstruct.print(po) << std::endl;

Most low-level functions expect the structure to be unformatted och require that unformat() is called after an expression string has been parsed or format() has been called.

To access a child structure either the [] operator or the safer getChild() can be used. Note however that the index passed to the operator start at zero and the index argument for getChild() starts at one.

MathStructure mstruct(5);
mstruct += 2;
std::cout << mstruct.print() << std::endl; // output: "5 + 2"
std::cout << mstruct.getChild(1)->print() << std::endl; // output: "5"
std::cout << mstruct[1].print() << std::endl; // output: "2"

MathStructure uses reference count for management of objects allocated with new. Call ref() when starting to use the object and unref() when done. Note that the reference count is initialized to 1 in the constructors, so ref() should not be called after the object creation. This system is used for all child objects, so the following is perfectly legal:

MathStructure *mchild_p = mstruct->getChild(1);
mchild_p->ref(); // mchild_p reference count = 2
mstruct->unref(); //mstruct reference count = 0, mstruct deleted, mchild_p reference count = 1
(...)
mchild_p->unref(); // mchild_p reference count = 0, mchild_p deleted

Constructor & Destructor Documentation

◆ MathStructure() [1/11]

MathStructure::MathStructure ( )

Create a new structure, initialized to zero.

◆ MathStructure() [2/11]

MathStructure::MathStructure ( const MathStructure o)

Create a copy of a structure. Child structures are copied.

Parameters
oThe structure to copy.

◆ MathStructure() [3/11]

MathStructure::MathStructure ( int  num,
int  den = 1,
int  exp10 = 0 
)

Create a new numeric structure (value=num/den*10^exp10). Equivalent to MathStructure(Number(num, den, exp10)).

Parameters
numThe numerator of the numeric value.
denThe denominator of the numeric value.
exp10The base 10 exponent of the numeric value.

◆ MathStructure() [4/11]

MathStructure::MathStructure ( string  sym,
bool  force_symbol = false 
)

Create a new symbolic/text structure.

Parameters
symSymbolic/text value.
force_symbolDo not check for undefined or date value.

◆ MathStructure() [5/11]

MathStructure::MathStructure ( const QalculateDateTime o_dt)

Create a new date and time structure.

Parameters
symDate and time value.

◆ MathStructure() [6/11]

MathStructure::MathStructure ( double  float_value)

Create a new numeric structure with floating point value. Uses Number::setFloat().

Parameters
oNumeric value.

◆ MathStructure() [7/11]

MathStructure::MathStructure ( const MathStructure o,
  ... 
)

Create a new vector.

Parameters
oThe first element (copied) in the vector.
...Elements (copied) in the vector. End with NULL.

◆ MathStructure() [8/11]

MathStructure::MathStructure ( MathFunction o,
  ... 
)

Create a new function structure.

Parameters
oFunction value.
...Arguments (copied) to the function. End with NULL.

◆ MathStructure() [9/11]

MathStructure::MathStructure ( Unit u,
Prefix p = NULL 
)

Create a new unit structure.

Parameters
uThe unit value.
pPrefix of the unit.

◆ MathStructure() [10/11]

MathStructure::MathStructure ( Variable o)

Create a new variable structure.

Parameters
oVariable value.

◆ MathStructure() [11/11]

MathStructure::MathStructure ( const Number o)

Create a new numeric structure.

Parameters
oNumeric value.

Member Function Documentation

◆ childrenUpdated()

void MathStructure::childrenUpdated ( bool  recursive = false)

Call this function when you have updated children. Updates the precision.

If true, do the same for each child of the children.

◆ childUpdated()

void MathStructure::childUpdated ( size_t  index,
bool  recursive = false 
)

Call this function when you have updated a child. Updates the precision.

Parameters
indexIndex (starting at 1) of the updated child. If true, do the same for each child of the child.

◆ clear()

void MathStructure::clear ( bool  preserve_precision = false)

Reset the value (to zero) and parameters of the structure.

Parameters
preserve_precisionPreserve the current precision.

◆ clearMatrix()

void MathStructure::clearMatrix ( bool  preserve_precision = false)

Set the structure to an empty matrix.

Parameters
preserve_precisionPreserve the current precision.

◆ clearVector()

void MathStructure::clearVector ( bool  preserve_precision = false)

Set the structure to an empty vector.

Parameters
preserve_precisionPreserve the current precision.

◆ isRationalPolynomial()

bool MathStructure::isRationalPolynomial ( bool  allow_non_rational_coefficient = false,
bool  allow_interval_coefficient = false 
) const

If the structure represents a rational polynomial. This is true for

  • rational numbers;
  • functions, units, variables and symbols that do not represent a matrix or undefined;
  • a power with a positive integer exponent and any of the previous as base;
  • a multiplication with the previous as factors; or
  • an addition with the previous as terms.
Returns
true if structure represents a rational polynomial.

◆ operator[]() [1/2]

MathStructure& MathStructure::operator[] ( size_t  index)

Returns a child. Does not check if a child exists at the index.

Parameters
indexIndex (starting at zero).

◆ operator[]() [2/2]

const MathStructure& MathStructure::operator[] ( size_t  index) const

Returns a child. Does not check if a child exists at the index.

Parameters
indexIndex (starting at zero).

◆ set() [1/9]

void MathStructure::set ( const MathStructure o,
bool  merge_precision = false 
)

Set the structure to a copy of another structure. Child structures are copied.

Parameters
oThe structure to copy.
merge_precisionPreserve the current precision (unless the new value has a lower precision).

◆ set() [2/9]

void MathStructure::set ( int  num,
int  den = 1,
int  exp10 = 0,
bool  preserve_precision = false 
)

Set the structure to a number (num/den*10^exp10). Equivalent to set(Number(num, den, exp10), precerve_precision).

Parameters
numThe numerator of the new numeric value.
denThe denominator of the new numeric value.
exp10The base 10 exponent of the new numeric value.
preserve_precisionPreserve the current precision (unless the new value has a lower precision).

◆ set() [3/9]

void MathStructure::set ( string  sym,
bool  preserve_precision = false,
bool  force_symbol = false 
)

Set the structure to a symbolic/text value.

Parameters
oThe new symolic/text value.
preserve_precisionPreserve the current precision.
force_symbolDo not check for undefined or date value.

◆ set() [4/9]

void MathStructure::set ( const QalculateDateTime o_dt,
bool  preserve_precision = false 
)

Set the structure to a date and time value.

Parameters
oThe new data and time value.
preserve_precisionPreserve the current precision.

◆ set() [5/9]

void MathStructure::set ( double  float_value,
bool  preserve_precision = false 
)

Set the structure to a number with a floating point value. Uses Number::setFloat().

Parameters
oThe new numeric value.
preserve_precisionPreserve the current precision (unless the new value has a lower precision).

◆ set() [6/9]

void MathStructure::set ( MathFunction o,
  ... 
)

Set the structure to a mathematical function.

Parameters
oThe new function value.
...Arguments (copied) to the function. End with NULL.

◆ set() [7/9]

void MathStructure::set ( Unit u,
Prefix p = NULL,
bool  preserve_precision = false 
)

Set the structure to a unit.

Parameters
uThe new unit value.
pPrefix of the unit.
preserve_precisionPreserve the current precision (unless the new value has a lower precision).

◆ set() [8/9]

void MathStructure::set ( Variable o,
bool  preserve_precision = false 
)

Set the structure to a variable.

Parameters
oThe new variable value.
preserve_precisionPreserve the current precision.

◆ set() [9/9]

void MathStructure::set ( const Number o,
bool  preserve_precision = false 
)

Set the structure to a number.

Parameters
oThe new numeric value.
preserve_precisionPreserve the current precision (unless the new value has a lower precision).

◆ set_nocopy()

void MathStructure::set_nocopy ( MathStructure o,
bool  merge_precision = false 
)

Set the structure to a copy of another structure. Pointers to child structures are copied.

Parameters
oThe structure to copy.
merge_precisionPreserve the current precision (unless the new value has a lower precision).

◆ setAborted()

void MathStructure::setAborted ( bool  preserve_precision = false)

Mark that calculation was aborted.

Parameters
preserve_precisionPreserve the current precision.

◆ setType()

void MathStructure::setType ( StructureType  mtype)

Explicitely sets the type of the structure. setType() is dangerous and might crash the program if used unwisely.

Parameters
mtypeThe new structure type

◆ setUndefined()

void MathStructure::setUndefined ( bool  preserve_precision = false)

Set the value of the structure to undefined.

Parameters
preserve_precisionPreserve the current precision.

◆ setVector()

void MathStructure::setVector ( const MathStructure o,
  ... 
)

Set the structure to a vector.

Parameters
oThe first element (copied) in the new vector.
...Elements (copied) in the new vector. End with NULL.

The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/functions_func_g.html0000644000175000017500000001330613401033110021144 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- g -

libqalculate-2.8.2/docs/reference/html/classArgumentSet.html0000644000175000017500000007755213401033110021114 00000000000000 libqalculate-2.8.2: ArgumentSet Class Reference
libqalculate-2.8.2

A set of accepted arguments. More...

#include <Function.h>

Inheritance diagram for ArgumentSet:
Argument

Public Member Functions

 ArgumentSet (string name_="", bool does_test=true, bool does_error=true)
 
 ArgumentSet (const ArgumentSet *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
void addArgument (Argument *arg)
 
void delArgument (size_t index)
 
size_t countArguments () const
 
ArgumentgetArgument (size_t index) const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Protected Attributes

vector< Argument * > subargs
 
- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A set of accepted arguments.

This is used when several different type of argments shall be accepted by a function.

Member Function Documentation

◆ copy()

virtual Argument* ArgumentSet::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string ArgumentSet::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string ArgumentSet::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool ArgumentSet::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int ArgumentSet::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classAliasUnit__Composite-members.html0000644000175000017500000013017213401033110024344 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
AliasUnit_Composite Member List

This is the complete list of members for AliasUnit_Composite, including all inherited members.

abbreviation(bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
AliasUnit(string cat_, string name_, string plural_, string singular_, string title_, Unit *alias, string relation="1", int exp=1, string inverse="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in AliasUnit)AliasUnit
AliasUnit(const AliasUnit *unit) (defined in AliasUnit)AliasUnit
AliasUnit() (defined in AliasUnit)AliasUnit
AliasUnit_Composite(Unit *alias, int exp=1, Prefix *prefix_=NULL) (defined in AliasUnit_Composite)AliasUnit_Composite
AliasUnit_Composite(const AliasUnit_Composite *unit) (defined in AliasUnit_Composite)AliasUnit_Composite
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
b_si (defined in Unit)Unitprotected
b_use_with_prefixes (defined in Unit)Unitprotected
baseExponent(int exp=1) const (defined in AliasUnit)AliasUnitvirtual
baseUnit() const (defined in AliasUnit)AliasUnitvirtual
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
convert(Unit *u, MathStructure &mvalue, MathStructure &exp) constUnit
convert(Unit *u, MathStructure &mvalue) constUnit
convert(Unit *u, bool *converted=NULL) const (defined in Unit)Unit
convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
convertFromBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnitvirtual
convertFromBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
copy() const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
countries() const (defined in Unit)Unit
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
expression() const (defined in AliasUnit)AliasUnitvirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
firstBaseExponent() const (defined in AliasUnit)AliasUnitvirtual
firstBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasComplexExpression() const (defined in AliasUnit)AliasUnitvirtual
hasComplexRelationTo(Unit *u) const (defined in AliasUnit)AliasUnitvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_exp (defined in AliasUnit)AliasUnitprotected
i_mix (defined in AliasUnit)AliasUnitprotected
i_mix_min (defined in AliasUnit)AliasUnitprotected
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
inverseExpression() const (defined in AliasUnit)AliasUnitvirtual
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isChildOf(Unit *u) constAliasUnitvirtual
isCurrency() constUnit
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isParentOf(Unit *u) constAliasUnitvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() constUnit
isUsedByOtherUnits() const (defined in Unit)Unitvirtual
mixWithBase() const (defined in AliasUnit)AliasUnitvirtual
mixWithBaseMinimum() const (defined in AliasUnit)AliasUnitvirtual
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
o_unit (defined in AliasUnit)AliasUnitprotected
plural(bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
prefix() const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
prefixExponent() const (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
prefixv (defined in AliasUnit_Composite)AliasUnit_Compositeprotected
print(bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constAliasUnit_Compositevirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
scountries (defined in Unit)Unitprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
set(Unit *u, int exp=1, Prefix *prefix_=NULL) (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAsSIUnit()Unit
setBaseUnit(Unit *alias) (defined in AliasUnit)AliasUnitvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setCountries(string country_names) (defined in Unit)Unit
setDescription(string descr_)ExpressionItemvirtual
setExponent(int exp) (defined in AliasUnit)AliasUnitvirtual
setExpression(string relation)AliasUnitvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setInverseExpression(string inverse)AliasUnitvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setMixWithBase(int combine_priority=1) (defined in AliasUnit)AliasUnitvirtual
setMixWithBaseMinimum(int combine_minimum) (defined in AliasUnit)AliasUnitvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItemvirtual
setUncertainty(string standard_uncertainty) (defined in AliasUnit)AliasUnitvirtual
setUseWithPrefixesByDefault(bool use_with_prefixes)Unit
singular(bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
sinverse (defined in AliasUnit)AliasUnitprotected
ssystem (defined in Unit)Unitprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constAliasUnitvirtual
suncertainty (defined in AliasUnit)AliasUnitprotected
svalue (defined in AliasUnit)AliasUnitprotected
system() constUnit
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constUnitvirtual
uncertainty() const (defined in AliasUnit)AliasUnitvirtual
Unit(string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Unit)Unit
Unit() (defined in Unit)Unit
Unit(const Unit *unit) (defined in Unit)Unit
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
useWithPrefixesByDefault() constUnit
v_refs (defined in ExpressionItem)ExpressionItemprotected
~AliasUnit() (defined in AliasUnit)AliasUnitvirtual
~AliasUnit_Composite() (defined in AliasUnit_Composite)AliasUnit_Compositevirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~Unit() (defined in Unit)Unitvirtual
libqalculate-2.8.2/docs/reference/html/functions_y.html0000644000175000017500000000516613401033110020160 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- y -

libqalculate-2.8.2/docs/reference/html/functions_x.html0000644000175000017500000000516613401033110020157 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- x -

libqalculate-2.8.2/docs/reference/html/functions_g.html0000644000175000017500000001365313401033110020136 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- g -

libqalculate-2.8.2/docs/reference/html/classCompositeUnit.png0000644000175000017500000000115513401033110021262 00000000000000‰PNG  IHDR`ˆ/QåPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2üIDATxíir«0[Ÿª¸ÿ‘c±x¨÷âqÔ ePkÍorÎÙ²$ùI2yN†Ÿ$`÷ª8øvHÒmÎ †Wêÿj®Ÿ\™c}Œ¹úª‘壣”¶!zìnì1I«Ô®ëút´ó—”곩ÝÚ%ÛîÁVКkó® DÚ‚ÅX*mÌz´JšÓ2ÀØä­$I«tq‰Êü6§¨ž—£S´8Í®’šô»[qâ_Åÿ/¤ÏI2yBsÎŽ\¢ðÄ[ÐuÎoÁ«_ƒ»àœ¢Ø„À$&!0 €ILB`ò…‚œsö„,I~„@’LþAª©8$雂uA’ö¹*HJ}¶3\”Åñ[¢2üHÒ wAjÆÎ'ÁgO‘$Ý"’dI2yBsÎŽ\¢ðÄ[ÐuÎoÁ«_ƒ»àœ¢Ø„À$&!0 €ILB`ò…‚”Rò„àGLž ›ðžWÜ:äŶp`a}¸+h*‡‰ Mc¦t1½Æº¾y,LãnÛŽã7ý)’"šª!5©.È"ОÁNOëÞ‹†»‚iÊËB}V©Ií&¿ìÇ]Úƒ7‚zêÙ˜ÒÞ)*ÞÚR°¶¿É¿ºëß!¸MLž¤”’#?Ì(M0µ2IEND®B`‚libqalculate-2.8.2/docs/reference/html/ExpressionItem_8h.html0000644000175000017500000000655313401033110021176 00000000000000 libqalculate-2.8.2: libqalculate/ExpressionItem.h File Reference
libqalculate-2.8.2
ExpressionItem.h File Reference

Classes

struct  ExpressionName
 A name for an expression item (function, variable or unit) More...
 
class  ExpressionItem
 Abstract base class for functions, variables and units. More...
 
libqalculate-2.8.2/docs/reference/html/classNowVariable.png0000644000175000017500000000216013401033110020666 00000000000000‰PNG  IHDRmøј”PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2ÿIDATxíirã: ›«tÿ#?kã¦eAR~ˆÕæ²I žùKÎ9»A–$'Â&Iüª--’ô€CÜ«ã~îh“¤·yÓ¶iþ”Ú|ìõôå{a«•¢D®“$5ÏÅÙÖÀeê¶ö¶|’†§ ûæGR}®Þ[Ý|Ï:»|7½ÛÉÍ^½·£­ÝF>µ­‘_°u»,´1ã9”TŸ>ài–IžïÜäz ‡œ,Ùw•“]b5÷|k“Ô<ßûõIÒÀÿÖ&I¦„M’,p·åœ³o0¸áj›&O«í%sÔùÚ>:'Ã`BØ,€a° l„ À‚°X6€žœsvƒ,IN„M’,øc¶Ô|Mm—¤3Þ³¼V¶e¡e±”ÖbùìÍW}ØÆ%éŠç¶ºèRnÍÚ*»’¤ ¾p¶ÁºÙJacÛ.n¹©þŒÛ¹vÛ6.IW<· 7z(ž$Ê“ß[MË›ñ{«oéµr³êÚ´ÎII²"l’dAØ$Éw[Î9{ð€®¶iòÔ¹Ú^2G¯í£s2l&„ À‚°X6 Â`AØ,€aèÉ9g7È’äDØ$ɂߴ¥ò%IW¬CXmnµ³e޶ÊÎmï#Ûv¼´–s±oáÕ¹w—kØÛógonQµãÚ¶í{•ìŽRëÜ mxÓ:\Õ`Ûö²Ï+E?»]eh³nmM¢ÜØš;¨—VšÍ¬müY2Ú¶3Ú®ÂÛÝIªÏù/ Ÿ§$u´ß'¶Çï­É•&§®lËx»«¥ù8'%é' ›$Y6I²ÀÝ–sÎ^¼Áà†«mš libqalculate-2.8.2: MatrixArgument Class Reference
libqalculate-2.8.2

A matrix argument. More...

#include <Function.h>

Inheritance diagram for MatrixArgument:
Argument

Public Member Functions

 MatrixArgument (string name_="", bool does_test=true, bool does_error=true)
 
 MatrixArgument (const MatrixArgument *arg)
 
virtual bool squareDemanded () const
 
virtual void setSquareDemanded (bool square)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Protected Attributes

bool b_square
 
- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A matrix argument.

Member Function Documentation

◆ copy()

virtual Argument* MatrixArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string MatrixArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string MatrixArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool MatrixArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int MatrixArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classTomorrowVariable.png0000644000175000017500000000222113401033110021751 00000000000000‰PNG  IHDRtø 62¶PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2 IDATxíë’« ›*ßÿ‘O¢ˆ€$19ت̆VÁæ2Öþ%ÆGC”¤±¸T’Ìø+Ò°þIÒNq·†—}{RIú˜ÿ“®·pÿå§û&l{‘¯+é)ßräÖI’*ž¬t‹_GHŠd RSŠÀ¶í^$UåÙ™K©ÙÉ×¢õ$ío÷³3=KËÙä×]éù¾´šs¦ŒiW¥ £Ô’Žò:‘Îâ 5å Û»íÍ){sž>ÊÞ*÷ŠÍ¿"•T”ÿûj%éŒK%É —J’³¤1Æ8€YF3Cº,¬3¤7çxëée¯Kìp)€.0Ã¥f¸À —˜áR3\ ð‚c Q’ÆâRI2ãïJCqm‹§æ½$=àséIÿeé:Þ:fÛmýíÕÛóÞKÒÞ“c¯÷T=jyr’ô˜7WÚÈ“4ß¾*M»¹n_½â´Ê]šÞKÒÞ“6Û|º]Ì¥«ßé‘À©Í™'xƒoU£ì•¤/âRI2Ã¥’dÆ,iŒ1àC€ÑÌ.Ëë éÍ9Þ:EúCÙëR;\ `†KÌp)€.0Ã¥f¸À —¼ ÆGC”¤±¸T’Ìø#Ò/’ôˆ-  ;ªééÁ0}éKg_zÒ¿#M‹ Ûý~ÛgrkÜ›ó¦ìõûo¯¦¨£AÒQzÒ´ŠÍµ«òS5…‚2¼¨õ6®#M3Û»ç[=H9XSo{]‘¹ôDZìȱ“¹ZôJï¯%R+M‡ÖJ…—“”T•ÇŸLÝ]Aª(¯é»gZ¤S‘}¤ëûrrkõÝì•$c\*If¸T’̘%1ÆÁ|È0šÒe™`!½9Ç[§H({] `‡KÌp)€.0Ã¥f¸À —˜áR€Äãhˆ’4—J’Ó¥áþ'IÏ9B¶§¦Kûº}ßJû!’Ô§+=é/Hï×ûÃzÛ¾­ÿVËoRS®õ5êèÑÄ_‘nGí^Ê&©¦íÑÄ_Zi¹EA*KîÑ>W=Þ“Öó¯æ\HÓnî!ç{|¢]é~2 ÷¥Í6÷:¾ÎÞ+Ò2uH/é± õüתG¨÷S ÙÛýÂ%éÛô¥¶Î¾ÔØéÿÚ$ÉŽŸ’Æã`>dÍ é²L°ÎÞœã­S¤?”½.°Ã¥f¸À —˜áR3\ `†KÌp)À Ba4€±¸ÀŒ©Ò=­Þ"uŠrTÓSý¾XégKîJOúÒm¹kóÚ–Ÿî—{ó²?–‘kÛ>PŽÍÙJ÷‘Öàrôý’§ÔJËÈ£ù¨åÉ=–¶¡åKG)kë…ûËÒ*«ç°˾¿ŸK÷³;n½£®WúâL_I›]BÍ;gš“.Çí9yJÒö{Hÿ=Êd]O³` .0Ã¥fÌ’†Â`þnr^xÚøjIEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_func_d.html0000644000175000017500000000535013401033110021141 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- d -

libqalculate-2.8.2/docs/reference/html/open.png0000644000175000017500000000017313401033110016372 00000000000000‰PNG  IHDR à‘BIDATxíÝÁ €0 Ð׬ՙ\Àº€39—b!©9{|ðI>$#Àß´ý8/¨ÄØzƒ/Ï>2À[ÎgiU,/¬~¼Ï\ Ä9Ù¸IEND®B`‚libqalculate-2.8.2/docs/reference/html/classAliasUnit-members.html0000644000175000017500000012313213401033110022161 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
AliasUnit Member List

This is the complete list of members for AliasUnit, including all inherited members.

abbreviation(bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
AliasUnit(string cat_, string name_, string plural_, string singular_, string title_, Unit *alias, string relation="1", int exp=1, string inverse="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in AliasUnit)AliasUnit
AliasUnit(const AliasUnit *unit) (defined in AliasUnit)AliasUnit
AliasUnit() (defined in AliasUnit)AliasUnit
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
b_si (defined in Unit)Unitprotected
b_use_with_prefixes (defined in Unit)Unitprotected
baseExponent(int exp=1) const (defined in AliasUnit)AliasUnitvirtual
baseUnit() const (defined in AliasUnit)AliasUnitvirtual
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
convert(Unit *u, MathStructure &mvalue, MathStructure &exp) constUnit
convert(Unit *u, MathStructure &mvalue) constUnit
convert(Unit *u, bool *converted=NULL) const (defined in Unit)Unit
convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
convertFromBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnitvirtual
convertFromBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
convertFromFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit(MathStructure &mvalue) const (defined in AliasUnit)AliasUnitvirtual
convertToBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
convertToFirstBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in AliasUnit)AliasUnitvirtual
copy() const (defined in AliasUnit)AliasUnitvirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
countries() const (defined in Unit)Unit
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
expression() const (defined in AliasUnit)AliasUnitvirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
firstBaseExponent() const (defined in AliasUnit)AliasUnitvirtual
firstBaseUnit() const (defined in AliasUnit)AliasUnitvirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasComplexExpression() const (defined in AliasUnit)AliasUnitvirtual
hasComplexRelationTo(Unit *u) const (defined in AliasUnit)AliasUnitvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_exp (defined in AliasUnit)AliasUnitprotected
i_mix (defined in AliasUnit)AliasUnitprotected
i_mix_min (defined in AliasUnit)AliasUnitprotected
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
inverseExpression() const (defined in AliasUnit)AliasUnitvirtual
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isChildOf(Unit *u) constAliasUnitvirtual
isCurrency() constUnit
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isParentOf(Unit *u) constAliasUnitvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() constUnit
isUsedByOtherUnits() const (defined in Unit)Unitvirtual
mixWithBase() const (defined in AliasUnit)AliasUnitvirtual
mixWithBaseMinimum() const (defined in AliasUnit)AliasUnitvirtual
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
o_unit (defined in AliasUnit)AliasUnitprotected
plural(bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
print(bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constUnitvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
scountries (defined in Unit)Unitprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in AliasUnit)AliasUnitvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAsSIUnit()Unit
setBaseUnit(Unit *alias) (defined in AliasUnit)AliasUnitvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setCountries(string country_names) (defined in Unit)Unit
setDescription(string descr_)ExpressionItemvirtual
setExponent(int exp) (defined in AliasUnit)AliasUnitvirtual
setExpression(string relation)AliasUnitvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setInverseExpression(string inverse)AliasUnitvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setMixWithBase(int combine_priority=1) (defined in AliasUnit)AliasUnitvirtual
setMixWithBaseMinimum(int combine_minimum) (defined in AliasUnit)AliasUnitvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItemvirtual
setUncertainty(string standard_uncertainty) (defined in AliasUnit)AliasUnitvirtual
setUseWithPrefixesByDefault(bool use_with_prefixes)Unit
singular(bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
sinverse (defined in AliasUnit)AliasUnitprotected
ssystem (defined in Unit)Unitprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constAliasUnitvirtual
suncertainty (defined in AliasUnit)AliasUnitprotected
svalue (defined in AliasUnit)AliasUnitprotected
system() constUnit
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constUnitvirtual
uncertainty() const (defined in AliasUnit)AliasUnitvirtual
Unit(string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Unit)Unit
Unit() (defined in Unit)Unit
Unit(const Unit *unit) (defined in Unit)Unit
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
useWithPrefixesByDefault() constUnit
v_refs (defined in ExpressionItem)ExpressionItemprotected
~AliasUnit() (defined in AliasUnit)AliasUnitvirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~Unit() (defined in Unit)Unitvirtual
libqalculate-2.8.2/docs/reference/html/classDataSet-members.html0000644000175000017500000014560313401033110021624 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
DataSet Member List

This is the complete list of members for DataSet, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addObject(DataObject *o) (defined in DataSet)DataSet
addProperty(DataProperty *dp) (defined in DataSet)DataSet
appendDefaultValues(MathStructure &vargs) (defined in MathFunction)MathFunction
argc (defined in MathFunction)MathFunctionprotected
args() constMathFunction
args(const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)MathFunction
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_loaded (defined in DataSet)DataSetprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)DataSetvirtual
calculate(const string &eq, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
calculate(MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearArgumentDefinitions()MathFunction
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
condition() constMathFunction
copy() const (defined in DataSet)DataSetvirtual
copyright() const (defined in DataSet)DataSet
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
createFunctionMathStructureFromSVArgs(vector< string > &svargs) (defined in MathFunction)MathFunctionprotectedvirtual
createFunctionMathStructureFromVArgs(const MathStructure &vargs) (defined in MathFunction)MathFunctionprotectedvirtual
DataSet(string s_category="", string s_name="", string s_default_file="", string s_title="", string s_description="", bool is_local=true) (defined in DataSet)DataSet
DataSet(const DataSet *o) (defined in DataSet)DataSet
default_values (defined in MathFunction)MathFunctionprotected
defaultDataFile() const (defined in DataSet)DataSet
defaultProperty() const (defined in DataSet)DataSet
delObject(DataObject *o) (defined in DataSet)DataSet
delObject(DataObjectIter *it) (defined in DataSet)DataSet
delProperty(DataProperty *dp) (defined in DataSet)DataSet
delProperty(DataPropertyIter *it) (defined in DataSet)DataSet
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
example(bool raw_format=false, string name_string="") const (defined in MathFunction)MathFunction
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
getArgumentDefinition(size_t index)MathFunction
getDefaultValue(size_t arg_) const (defined in MathFunction)MathFunction
getFirstObject(DataObjectIter *it) (defined in DataSet)DataSet
getFirstProperty(DataPropertyIter *it) (defined in DataSet)DataSet
getFirstPropertyName(DataPropertyIter *it) (defined in DataSet)DataSet
getName(size_t index) constExpressionItemvirtual
getNextObject(DataObjectIter *it) (defined in DataSet)DataSet
getNextProperty(DataPropertyIter *it) (defined in DataSet)DataSet
getNextPropertyName(DataPropertyIter *it) (defined in DataSet)DataSet
getObject(string object) (defined in DataSet)DataSet
getObject(const MathStructure &object) (defined in DataSet)DataSet
getObjectProperty(string property, string object) (defined in DataSet)DataSet
getObjectPropertyDisplayString(string property, string object) (defined in DataSet)DataSet
getObjectPropertyInputString(string property, string object) (defined in DataSet)DataSet
getObjectProperyStruct(string property, string object) (defined in DataSet)DataSet
getPrimaryKeyProperty() (defined in DataSet)DataSet
getProperty(string property) (defined in DataSet)DataSet
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
last_argdef_index (defined in MathFunction)MathFunctionprotected
lastArgumentDefinitionIndex() constMathFunction
loadObjects(const char *file_name=NULL, bool is_user_defs=true) (defined in DataSet)DataSet
MathFunction(string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true) (defined in MathFunction)MathFunction
MathFunction(const MathFunction *function) (defined in MathFunction)MathFunction
MathFunction() (defined in MathFunction)MathFunction
max_argc (defined in MathFunction)MathFunctionprotected
maxargs() constMathFunction
minargs() constMathFunction
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
objects (defined in DataSet)DataSetprotected
objectsLoaded() const (defined in DataSet)DataSet
parse(const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
parse(MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
printCondition()MathFunction
printProperties(string object) (defined in DataSet)DataSet
printProperties(DataObject *o) (defined in DataSet)DataSet
priv (defined in MathFunction)MathFunctionprotected
produceArgumentsVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
produceVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
properties (defined in DataSet)DataSetprotected
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsEven(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsInteger(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonMatrix(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsNonNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonZero(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNumber(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsOdd(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsRational(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsReal(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsScalar(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsUndefined(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
saveObjects(const char *file_name=NULL, bool save_global=false) (defined in DataSet)DataSet
scat (defined in ExpressionItem)ExpressionItemprotected
scondition (defined in MathFunction)MathFunctionprotected
scopyright (defined in DataSet)DataSetprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in DataSet)DataSetvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setArgumentDefinition(size_t index, Argument *argdef)MathFunction
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setCondition(string expression)MathFunction
setCopyright(string s_copyright) (defined in DataSet)DataSet
setDefaultDataFile(string s_file) (defined in DataSet)DataSet
setDefaultProperty(string property) (defined in DataSet)DataSet
setDefaultValue(size_t arg_, string value_) (defined in MathFunction)MathFunction
setDescription(string descr_)ExpressionItemvirtual
setExample(string new_example) (defined in MathFunction)MathFunction
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setObjectsLoaded(bool objects_loaded) (defined in DataSet)DataSet
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
sexample (defined in MathFunction)MathFunctionprotected
sfile (defined in DataSet)DataSetprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
stringArgs(const string &str, vector< string > &svargs) (defined in MathFunction)MathFunction
subtype() constDataSetvirtual
testArgumentCount(int itmp) (defined in MathFunction)MathFunction
testArguments(MathStructure &vargs) (defined in MathFunction)MathFunctionprotected
testCondition(const MathStructure &vargs)MathFunction
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constMathFunctionvirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~MathFunction() (defined in MathFunction)MathFunctionvirtual
libqalculate-2.8.2/docs/reference/html/Variable_8h.html0000644000175000017500000004121513401033110017737 00000000000000 libqalculate-2.8.2: libqalculate/Variable.h File Reference
libqalculate-2.8.2
Variable.h File Reference

Classes

class  Assumptions
 An assumption about an unknown mathematical value. More...
 
class  Variable
 Abstract base class for variables. More...
 
class  UnknownVariable
 A variable with unknown value. More...
 
class  KnownVariable
 A variable with a known value. More...
 
class  DynamicVariable
 Abstract base class for variables with a value which is recalculated when the precision has changed. More...
 
class  PrecisionVariable
 Dynamic variable for Pi. More...
 
class  TodayVariable
 
class  TomorrowVariable
 
class  YesterdayVariable
 
class  NowVariable
 

Macros

#define DECLARE_BUILTIN_VARIABLE(x)
 

Enumerations

enum  AssumptionType {
  ASSUMPTION_TYPE_NONE = 0, ASSUMPTION_TYPE_NONMATRIX = 1, ASSUMPTION_TYPE_NUMBER = 2, ASSUMPTION_TYPE_COMPLEX = 3,
  ASSUMPTION_TYPE_REAL = 4, ASSUMPTION_TYPE_RATIONAL = 5, ASSUMPTION_TYPE_INTEGER = 6
}
 Type assumption. More...
 
enum  AssumptionSign {
  ASSUMPTION_SIGN_UNKNOWN, ASSUMPTION_SIGN_POSITIVE, ASSUMPTION_SIGN_NONNEGATIVE, ASSUMPTION_SIGN_NEGATIVE,
  ASSUMPTION_SIGN_NONPOSITIVE, ASSUMPTION_SIGN_NONZERO
}
 Signedness assumption. More...
 
enum  VariableSubtype { SUBTYPE_VARIABLE, SUBTYPE_UNKNOWN_VARIABLE, SUBTYPE_KNOWN_VARIABLE }
 Type of variable. More...
 

Macro Definition Documentation

◆ DECLARE_BUILTIN_VARIABLE

#define DECLARE_BUILTIN_VARIABLE (   x)
Value:
class x : public DynamicVariable { \
private: \
void calculate() const; \
public: \
x(); \
x(const x *variable) {set(variable);} \
ExpressionItem *copy() const {return new x(this);} \
};
Abstract base class for variables with a value which is recalculated when the precision has changed...
Definition: Variable.h:348

Enumeration Type Documentation

◆ AssumptionSign

Signedness assumption.

Enumerator
ASSUMPTION_SIGN_UNKNOWN 

x = ?

ASSUMPTION_SIGN_POSITIVE 

x > 0

ASSUMPTION_SIGN_NONNEGATIVE 

x >= 0

ASSUMPTION_SIGN_NEGATIVE 

x < 0

ASSUMPTION_SIGN_NONPOSITIVE 

x <= 0

ASSUMPTION_SIGN_NONZERO 

x != 0

◆ AssumptionType

Type assumption.

Each type is a subset of the type above.

Enumerator
ASSUMPTION_TYPE_NONE 

Multiplication is NOT commutative; do not use.

ASSUMPTION_TYPE_COMPLEX 

im(x) != 0

◆ VariableSubtype

Type of variable.

Enumerator
SUBTYPE_VARIABLE 

class Variable

SUBTYPE_UNKNOWN_VARIABLE 

class UnknownVariable

SUBTYPE_KNOWN_VARIABLE 

class KnownVariable

libqalculate-2.8.2/docs/reference/html/classThread.html0000644000175000017500000001371113401033110020050 00000000000000 libqalculate-2.8.2: Thread Class Reference
libqalculate-2.8.2

Public Member Functions

bool start ()
 
bool cancel ()
 
template<class T >
bool write (T data)
 

Public Attributes

volatile bool running
 

Protected Member Functions

virtual void run ()=0
 
void enableAsynchronousCancel ()
 
template<class T >
read ()
 
template<class T >
bool read (T *data)
 

The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classBooleanArgument.png0000644000175000017500000000100313401033110021532 00000000000000‰PNG  IHDRpPö’OPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2’IDATxí]nà ‡)÷?róglLº¢•B•élX6ö+Þ{?¼$Íc %É”ÿ(t’4Àõý}¡5Z ·èÂÿ0mn?»C×+„¶$5é ãä›+*³p3Tßó$©É€°PBQÔA’Úô…¯¿ž0Üc"Lç×Ýa}U’Ú ë£´Oi-ŒERj%ib•æµHR›ñ'Íès@Òþ3&Ì;•¤ÏÜaçW-IÖÛB’Lù ¡÷ÞOà#3™-|<&g Ÿ¾¹ÆéÂ/¨Ò%°e LYBS–À”%0e LYBS– ‰sÎÍ0%0åï„¡‚€ês±šÑ…&Oi´&9Ÿu85§Â¸Ñ1iàï+ÈíjHÊß›0JáÐQšiÒcÿË^- ÌÓ:Ã3a½žðdLkí7w˜V²…]žc¦/„ÕûÂrý8ú°ÝÖ뫟œá‰°>Ê[)Í9º¨Òp÷›0I©•¤©ªâP¥¿áî4&Â]!\b³ÃÖS Áz=˜òB眛È’©™ÛöIEND®B`‚libqalculate-2.8.2/docs/reference/html/classVariable.html0000644000175000017500000014440713401033110020375 00000000000000 libqalculate-2.8.2: Variable Class Reference
libqalculate-2.8.2
Variable Class Referenceabstract

Abstract base class for variables. More...

#include <Variable.h>

Inheritance diagram for Variable:
ExpressionItem KnownVariable UnknownVariable DynamicVariable NowVariable PrecisionVariable TodayVariable TomorrowVariable YesterdayVariable

Public Member Functions

 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual ExpressionItemcopy () const =0
 
virtual void set (const ExpressionItem *item)
 
virtual int type () const
 
virtual int subtype () const
 
virtual bool isKnown () const =0
 
virtual bool representsPositive (bool=false)
 
virtual bool representsNegative (bool=false)
 
virtual bool representsNonNegative (bool=false)
 
virtual bool representsNonPositive (bool=false)
 
virtual bool representsInteger (bool=false)
 
virtual bool representsNonInteger (bool=false)
 
virtual bool representsFraction (bool=false)
 
virtual bool representsNumber (bool=false)
 
virtual bool representsRational (bool=false)
 
virtual bool representsReal (bool=false)
 
virtual bool representsNonComplex (bool b=false)
 
virtual bool representsComplex (bool=false)
 
virtual bool representsNonZero (bool=false)
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
virtual bool representsNonMatrix ()
 
virtual bool representsScalar ()
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Additional Inherited Members

- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

Abstract base class for variables.

A variable is an alpha-numerical representation of a known or unknown value.

Member Function Documentation

◆ isKnown()

virtual bool Variable::isKnown ( ) const
pure virtual

Returns if the variable has a known value (as oppossed to assumptions).

Returns
true if the variable is of class KnownVariable, false if UnknownVariable.

Implemented in KnownVariable, and UnknownVariable.

◆ representsPositive()

virtual bool Variable::representsPositive ( bool  = false)
inlinevirtual

Returns if the variable represents a positive value.

Reimplemented in NowVariable, YesterdayVariable, TomorrowVariable, TodayVariable, DynamicVariable, KnownVariable, and UnknownVariable.

◆ subtype()

virtual int Variable::subtype ( ) const
inlinevirtual

Returns the subtype of the variable, corresponding to which subsubclass the object belongs to.

Returns
VariableSubtype.

Implements ExpressionItem.

Reimplemented in KnownVariable, and UnknownVariable.

References SUBTYPE_VARIABLE.

◆ type()

virtual int Variable::type ( ) const
inlinevirtual

Returns the type of the expression item, corresponding to which subclass the object belongs to.

Returns
ExpressionItemType.

Implements ExpressionItem.

References TYPE_VARIABLE.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classVectorArgument-members.html0000644000175000017500000004063713401033110023245 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
VectorArgument Member List

This is the complete list of members for VectorArgument, including all inherited members.

addArgument(Argument *arg) (defined in VectorArgument)VectorArgument
alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_argloop (defined in VectorArgument)VectorArgumentprotected
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constVectorArgumentvirtual
countArguments() const (defined in VectorArgument)VectorArgument
delArgument(size_t index) (defined in VectorArgument)VectorArgument
getArgument(size_t index) const (defined in VectorArgument)VectorArgument
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constVectorArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
reoccuringArguments() const (defined in VectorArgument)VectorArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setReoccuringArguments(bool reocc) (defined in VectorArgument)VectorArgument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subargs (defined in VectorArgument)VectorArgumentprotected
subprintlong() constVectorArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constVectorArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constVectorArgumentvirtual
VectorArgument(string name_="", bool does_test=true, bool allow_matrix=false, bool does_error=true) (defined in VectorArgument)VectorArgument
VectorArgument(const VectorArgument *arg) (defined in VectorArgument)VectorArgument
zeroForbidden() constArgument
~Argument()Argumentvirtual
~VectorArgument() (defined in VectorArgument)VectorArgumentvirtual
libqalculate-2.8.2/docs/reference/html/classDataProperty.html0000644000175000017500000005643713401033110021273 00000000000000 libqalculate-2.8.2: DataProperty Class Reference
libqalculate-2.8.2

A data set property. More...

#include <DataSet.h>

Public Member Functions

 DataProperty (DataSet *parent_set, string s_name="", string s_title="", string s_description="")
 
 DataProperty (const DataProperty &dp)
 
void set (const DataProperty &dp)
 
void setName (string s_name, bool is_ref=false)
 
void setNameIsReference (size_t index=1, bool is_ref=true)
 
bool nameIsReference (size_t index=1) const
 
void clearNames ()
 
void addName (string s_name, bool is_ref=false, size_t index=0)
 
size_t hasName (const string &s_name)
 
size_t countNames () const
 
const string & getName (size_t index=1) const
 
const string & getReferenceName () const
 
void setTitle (string s_title)
 
const string & title (bool return_name_if_no_title=true) const
 
void setDescription (string s_description)
 
const string & description () const
 
void setUnit (string s_unit)
 
const string & getUnitString () const
 
const MathStructuregetUnitStruct ()
 
string getInputString (const string &valuestr)
 
string getDisplayString (const string &valuestr)
 
MathStructuregenerateStruct (const string &valuestr, int is_approximate=-1)
 
void setKey (bool is_key=true)
 
bool isKey () const
 
void setHidden (bool is_hidden=true)
 
bool isHidden () const
 
void setCaseSensitive (bool is_case_sensitive=true)
 
bool isCaseSensitive () const
 
void setUsesBrackets (bool uses_brackets=true)
 
bool usesBrackets () const
 
void setApproximate (bool is_approximate=true)
 
bool isApproximate () const
 
void setPropertyType (PropertyType property_type)
 
PropertyType propertyType () const
 
bool isUserModified () const
 
void setUserModified (bool user_modified=true)
 
DataSetparentSet () const
 

Protected Attributes

vector< string > names
 
vector< bool > name_is_ref
 
string sdescr
 
string stitle
 
string sunit
 
MathStructurem_unit
 
bool b_approximate
 
bool b_brackets
 
bool b_key
 
bool b_case
 
bool b_hide
 
DataSetparent
 
PropertyType ptype
 
bool b_uchanged
 

Detailed Description

A data set property.

Property definitions for use with data set objects.

Constructor & Destructor Documentation

◆ DataProperty()

DataProperty::DataProperty ( DataSet parent_set,
string  s_name = "",
string  s_title = "",
string  s_description = "" 
)

Create a data property.

Parameters
s_nameProperty name (initial) used for reference.
s_titleDescriptive name/title.
s_descriptionDescription.

The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classAssumptions-members.html0000644000175000017500000002444513401033110022624 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
Assumptions Member List

This is the complete list of members for Assumptions, including all inherited members.

Assumptions() (defined in Assumptions)Assumptions
b_incl_max (defined in Assumptions)Assumptionsprotected
b_incl_min (defined in Assumptions)Assumptionsprotected
fmax (defined in Assumptions)Assumptionsprotected
fmin (defined in Assumptions)Assumptionsprotected
i_sign (defined in Assumptions)Assumptionsprotected
i_type (defined in Assumptions)Assumptionsprotected
includeEqualsMax() const (defined in Assumptions)Assumptions
includeEqualsMin() const (defined in Assumptions)Assumptions
isComplex() (defined in Assumptions)Assumptions
isInteger() (defined in Assumptions)Assumptions
isNegative() (defined in Assumptions)Assumptions
isNonMatrix() (defined in Assumptions)Assumptions
isNonNegative() (defined in Assumptions)Assumptions
isNonPositive() (defined in Assumptions)Assumptions
isNonZero() (defined in Assumptions)Assumptions
isNumber() (defined in Assumptions)Assumptions
isPositive() (defined in Assumptions)Assumptions
isRational() (defined in Assumptions)Assumptions
isReal() (defined in Assumptions)Assumptions
isScalar() (defined in Assumptions)Assumptions
max() const (defined in Assumptions)Assumptions
min() const (defined in Assumptions)Assumptions
setIncludeEqualsMax(bool include_equals) (defined in Assumptions)Assumptions
setIncludeEqualsMin(bool include_equals) (defined in Assumptions)Assumptions
setMax(const Number *nmax) (defined in Assumptions)Assumptions
setMin(const Number *nmin) (defined in Assumptions)Assumptions
setSign(AssumptionSign as) (defined in Assumptions)Assumptions
setType(AssumptionType ant) (defined in Assumptions)Assumptions
sign() (defined in Assumptions)Assumptions
type() (defined in Assumptions)Assumptions
~Assumptions() (defined in Assumptions)Assumptions
libqalculate-2.8.2/docs/reference/html/functions_func.html0000644000175000017500000000637513401033110020646 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- a -

libqalculate-2.8.2/docs/reference/html/structPlotDataParameters-members.html0000644000175000017500000000754513401033110024254 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
PlotDataParameters Member List
libqalculate-2.8.2/docs/reference/html/functions_0x7e.html0000644000175000017500000000402413401033110020463 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- ~ -

libqalculate-2.8.2/docs/reference/html/classFileArgument-members.html0000644000175000017500000003411713401033110022656 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
FileArgument Member List

This is the complete list of members for FileArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constFileArgumentvirtual
FileArgument(string name_="", bool does_test=true, bool does_error=true) (defined in FileArgument)FileArgument
FileArgument(const FileArgument *arg) (defined in FileArgument)FileArgument
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constFileArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constFileArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constFileArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constFileArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~FileArgument() (defined in FileArgument)FileArgumentvirtual
libqalculate-2.8.2/docs/reference/html/classNumberPrefix.html0000644000175000017500000004624113401033110021253 00000000000000 libqalculate-2.8.2: NumberPrefix Class Reference
libqalculate-2.8.2

A prefix with a free numerical value. More...

#include <Prefix.h>

Inheritance diagram for NumberPrefix:
Prefix

Public Member Functions

 NumberPrefix (const Number &nr, string long_name, string short_name="", string unicode_name="")
 
void setValue (const Number &nr)
 
Number value (const Number &nexp) const
 
Number value (int iexp) const
 
Number value () const
 
int type () const
 
- Public Member Functions inherited from Prefix
 Prefix (string long_name, string short_name="", string unicode_name="")
 
const string & shortName (bool return_long_if_no_short=true, bool use_unicode=false) const
 
const string & longName (bool return_short_if_no_long=true, bool use_unicode=false) const
 
const string & unicodeName (bool return_short_if_no_uni=true) const
 
void setShortName (string short_name)
 
void setLongName (string long_name)
 
void setUnicodeName (string unicode_name)
 
const string & name (bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 

Protected Attributes

Number o_number
 
- Protected Attributes inherited from Prefix
string l_name
 
string s_name
 
string u_name
 

Detailed Description

A prefix with a free numerical value.

A prefix without any predefined base, which can use any number.

Constructor & Destructor Documentation

◆ NumberPrefix()

NumberPrefix::NumberPrefix ( const Number nr,
string  long_name,
string  short_name = "",
string  unicode_name = "" 
)

Create a number prefix.

Parameters
nrValue of the prefix.
long_nameLong name.
short_nameShort name.
unicode_nameUnicode name.

Member Function Documentation

◆ setValue()

void NumberPrefix::setValue ( const Number nr)

Sets the value of the prefix.

Parameters
nrNew value for the prefix.

◆ type()

int NumberPrefix::type ( ) const
virtual

Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix.

Returns
The type of the prefix.

Implements Prefix.

◆ value() [1/3]

Number NumberPrefix::value ( const Number nexp) const
virtual

Returns the value of the prefix.

Parameters
nexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implements Prefix.

◆ value() [2/3]

Number NumberPrefix::value ( int  iexp) const
virtual

Returns the value of the prefix.

Parameters
iexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implements Prefix.

◆ value() [3/3]

Number NumberPrefix::value ( ) const
virtual

Returns the value of the prefix.

Returns
The value of the prefix.

Implements Prefix.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/functions.html0000644000175000017500000001235513401033110017626 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- a -

libqalculate-2.8.2/docs/reference/html/functions_func_k.html0000644000175000017500000000365713401033110021160 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- k -

libqalculate-2.8.2/docs/reference/html/structExpressionName-members.html0000644000175000017500000001315113401033110023446 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
ExpressionName Member List

This is the complete list of members for ExpressionName, including all inherited members.

abbreviationExpressionName
avoid_inputExpressionName
case_sensitiveExpressionName
completion_onlyExpressionName
ExpressionName()ExpressionName
ExpressionName(string sname)ExpressionName
nameExpressionName
operator!=(const ExpressionName &ename) const (defined in ExpressionName)ExpressionName
operator=(const ExpressionName &ename) (defined in ExpressionName)ExpressionName
operator==(const ExpressionName &ename) const (defined in ExpressionName)ExpressionName
pluralExpressionName
referenceExpressionName
suffixExpressionName
unicodeExpressionName
libqalculate-2.8.2/docs/reference/html/functions_func_e.html0000644000175000017500000000561713401033110021150 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- e -

libqalculate-2.8.2/docs/reference/html/classMatrixArgument.png0000644000175000017500000000100713401033110021423 00000000000000‰PNG  IHDReP7KãPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2–IDATxíÝr FÏ~Ìøþ\ d£ÄÕ&Ó±´9‚ö°üxMJ)I’fZ$)°˜$xÚd±¨æ#ËRZþ̱¼~mÎM·"×%鞥D\Åã–%l÷ݽ’tÏK–J-jܾ¤ #ËíoÏ’û¼oY÷d7—þ­$mXúíù¥ë-e·ë¦¯±Ëó HÒ†ÈÝ^Ò¸Ås’¤0/çòüÊIÒó—_’"|™%¥”Ž ÈàpN±\.ghN±\%'hα|Õ›€ÓaZ"L @„iˆ0-¦ ·˜™p0ÓádË*«ÒmK_ØÃƒ¯•\–âIÄpæ#Ë퀗ò_¬½—2ß‚Ü\ZÊýË=ÖýŠy˜¥þ8ÞÜt^ÂvßÝûØRfÞÆÍsª–J-ºÙ4Å&¬gÐ̲µäcK7x`éÇcÔ°žG¹ôoïOò6ÛfëÎoß }Æ+Ö¬Ïr²¼óCKÙíºéu¹ûy||÷_û¾ÅsØáƒ\Ö+°Ãüåˆðe3³£ù’ B÷è:IEND®B`‚libqalculate-2.8.2/docs/reference/html/classDataObjectArgument.html0000644000175000017500000007630713401033110022356 00000000000000 libqalculate-2.8.2: DataObjectArgument Class Reference
libqalculate-2.8.2

Data object function argument. More...

#include <DataSet.h>

Inheritance diagram for DataObjectArgument:
Argument

Public Member Functions

 DataObjectArgument (DataSet *data_set, string name_="", bool does_test=true, bool does_error=true)
 
 DataObjectArgument (const DataObjectArgument *arg)
 
int type () const
 
Argumentcopy () const
 
string print () const
 
DataSetdataSet () const
 
void setDataSet (DataSet *data_set)
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Protected Attributes

DataSeto_data
 
- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

Data object function argument.

Member Function Documentation

◆ copy()

Argument* DataObjectArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

string DataObjectArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string DataObjectArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool DataObjectArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

int DataObjectArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classDataObjectArgument-members.html0000644000175000017500000003620713401033110024001 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
DataObjectArgument Member List

This is the complete list of members for DataObjectArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constDataObjectArgumentvirtual
DataObjectArgument(DataSet *data_set, string name_="", bool does_test=true, bool does_error=true) (defined in DataObjectArgument)DataObjectArgument
DataObjectArgument(const DataObjectArgument *arg) (defined in DataObjectArgument)DataObjectArgument
dataSet() const (defined in DataObjectArgument)DataObjectArgument
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
o_data (defined in DataObjectArgument)DataObjectArgumentprotected
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constDataObjectArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setDataSet(DataSet *data_set) (defined in DataObjectArgument)DataObjectArgument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constDataObjectArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constDataObjectArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constDataObjectArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~DataObjectArgument() (defined in DataObjectArgument)DataObjectArgument
libqalculate-2.8.2/docs/reference/html/classKnownVariable-members.html0000644000175000017500000011224613401033110023036 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
KnownVariable Member List

This is the complete list of members for KnownVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_expression (defined in KnownVariable)KnownVariableprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculated_precision (defined in KnownVariable)KnownVariableprotected
calculated_with_interval (defined in KnownVariable)KnownVariableprotected
calculated_with_units (defined in KnownVariable)KnownVariableprotected
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const (defined in KnownVariable)KnownVariablevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
expression() constKnownVariablevirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
get()KnownVariablevirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isExpression() constKnownVariablevirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() constKnownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
KnownVariable(string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable(string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable()KnownVariable
KnownVariable(const KnownVariable *variable)KnownVariable
mstruct (defined in KnownVariable)KnownVariableprotected
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in KnownVariable)KnownVariablevirtual
representsComplex(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsEven(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsFraction(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsInteger(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNegative(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonComplex(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonInteger(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonMatrix() (defined in KnownVariable)KnownVariablevirtual
representsNonNegative(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonPositive(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonZero(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNumber(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsOdd(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsPositive(bool=false)KnownVariablevirtual
representsRational(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsReal(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsScalar() (defined in KnownVariable)KnownVariablevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in KnownVariable)KnownVariablevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in KnownVariable)KnownVariablevirtual
set(const MathStructure &o)KnownVariablevirtual
set(string expression_)KnownVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
setUncertainty(string standard_uncertainty) (defined in KnownVariable)KnownVariablevirtual
setUnit(string unit_expression) (defined in KnownVariable)KnownVariablevirtual
sexpression (defined in KnownVariable)KnownVariableprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constKnownVariableinlinevirtual
suncertainty (defined in KnownVariable)KnownVariableprotected
sunit (defined in KnownVariable)KnownVariableprotected
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constVariableinlinevirtual
uncertainty() const (defined in KnownVariable)KnownVariablevirtual
unit() const (defined in KnownVariable)KnownVariablevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~KnownVariable() (defined in KnownVariable)KnownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-2.8.2/docs/reference/html/classUserFunction.png0000644000175000017500000000125413401033110021104 00000000000000‰PNG  IHDR`ˆ/QåPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2;IDATxíër«0 ןgxÿGnbƒoÄ*9™9­6€-¼BVû›c\ Q’ÖáI2¹OÒG’.pŠ{ Lž­Iúg® Ò)<¿åêùrùËob¿*§™š½AžKÑûrûŠAŽ&p{³=¨)öäÊo3z´%;ïÁYКËôKAŽ´].…6fÌVAõèŒM>K‚4o–(¿ß©‹J¿Ìº¨ë‹¦€£@Rsüì¯â¿Šÿ_ IŸÁ’dr‡ ÆðÀJV ¶m±aµà±þZÃrÁ/è"ظÀÄ&.0q€‰ L\`ò1Ƹ¢$­Ã’dr« çtµß„ô‘¤Ô0Iêé9ªY§HÒ kr&Hé>ßt߬•´9¸ ÛoÊÔËíÍ:)º)Á1QGËU?õ Ö§Œ L\`r‡ „ò&#'ìX 1IEND®B`‚libqalculate-2.8.2/docs/reference/html/classTodayVariable-members.html0000644000175000017500000012110413401033110023013 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
TodayVariable Member List

This is the complete list of members for TodayVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
always_recalculate (defined in DynamicVariable)DynamicVariableprotected
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_expression (defined in KnownVariable)KnownVariableprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculated_precision (defined in KnownVariable)KnownVariableprotected
calculated_with_interval (defined in KnownVariable)KnownVariableprotected
calculated_with_units (defined in KnownVariable)KnownVariableprotected
calculatedPrecision() constDynamicVariable
calculatedWithInterval() const (defined in DynamicVariable)DynamicVariable
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const (defined in TodayVariable)TodayVariableinlinevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
DynamicVariable(string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true) (defined in DynamicVariable)DynamicVariable
DynamicVariable(const DynamicVariable *variable) (defined in DynamicVariable)DynamicVariable
DynamicVariable() (defined in DynamicVariable)DynamicVariable
expression() constKnownVariablevirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
get()DynamicVariablevirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isExpression() constKnownVariablevirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() constKnownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
KnownVariable(string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable(string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable()KnownVariable
KnownVariable(const KnownVariable *variable)KnownVariable
mstruct (defined in KnownVariable)KnownVariableprotected
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsComplex(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsEven(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsFraction(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsInteger(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonComplex(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonInteger(bool=false) (defined in TodayVariable)TodayVariableinlinevirtual
representsNonMatrix() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonNegative(bool=false) (defined in TodayVariable)TodayVariableinlinevirtual
representsNonPositive(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonZero(bool b=false) (defined in TodayVariable)TodayVariableinlinevirtual
representsNumber(bool b=false) (defined in TodayVariable)TodayVariableinlinevirtual
representsOdd(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsPositive(bool=false)TodayVariableinlinevirtual
representsRational(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsReal(bool b=false) (defined in TodayVariable)TodayVariableinlinevirtual
representsScalar() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in DynamicVariable)DynamicVariablevirtual
set(const MathStructure &o)DynamicVariablevirtual
set(string expression_)DynamicVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
setUncertainty(string standard_uncertainty) (defined in KnownVariable)KnownVariablevirtual
setUnit(string unit_expression) (defined in KnownVariable)KnownVariablevirtual
sexpression (defined in KnownVariable)KnownVariableprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constKnownVariableinlinevirtual
suncertainty (defined in KnownVariable)KnownVariableprotected
sunit (defined in KnownVariable)KnownVariableprotected
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
TodayVariable() (defined in TodayVariable)TodayVariable
TodayVariable(const TodayVariable *variable) (defined in TodayVariable)TodayVariableinline
type() constVariableinlinevirtual
uncertainty() const (defined in KnownVariable)KnownVariablevirtual
unit() const (defined in KnownVariable)KnownVariablevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~DynamicVariable() (defined in DynamicVariable)DynamicVariablevirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~KnownVariable() (defined in KnownVariable)KnownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-2.8.2/docs/reference/html/classVariableArgument.html0000644000175000017500000007320113401033110022071 00000000000000 libqalculate-2.8.2: VariableArgument Class Reference
libqalculate-2.8.2
Inheritance diagram for VariableArgument:
Argument

Public Member Functions

 VariableArgument (string name_="", bool does_test=true, bool does_error=true)
 
 VariableArgument (const VariableArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Member Function Documentation

◆ copy()

virtual Argument* VariableArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string VariableArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string VariableArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool VariableArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int VariableArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classPrecisionVariable.html0000644000175000017500000016763613401033110022262 00000000000000 libqalculate-2.8.2: PrecisionVariable Class Reference
libqalculate-2.8.2
PrecisionVariable Class Reference

Dynamic variable for Pi. More...

#include <Variable.h>

Inheritance diagram for PrecisionVariable:
DynamicVariable KnownVariable Variable ExpressionItem

Public Member Functions

 PrecisionVariable (const PrecisionVariable *variable)
 
ExpressionItemcopy () const
 
bool representsInteger (bool=false)
 
bool representsNonInteger (bool=false)
 
- Public Member Functions inherited from DynamicVariable
 DynamicVariable (string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true)
 
 DynamicVariable (const DynamicVariable *variable)
 
void set (const ExpressionItem *item)
 
const MathStructureget ()
 
void set (const MathStructure &o)
 
void set (string expression_)
 
int calculatedPrecision () const
 
bool calculatedWithInterval () const
 
virtual bool representsPositive (bool=false)
 
virtual bool representsNegative (bool=false)
 
virtual bool representsNonNegative (bool=false)
 
virtual bool representsNonPositive (bool=false)
 
virtual bool representsNumber (bool=false)
 
virtual bool representsRational (bool=false)
 
virtual bool representsReal (bool=false)
 
virtual bool representsComplex (bool=false)
 
virtual bool representsNonZero (bool=false)
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
virtual bool representsNonMatrix ()
 
virtual bool representsScalar ()
 
- Public Member Functions inherited from KnownVariable
 KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable ()
 
 KnownVariable (const KnownVariable *variable)
 
bool isKnown () const
 
virtual bool isExpression () const
 
virtual string expression () const
 
virtual string uncertainty () const
 
virtual string unit () const
 
int subtype () const
 
virtual void setUncertainty (string standard_uncertainty)
 
virtual void setUnit (string unit_expression)
 
virtual bool representsFraction (bool=false)
 
virtual bool representsNonComplex (bool=false)
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Additional Inherited Members

- Protected Attributes inherited from DynamicVariable
bool always_recalculate
 
- Protected Attributes inherited from KnownVariable
MathStructuremstruct
 
bool b_expression
 
int calculated_precision
 
bool calculated_with_interval
 
bool calculated_with_units
 
string sexpression
 
string suncertainty
 
string sunit
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

Dynamic variable for Pi.

Dynamic variable for e, the base of natural logarithms Dynamic variable for Euler's constant Dynamic variable for Catalan's constant Dynamic variable for current precision


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classMathFunction.png0000644000175000017500000000164513401033110021063 00000000000000‰PNG  IHDRʈ‘+„ýPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT24IDATxíë’« ›*ßÿ‘O‚ÊMÍÂ&FÖ3‰m¦&úñÞû3ø^’ÎÃTº1IjÁTºYT\øHR›v‚ƒg¯P‘¤_3¢JøqÏo¼zNØkçÆY³å&V]¼À–P²ˆC\ÙZ+Ri¼*«†QI«+¸¾óÊaÛ²Œÿ²mŸ¦d^:uÐP¥X9SeêVeÝ G{e0•”¼*•¥(o¶–Å 6€ ÀÇ1€nL SèÆTZ0€nœsîLe¸÷Q™¦Û¸ÜGåar—©XS S S S8‘iš¦/p&ß{Á¦І©tb*m˜ @'¦І©tb*m˜ @'¦ÐÆÀ*Þ{ßÃä½÷|q$/Iç‘«HÒy˜Š$µa*’ÔÉÿ¢âžŸü¾¬Ú­Tû*áݧ˜Gý=ʇz­RÇTóII:âeåÏ*á^T:¥>³2IÚòƒÊüäÒ ßÔ"LBÖâyŠÑĪ>•Øïzµö’*$i×*ÛNk•¢EyS Ü8+EÄKq à=•ÔËúÆëž‹‘˲_¨Ìý§«Øqª¤ZX~=ßUÙ,°ò­¾µí·‹ê4•r¶wT>¸WJ•¸öJ—J\MsîȲÈZ³¬ŒÞ –=_d°"7–a'Ï`*’ô.ƒüÛKÒ»˜Š$ub*’Ô†©HR'¦"Im|UÅ{ïO$SñÞûùÂ=d3&ôâIEND®B`‚libqalculate-2.8.2/docs/reference/html/classDataPropertyArgument.html0000644000175000017500000007637113401033110022775 00000000000000 libqalculate-2.8.2: DataPropertyArgument Class Reference
libqalculate-2.8.2

Data property function argument. More...

#include <DataSet.h>

Inheritance diagram for DataPropertyArgument:
Argument

Public Member Functions

 DataPropertyArgument (DataSet *data_set, string name_="", bool does_test=true, bool does_error=true)
 
 DataPropertyArgument (const DataPropertyArgument *arg)
 
int type () const
 
Argumentcopy () const
 
string print () const
 
DataSetdataSet () const
 
void setDataSet (DataSet *data_set)
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Protected Attributes

DataSeto_data
 
- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

Data property function argument.

Member Function Documentation

◆ copy()

Argument* DataPropertyArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

string DataPropertyArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string DataPropertyArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool DataPropertyArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

int DataPropertyArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classCalculatorMessage-members.html0000644000175000017500000001252513401033110023671 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
CalculatorMessage Member List

This is the complete list of members for CalculatorMessage, including all inherited members.

c_message() const (defined in CalculatorMessage)CalculatorMessage
CalculatorMessage(string message_, MessageType type_=MESSAGE_WARNING, int cat_=MESSAGE_CATEGORY_NONE, int stage_=MESSAGE_STAGE_UNSET) (defined in CalculatorMessage)CalculatorMessage
CalculatorMessage(const CalculatorMessage &e) (defined in CalculatorMessage)CalculatorMessage
category() const (defined in CalculatorMessage)CalculatorMessage
i_cat (defined in CalculatorMessage)CalculatorMessageprotected
i_stage (defined in CalculatorMessage)CalculatorMessageprotected
message() const (defined in CalculatorMessage)CalculatorMessage
mtype (defined in CalculatorMessage)CalculatorMessageprotected
smessage (defined in CalculatorMessage)CalculatorMessageprotected
stage() const (defined in CalculatorMessage)CalculatorMessage
type() const (defined in CalculatorMessage)CalculatorMessage
libqalculate-2.8.2/docs/reference/html/hierarchy.html0000644000175000017500000004744113401033110017600 00000000000000 libqalculate-2.8.2: Class Hierarchy
libqalculate-2.8.2
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 12345]
 CArgumentA mathematical function argument definition with free value and base class for all argument definitions
 CAngleArgument
 CArgumentSetA set of accepted arguments
 CBooleanArgumentA boolean argument
 CDataObjectArgumentData object function argument
 CDataPropertyArgumentData property function argument
 CDateArgumentA date argument
 CExpressionItemArgumentArgument for functions, variables and units
 CFileArgument
 CFunctionArgumentA function argument
 CIntegerArgumentA definition for integer arguments
 CMatrixArgumentA matrix argument
 CNumberArgumentA definition for numerical arguments
 CSymbolicArgumentA symbolic argument
 CTextArgumentA text argument
 CUnitArgument
 CVariableArgument
 CVectorArgumentA vector argument
 CAssumptionsAn assumption about an unknown mathematical value
 CCalculatorThe almighty calculator class
 CCalculatorMessageA message with information to the user. Primarily used for errors and warnings
 CDataObjectA a data set object
 CDataPropertyA data set property
 CElement
 CEvaluationOptionsOptions for calculation
 CExpressionItemAbstract base class for functions, variables and units
 CMathFunctionAbstract base class for mathematical functions
 CDataSetA data set
 CUserFunctionA user defined mathematical function
 CUnitA unit for measurement
 CAliasUnitAn unit with relation to another unit
 CAliasUnit_CompositeA subunit in a CompositeUnit
 CCompositeUnitA unit consisting of a number of other units
 CVariableAbstract base class for variables
 CKnownVariableA variable with a known value
 CDynamicVariableAbstract base class for variables with a value which is recalculated when the precision has changed
 CNowVariable
 CPrecisionVariableDynamic variable for Pi
 CTodayVariable
 CTomorrowVariable
 CYesterdayVariable
 CUnknownVariableA variable with unknown value
 CExpressionNameA name for an expression item (function, variable or unit)
 CInternalPrintStruct
 CMathStructureA structure representing a mathematical value/expression/result
 CNumberA number
 CParseOptionsOptions for parsing expressions
 CPlotDataParametersParameters for plot data series
 CPlotParametersParameters passed to plotting functions
 CPrefixAbstract class for prefixes
 CBinaryPrefixA binary prefix
 CDecimalPrefixA decimal (metric) prefix
 CNumberPrefixA prefix with a free numerical value
 CPrintOptionsOptions for formatting and display of mathematical structures/results
 CQalculateDateTime
 CSortOptionsOptions for ordering the parts of a mathematical expression/result before display
 CThread
libqalculate-2.8.2/docs/reference/html/Prefix_8h.html0000644000175000017500000001206413401033110017447 00000000000000 libqalculate-2.8.2: libqalculate/Prefix.h File Reference
libqalculate-2.8.2
Prefix.h File Reference

Classes

class  Prefix
 Abstract class for prefixes. More...
 
class  DecimalPrefix
 A decimal (metric) prefix. More...
 
class  BinaryPrefix
 A binary prefix. More...
 
class  NumberPrefix
 A prefix with a free numerical value. More...
 

Enumerations

enum  PrefixType { PREFIX_DECIMAL, PREFIX_BINARY, PREFIX_NUMBER }
 Types for prefix classes.
 
libqalculate-2.8.2/docs/reference/html/bc_s.png0000644000175000017500000000124413401033110016337 00000000000000‰PNG  IHDR€_ kIDATxíËkQÆÏ¹É̤I&“¦mš&156*nÄ…”ܸR,4 +Hµ(U­b”ª1‚ŠˆJ.º(E·mßúhëJmKS'C›(‚èäÑ…¤ï &äÖþ ‡ïrÎåü3gö(z÷ýÒ&_9ó}’ÕŸ@‰mÚu ` Øh`ñ÷Ô¯  „ú&·ññ×Ù~“½—Üò‡ÎÝÑM4¸%‰3²§?Êêh)€ÿù™\ÄYi>Jb @gûßiÞˆú²Ñkg§ãê\è½­šEUæv+?E€î"pæÖÛB\ƒY&ðØó$vM+ê’Dn¼)}òþ:§Xoâ ƒ3ŠÚ¯'¯¿.‚fÁ0ìuŠ9òLýj€f6¸%«3Gf”Ô#Ôsm(,ùÃk*Ê’³Jª…¯¼JË¢o䆔¼u_~ °r]%%mnu]z°r5[ÍÆ°«Úò•Xeµ’†Iù<ÈèÐÅg@IÔÚÞàµë3‚:/<JÇ’ÐQ) ñ¹…tÚß÷(Mû\63éCgl!ýí;ÿ¸4Ùhâñ=÷Zë29­w’ÝÒ´·ˆV;ÊL3ƒj&7©·º½÷a!I†)ëë$-öÇÓú³›‹7tIV¾VàñÔübf¨8¡ÈƒB<﫵imnÿœÈ‡„ lߣù‡ÛD —#É5“­'Æ4?쬲øM’™›°»g¬‚|5Åçµ½GNdÓÐr|ô”Ã&„ì"7+'³@ 5‡G➑Džâɬ^;õã–.3Òr"ý_R³¿Â@²oI¾å$IEND®B`‚libqalculate-2.8.2/docs/reference/html/Unit_8h.html0000644000175000017500000001570413401033110017135 00000000000000 libqalculate-2.8.2: libqalculate/Unit.h File Reference
libqalculate-2.8.2
Unit.h File Reference

Classes

class  Unit
 A unit for measurement. More...
 
class  AliasUnit
 An unit with relation to another unit. More...
 
class  AliasUnit_Composite
 A subunit in a CompositeUnit. More...
 
class  CompositeUnit
 A unit consisting of a number of other units. More...
 

Enumerations

enum  UnitSubtype { SUBTYPE_BASE_UNIT, SUBTYPE_ALIAS_UNIT, SUBTYPE_COMPOSITE_UNIT }
 Type of unit. More...
 

Enumeration Type Documentation

◆ UnitSubtype

Type of unit.

Enumerator
SUBTYPE_BASE_UNIT 

class Unit

SUBTYPE_ALIAS_UNIT 

class AliasUnit

SUBTYPE_COMPOSITE_UNIT 

class CompositeUnit

libqalculate-2.8.2/docs/reference/html/tab_s.png0000644000175000017500000000027013401033110016517 00000000000000‰PNG  IHDR$ÇÇ[IDATxíÝ ‚@@Ñ£?Q…¤"š¢%¦I‘—Šf–6[´HÃäQƒ<Þâõþ]ždr Í’s?ˆO=Ñññw'ÌF‡Ž íðö-~rÃ[œèŠ­ì¬mƒÖ¬ƒݯнŠÕF)Yº% §`nÌ,9B ™’©!ÑŒ\ý<Å#üîî•IEND®B`‚libqalculate-2.8.2/docs/reference/html/classTomorrowVariable-members.html0000644000175000017500000012127713401033110023576 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
TomorrowVariable Member List

This is the complete list of members for TomorrowVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
always_recalculate (defined in DynamicVariable)DynamicVariableprotected
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_expression (defined in KnownVariable)KnownVariableprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculated_precision (defined in KnownVariable)KnownVariableprotected
calculated_with_interval (defined in KnownVariable)KnownVariableprotected
calculated_with_units (defined in KnownVariable)KnownVariableprotected
calculatedPrecision() constDynamicVariable
calculatedWithInterval() const (defined in DynamicVariable)DynamicVariable
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const (defined in TomorrowVariable)TomorrowVariableinlinevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
DynamicVariable(string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true) (defined in DynamicVariable)DynamicVariable
DynamicVariable(const DynamicVariable *variable) (defined in DynamicVariable)DynamicVariable
DynamicVariable() (defined in DynamicVariable)DynamicVariable
expression() constKnownVariablevirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
get()DynamicVariablevirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isExpression() constKnownVariablevirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() constKnownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
KnownVariable(string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable(string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable()KnownVariable
KnownVariable(const KnownVariable *variable)KnownVariable
mstruct (defined in KnownVariable)KnownVariableprotected
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsComplex(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsEven(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsFraction(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsInteger(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonComplex(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonInteger(bool=false) (defined in TomorrowVariable)TomorrowVariableinlinevirtual
representsNonMatrix() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonNegative(bool=false) (defined in TomorrowVariable)TomorrowVariableinlinevirtual
representsNonPositive(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonZero(bool b=false) (defined in TomorrowVariable)TomorrowVariableinlinevirtual
representsNumber(bool b=false) (defined in TomorrowVariable)TomorrowVariableinlinevirtual
representsOdd(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsPositive(bool=false)TomorrowVariableinlinevirtual
representsRational(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsReal(bool b=false) (defined in TomorrowVariable)TomorrowVariableinlinevirtual
representsScalar() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in DynamicVariable)DynamicVariablevirtual
set(const MathStructure &o)DynamicVariablevirtual
set(string expression_)DynamicVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
setUncertainty(string standard_uncertainty) (defined in KnownVariable)KnownVariablevirtual
setUnit(string unit_expression) (defined in KnownVariable)KnownVariablevirtual
sexpression (defined in KnownVariable)KnownVariableprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constKnownVariableinlinevirtual
suncertainty (defined in KnownVariable)KnownVariableprotected
sunit (defined in KnownVariable)KnownVariableprotected
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
TomorrowVariable() (defined in TomorrowVariable)TomorrowVariable
TomorrowVariable(const TomorrowVariable *variable) (defined in TomorrowVariable)TomorrowVariableinline
type() constVariableinlinevirtual
uncertainty() const (defined in KnownVariable)KnownVariablevirtual
unit() const (defined in KnownVariable)KnownVariablevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~DynamicVariable() (defined in DynamicVariable)DynamicVariablevirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~KnownVariable() (defined in KnownVariable)KnownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-2.8.2/docs/reference/html/classNumberPrefix-members.html0000644000175000017500000001701213401033110022675 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
NumberPrefix Member List

This is the complete list of members for NumberPrefix, including all inherited members.

l_name (defined in Prefix)Prefixprotected
longName(bool return_short_if_no_long=true, bool use_unicode=false) constPrefix
name(bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constPrefix
NumberPrefix(const Number &nr, string long_name, string short_name="", string unicode_name="")NumberPrefix
o_number (defined in NumberPrefix)NumberPrefixprotected
Prefix(string long_name, string short_name="", string unicode_name="")Prefix
s_name (defined in Prefix)Prefixprotected
setLongName(string long_name)Prefix
setShortName(string short_name)Prefix
setUnicodeName(string unicode_name)Prefix
setValue(const Number &nr)NumberPrefix
shortName(bool return_long_if_no_short=true, bool use_unicode=false) constPrefix
type() constNumberPrefixvirtual
u_name (defined in Prefix)Prefixprotected
unicodeName(bool return_short_if_no_uni=true) constPrefix
value(const Number &nexp) constNumberPrefixvirtual
value(int iexp) constNumberPrefixvirtual
value() constNumberPrefixvirtual
~NumberPrefix() (defined in NumberPrefix)NumberPrefix
~Prefix() (defined in Prefix)Prefixvirtual
libqalculate-2.8.2/docs/reference/html/doc.png0000644000175000017500000000135213401033110016176 00000000000000‰PNG  IHDRÚ}\ˆ±IDATxíMOS[…Ÿžsúa?-XZ(PD4‚ AWbu`b 77wäHFÆCËÔÂÿà/`vo„ˆAPòq‹P @ ­ûÝè980 îà¤+»§Ýy×^ïZï9SW¹\83g‰3'°Nâçl¹¸_b¯p ïåûÆVÜÖ¡€Ÿ×"¬Ö†X€d]Ðà3“ÉÃÄÌ™xŸ ßMàœ[<çSPkvc—hÈ'…™˜^Åm™hØ7 `Û™¦ èÀåráq›‘œ¾!daeKŸþÆÕ˜:Ì*³_דâèi?I–eP*B7Ÿ¿åô!¹Ýgr6Ër6oKbëþãðôrI”ËTˆüªŒ¨xóö=›ù¢&‰(e+ßóÄkýÇ`ëÁÜb.“¸ÐW×w0¥°jÑzN™¬|©WEãµ¢a¯6[öX†AkÓù*/œ¨‰€ÉY­ ÿV’§–u²jÂ>1W *½·°PGŽzÿ¨/Eg{ ŸÇâaoŠÁVú:è¿™¤1$ôR§W,–ªà¨@ŠË56¾ÀÔÜ-¾,mê¸Î/æè¹– òr5¥T*S(Vf8ö9u’ Õ£w›ùóa=Í<{Ò¡UŒ÷r¯+ÉådDÏF$è°…£é¿`zþ»ÎúöN‘µÜ®0Q3£~_^Ëóâ¯N=ˆvpTà±LžT}ˆîkq†Òm<¼ÎÓ?Zh¿X£ï_þÝ¥[)ƒ `gêÃa_Ô*äÔ2`'=õ´Fÿ2EâÁPú ÷»›l=8‹Wv°%THqÉ¿<"¤ïG¾ÆxH{#ÆÖ«aÔJÕÞ‡—m‹„ çñKsÿàñVŠØ¡°·MâÒ^ TÁ– Ý›r¥ß½ømüÿ_™?ªWİ÷#uIEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_m.html0000644000175000017500000000613013401033110020134 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- m -

libqalculate-2.8.2/docs/reference/html/structPrintOptions-members.html0000644000175000017500000003773213401033110023171 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
PrintOptions Member List

This is the complete list of members for PrintOptions, including all inherited members.

abbreviate_namesPrintOptions
allow_factorizationPrintOptions
allow_non_usablePrintOptions
basePrintOptions
base_displayPrintOptions
binary_bitsPrintOptions
can_display_unicode_string_argPrintOptions
can_display_unicode_string_functionPrintOptions
comma() constPrintOptions
comma_signPrintOptions
custom_time_zonePrintOptions
date_time_formatPrintOptions
decimalpoint() constPrintOptions
decimalpoint_signPrintOptions
digit_groupingPrintOptions
division_signPrintOptions
excessive_parenthesisPrintOptions
exp_to_rootPrintOptions
halfexp_to_sqrtPrintOptions
hide_underscore_spacesPrintOptions
improve_division_multipliersPrintOptions
indicate_infinite_seriesPrintOptions
interval_displayPrintOptions
is_approximatePrintOptions
limit_implicit_multiplicationPrintOptions
lower_case_ePrintOptions
lower_case_numbersPrintOptions
max_decimalsPrintOptions
min_decimalsPrintOptions
min_exp (defined in PrintOptions)PrintOptions
multiplication_signPrintOptions
negative_exponentsPrintOptions
number_fraction_formatPrintOptions
place_units_separatelyPrintOptions
prefixPrintOptions
preserve_formatPrintOptions
preserve_precisionPrintOptions
PrintOptions() (defined in PrintOptions)PrintOptionsinline
restrict_fraction_lengthPrintOptions
restrict_to_parent_precisionPrintOptions
round_halfway_to_evenPrintOptions
short_multiplicationPrintOptions
show_ending_zeroesPrintOptions
sort_optionsPrintOptions
spaciousPrintOptions
spell_out_logical_operatorsPrintOptions
time_zonePrintOptions
twos_complementPrintOptions
use_all_prefixesPrintOptions
use_denominator_prefixPrintOptions
use_max_decimalsPrintOptions
use_min_decimalsPrintOptions
use_prefixes_for_all_unitsPrintOptions
use_prefixes_for_currenciesPrintOptions
use_reference_namesPrintOptions
use_unicode_signsPrintOptions
use_unit_prefixesPrintOptions
libqalculate-2.8.2/docs/reference/html/classDateArgument-members.html0000644000175000017500000003414513401033110022655 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
DateArgument Member List

This is the complete list of members for DateArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constDateArgumentvirtual
DateArgument(string name_="", bool does_test=true, bool does_error=true) (defined in DateArgument)DateArgument
DateArgument(const DateArgument *arg) (defined in DateArgument)DateArgument
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constDateArgumentvirtual
Argument::parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constDateArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constDateArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constDateArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constDateArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~DateArgument() (defined in DateArgument)DateArgumentvirtual
libqalculate-2.8.2/docs/reference/html/classUnitArgument-members.html0000644000175000017500000003411713401033110022716 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
UnitArgument Member List

This is the complete list of members for UnitArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constUnitArgumentvirtual
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constUnitArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constUnitArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constUnitArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constUnitArgumentvirtual
UnitArgument(string name_="", bool does_test=true, bool does_error=true) (defined in UnitArgument)UnitArgument
UnitArgument(const UnitArgument *arg) (defined in UnitArgument)UnitArgument
zeroForbidden() constArgument
~Argument()Argumentvirtual
~UnitArgument() (defined in UnitArgument)UnitArgumentvirtual
libqalculate-2.8.2/docs/reference/html/folderclosed.png0000644000175000017500000000115013401033110020072 00000000000000‰PNG  IHDRÚ}\ˆ/IDATxí]MOÔ@~ÚúuØlp]ö¿#›Å]PYECˆ\9ù¼yÑß`ÖÄÿàÿÀÉxóâ¢C &=qÐÄ£—vZçv¶3m؃‡vžLûNç}Þ÷}Þ½ZA@n° OäNp ’xóþK°ññ€xÜj”°8sÑ€“ “€œ_¼[Âíæ§ïD'‚•yye+ø¼û 7#rNŸlïük* ¾0Ь_d«_(àñÖ±àôz=ñxõv§÷h©‰z¹€šØP-äóä’̪uý¼$»\DãJc—B4¯ãÝÖ.:£Ï-ÑÏß}µŠLEíºþ #—ûáºÀÏgN;BŠ€6ïýñ䬜…ö@’Ðåñp&™h>p9¤™EEά¨ÎÊ‘" u¥n€$R"?{¹<˜…ë…%PNtâ$‰ß¶±úá+^<é"§2 ªDq”q´\¬«Ò™a–Œ‘©Aÿ€"Ôµ ™êŸèP£}#Eàz{û.8i îp³ê(ADwD¦E<ê¬cE¦$ HdÊÄ ”.:Ù GŽ-`ŒL‚ý¾'¢‰Ä<¤CIª½;ÙÇTZd±i};>èôß‚z×;K×§8t ¤Ž q”:uvÿv•Ý›¬²ÙvEân{„M·FXg¼ÌfZÖ¨°¹‰*›ßÌß©±ù©:›j–YqèÜë#3çÏSøWøÿÿÑr'ø Ôùù‚ ©¡IEND®B`‚libqalculate-2.8.2/docs/reference/html/classUserFunction.html0000644000175000017500000023675613401033110021305 00000000000000 libqalculate-2.8.2: UserFunction Class Reference
libqalculate-2.8.2

A user defined mathematical function. More...

#include <Function.h>

Inheritance diagram for UserFunction:
MathFunction ExpressionItem

Public Member Functions

 UserFunction (string cat_, string name_, string formula_, bool is_local=true, int argc_=-1, string title_="", string descr_="", int max_argc_=0, bool is_active=true)
 
 UserFunction (const UserFunction *function)
 
void set (const ExpressionItem *item)
 
ExpressionItemcopy () const
 
string formula () const
 
string internalFormula () const
 
int calculate (MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)
 
void setFormula (string new_formula, int argc_=-1, int max_argc_=0)
 
void addSubfunction (string subfunction, bool precalculate=true)
 
void setSubfunction (size_t index, string subfunction)
 
void delSubfunction (size_t index)
 
void clearSubfunctions ()
 
size_t countSubfunctions () const
 
void setSubfunctionPrecalculated (size_t index, bool precalculate)
 
const string & getSubfunction (size_t index) const
 
bool subfunctionPrecalculated (size_t index) const
 
int subtype () const
 
- Public Member Functions inherited from MathFunction
 MathFunction (string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true)
 
 MathFunction (const MathFunction *function)
 
virtual int type () const
 
string example (bool raw_format=false, string name_string="") const
 
void setExample (string new_example)
 
bool testArgumentCount (int itmp)
 
virtual MathStructure calculate (const string &eq, const EvaluationOptions &eo=default_evaluation_options)
 
virtual MathStructure parse (const string &eq, const ParseOptions &po=default_parse_options)
 
virtual int parse (MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options)
 
virtual MathStructure calculate (MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options)
 
string condition () const
 
string printCondition ()
 
void setCondition (string expression)
 
bool testCondition (const MathStructure &vargs)
 
int args () const
 
int minargs () const
 
int maxargs () const
 
int args (const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)
 
size_t lastArgumentDefinitionIndex () const
 
ArgumentgetArgumentDefinition (size_t index)
 
void clearArgumentDefinitions ()
 
void setArgumentDefinition (size_t index, Argument *argdef)
 
int stringArgs (const string &str, vector< string > &svargs)
 
void setDefaultValue (size_t arg_, string value_)
 
const string & getDefaultValue (size_t arg_) const
 
void appendDefaultValues (MathStructure &vargs)
 
MathStructure produceVector (const MathStructure &vargs, int begin=-1, int end=-1)
 
MathStructure produceArgumentsVector (const MathStructure &vargs, int begin=-1, int end=-1)
 
virtual bool representsPositive (const MathStructure &, bool=false) const
 
virtual bool representsNegative (const MathStructure &, bool=false) const
 
virtual bool representsNonNegative (const MathStructure &, bool=false) const
 
virtual bool representsNonPositive (const MathStructure &, bool=false) const
 
virtual bool representsInteger (const MathStructure &, bool=false) const
 
virtual bool representsNumber (const MathStructure &, bool=false) const
 
virtual bool representsRational (const MathStructure &, bool=false) const
 
virtual bool representsNonComplex (const MathStructure &, bool=false) const
 
virtual bool representsReal (const MathStructure &, bool=false) const
 
virtual bool representsComplex (const MathStructure &, bool=false) const
 
virtual bool representsNonZero (const MathStructure &, bool=false) const
 
virtual bool representsEven (const MathStructure &, bool=false) const
 
virtual bool representsOdd (const MathStructure &, bool=false) const
 
virtual bool representsUndefined (const MathStructure &) const
 
virtual bool representsBoolean (const MathStructure &) const
 
virtual bool representsNonMatrix (const MathStructure &) const
 
virtual bool representsScalar (const MathStructure &) const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Attributes

string sformula
 
string sformula_calc
 
vector< string > v_subs
 
vector< bool > v_precalculate
 
- Protected Attributes inherited from MathFunction
MathFunction_p * priv
 
int argc
 
int max_argc
 
vector< string > default_values
 
size_t last_argdef_index
 
string scondition
 
string sexample
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Additional Inherited Members

- Protected Member Functions inherited from MathFunction
bool testArguments (MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromVArgs (const MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromSVArgs (vector< string > &svargs)
 

Detailed Description

A user defined mathematical function.

User functions are functions defined using expression strings, representing mathematical formulas.

The expression/formula of a function is basically a normal expression with placeholders for arguments. These placeholders consists of a backslash and a letter — x, y, z for the 1st, 2nd and 3rd arguments and a to u for argument 4 to 24. They are replaced by entered arguments when a function is calculated. The placeholders naturally also decide the number of arguments that a function requires. For example the function for triangle area ("base * height / 2") has the name triangle and the formula "(\x*\y)/2", which gives that "triangle(2, 3)" equals "(2*3) / 2" and returns "3" as result. An argument can be used more than one time and all arguments must not necessarily be in order in the formula.

Additionally, optional arguments can be put in the formula with upper-case (X, Y, Z, ...) instead of lower-case letters (x, y, z, ...). The default value can be put in brackets after the letter (ex. "\X{2}"). The default value may be omitted and is then zero. All additional arguments after an optional argument must also be optional.

To simplify the formula and make it more efficient, subfunctions can be used. These works just like the main formula, using the arguments of it. Subfunctions are referenced in the formula using ('\2', '\2', '\3', ...). Even though it would be quite meaningless, the formula for triangle function could for example have a subfunction "\x*\y" and the formula "\1/2". Subfunctions must be added before the main formula is set.

Member Function Documentation

◆ calculate()

int UserFunction::calculate ( MathStructure mstruct,
const MathStructure vargs,
const EvaluationOptions eo 
)
virtual

The main function for subclasses to reimplement. Calculates a value from arguments in vargs and puts it in mstruct.

This function expects the number of arguments to be equal to the maximum number of arguments, and checked by the argument definitions.

If the return value is negative, then argument -(return value) has been evaluated in mstruct. If -(return value) is greater than max arguments, then mstruct is a vector of evaluated argument values.

Parameters
[out]mstructStructure that is set with the result of the calculation.
vargsArguments passed to the mathematical function.
eoEvaluation options.
Returns
1 if the calculation was successful.

Reimplemented from MathFunction.

◆ formula()

string UserFunction::formula ( ) const

Returns the external representation of the formula.

◆ internalFormula()

string UserFunction::internalFormula ( ) const

Returns the internal representation of the formula.

◆ setFormula()

void UserFunction::setFormula ( string  new_formula,
int  argc_ = -1,
int  max_argc_ = 0 
)

Sets the formula of the mathematical function.

Parameters
new_formulaFormula/expression.
arc_Minimum number of arguments or -1 to read from formula.
max_argc_Maximum number of arguments (ignored if argc_ < 0)

◆ setSubfunction()

void UserFunction::setSubfunction ( size_t  index,
string  subfunction 
)

Sets the formula for a subfunction.

Parameters
indexIndex (starting at 1).
subfunctionFormula/expression.

◆ subtype()

int UserFunction::subtype ( ) const
virtual

Returns the subtype of the mathematical function, corresponding to which subsubclass the object belongs to.

Returns
FunctionSubtype.

Reimplemented from MathFunction.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/functions_func_p.html0000644000175000017500000001434513401033110021161 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- p -

libqalculate-2.8.2/docs/reference/html/structEvaluationOptions-members.html0000644000175000017500000002252113401033110024172 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
EvaluationOptions Member List
libqalculate-2.8.2/docs/reference/html/functions_c.html0000644000175000017500000002167013401033110020130 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- c -

libqalculate-2.8.2/docs/reference/html/functions_f.html0000644000175000017500000000555413401033110020136 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- f -

libqalculate-2.8.2/docs/reference/html/classKnownVariable.html0000644000175000017500000021304213401033110021402 00000000000000 libqalculate-2.8.2: KnownVariable Class Reference
libqalculate-2.8.2

A variable with a known value. More...

#include <Variable.h>

Inheritance diagram for KnownVariable:
Variable ExpressionItem DynamicVariable NowVariable PrecisionVariable TodayVariable TomorrowVariable YesterdayVariable

Public Member Functions

 KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable ()
 
 KnownVariable (const KnownVariable *variable)
 
virtual ExpressionItemcopy () const
 
virtual void set (const ExpressionItem *item)
 
bool isKnown () const
 
virtual bool isExpression () const
 
virtual string expression () const
 
virtual string uncertainty () const
 
virtual string unit () const
 
int subtype () const
 
virtual void set (const MathStructure &o)
 
virtual void set (string expression_)
 
virtual void setUncertainty (string standard_uncertainty)
 
virtual void setUnit (string unit_expression)
 
virtual const MathStructureget ()
 
virtual bool representsPositive (bool=false)
 
virtual bool representsNegative (bool=false)
 
virtual bool representsNonNegative (bool=false)
 
virtual bool representsNonPositive (bool=false)
 
virtual bool representsInteger (bool=false)
 
virtual bool representsNonInteger (bool=false)
 
virtual bool representsFraction (bool=false)
 
virtual bool representsNumber (bool=false)
 
virtual bool representsRational (bool=false)
 
virtual bool representsReal (bool=false)
 
virtual bool representsNonComplex (bool=false)
 
virtual bool representsComplex (bool=false)
 
virtual bool representsNonZero (bool=false)
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
virtual bool representsNonMatrix ()
 
virtual bool representsScalar ()
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Attributes

MathStructuremstruct
 
bool b_expression
 
int calculated_precision
 
bool calculated_with_interval
 
bool calculated_with_units
 
string sexpression
 
string suncertainty
 
string sunit
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

A variable with a known value.

Known variables have an associated value. The value can be a simple number or a full mathematical expression. The known variable class is used both for variable values and constants.

The value can be provided as an expression in the form of a text string or as a mathematical value in the form of an object of the MathStructure class. The text string is parsed when needed, which saves time when loading many variable definitions which might not be used, at least not immediately.

Constructor & Destructor Documentation

◆ KnownVariable() [1/4]

KnownVariable::KnownVariable ( string  cat_,
string  name_,
const MathStructure o,
string  title_ = "",
bool  is_local = true,
bool  is_builtin = false,
bool  is_active = true 
)

Create a known variable with a value.

Parameters
cat_Category that the variable belongs to.
name_Initial name of the variable.
oValue.
title_Descriptive name.
is_localIf the variable is local/user-defined or global.
is_builtinIf the variable is builtin and not modifiable.
is_activeIf the variable is active and can be used in expressions.

◆ KnownVariable() [2/4]

KnownVariable::KnownVariable ( string  cat_,
string  name_,
string  expression_,
string  title_ = "",
bool  is_local = true,
bool  is_builtin = false,
bool  is_active = true 
)

Create a known variable with an text string expression.

Parameters
cat_Category that the variable belongs to.
name_Initial name of the variable.
expression_Expression.
title_Descriptive name.
is_localIf the variable is local/user-defined or global.
is_builtinIf the variable is builtin and not modifiable.
is_activeIf the variable is active and can be used in expressions.

◆ KnownVariable() [3/4]

KnownVariable::KnownVariable ( )

Create an empty known variable. Primarily for internal use.

◆ KnownVariable() [4/4]

KnownVariable::KnownVariable ( const KnownVariable variable)

Create a copy of a known variable.

Parameters
variableKnown variable to copy.

Member Function Documentation

◆ expression()

virtual string KnownVariable::expression ( ) const
virtual

Returns the variable's string expression or an empty string if it has not got an expression.

Returns
The variable's expression.

◆ get()

virtual const MathStructure& KnownVariable::get ( )
virtual

Returns the value of the variable. If no value is set or parsed and an expression is set, the expression is parsed and resulting value returned.

Returns
The value of the variable..

Reimplemented in DynamicVariable.

◆ isExpression()

virtual bool KnownVariable::isExpression ( ) const
virtual

Returns if the variable has an text string expression instead of a value.

Returns
True if the variable has an expression instead of a value.

◆ isKnown()

bool KnownVariable::isKnown ( ) const
inlinevirtual

Returns if the variable has a known value (as oppossed to assumptions).

Returns
true if the variable is of class KnownVariable, false if UnknownVariable.

Implements Variable.

◆ representsPositive()

virtual bool KnownVariable::representsPositive ( bool  = false)
virtual

Returns if the variable represents a positive value.

Reimplemented from Variable.

Reimplemented in NowVariable, YesterdayVariable, TomorrowVariable, TodayVariable, and DynamicVariable.

◆ set() [1/2]

virtual void KnownVariable::set ( const MathStructure o)
virtual

Sets the value of the variable. If expression is set, it is cleared.

Parameters
oValue.

Reimplemented in DynamicVariable.

◆ set() [2/2]

virtual void KnownVariable::set ( string  expression_)
virtual

Sets the text string expression of the variable. The value is cleared.

Parameters
expression_Expression.

Reimplemented in DynamicVariable.

◆ subtype()

int KnownVariable::subtype ( ) const
inlinevirtual

Returns the subtype of the variable, corresponding to which subsubclass the object belongs to.

Returns
VariableSubtype.

Reimplemented from Variable.

References SUBTYPE_KNOWN_VARIABLE.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classUnit.html0000644000175000017500000020337513401033110017567 00000000000000 libqalculate-2.8.2: Unit Class Reference
libqalculate-2.8.2

A unit for measurement. More...

#include <Unit.h>

Inheritance diagram for Unit:
ExpressionItem AliasUnit CompositeUnit AliasUnit_Composite

Public Member Functions

 Unit (string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Unit (const Unit *unit)
 
virtual ExpressionItemcopy () const
 
virtual void set (const ExpressionItem *item)
 
bool isSIUnit () const
 
void setAsSIUnit ()
 
void setSystem (string s_system)
 
const string & system () const
 
bool useWithPrefixesByDefault () const
 
void setUseWithPrefixesByDefault (bool use_with_prefixes)
 
bool isCurrency () const
 
const string & countries () const
 
void setCountries (string country_names)
 
virtual string print (bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & plural (bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & singular (bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & abbreviation (bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual bool isUsedByOtherUnits () const
 
virtual UnitbaseUnit () const
 
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue) const
 
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue) const
 
virtual MathStructure convertToBaseUnit () const
 
virtual MathStructure convertFromBaseUnit () const
 
virtual int baseExponent (int exp=1) const
 
virtual int type () const
 
virtual int subtype () const
 
virtual bool isChildOf (Unit *u) const
 
virtual bool isParentOf (Unit *u) const
 
virtual bool hasComplexRelationTo (Unit *u) const
 
bool convert (Unit *u, MathStructure &mvalue, MathStructure &exp) const
 
bool convert (Unit *u, MathStructure &mvalue) const
 
MathStructure convert (Unit *u, bool *converted=NULL) const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Attributes

string ssystem
 
string scountries
 
bool b_si
 
bool b_use_with_prefixes
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

A unit for measurement.

The Unit class both represents a base unit and is the base class for other unit types. Base units are units defined as basis for other units. Meters and seconds are typical base units.

For base units, a name is all that is needed. Base units do however normally have three different names defined for use in expressions - abbreviation (ex. "m"), singular ("meter") and plural ("meters").

Member Function Documentation

◆ convert() [1/2]

bool Unit::convert ( Unit u,
MathStructure mvalue,
MathStructure exp 
) const

Converts a value from specified unit and exponent to this unit. value * (unit^exponent) = new value * (this^new exponent) This function cannot convert to or from CompositeUnit.

Parameters
uUnit to convert from.
[in,out]mvalueQuantity value.
[in,out]expExponent.
Returns
true if the value was successfully converted.

◆ convert() [2/2]

bool Unit::convert ( Unit u,
MathStructure mvalue 
) const

Converts a value from specified unit and exponent to this unit. value * unit = new value * this This function cannot convert to or from CompositeUnit.

Parameters
uUnit to convert from.
[in,out]mvalueQuantity value.
Returns
true if the value was successfully converted.

◆ isChildOf()

virtual bool Unit::isChildOf ( Unit u) const
virtual

If specified unit is a base unit for this unit, directly or with other units in between. Equivalent to u->isParentOf(this).

Reimplemented in AliasUnit.

◆ isCurrency()

bool Unit::isCurrency ( ) const

Returns if the unit is a currency (Euro is base unit).

Returns
true if the unit is a currency.

◆ isParentOf()

virtual bool Unit::isParentOf ( Unit u) const
virtual

If this unit is a base unit for specified unit, directly or with other units in between. Equivalent to u->isChildOf(this).

Reimplemented in AliasUnit.

◆ isSIUnit()

bool Unit::isSIUnit ( ) const

Returns if the unit is part of the SI standard.

Returns
true if the unit is part of the SI standard.

◆ print()

virtual string Unit::print ( bool  plural_,
bool  short_,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const
virtual

Returns a display string representing the unit in an expression.

Equivalent to preferredName() for Unit and AliasUnit, but closer to MathStructure::print() for CompositeUnit (prints out base expression).

Reimplemented in CompositeUnit, and AliasUnit_Composite.

◆ setAsSIUnit()

void Unit::setAsSIUnit ( )

State that the unit is part of the SI standard. Sets system to "SI".

◆ setSystem()

void Unit::setSystem ( string  s_system)

Sets which system/standard ("SI", "CGS", etc.) the unit is part of. Setting system to "SI" (case-insensitive), is equivalent to setAsSIUnit().

◆ setUseWithPrefixesByDefault()

void Unit::setUseWithPrefixesByDefault ( bool  use_with_prefixes)

Sets wether prefixes are approriate with this unit or not.

◆ subtype()

virtual int Unit::subtype ( ) const
virtual

Returns the subtype of the unit, corresponding to which subsubclass the object belongs to.

Returns
UnitSubtype.

Implements ExpressionItem.

Reimplemented in CompositeUnit, and AliasUnit.

◆ system()

const string& Unit::system ( ) const

Returns the system/standard that the unit is part of.

Returns
System string.

◆ type()

virtual int Unit::type ( ) const
virtual

Returns the type of the expression item, corresponding to which subclass the object belongs to.

Returns
ExpressionItemType.

Implements ExpressionItem.

◆ useWithPrefixesByDefault()

bool Unit::useWithPrefixesByDefault ( ) const

Returns wether prefixes should be used with this unit or not.

Returns
true if the prefixes is appropriate for this unit.

The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classArgumentSet-members.html0000644000175000017500000003656713401033110022545 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
ArgumentSet Member List

This is the complete list of members for ArgumentSet, including all inherited members.

addArgument(Argument *arg) (defined in ArgumentSet)ArgumentSet
alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
ArgumentSet(string name_="", bool does_test=true, bool does_error=true) (defined in ArgumentSet)ArgumentSet
ArgumentSet(const ArgumentSet *arg) (defined in ArgumentSet)ArgumentSet
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constArgumentSetvirtual
countArguments() const (defined in ArgumentSet)ArgumentSet
delArgument(size_t index) (defined in ArgumentSet)ArgumentSet
getArgument(size_t index) const (defined in ArgumentSet)ArgumentSet
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constArgumentSetvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subargs (defined in ArgumentSet)ArgumentSetprotected
subprintlong() constArgumentSetprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constArgumentSetprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constArgumentSetvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~ArgumentSet() (defined in ArgumentSet)ArgumentSetvirtual
libqalculate-2.8.2/docs/reference/html/structParseOptions-members.html0000644000175000017500000001464613401033110023146 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
ParseOptions Member List
libqalculate-2.8.2/docs/reference/html/classDecimalPrefix.png0000644000175000017500000000070213401033110021171 00000000000000‰PNG  IHDRZP®í’VPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2QIDATxír„ E_>3{ÿ#wE… ØuÚM;Æù4Â#@)¥Ä˜"IN´$¯ßCÛòHôŒœb’tð+tk1Izá»èšhÝÁÚL•ät]yÕ½û<ÿ»µÞx]W“¤+ßɺg¾#=¼~» GtËú=ÇØÏ³ÖàMhIúª-É+Ñ’¼bÑ¥”b€û~Ä8ýx„±ãÐOr;ýGoH¢A‰¼ x%ðJ4à•hÀ+Ñ€×@›™Åˆp¢¯Ÿ@¯g 0xš>^‰Ž¾Œ^ГÁç¥tm·„Ö®r¬‡ö±ÛöÆ/zF»Ùk·l´á·POc6á*kŸ˜“ûÞk½ vóêjWèuÚ Ýþ´ºîÑ›èáT ¼Æ-tÞü´ çýx]¡Ûßé1¶«z¾!® î¾ô„ö‘h€÷:Ñ€W¢¯X´™Yˆ?ŠN¿}’IEND®B`‚libqalculate-2.8.2/docs/reference/html/classTextArgument-members.html0000644000175000017500000003413713401033110022725 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
TextArgument Member List

This is the complete list of members for TextArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constTextArgumentvirtual
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constTextArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constTextArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constTextArgumentprotectedvirtual
suggestsQuotes() const (defined in TextArgument)TextArgumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
TextArgument(string name_="", bool does_test=true, bool does_error=true) (defined in TextArgument)TextArgument
TextArgument(const TextArgument *arg) (defined in TextArgument)TextArgument
type() constTextArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~TextArgument() (defined in TextArgument)TextArgumentvirtual
libqalculate-2.8.2/docs/reference/html/functions_func_h.html0000644000175000017500000000535613401033110021153 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- h -

libqalculate-2.8.2/docs/reference/html/classArgument.png0000644000175000017500000001501613401033110020243 00000000000000‰PNG  IHDR6Ћà§-PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2IDATxíÝévâJá tïÿÈ×´±ÙÙ }AdaTb†oªTÙív»× à¥{Éÿ…eˆ+@\ÙâÊ·M¶ôžø¿c“l»ô¦²-ÙÇÝñïñ›¦÷_§§¾Ç÷¿m‹l'¢ƒØ nb;8­>O¿mÛlsóa†Z~Ý&Ù¾ÿýÄvS¶³d·fÛú*À¯û¶õ#®‹à²5Ûi ˜w‚ë´“N¢¿n‹Ï6€Uÿ‘›g›fÀÃÚþl;íªë#)Àc+@\ÙâÊW6€¸7`Ûív»— àSÚ4€¤²¤í÷u+@Ú—ZݲÊð ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqOa†ax½ÕsØT_­²©Æ•M5®lªqeSÛÛNõ¬Õ¹kToõãø-°í®ýÌå©«ToõIl_‡ãñðùûíîxbb;^˜/gŽwO}ÆûT¯·¶“Àñ_Ó»UÓùÛÁiõy‚T½Õ–ØÆ 4é]°Ýµúü1lßÿ®‚ŒNÇ»lÇ1ÿÛ~¿ß?<Õ;­ë³m9à§Ù¶¾ªz³÷ŸmWØÖ϶ ¶õ#îCé9ÛÅNºf;]žG]Œ=‰ªÞlÏ6Õ³~øÕ?N&Õ»mmž`ªýpYõmp¶¶MÕkýpYõç¶¹HUŸZÙTãʦW6Õ¸²©Æ½Û0 ÃËð¨žÂ°íÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@ÜS؆a^/€Gõ6ÕW«lªqeS+›j\ÙTã6ŶS ú¿ûú—ÖØv©Û×ðÃómŸÌv8~Í¡“Êá0 æÖ×çÃôáÂjæ©ÞjCl'¢ƒØ nb;8­>OŸFêyò©þÐ&ÙÖ ;]¾Î'¸fŸî÷ØŽcÎÖTê±lûý~ÿðTÑj±Ý›m««£óâ‚êOmg¶]°­q7é’í#éší´Ì;Á´œÃŽ+ûxáóvRÕU¿:ªa[e›fêãÛìl;­=Õ'´åEªú¤Ê¦W6Õ¸²©Æ•M5î Ø†a^.€Gõ6€mW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâžÂ6 Ãðz<ªç°©¾ZeS+›j\ÙTãʦ÷Îl»ïª«.Ïüæ’êE·Ç¿5ÛÕŸvû·îR·³&ÝñpåÄiNŽl‡ã×¹ï¿Ç¦÷«[®Íå ±M¿}<œ˜ßŽ4çç¿ WŒó÷¨^¶…gÛ-¶µê‚íÆ=×þP½Ò6gÛèy8,VîiíÞa[Ýò¯Øöûýþá©^íî"½F£îÖ]›m뫪—}³íÛú÷A‹tZuwvÒãöyÁvÚæ`ÄZ=-7¹“ªþM·'“êÝ>•m±Ùª¦}ìl;­cÕ?è“©êV6Õ¸²©Æ•M5®lªqoÀ6 Ãðr<ª§°l»²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊ÷¶a†× àQ=‡MõÕ*›j\ÙTãʦW6Õ¸7dÛ}ÿ[~>»¶8·¼´8qqZõN—ãß‘íì—œ¿ýþs æ4 tÛÛç{jÍsìKf<1οå°ñ+§ŽãÇÛFÚqät—:¿Þ™mú­‹wã¥éüâÒ|i–cGÃãüêâõÖ³íkõî†è‚mn5þ*¶ºx½û"Ûôî‚áüÒ¼¥Üc[|õóÙöûýþᩫׯéêҕɹœv7fÛúªºx½óNzÁ¶¸t{¹]°­qÛ]¤ã";lqóf7/Ö›;éé¶/ÌfóýGQuñzC6Õ_v9MTÏûÝ(u~}:Û4ëTߦÙ~ã1.xÕß·íÙ¦ú”ʦW6Õ¸²©Æ•M5î Ø†a^.€Gõ6€mW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâžÂ6 Ãðz<ªç°©¾ZeS+›j\ÙTãʦ÷Vl»ï‹ÿñóûó+ªWZ ùÅxu~-Ç¿ÛÙÿúÛïÖæ¡Û{³þæÖügf;`ŒçŽð4¿?~½[Œ¿îpÇáïñÚô~õE«éüžlÓï[¼=çs«'¾ÓùÕkÆùÎ7Ÿm ¬Ó/›æÔŠòÒé’íÚÿŸlƒí¨´~7_\ÿÚ“èz†þ=ÎÀù¿æ™lûý~ÿð~½Ho϶õ•i¢Ý˜‰«Ù¶¾úÞ;éïØ®?Ìn°­qÛZ¤ãÂ:lkó7nŠóSþêNzD™ñ×ûÂéúÚlµ¼ßu'Uý}ËÙñ‹ó·†«^ôyl×NÏËVõ}۳˨úCfS}VeS+›j\ÙTãʦ÷lÃ0 /À£z À¶+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqOa†ax½ÕsØT_­²©Æ•M5®lªqeSÛÛîûßòóê¢jÐoÆo„íìç® C·c;ü=̺ùÏ‚ípü:÷ý÷8xzûõyqŸêÍ6Æ6¸ÓUG’é0®ç;UïµµÙv‡mn…»úü©lǽá¸ÖŽ+oÜ-î±Mwý?lûý~ÿðTèÆ"]ƒÞŸm뫪÷ÚØNzñl»`[?â>|‘Ž+ñ°.wÄ5Ûi ˜w‚k{U½×6ØTÛo&“êÝ>‹mžªчͶq-«þMŸ·HUÿº²©Æ•M5®lªqeS{¶a†— àQ=… `Û• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸§° Ã0¼^ê9lª¯VÙTãʦW6Õ¸²©Æ½ ÛîðOõ]Œû:qýÞß~ãÙø÷aSýãn±íÒï}S¶ÃáûÇgÞágŸfáâï¡Ó»é0<Þ´b;}Ïxáp-¿hœðo7ÛŽ?æðNHÓïtçêµx~î(45 »2èâ‹ÞóÙ6O§uã´Y¬É+¦îœ_ ¶õ÷ìtù:;¼å³í’mé9]¾Šp¹à·™{lÓMOcÛï÷û‡wu‘žÑ-Çܘ$óo>û|eÖîtùZŒzó-á’n§g¯éÛú·‰Ez\,;é´ÕÝÚIW»Èb _°MûĸÌ+y ûNlêâ5/LÕÇõÛï-Ûê;˦šuZìª?õ¦lªÿgeS+›j\ÙTãʦ÷lÃ0 /À£z À¶+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqOa†ax½ÕsØT_­²©Æ•M5®lªqeSÛ Ûîðïëxx-ΫýrüfØ®ÿò]êö¡l§Ùv˜y ¶ÃñëÜxy"Ûz¶ˆ§ã]¶i/ùߨöûýþá©þØå"NžM½k³m}Uõ‡6ýl»`[?âºH¯ï¤k¶Ó0ïcO¢ª?´6Õ_ôËɤz·b›çŸêßõI³í´«ªþm¶HUQÙTãʦW6Õ¸²©Æ½Û0 ÃËð¨žÂ°íÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@ÜS؆a^/€Gõ6ÕW«lªqeS+›j\ÙTãÞ—mwø§z¥¯ó×.Ý®z­›ãߘMõV×/îR· ³}“ë8õ3ðûÏáüáÜxib;Cæ»O߸¼åölÞÛñwO ËóÛ‘æüü·áŠqþÕ‹ÞüÙ¶œmËznxÆví¶k·|Â"ý™mÜCî±Çü[¶ý~¿xªWŠÙÆçÚ³m}Uõ¢M̶³ùqwÅ-ÉV¸[¤ëgù¸®wÒ+lówί³[¶·“ªþe7'“êÝ>–mšuªqŸ;ÛN»ªjÞG/RÕ?«lªqeS+›j\ÙTãÞ€m†áåxTOaØveˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• î)lÃ0 ¯À£z›ê«U6Õ¸²©Æ•M5®lªqoζ»òNõ²Ÿ®««×ýñŸÂ¶KݶÎöòýwúó}8üèñÓñÃÉáp<8ž>9Þw9•êµ6ÀvüÕK‡ñÜIo|s"=ðm¸bœ¿Lõz[˜m—l‹ÃIëüÍùWoW½Þ¦Ø¾ÿ-f͸èŽëo\²·ÙÖ·«Þì±lûý~ÿðTou1ÛÖ*«‰¶š7fÛåíª—ms‘®žmר֏O^¤·wÒs¶y€;ç×´“Nß§z½7gS½Öý¹ò›ª·Û Û<½T¯ôãÕûmq¶V§êõ~ z·.RÕgV6Õ¸²©Æ•M5®lªqoÀ6 Ãðr<ª§°l»²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊ÷¶a†× àQ=‡MõÕ*›j\ÙTãʦW6Õ¸·gÛ¯Y¿Wý©ŸÆ¿?Ûñž7~ò.uû(¶Ý÷ßãŸÓN#Ûáøuý0âÐôþxß÷çñ;ToµE:¹LGÅé55^ >8­>Oª7ÚÛin-¡Ž³ff››+ÞÅAõV[ØæÙrZ lÇ ÷ÙV7ÿ[¶ý~¿xª·[°­AÜ9¿Ôݺk³m}UõV[˜mWØbáÎÛÁÅl§Ëׇ-ÒÅ’<ìŸÓ¯¿ÊvÚæ`^ákXÕ[½=›jÜO“IõnŸÇ6Í:Õ?ígÛiWUýã>s‘ªþUeS+›j\ÙTãʦ÷lÃ0 /À£z À¶+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqOa†ax½ÕsØT_­²©Æ•M5®lªqeS{k¶Ýâ¯:¿®œºyVõzwÆ¿7Ûá‡ý–m—ºm–íð˾šÓû“è{:9ßõuáÊ}§Ž·ŸnV½h[l‡ß{|³8}4›.^»oú¡ß|‘®Ø¿óøf¥±ø05 Z œîŸ>_¬ðl ã|rçêu•mA¼2üñ~Õ‹Þ{'½=³®³ÛÈ=¶ã˜ʶßï÷Oõ²ÅÏÿ-ÛjUß›m뫪ç½ÿNzÎv®ÉÎoù€E:.¸ p|ÝÜI×l§-`Þ .ÆžDUÏ{ïgÛbí©Æýñ­ïÏö§?}žªaoÏöçsm\äªiX¤ªÿº²©Æ•M5®lªqeS{¶a†— àQ=… `Û• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸§° Ã0¼^ê9lª¯VÙTãʦW6Õ¸²©Æmƒmwü§.^Çg'Uïö»ñ›™m—?÷pf—º}$ÛaÊ½Ž³od;¿Îœ.‹¡Ç‡!¿rÛÛ$²àiŽçl§Õç Rõn›d;œ±­PݹzTï·1¶qiÎ~§Uwí8ædÛï÷û‡§úsÎù:Õ«®Í¶õUÕûmq‘Î[èÛú×Ez¹“žøgûÂi ¯Í–ÂÛIUÑï&“êÝ>‰mšuª×GͶӮªú—}Ú"U}@eS+›j\ÙTãʦ÷lÃ0 /À£z À¶+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqOa†ax½ÕsØT_­²©Æ•M5®lªqeSÛ Ûnú3~<~˜O©þÜ/Ço”m>º}(Û—Ó÷ÛïÃéxºü}íøw8Þ5Ý1¾W½ßæØŽ3ÏH³¼:®ç»Th{³í:ÛÜjÄêsÙÆwßÿ~b;Žù?Ùöûýþá©þØU¶y3ýa¶­¯ªþЦgÛÛú×Ez\k«Is|àŸí Ç•ëÎù5í¤“¨êm†Mõç~9™TïöAlÓ¬SýË>i¶vUÕ¿íéê#*›j\ÙTãʦW6Õ¸7`†ax¹ÕSض]ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ{ Û0 Ãëð¨žÃ¦új•M5®lªqeS+›jܳíÏN.Þ­®Ÿ V½ÛÍñ[c»øÉËë»Ôm‹l‡uøa»Ýñpr9~üz?8]ŸØǯsßC¦÷«›ÇûT×mmÖ9Ó§óqÓ¥Õà5ã|§êE›˜mç,+=ݹnùa5jõy³ló¢WÖ´&× ãõÓñ.Ûùͪ—=–m¿ßïžêõNlg³éÈz ùa¶­¯ª^ôÖ³í¾Äµ…·¸zÄ}Î"æÆêq~úx±“®ÙN[À¼Œ_°\ï›ÜIUÿª›“Iõn˶܆U³>w¶vUÕ¼^¤ªVÙTãʦW6Õ¸²©Æ½Û0 ÃËð¨žÂ°íÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@\ÙâÊW6€¸²Ä• ®lqeˆ+@ÜS؆a^/€Gõ6ÕW«lªqeS+›j\ÙTãÞm·ø{qúþÕÛÝÿ)l»ÔmÛl‡Ÿwø‰»Ý|˜ÿŒ`#ÛáøuáûïñÎéý醯Ïóͪ×Ú Û„0¦“ËG’é0®çÛU¯·E¶àIëü͹ðêó°ËïkUSèÛñê}¶ùþ1Û~¿ß?<Õ;l«'ùÛ¼qü0Û.¦­ê•Êðð~šmk“+϶klëGÜÿ¼HÞ/ÙV;ér3¼d;móN0b-w¸“<¼ÙTãîO&Õ»}"Û<ÿTÿ¨œm§å«ú‡}ê"Uý‹Ê¦W6Õ¸²©Æ•M5î Ø†a^®ÿQ´rÁ^ÉIEND®B`‚libqalculate-2.8.2/docs/reference/html/classThread-members.html0000644000175000017500000001115413401033110021477 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
Thread Member List

This is the complete list of members for Thread, including all inherited members.

cancel() (defined in Thread)Thread
enableAsynchronousCancel() (defined in Thread)Threadprotected
read() (defined in Thread)Threadinlineprotected
read(T *data) (defined in Thread)Threadinlineprotected
run()=0 (defined in Thread)Threadprotectedpure virtual
running (defined in Thread)Thread
start() (defined in Thread)Thread
Thread() (defined in Thread)Thread
write(T data) (defined in Thread)Threadinline
~Thread() (defined in Thread)Threadvirtual
libqalculate-2.8.2/docs/reference/html/functions_func_n.html0000644000175000017500000000504313401033110021152 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- n -

libqalculate-2.8.2/docs/reference/html/MathStructure_8h.html0000644000175000017500000001345113401033110021025 00000000000000 libqalculate-2.8.2: libqalculate/MathStructure.h File Reference
libqalculate-2.8.2
MathStructure.h File Reference
#include <libqalculate/includes.h>
#include <libqalculate/Number.h>
#include <libqalculate/QalculateDateTime.h>
#include <sys/time.h>

Classes

class  MathStructure
 A structure representing a mathematical value/expression/result. More...
 

Enumerations

enum  StructureType {
  STRUCT_MULTIPLICATION, STRUCT_INVERSE, STRUCT_DIVISION, STRUCT_ADDITION,
  STRUCT_NEGATE, STRUCT_POWER, STRUCT_NUMBER, STRUCT_UNIT,
  STRUCT_SYMBOLIC, STRUCT_FUNCTION, STRUCT_VARIABLE, STRUCT_VECTOR,
  STRUCT_BITWISE_AND, STRUCT_BITWISE_OR, STRUCT_BITWISE_XOR, STRUCT_BITWISE_NOT,
  STRUCT_LOGICAL_AND, STRUCT_LOGICAL_OR, STRUCT_LOGICAL_XOR, STRUCT_LOGICAL_NOT,
  STRUCT_COMPARISON, STRUCT_UNDEFINED, STRUCT_ABORTED, STRUCT_DATETIME
}
 Types for MathStructure.
 
enum  { MULTIPLICATION_SIGN_NONE, MULTIPLICATION_SIGN_SPACE, MULTIPLICATION_SIGN_OPERATOR, MULTIPLICATION_SIGN_OPERATOR_SHORT }
 

Functions

ostream & operator<< (ostream &os, const MathStructure &)
 
libqalculate-2.8.2/docs/reference/html/classMathStructure-members.html0000644000175000017500000040635213401033110023112 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
MathStructure Member List

This is the complete list of members for MathStructure, including all inherited members.

add(const MathStructure &o, MathOperation op, bool append=false) (defined in MathStructure)MathStructure
add(const MathStructure &o, bool append=false) (defined in MathStructure)MathStructure
add(const Number &o, bool append=false) (defined in MathStructure)MathStructure
add(int i, bool append=false) (defined in MathStructure)MathStructure
add(Variable *v, bool append=false) (defined in MathStructure)MathStructure
add(Unit *u, bool append=false) (defined in MathStructure)MathStructure
add(string sym, bool append=false) (defined in MathStructure)MathStructure
add_nocopy(MathStructure *o, MathOperation op, bool append=false) (defined in MathStructure)MathStructure
add_nocopy(MathStructure *o, bool append=false) (defined in MathStructure)MathStructure
addChild(const MathStructure &o) (defined in MathStructure)MathStructure
addChild_nocopy(MathStructure *o) (defined in MathStructure)MathStructure
addColumn(const MathStructure &mfill) (defined in MathStructure)MathStructure
addColumns(size_t c, const MathStructure &mfill) (defined in MathStructure)MathStructure
addRow(const MathStructure &mfill) (defined in MathStructure)MathStructure
addRows(size_t r, const MathStructure &mfill) (defined in MathStructure)MathStructure
adjointMatrix(const EvaluationOptions &eo) (defined in MathStructure)MathStructure
b_approx (defined in MathStructure)MathStructureprotected
b_parentheses (defined in MathStructure)MathStructureprotected
b_plural (defined in MathStructure)MathStructureprotected
b_protected (defined in MathStructure)MathStructureprotected
base() const (defined in MathStructure)MathStructure
base() (defined in MathStructure)MathStructure
calculateAdd(const MathStructure &madd, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateAddIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateAddLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseAndIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseAndLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseNot(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseOrIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseOrLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseXorIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateBitwiseXorLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateDivide(const MathStructure &mdiv, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateFunctions(const EvaluationOptions &eo, bool recursive=true, bool do_unformat=true) (defined in MathStructure)MathStructure
calculateInverse(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLimit(const MathStructure &x_var, const MathStructure &limit, const EvaluationOptions &eo_pre, int approach_direction=0) (defined in MathStructure)MathStructure
calculateLogicalAnd(const MathStructure &mand, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalAndIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalAndLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalNot(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalOr(const MathStructure &mor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalOrIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalOrLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalXor(const MathStructure &mxor, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateLogicalXorLast(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateMergeIndex(size_t index, const EvaluationOptions &eo, const EvaluationOptions &feo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateMultiply(const MathStructure &mmul, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateMultiplyIndex(size_t index, const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateMultiplyLast(const EvaluationOptions &eo, bool check_size=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateNegate(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateRaise(const MathStructure &mexp, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateRaiseExponent(const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateReplace(const MathStructure &mfrom, const MathStructure &mto, const EvaluationOptions &eo) (defined in MathStructure)MathStructure
calculatesub(const EvaluationOptions &eo, const EvaluationOptions &feo, bool recursive=true, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
calculateSubtract(const MathStructure &msub, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
childrenUpdated(bool recursive=false)MathStructure
childToFront(size_t index) (defined in MathStructure)MathStructure
childUpdated(size_t index, bool recursive=false)MathStructure
clear(bool preserve_precision=false)MathStructure
clearMatrix(bool preserve_precision=false)MathStructure
clearVector(bool preserve_precision=false)MathStructure
coefficient(const MathStructure &xvar, const Number &pownr, MathStructure &mcoeff) const (defined in MathStructure)MathStructure
cofactor(size_t r, size_t c, MathStructure &mstruct, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
columns() const (defined in MathStructure)MathStructure
columnToVector(size_t c, MathStructure &mstruct) const (defined in MathStructure)MathStructure
compare(const MathStructure &o) const (defined in MathStructure)MathStructure
compareApproximately(const MathStructure &o, const EvaluationOptions &eo=default_evaluation_options) const (defined in MathStructure)MathStructure
comparisonType() const (defined in MathStructure)MathStructure
complexToExponentialForm(const EvaluationOptions &eo) (defined in MathStructure)MathStructure
complexToPolarForm(const EvaluationOptions &eo) (defined in MathStructure)MathStructure
contains(const MathStructure &mstruct, bool structural_only=true, bool check_variables=false, bool check_functions=false, bool loose_equals=false) const (defined in MathStructure)MathStructure
containsAdditionPower() const (defined in MathStructure)MathStructure
containsDivision() const (defined in MathStructure)MathStructure
containsFunction(MathFunction *f, bool structural_only=true, bool check_variables=false, bool check_functions=false) const (defined in MathStructure)MathStructure
containsInfinity(bool structural_only=true, bool check_variables=false, bool check_functions=false) const (defined in MathStructure)MathStructure
containsInterval(bool structural_only=true, bool check_variables=false, bool check_functions=false, bool ignore_high_precision_interval=false, bool include_interval_function=false) const (defined in MathStructure)MathStructure
containsOpaqueContents() const (defined in MathStructure)MathStructure
containsRepresentativeOf(const MathStructure &mstruct, bool check_variables=false, bool check_functions=false) const (defined in MathStructure)MathStructure
containsRepresentativeOfType(StructureType mtype, bool check_variables=false, bool check_functions=false) const (defined in MathStructure)MathStructure
containsType(StructureType mtype, bool structural_only=true, bool check_variables=false, bool check_functions=false) const (defined in MathStructure)MathStructure
containsUnknowns() const (defined in MathStructure)MathStructure
convert(Unit *u, bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options, Prefix *new_prefix=NULL) (defined in MathStructure)MathStructure
convert(const MathStructure unit_mstruct, bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options) (defined in MathStructure)MathStructure
convertToBaseUnits(bool convert_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options) (defined in MathStructure)MathStructure
countChildren() const (defined in MathStructure)MathStructure
countFunctions(bool count_subfunctions=true) const (defined in MathStructure)MathStructure
countOccurrences(const MathStructure &mstruct) const (defined in MathStructure)MathStructure
countTotalChildren(bool count_function_as_one=true) const (defined in MathStructure)MathStructure
ct_comp (defined in MathStructure)MathStructureprotected
datetime() const (defined in MathStructure)MathStructure
datetime() (defined in MathStructure)MathStructure
decomposeFractions(const MathStructure &x_var, const EvaluationOptions &eo) (defined in MathStructure)MathStructure
degree(const MathStructure &xvar) const (defined in MathStructure)MathStructure
delChild(size_t index, bool check_size=false) (defined in MathStructure)MathStructure
determinant(MathStructure &mstruct, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
differentiate(const MathStructure &x_var, const EvaluationOptions &eo) (defined in MathStructure)MathStructure
dissolveAllCompositeUnits() (defined in MathStructure)MathStructure
divide(const MathStructure &o, bool append=false) (defined in MathStructure)MathStructure
divide(const Number &o, bool append=false) (defined in MathStructure)MathStructure
divide(int i, bool append=false) (defined in MathStructure)MathStructure
divide(Variable *v, bool append=false) (defined in MathStructure)MathStructure
divide(Unit *u, bool append=false) (defined in MathStructure)MathStructure
divide(string sym, bool append=false) (defined in MathStructure)MathStructure
divide_nocopy(MathStructure *o, bool append=false) (defined in MathStructure)MathStructure
equals(const MathStructure &o, bool allow_interval=false, bool allow_infinity=false) const (defined in MathStructure)MathStructure
equals(const Number &o, bool allow_interval=false, bool allow_infinity=false) const (defined in MathStructure)MathStructure
equals(int i) const (defined in MathStructure)MathStructure
equals(Unit *u) const (defined in MathStructure)MathStructure
equals(Variable *v) const (defined in MathStructure)MathStructure
equals(string sym) const (defined in MathStructure)MathStructure
eval(const EvaluationOptions &eo=default_evaluation_options) (defined in MathStructure)MathStructure
evalSort(bool recursive=false, bool absolute=false) (defined in MathStructure)MathStructure
expandPartialFractions(const EvaluationOptions &eo) (defined in MathStructure)MathStructure
exponent() const (defined in MathStructure)MathStructure
exponent() (defined in MathStructure)MathStructure
factorize(const EvaluationOptions &eo=default_evaluation_options, bool unfactorize=true, int term_combination_levels=0, int max_msecs=1000, bool only_integers=true, int recursive=1, struct timeval *endtime_p=NULL, const MathStructure &force_factorization=m_undefined, bool complete_square=false, bool only_sqrfree=false, int max_degree_factor=-1) (defined in MathStructure)MathStructure
factorizeUnits() (defined in MathStructure)MathStructure
find_x_var() const (defined in MathStructure)MathStructure
findAllUnknowns(MathStructure &unknowns_vector) (defined in MathStructure)MathStructure
flattenVector(MathStructure &mstruct) const (defined in MathStructure)MathStructure
format(const PrintOptions &po=default_print_options) (defined in MathStructure)MathStructure
formatsub(const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0, bool recursive=true, MathStructure *top_parent=NULL) (defined in MathStructure)MathStructure
function() const (defined in MathStructure)MathStructure
function_value (defined in MathStructure)MathStructureprotected
functionValue() const (defined in MathStructure)MathStructure
gaussianElimination(const EvaluationOptions &eo=default_evaluation_options, bool det=false) (defined in MathStructure)MathStructure
gcd(const MathStructure &m1, const MathStructure &m2, MathStructure &mresult, const EvaluationOptions &eo, MathStructure *ca=NULL, MathStructure *cb=NULL, bool check_args=true) (defined in MathStructure)MathStructurestatic
generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector=NULL, const EvaluationOptions &eo=default_evaluation_options) const (defined in MathStructure)MathStructure
generateVector(MathStructure x_mstruct, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector=NULL, const EvaluationOptions &eo=default_evaluation_options) const (defined in MathStructure)MathStructure
generateVector(MathStructure x_mstruct, const MathStructure &x_vector, const EvaluationOptions &eo=default_evaluation_options) const (defined in MathStructure)MathStructure
getArea(size_t r1, size_t c1, size_t r2, size_t c2, MathStructure &mstruct) const (defined in MathStructure)MathStructure
getChild(size_t index) const (defined in MathStructure)MathStructure
getChild(size_t index) (defined in MathStructure)MathStructure
getElement(size_t row, size_t column) const (defined in MathStructure)MathStructure
getElement(size_t row, size_t column) (defined in MathStructure)MathStructure
getIdentityMatrix(MathStructure &mstruct) const (defined in MathStructure)MathStructure
getRange(int start, int end, MathStructure &mstruct) const (defined in MathStructure)MathStructure
hasNegativeSign() const (defined in MathStructure)MathStructure
i_precision (defined in MathStructure)MathStructureprotected
i_ref (defined in MathStructure)MathStructureprotected
improve_division_multipliers(const PrintOptions &po=default_print_options) (defined in MathStructure)MathStructure
init() (defined in MathStructure)MathStructureprotected
inParentheses() const (defined in MathStructure)MathStructure
insertChild(const MathStructure &o, size_t index) (defined in MathStructure)MathStructure
insertChild_nocopy(MathStructure *o, size_t index) (defined in MathStructure)MathStructure
integerFactorize() (defined in MathStructure)MathStructure
integrate(const MathStructure &x_var, const EvaluationOptions &eo, bool simplify_first=true, int use_abs=1, bool definite_integral=false, bool try_abs=true, int max_part_depth=5, vector< MathStructure *> *parent_parts=NULL) (defined in MathStructure)MathStructure
inverse() (defined in MathStructure)MathStructure
invertMatrix(const EvaluationOptions &eo) (defined in MathStructure)MathStructure
isAborted() const (defined in MathStructure)MathStructure
isAddition() const (defined in MathStructure)MathStructure
isApproximate() const (defined in MathStructure)MathStructure
isApproximatelyZero() const (defined in MathStructure)MathStructure
isBitwiseAnd() const (defined in MathStructure)MathStructure
isBitwiseNot() const (defined in MathStructure)MathStructure
isBitwiseOr() const (defined in MathStructure)MathStructure
isBitwiseXor() const (defined in MathStructure)MathStructure
isComparison() const (defined in MathStructure)MathStructure
isDateTime() const (defined in MathStructure)MathStructure
isDivision() const (defined in MathStructure)MathStructure
isEmptySymbol() const (defined in MathStructure)MathStructure
isFunction() const (defined in MathStructure)MathStructure
isInfinite(bool ignore_imag=true) const (defined in MathStructure)MathStructure
isInfinity() const (defined in MathStructure)MathStructure
isInteger() const (defined in MathStructure)MathStructure
isInverse() const (defined in MathStructure)MathStructure
isLogicalAnd() const (defined in MathStructure)MathStructure
isLogicalNot() const (defined in MathStructure)MathStructure
isLogicalOr() const (defined in MathStructure)MathStructure
isLogicalXor() const (defined in MathStructure)MathStructure
isMatrix() const (defined in MathStructure)MathStructure
isMinusOne() const (defined in MathStructure)MathStructure
isMultiplication() const (defined in MathStructure)MathStructure
isNegate() const (defined in MathStructure)MathStructure
isNumber() const (defined in MathStructure)MathStructure
isNumber_exp() const (defined in MathStructure)MathStructure
isNumericMatrix() const (defined in MathStructure)MathStructure
isolate_x(const EvaluationOptions &eo, const MathStructure &x_var=m_undefined, bool check_result=false) (defined in MathStructure)MathStructure
isolate_x(const EvaluationOptions &eo, const EvaluationOptions &feo, const MathStructure &x_var=m_undefined, bool check_result=false) (defined in MathStructure)MathStructure
isolate_x_sub(const EvaluationOptions &eo, EvaluationOptions &eo2, const MathStructure &x_var, MathStructure *morig=NULL) (defined in MathStructure)MathStructureprotected
isOne() const (defined in MathStructure)MathStructure
isPlural() const (defined in MathStructure)MathStructure
isPower() const (defined in MathStructure)MathStructure
isProtected() const (defined in MathStructure)MathStructure
isRationalPolynomial(bool allow_non_rational_coefficient=false, bool allow_interval_coefficient=false) constMathStructure
isSymbolic() const (defined in MathStructure)MathStructure
isUndefined() const (defined in MathStructure)MathStructure
isUnit() const (defined in MathStructure)MathStructure
isUnit_exp() const (defined in MathStructure)MathStructure
isUnitCompatible(const MathStructure &mstruct) const (defined in MathStructure)MathStructure
isUnknown() const (defined in MathStructure)MathStructure
isUnknown_exp() const (defined in MathStructure)MathStructure
isVariable() const (defined in MathStructure)MathStructure
isVector() const (defined in MathStructure)MathStructure
isZero() const (defined in MathStructure)MathStructure
last() (defined in MathStructure)MathStructure
last() const (defined in MathStructure)MathStructure
lcm(const MathStructure &m1, const MathStructure &m2, MathStructure &mlcm, const EvaluationOptions &eo, bool check_args=true) (defined in MathStructure)MathStructurestatic
lcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const (defined in MathStructure)MathStructure
ldegree(const MathStructure &xvar) const (defined in MathStructure)MathStructure
m_type (defined in MathStructure)MathStructureprotected
MathStructure()MathStructure
MathStructure(const MathStructure &o)MathStructure
MathStructure(int num, int den=1, int exp10=0)MathStructure
MathStructure(long int num, long int den, long int exp10=0L) (defined in MathStructure)MathStructure
MathStructure(string sym, bool force_symbol=false)MathStructure
MathStructure(const QalculateDateTime &o_dt)MathStructure
MathStructure(double float_value)MathStructure
MathStructure(const MathStructure *o,...)MathStructure
MathStructure(MathFunction *o,...)MathStructure
MathStructure(Unit *u, Prefix *p=NULL)MathStructure
MathStructure(Variable *o)MathStructure
MathStructure(const Number &o)MathStructure
matrixIsSquare() const (defined in MathStructure)MathStructure
matrixToVector(MathStructure &mstruct) const (defined in MathStructure)MathStructure
maxCoefficient() (defined in MathStructure)MathStructure
merge_addition(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_bitwise_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_bitwise_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_bitwise_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_logical_and(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_logical_or(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_logical_xor(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
merge_multiplication(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false, bool do_append=true) (defined in MathStructure)MathStructure
merge_power(MathStructure &mstruct, const EvaluationOptions &eo, MathStructure *mparent=NULL, size_t index_this=1, size_t index_that=2, bool reversed=false) (defined in MathStructure)MathStructure
mergeInterval(const MathStructure &o, bool set_to_overlap=false) (defined in MathStructure)MathStructure
mergePrecision(const MathStructure &o) (defined in MathStructure)MathStructure
mergePrecision(bool approx, int prec) (defined in MathStructure)MathStructure
multiply(const MathStructure &o, bool append=false) (defined in MathStructure)MathStructure
multiply(const Number &o, bool append=false) (defined in MathStructure)MathStructure
multiply(int i, bool append=false) (defined in MathStructure)MathStructure
multiply(Variable *v, bool append=false) (defined in MathStructure)MathStructure
multiply(Unit *u, bool append=false) (defined in MathStructure)MathStructure
multiply(string sym, bool append=false) (defined in MathStructure)MathStructure
multiply_nocopy(MathStructure *o, bool append=false) (defined in MathStructure)MathStructure
neededMultiplicationSign(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool par, bool par_prev, bool flat_division=true, bool flat_power=true) const (defined in MathStructure)MathStructure
needsParenthesis(const PrintOptions &po, const InternalPrintStruct &ips, const MathStructure &parent, size_t index, bool flat_division=true, bool flat_power=true) const (defined in MathStructure)MathStructure
negate() (defined in MathStructure)MathStructure
number() const (defined in MathStructure)MathStructure
number() (defined in MathStructure)MathStructure
numberUpdated() (defined in MathStructure)MathStructure
o_datetime (defined in MathStructure)MathStructureprotected
o_function (defined in MathStructure)MathStructureprotected
o_number (defined in MathStructure)MathStructureprotected
o_prefix (defined in MathStructure)MathStructureprotected
o_unit (defined in MathStructure)MathStructureprotected
o_variable (defined in MathStructure)MathStructureprotected
operator!() const (defined in MathStructure)MathStructure
operator!=(const MathStructure &o) const (defined in MathStructure)MathStructure
operator&&(const MathStructure &o) const (defined in MathStructure)MathStructure
operator*(const MathStructure &o) const (defined in MathStructure)MathStructure
operator*=(const MathStructure &o) (defined in MathStructure)MathStructure
operator*=(const Number &o) (defined in MathStructure)MathStructure
operator*=(int i) (defined in MathStructure)MathStructure
operator*=(Unit *u) (defined in MathStructure)MathStructure
operator*=(Variable *v) (defined in MathStructure)MathStructure
operator*=(string sym) (defined in MathStructure)MathStructure
operator+(const MathStructure &o) const (defined in MathStructure)MathStructure
operator+=(const MathStructure &o) (defined in MathStructure)MathStructure
operator+=(const Number &o) (defined in MathStructure)MathStructure
operator+=(int i) (defined in MathStructure)MathStructure
operator+=(Unit *u) (defined in MathStructure)MathStructure
operator+=(Variable *v) (defined in MathStructure)MathStructure
operator+=(string sym) (defined in MathStructure)MathStructure
operator-() const (defined in MathStructure)MathStructure
operator-(const MathStructure &o) const (defined in MathStructure)MathStructure
operator-=(const MathStructure &o) (defined in MathStructure)MathStructure
operator-=(const Number &o) (defined in MathStructure)MathStructure
operator-=(int i) (defined in MathStructure)MathStructure
operator-=(Unit *u) (defined in MathStructure)MathStructure
operator-=(Variable *v) (defined in MathStructure)MathStructure
operator-=(string sym) (defined in MathStructure)MathStructure
operator/(const MathStructure &o) const (defined in MathStructure)MathStructure
operator/=(const MathStructure &o) (defined in MathStructure)MathStructure
operator/=(const Number &o) (defined in MathStructure)MathStructure
operator/=(int i) (defined in MathStructure)MathStructure
operator/=(Unit *u) (defined in MathStructure)MathStructure
operator/=(Variable *v) (defined in MathStructure)MathStructure
operator/=(string sym) (defined in MathStructure)MathStructure
operator=(const MathStructure &o) (defined in MathStructure)MathStructure
operator=(const Number &o) (defined in MathStructure)MathStructure
operator=(int i) (defined in MathStructure)MathStructure
operator=(Unit *u) (defined in MathStructure)MathStructure
operator=(Variable *v) (defined in MathStructure)MathStructure
operator=(string sym) (defined in MathStructure)MathStructure
operator==(const MathStructure &o) const (defined in MathStructure)MathStructure
operator==(const Number &o) const (defined in MathStructure)MathStructure
operator==(int i) const (defined in MathStructure)MathStructure
operator==(Unit *u) const (defined in MathStructure)MathStructure
operator==(Variable *v) const (defined in MathStructure)MathStructure
operator==(string sym) const (defined in MathStructure)MathStructure
operator[](size_t index)MathStructure
operator[](size_t index) constMathStructure
operator^(const MathStructure &o) const (defined in MathStructure)MathStructure
operator^=(const MathStructure &o) (defined in MathStructure)MathStructure
operator^=(const Number &o) (defined in MathStructure)MathStructure
operator^=(int i) (defined in MathStructure)MathStructure
operator^=(Unit *u) (defined in MathStructure)MathStructure
operator^=(Variable *v) (defined in MathStructure)MathStructure
operator^=(string sym) (defined in MathStructure)MathStructure
operator||(const MathStructure &o) const (defined in MathStructure)MathStructure
overallCoefficient() const (defined in MathStructure)MathStructure
permanent(MathStructure &mstruct, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
pivot(size_t ro, size_t co, bool symbolic=true) (defined in MathStructure)MathStructure
polynomialContent(const MathStructure &xvar, MathStructure &mcontent, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
polynomialDivide(const MathStructure &mnum, const MathStructure &mden, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args=true) (defined in MathStructure)MathStructurestatic
polynomialPrimpart(const MathStructure &xvar, MathStructure &mprim, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
polynomialPrimpart(const MathStructure &xvar, const MathStructure &c, MathStructure &mprim, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
polynomialQuotient(const MathStructure &mnum, const MathStructure &mden, const MathStructure &xvar, MathStructure &mquotient, const EvaluationOptions &eo, bool check_args=true) (defined in MathStructure)MathStructurestatic
polynomialUnit(const MathStructure &xvar) const (defined in MathStructure)MathStructure
polynomialUnitContentPrimpart(const MathStructure &xvar, int &munit, MathStructure &mcontent, MathStructure &mprim, const EvaluationOptions &eo) const (defined in MathStructure)MathStructure
postFormatUnits(const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0) (defined in MathStructure)MathStructure
precision() const (defined in MathStructure)MathStructure
prefix() const (defined in MathStructure)MathStructure
prefixCurrencies() (defined in MathStructure)MathStructure
print(const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const (defined in MathStructure)MathStructure
raise(const MathStructure &o) (defined in MathStructure)MathStructure
raise(const Number &o) (defined in MathStructure)MathStructure
raise(int i) (defined in MathStructure)MathStructure
raise(Variable *v) (defined in MathStructure)MathStructure
raise(Unit *u) (defined in MathStructure)MathStructure
raise(string sym) (defined in MathStructure)MathStructure
raise_nocopy(MathStructure *o) (defined in MathStructure)MathStructure
rankVector(bool ascending=true) (defined in MathStructure)MathStructure
ref() (defined in MathStructure)MathStructure
refcount() const (defined in MathStructure)MathStructure
removeType(StructureType mtype) (defined in MathStructure)MathStructure
replace(const MathStructure &mfrom, const MathStructure &mto, bool once_only=false) (defined in MathStructure)MathStructure
replace(const MathStructure &mfrom1, const MathStructure &mto1, const MathStructure &mfrom2, const MathStructure &mto2) (defined in MathStructure)MathStructure
representsApproximatelyZero(bool allow_units=false) const (defined in MathStructure)MathStructure
representsBoolean() const (defined in MathStructure)MathStructure
representsComplex(bool allow_units=false) const (defined in MathStructure)MathStructure
representsEven(bool allow_units=false) const (defined in MathStructure)MathStructure
representsFraction(bool allow_units=false) const (defined in MathStructure)MathStructure
representsInteger(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNegative(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNonComplex(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNonInteger(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNonMatrix() const (defined in MathStructure)MathStructure
representsNonNegative(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNonPositive(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNonZero(bool allow_units=false) const (defined in MathStructure)MathStructure
representsNumber(bool allow_units=false) const (defined in MathStructure)MathStructure
representsOdd(bool allow_units=false) const (defined in MathStructure)MathStructure
representsPositive(bool allow_units=false) const (defined in MathStructure)MathStructure
representsRational(bool allow_units=false) const (defined in MathStructure)MathStructure
representsReal(bool allow_units=false) const (defined in MathStructure)MathStructure
representsScalar() const (defined in MathStructure)MathStructure
representsUndefined(bool include_children=false, bool include_infinite=false, bool be_strict=false) const (defined in MathStructure)MathStructure
representsZero(bool allow_units=false) const (defined in MathStructure)MathStructure
resizeMatrix(size_t r, size_t c, const MathStructure &mfill) (defined in MathStructure)MathStructure
resizeVector(size_t i, const MathStructure &mfill) (defined in MathStructure)MathStructure
rows() const (defined in MathStructure)MathStructure
rowToVector(size_t r, MathStructure &mstruct) const (defined in MathStructure)MathStructure
s_sym (defined in MathStructure)MathStructureprotected
set(const MathStructure &o, bool merge_precision=false)MathStructure
set(int num, int den=1, int exp10=0, bool preserve_precision=false)MathStructure
set(long int num, long int den, long int exp10=0L, bool preserve_precision=false) (defined in MathStructure)MathStructure
set(string sym, bool preserve_precision=false, bool force_symbol=false)MathStructure
set(const QalculateDateTime &o_dt, bool preserve_precision=false)MathStructure
set(double float_value, bool preserve_precision=false)MathStructure
set(MathFunction *o,...)MathStructure
set(Unit *u, Prefix *p=NULL, bool preserve_precision=false)MathStructure
set(Variable *o, bool preserve_precision=false)MathStructure
set(const Number &o, bool preserve_precision=false)MathStructure
set_nocopy(MathStructure &o, bool merge_precision=false)MathStructure
setAborted(bool preserve_precision=false)MathStructure
setApproximate(bool is_approx=true, bool recursive=false) (defined in MathStructure)MathStructure
setBitwiseNot() (defined in MathStructure)MathStructure
setChild(const MathStructure &o, size_t index=1, bool merge_precision=false) (defined in MathStructure)MathStructure
setChild_nocopy(MathStructure *o, size_t index=1, bool merge_precision=false) (defined in MathStructure)MathStructure
setComparisonType(ComparisonType comparison_type) (defined in MathStructure)MathStructure
setElement(const MathStructure &mstruct, size_t row, size_t column) (defined in MathStructure)MathStructure
setFunction(MathFunction *f) (defined in MathStructure)MathStructure
setInParentheses(bool b=true) (defined in MathStructure)MathStructure
setLogicalNot() (defined in MathStructure)MathStructure
setPlural(bool is_plural) (defined in MathStructure)MathStructure
setPrecision(int prec, bool recursive=false) (defined in MathStructure)MathStructure
setPrefix(Prefix *p) (defined in MathStructure)MathStructure
setPrefixes(const PrintOptions &po=default_print_options, MathStructure *parent=NULL, size_t pindex=0) (defined in MathStructure)MathStructure
setPrefixForUnit(Unit *u, Prefix *new_prefix) (defined in MathStructure)MathStructure
setProtected(bool do_protect=true) (defined in MathStructure)MathStructure
setToChild(size_t index, bool merge_precision=false, MathStructure *mparent=NULL, size_t index_this=1) (defined in MathStructure)MathStructure
setToIdentityMatrix(size_t n) (defined in MathStructure)MathStructure
setType(StructureType mtype)MathStructure
setUndefined(bool preserve_precision=false)MathStructure
setUnit(Unit *u) (defined in MathStructure)MathStructure
setVariable(Variable *v) (defined in MathStructure)MathStructure
setVector(const MathStructure *o,...)MathStructure
simplify(const EvaluationOptions &eo=default_evaluation_options, bool unfactorize=true) (defined in MathStructure)MathStructure
size() const (defined in MathStructure)MathStructure
sort(const PrintOptions &po=default_print_options, bool recursive=true) (defined in MathStructure)MathStructure
sortVector(bool ascending=true) (defined in MathStructure)MathStructure
structure(StructuringMode structuring, const EvaluationOptions &eo, bool restore_first=true) (defined in MathStructure)MathStructure
subtract(const MathStructure &o, bool append=false) (defined in MathStructure)MathStructure
subtract(const Number &o, bool append=false) (defined in MathStructure)MathStructure
subtract(int i, bool append=false) (defined in MathStructure)MathStructure
subtract(Variable *v, bool append=false) (defined in MathStructure)MathStructure
subtract(Unit *u, bool append=false) (defined in MathStructure)MathStructure
subtract(string sym, bool append=false) (defined in MathStructure)MathStructure
subtract_nocopy(MathStructure *o, bool append=false) (defined in MathStructure)MathStructure
swapChildren(size_t index1, size_t index2) (defined in MathStructure)MathStructure
symbol() const (defined in MathStructure)MathStructure
syncUnits(bool sync_complex_relations=false, bool *found_complex_relations=NULL, bool calculate_new_functions=false, const EvaluationOptions &feo=default_evaluation_options) (defined in MathStructure)MathStructure
tcoefficient(const MathStructure &xvar, MathStructure &mcoeff) const (defined in MathStructure)MathStructure
testCompositeUnit(Unit *u) (defined in MathStructure)MathStructure
testDissolveCompositeUnit(Unit *u) (defined in MathStructure)MathStructure
transform(StructureType mtype, const MathStructure &o) (defined in MathStructure)MathStructure
transform(StructureType mtype, const Number &o) (defined in MathStructure)MathStructure
transform(StructureType mtype, int i) (defined in MathStructure)MathStructure
transform(StructureType mtype, Unit *u) (defined in MathStructure)MathStructure
transform(StructureType mtype, Variable *v) (defined in MathStructure)MathStructure
transform(StructureType mtype, string sym) (defined in MathStructure)MathStructure
transform(StructureType mtype) (defined in MathStructure)MathStructure
transform(MathFunction *o) (defined in MathStructure)MathStructure
transform(ComparisonType ctype, const MathStructure &o) (defined in MathStructure)MathStructure
transform_nocopy(StructureType mtype, MathStructure *o) (defined in MathStructure)MathStructure
transposeMatrix() (defined in MathStructure)MathStructure
type() const (defined in MathStructure)MathStructure
unformat(const EvaluationOptions &eo=default_evaluation_options) (defined in MathStructure)MathStructure
unit() const (defined in MathStructure)MathStructure
unit_exp_prefix() const (defined in MathStructure)MathStructure
unit_exp_unit() const (defined in MathStructure)MathStructure
unref() (defined in MathStructure)MathStructure
v_order (defined in MathStructure)MathStructureprotected
v_subs (defined in MathStructure)MathStructureprotected
variable() const (defined in MathStructure)MathStructure
~MathStructure() (defined in MathStructure)MathStructure
libqalculate-2.8.2/docs/reference/html/classVectorArgument.html0000644000175000017500000010161713401033110021611 00000000000000 libqalculate-2.8.2: VectorArgument Class Reference
libqalculate-2.8.2

A vector argument. More...

#include <Function.h>

Inheritance diagram for VectorArgument:
Argument

Public Member Functions

 VectorArgument (string name_="", bool does_test=true, bool allow_matrix=false, bool does_error=true)
 
 VectorArgument (const VectorArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
bool reoccuringArguments () const
 
void setReoccuringArguments (bool reocc)
 
void addArgument (Argument *arg)
 
void delArgument (size_t index)
 
size_t countArguments () const
 
ArgumentgetArgument (size_t index) const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Protected Attributes

vector< Argument * > subargs
 
bool b_argloop
 
- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A vector argument.

Member Function Documentation

◆ copy()

virtual Argument* VectorArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string VectorArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string VectorArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool VectorArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int VectorArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classExpressionItem.html0000644000175000017500000021460613401033110021625 00000000000000 libqalculate-2.8.2: ExpressionItem Class Reference
libqalculate-2.8.2
ExpressionItem Class Referenceabstract

Abstract base class for functions, variables and units. More...

#include <ExpressionItem.h>

Inheritance diagram for ExpressionItem:
MathFunction Unit Variable DataSet UserFunction AliasUnit CompositeUnit KnownVariable UnknownVariable AliasUnit_Composite DynamicVariable NowVariable PrecisionVariable TodayVariable TomorrowVariable YesterdayVariable

Public Member Functions

 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual ExpressionItemcopy () const =0
 
virtual void set (const ExpressionItem *item)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 
virtual int type () const =0
 
virtual int subtype () const =0
 

Protected Attributes

string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

Abstract base class for functions, variables and units.

Expression items have one or more names used to reference it in mathematical expressions and display them in a result. Each name must be fully unique, with the exception that functions can have names used by other types of items (for example "min" is used as a name for the minute unit but also for a function returning smallest value in a vector).

Items have an optional title and description for information to the end user. The categoy property is used to organize items, so that the end user can easily find them. Subcategories are separated by a slash, '/' (ex. "Physical Constants/Electromagnetic Constants").

A local item is created/edited by the end user.

A builtin item has defining properties that can/should not be edited by the user and is usually an item not loaded from the definition files.

An inactive item can not be used in expressions and can share the name of an active item.

The hidden propery defines if the item should be hidden from the end user.

Before an item can be used in expressions, it must be added to the Calculator object using CALCULATOR->addExpressionItem(). It is then said to be registered.

To delete an ExpressionItem object you should use destroy() to make sure that the item is removed from the Calculator and does not have any referrer.

Member Function Documentation

◆ category()

virtual const string& ExpressionItem::category ( ) const
virtual

Returns the category that the expression item belongs to. Subcategories are separated by '/'.

Returns
Category.

◆ clearNames()

virtual void ExpressionItem::clearNames ( )
virtual

Removes all names.

◆ clearNonReferenceNames()

virtual void ExpressionItem::clearNonReferenceNames ( )
virtual

Removes all names that are not used for reference (ExpressionName.reference = true).

◆ description()

virtual const string& ExpressionItem::description ( ) const
virtual

Returns the expression items description.

Returns
Description.

◆ findName()

virtual const ExpressionName& ExpressionItem::findName ( int  abbreviation = -1,
int  use_unicode = -1,
int  plural = -1,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const
virtual

Searches for a name with specific properties.

Parameters
abbreviationIf the name must be abbreviated. 1=true, 0=false, -1=ignore.
use_unicodeIf the name must have unicode characters. 1=true, 0=false, -1=ignore.
pluralIf the name must be in plural form. 1=true, 0=false, -1=ignore.
can_display_unicode_string_functionFunction that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_argArgument to pass to the above test function.
Returns
The first found name with the specified properties or empty_expression_name if none found.

◆ getName()

virtual const ExpressionName& ExpressionItem::getName ( size_t  index) const
virtual

Returns name for an index (starting at one). All functions can be traversed by starting at index one and increasing the index until empty_expression_name is returned.

Parameters
indexIndex of name.
Returns
Name for index or empty_expression_name if not found.

◆ hasChanged()

virtual bool ExpressionItem::hasChanged ( ) const
virtual

If the object has been changed since it was created/loaded.

◆ hasName()

virtual size_t ExpressionItem::hasName ( const string &  sname,
bool  case_sensitive = true 
) const
virtual

Checks if the expression item has a name with a specific text string.

Parameters
snameA text string to look for (not case sensitive)
case_sensitiveIf the name is case sensitive.
Returns
Index of the name with the given text string or zero if such a name was not found.

◆ hasNameCaseSensitive()

virtual size_t ExpressionItem::hasNameCaseSensitive ( const string &  sname) const
virtual

Checks if the expression item has a name with a specific case sensitive text string.

Parameters
snameA text string to look for (case sensitive)
Returns
Index of the name with the given text string or zero if such a name was not found.

◆ isActive()

virtual bool ExpressionItem::isActive ( ) const
virtual

Returns if the expression item is active and can be used in expressions.

Returns
true if active.

◆ isApproximate()

virtual bool ExpressionItem::isApproximate ( ) const
virtual

If the item is approximate or exact. Note that an actual value associated with the item might have a have a lower precision. For, for example, a mathematical function this defines the precision of the formula, not the result.

Returns
true if the item is approximate

◆ precision()

virtual int ExpressionItem::precision ( ) const
virtual

Returns precision of the item, if it is approximate. Note that an actual value associated with the item might have a have a lower precision. For, for example, a mathematical function this defines the precision of the formula, not the result.

◆ preferredDisplayName()

virtual const ExpressionName& ExpressionItem::preferredDisplayName ( bool  abbreviation = false,
bool  use_unicode = false,
bool  plural = false,
bool  reference = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const
virtual

Returns the name that best fulfils provided criterias and is suitable for display. If two names are equally preferred, the one with lowest index is returned.

Parameters
abbreviationIf an abbreviated name is preferred.
use_unicodeIf a name with unicode characters can be displayed/is preferred (prioritized if false).
pluralIf a name in plural form is preferred.
referenceIf a reference name is preferred (ignored if false).
can_display_unicode_string_functionFunction that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_argArgument to pass to the above test function.
Returns
The preferred name.

◆ preferredInputName()

virtual const ExpressionName& ExpressionItem::preferredInputName ( bool  abbreviation = false,
bool  use_unicode = false,
bool  plural = false,
bool  reference = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const
virtual

Returns the name that best fulfils provided criterias and is suitable for user input. If two names are equally preferred, the one with lowest index is returned.

Parameters
abbreviationIf an abbreviated name is preferred.
use_unicodeIf a name with unicode characters can be displayed/is preferred (prioritized if false).
pluralIf a name in plural form is preferred.
referenceIf a reference name is preferred (ignored if false).
can_display_unicode_string_functionFunction that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_argArgument to pass to the above test function.
Returns
The preferred name.

◆ preferredName()

virtual const ExpressionName& ExpressionItem::preferredName ( bool  abbreviation = false,
bool  use_unicode = false,
bool  plural = false,
bool  reference = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const
virtual

Returns the name that best fulfils provided criterias. If two names are equally preferred, the one with lowest index is returned.

Parameters
abbreviationIf an abbreviated name is preferred.
use_unicodeIf a name with unicode characters can be displayed/is preferred (prioritized if false).
pluralIf a name in plural form is preferred.
referenceIf a reference name is preferred (ignored if false).
can_display_unicode_string_functionFunction that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_argArgument to pass to the above test function.
Returns
The preferred name.

◆ refcount()

virtual int ExpressionItem::refcount ( ) const
virtual

The reference count is not used to delete the expression item when it becomes zero, but to stop from being deleted while it is in use.

◆ setCategory()

virtual void ExpressionItem::setCategory ( string  cat_)
virtual

Sets which category the expression belongs to. Subcategories are separated by '/'.

Parameters
cat_Category.

◆ setDescription()

virtual void ExpressionItem::setDescription ( string  descr_)
virtual

Sets the expression items description.

Parameters
descr_Description.

◆ setName() [1/2]

virtual void ExpressionItem::setName ( const ExpressionName ename,
size_t  index = 1,
bool  force = true 
)
virtual

Changes a name. If a name for the provided index is not present, it is added (equivalent to addName(ename, index, force)).

Parameters
enameThe new name.
indexIndex of name to change.
forceIf true, expression items with conflicting names are replaced, otherwise . Only applies if the item is registered.

◆ setName() [2/2]

virtual void ExpressionItem::setName ( string  sname,
size_t  index,
bool  force = true 
)
virtual

Changes the text string of a name. If a name for the provided index is not present, it is added (equivalent to addName(sname, index, force)).

Parameters
snameThe new name text string.
indexIndex of name to change.
forceIf true, expression items with conflicting names are replaced, otherwise . Only applies if the item is registered.

◆ setTitle()

virtual void ExpressionItem::setTitle ( string  title_)
virtual

Sets the title, descriptive name, of the item. The title can not be used in expressions.

Parameters
title_The new title.

◆ subtype()

virtual int ExpressionItem::subtype ( ) const
pure virtual

Returns the subtype of the expression item, corresponding to which subsubclass the object belongs to.

Returns
Subtype/subsubclass.

Implemented in CompositeUnit, KnownVariable, UserFunction, UnknownVariable, AliasUnit, DataSet, Variable, Unit, and MathFunction.

◆ title()

virtual const string& ExpressionItem::title ( bool  return_name_if_no_title = true,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const
virtual

Returns the title, descriptive name, of the item.

Parameters
return_name_if_no_titleIf true, a name is returned if the title string is empty (using preferredName(false, use_unicode, false, false, can_display_unicode_string_function, can_display_unicode_string_arg)).
use_unicodeIf a name with unicode characters can be displayed/is preferred (passed to preferredName()).
can_display_unicode_string_functionFunction that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected (passed to preferredName()).
can_display_unicode_string_argArgument to pass to the above test function (passed to preferredName()).
Returns
Item title.

◆ type()

virtual int ExpressionItem::type ( ) const
pure virtual

Returns the type of the expression item, corresponding to which subclass the object belongs to.

Returns
ExpressionItemType.

Implemented in Variable, Unit, and MathFunction.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classAngleArgument.png0000644000175000017500000000077113401033110021214 00000000000000‰PNG  IHDRcP: ;¤PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2ˆIDATxíërƒ —™¼ÿ#7‘›¨„C[ìLJÆ —sdEÀßxïýdð’4•å$íp’4@+ÿÃJ~àØJþÃH¹þì]¯"Ô%é@ÛÇÛ†–ìØ­ÚÙ*I,ŽB)ʨu!IGÞ8^¿ž#ä|ב֢;:*IGìŽzY~å]ÕŽ¸Æe©ÓÈq_e½$8ç£GrÔ‘ç#I£XçÑ<`’Ôa}Û%ÉÆ9¼÷~.c<&sƒãñ˜/¹ÁñTL—Üáø˜}µF–ÀÆrØXË`c9l,€ìpιÉল6îv\Ùª¾Ñljù;Çå”ö]Ãsn:žE(·ö«úÚáûÜ(áÔO[ãx_NÑpåZEîß9¶A«v¶^:Ò£eÕÉÑȪÚ׎íÔ_ݱ|ë9 Gzu×óØ'ôæQG;Žz=NŽzY,ïêè8í«ÚÃ%ë”õ½=ß9ÖÓÒt”G8Ñ åjÏ# € :áõmçƒÎ97—/#ÔnˆÚ±IEND®B`‚libqalculate-2.8.2/docs/reference/html/classUserFunction-members.html0000644000175000017500000013320413401033110022715 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
UserFunction Member List

This is the complete list of members for UserFunction, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addSubfunction(string subfunction, bool precalculate=true) (defined in UserFunction)UserFunction
appendDefaultValues(MathStructure &vargs) (defined in MathFunction)MathFunction
argc (defined in MathFunction)MathFunctionprotected
args() constMathFunction
args(const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)MathFunction
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)UserFunctionvirtual
calculate(const string &eq, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
calculate(MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearArgumentDefinitions()MathFunction
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
clearSubfunctions() (defined in UserFunction)UserFunction
condition() constMathFunction
copy() const (defined in UserFunction)UserFunctionvirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
countSubfunctions() const (defined in UserFunction)UserFunction
createFunctionMathStructureFromSVArgs(vector< string > &svargs) (defined in MathFunction)MathFunctionprotectedvirtual
createFunctionMathStructureFromVArgs(const MathStructure &vargs) (defined in MathFunction)MathFunctionprotectedvirtual
default_values (defined in MathFunction)MathFunctionprotected
delSubfunction(size_t index) (defined in UserFunction)UserFunction
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
example(bool raw_format=false, string name_string="") const (defined in MathFunction)MathFunction
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
formula() constUserFunction
getArgumentDefinition(size_t index)MathFunction
getDefaultValue(size_t arg_) const (defined in MathFunction)MathFunction
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
getSubfunction(size_t index) const (defined in UserFunction)UserFunction
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
internalFormula() constUserFunction
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
last_argdef_index (defined in MathFunction)MathFunctionprotected
lastArgumentDefinitionIndex() constMathFunction
MathFunction(string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true) (defined in MathFunction)MathFunction
MathFunction(const MathFunction *function) (defined in MathFunction)MathFunction
MathFunction() (defined in MathFunction)MathFunction
max_argc (defined in MathFunction)MathFunctionprotected
maxargs() constMathFunction
minargs() constMathFunction
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
parse(const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
parse(MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
printCondition()MathFunction
priv (defined in MathFunction)MathFunctionprotected
produceArgumentsVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
produceVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsEven(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsInteger(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonMatrix(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsNonNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonZero(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNumber(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsOdd(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsRational(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsReal(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsScalar(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsUndefined(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
scondition (defined in MathFunction)MathFunctionprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in UserFunction)UserFunctionvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setArgumentDefinition(size_t index, Argument *argdef)MathFunction
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setCondition(string expression)MathFunction
setDefaultValue(size_t arg_, string value_) (defined in MathFunction)MathFunction
setDescription(string descr_)ExpressionItemvirtual
setExample(string new_example) (defined in MathFunction)MathFunction
setFormula(string new_formula, int argc_=-1, int max_argc_=0)UserFunction
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setSubfunction(size_t index, string subfunction)UserFunction
setSubfunctionPrecalculated(size_t index, bool precalculate) (defined in UserFunction)UserFunction
setTitle(string title_)ExpressionItemvirtual
sexample (defined in MathFunction)MathFunctionprotected
sformula (defined in UserFunction)UserFunctionprotected
sformula_calc (defined in UserFunction)UserFunctionprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
stringArgs(const string &str, vector< string > &svargs) (defined in MathFunction)MathFunction
subfunctionPrecalculated(size_t index) const (defined in UserFunction)UserFunction
subtype() constUserFunctionvirtual
testArgumentCount(int itmp) (defined in MathFunction)MathFunction
testArguments(MathStructure &vargs) (defined in MathFunction)MathFunctionprotected
testCondition(const MathStructure &vargs)MathFunction
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constMathFunctionvirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
UserFunction(string cat_, string name_, string formula_, bool is_local=true, int argc_=-1, string title_="", string descr_="", int max_argc_=0, bool is_active=true) (defined in UserFunction)UserFunction
UserFunction(const UserFunction *function) (defined in UserFunction)UserFunction
v_precalculate (defined in UserFunction)UserFunctionprotected
v_refs (defined in ExpressionItem)ExpressionItemprotected
v_subs (defined in UserFunction)UserFunctionprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~MathFunction() (defined in MathFunction)MathFunctionvirtual
libqalculate-2.8.2/docs/reference/html/classDynamicVariable.html0000644000175000017500000017672013401033110021705 00000000000000 libqalculate-2.8.2: DynamicVariable Class Reference
libqalculate-2.8.2

Abstract base class for variables with a value which is recalculated when the precision has changed. More...

#include <Variable.h>

Inheritance diagram for DynamicVariable:
KnownVariable Variable ExpressionItem NowVariable PrecisionVariable TodayVariable TomorrowVariable YesterdayVariable

Public Member Functions

 DynamicVariable (string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true)
 
 DynamicVariable (const DynamicVariable *variable)
 
ExpressionItemcopy () const =0
 
void set (const ExpressionItem *item)
 
const MathStructureget ()
 
void set (const MathStructure &o)
 
void set (string expression_)
 
int calculatedPrecision () const
 
bool calculatedWithInterval () const
 
virtual bool representsPositive (bool=false)
 
virtual bool representsNegative (bool=false)
 
virtual bool representsNonNegative (bool=false)
 
virtual bool representsNonPositive (bool=false)
 
virtual bool representsInteger (bool=false)
 
virtual bool representsNonInteger (bool=false)
 
virtual bool representsNumber (bool=false)
 
virtual bool representsRational (bool=false)
 
virtual bool representsReal (bool=false)
 
virtual bool representsComplex (bool=false)
 
virtual bool representsNonZero (bool=false)
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
virtual bool representsNonMatrix ()
 
virtual bool representsScalar ()
 
- Public Member Functions inherited from KnownVariable
 KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable ()
 
 KnownVariable (const KnownVariable *variable)
 
bool isKnown () const
 
virtual bool isExpression () const
 
virtual string expression () const
 
virtual string uncertainty () const
 
virtual string unit () const
 
int subtype () const
 
virtual void setUncertainty (string standard_uncertainty)
 
virtual void setUnit (string unit_expression)
 
virtual bool representsFraction (bool=false)
 
virtual bool representsNonComplex (bool=false)
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Member Functions

virtual void calculate () const =0
 

Protected Attributes

bool always_recalculate
 
- Protected Attributes inherited from KnownVariable
MathStructuremstruct
 
bool b_expression
 
int calculated_precision
 
bool calculated_with_interval
 
bool calculated_with_units
 
string sexpression
 
string suncertainty
 
string sunit
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

Abstract base class for variables with a value which is recalculated when the precision has changed.

Member Function Documentation

◆ calculatedPrecision()

int DynamicVariable::calculatedPrecision ( ) const

Returns the precision of the calculated value.

Returns
Precision of the calculated value or zero if the value has not yet been calculated.

◆ get()

const MathStructure& DynamicVariable::get ( )
virtual

Returns the value of the variable. If no value is set or parsed and an expression is set, the expression is parsed and resulting value returned.

Returns
The value of the variable..

Reimplemented from KnownVariable.

◆ representsPositive()

virtual bool DynamicVariable::representsPositive ( bool  = false)
inlinevirtual

Returns if the variable represents a positive value.

Reimplemented from KnownVariable.

Reimplemented in NowVariable, YesterdayVariable, TomorrowVariable, and TodayVariable.

◆ set() [1/2]

void DynamicVariable::set ( const MathStructure o)
virtual

Sets the value of the variable. If expression is set, it is cleared.

Parameters
oValue.

Reimplemented from KnownVariable.

◆ set() [2/2]

void DynamicVariable::set ( string  expression_)
virtual

Sets the text string expression of the variable. The value is cleared.

Parameters
expression_Expression.

Reimplemented from KnownVariable.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classMatrixArgument-members.html0000644000175000017500000003605713401033110023250 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
MatrixArgument Member List

This is the complete list of members for MatrixArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_square (defined in MatrixArgument)MatrixArgumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constMatrixArgumentvirtual
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
MatrixArgument(string name_="", bool does_test=true, bool does_error=true) (defined in MatrixArgument)MatrixArgument
MatrixArgument(const MatrixArgument *arg) (defined in MatrixArgument)MatrixArgument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constMatrixArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setSquareDemanded(bool square) (defined in MatrixArgument)MatrixArgumentvirtual
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
squareDemanded() const (defined in MatrixArgument)MatrixArgumentvirtual
subprintlong() constMatrixArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constMatrixArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constMatrixArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~MatrixArgument() (defined in MatrixArgument)MatrixArgumentvirtual
libqalculate-2.8.2/docs/reference/html/classPrecisionVariable.png0000644000175000017500000000221613401033110022060 00000000000000‰PNG  IHDRqøìùòPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2IDATxíë’« ›*ßÿ‘OTä&Æ$;KNÕΆVkÿcŒS!JÒDÜ(IÖüưýIÒ œâ wcÏFIú˜·[XùiÝþ~ ùº‘žò-Gîƒ$5år{ð6<ÍŸAêJØ·­ER]®ßcÙDË>C¾V­'ãð”¯ßãÙX/%w{䛯fµ™:¦ß‚JiÞÉœ³5H]ùé©îGrÊÕœ•W¹Ú$[uæ·FIUùÙ×)I'Ü(IÖ¸Q’¬ùŠ1Ægð ÀT¦—e¶rºñ!œ¬œoü¹êFsÜ`¬q#€5n°ÆÖ¸À7\cŒS!JÒDÜ(IÖü—ÆP]»Æê©ë—¤1ŸOnKã6Ù6aûmûÕÇóú%éšwŒeâ힪¥–W&I—¼µÇΜŒùfgL‡¸Z»×´¿Ã˜ú%éšwŒÝéžn¯%ÏkßcI×ñÞcykÙ«™÷êoäª$ÙáFI²Æ’dÍWŒ1Æ8€X¦2ݸ,³•Óádå|ãŸÈU7˜ãFkÜ`¬q#€5n°ÆÖ¸àŠcœ Q’&âFI²æûÆ/’tÅÐ…•jzO32Þ ÇÆ“ûecÚfØïëíXÆ£ñhÎÇqÔ×ßQMQ¥á¹1­žüÔø+êðª68²“1­é›oí õL]½uk¬’牱:‹r€¹ZJý/dNoL/ª7^…×+”T—«¯£« 5Ô×ñ­÷XåO•kWÆ­¿^ÙV}+W%éwq£$YãFI²æ+Æcœ ÀG,S™n\–ÙÊ鯇p²r¾ñOäªÌq#€5n°ÆÖ¸À7XãFkÜpEŒ1N…(Iq£$YóUcXÿ$é9%dê†ôÝ}cõKÒCãÉ}g\¯ëÃvÛ·¼ïüQË=©)WK}‹*#ºø[ãþXjk©›¤–~D¿Çúd‚T—<¢nF¼alWÞ¬¶2¦Cô?¡ŽÚ~Or` n°ÆÖ|ÅB3ù’c\v»IEND®B`‚libqalculate-2.8.2/docs/reference/html/classUnit-members.html0000644000175000017500000010225413401033110021211 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
Unit Member List

This is the complete list of members for Unit, including all inherited members.

abbreviation(bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
b_si (defined in Unit)Unitprotected
b_use_with_prefixes (defined in Unit)Unitprotected
baseExponent(int exp=1) const (defined in Unit)Unitvirtual
baseUnit() const (defined in Unit)Unitvirtual
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
convert(Unit *u, MathStructure &mvalue, MathStructure &exp) constUnit
convert(Unit *u, MathStructure &mvalue) constUnit
convert(Unit *u, bool *converted=NULL) const (defined in Unit)Unit
convertFromBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unitvirtual
convertFromBaseUnit(MathStructure &mvalue) const (defined in Unit)Unitvirtual
convertFromBaseUnit() const (defined in Unit)Unitvirtual
convertToBaseUnit(MathStructure &mvalue, MathStructure &mexp) const (defined in Unit)Unitvirtual
convertToBaseUnit(MathStructure &mvalue) const (defined in Unit)Unitvirtual
convertToBaseUnit() const (defined in Unit)Unitvirtual
copy() const (defined in Unit)Unitvirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
countries() const (defined in Unit)Unit
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasComplexRelationTo(Unit *u) const (defined in Unit)Unitvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isChildOf(Unit *u) constUnitvirtual
isCurrency() constUnit
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isParentOf(Unit *u) constUnitvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
isSIUnit() constUnit
isUsedByOtherUnits() const (defined in Unit)Unitvirtual
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
plural(bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
print(bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constUnitvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
scountries (defined in Unit)Unitprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in Unit)Unitvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAsSIUnit()Unit
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setCountries(string country_names) (defined in Unit)Unit
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setSystem(string s_system)Unit
setTitle(string title_)ExpressionItemvirtual
setUseWithPrefixesByDefault(bool use_with_prefixes)Unit
singular(bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in Unit)Unitvirtual
ssystem (defined in Unit)Unitprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constUnitvirtual
system() constUnit
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constUnitvirtual
Unit(string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Unit)Unit
Unit() (defined in Unit)Unit
Unit(const Unit *unit) (defined in Unit)Unit
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
useWithPrefixesByDefault() constUnit
v_refs (defined in ExpressionItem)ExpressionItemprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~Unit() (defined in Unit)Unitvirtual
libqalculate-2.8.2/docs/reference/html/bdwn.png0000644000175000017500000000022313401033110016357 00000000000000‰PNG  IHDR5åZIDATxíË € DŸP–1ñlžmÀ r±j².e è†D[ØÉ¾ÙÏÔ¼µ¦ã´Þ|陣6€Všë3´Å?Ls'(}¬>+ žKó÷¥¿ch`‚ ^׃ÞnIEND®B`‚libqalculate-2.8.2/docs/reference/html/classBinaryPrefix-members.html0000644000175000017500000001777313401033110022707 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
BinaryPrefix Member List

This is the complete list of members for BinaryPrefix, including all inherited members.

BinaryPrefix(int exp2, string long_name, string short_name="", string unicode_name="")BinaryPrefix
exp (defined in BinaryPrefix)BinaryPrefixprotected
exponent(int iexp=1) constBinaryPrefix
exponent(const Number &nexp) constBinaryPrefix
l_name (defined in Prefix)Prefixprotected
longName(bool return_short_if_no_long=true, bool use_unicode=false) constPrefix
name(bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constPrefix
Prefix(string long_name, string short_name="", string unicode_name="")Prefix
s_name (defined in Prefix)Prefixprotected
setExponent(int iexp)BinaryPrefix
setLongName(string long_name)Prefix
setShortName(string short_name)Prefix
setUnicodeName(string unicode_name)Prefix
shortName(bool return_long_if_no_short=true, bool use_unicode=false) constPrefix
type() constBinaryPrefixvirtual
u_name (defined in Prefix)Prefixprotected
unicodeName(bool return_short_if_no_uni=true) constPrefix
value(const Number &nexp) constBinaryPrefixvirtual
value(int iexp) constBinaryPrefixvirtual
value() constBinaryPrefixvirtual
~BinaryPrefix() (defined in BinaryPrefix)BinaryPrefix
~Prefix() (defined in Prefix)Prefixvirtual
libqalculate-2.8.2/docs/reference/html/classAliasUnit.html0000644000175000017500000021104113401033110020526 00000000000000 libqalculate-2.8.2: AliasUnit Class Reference
libqalculate-2.8.2

An unit with relation to another unit. More...

#include <Unit.h>

Inheritance diagram for AliasUnit:
Unit ExpressionItem AliasUnit_Composite

Public Member Functions

 AliasUnit (string cat_, string name_, string plural_, string singular_, string title_, Unit *alias, string relation="1", int exp=1, string inverse="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 AliasUnit (const AliasUnit *unit)
 
virtual ExpressionItemcopy () const
 
virtual void set (const ExpressionItem *item)
 
virtual UnitbaseUnit () const
 
virtual UnitfirstBaseUnit () const
 
virtual void setBaseUnit (Unit *alias)
 
virtual string expression () const
 
virtual string inverseExpression () const
 
virtual string uncertainty () const
 
virtual void setExpression (string relation)
 
virtual void setInverseExpression (string inverse)
 
virtual void setUncertainty (string standard_uncertainty)
 
virtual MathStructureconvertToFirstBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertFromFirstBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue) const
 
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue) const
 
virtual MathStructure convertToBaseUnit () const
 
virtual MathStructure convertFromBaseUnit () const
 
virtual int baseExponent (int exp=1) const
 
virtual void setExponent (int exp)
 
virtual int firstBaseExponent () const
 
virtual int mixWithBase () const
 
virtual int mixWithBaseMinimum () const
 
virtual void setMixWithBase (int combine_priority=1)
 
virtual void setMixWithBaseMinimum (int combine_minimum)
 
virtual int subtype () const
 
virtual bool isChildOf (Unit *u) const
 
virtual bool isParentOf (Unit *u) const
 
virtual bool hasComplexExpression () const
 
virtual bool hasComplexRelationTo (Unit *u) const
 
- Public Member Functions inherited from Unit
 Unit (string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Unit (const Unit *unit)
 
bool isSIUnit () const
 
void setAsSIUnit ()
 
void setSystem (string s_system)
 
const string & system () const
 
bool useWithPrefixesByDefault () const
 
void setUseWithPrefixesByDefault (bool use_with_prefixes)
 
bool isCurrency () const
 
const string & countries () const
 
void setCountries (string country_names)
 
virtual string print (bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & plural (bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & singular (bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & abbreviation (bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual bool isUsedByOtherUnits () const
 
virtual int type () const
 
bool convert (Unit *u, MathStructure &mvalue, MathStructure &exp) const
 
bool convert (Unit *u, MathStructure &mvalue) const
 
MathStructure convert (Unit *u, bool *converted=NULL) const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Attributes

string svalue
 
string sinverse
 
string suncertainty
 
int i_exp
 
int i_mix
 
int i_mix_min
 
Unito_unit
 
- Protected Attributes inherited from Unit
string ssystem
 
string scountries
 
bool b_si
 
bool b_use_with_prefixes
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

An unit with relation to another unit.

Alias units is defined in relation to another unit. For example, hour are defined as an alias unit that equals 60 minutes which in turn is defined in relation to seconds.

Alias units have an associated base unit, exponent and relation expression. For more complex relations an inverse relation can also be specified for conversion back from the base unit. The base unit must not necessarily be of the base unit class and it is recommended that an alias unit is defined in relation to the closest unit (ex. 1ft = 3 hands, 1 hand = 4 in, and 1 in = 0.0254 m).

The relation is usually just a number that tells how large quantity of the base unit is needed to get the alias unit (alias unit = base unit * relation). More complex units can specify the relation as a full-blown expression where '' is replaced by the quantity of the base unit and '' is the exponent. For example, Degrees Celsius has the relation "\x + 273.15" and the inverse relation "\x - 273.15" to the base unit Kelvin. For simple relations, the reversion is automatic and ought not be defined separately.

The precision property inherited from ExpressionItem defines the precision of the relation.

The exponent defines the exponential relation to the base unit, so that the alias unit equals the base unit raised to the exponent. For simple unit relations this gives: alias unit = relation * base unit^exponent.

Alias units normally have three different names defined for use in expressions - abbreviation (ex. "m"), singular ("meter") and plural ("meters").

Member Function Documentation

◆ isChildOf()

virtual bool AliasUnit::isChildOf ( Unit u) const
virtual

If specified unit is a base unit for this unit, directly or with other units in between. Equivalent to u->isParentOf(this).

Reimplemented from Unit.

◆ isParentOf()

virtual bool AliasUnit::isParentOf ( Unit u) const
virtual

If this unit is a base unit for specified unit, directly or with other units in between. Equivalent to u->isChildOf(this).

Reimplemented from Unit.

◆ setExpression()

virtual void AliasUnit::setExpression ( string  relation)
virtual

Sets the relation expression.

◆ setInverseExpression()

virtual void AliasUnit::setInverseExpression ( string  inverse)
virtual

Sets the inverse relation expression.

◆ subtype()

virtual int AliasUnit::subtype ( ) const
virtual

Returns the subtype of the unit, corresponding to which subsubclass the object belongs to.

Returns
UnitSubtype.

Reimplemented from Unit.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classTextArgument.html0000644000175000017500000007413113401033110021273 00000000000000 libqalculate-2.8.2: TextArgument Class Reference
libqalculate-2.8.2

A text argument. More...

#include <Function.h>

Inheritance diagram for TextArgument:
Argument

Public Member Functions

 TextArgument (string name_="", bool does_test=true, bool does_error=true)
 
 TextArgument (const TextArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
virtual bool suggestsQuotes () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A text argument.

Accepts text (symbolic) structures. Argument values are parsed as text, unless surrounded by back slashes (which are then removed). Surrounding Parentheses and first quotation marks are removed.

Member Function Documentation

◆ copy()

virtual Argument* TextArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string TextArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string TextArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool TextArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int TextArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/splitbar.png0000644000175000017500000000047213401033110017253 00000000000000‰PNG  IHDRM¸¿IDATxíÝ¡JCa‡ñç(˜ ëƒ%±Ø4 b±È˜Í¶3˜v^Á±˜…ãó–ŽELƒõ…¥•³ ,ÿb;íç{Ã/¼ðÞÀaYÕ¯åóøq:¼º¹›\òIIIIIIIIIIIIIIIIII-Òçl¹›«õ抢è_t/Ï»ã£ÑíYQVõðêäíã÷´×ùY¬Úÿµ§¦ivók¾_íåýÛ£I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$I@$ýC[Vì=ü[„fÆIEND®B`‚libqalculate-2.8.2/docs/reference/html/folderopen.png0000644000175000017500000000112513401033110017564 00000000000000‰PNG  IHDRÚ}\ˆIDATxí]?oÓPÿ9iš4i°;ii“¶‰ZЉ‘‰ÀÀ7`bèÔÙ¬Øù,HìU'ô$*Tµ]‚T¡DPÚÄ6wÏ}‰;¡C; a¿ÓߟûÝïîž¼jAÀ­InSþ}€9H“ÓŽ|?íÁ÷ =_ÊÆŠ­†¥Àue*;¯YEäsYäæB¢Ÿ¿þÄ—£sÙ½½ÙŒ† É«›©ÀYÇq !GÇ¿v̇¹ÑØ®š °Œ‚ÔF¹}q¥b]÷7í·0)Úd›¾ÿð-èº}Pfä£ÖY{4™ÑÂ@}úæôñ2ÛüÔ—ñúåNŒI‚ÁǃcçÁº%£¬UаI³mc±ô˜å¼ÔÆüÈ>é¸xþt9Æ$µý OæVE*õU´Ì‚ç#ž×ˆ•ïûr@l$øPÿrHaaÇ¥ ²›dZ®rè‘ãqI„o¼øT\Ž,tªj2FAxv-LŸp׌p TÄI/ \¥sfí½; jViTƒèú¤o^cpÅü¼ûû»Ïb]”€¢¤<†aþÕœ²“ßÓ˜y“£§9:Œîù+À³€ñà,E žf³6éNˆÄE£KU}Ü^;¶ØnZ¢uß­US4— ѬëbížN¶.Úk¦ØjTÄöº%µªâ i¯VÄÊÝò§™ Èù¸)ùÿG€™òºJ@T x”IEND®B`‚libqalculate-2.8.2/docs/reference/html/classCalculatorMessage.html0000644000175000017500000001635013401033110022241 00000000000000 libqalculate-2.8.2: CalculatorMessage Class Reference
libqalculate-2.8.2
CalculatorMessage Class Reference

A message with information to the user. Primarily used for errors and warnings. More...

#include <Calculator.h>

Public Member Functions

 CalculatorMessage (string message_, MessageType type_=MESSAGE_WARNING, int cat_=MESSAGE_CATEGORY_NONE, int stage_=MESSAGE_STAGE_UNSET)
 
 CalculatorMessage (const CalculatorMessage &e)
 
string message () const
 
const char * c_message () const
 
MessageType type () const
 
int stage () const
 
int category () const
 

Protected Attributes

string smessage
 
MessageType mtype
 
int i_stage
 
int i_cat
 

Detailed Description

A message with information to the user. Primarily used for errors and warnings.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/structPlotDataParameters.html0000644000175000017500000001430113401033110022610 00000000000000 libqalculate-2.8.2: PlotDataParameters Struct Reference
libqalculate-2.8.2
PlotDataParameters Struct Reference

Parameters for plot data series. More...

#include <Calculator.h>

Public Attributes

string title
 Title label.
 
PlotSmoothing smoothing
 Plot smoothing.
 
PlotStyle style
 Plot style.
 
bool yaxis2
 Use scale on second y-axis.
 
bool xaxis2
 Use scale on second x-axis.
 
bool test_continuous
 Check if data is continuous.
 

Detailed Description

Parameters for plot data series.


The documentation for this struct was generated from the following file:
libqalculate-2.8.2/docs/reference/html/util_8h.html0000644000175000017500000005674213401033110017202 00000000000000 libqalculate-2.8.2: libqalculate/util.h File Reference
libqalculate-2.8.2
util.h File Reference
#include <libqalculate/includes.h>
#include <pthread.h>
#include <unistd.h>

Classes

class  Thread
 

Functions

void sleep_ms (int milliseconds)
 
string & gsub (const string &pattern, const string &sub, string &str)
 
string & gsub (const char *pattern, const char *sub, string &str)
 
string d2s (double value, int precision=100)
 
string i2s (int value)
 
string i2s (long int value)
 
string i2s (unsigned int value)
 
string i2s (unsigned long int value)
 
const char * b2yn (bool b, bool capital=true)
 
const char * b2tf (bool b, bool capital=true)
 
const char * b2oo (bool b, bool capital=true)
 
string p2s (void *o)
 
int s2i (const string &str)
 
int s2i (const char *str)
 
void * s2p (const string &str)
 
void * s2p (const char *str)
 
void now (int &hour, int &min, int &sec)
 
size_t find_ending_bracket (const string &str, size_t start, int *missing=NULL)
 
char op2ch (MathOperation op)
 
string & wrap_p (string &str)
 
string & remove_blanks (string &str)
 
string & remove_duplicate_blanks (string &str)
 
string & remove_blank_ends (string &str)
 
string & remove_parenthesis (string &str)
 
bool is_in (const char *str, char c)
 
bool is_not_in (const char *str, char c)
 
bool is_in (const string &str, char c)
 
bool is_not_in (const string &str, char c)
 
int sign_place (string *str, size_t start=0)
 
int gcd (int i1, int i2)
 
char * locale_to_utf8 (const char *str)
 
char * locale_from_utf8 (const char *str)
 
char * utf8_strdown (const char *str, int l=-1)
 
size_t unicode_length (const string &str)
 
size_t unicode_length (const char *str)
 
bool text_length_is_one (const string &str)
 
bool equalsIgnoreCase (const string &str1, const string &str2)
 
bool equalsIgnoreCase (const string &str1, const char *str2)
 
void parse_qalculate_version (string qalculate_version, int *qalculate_version_numbers)
 
string getOldLocalDir ()
 
string getLocalDir ()
 
string getPackageDataDir ()
 
string getGlobalDefinitionsDir ()
 
string getPackageLocaleDir ()
 
string getLocalDataDir ()
 
string getLocalTmpDir ()
 
string buildPath (string dir, string filename)
 
string buildPath (string dir1, string dir2, string filename)
 
string buildPath (string dir1, string dir2, string dir3, string filename)
 
bool dirExists (string dirpath)
 
bool fileExists (string dirpath)
 
bool makeDir (string dirpath)
 
bool recursiveMakeDir (string dirpath)
 
bool removeDir (string dirpath)
 
bool move_file (const char *from_file, const char *to_file)
 
int checkAvailableVersion (const char *version_id, const char *current_version, string *avaible_version=NULL, int timeout=5)
 
libqalculate-2.8.2/docs/reference/html/classIntegerArgument.html0000644000175000017500000010552313401033110021744 00000000000000 libqalculate-2.8.2: IntegerArgument Class Reference
libqalculate-2.8.2

A definition for integer arguments. More...

#include <Function.h>

Inheritance diagram for IntegerArgument:
Argument

Public Member Functions

 IntegerArgument (string name_="", ArgumentMinMaxPreDefinition minmax=ARGUMENT_MIN_MAX_NONE, bool does_test=true, bool does_error=true, IntegerType integer_type=INTEGER_TYPE_NONE)
 
 IntegerArgument (const IntegerArgument *arg)
 
IntegerType integerType () const
 
void setIntegerType (IntegerType integer_type)
 
virtual void set (const Argument *arg)
 
virtual Argumentcopy () const
 
virtual string print () const
 
void setMin (const Number *nmin)
 
const Numbermin () const
 
void setMax (const Number *nmax)
 
const Numbermax () const
 
virtual int type () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Protected Attributes

Numberimin
 
Numberimax
 
IntegerType i_inttype
 
- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A definition for integer arguments.

These arguments allows numerical integer values. The value can be restricted to a max and/or min value.

Member Function Documentation

◆ copy()

virtual Argument* IntegerArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string IntegerArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ set()

virtual void IntegerArgument::set ( const Argument arg)
virtual

Sets the argument to a copy of an argument definition.

Parameters
argArgument to copy.

Reimplemented from Argument.

◆ subprintlong()

virtual string IntegerArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool IntegerArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int IntegerArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/functions_func_f.html0000644000175000017500000000442713401033110021147 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- f -

libqalculate-2.8.2/docs/reference/html/classExpressionItem.png0000644000175000017500000001050513401033110021435 00000000000000‰PNG  IHDR®øÛçK7PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2ÔIDATxíÝÛrò̄Ṋû¿äõ…­Ì&ü™d5é—`cl¹¥öœB€7²Ùl6?à?š˜ÄxDâ LMâ LMâ LMâ LÍzb6»<ÁÕqÿv<÷ÛÄxĸ—I\!@€·q7®»›¿Ó§…w¿þžÞw>þŽÜÿ®I\!@€GÜ_]÷IÛeïÎC>7\¨x¹ïCpEâ <âFŽv¯aùÙÿìôÞö^ŵA‰+ðˆ9ºŽkÏñéëÕ¸îL\!@€W¸Ÿ£a<ѹ\Imœ5#‰+ðˆ»9Ú¯ »5ô"².´׬® À‹ÜÈÑîuŠë.°Çô>Ÿßwœ?íµcH,\¸B€x&1ß–ªÄxDâ LMâ LÍ&&q…‘¸B€S“¸B€S“¸B€S“¸B€S³Ùl6?àûØB€f%q…ff»M^!@€‰I\!@€™ù—Ö䘗Ęœ„˜šÄ˜šÄ˜šÄ˜šÄ˜šÄ˜šÄ˜šÄ˜šÄ˜šÄLÈv»Ý†ív» Ûív{˜´MñMñ¦!í@Sü@Sü€iH;Ð?Ð?`Ò4Å4؆´MñMñ¦!í@Sü@Sü€iH;Ð?Ð?`Ò4Å4؆´MñMñ¦!í@Sü@Sü€iH;Ð?Ð?`Ò4Å4؆´MñMñ¦!í@Sü@Sü€iH;Ð?Ð?à},˲¼ÀvY–åëÀ\,˲¼@üX–¥éÏù?ÈRUõSÌ8žUU?Eü¨ª¦ÄƒÒ4Å4؆´MñMñ¦!í@Sü@Sü€iH;Ð?Ð?`n¶csñ÷é°±Ù½ªªV8VUu—¿2ž»û]3ªªêüb?ö7|qÛƒ%+ßWUÝ#qÅ Ûq=4`5®UU·øDKþh\??—4®W~$®ðOÅu·”~¼ýûÛm·&ìB¼?¸vØ8}UUuÍ_‹ëÉžýÍWU}ŠßìÇi.÷¾–Ë98飯zHâŠA·ãzhÀaMÝÿÛåñ:®ç½§OãWUU+ü¹¸·_Uõ9þB\Ï©\™ƒóŽªª‡$®ôL\OkÇÙüã3ó"§×GÞmÎß[]×Ëè®9“¸ÂW¸×¶´îÒyÌÄ5q½|¾‡¥­²‡Ù9:sø¾ªê‰+=׫GcâZUM‰ë9®CTWþ}ƙăîÅuÝë1®ã£³6uVâZUõ~·‡Åu}v.£ªê!‰+=×f<:woã0îwõÃŽûŽÿqý¸ÙqDw›UUŸâ/Äõ0,—³³wä<UUI\1èkãYUõþL\«ªÞ@ü¨ª¦ÄƒÒ4Å4؆´MñMñ¦!í@Sü@Sü€iH;Ð?Ð?`Ò4Å4؆´MñMñ¦!í@Sü@Sü€iX–eù9`.–eY~˜‹eY–Ÿ¼‡-„ø+ʆ´MñMñfa»M?â¬?`Ò4Å4Ř…ÝH?â¬?`Ò4Å4Řˆ4MñMñ¦!í@Sü@Sü€iH;Ð?Ð?`Ò4Å4؆´MñMñ¦!í@Sü@Sü€iH;Ð?Ð?`Ò4Å4؆´MñMñ¦!í@Sü@Sü€·°Ýn·S°Ýn·S°Ýn·Saš±€ HhJ0 išRšRLCÚ¦Ô¦ÔÓv )u )uÀ4¤hJhJ0 išRšRLCÚ¦Ô¦ÔÓv )u )uÀ4¤hJhJ0 išRšRLCÚ¦Ô¦ÔÓv )u )uÀ4¤hJhJ0 išRšRLCÚ¦Ô¦ÔïcY–å¶Ë²,_'u,ËÒ”:–eiš¯øA–ªªŸ¢·£ªê§HUÕ”:ªª)qÍXTU]:ªª)qÅ ´#uTU ¤ŽªjJ\3UU¤ŽªjJ\1(íHUU©£ªš~c\7¯¾=~µúEUÕžjÇît«çÜUtëjÿö?]È—Æbö•Ë\ü‰Bžóãö=WÕ áÒŸ(ëQ·[²jÐõÎöéÞinÖq}/UUwy¥š_×ËŒ¾bÞ{âZUu‹ç«øZ\77 »Þÿθ>•Ç]ºw–gâú¸„Õ€\]ýGãúd5¿6®ûN}<ÞÏoç{lûªªò¹¸îÏ{8ýGZŽ×9ÔðoÇùˆ·S­§¯ªªVx-®çËì¯rÞºö“Ž×ëK^Æu8bܸ_Öâz‡ÕkŽõ¼qu=?OÙ?˜nÜý°ëÙ²ÇõÐð~!.W=»j×ÍÅúq\OAýÖj~÷ê:¤òܸïë•áçuãb,WFõ;ãzUâõc­ªê_‰ëúögëe\—õ0®×ÏçMU×Àeßn=õ«ªžX]OYûÎj~w\÷)9:Ýòù‹ªªÇ|*®‡GÂÑõ©ù/âz®£q*í§ãzªä¢-oŠkïÊ퀴UxèY›Ÿ^`UÕÈ[ãúB5¿:®W¢qýû¶¸#öÃq½X½Îçÿ\.ªªëq­Ú4}rÑ"®Ó¿ýßU@nþõ:®îå{«ùµqïs%®ß·ºŽÁ¸ˆëø€¬MõƵõû»âº~ö³+)¾Ù¥—⺶¢_õæü¾•‡]Uu=×ï­æWÆõãuüôñ¨ÚÝäþvøfÿïpTUÕž‹ÉùìçkŒ¦ª8î>VÑ6¾9®g#ZÁm–žtä¹Ç×höY£?} ?[ÖSqíkÚØ“Ë€œÜi‡'¨ÿ¾ªjàvW÷ò­ÕüƸVU½™ÏǤªêýü…:ž~FVU= }©ª¦Ä5cQUuAâZUM‰+¥‰kUÕ@úRUM‰kÆ¢ªê‚ÔQUM‰+¥©£ªj uTUSâš±¨ªº uTUSâŠAiGꨪHUÕ”¸f,ªª.HUÕ”¸bв,ËÏ‘:–eiJ˲4ÍWø l!Ä03O4Å0Ûmæ3~@€ÉÉx¢)~@€ùø7™Ïøæ&㉦ø¦$ɦø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø&$㉦ø¾ƒeY–Ø.˲|˜‹eY–øs~@€)Xªª~ŠãZUõS$®`Œ'šâ˜Œ'šâ˜Œ'šâ˜Œ'šâ˜óxnŽïûç×nû¼óâˆÍ¿WUÕ\{þ¸~ÜÝ·7¸3l¯~}eqâ îrÏÍe,oÅuܸõ£ªª~]\?w{7âzuÿ‰+ø+qýøXSvïçý‡Í¶à´uãøåáûƒ/N´Û:ÿü—Äõ|O·Õîö|§'ÇŽÛ{gO¿¸8>q…9ŽçiˆÆáürÿåîU›³úîýÆq\O?ÿq=Þ^KîÙŸ1{Ãg /~q¶²»˜¸B€{\ŒgUÕ[¸ŪªKæëg飯êë$®`/Æu·ê\/8®ÿAZWpƒ¬®hºåÇ‘ÖÄÜà»âZUõß´ºVU}7‰+X'㉦ø&$㉦ø&$㉦ø&$㉦ø&dY–å瀹X–eù9 @€ßÇ0+‰+03Ûmò LLâ ÌÌ¿´&¯ À¼$® Àä$¬ ÀÔ$® ÀÔ$® ÀÔ$® ÀÔ$® ÀÔ$® ÀÔ$® ÀÔ$® ÀÔ$® ÀÔ$®`B¶Ûí6l·ÛmØn·Û+ À ÌÒŽÔ¦Ô] 4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®0  4¥4%®ð>–eY^`»,ËòuRDz,M©cY–&=®UU?E‹ªªŸ"uTUÓ„u@ÈX¤Žªª‘Äf$c‘:ªªW˜‘ŒEꨪH\aF2©£ªj q…¹ÓŽM{¯ª³V¿8o>­ü°ªÝ‹ÍÇ«ªêšÓî«ï_¨êÑxîê+zçåÔ±rõªªÇ|¹¤u¬~s>ÞPHâŠA÷âºóïÙ¸^õᕸ>ùûª:ë…ªžXMNé;L¹YDzúJIÿI\Ÿ($qÅ »«ë‡;>’{Ú8ܱ?òtÜÇçá‡UUë<Œëî´Ç‹´³§?\ï…ªžŽë©”áÄ#/˜ò ®§3]_¨9õ†>ݨãêt§KöBÞèMâŠAÏÄõ4$—cÐósÞ}Þ:u©ªj…Çqmg=ý»<ýÅŒ~¡ªgãÚj¸*¬6U#Ÿ7å~\ÏgÚGb|z½³OâºÒŠáôoó&qÅ »q½ˆÅU.{¸¬¯Åõãuqòñüz±ªÏÇõúÄï0幸®vb-F_.éöcôÒ†›¡|‹7‰+Ýë¾AWcpìÛ.WÃCs|²žbWUµÂÝÕõ¼ÂžÎ:,'×éùrU_ŒëéÄÇÁ}Õ”wÇõ«%ݯãtø©—§—7‰+}*®û¿«ÇìÅ˪ª[<×a_¤ßˆëç«úZ\Ï×FòSÞ×Wûô(®}»ýüú/z“¸bЃ¸îž —OΡo+î_ TUÕOÇue‰_‰ë—«ú|\G[ÞeÊ{âúzŸžˆë¦ªk8ýÛ¼I\1èQ\÷~ººÖýû¢7g·ùï¯ï¨ªºÁSq=]½u8ýe\?_Õ³q=—ÒN<®./™ò(&ÇSÏ~nËèÔ«}zPG³áµ^ȽI\1èN\«ª¾—'bRUõí¼XÇÝGRUÕ³ü?ÞæMâŠA‰ëËu¼-­0®¯y“¸bPâújïKëß‹ë‹Þ$®”¸¦Žªª 뀱HUU#‰+ÌHÆ"uTU $®0#‹ÔQU5¸ÂŒd,RGUÕ@â 3²,Ëòs¤ŽeYšRÇøúðƒ°Pa“c±IEND®B`‚libqalculate-2.8.2/docs/reference/html/classDataSet.png0000644000175000017500000000123313401033110020002 00000000000000‰PNG  IHDR`ˆ/QåPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2*IDATxím“â ›‡ªüÿŸ| ¯fN×àÕ¹ãÒ1É4 ¬Ÿ‰1Æ•%i.$“Ï BúHÒLq·Ž“w«@’~Ìó‚ôîå¼ÆrMìwå«Dæ—ÎVÇRôžnϤ¡5cß½íAbO~¡\›ÞIЖlÞƒYКËðCAŽ´Ý\ mÌ8[ÕÖ› libqalculate-2.8.2: Member List
libqalculate-2.8.2
YesterdayVariable Member List

This is the complete list of members for YesterdayVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
always_recalculate (defined in DynamicVariable)DynamicVariableprotected
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_expression (defined in KnownVariable)KnownVariableprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculated_precision (defined in KnownVariable)KnownVariableprotected
calculated_with_interval (defined in KnownVariable)KnownVariableprotected
calculated_with_units (defined in KnownVariable)KnownVariableprotected
calculatedPrecision() constDynamicVariable
calculatedWithInterval() const (defined in DynamicVariable)DynamicVariable
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const (defined in YesterdayVariable)YesterdayVariableinlinevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
DynamicVariable(string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true) (defined in DynamicVariable)DynamicVariable
DynamicVariable(const DynamicVariable *variable) (defined in DynamicVariable)DynamicVariable
DynamicVariable() (defined in DynamicVariable)DynamicVariable
expression() constKnownVariablevirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
get()DynamicVariablevirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isExpression() constKnownVariablevirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() constKnownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
KnownVariable(string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable(string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable()KnownVariable
KnownVariable(const KnownVariable *variable)KnownVariable
mstruct (defined in KnownVariable)KnownVariableprotected
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsComplex(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsEven(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsFraction(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsInteger(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonComplex(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonInteger(bool=false) (defined in YesterdayVariable)YesterdayVariableinlinevirtual
representsNonMatrix() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonNegative(bool=false) (defined in YesterdayVariable)YesterdayVariableinlinevirtual
representsNonPositive(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonZero(bool b=false) (defined in YesterdayVariable)YesterdayVariableinlinevirtual
representsNumber(bool b=false) (defined in YesterdayVariable)YesterdayVariableinlinevirtual
representsOdd(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsPositive(bool=false)YesterdayVariableinlinevirtual
representsRational(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsReal(bool b=false) (defined in YesterdayVariable)YesterdayVariableinlinevirtual
representsScalar() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in DynamicVariable)DynamicVariablevirtual
set(const MathStructure &o)DynamicVariablevirtual
set(string expression_)DynamicVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
setUncertainty(string standard_uncertainty) (defined in KnownVariable)KnownVariablevirtual
setUnit(string unit_expression) (defined in KnownVariable)KnownVariablevirtual
sexpression (defined in KnownVariable)KnownVariableprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constKnownVariableinlinevirtual
suncertainty (defined in KnownVariable)KnownVariableprotected
sunit (defined in KnownVariable)KnownVariableprotected
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constVariableinlinevirtual
uncertainty() const (defined in KnownVariable)KnownVariablevirtual
unit() const (defined in KnownVariable)KnownVariablevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
YesterdayVariable() (defined in YesterdayVariable)YesterdayVariable
YesterdayVariable(const YesterdayVariable *variable) (defined in YesterdayVariable)YesterdayVariableinline
~DynamicVariable() (defined in DynamicVariable)DynamicVariablevirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~KnownVariable() (defined in KnownVariable)KnownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-2.8.2/docs/reference/html/classKnownVariable.png0000644000175000017500000000501713401033110021223 00000000000000‰PNG  IHDRvøV¯[JPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2 žIDATxíÝÛr²Ì†Ñá¤Êû¿äwˆÛä›Ö¿xGEš´Í)lÚ0 C?ب¡ªª[²ƒ-KvÐ(ÙA@£d’4ºÍnwü©ªzÁÍ~?O<o²ƒ-[É®ªêcɸ›ÝñnwøÂÓz8þ=:?ïÆ=OoªªšKv°e÷W»S1džΑ;ÛU-n“—ÏnUU3ɶl%»ãÏl9›;e4þ<{“Ý‹n²ƒ-»¿Ú­d7íq|y5»ÓžÉæž^déM÷Y®lµ«ëm¾CUMnɶìnv§í¸¦Ý^dwUÓ[.²ðš•ìNWÈKv—Kêù¥ñò:¹O¯ÆÇ+ìä¹déí6»ªšÜn›©ªú¥d[–ì  Q²ƒ€Fϲ«ªúsɶ,ÙA@£d’4JvÐh†¡¼c=’ôÙïÓ´IvÐ秺t]’´JtÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙAÀ»†aúAÀF UUÝ’lY²ƒ€FÉ%;h”ì  Ñ+Ùí&ON-^¯ªº'ÙÁ–}œÝM€Éžzé"{(êXÕnwº;þ^6_v8¿^UõH²ƒ-{+»k]Çûóæuk̳ªêd[öÞj·ÈïœÝx—ì à±—²;_SÑùªw^é.Ù_¯ªz$ÙÁ–½•Ýâb{s÷Jrɶîµì.‹Ýzvcs¹ÈBÀcoew¸ŠNó:mþüNŸ¨ªz"ÙÁ–½˜]UÕßIv°eÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Ñ0 C?xÇz$;è³ß§;h“ì  ÏOuéº$;h•è  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€wív»]?ب¯ì`Ë’4JvÐ(ÙA@£dn 8>ñ´‹Ó‹Ý®›çG÷“ì`ËV³{žÅjv7GMv0·–ÝyÁÛîw—ž¼<=.Œ—íÃïeó¼×õ Lnɶl%»óJvªíÛøháÄt÷ÉÖêâ™ì`Ën“8¯N—€Æ»yFÓœÛËw%;ˆ/²³›¬Š×ëé¸9y×ùu\oɶl5‰‰ñîô{“ݽݧ™ÂL²ƒ-[_‰n²cfúw%»ÛÕ1ÙA<Êî¼–¯š+y]ßyx}šçqóçwñ~\oɶì+$;زd’4JvÐ(ÙA@£d’4JvÐh·ÛíúA@À;öÐ#ÙA@Ÿý>ÝA@›d}~ªKwÐ%ÙA@«D’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’¼k†áCûa†Ï@ÀF UUÝ’lY²ƒ€FÉ%;h”ì  Ñ$»Ý᧪ê±ë.§G‹·,_^¾žì`ë¦Ù݉¤ªjÕjv7&;\oËìŽw§Åï´þl¯œŸ7¯Ûǽ®ïXìŸì gwzxÝ:ܦOÕ®jnùŽÅþÉâÉj7½P·ñËdzw$;˜¹“Ý| ›­[“ìÎ×ÔË.·ï¸ì~=ÙA¬gw®i¾èíª¦·Yv‹‹íÚ«êzKv°eËìΞgw´jW3—»•ý“Ä4»ë¥p¾†ý<{ qÒÐlÇË.7ï¸^ygרd›6Énò³¼*VUý¡d[¶šÝ?®.ÙÁ¦­e÷¯«Kv°iëÙªª(ÙÁ–%;h”ì  Q²ƒ€FÉ Ã0ôƒ€€wì!  G²ƒ€>û}ºƒ€6ÉúüT—î  K²ƒ€V‰%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h·ßï÷±ßï÷ý¾ýmÏøð=ÉÚe|h—i‡ïIvÐ.ãÃ÷$;h—ñ¡]¦¾'ÙA»Œß“ì ]Ƈv™vøždí2>|O²ƒvÚeÚá{’´Ëøð=ÉÚe|h—i‡ïù/? Ãð¡ý0 Ãg2þÆÇªªºMÿíªªnÿÛãgÚ«ªšeüL{UU³ŒŸi¯ªj–ñ3íUUÍ2þaw“¿Uu½­¾pÝ}óú‡góhÚç1?“¿öÁø+£VU=÷Ñ©¬Œ¿zÆw?ÿ_žÀýìŽû½šÝÍxŸd÷Âûªªf><›'ßö§³ÿÛIXÿƒæ>=•žÝ“x°Úv<:8n\ž^8í9îwx<{cUÕ­‡Ùw9øäh³ÃžÇùðl^Ên<…Ùç>œ„ÙG¸`23¿üÿ&ŒUU-Ü]í®+Þx´ÅEöæÒòÉÙ|ÝxÀËò›IøËì>9•Çùqe¾mõПÎÅÙ].Ù‹¯Åíõp:%UU+žg7{núÕ»“Ý{gó~v×cϦúÃIø‹ì~óy<Êîö‚·\Ç~?³›^Èoc¸3ÊÚ¥¼ªjæ¥ìV–Ú•ì>:›÷²›OÃ_LÂï³ûÝçñ$»]Õô6;ìŸÌÅãì.kå5èç…ùUèô œ>QUµâiv㨓£Í»Ìî½³y%»ë)L8ÿö< /ró•ý:ýó™ùÍçñ`üÉ¿}nfz4w³«ªúwž|ìUUÿÔ/Æ¿ûUªªzÕøÿÿ“¹HvoŽÿ'ÕýŸd÷ù\$»÷Æÿ›êþ?²ûÅ\$»Œ_UÕ,ÙeüªªfÉ.ãWU5Kv¿ªªY²ËøUUÍ~²†ah7ù·‡aÚeüïŽÿ?Êƹ‚œ)ÄIEND®B`‚libqalculate-2.8.2/docs/reference/html/classExpressionItemArgument-members.html0000644000175000017500000003464313401033110024761 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
ExpressionItemArgument Member List

This is the complete list of members for ExpressionItemArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constExpressionItemArgumentvirtual
ExpressionItemArgument(string name_="", bool does_test=true, bool does_error=true) (defined in ExpressionItemArgument)ExpressionItemArgument
ExpressionItemArgument(const ExpressionItemArgument *arg) (defined in ExpressionItemArgument)ExpressionItemArgument
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constExpressionItemArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constExpressionItemArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constExpressionItemArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constExpressionItemArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~ExpressionItemArgument() (defined in ExpressionItemArgument)ExpressionItemArgumentvirtual
libqalculate-2.8.2/docs/reference/html/functions_func_i.html0000644000175000017500000001022613401033110021144 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- i -

libqalculate-2.8.2/docs/reference/html/functions_o.html0000644000175000017500000000403413401033110020137 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- o -

libqalculate-2.8.2/docs/reference/html/classDecimalPrefix-members.html0000644000175000017500000002004113401033110022777 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
DecimalPrefix Member List

This is the complete list of members for DecimalPrefix, including all inherited members.

DecimalPrefix(int exp10, string long_name, string short_name="", string unicode_name="")DecimalPrefix
exp (defined in DecimalPrefix)DecimalPrefixprotected
exponent(int iexp=1) constDecimalPrefix
exponent(const Number &nexp) constDecimalPrefix
l_name (defined in Prefix)Prefixprotected
longName(bool return_short_if_no_long=true, bool use_unicode=false) constPrefix
name(bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constPrefix
Prefix(string long_name, string short_name="", string unicode_name="")Prefix
s_name (defined in Prefix)Prefixprotected
setExponent(int iexp)DecimalPrefix
setLongName(string long_name)Prefix
setShortName(string short_name)Prefix
setUnicodeName(string unicode_name)Prefix
shortName(bool return_long_if_no_short=true, bool use_unicode=false) constPrefix
type() constDecimalPrefixvirtual
u_name (defined in Prefix)Prefixprotected
unicodeName(bool return_short_if_no_uni=true) constPrefix
value(const Number &nexp) constDecimalPrefixvirtual
value(int iexp) constDecimalPrefixvirtual
value() constDecimalPrefixvirtual
~DecimalPrefix() (defined in DecimalPrefix)DecimalPrefix
~Prefix() (defined in Prefix)Prefixvirtual
libqalculate-2.8.2/docs/reference/html/globals.html0000644000175000017500000002601313401033110017235 00000000000000 libqalculate-2.8.2: File Members
libqalculate-2.8.2
Here is a list of all documented file members with links to the documentation:

- a -

- c -

- e -

- f -

- m -

- n -

- p -

- s -

- t -

- u -

- v -

libqalculate-2.8.2/docs/reference/html/structSortOptions.html0000644000175000017500000000764713401033110021376 00000000000000 libqalculate-2.8.2: SortOptions Struct Reference
libqalculate-2.8.2
SortOptions Struct Reference

Options for ordering the parts of a mathematical expression/result before display. More...

#include <includes.h>

Public Attributes

bool prefix_currencies
 Put currency units before quantity. Default: true.
 
bool minus_last
 If true, avoid placing negative terms first. Default: true.
 

Detailed Description

Options for ordering the parts of a mathematical expression/result before display.


The documentation for this struct was generated from the following file:
libqalculate-2.8.2/docs/reference/html/functions_d.html0000644000175000017500000000731613401033110020132 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- d -

libqalculate-2.8.2/docs/reference/html/globals_enum.html0000644000175000017500000001052013401033110020255 00000000000000 libqalculate-2.8.2: File Members
libqalculate-2.8.2
 
libqalculate-2.8.2/docs/reference/html/classQalculateDateTime.html0000644000175000017500000005602713401033110022200 00000000000000 libqalculate-2.8.2: QalculateDateTime Class Reference
libqalculate-2.8.2

Public Member Functions

 QalculateDateTime (long int initialyear, int initialmonth, int initialday)
 
 QalculateDateTime (const Number &initialtimestamp)
 
 QalculateDateTime (string date_string)
 
 QalculateDateTime (const QalculateDateTime &date)
 
bool operator> (const QalculateDateTime &date2) const
 
bool operator< (const QalculateDateTime &date2) const
 
bool operator>= (const QalculateDateTime &date2) const
 
bool operator<= (const QalculateDateTime &date2) const
 
bool operator!= (const QalculateDateTime &date2) const
 
bool operator== (const QalculateDateTime &date2) const
 
bool isFutureDate () const
 
bool isPastDate () const
 
void setToCurrentDate ()
 
void setToCurrentTime ()
 
bool set (long int newyear, int newmonth, int newday)
 
bool set (const Number &newtimestamp)
 
bool set (string date_string)
 
void set (const QalculateDateTime &date)
 
string toISOString () const
 
string toLocalString () const
 
string print (const PrintOptions &po=default_print_options) const
 
long int year () const
 
long int month () const
 
long int day () const
 
long int hour () const
 
long int minute () const
 
const Numbersecond () const
 
void setYear (long int newyear)
 
bool setTime (long int ihour, long int imin, const Number &nsec)
 
bool timeIsSet () const
 
bool addDays (const Number &ndays)
 
bool addMonths (const Number &nmonths)
 
bool addYears (const Number &nyears)
 
bool addHours (const Number &nhours)
 
bool addMinutes (const Number &nminutes, bool remove_leap_second=true, bool convert_to_utc=true)
 
bool addSeconds (const Number &seconds, bool count_leap_seconds=true, bool convert_to_utc=true)
 
bool add (const QalculateDateTime &date)
 
int weekday () const
 
int week (bool start_sunday=false) const
 
int yearday () const
 
Number timestamp (bool reverse_utc=false) const
 
Number secondsTo (const QalculateDateTime &date, bool count_leap_seconds=true, bool convert_to_utc=true) const
 
Number daysTo (const QalculateDateTime &date, int basis=1, bool date_func=true, bool remove_leap_seconds=true) const
 
Number yearsTo (const QalculateDateTime &date, int basis=1, bool date_func=true, bool remove_leap_seconds=true) const
 

Public Attributes

string parsed_string
 

Protected Attributes

long int i_year
 
long int i_month
 
long int i_day
 
long int i_hour
 
long int i_min
 
Number n_sec
 
bool b_time
 

The documentation for this class was generated from the following file:
  • libqalculate/QalculateDateTime.h
libqalculate-2.8.2/docs/reference/html/classNumber-members.html0000644000175000017500000022660413401033110021530 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
Number Member List

This is the complete list of members for Number, including all inherited members.

abs() (defined in Number)Number
acos() (defined in Number)Number
acosh() (defined in Number)Number
add(const Number &o)Number
add(long int i) (defined in Number)Number
add(const Number &o, MathOperation op) (defined in Number)Number
airy() (defined in Number)Number
allroots(const Number &o, vector< Number > &roots) (defined in Number)Number
arg() (defined in Number)Number
asin() (defined in Number)Number
asinh() (defined in Number)Number
atan() (defined in Number)Number
atan2(const Number &o, bool allow_zero=false) (defined in Number)Number
atanh() (defined in Number)Number
b_approx (defined in Number)Numberprotected
b_imag (defined in Number)Numberprotected
besselj(const Number &o) (defined in Number)Number
bessely(const Number &o) (defined in Number)Number
binomial(const Number &m, const Number &k) (defined in Number)Number
bitAnd(const Number &o) (defined in Number)Number
bitCmp(unsigned int bits) (defined in Number)Number
bitEqv(const Number &o) (defined in Number)Number
bitNot() (defined in Number)Number
bitOr(const Number &o) (defined in Number)Number
bitXor(const Number &o) (defined in Number)Number
catalan()Number
cbrt() (defined in Number)Number
ceil(const Number &o) (defined in Number)Number
ceil() (defined in Number)Number
clear(bool keep_precision=false) (defined in Number)Number
clearImaginary() (defined in Number)Number
clearReal() (defined in Number)Number
compare(const Number &o, bool ignore_imag=false) const (defined in Number)Number
compare(long int i) const (defined in Number)Number
compareAbsolute(const Number &o, bool ignore_imag=false) const (defined in Number)Number
compareApproximately(const Number &o, int prec=EQUALS_PRECISION_LOWEST) const (defined in Number)Number
compareImaginaryParts(const Number &o) const (defined in Number)Number
compareRealParts(const Number &o) const (defined in Number)Number
complexDenominator() const (defined in Number)Number
complexNumerator() const (defined in Number)Number
cos() (defined in Number)Number
cosh() (defined in Number)Number
coshint() (defined in Number)Number
cosint() (defined in Number)Number
denominator() const (defined in Number)Number
denominatorEquals(long int i) const (defined in Number)Number
denominatorIsEqual(const Number &o) const (defined in Number)Number
denominatorIsEven() const (defined in Number)Number
denominatorIsGreater(const Number &o) const (defined in Number)Number
denominatorIsGreaterThan(long int i) const (defined in Number)Number
denominatorIsLess(const Number &o) const (defined in Number)Number
denominatorIsLessThan(long int i) const (defined in Number)Number
denominatorIsTwo() const (defined in Number)Number
digamma() (defined in Number)Number
divide(const Number &o)Number
divide(long int i) (defined in Number)Number
doubleFactorial() (defined in Number)Number
e(bool use_cached_number=true)Number
equals(const Number &o, bool allow_interval=false, bool allow_infinite=false) const (defined in Number)Number
equals(long int i) const (defined in Number)Number
equalsApproximately(const Number &o, int prec) const (defined in Number)Number
equalsZero() const (defined in Number)Number
erf() (defined in Number)Number
erfc() (defined in Number)Number
euler()Number
exp() (defined in Number)Number
exp10(const Number &o)Number
exp10()Number
exp2(const Number &o)Number
exp2()Number
expint() (defined in Number)Number
factorial() (defined in Number)Number
factorize(vector< Number > &factors) (defined in Number)Number
fl_value (defined in Number)Numberprotected
floatValue() const (defined in Number)Number
floor(const Number &o) (defined in Number)Number
floor() (defined in Number)Number
frac() (defined in Number)Number
fu_value (defined in Number)Numberprotected
gamma() (defined in Number)Number
gcd(const Number &o) (defined in Number)Number
getBoolean() const (defined in Number)Number
getCentralInteger(Number &nr_int, bool *b_multiple=NULL, vector< Number > *v=NULL) const (defined in Number)Number
hasImaginaryPart() const (defined in Number)Number
hasNegativeSign() const (defined in Number)Number
hasPositiveSign() const (defined in Number)Number
hasRealPart() const (defined in Number)Number
i_precision (defined in Number)Numberprotected
i_value (defined in Number)Numberprotected
igamma(const Number &o) (defined in Number)Number
imaginaryPart() constNumber
imaginaryPartIsInterval() const (defined in Number)Number
imaginaryPartIsNegative() const (defined in Number)Number
imaginaryPartIsNonNegative() const (defined in Number)Number
imaginaryPartIsNonPositive() const (defined in Number)Number
imaginaryPartIsNonZero() const (defined in Number)Number
imaginaryPartIsPositive() const (defined in Number)Number
includesInfinity(bool ignore_imag=false) const (defined in Number)Number
includesMinusInfinity() const (defined in Number)Number
includesPlusInfinity() const (defined in Number)Number
integer() const (defined in Number)Number
integerLength() const (defined in Number)Number
internalImaginary() const (defined in Number)Number
internalLowerFloat() const (defined in Number)Number
internalLowerFloat() (defined in Number)Number
internalRational() const (defined in Number)Number
internalRational() (defined in Number)Number
internalType() const (defined in Number)Number
internalUpperFloat() const (defined in Number)Number
internalUpperFloat() (defined in Number)Number
intervalToMidValue() (defined in Number)Number
intervalToPrecision(long int min_precision=2) (defined in Number)Number
intRand(const Number &ceil) (defined in Number)Number
intValue(bool *overflow=NULL) constNumber
iquo(const Number &o) (defined in Number)Number
iquo(unsigned long int i) (defined in Number)Number
iquo(const Number &o, Number &r) (defined in Number)Number
irem(const Number &o) (defined in Number)Number
irem(const Number &o, Number &q) (defined in Number)Number
isApproximate() constNumber
isComplex() const (defined in Number)Number
isEven() const (defined in Number)Number
isFloatingPoint() constNumber
isFraction() const (defined in Number)Number
isGreaterThan(const Number &o) const (defined in Number)Number
isGreaterThan(long int i) const (defined in Number)Number
isGreaterThanOrEqualTo(const Number &o) const (defined in Number)Number
isGreaterThanOrEqualTo(long int i) const (defined in Number)Number
isI() const (defined in Number)Number
isInfinite(bool ignore_imag=true) constNumber
isInteger(IntegerType integer_type=INTEGER_TYPE_NONE) const (defined in Number)Number
isIntegerDivisible(const Number &o) const (defined in Number)Number
isInterval(bool ignore_imag=true) const (defined in Number)Number
isLessThan(const Number &o) const (defined in Number)Number
isLessThan(long int i) const (defined in Number)Number
isLessThanOrEqualTo(const Number &o) const (defined in Number)Number
isLessThanOrEqualTo(long int i) const (defined in Number)Number
isMinusI() const (defined in Number)Number
isMinusInfinity(bool ignore_imag=false) constNumber
isMinusOne() const (defined in Number)Number
isNegative() const (defined in Number)Number
isNonNegative() const (defined in Number)Number
isNonPositive() const (defined in Number)Number
isNonZero() const (defined in Number)Number
isOdd() const (defined in Number)Number
isOne() const (defined in Number)Number
isPerfectSquare() const (defined in Number)Number
isPlusInfinity(bool ignore_imag=false) constNumber
isPositive() const (defined in Number)Number
isqrt() (defined in Number)Number
isRational() const (defined in Number)Number
isReal() const (defined in Number)Number
isTwo() const (defined in Number)Number
isUndefined() const (defined in Number)Number
isZero() const (defined in Number)Number
lambertW() (defined in Number)Number
lcm(const Number &o) (defined in Number)Number
lintValue(bool *overflow=NULL) const (defined in Number)Number
llintValue() const (defined in Number)Number
ln() (defined in Number)Number
log(const Number &o) (defined in Number)Number
logint() (defined in Number)Number
lowerEndPoint(bool include_imag=false) const (defined in Number)Number
markAsImaginaryPart(bool is_imag=true) (defined in Number)Number
mergeInterval(const Number &o, bool set_to_overlap=false) (defined in Number)Number
mod(const Number &o) (defined in Number)Number
multiFactorial(const Number &o) (defined in Number)Number
multiply(const Number &o)Number
multiply(long int i) (defined in Number)Number
n_type (defined in Number)Numberprotected
negate()Number
Number()Number
Number(string number, const ParseOptions &po=default_parse_options)Number
Number(long int numerator, long int denominator=1, long int exp_10=0)Number
Number(const Number &o)Number
numerator() const (defined in Number)Number
numeratorEquals(long int i) const (defined in Number)Number
numeratorIsEven() const (defined in Number)Number
numeratorIsGreaterThan(long int i) const (defined in Number)Number
numeratorIsLessThan(long int i) const (defined in Number)Number
numeratorIsMinusOne() const (defined in Number)Number
numeratorIsOne() const (defined in Number)Number
operator!() const (defined in Number)Number
operator!=(const Number &o) const (defined in Number)Number
operator!=(long int i) const (defined in Number)Number
operator&&(const Number &o) const (defined in Number)Number
operator*(const Number &o) const (defined in Number)Number
operator*(long int i) const (defined in Number)Number
operator*=(const Number &o) (defined in Number)Number
operator*=(long int i) (defined in Number)Number
operator+(const Number &o) const (defined in Number)Number
operator+(long int i) const (defined in Number)Number
operator++(int) (defined in Number)Number
operator+=(const Number &o) (defined in Number)Number
operator+=(long int i) (defined in Number)Number
operator-() const (defined in Number)Number
operator-(const Number &o) const (defined in Number)Number
operator-(long int i) const (defined in Number)Number
operator--(int) (defined in Number)Number
operator-=(const Number &o) (defined in Number)Number
operator-=(long int i) (defined in Number)Number
operator/(const Number &o) const (defined in Number)Number
operator/(long int i) const (defined in Number)Number
operator/=(const Number &o) (defined in Number)Number
operator/=(long int i) (defined in Number)Number
operator<(const Number &o) const (defined in Number)Number
operator<(long int i) const (defined in Number)Number
operator<=(const Number &o) const (defined in Number)Number
operator<=(long int i) const (defined in Number)Number
operator=(const Number &o) (defined in Number)Number
operator=(long int i) (defined in Number)Number
operator==(const Number &o) const (defined in Number)Number
operator==(long int i) const (defined in Number)Number
operator>(const Number &o) const (defined in Number)Number
operator>(long int i) const (defined in Number)Number
operator>=(const Number &o) const (defined in Number)Number
operator>=(long int i) const (defined in Number)Number
operator^(const Number &o) const (defined in Number)Number
operator^(long int i) const (defined in Number)Number
operator^=(const Number &o) (defined in Number)Number
operator^=(long int i) (defined in Number)Number
operator||(const Number &o) const (defined in Number)Number
pi()Number
polylog(const Number &o) (defined in Number)Number
precision(int calculate_from_interval=0) constNumber
precisionToInterval() (defined in Number)Number
print(const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const (defined in Number)Number
printDenominator(int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const (defined in Number)Number
printImaginaryDenominator(int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const (defined in Number)Number
printImaginaryNumerator(int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const (defined in Number)Number
printNumerator(int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const (defined in Number)Number
r_value (defined in Number)Numberprotected
raise(const Number &o, bool try_exact=true)Number
rand() (defined in Number)Number
realPart() constNumber
realPartIsNegative() const (defined in Number)Number
realPartIsNonNegative() const (defined in Number)Number
realPartIsNonZero() const (defined in Number)Number
realPartIsPositive() const (defined in Number)Number
realPartIsRational() const (defined in Number)Number
recip()Number
relativeUncertainty() const (defined in Number)Number
rem(const Number &o) (defined in Number)Number
root(const Number &o) (defined in Number)Number
round(const Number &o, bool halfway_to_even=true) (defined in Number)Number
round(bool halfway_to_even=true) (defined in Number)Number
set(string number, const ParseOptions &po=default_parse_options) (defined in Number)Number
set(long int numerator, long int denominator=1, long int exp_10=0, bool keep_precision=false, bool keep_imag=false) (defined in Number)Number
set(const Number &o, bool merge_precision=false, bool keep_imag=false) (defined in Number)Number
setApproximate(bool is_approximate=true)Number
setFalse() (defined in Number)Number
setFloat(long double d_value) (defined in Number)Number
setImaginaryPart(const Number &o) (defined in Number)Number
setImaginaryPart(long int numerator, long int denominator=1, long int exp_10=0) (defined in Number)Number
setInternal(const mpz_t &mpz_value, bool keep_precision=false, bool keep_imag=false) (defined in Number)Number
setInternal(mpz_srcptr mpz_value, bool keep_precision=false, bool keep_imag=false) (defined in Number)Number
setInternal(const mpq_t &mpq_value, bool keep_precision=false, bool keep_imag=false) (defined in Number)Number
setInternal(const mpz_t &mpz_num, const mpz_t &mpz_den, bool keep_precision=false, bool keep_imag=false) (defined in Number)Number
setInternal(const mpfr_t &mpfr_value, bool merge_precision=false, bool keep_imag=false) (defined in Number)Number
setInterval(const Number &nr_lower, const Number &nr_upper, bool keep_precision=false) (defined in Number)Number
setLogicalNot() (defined in Number)Number
setMinusInfinity(bool keep_precision=false, bool keep_imag=false) (defined in Number)Number
setNegative(bool is_negative) (defined in Number)Number
setPlusInfinity(bool keep_precision=false, bool keep_imag=false) (defined in Number)Number
setPrecision(int prec) (defined in Number)Number
setPrecisionAndApproximateFrom(const Number &o) (defined in Number)Number
setToFloatingPoint() (defined in Number)Number
setTrue(bool is_true=true) (defined in Number)Number
setUncertainty(const Number &o, bool force_interval=false) (defined in Number)Number
shift(const Number &o) (defined in Number)Number
shiftLeft(const Number &o) (defined in Number)Number
shiftRight(const Number &o) (defined in Number)Number
signum() (defined in Number)Number
sin() (defined in Number)Number
sinh() (defined in Number)Number
sinhint() (defined in Number)Number
sinint() (defined in Number)Number
smod(const Number &o) (defined in Number)Number
splitInterval(unsigned int nr_of_parts, vector< Number > &v) const (defined in Number)Number
sqrt() (defined in Number)Number
square()Number
subtract(const Number &o)Number
subtract(long int i) (defined in Number)Number
tan() (defined in Number)Number
tanh() (defined in Number)Number
testErrors(int error_level=1) const (defined in Number)Numberprotected
testFloatResult(bool allow_infinite_result=true, int error_level=1, bool test_integer=true) (defined in Number)Numberprotected
testInteger() (defined in Number)Numberprotected
toBoolean() (defined in Number)Number
trunc(const Number &o) (defined in Number)Number
trunc() (defined in Number)Number
uintValue(bool *overflow=NULL) const (defined in Number)Number
ulintValue(bool *overflow=NULL) const (defined in Number)Number
uncertainty() const (defined in Number)Number
upperEndPoint(bool include_imag=false) const (defined in Number)Number
zeta()Number
~Number() (defined in Number)Numbervirtual
libqalculate-2.8.2/docs/reference/html/doxygen.png0000644000175000017500000000730313401033110017110 00000000000000‰PNG  IHDRh ;ˆØŠIDATxí]y\•Õº~45%TL Q”PE"q–Û11±]8a„w*©¨(*â" ˆzÀè`8 ¨‰¢mÅ,’òà„p$%”œBó(8k†Ü÷ýÜû6lòö»§k÷Ç÷[ÏÞß·Ö;?k½ëßÕÕÕPxÑêÏ't´ÏùÈ€zÀÇÅ3_€Q4€g@œmÿ ¾ò‰âci‰ôçÿ{ ðÇð¬ù~½Á€4:õHcÂü ðŸÁ³„ª'ÕPÆæ P7^h،♠zb„cóP¨„ 3‚† Ò}çÿO²qÁºNkÝTÛ(É?d Ç~z<’«4Óǡ؞Þv­zµÙ¦õ¬ZâdÛ,Ë6Ók±]Fz< ¾ZçƒsÕ?ìƒsUø2SÉåwê1”c`[ì—}%ѽ.Ô¼6‚BLZ˜û!F8[ ¹…×TéÛ— »Þ#gó]å:vžu?‡vèbÙR˜?wùŽŸ¾ÊÐgbÑÉÌÕ$kF~Ê;عÆ•¢ïX®?ÉèlÆÙôõà»Nʪ¼­,ìHC§gAz•ÆlÓº­gÑú ]œjÎñåM…3ÓÚæoÒ³'=‘$Ò÷f}G•ŸS_‡öèco.Êȹ :ó£ Ãds®Ù:1=¼{ƒå9?÷ý…zqÛvîÓi‰D’p¿Ë šmÙíoÛâýaÖüEqÒµwÌ}¿~{òj€ç{ôºŸFNëí[ëOq·ÇOSúXO]°>‚‚muæÄ¾e¤“5Ë{¨JÕ¯£(›´«bÂçû’ÍlÓÅ}žïú`éUÞy„ac§Á†ÔCºŠóAkl‘±y¥†ô¢ùôs÷Aø¬7ÄõôoJ±äÄ ù.¥Be. Z¬Ð×ÇÈöå¹­ù'Ù-PëìŠyF.ž‚žÝÚ€lp&.êˆð•jò7’re’z19»ã§HGíø%œüq°ïüz׈c¬_k_")ŸHJnÐÑ~ˆÐÖ˜á´äÕ5 µÁq€ÿ5#¸·îà¶+9T‘‚ ðŽ÷Rܸrz“Ï´Ì =Ï…{ðáO£Èf ¡Íwg|Ž’Ü/¢Þ$÷¯¢ëðúÀ;¿à¨Ö™âÒÆ­]¯ÜW"Þ/< ‡÷DÏà°½üB}çyIEc^—ƒ=[V“Ýh²ëMä$l];Kû®¸ýr¦È*Åò ÿtÒõ$]•MŸ÷´;×I€1èó!‚œõ¸M õ¨(fÌæ<ÁÎÎò5~z¿ù¶ž mÌêÕ >–âÚ©âëˆIÎÞçz;ãu[i·eç^ÆÜÙÓ³NÞëF6B\}7†»+üŽÓ,Ã'a ½˜-yHY¿,‘^—ñfú~ß?Hcø¸…¸ñó{Z+4\såƒû·¯Ù·nߣð«íFÆ¡sغëû§D¾?ò<–Ævkx0ÅM±ælذÁIÓxÿd”žÜÉ÷EE»AªM«g*È£YEí7Û™^[uíý®v[wGå†=Ed¼n×¶ÆæÖÅl¡'¨pGÚk+‹æ¢À¬¨C8ªâš2 dz3H£ß ¡¨BÒûSÃÅù[wŘ ~xpçútÁæmö¤Å£¥iQæ­‰AB1ÉfÙ‰›4u¹ïìIÒ]Ë6äò%ÿ†† 1t.’NJph¬zÌ ÎR1Ž"3-"¸‡‹&ìó°1âüžìó[:‡ï„¼‘……N m–“W0®_èÜœ ×õ6ùò&»)Æìꦬýæ}¬ñ~»{múù]z½£M•ºP~^Îá:eQTÙ_*7ÕÄ9É8—·Ëï 3°¶47E•î¿u÷“SÉ»U¯ _ NíºôW¬e¸ÄNÓ|»;™¿;ŒæÅd"ȉôøòÞµõï¾®½"èÄ´ÖMM+bYµ‘_ÉæEÝüÎ]P»¹XKÐI½Þ¥oE<_¹(„EP±Œ|mÇÁ¡‘Ý,ŠÓ©ººZ±Îߺ§×kÝ,kÍMš`Äø…jzeU»æ ™Át3ÓÀ½˜6—ÒöùË·r¨¹Ñ}““wö:Χùë¼ ¿|‚TܵÉQˆKßç_ÁâÀ™œ”pÑÐóໃ¼Ydâ0!®àa –øöçW$ÃÁ‘Á$/\¬$ð 2ÞímÞLH‹Ÿ èd£HVÜ,:ò½»RÍZšJ­a„z*>‹_…NT(ù‚^SVF­U¹8ñEþôñ܈óùnd;«®8™\C]ø=Èêm¬Æ:‚´ÆbãDd=Áãßžˆ‹UU5O‹|]þð®Pèêv‰á\]2ßìÿ"yÈ[ïyʧz£g{Y«{„Ùø5©ÿ;w{N3é­nâĨw§Á¢ÍK¢Ý­ûÏ29Id¿’ì y)ìPÞò8ŒÅ©¯‰±@mPÔñwjl,6 áhWÕ˜d öà uõmÁp®.™á£Ç…twöR x­BδYcŒxg*vo  yò‘•“[¬?ÜVœ˜0ÒN¡O난~Žó’¯·h#´Hkýœ±8kÓß^Àq@]àÓ“ø,56´¯÷Í-κU»n…[>]@nîøÏœp›[œ6# €4tën¯:ŽÒþ}…—8äT9_žY$/´G’K™©ù†•(óÑ’Mø©`ŸÉdѺ;ùO‹B Ó&P{qöhJÉ+Úé–§¦l2«MïöÝ_1ÑÓ«’t¸½±l€ëØya ¦ô©«®½ÆL^¬žêñš¸ùy.¾Û½Š[ u/]½‹iS}øN>²e1™q‡jfÚ&¢©iT\=kÏ›ÀXô-.84V5ðu!TE˜ þ.ŒOH´¶4—zwTr.ï‰¦Ë xõµ·œÖ„HÆù£žÈHùg Ñhñ’T$ßyq¸zþ¨p¿´ë< q•ró÷š‰wÿÍÑð–I]´–æI²é²˜sÂ"×:Õ–bÕ¦“ÈÙL6¢9VÊÓWž§<æ;”3?ý©Mê3AV#µ±ËÞ¯‘ž K£UrÝ9!›qát¦H£Ù+6ÇV…/TS^pÃùqgLP'Ú5E ‚–ÀÞºîÄ Ën"2|Ÿ;®W»Îý"Ö¬TwÖâµtúŽO'› á+W Ã+¦âZÌ–<ÕÆ&nOÝ,IŠ£06.ÁZ.Çñúøh*INÚ’Oe½ÉgBXÐÔZóäøä9èü“hÒíDSš¥¡Ê µA¯/Ôc¸ö“`A§¯"zå|‘ €ÅŸ¨ú;HÍ#‚Î|%ÄOˆƒ«OàÌÉÐÜD ž mÜðâc–ƤÉÂqm¶uË&~÷núÒË £ÇÏ€ZÕj =«_n[‡‡÷nN§ÏÝ$_¾bE˜‚€Õ)ù8¾?6‘lú“ÍÙæÖ}#bW( œ³d-®•p&¡ý’œÖa”"9öõņÐ$’Ú›AÜ!ä;ÐÑõè{~á¹8‘ÛÞ£1ÛÓÉ0ž`²#´kÒuäNÅÖ Q¹bhæ ”8ûÓMáŽa›•¿”w±h²¢®qŠæ°(bK ‚’Z¾Ò%ÐÆémáãÖË(Éý‚ÛJ)@> þ›7% ï{y Á“¾ÆÒîohfòô>{pÿ.­_Î%±ÉèägëlZØ\B2B #™¸ÚüÒºp‚hÝšü®[¥Ü<‹#SpñÌA7’ãØHƒt4:Ÿ|g¨tÓL¶*($Æ©»ì…®ù’ó÷$;b›ÔÙ`=¶£¦M„MÌÄ5ò«·Ç¾“H·ÌH.¼žHeAîº5}r­dõ¨±)ÀT};€Q5iÖ2…O0ü…0óñÃ;óæ,Š´²µ냔}g‘£]‹7å9ˆà©_{üèîêžC>úhê{Ž .ÈìðIIð€?[Kswz6Òuíý¬;µ€ç§OåâJÉa˶zv°éd† ¤µâ‚l´é舊«Åüy¾c÷ÁèÖÍ'ràúÅ™TWÕôÓ°¡L €|ʽŒ¼ì­høBã ÝTëî'ò]Kø£ìâÏ(=¹Kx €¿ LÌ,Pý¤Êµu‡¹…׈ §Å¾÷à1Ý«Äý;¿pGDäxZYÛ kfæ6¸ùóæ7®œ®þ6·ÕoÚ¾ÔH~ò®Þ¸â 8Uø“p<ºw3¡a£ÏÑ’‘3èÏ"€bˆ-ÎܺÏ_ªÅ]+ËM©zü°s“f-êçhÇãÑýÊãôÿ5}ZQNb{Ó?å%ÿ\SUõعIÓæ}~}p[œoÔÄ„êÐMMZáNÅå@>Œ„²á6(?¡Åé âK½+ü?À%ÝÝ·/Ç1‚9áUø?B)”ÕèâÞlÈÒêÏ @=àùÄÞžk­®ÅIEND®B`‚libqalculate-2.8.2/docs/reference/html/classVariableArgument-members.html0000644000175000017500000003432713401033110023527 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
VariableArgument Member List

This is the complete list of members for VariableArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constVariableArgumentvirtual
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constVariableArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constVariableArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constVariableArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constVariableArgumentvirtual
VariableArgument(string name_="", bool does_test=true, bool does_error=true) (defined in VariableArgument)VariableArgument
VariableArgument(const VariableArgument *arg) (defined in VariableArgument)VariableArgument
zeroForbidden() constArgument
~Argument()Argumentvirtual
~VariableArgument() (defined in VariableArgument)VariableArgumentvirtual
libqalculate-2.8.2/docs/reference/html/classYesterdayVariable.png0000644000175000017500000000225713401033110022103 00000000000000‰PNG  IHDRvøÃâ‹PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2>IDATxíë’£ FU¾ÿ#o¢ÈM̴̚LUzâ‘[ÃAlwÿcŒ÷C”¤»q­$ó‡´aý“¤ âÿŸ;ÔJÒÇüT»áù˵çAlç‘ï+©–‹¹M’¤–WO»ÍX×H’ä RwU}ß󒤆—ﶬ3¼“´_–É®°ÆµÆ¸À×ãZc\ `ŒkŒq-ÀbŒñ~ˆ’t7®•$cþ´6T÷®³ªuã’tÆ´‡ üºv]q]5„­X{óQßÒ¸$½âMmY}-S³´òö$éï>m§OÚ\ü²6ézˆíS§'ݵi\’^ñ¦¶;ìCq5«.·%™Z«w[ÞäCQ-¿5Í2Y’~×J’1®•$cæicŒñv>e¸Ÿ9Úe™â£}Xgx'i¿,“] `kŒq-€1®0ƵƸÀ×ãZ€+Äãý%én\+IÆümÈ7I:c èÂJ3ÕΖ9Ñþ×:Ö6ðž6=pØÊg±ïåѹwçƒÙÛÏßÞLQ¥CRu µéI6Û.˵fuxÕÞH›v·/‹v™z¹®ÝϺ¦­²ê…¶:•rž¹YÍJã’Êõ"¥zmzy½ö,¼Þ¦$5¼ø€Ú¤†ú>оÿn«Äª2ñL»Ž×Û[›ïg²$YãZI2Ƶ’dÌC³ïJ›Ît9ÎØã»dk÷74ØôXÛöh¢¤rdòmÆ'Ú‹ï¶Eû k*µk4{ÈaÆ¥L~ó’ôëœh­'Zk«ÿÇ'IÖ|6ÆoàS€û™£]–)Þ9Ú‡u†w’öË2ÙµÖ¸À×ãZc\ `ŒkŒq-€1®¸B!Üàn\ `ÌlíVô{ìéÐ5œYšÍúÖÚCü‰v-×úó«Z‹TÝÛÏÑôÁm]=udU‚·ñ¡6Q_iÎÖ,]ÒL,­¼½&¥RµZótññH¿ù&êT»›Ö»¶]n»évúeseê(jצñ±¶nç•ûh´Ç×t|ÚÁw[´ê«Yl mgö¾ÿ¼ÛÜU2¹¤sÎÕœ’ý-Ýu⮿W™ ð.Ïý‘öó©?ÑþhÃþ€)_§ !„Ûù†:`› ‹IEND®B`‚libqalculate-2.8.2/docs/reference/html/classDataObject-members.html0000644000175000017500000001621713401033110022275 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
DataObject Member List

This is the complete list of members for DataObject, including all inherited members.

a_properties (defined in DataObject)DataObjectprotected
b_uchanged (defined in DataObject)DataObjectprotected
DataObject(DataSet *parent_set)DataObject
eraseProperty(DataProperty *property)DataObject
getNonlocalizedKeyProperty(DataProperty *property)DataObject
getProperty(DataProperty *property, int *is_approximate=NULL)DataObject
getPropertyDisplayString(DataProperty *property)DataObject
getPropertyInputString(DataProperty *property)DataObject
getPropertyStruct(DataProperty *property)DataObject
isUserModified() constDataObject
m_properties (defined in DataObject)DataObjectprotected
parent (defined in DataObject)DataObjectprotected
parentSet() constDataObject
properties (defined in DataObject)DataObjectprotected
s_nonlocalized_properties (defined in DataObject)DataObjectprotected
s_properties (defined in DataObject)DataObjectprotected
setNonlocalizedKeyProperty(DataProperty *property, string s_value)DataObject
setProperty(DataProperty *property, string s_value, int is_approximate=-1)DataObject
setUserModified(bool user_modified=true)DataObject
libqalculate-2.8.2/docs/reference/html/classBinaryPrefix.png0000644000175000017500000000066513401033110021067 00000000000000‰PNG  IHDRRP½:Ò¢PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2DIDATxí]ŽÃ ‡)÷?ò6„`ÈKZ÷aµT :6¸É31Æè Q’<™JIò¡£ ëGR3^‘SLR=zÊ2b’ÔaD™ KoÓe²‡ÊäIØ×}½#g™=•2e‘¤+~«Ò*Í›vT6—ooü¨,U~ÖëSÚë‡JIz‡©”$þ³2Æ]cðÅ_¹,îNåËèíü‚òt|*œ˜J¦À‡©ða*|˜J€.!„à À“©ð¡(·^­€öE€c‹MY&€®S•il¥äŠÖ%¹þ¢L‘t›êd—ÊÝœ±kS¶1ûÁÍYVGZ´ùÎ~–u¬ÊÒÙø¾¨4¬Md·*ë í8Ûꛌ§¿¥,Ë.Ûs>ËüRÙ•ùq¯è1þ*<¶ƒÊ'/‚ùrðá;ÊBpårgݦ:ÔIEND®B`‚libqalculate-2.8.2/docs/reference/html/classTodayVariable.html0000644000175000017500000017021013401033110021365 00000000000000 libqalculate-2.8.2: TodayVariable Class Reference
libqalculate-2.8.2
TodayVariable Class Reference
Inheritance diagram for TodayVariable:
DynamicVariable KnownVariable Variable ExpressionItem

Public Member Functions

 TodayVariable (const TodayVariable *variable)
 
ExpressionItemcopy () const
 
virtual bool representsPositive (bool=false)
 
virtual bool representsNonNegative (bool=false)
 
virtual bool representsNonInteger (bool=false)
 
virtual bool representsNumber (bool b=false)
 
virtual bool representsReal (bool b=false)
 
virtual bool representsNonZero (bool b=false)
 
- Public Member Functions inherited from DynamicVariable
 DynamicVariable (string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true)
 
 DynamicVariable (const DynamicVariable *variable)
 
void set (const ExpressionItem *item)
 
const MathStructureget ()
 
void set (const MathStructure &o)
 
void set (string expression_)
 
int calculatedPrecision () const
 
bool calculatedWithInterval () const
 
virtual bool representsNegative (bool=false)
 
virtual bool representsNonPositive (bool=false)
 
virtual bool representsInteger (bool=false)
 
virtual bool representsRational (bool=false)
 
virtual bool representsComplex (bool=false)
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
virtual bool representsNonMatrix ()
 
virtual bool representsScalar ()
 
- Public Member Functions inherited from KnownVariable
 KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable ()
 
 KnownVariable (const KnownVariable *variable)
 
bool isKnown () const
 
virtual bool isExpression () const
 
virtual string expression () const
 
virtual string uncertainty () const
 
virtual string unit () const
 
int subtype () const
 
virtual void setUncertainty (string standard_uncertainty)
 
virtual void setUnit (string unit_expression)
 
virtual bool representsFraction (bool=false)
 
virtual bool representsNonComplex (bool=false)
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Additional Inherited Members

- Protected Attributes inherited from DynamicVariable
bool always_recalculate
 
- Protected Attributes inherited from KnownVariable
MathStructuremstruct
 
bool b_expression
 
int calculated_precision
 
bool calculated_with_interval
 
bool calculated_with_units
 
string sexpression
 
string suncertainty
 
string sunit
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Member Function Documentation

◆ representsPositive()

virtual bool TodayVariable::representsPositive ( bool  = false)
inlinevirtual

Returns if the variable represents a positive value.

Reimplemented from DynamicVariable.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/structExpressionName.html0000644000175000017500000003006213401033110022016 00000000000000 libqalculate-2.8.2: ExpressionName Struct Reference
libqalculate-2.8.2
ExpressionName Struct Reference

A name for an expression item (function, variable or unit) More...

#include <ExpressionItem.h>

Public Member Functions

 ExpressionName ()
 
 ExpressionName (string sname)
 
void operator= (const ExpressionName &ename)
 
bool operator== (const ExpressionName &ename) const
 
bool operator!= (const ExpressionName &ename) const
 

Public Attributes

bool abbreviation
 If the name is an abbreviation.
 
bool suffix
 If the name has a suffix. If set to true, the part of the name after an underscore should be treated as a suffix.
 
bool unicode
 If the name contains unicode characters.
 
bool plural
 If the name is in plural form.
 
bool reference
 If the name shall be used as a fixed reference. If this is set to true, the name will kept as it is in addition to translations of it.
 
bool avoid_input
 If the name is unsuitable for user input.
 
bool case_sensitive
 If the name is case sensitive. The default behavior is that abbreviations are case sensitive and other names are not.
 
bool completion_only
 Use only for completion (useful for unicode letter alternatives)
 
string name
 The name.
 

Detailed Description

A name for an expression item (function, variable or unit)

An expression name has a text string representing a name and boolean values describing the names properties.

Constructor & Destructor Documentation

◆ ExpressionName() [1/2]

ExpressionName::ExpressionName ( )

Create an empty expression name. All properties are set to false.

◆ ExpressionName() [2/2]

ExpressionName::ExpressionName ( string  sname)

Create an expression name. All properties are set to false, unless the name only has one character in which case abbreviation and case_sesnsitive is set to true.

Parameters
snameThe name.

The documentation for this struct was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classFunctionArgument-members.html0000644000175000017500000003432713401033110023567 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
FunctionArgument Member List

This is the complete list of members for FunctionArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constFunctionArgumentvirtual
FunctionArgument(string name_="", bool does_test=true, bool does_error=true) (defined in FunctionArgument)FunctionArgument
FunctionArgument(const FunctionArgument *arg) (defined in FunctionArgument)FunctionArgument
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constFunctionArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constFunctionArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constFunctionArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constFunctionArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~FunctionArgument() (defined in FunctionArgument)FunctionArgumentvirtual
libqalculate-2.8.2/docs/reference/html/classAliasUnit__Composite.html0000644000175000017500000021461113401033110022715 00000000000000 libqalculate-2.8.2: AliasUnit_Composite Class Reference
libqalculate-2.8.2
AliasUnit_Composite Class Reference

A subunit in a CompositeUnit. More...

#include <Unit.h>

Inheritance diagram for AliasUnit_Composite:
AliasUnit Unit ExpressionItem

Public Member Functions

 AliasUnit_Composite (Unit *alias, int exp=1, Prefix *prefix_=NULL)
 
 AliasUnit_Composite (const AliasUnit_Composite *unit)
 
virtual ExpressionItemcopy () const
 
virtual void set (const ExpressionItem *item)
 
virtual string print (bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual Prefixprefix () const
 
virtual int prefixExponent () const
 
virtual void set (Unit *u, int exp=1, Prefix *prefix_=NULL)
 
virtual MathStructureconvertToFirstBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertFromFirstBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
- Public Member Functions inherited from AliasUnit
 AliasUnit (string cat_, string name_, string plural_, string singular_, string title_, Unit *alias, string relation="1", int exp=1, string inverse="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 AliasUnit (const AliasUnit *unit)
 
virtual UnitbaseUnit () const
 
virtual UnitfirstBaseUnit () const
 
virtual void setBaseUnit (Unit *alias)
 
virtual string expression () const
 
virtual string inverseExpression () const
 
virtual string uncertainty () const
 
virtual void setExpression (string relation)
 
virtual void setInverseExpression (string inverse)
 
virtual void setUncertainty (string standard_uncertainty)
 
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue) const
 
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue) const
 
virtual MathStructure convertToBaseUnit () const
 
virtual MathStructure convertFromBaseUnit () const
 
virtual int baseExponent (int exp=1) const
 
virtual void setExponent (int exp)
 
virtual int firstBaseExponent () const
 
virtual int mixWithBase () const
 
virtual int mixWithBaseMinimum () const
 
virtual void setMixWithBase (int combine_priority=1)
 
virtual void setMixWithBaseMinimum (int combine_minimum)
 
virtual int subtype () const
 
virtual bool isChildOf (Unit *u) const
 
virtual bool isParentOf (Unit *u) const
 
virtual bool hasComplexExpression () const
 
virtual bool hasComplexRelationTo (Unit *u) const
 
- Public Member Functions inherited from Unit
 Unit (string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Unit (const Unit *unit)
 
bool isSIUnit () const
 
void setAsSIUnit ()
 
void setSystem (string s_system)
 
const string & system () const
 
bool useWithPrefixesByDefault () const
 
void setUseWithPrefixesByDefault (bool use_with_prefixes)
 
bool isCurrency () const
 
const string & countries () const
 
void setCountries (string country_names)
 
virtual const string & plural (bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & singular (bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & abbreviation (bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual bool isUsedByOtherUnits () const
 
virtual int type () const
 
bool convert (Unit *u, MathStructure &mvalue, MathStructure &exp) const
 
bool convert (Unit *u, MathStructure &mvalue) const
 
MathStructure convert (Unit *u, bool *converted=NULL) const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Attributes

Prefixprefixv
 
- Protected Attributes inherited from AliasUnit
string svalue
 
string sinverse
 
string suncertainty
 
int i_exp
 
int i_mix
 
int i_mix_min
 
Unito_unit
 
- Protected Attributes inherited from Unit
string ssystem
 
string scountries
 
bool b_si
 
bool b_use_with_prefixes
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

A subunit in a CompositeUnit.

Should normally not be used directly.

Member Function Documentation

◆ print()

virtual string AliasUnit_Composite::print ( bool  plural_,
bool  short_,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const
virtual

Returns a display string representing the unit in an expression.

Equivalent to preferredName() for Unit and AliasUnit, but closer to MathStructure::print() for CompositeUnit (prints out base expression).

Reimplemented from Unit.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/functions_func_u.html0000644000175000017500000000540313401033110021161 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- u -

libqalculate-2.8.2/docs/reference/html/tabs.css0000644000175000017500000002207513401033110016373 00000000000000.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#doc-content{overflow:auto;display:block;padding:0;margin:0;-webkit-overflow-scrolling:touch}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0 1px 1px rgba(255,255,255,0.9);color:#283a5d;outline:0}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace!important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283a5d transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;-moz-border-radius:0!important;-webkit-border-radius:0;border-radius:0!important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;-moz-border-radius:5px!important;-webkit-border-radius:5px;border-radius:5px!important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0!important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px!important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}}libqalculate-2.8.2/docs/reference/html/functions_func_o.html0000644000175000017500000000365413401033110021161 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- o -

libqalculate-2.8.2/docs/reference/html/functions_n.html0000644000175000017500000000577313401033110020151 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- n -

libqalculate-2.8.2/docs/reference/html/classVariable.png0000644000175000017500000000516213401033110020207 00000000000000‰PNG  IHDRvøV¯[JPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2 IDATxíÝÙVÂH†ÑÍÉZ¼ÿ#·ŒA=t7¿²e ©XùHÝBÀ‹†aúAÀ‡ªªº%;ødÉ%;h”ì  Q²ƒ€FëìvÇŸªªoXm÷õÂãÏ&;ødÙUU½,ÙAÀ7³;Þí¿×G‡ áézxý{t~t½»nyúPUÕ\²ƒOvûjw*æØÐ9²sg»ªÅm²áòµÃ­ªj&ÙÁ'ÛÈîø3»œÍ2ºþ¼ºÊîÆ¢›ìà“ݾÚmd7íñúöfv§-“Ì=\déM·Y^ÙjWãm¾AUMnÉ>ÙÍìNW´ã5m½È·,²ð=ÙVÈKv—%õüÖuy¬ÁÓÕø¸ÂN^Kv˜ÞÖÙUÕä¶n¦ªê‡’|²d’4z”]UÕ¯KvðÉ’4JvÐ(ÙA@£d†aúA@À3öÐ#ÙA@Ÿý>ÝA@›d}¾ªKwÐ%ÙA@«D’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’Y²ƒ€FÉ%;h”ì  Ñw 8m³Ør|z~ôDKÉ>ÙËÙ­v‘ì à¡opØè¸ánwº;þ^ž~=¾lp~îIvðÉžÊn¬ëx~:>»æ w$;ødÏ]íù³»Þ%;¸ï{œÖÔã":¿ê¯t—ìÎïÃ=É>ÙSÙ-ÛÕÝwsJvðɾYÀùb·Ýµ¹,²pßSÙVÑi^§§_¿ÓàdŸì-$;ødÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Ñn·Ûõƒ€€gì!  G²ƒ€>û}ºƒ€6Éú|U—î  K²ƒ€V‰%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;xÂ~¿ß¿|’wŸöd'ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£dφaxÑ~†á5ÿžñ! ÕPUÕmš]UU·dï”ì  Q²ƒ€FÉ%;h´:í»ëŸªª[N,6ŸžÝÚÍfv‹ÂŽ"ÙÁ;mf÷ø”ožðÕ©Kvß8Šdï´•Ý9€ÝéþpwiñëÅËË×P.Ï¿—§ç­Æªjr»›ÝøÙñÉ/E²ƒwÚÈî| ¹œ÷ËKã‰ÜUÕÊtóɳ͋çýì®ÁýÙQ$;x§uvçëÂxÅ©]Ín3Ókθ¨Í>õlvc3uÉÞéÎ"{÷„O®ŠãJv}:ùÔùýªo¿–Ý‹G‘ìà¶²›ºÞ~W'üÖæÓ@ªªf¾•ÝE²ƒwÚÌn}êjW53ý»qÂ××¥ç³û»£HvðNÛÙM¯5³ÕnuÂïOÃ8>ýú]|¾ªÆÛfv‹…òt÷7G‘ìàVÙUUýµí쪪z$;x§d’4JvÐ(ÙA@£d’4JvÐh†¡ß¿g|ø¯ØC@@d}öûtm’ôùª.ÝA@—d­4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4Jvð¬a†í‡a^j¨ªê–ìà“%;h”ì  Q²ƒ€FÉM²Û~ªªî79=Z|dùöòýdŸnšÝHªª6mf· 0ÙA`¼-³;ü=<8Þ.~§kà׳ë;ç—®OÇçÇ­ÆO,¶Ov÷³;=ŸnÓ—jW5·üÄbûdñàj7](wUÓÛõËdzO$;˜¹‘Ýü6»nM²;¯©—MÖŸ¸l~?ÙAlgw®i~ÑÛUMo³ì‹íÖ«j¼%;ødËìÎg7FZµ«™ËÝÆöÉbšÝ¸ίa_¯Cœ44Ûð²ÉêãÊ;[c“|´Iv“ŸåªXUõ‹’|²Íìþ¸ºdm+»¿®.ÙÁGÛ^d«ªþP²ƒO–ì  Q²ƒ€FÉ%;h4 ÃО±‡€€Éúì÷éÚ$;èóU]ºƒ€.ÉZ%:h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì Ý~¿ßÇ~¿ß(è÷îo{Ƈ÷IvÐ.ãC»L;¼O²ƒvÞ'ÙA»Œí2íð>ÉÚe|xŸdí2>´Ë´Ãû$;h—ñá}’´ËøÐ.Óï“ì ]Ƈ÷IvÐ.ãC»L;¼Ïyüa†í‡a^“ñ?|ü¡ªªÛôß®ªê–ñß=~¦½ªªYÆÏ´WU5Ëø™öªªf?Ó^UÕ,ãßv7ù[UãmóñéùÑÆýÛ»ÃOUÕÚõåÕû/ͽi?ÇüH~kØ;ãoŒZUõØK‡²1þæß<ÿ?<€ÛÙ·ûnv«ñ^Éªšyñh|ÛÎþO'asüš{õPþ<»pçjwØðèPàõÉøðôÆiËëv‡Ç³VU­ÝÍËÎ'{›íö<΋Gó­ì®‡0ÛáÜ‹“p'»ëÖLfæ‡çccüÕn®CMà—æâqv×IXþ›ÓÆ—Çg×£©ªZ¸ŸÝdo×»ånsÿäÑ|'»ÉØ«ª]ÕÜs“p;»q§S<ÿÖýÖù¸“ÝÆ”Ïvû+sq'»Åi^´<ÖPžËîð³Øé|¿‹~p4Ïe·ÞáO'áqv›3¾•ÅK‡²ýµ_þÛ7ãúñ\ÜËn¼ÒÏþÍËñ;™E>ÿ&\3ªªZ¸yµ¯x×½-ÙÕÒòÊѼÝu‡—ò“IøÍì^9”û‹üõÊ:ýØæ®_‹'²»,Ù‹¯Åz=œNIUÕ†ÇÙÍ^›~õnd÷ÜÑ<ŸÝ¸ïÙT¿8 ¿‘ÝOÎǽìÖ Þò:ö󹸛Ýt!_Çpc”­¥¼ªjæ[Ùm\j7²{éhžËn> ¿1 ?ÏîgçãAv»ªém¶Û_™‹ûÙ]®•7®A_oÌW¡Ó7púBUÕ†‡Ù]Gìm¶ÛevÏÍw²a²Ãù·ÿåI¸¿ÈͯìãôÏgæ'çãÎø“ûÜÌô~i.nfWUõwœöªª?õƒño~•ªª¾ë?üÿÿÊ\$»'Çÿ•êþ'Ù½>Éî¹ñ§ºÿGv?˜‹d—ñ«ªš%»Œ_UÕ,ÙeüªªfÉ.ãWU5Kv¿ªªÙWvÃ0 í&ÿö0 C»ŒÿÞñÿ°yß·§g¢·IEND®B`‚libqalculate-2.8.2/docs/reference/html/classQalculateDateTime-members.html0000644000175000017500000004372413401033110023630 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
QalculateDateTime Member List

This is the complete list of members for QalculateDateTime, including all inherited members.

add(const QalculateDateTime &date) (defined in QalculateDateTime)QalculateDateTime
addDays(const Number &ndays) (defined in QalculateDateTime)QalculateDateTime
addHours(const Number &nhours) (defined in QalculateDateTime)QalculateDateTime
addMinutes(const Number &nminutes, bool remove_leap_second=true, bool convert_to_utc=true) (defined in QalculateDateTime)QalculateDateTime
addMonths(const Number &nmonths) (defined in QalculateDateTime)QalculateDateTime
addSeconds(const Number &seconds, bool count_leap_seconds=true, bool convert_to_utc=true) (defined in QalculateDateTime)QalculateDateTime
addYears(const Number &nyears) (defined in QalculateDateTime)QalculateDateTime
b_time (defined in QalculateDateTime)QalculateDateTimeprotected
day() const (defined in QalculateDateTime)QalculateDateTime
daysTo(const QalculateDateTime &date, int basis=1, bool date_func=true, bool remove_leap_seconds=true) const (defined in QalculateDateTime)QalculateDateTime
hour() const (defined in QalculateDateTime)QalculateDateTime
i_day (defined in QalculateDateTime)QalculateDateTimeprotected
i_hour (defined in QalculateDateTime)QalculateDateTimeprotected
i_min (defined in QalculateDateTime)QalculateDateTimeprotected
i_month (defined in QalculateDateTime)QalculateDateTimeprotected
i_year (defined in QalculateDateTime)QalculateDateTimeprotected
isFutureDate() const (defined in QalculateDateTime)QalculateDateTime
isPastDate() const (defined in QalculateDateTime)QalculateDateTime
minute() const (defined in QalculateDateTime)QalculateDateTime
month() const (defined in QalculateDateTime)QalculateDateTime
n_sec (defined in QalculateDateTime)QalculateDateTimeprotected
operator!=(const QalculateDateTime &date2) const (defined in QalculateDateTime)QalculateDateTime
operator<(const QalculateDateTime &date2) const (defined in QalculateDateTime)QalculateDateTime
operator<=(const QalculateDateTime &date2) const (defined in QalculateDateTime)QalculateDateTime
operator==(const QalculateDateTime &date2) const (defined in QalculateDateTime)QalculateDateTime
operator>(const QalculateDateTime &date2) const (defined in QalculateDateTime)QalculateDateTime
operator>=(const QalculateDateTime &date2) const (defined in QalculateDateTime)QalculateDateTime
parsed_string (defined in QalculateDateTime)QalculateDateTime
print(const PrintOptions &po=default_print_options) const (defined in QalculateDateTime)QalculateDateTime
QalculateDateTime() (defined in QalculateDateTime)QalculateDateTime
QalculateDateTime(long int initialyear, int initialmonth, int initialday) (defined in QalculateDateTime)QalculateDateTime
QalculateDateTime(const Number &initialtimestamp) (defined in QalculateDateTime)QalculateDateTime
QalculateDateTime(string date_string) (defined in QalculateDateTime)QalculateDateTime
QalculateDateTime(const QalculateDateTime &date) (defined in QalculateDateTime)QalculateDateTime
second() const (defined in QalculateDateTime)QalculateDateTime
secondsTo(const QalculateDateTime &date, bool count_leap_seconds=true, bool convert_to_utc=true) const (defined in QalculateDateTime)QalculateDateTime
set(long int newyear, int newmonth, int newday) (defined in QalculateDateTime)QalculateDateTime
set(const Number &newtimestamp) (defined in QalculateDateTime)QalculateDateTime
set(string date_string) (defined in QalculateDateTime)QalculateDateTime
set(const QalculateDateTime &date) (defined in QalculateDateTime)QalculateDateTime
setTime(long int ihour, long int imin, const Number &nsec) (defined in QalculateDateTime)QalculateDateTime
setToCurrentDate() (defined in QalculateDateTime)QalculateDateTime
setToCurrentTime() (defined in QalculateDateTime)QalculateDateTime
setYear(long int newyear) (defined in QalculateDateTime)QalculateDateTime
timeIsSet() const (defined in QalculateDateTime)QalculateDateTime
timestamp(bool reverse_utc=false) const (defined in QalculateDateTime)QalculateDateTime
toISOString() const (defined in QalculateDateTime)QalculateDateTime
toLocalString() const (defined in QalculateDateTime)QalculateDateTime
week(bool start_sunday=false) const (defined in QalculateDateTime)QalculateDateTime
weekday() const (defined in QalculateDateTime)QalculateDateTime
year() const (defined in QalculateDateTime)QalculateDateTime
yearday() const (defined in QalculateDateTime)QalculateDateTime
yearsTo(const QalculateDateTime &date, int basis=1, bool date_func=true, bool remove_leap_seconds=true) const (defined in QalculateDateTime)QalculateDateTime
libqalculate-2.8.2/docs/reference/html/classDecimalPrefix.html0000644000175000017500000005326613401033110021366 00000000000000 libqalculate-2.8.2: DecimalPrefix Class Reference
libqalculate-2.8.2

A decimal (metric) prefix. More...

#include <Prefix.h>

Inheritance diagram for DecimalPrefix:
Prefix

Public Member Functions

 DecimalPrefix (int exp10, string long_name, string short_name="", string unicode_name="")
 
int exponent (int iexp=1) const
 
Number exponent (const Number &nexp) const
 
void setExponent (int iexp)
 
Number value (const Number &nexp) const
 
Number value (int iexp) const
 
Number value () const
 
int type () const
 
- Public Member Functions inherited from Prefix
 Prefix (string long_name, string short_name="", string unicode_name="")
 
const string & shortName (bool return_long_if_no_short=true, bool use_unicode=false) const
 
const string & longName (bool return_short_if_no_long=true, bool use_unicode=false) const
 
const string & unicodeName (bool return_short_if_no_uni=true) const
 
void setShortName (string short_name)
 
void setLongName (string long_name)
 
void setUnicodeName (string unicode_name)
 
const string & name (bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 

Protected Attributes

int exp
 
- Protected Attributes inherited from Prefix
string l_name
 
string s_name
 
string u_name
 

Detailed Description

A decimal (metric) prefix.

A metric or decimal prefix has an integer exponent which with a base of ten constitutes the value of the prefix (value=10^exponent).

Constructor & Destructor Documentation

◆ DecimalPrefix()

DecimalPrefix::DecimalPrefix ( int  exp10,
string  long_name,
string  short_name = "",
string  unicode_name = "" 
)

Create a decimal prefix.

Parameters
exp10Exponent for the value.
long_nameLong name.
short_nameShort name.
unicode_nameUnicode name.

Member Function Documentation

◆ exponent() [1/2]

int DecimalPrefix::exponent ( int  iexp = 1) const

Returns the exponent.

Parameters
iexpExponent of the unit.
Returns
The exponent of the prefix.

◆ exponent() [2/2]

Number DecimalPrefix::exponent ( const Number nexp) const

Returns the exponent.

Parameters
nexpExponent of the unit.
Returns
The exponent of the prefix.

◆ setExponent()

void DecimalPrefix::setExponent ( int  iexp)

Sets the exponent of the prefix.

Parameters
iexpNew exponent for the prefix.

◆ type()

int DecimalPrefix::type ( ) const
virtual

Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix.

Returns
The type of the prefix.

Implements Prefix.

◆ value() [1/3]

Number DecimalPrefix::value ( const Number nexp) const
virtual

Returns the value of the prefix.

Parameters
nexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implements Prefix.

◆ value() [2/3]

Number DecimalPrefix::value ( int  iexp) const
virtual

Returns the value of the prefix.

Parameters
iexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implements Prefix.

◆ value() [3/3]

Number DecimalPrefix::value ( ) const
virtual

Returns the value of the prefix.

Returns
The value of the prefix.

Implements Prefix.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classDataPropertyArgument-members.html0000644000175000017500000003634313401033110024420 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
DataPropertyArgument Member List

This is the complete list of members for DataPropertyArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constDataPropertyArgumentvirtual
DataPropertyArgument(DataSet *data_set, string name_="", bool does_test=true, bool does_error=true) (defined in DataPropertyArgument)DataPropertyArgument
DataPropertyArgument(const DataPropertyArgument *arg) (defined in DataPropertyArgument)DataPropertyArgument
dataSet() const (defined in DataPropertyArgument)DataPropertyArgument
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
o_data (defined in DataPropertyArgument)DataPropertyArgumentprotected
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constDataPropertyArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setDataSet(DataSet *data_set) (defined in DataPropertyArgument)DataPropertyArgument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constDataPropertyArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constDataPropertyArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constDataPropertyArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~DataPropertyArgument() (defined in DataPropertyArgument)DataPropertyArgument
libqalculate-2.8.2/docs/reference/html/index.html0000644000175000017500000001324313401033110016722 00000000000000 libqalculate-2.8.2: Index
libqalculate-2.8.2
Index

Introduction

libqalculate is math libary for expression evaluation with units, variables and functions support and CAS functionality.

The main parts of the library is the almighty Calculator class, the MathStructure class for mathematical expressions and classes for objects in an expression, mostly of the class Numbers and sub classes of ExpressionItem.

A simple application using libqalculate need only create a calculator object, perhaps load definitions (functions, variables, units, etc.), and calculate (and output) an expression as follows:

new Calculator();
CALCULATOR->loadGlobalDefinitions();
CALCULATOR->loadLocalDefinitions();
cout << CALCULATOR->calculateAndPrint("1 + 1", 2000) << endl;

In the above example, the calculation is terminated after two seconds (2000 ms), if it is not finished before then. Applications using localized numbers should first call Calculalor::unlocalizeExpression() on the expression.

A less simple application might calculate and output the expression separately.

CALCULATOR->calculate(&mstruct, unlocalizeExpression("1 + 1"), 2000, eo);

More complex usage mainly involves manipulating objects of the MathStructure class directly.

To display the resulting expression use Calculator::print() as follows:

string result_str = CALCULATOR->print(result, 2000, po);

Alternatively MathStructure::format() followed by MathStructure::print() can be used, whithout the possiblity to specify a time limit.

Central to the flexiblity of libqalculate is the many options passed to evaluating and display functions with EvaluationOptions and PrintOptions.

Using the library

libqalculate uses pkg-config.

For a simple program use pkg-config on the command line:

c++ `pkg-config --cflags --libs libqalculate` hello.c -o hello

If the program uses autoconf, put the following in configure.ac:

PKG_CHECK_MODULES(QALCULATE, [
libqalculate >= 1.0.0
])
AC_SUBST(QALCULATE_CFLAGS)
AC_SUBST(QALCULATE_LIBS)
libqalculate-2.8.2/docs/reference/html/functions_func_z.html0000644000175000017500000000401313401033110021162 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- z -

libqalculate-2.8.2/docs/reference/html/functions_b.html0000644000175000017500000000532213401033110020123 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- b -

libqalculate-2.8.2/docs/reference/html/structSortOptions-members.html0000644000175000017500000000545413401033110023020 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
SortOptions Member List

This is the complete list of members for SortOptions, including all inherited members.

minus_lastSortOptions
prefix_currenciesSortOptions
SortOptions() (defined in SortOptions)SortOptionsinline
libqalculate-2.8.2/docs/reference/html/classNumber.html0000644000175000017500000043031413401033110020073 00000000000000 libqalculate-2.8.2: Number Class Reference
libqalculate-2.8.2

A number. More...

#include <Number.h>

Public Member Functions

 Number ()
 
 Number (string number, const ParseOptions &po=default_parse_options)
 
 Number (long int numerator, long int denominator=1, long int exp_10=0)
 
 Number (const Number &o)
 
void set (string number, const ParseOptions &po=default_parse_options)
 
void set (long int numerator, long int denominator=1, long int exp_10=0, bool keep_precision=false, bool keep_imag=false)
 
void setPlusInfinity (bool keep_precision=false, bool keep_imag=false)
 
void setMinusInfinity (bool keep_precision=false, bool keep_imag=false)
 
void setFloat (long double d_value)
 
bool setInterval (const Number &nr_lower, const Number &nr_upper, bool keep_precision=false)
 
void setInternal (const mpz_t &mpz_value, bool keep_precision=false, bool keep_imag=false)
 
void setInternal (mpz_srcptr mpz_value, bool keep_precision=false, bool keep_imag=false)
 
void setInternal (const mpq_t &mpq_value, bool keep_precision=false, bool keep_imag=false)
 
void setInternal (const mpz_t &mpz_num, const mpz_t &mpz_den, bool keep_precision=false, bool keep_imag=false)
 
void setInternal (const mpfr_t &mpfr_value, bool merge_precision=false, bool keep_imag=false)
 
void setImaginaryPart (const Number &o)
 
void setImaginaryPart (long int numerator, long int denominator=1, long int exp_10=0)
 
void set (const Number &o, bool merge_precision=false, bool keep_imag=false)
 
void clear (bool keep_precision=false)
 
void clearReal ()
 
void clearImaginary ()
 
const mpq_t & internalRational () const
 
const mpfr_t & internalUpperFloat () const
 
const mpfr_t & internalLowerFloat () const
 
mpq_t & internalRational ()
 
mpfr_t & internalUpperFloat ()
 
mpfr_t & internalLowerFloat ()
 
NumberinternalImaginary () const
 
void markAsImaginaryPart (bool is_imag=true)
 
const NumberType & internalType () const
 
bool setToFloatingPoint ()
 
void precisionToInterval ()
 
bool intervalToPrecision (long int min_precision=2)
 
void intervalToMidValue ()
 
void splitInterval (unsigned int nr_of_parts, vector< Number > &v) const
 
bool getCentralInteger (Number &nr_int, bool *b_multiple=NULL, vector< Number > *v=NULL) const
 
bool mergeInterval (const Number &o, bool set_to_overlap=false)
 
void setUncertainty (const Number &o, bool force_interval=false)
 
Number uncertainty () const
 
Number relativeUncertainty () const
 
double floatValue () const
 
int intValue (bool *overflow=NULL) const
 
unsigned int uintValue (bool *overflow=NULL) const
 
long int lintValue (bool *overflow=NULL) const
 
long long int llintValue () const
 
unsigned long int ulintValue (bool *overflow=NULL) const
 
bool isApproximate () const
 
bool isFloatingPoint () const
 
void setPrecisionAndApproximateFrom (const Number &o)
 
bool isInterval (bool ignore_imag=true) const
 
bool imaginaryPartIsInterval () const
 
void setApproximate (bool is_approximate=true)
 
int precision (int calculate_from_interval=0) const
 
void setPrecision (int prec)
 
bool isUndefined () const
 
bool isInfinite (bool ignore_imag=true) const
 
bool isPlusInfinity (bool ignore_imag=false) const
 
bool isMinusInfinity (bool ignore_imag=false) const
 
bool includesInfinity (bool ignore_imag=false) const
 
bool includesPlusInfinity () const
 
bool includesMinusInfinity () const
 
Number realPart () const
 
Number imaginaryPart () const
 
Number numerator () const
 
Number denominator () const
 
Number complexNumerator () const
 
Number complexDenominator () const
 
Number lowerEndPoint (bool include_imag=false) const
 
Number upperEndPoint (bool include_imag=false) const
 
void operator= (const Number &o)
 
void operator= (long int i)
 
void operator-- (int)
 
void operator++ (int)
 
Number operator- () const
 
Number operator* (const Number &o) const
 
Number operator/ (const Number &o) const
 
Number operator+ (const Number &o) const
 
Number operator- (const Number &o) const
 
Number operator^ (const Number &o) const
 
Number operator* (long int i) const
 
Number operator/ (long int i) const
 
Number operator+ (long int i) const
 
Number operator- (long int i) const
 
Number operator^ (long int i) const
 
Number operator&& (const Number &o) const
 
Number operator|| (const Number &o) const
 
Number operator! () const
 
void operator*= (const Number &o)
 
void operator/= (const Number &o)
 
void operator+= (const Number &o)
 
void operator-= (const Number &o)
 
void operator^= (const Number &o)
 
void operator*= (long int i)
 
void operator/= (long int i)
 
void operator+= (long int i)
 
void operator-= (long int i)
 
void operator^= (long int i)
 
bool operator== (const Number &o) const
 
bool operator!= (const Number &o) const
 
bool operator< (const Number &o) const
 
bool operator<= (const Number &o) const
 
bool operator> (const Number &o) const
 
bool operator>= (const Number &o) const
 
bool operator< (long int i) const
 
bool operator<= (long int i) const
 
bool operator> (long int i) const
 
bool operator>= (long int i) const
 
bool operator== (long int i) const
 
bool operator!= (long int i) const
 
bool bitAnd (const Number &o)
 
bool bitOr (const Number &o)
 
bool bitXor (const Number &o)
 
bool bitNot ()
 
bool bitCmp (unsigned int bits)
 
bool bitEqv (const Number &o)
 
bool shiftLeft (const Number &o)
 
bool shiftRight (const Number &o)
 
bool shift (const Number &o)
 
bool hasRealPart () const
 
bool hasImaginaryPart () const
 
bool isComplex () const
 
bool isInteger (IntegerType integer_type=INTEGER_TYPE_NONE) const
 
Number integer () const
 
bool isRational () const
 
bool isReal () const
 
bool isFraction () const
 
bool isZero () const
 
bool isNonZero () const
 
bool isOne () const
 
bool isTwo () const
 
bool isI () const
 
bool isMinusI () const
 
bool isMinusOne () const
 
bool isNegative () const
 
bool isNonNegative () const
 
bool isPositive () const
 
bool isNonPositive () const
 
bool realPartIsNegative () const
 
bool realPartIsNonNegative () const
 
bool realPartIsPositive () const
 
bool realPartIsNonZero () const
 
bool realPartIsRational () const
 
bool imaginaryPartIsNegative () const
 
bool imaginaryPartIsPositive () const
 
bool imaginaryPartIsNonNegative () const
 
bool imaginaryPartIsNonPositive () const
 
bool imaginaryPartIsNonZero () const
 
bool hasNegativeSign () const
 
bool hasPositiveSign () const
 
bool equalsZero () const
 
bool equals (const Number &o, bool allow_interval=false, bool allow_infinite=false) const
 
bool equals (long int i) const
 
int equalsApproximately (const Number &o, int prec) const
 
ComparisonResult compare (const Number &o, bool ignore_imag=false) const
 
ComparisonResult compareAbsolute (const Number &o, bool ignore_imag=false) const
 
ComparisonResult compare (long int i) const
 
ComparisonResult compareApproximately (const Number &o, int prec=EQUALS_PRECISION_LOWEST) const
 
ComparisonResult compareImaginaryParts (const Number &o) const
 
ComparisonResult compareRealParts (const Number &o) const
 
bool isGreaterThan (const Number &o) const
 
bool isLessThan (const Number &o) const
 
bool isGreaterThanOrEqualTo (const Number &o) const
 
bool isLessThanOrEqualTo (const Number &o) const
 
bool isGreaterThan (long int i) const
 
bool isLessThan (long int i) const
 
bool isGreaterThanOrEqualTo (long int i) const
 
bool isLessThanOrEqualTo (long int i) const
 
bool isEven () const
 
bool numeratorIsGreaterThan (long int i) const
 
bool numeratorIsLessThan (long int i) const
 
bool numeratorEquals (long int i) const
 
bool denominatorIsGreaterThan (long int i) const
 
bool denominatorIsLessThan (long int i) const
 
bool denominatorEquals (long int i) const
 
bool denominatorIsGreater (const Number &o) const
 
bool denominatorIsLess (const Number &o) const
 
bool denominatorIsEqual (const Number &o) const
 
bool denominatorIsEven () const
 
bool denominatorIsTwo () const
 
bool numeratorIsEven () const
 
bool numeratorIsOne () const
 
bool numeratorIsMinusOne () const
 
bool isOdd () const
 
int integerLength () const
 
bool add (const Number &o)
 
bool add (long int i)
 
bool subtract (const Number &o)
 
bool subtract (long int i)
 
bool multiply (const Number &o)
 
bool multiply (long int i)
 
bool divide (const Number &o)
 
bool divide (long int i)
 
bool recip ()
 
bool raise (const Number &o, bool try_exact=true)
 
bool sqrt ()
 
bool cbrt ()
 
bool root (const Number &o)
 
bool allroots (const Number &o, vector< Number > &roots)
 
bool exp10 (const Number &o)
 
bool exp2 (const Number &o)
 
bool exp10 ()
 
bool exp2 ()
 
bool square ()
 
bool negate ()
 
void setNegative (bool is_negative)
 
bool abs ()
 
bool signum ()
 
bool round (const Number &o, bool halfway_to_even=true)
 
bool floor (const Number &o)
 
bool ceil (const Number &o)
 
bool trunc (const Number &o)
 
bool mod (const Number &o)
 
bool isIntegerDivisible (const Number &o) const
 
bool isqrt ()
 
bool isPerfectSquare () const
 
bool round (bool halfway_to_even=true)
 
bool floor ()
 
bool ceil ()
 
bool trunc ()
 
bool frac ()
 
bool rem (const Number &o)
 
bool smod (const Number &o)
 
bool irem (const Number &o)
 
bool irem (const Number &o, Number &q)
 
bool iquo (const Number &o)
 
bool iquo (unsigned long int i)
 
bool iquo (const Number &o, Number &r)
 
int getBoolean () const
 
void toBoolean ()
 
void setTrue (bool is_true=true)
 
void setFalse ()
 
void setLogicalNot ()
 
void e (bool use_cached_number=true)
 
void pi ()
 
void catalan ()
 
void euler ()
 
bool zeta ()
 
bool gamma ()
 
bool digamma ()
 
bool airy ()
 
bool erf ()
 
bool erfc ()
 
bool besselj (const Number &o)
 
bool bessely (const Number &o)
 
bool sin ()
 
bool asin ()
 
bool sinh ()
 
bool asinh ()
 
bool cos ()
 
bool acos ()
 
bool cosh ()
 
bool acosh ()
 
bool tan ()
 
bool atan ()
 
bool atan2 (const Number &o, bool allow_zero=false)
 
bool arg ()
 
bool tanh ()
 
bool atanh ()
 
bool ln ()
 
bool log (const Number &o)
 
bool exp ()
 
bool lambertW ()
 
bool gcd (const Number &o)
 
bool lcm (const Number &o)
 
bool polylog (const Number &o)
 
bool igamma (const Number &o)
 
bool expint ()
 
bool logint ()
 
bool sinint ()
 
bool sinhint ()
 
bool cosint ()
 
bool coshint ()
 
bool factorial ()
 
bool multiFactorial (const Number &o)
 
bool doubleFactorial ()
 
bool binomial (const Number &m, const Number &k)
 
bool factorize (vector< Number > &factors)
 
void rand ()
 
void intRand (const Number &ceil)
 
bool add (const Number &o, MathOperation op)
 
string printNumerator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
 
string printDenominator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
 
string printImaginaryNumerator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
 
string printImaginaryDenominator (int base=10, bool display_sign=true, BaseDisplay base_display=BASE_DISPLAY_NORMAL, bool lower_case=false) const
 
string print (const PrintOptions &po=default_print_options, const InternalPrintStruct &ips=top_ips) const
 

Protected Member Functions

void testInteger ()
 
bool testErrors (int error_level=1) const
 
bool testFloatResult (bool allow_infinite_result=true, int error_level=1, bool test_integer=true)
 

Protected Attributes

mpq_t r_value
 
mpfr_t fu_value
 
mpfr_t fl_value
 
Numberi_value
 
NumberType n_type
 
bool b_approx
 
bool b_imag
 
int i_precision
 

Detailed Description

A number.

Can be rational, floating point, complex or infinite. Has arbitrary precision (uses Calculator::precision()) and infinitely large rational numbers. Implimented using GNU MP and MPFR.

Constructor & Destructor Documentation

◆ Number() [1/4]

Number::Number ( )

Constructs a number initialized as zero.

◆ Number() [2/4]

Number::Number ( string  number,
const ParseOptions po = default_parse_options 
)

Constructs a number parsing a text string.

Parameters
numberText string to read number from.
poOptions for parsing the text string.

◆ Number() [3/4]

Number::Number ( long int  numerator,
long int  denominator = 1,
long int  exp_10 = 0 
)

Constructs a rational number.

Parameters
numerator
denominator
exp_10

◆ Number() [4/4]

Number::Number ( const Number o)

Constructs a copy of a number.

Member Function Documentation

◆ add()

bool Number::add ( const Number o)

Add to the number (x+o).

Parameters
oNumber to add.
Returns
true if the operation was successful.

◆ catalan()

void Number::catalan ( )

Set the number to Catalan's constant, calculated with the current default precision.

◆ divide()

bool Number::divide ( const Number o)

Divide the number (x/o).

Parameters
oNumber to divide by.
Returns
true if the operation was successful.

◆ e()

void Number::e ( bool  use_cached_number = true)

Set the number to e, the base of natural logarithm, calculated with the current default precision.

◆ euler()

void Number::euler ( )

Set the number to Euler's constant, calculated with the current default precision.

◆ exp10() [1/2]

bool Number::exp10 ( const Number o)

Multiply the number with a power of ten (x*10^o).

Parameters
oNumber to raise 10 by.
Returns
true if the operation was successful.

◆ exp10() [2/2]

bool Number::exp10 ( )

Set the number to ten raised by the number (10^x).

Returns
true if the operation was successful.

◆ exp2() [1/2]

bool Number::exp2 ( const Number o)

Multiply the number with a power of two (x*2^o).

Parameters
oNumber to raise 2 by.
Returns
true if the operation was successful.

◆ exp2() [2/2]

bool Number::exp2 ( )

Set the number to two raised by the number (2^x).

Returns
true if the operation was successful.

◆ imaginaryPart()

Number Number::imaginaryPart ( ) const

Returns the imaginary part as real number of the number if it is complex, or zero if it is real.

Returns
true if the imaginary part of a complex number.

◆ intValue()

int Number::intValue ( bool *  overflow = NULL) const

Converts a number to an integer. If the number does not represent an integer it will rounded using round().

Parameters
[out]overflowIf overflow is non-null it will be set to true if the number was to large to fit the return type.
Returns
Resulting integer.

◆ isApproximate()

bool Number::isApproximate ( ) const

Returns true if the number is approximate.

Returns
true if the number is approximate.

◆ isFloatingPoint()

bool Number::isFloatingPoint ( ) const

Returns true if the number is a floating point number.

Returns
true if the number has an approximate representation.

◆ isInfinite()

bool Number::isInfinite ( bool  ignore_imag = true) const

Returns true if the number is infinity, plus infinity or minus infinity.

Returns
true if the number is infinite.

◆ isMinusInfinity()

bool Number::isMinusInfinity ( bool  ignore_imag = false) const

Returns true if the number is minus infinity.

Returns
true if the number is minus infinity.

◆ isPlusInfinity()

bool Number::isPlusInfinity ( bool  ignore_imag = false) const

Returns true if the number is plus infinity.

Returns
true if the number is plus infinity.

◆ multiply()

bool Number::multiply ( const Number o)

Multiply the number (x*o).

Parameters
oNumber to multiply with.
Returns
true if the operation was successful.

◆ negate()

bool Number::negate ( )

Negate the number (-x).

Returns
true if the operation was successful.

◆ pi()

void Number::pi ( )

Set the number to pi, Archimede's constant, calculated with the current default precision.

◆ precision()

int Number::precision ( int  calculate_from_interval = 0) const

Returns the.precision of the number.

Returns
Precision of the number or -1 if the number is exact or the precision has not been set.

◆ raise()

bool Number::raise ( const Number o,
bool  try_exact = true 
)

Raise the number (x^o).

Parameters
oNumber to raise to.
try_exactIf an exact solution should be tried first (might be slow).
Returns
true if the operation was successful.

◆ realPart()

Number Number::realPart ( ) const

Returns the real part of the number if it is complex, or a copy if it is real.

Returns
true if the real part of a complex number.

◆ recip()

bool Number::recip ( )

Invert the number (1/x).

Returns
true if the operation was successful.

◆ setApproximate()

void Number::setApproximate ( bool  is_approximate = true)

Defines the number as approximate or exact.

Parameters
is_approximateIf the number shall be regarded as approximate.

◆ square()

bool Number::square ( )

Raise the number by two (x^2).

Returns
true if the operation was successful.

◆ subtract()

bool Number::subtract ( const Number o)

Subtracts from to the number (x-o).

Parameters
oNumber to subtract.
Returns
true if the operation was successful.

◆ zeta()

bool Number::zeta ( )

Set the number to Riemann's zeta with the number as integral point. The number must be an integer greater than one.

Returns
true if the calculation was successful.

The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/structElement-members.html0000644000175000017500000000717513401033110022110 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
Element Member List

This is the complete list of members for Element, including all inherited members.

group (defined in Element)Element
name (defined in Element)Element
number (defined in Element)Element
symbol (defined in Element)Element
weight (defined in Element)Element
x_pos (defined in Element)Element
y_pos (defined in Element)Element
libqalculate-2.8.2/docs/reference/html/functions_s.html0000644000175000017500000003532513401033110020152 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- s -

libqalculate-2.8.2/docs/reference/html/functions_l.html0000644000175000017500000001072113401033110020134 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- l -

libqalculate-2.8.2/docs/reference/html/classExpressionItem-members.html0000644000175000017500000005657113401033110023262 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
ExpressionItem Member List

This is the complete list of members for ExpressionItem, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const =0 (defined in ExpressionItem)ExpressionItempure virtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in ExpressionItem)ExpressionItemvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() const =0ExpressionItempure virtual
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() const =0ExpressionItempure virtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
libqalculate-2.8.2/docs/reference/html/structParseOptions.html0000644000175000017500000003547213401033110021516 00000000000000 libqalculate-2.8.2: ParseOptions Struct Reference
libqalculate-2.8.2
ParseOptions Struct Reference

Options for parsing expressions. More...

#include <includes.h>

Public Attributes

bool variables_enabled
 If variables will be parsed. Default: true.
 
bool functions_enabled
 If functions will be parsed. Default: true.
 
bool unknowns_enabled
 If left-over characters will be parsed as symbols. Default: true.
 
bool units_enabled
 If units will be parsed. Default: true.
 
bool rpn
 If Reverse Polish Notation syntax will be used. Default: false.
 
int base
 Base of parsed numbers. Default: 10.
 
bool limit_implicit_multiplication
 When implicit multiplication is limited variables, functions and units must be separated by a space, operator or parenthesis ("xy" does not equal "x * y"). Default: false. More...
 
ReadPrecisionMode read_precision
 If and when precisions will be read from number of digits in a number. Default: DONT_READ_PRECISION.
 
bool dot_as_separator
 If true dots will ignored if another character is the default decimal sign, to allow dots to be used as thousand separator. Default: false.
 
bool comma_as_separator
 If true commas will ignored if another character is the default decimal sign, to allow commas to be used as thousand separator. You should also call CALCULATOR->useDecimalPoint(true). Default: false.
 
bool brackets_as_parentheses
 Interpret square brackets equally to parentheses (not only for vectors/matrices). Default; false.
 
AngleUnit angle_unit
 Default angle unit for trigonometric functions. Default: ANGLE_UNIT_NONE.
 
MathStructureunended_function
 If non-NULL will be set to unfinished function at the end of the expression (if there is one). Default: NULL.
 
bool preserve_format
 Preserve the expression structure as much as possible. Default: false.
 
DataSetdefault_dataset
 Default dataset. Used for object.property syntax without a preceeding data set. Default: NULL.
 
ParsingMode parsing_mode
 Parsing mode. Default: PARSING_MODE_ADAPTIVE.
 
bool twos_complement
 Negative binary numbers uses two's complement representation. All binary numbers starting with 1 are assumed to be negative. Default: false.
 

Detailed Description

Options for parsing expressions.

Member Data Documentation

◆ limit_implicit_multiplication

bool ParseOptions::limit_implicit_multiplication

When implicit multiplication is limited variables, functions and units must be separated by a space, operator or parenthesis ("xy" does not equal "x * y"). Default: false.

If the limit implicit multiplication mode is activated, the use of implicite multiplication when parsing expressions and displaying results will be limited to avoid confusion. For example, if this mode is not activated and "integrte(5x)" is accidently typed instead of "integrate(5x)", the expression is interpreted as "int(e * e * (5 * x) * gr * t)". If limit implicit multiplication is turned on to mistyped expression would instead show an error telling that "integrte" is not a valid variable, function or unit (unless unknowns is not enabled in which case the result will be "5 'integrate' * x".


The documentation for this struct was generated from the following file:
libqalculate-2.8.2/docs/reference/html/functions_func_b.html0000644000175000017500000000403213401033110021133 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- b -

libqalculate-2.8.2/docs/reference/html/structPlotParameters.html0000644000175000017500000004056413401033110022030 00000000000000 libqalculate-2.8.2: PlotParameters Struct Reference
libqalculate-2.8.2
PlotParameters Struct Reference

Parameters passed to plotting functions. More...

#include <Calculator.h>

Public Attributes

string title
 Title label.
 
string y_label
 Y-axis label.
 
string x_label
 X-axis label.
 
string filename
 Image to save plot to. If empty shows plot in a window on the screen.
 
PlotFileType filetype
 The image type to save as. Set to PLOT_FILETYPE_AUTO to guess from file extension.
 
string font
 Font used for text.
 
bool color
 Set to true for colored plot, false for monochrome. Default: true.
 
bool auto_y_min
 If the minimum y-axis value shall be set automatically (otherwise uses y_min). Default: true.
 
bool auto_x_min
 If the minimum x-axis value shall be set automatically (otherwise uses x_min). Default: true.
 
bool auto_y_max
 If the maximum y-axis value shall be set automatically (otherwise uses y_max). Default: true.
 
bool auto_x_max
 If the maximum x-axis value shall be set automatically (otherwise uses x_max). Default: true.
 
float y_min
 Minimum y-axis value.
 
float x_min
 Minimum x-axis value.
 
float y_max
 Maximum y-axis value.
 
float x_max
 Maximum x-axis value.
 
bool y_log
 If a logarithimic scale shall be used for the y-axis. Default: false.
 
bool x_log
 If a logarithimic scale shall be used for the x-axis. Default: false.
 
int y_log_base
 Logarithimic base for the y-axis. Default: 10.
 
int x_log_base
 Logarithimic base for the x-axis. Default: 10.
 
bool grid
 If a grid shall be shown in the plot. Default: false.
 
int linewidth
 Width of lines. Default: 2.
 
bool show_all_borders
 If the plot shall be surrounded by borders on all sides (not just axis). Default: false.
 
PlotLegendPlacement legend_placement
 Where the plot legend shall be placed. Default: PLOT_LEGEND_TOP_RIGHT.
 

Detailed Description

Parameters passed to plotting functions.


The documentation for this struct was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classTextArgument.png0000644000175000017500000000073613401033110021113 00000000000000‰PNG  IHDRYPEÚ)UPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2mIDATxí펄 EO/‰ïÿÈ;ò¡¸B6ìf “Þ©b9”ýsÎMN’&h‘ÿ”l’4 F|›l£èa²÷þÃütýC» ×’ k’#ÅC#;‘=ªºOkI*윕]fÕNRimòþ{"‡˜1òQãǜ맒Jë"×åþA5jrìXnÜÁ‹g#-*©´¾wpôÅé#§Ü%i@9·^IzÐúо€ìœs3Э `Ц‘·mzùž„žGþ—gc‘l‹¼È--ò"´´È‹ ÐÒûÉffS„LÐ"ÿ.ùè'->PŒ/r¾üÈð®îÈ>ñ€ {H»Ú}8¥a8ޤIû½)â« Á K ³’;–©VʳîÉ>êD®ÖŨìäZä£y‰¸½ïÈ!朮˭6Ðʹ~z[|(.äºÜÕ(ÏFìÏ©±V5¶lËõlt¨7~ŒœrxÐ`Η@[ë+ú²™Ù }¨‰°Ö5&éIEND®B`‚libqalculate-2.8.2/docs/reference/html/classFunctionArgument.png0000644000175000017500000000101113401033110021737 00000000000000‰PNG  IHDRsP¥ºLPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2˜IDATxí]nà ‡)÷?rccÀëšRƒ+…¨SÃÂÚyÅ{¤¡L§$õá¿:$5Pÿ†ÓµJ/t®¥ ÿÃÊ©þlMKê’T îÜÖ_u›59W‰ùžv!IZœ™\d‹-$©ÄÎåSs†1W9ã]Vã´½’T¢Ýi¯µËÙZç–39u¢iËÛ´I*ñÁ{¨õ!I†FgŠW’>¥5Îê/IæïŠ$õዜÞ{?€Ïx æçã1^zƒó©.½Ãù5y;˜N€>L'@¦ Ó ЇéèÃtôa:^âœsƒÁ e:úp«sË(€ß<ÛϺZ·U¹P༳ùŒJÎ¥\à A¯±ÇG*DìJs×2 ɳ·÷Sâ9aRZcÿ%WãºÇöefy_÷¹ÓŽ:´YçÙ´³)Õ³­;cÒ½r†1W9ãÝTã´½çag/jï3×Úr¶öòcÞÙ¼=qæ!8òßaÊ!oþÈ»+]åLñT¸,Îò‹À0ËúðENçœË¤|0ž^J IEND®B`‚libqalculate-2.8.2/docs/reference/html/classExpressionItemArgument.png0000644000175000017500000000115013401033110023134 00000000000000‰PNG  IHDR–PÌn|yPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2÷IDATxíë²£ ›ª¼ÿ#o¢\ƒÆÑ\–ÚStðèˆí0à_bŒq>ˆ’4®%IV\K’¬\Ó ’t‚³ñ×´ÂÙçüVkéÃú»>¼ßO¯§Ýz,IV®h%…Å(‰­Å£û¿ˆJ’•÷´*µ«"}'If.i=þŽ´Ö˜jåº:ÌVU’Ì|B«/±¿5‰½V*ñZéY&­Äb,If>²ËŸN†$½äm­’5Iúïgëü^)IüSŸjIú*®%IVæÕŠ1Æéø7€ù˜Sëv›ÒkN­»ÕŒ^“jùJ°ãZV\ ÀŠkXq-+®`ŵ¬¸€×°âZV\ ÀŠkXù´Ba>³áZV\ ÀJÑJ à˜!î~bûÞ³/mêÀUö´NOÆŽÖÒ=N®™[.§,6¿ é¨t%r½©>“/,]jÊ6dk ^B’D‡@ךÀçsi?Ì”° a íÚªéèɯÑÌÙ†3Ú­~œm{ê6kkÔj}Ëå͇¬‘Íãò2z¥Unz¥5¾j-Ú6U{ÙÿßÈz€¶5Q%?ªxj‡“8hõ%fšÄæÃݮIJTöVb·Jš)´Ê:È•^gºßßX¾µõÛ÷ëŸiõu °Ï/³eÿ¸Mÿ©˜×°2¯V!LÇ 6 ­îµâIEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_k.html0000644000175000017500000000445113401033110020136 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- k -

libqalculate-2.8.2/docs/reference/html/structPlotParameters-members.html0000644000175000017500000001750113401033110023453 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
PlotParameters Member List
libqalculate-2.8.2/docs/reference/html/structInternalPrintStruct-members.html0000644000175000017500000001441213401033110024505 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
InternalPrintStruct Member List

This is the complete list of members for InternalPrintStruct, including all inherited members.

den (defined in InternalPrintStruct)InternalPrintStruct
depth (defined in InternalPrintStruct)InternalPrintStruct
division_depth (defined in InternalPrintStruct)InternalPrintStruct
exp (defined in InternalPrintStruct)InternalPrintStruct
exp_minus (defined in InternalPrintStruct)InternalPrintStruct
iexp (defined in InternalPrintStruct)InternalPrintStruct
im (defined in InternalPrintStruct)InternalPrintStruct
InternalPrintStruct() (defined in InternalPrintStruct)InternalPrintStructinline
minus (defined in InternalPrintStruct)InternalPrintStruct
num (defined in InternalPrintStruct)InternalPrintStruct
parent_approximate (defined in InternalPrintStruct)InternalPrintStruct
parent_precision (defined in InternalPrintStruct)InternalPrintStruct
power_depth (defined in InternalPrintStruct)InternalPrintStruct
re (defined in InternalPrintStruct)InternalPrintStruct
wrap (defined in InternalPrintStruct)InternalPrintStruct
libqalculate-2.8.2/docs/reference/html/functions_func_0x7e.html0000644000175000017500000000364413401033110021505 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- ~ -

libqalculate-2.8.2/docs/reference/html/classSymbolicArgument-members.html0000644000175000017500000003432713401033110023563 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
SymbolicArgument Member List

This is the complete list of members for SymbolicArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constSymbolicArgumentvirtual
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constSymbolicArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)Argumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constSymbolicArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constSymbolicArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
SymbolicArgument(string name_="", bool does_test=true, bool does_error=true) (defined in SymbolicArgument)SymbolicArgument
SymbolicArgument(const SymbolicArgument *arg) (defined in SymbolicArgument)SymbolicArgument
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constSymbolicArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~SymbolicArgument() (defined in SymbolicArgument)SymbolicArgumentvirtual
libqalculate-2.8.2/docs/reference/html/classUnknownVariable-members.html0000644000175000017500000010400213401033110023370 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
UnknownVariable Member List

This is the complete list of members for UnknownVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
assumptions()UnknownVariable
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const (defined in UnknownVariable)UnknownVariablevirtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
interval() const (defined in UnknownVariable)UnknownVariable
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() constUnknownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
mstruct (defined in UnknownVariable)UnknownVariableprotected
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
o_assumption (defined in UnknownVariable)UnknownVariableprotected
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in Variable)Variableinlinevirtual
representsComplex(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsEven(bool=false) (defined in Variable)Variableinlinevirtual
representsFraction(bool=false) (defined in Variable)Variableinlinevirtual
representsInteger(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNegative(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNonComplex(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNonInteger(bool=false) (defined in Variable)Variableinlinevirtual
representsNonMatrix() (defined in UnknownVariable)UnknownVariablevirtual
representsNonNegative(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNonPositive(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNonZero(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsNumber(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsOdd(bool=false) (defined in Variable)Variableinlinevirtual
representsPositive(bool=false)UnknownVariablevirtual
representsRational(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsReal(bool=false) (defined in UnknownVariable)UnknownVariablevirtual
representsScalar() (defined in UnknownVariable)UnknownVariablevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in Variable)Variableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in UnknownVariable)UnknownVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setAssumptions(Assumptions *ass)UnknownVariable
setAssumptions(const MathStructure &mvar) (defined in UnknownVariable)UnknownVariable
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setInterval(const MathStructure &o) (defined in UnknownVariable)UnknownVariable
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constUnknownVariableinlinevirtual
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constVariableinlinevirtual
UnknownVariable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)UnknownVariable
UnknownVariable()UnknownVariable
UnknownVariable(const UnknownVariable *variable)UnknownVariable
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~UnknownVariable() (defined in UnknownVariable)UnknownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-2.8.2/docs/reference/html/classCalculator.html0000644000175000017500000134152713401033110020744 00000000000000 libqalculate-2.8.2: Calculator Class Reference
libqalculate-2.8.2

The almighty calculator class. More...

#include <Calculator.h>

Public Member Functions

UnitfindMatchingUnit (const MathStructure &mstruct)
 
void setVariableUnitsEnabled (bool enable_variable_units=true)
 
bool variableUnitsEnabled () const
 
Constructor
 Calculator ()
 
virtual ~Calculator ()
 
Functions for calculating expressions.
bool calculate (MathStructure *mstruct, string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
 
MathStructure calculate (string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
 
bool calculate (MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options, string to_str="")
 
MathStructure calculate (const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options, string to_str="")
 
string calculateAndPrint (string str, int msecs=10000, const EvaluationOptions &eo=default_evaluation_options, const PrintOptions &po=default_print_options)
 
int testCondition (string expression)
 
Functions for printing expressions with the option to set maximum time or abort.
string print (const MathStructure &mstruct, int milliseconds=100000, const PrintOptions &op=default_print_options)
 
string printMathStructureTimeOut (const MathStructure &mstruct, int milliseconds=100000, const PrintOptions &op=default_print_options)
 Deprecated: use print() instead.
 
void startControl (int milliseconds=0)
 
void stopControl (void)
 
bool abort ()
 
bool aborted (void)
 
bool isControlled (void) const
 
string abortedMessage (void) const
 
string timedOutString (void) const
 
void startPrintControl (int milliseconds=0)
 Deprecated: use startControl()
 
void abortPrint (void)
 Deprecated: use abort()
 
void stopPrintControl (void)
 Deprecated: use stopControl()
 
bool printingAborted (void)
 Deprecated: use aborted()
 
bool printingControlled (void) const
 Deprecated: use isControlled()
 
string printingAbortedMessage (void) const
 Deprecated: use abortedMessage()
 
Functions for handling of threaded calculations
bool busy ()
 
void saveState ()
 Deprecated: does nothing.
 
void restoreState ()
 Deprecated: does nothing.
 
void clearBuffers ()
 
void terminateThreads ()
 
Functions for manipulation of the RPN stack.
bool calculateRPNRegister (size_t index, int msecs, const EvaluationOptions &eo=default_evaluation_options)
 
bool calculateRPN (MathOperation op, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
 
bool calculateRPN (MathFunction *f, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
 
bool calculateRPNBitwiseNot (int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
 
bool calculateRPNLogicalNot (int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
 
MathStructurecalculateRPN (MathOperation op, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
 
MathStructurecalculateRPN (MathFunction *f, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
 
MathStructurecalculateRPNBitwiseNot (const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
 
MathStructurecalculateRPNLogicalNot (const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)
 
bool RPNStackEnter (MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options)
 
bool RPNStackEnter (string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
 
void RPNStackEnter (MathStructure *mstruct, bool eval=false, const EvaluationOptions &eo=default_evaluation_options)
 
void RPNStackEnter (string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
 
bool setRPNRegister (size_t index, MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options)
 
bool setRPNRegister (size_t index, string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
 
void setRPNRegister (size_t index, MathStructure *mstruct, bool eval=false, const EvaluationOptions &eo=default_evaluation_options)
 
void setRPNRegister (size_t index, string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)
 
void deleteRPNRegister (size_t index)
 
MathStructuregetRPNRegister (size_t index=1) const
 
size_t RPNStackSize () const
 
void clearRPNStack ()
 
void moveRPNRegister (size_t old_index, size_t new_index)
 
void moveRPNRegisterUp (size_t index)
 
void moveRPNRegisterDown (size_t index)
 
Functions for expression parsing.
string localizeExpression (string str, const ParseOptions &po=default_parse_options) const
 
string unlocalizeExpression (string str, const ParseOptions &po=default_parse_options) const
 
bool separateToExpression (string &str, string &to_str, const EvaluationOptions &eo, bool keep_modifiers=false, bool allow_empty_from=false) const
 
bool hasToExpression (const string &str, bool allow_empty_from=false) const
 
void parseSigns (string &str, bool convert_to_internal_representation=false) const
 
MathStructure parse (string str, const ParseOptions &po=default_parse_options)
 
void parse (MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options)
 
bool parseNumber (MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options)
 
bool parseOperators (MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options)
 
bool parseAdd (string &str, MathStructure *mstruct, const ParseOptions &po, MathOperation s, bool append=true)
 
bool parseAdd (string &str, MathStructure *mstruct, const ParseOptions &po)
 
Functions converting epxressions between units.
MathStructure convert (const MathStructure &mstruct, string composite_, const EvaluationOptions &eo=default_evaluation_options, MathStructure *units=NULL)
 
MathStructure convert (const MathStructure &mstruct, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options, bool always_convert=true, bool convert_to_mixed_units=true)
 
MathStructure convert (const MathStructure &mstruct, KnownVariable *to_var, const EvaluationOptions &eo=default_evaluation_options)
 
MathStructure convert (double value, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options)
 
MathStructure convert (string str, Unit *from_unit, Unit *to_unit, int milliseconds, const EvaluationOptions &eo=default_evaluation_options)
 
MathStructure convertTimeOut (string str, Unit *from_unit, Unit *to_unit, int milliseconds, const EvaluationOptions &eo=default_evaluation_options)
 
MathStructure convert (string str, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options)
 
MathStructure convertToBaseUnits (const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options)
 
UnitgetBestUnit (Unit *u, bool allow_only_div=false, bool convert_to_local_currency=true)
 
MathStructure convertToBestUnit (const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options, bool convert_to_si_units=true)
 
MathStructure convertToCompositeUnit (const MathStructure &mstruct, CompositeUnit *cu, const EvaluationOptions &eo=default_evaluation_options, bool always_convert=true)
 
MathStructure convertToMixedUnits (const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options)
 
Functions for default assumptions for unknown variables and symbols
void setDefaultAssumptions (Assumptions *ass)
 
AssumptionsdefaultAssumptions ()
 
Functions for retrieval of angle units
UnitgetGraUnit ()
 
UnitgetRadUnit ()
 
UnitgetDegUnit ()
 
Functions for finding a suitable prefix.
DecimalPrefixgetExactDecimalPrefix (int exp10, int exp=1) const
 
BinaryPrefixgetExactBinaryPrefix (int exp2, int exp=1) const
 
PrefixgetExactPrefix (const Number &o, int exp=1) const
 
DecimalPrefixgetNearestDecimalPrefix (int exp10, int exp=1) const
 
DecimalPrefixgetBestDecimalPrefix (int exp10, int exp=1, bool all_prefixes=true) const
 
DecimalPrefixgetBestDecimalPrefix (const Number &exp10, const Number &exp, bool all_prefixes=true) const
 
BinaryPrefixgetNearestBinaryPrefix (int exp2, int exp=1) const
 
BinaryPrefixgetBestBinaryPrefix (int exp2, int exp=1) const
 
BinaryPrefixgetBestBinaryPrefix (const Number &exp2, const Number &exp) const
 
PrefixaddPrefix (Prefix *p)
 
void prefixNameChanged (Prefix *p, bool new_item=false)
 
Functions for managing functions, variables, units, prefixes and data sets.
void expressionItemActivated (ExpressionItem *item)
 
void expressionItemDeactivated (ExpressionItem *item)
 
void expressionItemDeleted (ExpressionItem *item)
 
void nameChanged (ExpressionItem *item, bool new_item=false)
 
void deleteName (string name_, ExpressionItem *object=NULL)
 
void deleteUnitName (string name_, Unit *object=NULL)
 
UnitaddUnit (Unit *u, bool force=true, bool check_names=true)
 
void delPrefixUFV (Prefix *object)
 
void delUFV (ExpressionItem *object)
 
bool hasVariable (Variable *v)
 
bool hasUnit (Unit *u)
 
bool hasFunction (MathFunction *f)
 
bool stillHasVariable (Variable *v)
 
bool stillHasUnit (Unit *u)
 
bool stillHasFunction (MathFunction *f)
 
void saveFunctionCalled ()
 
bool checkSaveFunctionCalled ()
 
ExpressionItemgetActiveExpressionItem (string name, ExpressionItem *item=NULL)
 
ExpressionItemgetInactiveExpressionItem (string name, ExpressionItem *item=NULL)
 
ExpressionItemgetActiveExpressionItem (ExpressionItem *item)
 
ExpressionItemgetExpressionItem (string name, ExpressionItem *item=NULL)
 
UnitgetUnit (string name_)
 
UnitgetActiveUnit (string name_)
 
UnitgetCompositeUnit (string internal_name_)
 
UnitgetLocalCurrency ()
 
PrefixgetPrefix (size_t index) const
 
PrefixgetPrefix (string name_) const
 
VariableaddVariable (Variable *v, bool force=true, bool check_names=true)
 
void variableNameChanged (Variable *v, bool new_item=false)
 
void functionNameChanged (MathFunction *f, bool new_item=false)
 
void unitNameChanged (Unit *u, bool new_item=false)
 
VariablegetVariable (string name_)
 
VariablegetActiveVariable (string name_)
 
ExpressionItemaddExpressionItem (ExpressionItem *item, bool force=true)
 
MathFunctionaddFunction (MathFunction *f, bool force=true, bool check_names=true)
 
DataSetaddDataSet (DataSet *dc, bool force=true, bool check_names=true)
 
DataSetgetDataSet (size_t index)
 
DataSetgetDataSet (string name)
 
MathFunctiongetFunction (string name_)
 
MathFunctiongetActiveFunction (string name_)
 
VariablegetVariable (size_t index) const
 
UnitgetUnit (size_t index) const
 
MathFunctiongetFunction (size_t index) const
 
bool unitIsUsedByOtherUnits (const Unit *u) const
 
Functions for handling of builtin expression items
void resetVariables ()
 
void resetFunctions ()
 
void resetUnits ()
 
void reset ()
 
void addBuiltinVariables ()
 
void addBuiltinFunctions ()
 
void addBuiltinUnits ()
 
Functions for testing validity of functions, variable and unit names.
bool variableNameIsValid (const string &name_)
 
bool variableNameIsValid (const char *name_)
 
bool variableNameIsValid (const char *name_, int version_numbers[3], bool is_user_defs)
 
bool variableNameIsValid (const string &name_, int version_numbers[3], bool is_user_defs)
 
string convertToValidVariableName (string name_)
 
bool functionNameIsValid (const string &name_)
 
bool functionNameIsValid (const char *name_)
 
bool functionNameIsValid (const char *name_, int version_numbers[3], bool is_user_defs)
 
bool functionNameIsValid (const string &name_, int version_numbers[3], bool is_user_defs)
 
string convertToValidFunctionName (string name_)
 
bool unitNameIsValid (const string &name_)
 
bool unitNameIsValid (const char *name_)
 
bool unitNameIsValid (const char *name_, int version_numbers[3], bool is_user_defs)
 
bool unitNameIsValid (const string &name_, int version_numbers[3], bool is_user_defs)
 
bool utf8_pos_is_valid_in_name (char *pos)
 
string convertToValidUnitName (string name_)
 
bool nameTaken (string name, ExpressionItem *object=NULL)
 
bool variableNameTaken (string name, Variable *object=NULL)
 
bool unitNameTaken (string name, Unit *object=NULL)
 
bool functionNameTaken (string name, MathFunction *object=NULL)
 
string getName (string name="", ExpressionItem *object=NULL, bool force=false, bool always_append=false)
 
Functions for message handling.
void error (bool critical, int message_category, const char *TEMPLATE,...)
 
void error (bool critical, const char *TEMPLATE,...)
 
void message (MessageType mtype, int message_category, const char *TEMPLATE,...)
 
void message (MessageType mtype, const char *TEMPLATE,...)
 
void message (MessageType mtype, int message_category, const char *TEMPLATE, va_list ap)
 
CalculatorMessagemessage ()
 
CalculatorMessagenextMessage ()
 
bool showArgumentErrors () const
 
void beginTemporaryStopMessages ()
 
int endTemporaryStopMessages (int *message_count=NULL, int *warning_count=NULL, int release_messages_if_no_equal_or_greater_than_message_type=-1)
 
void endTemporaryStopMessages (bool release_messages, vector< CalculatorMessage > *blocked_messages=NULL)
 
void addMessages (vector< CalculatorMessage > *message_vector)
 
const PrintOptionsmessagePrintOptions () const
 
void setMessagePrintOptions (const PrintOptions &po)
 
Functions for loading and saving definitions (variables, functions, units, etc.).
bool loadGlobalDefinitions ()
 
bool loadGlobalDefinitions (string filename)
 
bool loadGlobalPrefixes ()
 
bool loadGlobalCurrencies ()
 
bool loadGlobalUnits ()
 
bool loadGlobalVariables ()
 
bool loadGlobalFunctions ()
 
bool loadGlobalDataSets ()
 
bool loadLocalDefinitions ()
 
int loadDefinitions (const char *file_name, bool is_user_defs=true)
 
bool saveDefinitions ()
 
int saveDataObjects ()
 
int savePrefixes (const char *file_name, bool save_global=false)
 
string temporaryCategory (void) const
 
int saveVariables (const char *file_name, bool save_global=false)
 
int saveUnits (const char *file_name, bool save_global=false)
 
int saveFunctions (const char *file_name, bool save_global=false)
 
int saveDataSets (const char *file_name, bool save_global=false)
 
Functions for CSV file import/export.
bool importCSV (MathStructure &mstruct, const char *file_name, int first_row=1, string delimiter=",", vector< string > *headers=NULL)
 
bool importCSV (const char *file_name, int first_row=1, bool headers=true, string delimiter=",", bool to_matrix=false, string name="", string title="", string category="")
 
bool exportCSV (const MathStructure &mstruct, const char *file_name, string delimiter=",")
 
Functions for exchange rates.
bool canFetch ()
 
bool hasGVFS ()
 Deprecated: gvfs is not needed anymore.
 
bool hasGnomeVFS ()
 Deprecated: gvfs is not needed anymore.
 
bool loadExchangeRates ()
 
string getExchangeRatesFileName (int index=1)
 
string getExchangeRatesUrl (int index=1)
 
time_t getExchangeRatesTime (int index=-1)
 
bool fetchExchangeRates (int seconds, string wget_args)
 Deprecated: wget arguments are not used.
 
bool fetchExchangeRates (int seconds=15, int n=-1)
 
bool checkExchangeRatesDate (unsigned int n_days=7, bool force_check=false, bool send_warning=false, int n=-1)
 
void setExchangeRatesWarningEnabled (bool enable)
 Enable or disable old exchange rates warning (initial state is true).
 
bool exchangeRatesWarningEnabled () const
 
int exchangeRatesUsed () const
 Check if exchange rates has been used since resetExchangeRatesUsed() was last called.
 
void resetExchangeRatesUsed ()
 
void setExchangeRatesUsed (int index)
 For internal use, called by currency units.
 
Functions for plotting
bool canPlot ()
 
MathStructure expressionToPlotVector (string expression, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector=NULL, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000)
 
MathStructure expressionToPlotVector (string expression, float min, float max, int steps, MathStructure *x_vector=NULL, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000)
 
MathStructure expressionToPlotVector (string expression, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector=NULL, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000)
 
MathStructure expressionToPlotVector (string expression, float min, float max, float step, MathStructure *x_vector=NULL, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000)
 
MathStructure expressionToPlotVector (string expression, const MathStructure &x_vector, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000)
 
bool plotVectors (PlotParameters *param, const vector< MathStructure > &y_vectors, const vector< MathStructure > &x_vectors, vector< PlotDataParameters *> &pdps, bool persistent=false, int msecs=5000)
 
bool invokeGnuplot (string commands, string commandline_extra="", bool persistent=false)
 
bool closeGnuplot ()
 
bool gnuplotOpen ()
 
Functions for global precision
void setPrecision (int precision=DEFAULT_PRECISION)
 
int getPrecision () const
 
void useIntervalArithmetic (bool use_interval_arithmetic=true)
 
bool usesIntervalArithmetic () const
 
void beginTemporaryStopIntervalArithmetic ()
 
void endTemporaryStopIntervalArithmetic ()
 
void beginTemporaryEnableIntervalArithmetic ()
 
void endTemporaryEnableIntervalArithmetic ()
 
Functions for localization
const string & getDecimalPoint () const
 
const string & getComma () const
 
void setLocale ()
 
void useDecimalComma ()
 
void useDecimalPoint (bool comma_as_separator=false)
 
void unsetLocale ()
 
string localToString (bool include_spaces=true) const
 
Functions adding alternative symbols for operators and such
void addStringAlternative (string replacement, string standard)
 
bool delStringAlternative (string replacement, string standard)
 
void addDefaultStringAlternative (string replacement, string standard)
 
bool delDefaultStringAlternative (string replacement, string standard)
 
Functions for storing values with associated identifiers
size_t addId (MathStructure *mstruct, bool persistent=false)
 
size_t parseAddId (MathFunction *f, const string &str, const ParseOptions &po, bool persistent=false)
 
size_t parseAddIdAppend (MathFunction *f, const MathStructure &append_mstruct, const string &str, const ParseOptions &po, bool persistent=false)
 
size_t parseAddVectorId (const string &str, const ParseOptions &po, bool persistent=false)
 
MathStructuregetId (size_t id)
 
void delId (size_t id)
 

Public Attributes

KnownVariablev_pi
 
KnownVariablev_e
 
KnownVariablev_euler
 
KnownVariablev_catalan
 
KnownVariablev_i
 
KnownVariablev_pinf
 
KnownVariablev_minf
 
KnownVariablev_undef
 
KnownVariablev_precision
 
KnownVariablev_percent
 
KnownVariablev_permille
 
KnownVariablev_permyriad
 
KnownVariablev_today
 
KnownVariablev_yesterday
 
KnownVariablev_tomorrow
 
KnownVariablev_now
 
UnknownVariablev_x
 
UnknownVariablev_y
 
UnknownVariablev_z
 
UnknownVariablev_C
 
UnknownVariablev_n
 
MathFunctionf_vector
 
MathFunctionf_sort
 
MathFunctionf_rank
 
MathFunctionf_limits
 
MathFunctionf_component
 
MathFunctionf_dimension
 
MathFunctionf_merge_vectors
 
MathFunctionf_matrix
 
MathFunctionf_matrix_to_vector
 
MathFunctionf_area
 
MathFunctionf_rows
 
MathFunctionf_columns
 
MathFunctionf_row
 
MathFunctionf_column
 
MathFunctionf_elements
 
MathFunctionf_element
 
MathFunctionf_transpose
 
MathFunctionf_identity
 
MathFunctionf_determinant
 
MathFunctionf_permanent
 
MathFunctionf_adjoint
 
MathFunctionf_cofactor
 
MathFunctionf_inverse
 
MathFunctionf_magnitude
 
MathFunctionf_hadamard
 
MathFunctionf_entrywise
 
MathFunctionf_factorial
 
MathFunctionf_factorial2
 
MathFunctionf_multifactorial
 
MathFunctionf_binomial
 
MathFunctionf_xor
 
MathFunctionf_bitxor
 
MathFunctionf_even
 
MathFunctionf_odd
 
MathFunctionf_shift
 
MathFunctionf_bitcmp
 
MathFunctionf_abs
 
MathFunctionf_gcd
 
MathFunctionf_lcm
 
MathFunctionf_signum
 
MathFunctionf_heaviside
 
MathFunctionf_dirac
 
MathFunctionf_round
 
MathFunctionf_floor
 
MathFunctionf_ceil
 
MathFunctionf_trunc
 
MathFunctionf_int
 
MathFunctionf_frac
 
MathFunctionf_rem
 
MathFunctionf_mod
 
MathFunctionf_polynomial_unit
 
MathFunctionf_polynomial_primpart
 
MathFunctionf_polynomial_content
 
MathFunctionf_coeff
 
MathFunctionf_lcoeff
 
MathFunctionf_tcoeff
 
MathFunctionf_degree
 
MathFunctionf_ldegree
 
MathFunctionf_re
 
MathFunctionf_im
 
MathFunctionf_arg
 
MathFunctionf_numerator
 
MathFunctionf_denominator
 
MathFunctionf_interval
 
MathFunctionf_sqrt
 
MathFunctionf_cbrt
 
MathFunctionf_root
 
MathFunctionf_sq
 
MathFunctionf_exp
 
MathFunctionf_ln
 
MathFunctionf_logn
 
MathFunctionf_lambert_w
 
MathFunctionf_sin
 
MathFunctionf_cos
 
MathFunctionf_tan
 
MathFunctionf_asin
 
MathFunctionf_acos
 
MathFunctionf_atan
 
MathFunctionf_sinh
 
MathFunctionf_cosh
 
MathFunctionf_tanh
 
MathFunctionf_asinh
 
MathFunctionf_acosh
 
MathFunctionf_atanh
 
MathFunctionf_atan2
 
MathFunctionf_sinc
 
MathFunctionf_radians_to_default_angle_unit
 
MathFunctionf_zeta
 
MathFunctionf_gamma
 
MathFunctionf_digamma
 
MathFunctionf_beta
 
MathFunctionf_airy
 
MathFunctionf_besselj
 
MathFunctionf_bessely
 
MathFunctionf_erf
 
MathFunctionf_erfc
 
MathFunctionf_total
 
MathFunctionf_percentile
 
MathFunctionf_min
 
MathFunctionf_max
 
MathFunctionf_mode
 
MathFunctionf_rand
 
MathFunctionf_date
 
MathFunctionf_datetime
 
MathFunctionf_timevalue
 
MathFunctionf_timestamp
 
MathFunctionf_stamptodate
 
MathFunctionf_days
 
MathFunctionf_yearfrac
 
MathFunctionf_week
 
MathFunctionf_weekday
 
MathFunctionf_month
 
MathFunctionf_day
 
MathFunctionf_year
 
MathFunctionf_yearday
 
MathFunctionf_time
 
MathFunctionf_add_days
 
MathFunctionf_add_months
 
MathFunctionf_add_years
 
MathFunctionf_lunarphase
 
MathFunctionf_nextlunarphase
 
MathFunctionf_bin
 
MathFunctionf_oct
 
MathFunctionf_hex
 
MathFunctionf_base
 
MathFunctionf_roman
 
MathFunctionf_ascii
 
MathFunctionf_char
 
MathFunctionf_length
 
MathFunctionf_concatenate
 
MathFunctionf_replace
 
MathFunctionf_stripunits
 
MathFunctionf_genvector
 
MathFunctionf_for
 
MathFunctionf_sum
 
MathFunctionf_product
 
MathFunctionf_process
 
MathFunctionf_process_matrix
 
MathFunctionf_csum
 
MathFunctionf_if
 
MathFunctionf_is_number
 
MathFunctionf_is_real
 
MathFunctionf_is_rational
 
MathFunctionf_is_integer
 
MathFunctionf_represents_number
 
MathFunctionf_represents_real
 
MathFunctionf_represents_rational
 
MathFunctionf_represents_integer
 
MathFunctionf_function
 
MathFunctionf_select
 
MathFunctionf_diff
 
MathFunctionf_integrate
 
MathFunctionf_solve
 
MathFunctionf_multisolve
 
MathFunctionf_dsolve
 
MathFunctionf_limit
 
MathFunctionf_li
 
MathFunctionf_Li
 
MathFunctionf_Ei
 
MathFunctionf_Si
 
MathFunctionf_Ci
 
MathFunctionf_Shi
 
MathFunctionf_Chi
 
MathFunctionf_igamma
 
MathFunctionf_error
 
MathFunctionf_warning
 
MathFunctionf_message
 
MathFunctionf_save
 
MathFunctionf_load
 
MathFunctionf_export
 
MathFunctionf_title
 
MathFunctionf_register
 
MathFunctionf_stack
 
MathFunctionf_plot
 
Unitu_rad
 
Unitu_gra
 
Unitu_deg
 
Unitu_euro
 
Unitu_btc
 
Unitu_second
 
Unitu_minute
 
Unitu_hour
 
Unitu_year
 
Unitu_month
 
Unitu_day
 
DecimalPrefixdecimal_null_prefix
 
BinaryPrefixbinary_null_prefix
 
bool place_currency_code_before
 
bool place_currency_sign_before
 
bool place_currency_code_before_negative
 
bool place_currency_sign_before_negative
 
bool default_dot_as_separator
 
string local_digit_group_separator
 
string local_digit_group_format
 
bool b_busy
 
string expression_to_calculate
 
EvaluationOptions tmp_evaluationoptions
 
MathStructuretmp_parsedstruct
 
MathStructuretmp_tostruct
 
MathStructuretmp_rpn_mstruct
 
bool tmp_maketodivision
 
int tmp_proc_command
 
int tmp_proc_registers
 
size_t tmp_rpnindex
 
PrintOptions save_printoptions
 
PrintOptions message_printoptions
 
vector< Variable * > variables
 
vector< MathFunction * > functions
 
vector< Unit * > units
 
vector< Prefix * > prefixes
 
vector< DecimalPrefix * > decimal_prefixes
 
vector< BinaryPrefix * > binary_prefixes
 

Protected Member Functions

bool calculateRPN (MathStructure *mstruct, int command, size_t index, int msecs, const EvaluationOptions &eo, int function_arguments=0)
 
bool calculateRPN (string str, int command, size_t index, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division, int function_arguments=0)
 

Protected Attributes

vector< CalculatorMessagemessages
 
int ianglemode
 
int i_precision
 
bool b_interval
 
int i_stop_interval
 
int i_start_interval
 
char vbuffer [200]
 
vector< void * > ufvl
 
vector< char > ufvl_t
 
vector< size_t > ufvl_i
 
vector< void * > ufv [4][UFV_LENGTHS]
 
vector< size_t > ufv_i [4][UFV_LENGTHS]
 
vector< DataSet * > data_sets
 
class Calculator_p * priv
 
vector< string > signs
 
vector< string > real_signs
 
vector< string > default_signs
 
vector< string > default_real_signs
 
char * saved_locale
 
int disable_errors_ref
 
vector< int > stopped_errors_count
 
vector< int > stopped_warnings_count
 
vector< int > stopped_messages_count
 
vector< vector< CalculatorMessage > > stopped_messages
 
Threadcalculate_thread
 
string NAME_NUMBER_PRE_S
 
string NAME_NUMBER_PRE_STR
 
string DOT_STR
 
string DOT_S
 
string COMMA_S
 
string COMMA_STR
 
string ILLEGAL_IN_NAMES
 
string ILLEGAL_IN_UNITNAMES
 
string ILLEGAL_IN_NAMES_MINUS_SPACE_STR
 
bool b_argument_errors
 
int current_stage
 
time_t exchange_rates_time [3]
 
time_t exchange_rates_check_time [3]
 
int b_exchange_rates_used
 
bool b_exchange_rates_warning_enabled
 
bool b_gnuplot_open
 
string gnuplot_cmdline
 
FILE * gnuplot_pipe
 
bool local_to
 
Assumptionsdefault_assumptions
 
vector< Variable * > deleted_variables
 
vector< MathFunction * > deleted_functions
 
vector< Unit * > deleted_units
 
bool b_var_units
 
bool b_save_called
 
int i_timeout
 
struct timeval t_end
 
int i_aborted
 
bool b_controlled
 
string per_str
 
string times_str
 
string plus_str
 
string minus_str
 
string and_str
 
string AND_str
 
string or_str
 
string OR_str
 
string XOR_str
 
size_t per_str_len
 
size_t times_str_len
 
size_t plus_str_len
 
size_t minus_str_len
 
size_t and_str_len
 
size_t AND_str_len
 
size_t or_str_len
 
size_t OR_str_len
 
size_t XOR_str_len
 
vector< MathStructure * > rpn_stack
 

Detailed Description

The almighty calculator class.

The calculator class is responsible for loading functions, variables and units, and keeping track of them, as well as parsing expressions and much more. A calculator object must be created before any other Qalculate! class is used. There should never be more than one calculator object, accessed with CALCULATOR.

A simple application using libqalculate need only create a calculator object, perhaps load definitions (functions, variables, units, etc.) and use the calculate function as follows:

new Calculator();
CALCULATOR->loadGlobalDefinitions();
CALCULATOR->loadLocalDefinitions();
MathStructure result = CALCULATOR->calculate("1 + 1");

Member Function Documentation

◆ abort()

bool Calculator::abort ( )

Abort formatting, printing or evaluation (after startControl() has been called). This function will normally be called from a thread that checks for user input or other conditions.

Returns
false if the calculation thread was forcibly stopped

◆ addBuiltinFunctions()

void Calculator::addBuiltinFunctions ( )

Adds builtin functions. Called automatically when the calculator is created.

◆ addBuiltinUnits()

void Calculator::addBuiltinUnits ( )

Adds builtin units. Called automatically when the calculator is created.

◆ addBuiltinVariables()

void Calculator::addBuiltinVariables ( )

Adds builtin variables. Called automatically when the calculator is created.

◆ addId()

size_t Calculator::addId ( MathStructure mstruct,
bool  persistent = false 
)

Stores a value with an associated id. Mainly for internal use.

Parameters
mstructThe value to store.
persistentIf false the values will be removed from storage when retrieved with getId().
Returns
Storage id.

◆ addPrefix()

Prefix* Calculator::addPrefix ( Prefix p)

Add a new prefix to the calculator.

◆ busy()

bool Calculator::busy ( )

Returns true if the calculate or print thread is busy.

◆ calculate() [1/4]

bool Calculator::calculate ( MathStructure mstruct,
string  str,
int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL,
MathStructure to_struct = NULL,
bool  make_to_division = true 
)

Calculates an expression. The expression should be unlocalized first with unlocalizeExpression(). This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters
[out]mstructMath structure to fill with the result.
strExpression.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the result of the parsing of the expression.
[out]to_structNULL or a math structure to fill with unit expression parsed after "to". If expression does not contain a "to" string, and to_struct is a unit or a symbol (a unit expression string), to_struct will be used instead.
make_to_divisionIf true, the expression after "to" will be interpreted as a unit epxression to convert the result to.
Returns
true if the calculation was successfully started (and finished if msecs > 0).

◆ calculate() [2/4]

MathStructure Calculator::calculate ( string  str,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL,
MathStructure to_struct = NULL,
bool  make_to_division = true 
)

Calculates an expression. The expression should be unlocalized first with unlocalizeExpression().

Parameters
strExpression.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the result of the parsing of the expression.
[out]to_structNULL or a math structure to fill with unit expression parsed after "to". If expression does not contain a "to" string, and to_struct is a unit or a symbol (a unit expression string), to_struct will be used instead.
make_to_divisionIf true, the expression after "to" will be interpreted as a unit epxression to convert the result to.
Returns
The result of the calculation.

◆ calculate() [3/4]

bool Calculator::calculate ( MathStructure mstruct,
int  msecs,
const EvaluationOptions eo = default_evaluation_options,
string  to_str = "" 
)

Calculates a parsed value. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters
[out]mstructParsed value to evaluate and fill with the result.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation of the expression.
to_str"to" expression for conversion.
Returns
The result of the calculation.

◆ calculate() [4/4]

MathStructure Calculator::calculate ( const MathStructure mstruct,
const EvaluationOptions eo = default_evaluation_options,
string  to_str = "" 
)

Calculates a parsed value.

Parameters
mstructParsed value to evaluate.
eoOptions for the evaluation of the expression.
to_str"to" expression for conversion.
Returns
The result of the calculation.

◆ calculateAndPrint()

string Calculator::calculateAndPrint ( string  str,
int  msecs = 10000,
const EvaluationOptions eo = default_evaluation_options,
const PrintOptions po = default_print_options 
)

Calculates an expression.and outputs the result to a text string. The expression should be unlocalized first with unlocalizeExpression().

Unlike other functions for expression evaluation this function handles ending "to"-commmands, in addition to unit conversion, such "to hexadecimal" or to "fractions", similar to the qalc application.

Parameters
strExpression.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
poResult formatting options.
Returns
The result of the calculation.
Since
2.6.0

◆ calculateRPN() [1/4]

bool Calculator::calculateRPN ( MathOperation  op,
int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies a mathematical operation to the first and second value on the RPN stack. The the second value is changed with input from the first value. For example, with OPERATION_SUBTRACT the first value is subtracted from the second. The first value on the stack is removed. If not enough registers is available, then zeros are added. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters
opOperation.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
true if the calculation was successfully started (and finished if msecs > 0).

◆ calculateRPN() [2/4]

bool Calculator::calculateRPN ( MathFunction f,
int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies a mathematical operation to the first value on the RPN stack. The value is set as the first argument of the function. If no register is available, then zero is added. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters
fMathematical function.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
true if the calculation was successfully started (and finished if msecs > 0).

◆ calculateRPN() [3/4]

MathStructure* Calculator::calculateRPN ( MathOperation  op,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies a mathematical operation to the first and second value on the RPN stack. The the second value is changed with input from the first value. For example, with OPERATION_SUBTRACT the first value is subtracted from the second. The first value on the stack is removed. If not enough registers is available, then zeros are added.

Parameters
opOperation.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
The first value on the stack.

◆ calculateRPN() [4/4]

MathStructure* Calculator::calculateRPN ( MathFunction f,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies a mathematical operation to the first value on the RPN stack. The value is set as the first argument of the function. If no register is available, then zero is added.

Parameters
fMathematical function.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
The first value on the stack.

◆ calculateRPNBitwiseNot() [1/2]

bool Calculator::calculateRPNBitwiseNot ( int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies bitwise not to the first value on the RPN stack. If no register is available, then zero is added. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
true if the calculation was successfully started (and finished if msecs > 0).

◆ calculateRPNBitwiseNot() [2/2]

MathStructure* Calculator::calculateRPNBitwiseNot ( const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies bitwise not to the first value on the RPN stack. If no register is available, then zero is added.

Parameters
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
The first value on the stack.

◆ calculateRPNLogicalNot() [1/2]

bool Calculator::calculateRPNLogicalNot ( int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies logical not to the first value on the RPN stack. If no register is available, then zero is added. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
true if the calculation was successfully started (and finished if msecs > 0).

◆ calculateRPNLogicalNot() [2/2]

MathStructure* Calculator::calculateRPNLogicalNot ( const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL 
)

Applies logical not to the first value on the RPN stack. If no register is available, then zero is added.

Parameters
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the unevaluated result.
Returns
The first value on the stack.

◆ calculateRPNRegister()

bool Calculator::calculateRPNRegister ( size_t  index,
int  msecs,
const EvaluationOptions eo = default_evaluation_options 
)

Evaluates a value on the RPN stack. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters
indexIndex, starting at 1, on the RPN stack.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
Returns
true if the calculation was successfully started (and finished if msecs > 0).

◆ canFetch()

bool Calculator::canFetch ( )

Checks if able to downloading exchange rates from the Internet (using libcurl).

Returns
true if exchange rates can downloaded (if libcurl is available).

◆ canPlot()

bool Calculator::canPlot ( )

Checks if gnuplot is available.

Returns
true if gnuplot was found.

◆ checkExchangeRatesDate()

bool Calculator::checkExchangeRatesDate ( unsigned int  n_days = 7,
bool  force_check = false,
bool  send_warning = false,
int  n = -1 
)

Check age of exchange rates on local disc.

Parameters
n_daysHow old in days exchange rates may be before exchange rates need updating
force_checkIf exchange rates date should be checked again even if found outdated within n_days before
send_warningIf the standard exchange rates warning should be sent.
Returns
false if exchange.rates need updating

◆ clearBuffers()

void Calculator::clearBuffers ( )

Clears all stored values. Used internally after aborted calculation.

◆ convert() [1/2]

MathStructure Calculator::convert ( const MathStructure mstruct,
string  composite_,
const EvaluationOptions eo = default_evaluation_options,
MathStructure units = NULL 
)

Converts to a unit expression. The converted value is evaluated.

Parameters
mstructThe value to convert.
composite_Unit expression.
eoEvaluation options.
[out]unitsNULL or a math structure to fill with the parsed unit expression(or set to undefined if no units were found).
Returns
Converted value.

◆ convert() [2/2]

MathStructure Calculator::convert ( const MathStructure mstruct,
Unit to_unit,
const EvaluationOptions eo = default_evaluation_options,
bool  always_convert = true,
bool  convert_to_mixed_units = true 
)

Converts to a unit. The converted value is evaluated.

Parameters
mstructThe value to convert.
composite_Unit to convert to.
eoEvaluation options.
always_convert...
Returns
Converted value.

◆ convertTimeOut()

MathStructure Calculator::convertTimeOut ( string  str,
Unit from_unit,
Unit to_unit,
int  milliseconds,
const EvaluationOptions eo = default_evaluation_options 
)

Depecated: use convert()

◆ defaultAssumptions()

Assumptions* Calculator::defaultAssumptions ( )

Returns the default assumptions for objects without own assumptions (unknown variables and symbols).

◆ delId()

void Calculator::delId ( size_t  id)

Removes and unreferences (value->unref() will be called) a value from storage. Mainly for internal use.

Parameters
idStorage id.

◆ fetchExchangeRates()

bool Calculator::fetchExchangeRates ( int  seconds = 15,
int  n = -1 
)

Download current exchange rates from the Internet to local disc with default wget arguments.

Parameters
secondsMaximum time for donwload try
Returns
true if operation was successful.

◆ findMatchingUnit()

Unit* Calculator::findMatchingUnit ( const MathStructure mstruct)

Used by the UI to find unit category for a mathematical expression.

◆ getBestBinaryPrefix() [1/2]

BinaryPrefix* Calculator::getBestBinaryPrefix ( int  exp2,
int  exp = 1 
) const

Returns the best suited binary prefix for a value.

Parameters
exp10Base-2 exponent of the value.
expThe exponent of the unit.
Returns
A prefix or NULL if the unit should be left without prefix.

◆ getBestBinaryPrefix() [2/2]

BinaryPrefix* Calculator::getBestBinaryPrefix ( const Number exp2,
const Number exp 
) const

Returns the best suited binary prefix for a value.

Parameters
exp10Base-2 exponent of the value.
expThe exponent of the unit.
Returns
A prefix or NULL if the unit should be left without prefix.

◆ getBestDecimalPrefix() [1/2]

DecimalPrefix* Calculator::getBestDecimalPrefix ( int  exp10,
int  exp = 1,
bool  all_prefixes = true 
) const

Returns the best suited decimal prefix for a value.

Parameters
exp10Base-10 exponent of the value.
expThe exponent of the unit.
all_prefixesIf false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will be skipped.
Returns
A prefix or NULL if the unit should be left without prefix.

◆ getBestDecimalPrefix() [2/2]

DecimalPrefix* Calculator::getBestDecimalPrefix ( const Number exp10,
const Number exp,
bool  all_prefixes = true 
) const

Returns the best suited decimal prefix for a value.

Parameters
exp10Base-10 exponent of the value.
expThe exponent of the unit.
all_prefixesIf false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will be skipped.
Returns
A prefix or NULL if the unit should be left without prefix.

◆ getComma()

const string& Calculator::getComma ( ) const

Returns the preferred comma character for separating arguments.

◆ getDecimalPoint()

const string& Calculator::getDecimalPoint ( ) const

Returns the preferred decimal point character.

◆ getDegUnit()

Unit* Calculator::getDegUnit ( )

Returns the degrees unit.

◆ getExactBinaryPrefix()

BinaryPrefix* Calculator::getExactBinaryPrefix ( int  exp2,
int  exp = 1 
) const

Returns a binary prefix with exactly the provided value, that fulfils the condition prefix->exponent(exp) == exp2.

Parameters
exp2Base-2 exponent of the requested prefix.
expThe exponent of the unit.
Returns
A prefix or NULL if not found.

◆ getExactDecimalPrefix()

DecimalPrefix* Calculator::getExactDecimalPrefix ( int  exp10,
int  exp = 1 
) const

Returns a decimal prefix with exactly the provided value, that fulfils the condition prefix->exponent(exp) == exp10.

Parameters
exp10Base-10 exponent of the requested prefix.
expThe exponent of the unit.
Returns
A prefix or NULL if not found.

◆ getExactPrefix()

Prefix* Calculator::getExactPrefix ( const Number o,
int  exp = 1 
) const

Returns a prefix with exactly the provided value, that fulfils the condition prefix->value(exp) == o.

Parameters
oValue of the requested prefix.
expThe exponent of the unit.
Returns
A prefix or NULL if not found.

◆ getExchangeRatesFileName()

string Calculator::getExchangeRatesFileName ( int  index = 1)

Name of the exchange rates file on local disc. Multiple exchange rates sources might be used. Iterate over these, using the index parameter, until an empty string is returned.

Parameters
indexThe index (starting at one) of the exchange rate source
Returns
name of local exchange rates file.

◆ getExchangeRatesTime()

time_t Calculator::getExchangeRatesTime ( int  index = -1)

Modification time of the exchange rates file.

Returns
Returns exchange rates modification time.

◆ getExchangeRatesUrl()

string Calculator::getExchangeRatesUrl ( int  index = 1)

Url of the exchange rates file on the Internet. Multiple exchange rates sources might be used. Iterate over these, using the index parameter, until an empty string is returned.

Parameters
indexThe index (starting at one) of the exchange rate source
Returns
Url of exchange rates file.

◆ getFunction()

MathFunction* Calculator::getFunction ( size_t  index) const

Returns function for an index (starting at zero). All functions can be traversed by starting at index zero and increasing the index until NULL is returned.

Parameters
indexIndex of function.
Returns
Function for index or NULL if not found.

◆ getGraUnit()

Unit* Calculator::getGraUnit ( )

Returns the gradians unit.

◆ getId()

MathStructure* Calculator::getId ( size_t  id)

Returns a stored value. Mainly for internal use.

Parameters
idStorage id.
Returns
A stored value.

◆ getNearestBinaryPrefix()

BinaryPrefix* Calculator::getNearestBinaryPrefix ( int  exp2,
int  exp = 1 
) const

Returns the nearest binary prefix for a value.

Parameters
exp10Base-2 exponent of the value.
expThe exponent of the unit.
Returns
A prefix or NULL if no binary prefix is available.

◆ getNearestDecimalPrefix()

DecimalPrefix* Calculator::getNearestDecimalPrefix ( int  exp10,
int  exp = 1 
) const

Returns the nearest decimal prefix for a value.

Parameters
exp10Base-10 exponent of the value.
expThe exponent of the unit.
Returns
A prefix or NULL if no decimal prefix is available.

◆ getPrecision()

int Calculator::getPrecision ( ) const

Returns default precision for approximate calculations.

◆ getPrefix() [1/2]

Prefix* Calculator::getPrefix ( size_t  index) const

Returns prefix for an index (starting at zero). All prefixes can be traversed by starting at index zero and increasing the index until NULL is returned.

Parameters
indexIndex of prefix.
Returns
Prefix for index or NULL if not found.

◆ getPrefix() [2/2]

Prefix* Calculator::getPrefix ( string  name_) const

Returns prefix with provided name.

Parameters
name_Name of prefix to retrieve.
Returns
Prefix with provided name or NULL if not found.

◆ getRadUnit()

Unit* Calculator::getRadUnit ( )

Returns the radians unit.

◆ getUnit()

Unit* Calculator::getUnit ( size_t  index) const

Returns unit for an index (starting at zero). All units can be traversed by starting at index zero and increasing the index until NULL is returned.

Parameters
indexIndex of unit.
Returns
Unit for index or NULL if not found.

◆ getVariable()

Variable* Calculator::getVariable ( size_t  index) const

Returns variable for an index (starting at zero). All variables can be traversed by starting at index zero and increasing the index until NULL is returned.

Parameters
indexIndex of variable.
Returns
Variable for index or NULL if not found.

◆ hasFunction()

bool Calculator::hasFunction ( MathFunction f)

Checks if a function exists/is registered in the calculator.

◆ hasUnit()

bool Calculator::hasUnit ( Unit u)

Checks if a unit exists/is registered in the calculator.

◆ hasVariable()

bool Calculator::hasVariable ( Variable v)

Checks if a variable exists/is registered in the calculator.

◆ loadDefinitions()

int Calculator::loadDefinitions ( const char *  file_name,
bool  is_user_defs = true 
)

Load definitions from a file.

Parameters
file_nameThe path to the file to load.
is_user_defstrue if the definitions are local, false if they are global.
Returns
true if the definitions were successfully loaded.

◆ loadExchangeRates()

bool Calculator::loadExchangeRates ( )

Load saved (local) currency units and exchange rates.

Returns
true if operation successful.

◆ loadGlobalCurrencies()

bool Calculator::loadGlobalCurrencies ( )

Load currencies.

Returns
true if the definitions were successfully loaded.

◆ loadGlobalDataSets()

bool Calculator::loadGlobalDataSets ( )

Load data sets.

Returns
true if the definitions were successfully loaded.

◆ loadGlobalDefinitions() [1/2]

bool Calculator::loadGlobalDefinitions ( )

Load all standard global (system wide) definitions from the global data directory ($PREFIX/share/qalculate).

Returns
true if the definitions were successfully loaded.

◆ loadGlobalDefinitions() [2/2]

bool Calculator::loadGlobalDefinitions ( string  filename)

Load global (system wide) definitions from a file in the global data directory ($PREFIX/share/qalculate).

Parameters
filenameName of the file in the global data directory.
Returns
true if the definitions were successfully loaded.

◆ loadGlobalFunctions()

bool Calculator::loadGlobalFunctions ( )

Load functions.

Returns
true if the definitions were successfully loaded.

◆ loadGlobalPrefixes()

bool Calculator::loadGlobalPrefixes ( )

Load prefixes.

Returns
true if the definitions were successfully loaded.

◆ loadGlobalUnits()

bool Calculator::loadGlobalUnits ( )

Load units.

Returns
true if the definitions were successfully loaded.

◆ loadGlobalVariables()

bool Calculator::loadGlobalVariables ( )

Load variables.

Returns
true if the definitions were successfully loaded.

◆ loadLocalDefinitions()

bool Calculator::loadLocalDefinitions ( )

Load local, user specific, definitions from the local definitions directory (~/.qalculate/definitions). All files in the directory and in the datasets subdirectory are loaded.

Returns
true if the definitions were successfully loaded.

◆ localizeExpression()

string Calculator::localizeExpression ( string  str,
const ParseOptions po = default_parse_options 
) const

Returns a localized expressions. Affects decimal signs and argument separators.

Parameters
strThe expression to localize.
Returns
A localized expression.

◆ localToString()

string Calculator::localToString ( bool  include_spaces = true) const

Returns the translated text string used in expressions for converting to a specific unit expression (ex "5 meters to feet.

◆ message() [1/2]

void Calculator::message ( MessageType  mtype,
int  message_category,
const char *  TEMPLATE,
  ... 
)

Put a message in the message queue.

◆ message() [2/2]

CalculatorMessage* Calculator::message ( )

Returns the first message in queue.

◆ nameTaken()

bool Calculator::nameTaken ( string  name,
ExpressionItem object = NULL 
)

Checks if a name is used by another object which is not allowed to have the same name.

Parameters
nameName.
objectObject to exclude from check.
Returns
true if the name is used.

◆ nextMessage()

CalculatorMessage* Calculator::nextMessage ( )

Removes the first message in queue and returns the next.

◆ parse()

MathStructure Calculator::parse ( string  str,
const ParseOptions po = default_parse_options 
)

Parse an expression and place in a MathStructure object.

Parameters
strExpression
poParse options.
Returns
MathStructure with result of parse.

◆ parseAddId()

size_t Calculator::parseAddId ( MathFunction f,
const string &  str,
const ParseOptions po,
bool  persistent = false 
)

Stores a function value with arguments parsed from a text string using Function::parse(), with an associated id. Mainly for internal use.

Parameters
fMathematical function.
strArguments.
poParse options.
persistentIf false the values will be removed from storage when retrieved with getId().
Returns
Storage id.

◆ prefixNameChanged()

void Calculator::prefixNameChanged ( Prefix p,
bool  new_item = false 
)

Used internally.

◆ print()

string Calculator::print ( const MathStructure mstruct,
int  milliseconds = 100000,
const PrintOptions op = default_print_options 
)

Calls MathStructure::format(po) and MathStructure::print(po). The process is aborted after msecs milliseconds.

◆ reset()

void Calculator::reset ( )

Unloads all non-builtin variables, functions and units.

◆ resetFunctions()

void Calculator::resetFunctions ( )

Unloads all non-builtin functions.

◆ resetUnits()

void Calculator::resetUnits ( )

Unloads all non-builtin units.

◆ resetVariables()

void Calculator::resetVariables ( )

Unloads all non-builtin variables.

◆ RPNStackEnter() [1/4]

bool Calculator::RPNStackEnter ( MathStructure mstruct,
int  msecs,
const EvaluationOptions eo = default_evaluation_options 
)

Evaluates a value and adds the result first on the RPN stack. This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters
mstructValue.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation of the expression.
Returns
true if the calculation was successfully started (and finished if msecs > 0).

◆ RPNStackEnter() [2/4]

bool Calculator::RPNStackEnter ( string  str,
int  msecs,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL,
MathStructure to_struct = NULL,
bool  make_to_division = true 
)

Calculates an expression and adds the result first on the RPN stack. The expression should be unlocalized first with unlocalizeExpression(). This function starts the calculation in a separate thread and will return when the calculation has started unless a maximum time has been specified. The calculation can then be stopped with abort().

Parameters
strExpression.
msecsThe maximum time for the calculation in milliseconds. If msecs <= 0 the time will be unlimited.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the result of the parsing of the expression.
[out]to_structNULL or a math structure to fill with unit expression parsed after "to".
make_to_divisionIf true, the expression after "to" will be interpreted as a unit epxression to convert the result to.
Returns
true if the calculation was successfully started (and finished if msecs > 0).

◆ RPNStackEnter() [3/4]

void Calculator::RPNStackEnter ( MathStructure mstruct,
bool  eval = false,
const EvaluationOptions eo = default_evaluation_options 
)

Adds a value first on the RPN stack.

Parameters
mstructValue.
evalIf true, the the mathematical structure will be evaluated first.

◆ RPNStackEnter() [4/4]

void Calculator::RPNStackEnter ( string  str,
const EvaluationOptions eo = default_evaluation_options,
MathStructure parsed_struct = NULL,
MathStructure to_struct = NULL,
bool  make_to_division = true 
)

Calculates an expression adds the result first on the RPN stack. The expression should be unlocalized first with unlocalizeExpression().

Parameters
strExpression.
eoOptions for the evaluation and parsing of the expression.
[out]parsed_structNULL or a math structure to fill with the result of the parsing of the expression.
[out]to_structNULL or a math structure to fill with unit expression parsed after "to".
make_to_divisionIf true, the expression after "to" will be interpreted as a unit epxression to convert the result to.

◆ saveDefinitions()

bool Calculator::saveDefinitions ( )

Save local definitions to ~/.qalculate/definitions/

Returns
true if definitions was successfully saved.

◆ separateToExpression()

bool Calculator::separateToExpression ( string &  str,
string &  to_str,
const EvaluationOptions eo,
bool  keep_modifiers = false,
bool  allow_empty_from = false 
) const

Split an expression string after and before " to ".

Parameters
[out]strThe expression. Will be set to the string before " to ".
[out]to_strWill be set to the string after " to ".
eoOptions for the evaluation and parsing of the expression (nothing will be done if units are not enabled).
Returns
true if " to " was found and the expression split.

◆ setDefaultAssumptions()

void Calculator::setDefaultAssumptions ( Assumptions ass)

Set assumptions for objects without own assumptions (unknown variables and symbols).

◆ setLocale()

void Calculator::setLocale ( )

Sets argument separator and decimal sign from the current locale. Mainly for internal use.

◆ setPrecision()

void Calculator::setPrecision ( int  precision = DEFAULT_PRECISION)

Set default precision for approximate calculations.

Parameters
precisionPrecision.

◆ startControl()

void Calculator::startControl ( int  milliseconds = 0)

Called before calculation, formatting or printing of a MathStructure (Calculator::calculate(), without maximum time, MathStructure::eval(), MathStructure::format() and MathStructure::print(), etc.) or printing of a Number (using Number::print) to be able to abort the process. Always use Calculator::stopControl() after finishing.

Parameters
millisecondsThe maximum time for the process in milliseconds. If msecs <= 0 the time will be unlimited (stop with abort()).

◆ stillHasFunction()

bool Calculator::stillHasFunction ( MathFunction f)

Checks if a pointer points to a mathematical function that still exists in the calculator. As opposed to hasFunction(), this function only checks if the mathematical function has been deleted.

◆ stillHasUnit()

bool Calculator::stillHasUnit ( Unit u)

Checks if a pointer points to a unit that still exists in the calculator. As opposed to hasUnit(), this function only checks if the unit has been deleted.

◆ stillHasVariable()

bool Calculator::stillHasVariable ( Variable v)

Checks if a pointer points to a variable that still exists in the calculator. As opposed to hasFunction(), this function only checks if the mathematical function has been deleted.

◆ stopControl()

void Calculator::stopControl ( void  )

Always call this function after Calculator::startControl() after formatting, printing or calculation has finished.

◆ terminateThreads()

void Calculator::terminateThreads ( )

Terminate calculation and print threads if started. Do not use to terminate calculation.

◆ unlocalizeExpression()

string Calculator::unlocalizeExpression ( string  str,
const ParseOptions po = default_parse_options 
) const

Returns an unlocalized expressions. Affects decimal signs and argument separators.

Parameters
strThe expression to unlocalize.
Returns
An unlocalized expression.

◆ unsetLocale()

void Calculator::unsetLocale ( )

Resets argument separator and decimal sign. Mainly for internal use.

◆ useDecimalPoint()

void Calculator::useDecimalPoint ( bool  comma_as_separator = false)

Use point as decimal separator. To use comma as an ignored separator in numbers, must be invoked with comma_as_separator = true, to change the default function argument separator to semicolon, in addition to using ParseOptions::comma_as_separator.

◆ useIntervalArithmetic()

void Calculator::useIntervalArithmetic ( bool  use_interval_arithmetic = true)

Set if interval arithmetic should be used for approximate calculations.

Parameters
use_interval_arithmeticSet true to activate, or false to deactivate, interval arithmetic.

◆ usesIntervalArithmetic()

bool Calculator::usesIntervalArithmetic ( ) const

Returns true if interval arithmetic are activated.

◆ variableNameIsValid() [1/2]

bool Calculator::variableNameIsValid ( const string &  name_)

Tests if a name is valid for a variable.

Parameters
name_Variable name.
Returns
true if the name is valid for a variable.

◆ variableNameIsValid() [2/2]

bool Calculator::variableNameIsValid ( const char *  name_)

Tests if a name is valid for a variable.

Parameters
name_Variable name.
Returns
true if the name is valid for a variable.

The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/Number_8h.html0000644000175000017500000001401013401033110017433 00000000000000 libqalculate-2.8.2: libqalculate/Number.h File Reference
libqalculate-2.8.2
Number.h File Reference
#include <libqalculate/includes.h>
#include <gmp.h>
#include <mpfr.h>

Classes

class  Number
 A number. More...
 

Macros

#define EQUALS_PRECISION_DEFAULT   -1
 
#define EQUALS_PRECISION_LOWEST   -2
 
#define EQUALS_PRECISION_HIGHEST   -3
 

Enumerations

enum  NumberType { NUMBER_TYPE_RATIONAL, NUMBER_TYPE_FLOAT, NUMBER_TYPE_PLUS_INFINITY, NUMBER_TYPE_MINUS_INFINITY }
 
enum  IntegerType {
  INTEGER_TYPE_NONE, INTEGER_TYPE_SINT, INTEGER_TYPE_UINT, INTEGER_TYPE_ULONG,
  INTEGER_TYPE_SLONG, INTEGER_TYPE_SIZE
}
 

Functions

ostream & operator<< (ostream &os, const Number &)
 
libqalculate-2.8.2/docs/reference/html/classNumberArgument.html0000644000175000017500000011400513401033110021572 00000000000000 libqalculate-2.8.2: NumberArgument Class Reference
libqalculate-2.8.2

A definition for numerical arguments. More...

#include <Function.h>

Inheritance diagram for NumberArgument:
Argument

Public Member Functions

 NumberArgument (string name_="", ArgumentMinMaxPreDefinition minmax=ARGUMENT_MIN_MAX_NONE, bool does_test=true, bool does_error=true)
 
 NumberArgument (const NumberArgument *arg)
 
virtual void set (const Argument *arg)
 
virtual Argumentcopy () const
 
virtual string print () const
 
void setMin (const Number *nmin)
 
void setIncludeEqualsMin (bool include_equals)
 
bool includeEqualsMin () const
 
const Numbermin () const
 
void setMax (const Number *nmax)
 
void setIncludeEqualsMax (bool include_equals)
 
bool includeEqualsMax () const
 
const Numbermax () const
 
bool complexAllowed () const
 
void setComplexAllowed (bool allow_complex)
 
bool rationalNumber () const
 
void setRationalNumber (bool rational_number)
 
virtual int type () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Protected Attributes

Numberfmin
 
Numberfmax
 
bool b_incl_min
 
bool b_incl_max
 
bool b_complex
 
bool b_rational_number
 
- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A definition for numerical arguments.

These arguments allows numerical values. The value can be restricted to real or rational numbers (defaults to allow all numbers, including complex), and a max and/or min value.

Member Function Documentation

◆ copy()

virtual Argument* NumberArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string NumberArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ set()

virtual void NumberArgument::set ( const Argument arg)
virtual

Sets the argument to a copy of an argument definition.

Parameters
argArgument to copy.

Reimplemented from Argument.

◆ subprintlong()

virtual string NumberArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool NumberArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int NumberArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classYesterdayVariable.html0000644000175000017500000017027413401033110022270 00000000000000 libqalculate-2.8.2: YesterdayVariable Class Reference
libqalculate-2.8.2
YesterdayVariable Class Reference
Inheritance diagram for YesterdayVariable:
DynamicVariable KnownVariable Variable ExpressionItem

Public Member Functions

 YesterdayVariable (const YesterdayVariable *variable)
 
ExpressionItemcopy () const
 
virtual bool representsPositive (bool=false)
 
virtual bool representsNonNegative (bool=false)
 
virtual bool representsNonInteger (bool=false)
 
virtual bool representsNumber (bool b=false)
 
virtual bool representsReal (bool b=false)
 
virtual bool representsNonZero (bool b=false)
 
- Public Member Functions inherited from DynamicVariable
 DynamicVariable (string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true)
 
 DynamicVariable (const DynamicVariable *variable)
 
void set (const ExpressionItem *item)
 
const MathStructureget ()
 
void set (const MathStructure &o)
 
void set (string expression_)
 
int calculatedPrecision () const
 
bool calculatedWithInterval () const
 
virtual bool representsNegative (bool=false)
 
virtual bool representsNonPositive (bool=false)
 
virtual bool representsInteger (bool=false)
 
virtual bool representsRational (bool=false)
 
virtual bool representsComplex (bool=false)
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
virtual bool representsNonMatrix ()
 
virtual bool representsScalar ()
 
- Public Member Functions inherited from KnownVariable
 KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable ()
 
 KnownVariable (const KnownVariable *variable)
 
bool isKnown () const
 
virtual bool isExpression () const
 
virtual string expression () const
 
virtual string uncertainty () const
 
virtual string unit () const
 
int subtype () const
 
virtual void setUncertainty (string standard_uncertainty)
 
virtual void setUnit (string unit_expression)
 
virtual bool representsFraction (bool=false)
 
virtual bool representsNonComplex (bool=false)
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Additional Inherited Members

- Protected Attributes inherited from DynamicVariable
bool always_recalculate
 
- Protected Attributes inherited from KnownVariable
MathStructuremstruct
 
bool b_expression
 
int calculated_precision
 
bool calculated_with_interval
 
bool calculated_with_units
 
string sexpression
 
string suncertainty
 
string sunit
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Member Function Documentation

◆ representsPositive()

virtual bool YesterdayVariable::representsPositive ( bool  = false)
inlinevirtual

Returns if the variable represents a positive value.

Reimplemented from DynamicVariable.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classUnitArgument.html0000644000175000017500000007305013401033110021265 00000000000000 libqalculate-2.8.2: UnitArgument Class Reference
libqalculate-2.8.2
Inheritance diagram for UnitArgument:
Argument

Public Member Functions

 UnitArgument (string name_="", bool does_test=true, bool does_error=true)
 
 UnitArgument (const UnitArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Member Function Documentation

◆ copy()

virtual Argument* UnitArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string UnitArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string UnitArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool UnitArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int UnitArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classCalculator-members.html0000644000175000017500000045701613401033110022374 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
Calculator Member List

This is the complete list of members for Calculator, including all inherited members.

abort()Calculator
aborted(void) (defined in Calculator)Calculator
abortedMessage(void) const (defined in Calculator)Calculator
abortPrint(void)Calculator
addBuiltinFunctions()Calculator
addBuiltinUnits()Calculator
addBuiltinVariables()Calculator
addDataSet(DataSet *dc, bool force=true, bool check_names=true) (defined in Calculator)Calculator
addDefaultStringAlternative(string replacement, string standard) (defined in Calculator)Calculator
addExpressionItem(ExpressionItem *item, bool force=true) (defined in Calculator)Calculator
addFunction(MathFunction *f, bool force=true, bool check_names=true) (defined in Calculator)Calculator
addId(MathStructure *mstruct, bool persistent=false)Calculator
addMessages(vector< CalculatorMessage > *message_vector) (defined in Calculator)Calculator
addPrefix(Prefix *p)Calculator
addStringAlternative(string replacement, string standard) (defined in Calculator)Calculator
addUnit(Unit *u, bool force=true, bool check_names=true) (defined in Calculator)Calculator
addVariable(Variable *v, bool force=true, bool check_names=true) (defined in Calculator)Calculator
and_str (defined in Calculator)Calculatorprotected
AND_str (defined in Calculator)Calculatorprotected
and_str_len (defined in Calculator)Calculatorprotected
AND_str_len (defined in Calculator)Calculatorprotected
b_argument_errors (defined in Calculator)Calculatorprotected
b_busy (defined in Calculator)Calculator
b_controlled (defined in Calculator)Calculatorprotected
b_exchange_rates_used (defined in Calculator)Calculatorprotected
b_exchange_rates_warning_enabled (defined in Calculator)Calculatorprotected
b_gnuplot_open (defined in Calculator)Calculatorprotected
b_interval (defined in Calculator)Calculatorprotected
b_save_called (defined in Calculator)Calculatorprotected
b_var_units (defined in Calculator)Calculatorprotected
beginTemporaryEnableIntervalArithmetic() (defined in Calculator)Calculator
beginTemporaryStopIntervalArithmetic() (defined in Calculator)Calculator
beginTemporaryStopMessages() (defined in Calculator)Calculator
binary_null_prefix (defined in Calculator)Calculator
binary_prefixes (defined in Calculator)Calculator
busy()Calculator
calculate(MathStructure *mstruct, string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)Calculator
calculate(string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)Calculator
calculate(MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options, string to_str="")Calculator
calculate(const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options, string to_str="")Calculator
calculate_thread (defined in Calculator)Calculatorprotected
calculateAndPrint(string str, int msecs=10000, const EvaluationOptions &eo=default_evaluation_options, const PrintOptions &po=default_print_options)Calculator
calculateRPN(MathStructure *mstruct, int command, size_t index, int msecs, const EvaluationOptions &eo, int function_arguments=0) (defined in Calculator)Calculatorprotected
calculateRPN(string str, int command, size_t index, int msecs, const EvaluationOptions &eo, MathStructure *parsed_struct, MathStructure *to_struct, bool make_to_division, int function_arguments=0) (defined in Calculator)Calculatorprotected
calculateRPN(MathOperation op, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPN(MathFunction *f, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPN(MathOperation op, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPN(MathFunction *f, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNBitwiseNot(int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNBitwiseNot(const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNLogicalNot(int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNLogicalNot(const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL)Calculator
calculateRPNRegister(size_t index, int msecs, const EvaluationOptions &eo=default_evaluation_options)Calculator
Calculator() (defined in Calculator)Calculator
canFetch()Calculator
canPlot()Calculator
checkExchangeRatesDate(unsigned int n_days=7, bool force_check=false, bool send_warning=false, int n=-1)Calculator
checkSaveFunctionCalled() (defined in Calculator)Calculator
clearBuffers()Calculator
clearRPNStack() (defined in Calculator)Calculator
closeGnuplot() (defined in Calculator)Calculator
COMMA_S (defined in Calculator)Calculatorprotected
COMMA_STR (defined in Calculator)Calculatorprotected
convert(const MathStructure &mstruct, string composite_, const EvaluationOptions &eo=default_evaluation_options, MathStructure *units=NULL)Calculator
convert(const MathStructure &mstruct, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options, bool always_convert=true, bool convert_to_mixed_units=true)Calculator
convert(const MathStructure &mstruct, KnownVariable *to_var, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convert(double value, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convert(string str, Unit *from_unit, Unit *to_unit, int milliseconds, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convert(string str, Unit *from_unit, Unit *to_unit, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convertTimeOut(string str, Unit *from_unit, Unit *to_unit, int milliseconds, const EvaluationOptions &eo=default_evaluation_options)Calculator
convertToBaseUnits(const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convertToBestUnit(const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options, bool convert_to_si_units=true) (defined in Calculator)Calculator
convertToCompositeUnit(const MathStructure &mstruct, CompositeUnit *cu, const EvaluationOptions &eo=default_evaluation_options, bool always_convert=true) (defined in Calculator)Calculator
convertToMixedUnits(const MathStructure &mstruct, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
convertToValidFunctionName(string name_) (defined in Calculator)Calculator
convertToValidUnitName(string name_) (defined in Calculator)Calculator
convertToValidVariableName(string name_) (defined in Calculator)Calculator
current_stage (defined in Calculator)Calculatorprotected
data_sets (defined in Calculator)Calculatorprotected
decimal_null_prefix (defined in Calculator)Calculator
decimal_prefixes (defined in Calculator)Calculator
default_assumptions (defined in Calculator)Calculatorprotected
default_dot_as_separator (defined in Calculator)Calculator
default_real_signs (defined in Calculator)Calculatorprotected
default_signs (defined in Calculator)Calculatorprotected
defaultAssumptions()Calculator
delDefaultStringAlternative(string replacement, string standard) (defined in Calculator)Calculator
deleted_functions (defined in Calculator)Calculatorprotected
deleted_units (defined in Calculator)Calculatorprotected
deleted_variables (defined in Calculator)Calculatorprotected
deleteName(string name_, ExpressionItem *object=NULL) (defined in Calculator)Calculator
deleteRPNRegister(size_t index) (defined in Calculator)Calculator
deleteUnitName(string name_, Unit *object=NULL) (defined in Calculator)Calculator
delId(size_t id)Calculator
delPrefixUFV(Prefix *object) (defined in Calculator)Calculator
delStringAlternative(string replacement, string standard) (defined in Calculator)Calculator
delUFV(ExpressionItem *object) (defined in Calculator)Calculator
disable_errors_ref (defined in Calculator)Calculatorprotected
DOT_S (defined in Calculator)Calculatorprotected
DOT_STR (defined in Calculator)Calculatorprotected
endTemporaryEnableIntervalArithmetic() (defined in Calculator)Calculator
endTemporaryStopIntervalArithmetic() (defined in Calculator)Calculator
endTemporaryStopMessages(int *message_count=NULL, int *warning_count=NULL, int release_messages_if_no_equal_or_greater_than_message_type=-1) (defined in Calculator)Calculator
endTemporaryStopMessages(bool release_messages, vector< CalculatorMessage > *blocked_messages=NULL) (defined in Calculator)Calculator
error(bool critical, int message_category, const char *TEMPLATE,...) (defined in Calculator)Calculator
error(bool critical, const char *TEMPLATE,...) (defined in Calculator)Calculator
exchange_rates_check_time (defined in Calculator)Calculatorprotected
exchange_rates_time (defined in Calculator)Calculatorprotected
exchangeRatesUsed() constCalculator
exchangeRatesWarningEnabled() const (defined in Calculator)Calculator
exportCSV(const MathStructure &mstruct, const char *file_name, string delimiter=",") (defined in Calculator)Calculator
expression_to_calculate (defined in Calculator)Calculator
expressionItemActivated(ExpressionItem *item) (defined in Calculator)Calculator
expressionItemDeactivated(ExpressionItem *item) (defined in Calculator)Calculator
expressionItemDeleted(ExpressionItem *item) (defined in Calculator)Calculator
expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, int steps, MathStructure *x_vector=NULL, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000) (defined in Calculator)Calculator
expressionToPlotVector(string expression, float min, float max, int steps, MathStructure *x_vector=NULL, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000) (defined in Calculator)Calculator
expressionToPlotVector(string expression, const MathStructure &min, const MathStructure &max, const MathStructure &step, MathStructure *x_vector=NULL, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000) (defined in Calculator)Calculator
expressionToPlotVector(string expression, float min, float max, float step, MathStructure *x_vector=NULL, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000) (defined in Calculator)Calculator
expressionToPlotVector(string expression, const MathStructure &x_vector, string x_var="\", const ParseOptions &po=default_parse_options, int msecs=5000) (defined in Calculator)Calculator
f_abs (defined in Calculator)Calculator
f_acos (defined in Calculator)Calculator
f_acosh (defined in Calculator)Calculator
f_add_days (defined in Calculator)Calculator
f_add_months (defined in Calculator)Calculator
f_add_years (defined in Calculator)Calculator
f_adjoint (defined in Calculator)Calculator
f_airy (defined in Calculator)Calculator
f_area (defined in Calculator)Calculator
f_arg (defined in Calculator)Calculator
f_ascii (defined in Calculator)Calculator
f_asin (defined in Calculator)Calculator
f_asinh (defined in Calculator)Calculator
f_atan (defined in Calculator)Calculator
f_atan2 (defined in Calculator)Calculator
f_atanh (defined in Calculator)Calculator
f_base (defined in Calculator)Calculator
f_besselj (defined in Calculator)Calculator
f_bessely (defined in Calculator)Calculator
f_beta (defined in Calculator)Calculator
f_bin (defined in Calculator)Calculator
f_binomial (defined in Calculator)Calculator
f_bitcmp (defined in Calculator)Calculator
f_bitxor (defined in Calculator)Calculator
f_cbrt (defined in Calculator)Calculator
f_ceil (defined in Calculator)Calculator
f_char (defined in Calculator)Calculator
f_Chi (defined in Calculator)Calculator
f_Ci (defined in Calculator)Calculator
f_coeff (defined in Calculator)Calculator
f_cofactor (defined in Calculator)Calculator
f_column (defined in Calculator)Calculator
f_columns (defined in Calculator)Calculator
f_component (defined in Calculator)Calculator
f_concatenate (defined in Calculator)Calculator
f_cos (defined in Calculator)Calculator
f_cosh (defined in Calculator)Calculator
f_csum (defined in Calculator)Calculator
f_date (defined in Calculator)Calculator
f_datetime (defined in Calculator)Calculator
f_day (defined in Calculator)Calculator
f_days (defined in Calculator)Calculator
f_degree (defined in Calculator)Calculator
f_denominator (defined in Calculator)Calculator
f_determinant (defined in Calculator)Calculator
f_diff (defined in Calculator)Calculator
f_digamma (defined in Calculator)Calculator
f_dimension (defined in Calculator)Calculator
f_dirac (defined in Calculator)Calculator
f_dsolve (defined in Calculator)Calculator
f_Ei (defined in Calculator)Calculator
f_element (defined in Calculator)Calculator
f_elements (defined in Calculator)Calculator
f_entrywise (defined in Calculator)Calculator
f_erf (defined in Calculator)Calculator
f_erfc (defined in Calculator)Calculator
f_error (defined in Calculator)Calculator
f_even (defined in Calculator)Calculator
f_exp (defined in Calculator)Calculator
f_export (defined in Calculator)Calculator
f_factorial (defined in Calculator)Calculator
f_factorial2 (defined in Calculator)Calculator
f_floor (defined in Calculator)Calculator
f_for (defined in Calculator)Calculator
f_frac (defined in Calculator)Calculator
f_function (defined in Calculator)Calculator
f_gamma (defined in Calculator)Calculator
f_gcd (defined in Calculator)Calculator
f_genvector (defined in Calculator)Calculator
f_hadamard (defined in Calculator)Calculator
f_heaviside (defined in Calculator)Calculator
f_hex (defined in Calculator)Calculator
f_identity (defined in Calculator)Calculator
f_if (defined in Calculator)Calculator
f_igamma (defined in Calculator)Calculator
f_im (defined in Calculator)Calculator
f_int (defined in Calculator)Calculator
f_integrate (defined in Calculator)Calculator
f_interval (defined in Calculator)Calculator
f_inverse (defined in Calculator)Calculator
f_is_integer (defined in Calculator)Calculator
f_is_number (defined in Calculator)Calculator
f_is_rational (defined in Calculator)Calculator
f_is_real (defined in Calculator)Calculator
f_lambert_w (defined in Calculator)Calculator
f_lcm (defined in Calculator)Calculator
f_lcoeff (defined in Calculator)Calculator
f_ldegree (defined in Calculator)Calculator
f_length (defined in Calculator)Calculator
f_Li (defined in Calculator)Calculator
f_li (defined in Calculator)Calculator
f_limit (defined in Calculator)Calculator
f_limits (defined in Calculator)Calculator
f_ln (defined in Calculator)Calculator
f_load (defined in Calculator)Calculator
f_logn (defined in Calculator)Calculator
f_lunarphase (defined in Calculator)Calculator
f_magnitude (defined in Calculator)Calculator
f_matrix (defined in Calculator)Calculator
f_matrix_to_vector (defined in Calculator)Calculator
f_max (defined in Calculator)Calculator
f_merge_vectors (defined in Calculator)Calculator
f_message (defined in Calculator)Calculator
f_min (defined in Calculator)Calculator
f_mod (defined in Calculator)Calculator
f_mode (defined in Calculator)Calculator
f_month (defined in Calculator)Calculator
f_multifactorial (defined in Calculator)Calculator
f_multisolve (defined in Calculator)Calculator
f_nextlunarphase (defined in Calculator)Calculator
f_numerator (defined in Calculator)Calculator
f_oct (defined in Calculator)Calculator
f_odd (defined in Calculator)Calculator
f_percentile (defined in Calculator)Calculator
f_permanent (defined in Calculator)Calculator
f_plot (defined in Calculator)Calculator
f_polynomial_content (defined in Calculator)Calculator
f_polynomial_primpart (defined in Calculator)Calculator
f_polynomial_unit (defined in Calculator)Calculator
f_process (defined in Calculator)Calculator
f_process_matrix (defined in Calculator)Calculator
f_product (defined in Calculator)Calculator
f_radians_to_default_angle_unit (defined in Calculator)Calculator
f_rand (defined in Calculator)Calculator
f_rank (defined in Calculator)Calculator
f_re (defined in Calculator)Calculator
f_register (defined in Calculator)Calculator
f_rem (defined in Calculator)Calculator
f_replace (defined in Calculator)Calculator
f_represents_integer (defined in Calculator)Calculator
f_represents_number (defined in Calculator)Calculator
f_represents_rational (defined in Calculator)Calculator
f_represents_real (defined in Calculator)Calculator
f_roman (defined in Calculator)Calculator
f_root (defined in Calculator)Calculator
f_round (defined in Calculator)Calculator
f_row (defined in Calculator)Calculator
f_rows (defined in Calculator)Calculator
f_save (defined in Calculator)Calculator
f_select (defined in Calculator)Calculator
f_Shi (defined in Calculator)Calculator
f_shift (defined in Calculator)Calculator
f_Si (defined in Calculator)Calculator
f_signum (defined in Calculator)Calculator
f_sin (defined in Calculator)Calculator
f_sinc (defined in Calculator)Calculator
f_sinh (defined in Calculator)Calculator
f_solve (defined in Calculator)Calculator
f_sort (defined in Calculator)Calculator
f_sq (defined in Calculator)Calculator
f_sqrt (defined in Calculator)Calculator
f_stack (defined in Calculator)Calculator
f_stamptodate (defined in Calculator)Calculator
f_stripunits (defined in Calculator)Calculator
f_sum (defined in Calculator)Calculator
f_tan (defined in Calculator)Calculator
f_tanh (defined in Calculator)Calculator
f_tcoeff (defined in Calculator)Calculator
f_time (defined in Calculator)Calculator
f_timestamp (defined in Calculator)Calculator
f_timevalue (defined in Calculator)Calculator
f_title (defined in Calculator)Calculator
f_total (defined in Calculator)Calculator
f_transpose (defined in Calculator)Calculator
f_trunc (defined in Calculator)Calculator
f_vector (defined in Calculator)Calculator
f_warning (defined in Calculator)Calculator
f_week (defined in Calculator)Calculator
f_weekday (defined in Calculator)Calculator
f_xor (defined in Calculator)Calculator
f_year (defined in Calculator)Calculator
f_yearday (defined in Calculator)Calculator
f_yearfrac (defined in Calculator)Calculator
f_zeta (defined in Calculator)Calculator
fetchExchangeRates(int seconds, string wget_args)Calculator
fetchExchangeRates(int seconds=15, int n=-1)Calculator
findMatchingUnit(const MathStructure &mstruct)Calculator
functionNameChanged(MathFunction *f, bool new_item=false) (defined in Calculator)Calculator
functionNameIsValid(const string &name_) (defined in Calculator)Calculator
functionNameIsValid(const char *name_) (defined in Calculator)Calculator
functionNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
functionNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
functionNameTaken(string name, MathFunction *object=NULL) (defined in Calculator)Calculator
functions (defined in Calculator)Calculator
getActiveExpressionItem(string name, ExpressionItem *item=NULL) (defined in Calculator)Calculator
getActiveExpressionItem(ExpressionItem *item) (defined in Calculator)Calculator
getActiveFunction(string name_) (defined in Calculator)Calculator
getActiveUnit(string name_) (defined in Calculator)Calculator
getActiveVariable(string name_) (defined in Calculator)Calculator
getBestBinaryPrefix(int exp2, int exp=1) constCalculator
getBestBinaryPrefix(const Number &exp2, const Number &exp) constCalculator
getBestDecimalPrefix(int exp10, int exp=1, bool all_prefixes=true) constCalculator
getBestDecimalPrefix(const Number &exp10, const Number &exp, bool all_prefixes=true) constCalculator
getBestUnit(Unit *u, bool allow_only_div=false, bool convert_to_local_currency=true) (defined in Calculator)Calculator
getComma() constCalculator
getCompositeUnit(string internal_name_) (defined in Calculator)Calculator
getDataSet(size_t index) (defined in Calculator)Calculator
getDataSet(string name) (defined in Calculator)Calculator
getDecimalPoint() constCalculator
getDegUnit()Calculator
getExactBinaryPrefix(int exp2, int exp=1) constCalculator
getExactDecimalPrefix(int exp10, int exp=1) constCalculator
getExactPrefix(const Number &o, int exp=1) constCalculator
getExchangeRatesFileName(int index=1)Calculator
getExchangeRatesTime(int index=-1)Calculator
getExchangeRatesUrl(int index=1)Calculator
getExpressionItem(string name, ExpressionItem *item=NULL) (defined in Calculator)Calculator
getFunction(string name_) (defined in Calculator)Calculator
getFunction(size_t index) constCalculator
getGraUnit()Calculator
getId(size_t id)Calculator
getInactiveExpressionItem(string name, ExpressionItem *item=NULL) (defined in Calculator)Calculator
getLocalCurrency() (defined in Calculator)Calculator
getName(string name="", ExpressionItem *object=NULL, bool force=false, bool always_append=false) (defined in Calculator)Calculator
getNearestBinaryPrefix(int exp2, int exp=1) constCalculator
getNearestDecimalPrefix(int exp10, int exp=1) constCalculator
getPrecision() constCalculator
getPrefix(size_t index) constCalculator
getPrefix(string name_) constCalculator
getRadUnit()Calculator
getRPNRegister(size_t index=1) const (defined in Calculator)Calculator
getUnit(string name_) (defined in Calculator)Calculator
getUnit(size_t index) constCalculator
getVariable(string name_) (defined in Calculator)Calculator
getVariable(size_t index) constCalculator
gnuplot_cmdline (defined in Calculator)Calculatorprotected
gnuplot_pipe (defined in Calculator)Calculatorprotected
gnuplotOpen() (defined in Calculator)Calculator
hasFunction(MathFunction *f)Calculator
hasGnomeVFS()Calculator
hasGVFS()Calculator
hasToExpression(const string &str, bool allow_empty_from=false) const (defined in Calculator)Calculator
hasUnit(Unit *u)Calculator
hasVariable(Variable *v)Calculator
i_aborted (defined in Calculator)Calculatorprotected
i_precision (defined in Calculator)Calculatorprotected
i_start_interval (defined in Calculator)Calculatorprotected
i_stop_interval (defined in Calculator)Calculatorprotected
i_timeout (defined in Calculator)Calculatorprotected
ianglemode (defined in Calculator)Calculatorprotected
ILLEGAL_IN_NAMES (defined in Calculator)Calculatorprotected
ILLEGAL_IN_NAMES_MINUS_SPACE_STR (defined in Calculator)Calculatorprotected
ILLEGAL_IN_UNITNAMES (defined in Calculator)Calculatorprotected
importCSV(MathStructure &mstruct, const char *file_name, int first_row=1, string delimiter=",", vector< string > *headers=NULL) (defined in Calculator)Calculator
importCSV(const char *file_name, int first_row=1, bool headers=true, string delimiter=",", bool to_matrix=false, string name="", string title="", string category="") (defined in Calculator)Calculator
invokeGnuplot(string commands, string commandline_extra="", bool persistent=false) (defined in Calculator)Calculator
isControlled(void) const (defined in Calculator)Calculator
loadDefinitions(const char *file_name, bool is_user_defs=true)Calculator
loadExchangeRates()Calculator
loadGlobalCurrencies()Calculator
loadGlobalDataSets()Calculator
loadGlobalDefinitions()Calculator
loadGlobalDefinitions(string filename)Calculator
loadGlobalFunctions()Calculator
loadGlobalPrefixes()Calculator
loadGlobalUnits()Calculator
loadGlobalVariables()Calculator
loadLocalDefinitions()Calculator
local_digit_group_format (defined in Calculator)Calculator
local_digit_group_separator (defined in Calculator)Calculator
local_to (defined in Calculator)Calculatorprotected
localizeExpression(string str, const ParseOptions &po=default_parse_options) constCalculator
localToString(bool include_spaces=true) constCalculator
message(MessageType mtype, int message_category, const char *TEMPLATE,...)Calculator
message(MessageType mtype, const char *TEMPLATE,...) (defined in Calculator)Calculator
message(MessageType mtype, int message_category, const char *TEMPLATE, va_list ap) (defined in Calculator)Calculator
message()Calculator
message_printoptions (defined in Calculator)Calculator
messagePrintOptions() const (defined in Calculator)Calculator
messages (defined in Calculator)Calculatorprotected
minus_str (defined in Calculator)Calculatorprotected
minus_str_len (defined in Calculator)Calculatorprotected
moveRPNRegister(size_t old_index, size_t new_index) (defined in Calculator)Calculator
moveRPNRegisterDown(size_t index) (defined in Calculator)Calculator
moveRPNRegisterUp(size_t index) (defined in Calculator)Calculator
NAME_NUMBER_PRE_S (defined in Calculator)Calculatorprotected
NAME_NUMBER_PRE_STR (defined in Calculator)Calculatorprotected
nameChanged(ExpressionItem *item, bool new_item=false) (defined in Calculator)Calculator
nameTaken(string name, ExpressionItem *object=NULL)Calculator
nextMessage()Calculator
or_str (defined in Calculator)Calculatorprotected
OR_str (defined in Calculator)Calculatorprotected
OR_str_len (defined in Calculator)Calculatorprotected
or_str_len (defined in Calculator)Calculatorprotected
parse(string str, const ParseOptions &po=default_parse_options)Calculator
parse(MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po, MathOperation s, bool append=true) (defined in Calculator)Calculator
parseAdd(string &str, MathStructure *mstruct, const ParseOptions &po) (defined in Calculator)Calculator
parseAddId(MathFunction *f, const string &str, const ParseOptions &po, bool persistent=false)Calculator
parseAddIdAppend(MathFunction *f, const MathStructure &append_mstruct, const string &str, const ParseOptions &po, bool persistent=false) (defined in Calculator)Calculator
parseAddVectorId(const string &str, const ParseOptions &po, bool persistent=false) (defined in Calculator)Calculator
parseNumber(MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
parseOperators(MathStructure *mstruct, string str, const ParseOptions &po=default_parse_options) (defined in Calculator)Calculator
parseSigns(string &str, bool convert_to_internal_representation=false) const (defined in Calculator)Calculator
per_str (defined in Calculator)Calculatorprotected
per_str_len (defined in Calculator)Calculatorprotected
place_currency_code_before (defined in Calculator)Calculator
place_currency_code_before_negative (defined in Calculator)Calculator
place_currency_sign_before (defined in Calculator)Calculator
place_currency_sign_before_negative (defined in Calculator)Calculator
plotVectors(PlotParameters *param, const vector< MathStructure > &y_vectors, const vector< MathStructure > &x_vectors, vector< PlotDataParameters *> &pdps, bool persistent=false, int msecs=5000) (defined in Calculator)Calculator
plus_str (defined in Calculator)Calculatorprotected
plus_str_len (defined in Calculator)Calculatorprotected
prefixes (defined in Calculator)Calculator
prefixNameChanged(Prefix *p, bool new_item=false)Calculator
print(const MathStructure &mstruct, int milliseconds=100000, const PrintOptions &op=default_print_options)Calculator
printingAborted(void)Calculator
printingAbortedMessage(void) constCalculator
printingControlled(void) constCalculator
printMathStructureTimeOut(const MathStructure &mstruct, int milliseconds=100000, const PrintOptions &op=default_print_options)Calculator
priv (defined in Calculator)Calculatorprotected
real_signs (defined in Calculator)Calculatorprotected
reset()Calculator
resetExchangeRatesUsed() (defined in Calculator)Calculator
resetFunctions()Calculator
resetUnits()Calculator
resetVariables()Calculator
restoreState()Calculator
rpn_stack (defined in Calculator)Calculatorprotected
RPNStackEnter(MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options)Calculator
RPNStackEnter(string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)Calculator
RPNStackEnter(MathStructure *mstruct, bool eval=false, const EvaluationOptions &eo=default_evaluation_options)Calculator
RPNStackEnter(string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true)Calculator
RPNStackSize() const (defined in Calculator)Calculator
save_printoptions (defined in Calculator)Calculator
saved_locale (defined in Calculator)Calculatorprotected
saveDataObjects() (defined in Calculator)Calculator
saveDataSets(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
saveDefinitions()Calculator
saveFunctionCalled() (defined in Calculator)Calculator
saveFunctions(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
savePrefixes(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
saveState()Calculator
saveUnits(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
saveVariables(const char *file_name, bool save_global=false) (defined in Calculator)Calculator
separateToExpression(string &str, string &to_str, const EvaluationOptions &eo, bool keep_modifiers=false, bool allow_empty_from=false) constCalculator
setDefaultAssumptions(Assumptions *ass)Calculator
setExchangeRatesUsed(int index)Calculator
setExchangeRatesWarningEnabled(bool enable)Calculator
setLocale()Calculator
setMessagePrintOptions(const PrintOptions &po) (defined in Calculator)Calculator
setPrecision(int precision=DEFAULT_PRECISION)Calculator
setRPNRegister(size_t index, MathStructure *mstruct, int msecs, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
setRPNRegister(size_t index, string str, int msecs, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true) (defined in Calculator)Calculator
setRPNRegister(size_t index, MathStructure *mstruct, bool eval=false, const EvaluationOptions &eo=default_evaluation_options) (defined in Calculator)Calculator
setRPNRegister(size_t index, string str, const EvaluationOptions &eo=default_evaluation_options, MathStructure *parsed_struct=NULL, MathStructure *to_struct=NULL, bool make_to_division=true) (defined in Calculator)Calculator
setVariableUnitsEnabled(bool enable_variable_units=true) (defined in Calculator)Calculator
showArgumentErrors() const (defined in Calculator)Calculator
signs (defined in Calculator)Calculatorprotected
startControl(int milliseconds=0)Calculator
startPrintControl(int milliseconds=0)Calculator
stillHasFunction(MathFunction *f)Calculator
stillHasUnit(Unit *u)Calculator
stillHasVariable(Variable *v)Calculator
stopControl(void)Calculator
stopped_errors_count (defined in Calculator)Calculatorprotected
stopped_messages (defined in Calculator)Calculatorprotected
stopped_messages_count (defined in Calculator)Calculatorprotected
stopped_warnings_count (defined in Calculator)Calculatorprotected
stopPrintControl(void)Calculator
t_end (defined in Calculator)Calculatorprotected
temporaryCategory(void) const (defined in Calculator)Calculator
terminateThreads()Calculator
testCondition(string expression) (defined in Calculator)Calculator
timedOutString(void) const (defined in Calculator)Calculator
times_str (defined in Calculator)Calculatorprotected
times_str_len (defined in Calculator)Calculatorprotected
tmp_evaluationoptions (defined in Calculator)Calculator
tmp_maketodivision (defined in Calculator)Calculator
tmp_parsedstruct (defined in Calculator)Calculator
tmp_proc_command (defined in Calculator)Calculator
tmp_proc_registers (defined in Calculator)Calculator
tmp_rpn_mstruct (defined in Calculator)Calculator
tmp_rpnindex (defined in Calculator)Calculator
tmp_tostruct (defined in Calculator)Calculator
u_btc (defined in Calculator)Calculator
u_day (defined in Calculator)Calculator
u_deg (defined in Calculator)Calculator
u_euro (defined in Calculator)Calculator
u_gra (defined in Calculator)Calculator
u_hour (defined in Calculator)Calculator
u_minute (defined in Calculator)Calculator
u_month (defined in Calculator)Calculator
u_rad (defined in Calculator)Calculator
u_second (defined in Calculator)Calculator
u_year (defined in Calculator)Calculator
ufv (defined in Calculator)Calculatorprotected
ufv_i (defined in Calculator)Calculatorprotected
ufvl (defined in Calculator)Calculatorprotected
ufvl_i (defined in Calculator)Calculatorprotected
ufvl_t (defined in Calculator)Calculatorprotected
unitIsUsedByOtherUnits(const Unit *u) const (defined in Calculator)Calculator
unitNameChanged(Unit *u, bool new_item=false) (defined in Calculator)Calculator
unitNameIsValid(const string &name_) (defined in Calculator)Calculator
unitNameIsValid(const char *name_) (defined in Calculator)Calculator
unitNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
unitNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
unitNameTaken(string name, Unit *object=NULL) (defined in Calculator)Calculator
units (defined in Calculator)Calculator
unlocalizeExpression(string str, const ParseOptions &po=default_parse_options) constCalculator
unsetLocale()Calculator
useDecimalComma() (defined in Calculator)Calculator
useDecimalPoint(bool comma_as_separator=false)Calculator
useIntervalArithmetic(bool use_interval_arithmetic=true)Calculator
usesIntervalArithmetic() constCalculator
utf8_pos_is_valid_in_name(char *pos) (defined in Calculator)Calculator
v_C (defined in Calculator)Calculator
v_catalan (defined in Calculator)Calculator
v_e (defined in Calculator)Calculator
v_euler (defined in Calculator)Calculator
v_i (defined in Calculator)Calculator
v_minf (defined in Calculator)Calculator
v_n (defined in Calculator)Calculator
v_now (defined in Calculator)Calculator
v_percent (defined in Calculator)Calculator
v_permille (defined in Calculator)Calculator
v_permyriad (defined in Calculator)Calculator
v_pi (defined in Calculator)Calculator
v_pinf (defined in Calculator)Calculator
v_precision (defined in Calculator)Calculator
v_today (defined in Calculator)Calculator
v_tomorrow (defined in Calculator)Calculator
v_undef (defined in Calculator)Calculator
v_x (defined in Calculator)Calculator
v_y (defined in Calculator)Calculator
v_yesterday (defined in Calculator)Calculator
v_z (defined in Calculator)Calculator
variableNameChanged(Variable *v, bool new_item=false) (defined in Calculator)Calculator
variableNameIsValid(const string &name_)Calculator
variableNameIsValid(const char *name_)Calculator
variableNameIsValid(const char *name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
variableNameIsValid(const string &name_, int version_numbers[3], bool is_user_defs) (defined in Calculator)Calculator
variableNameTaken(string name, Variable *object=NULL) (defined in Calculator)Calculator
variables (defined in Calculator)Calculator
variableUnitsEnabled() const (defined in Calculator)Calculator
vbuffer (defined in Calculator)Calculatorprotected
XOR_str (defined in Calculator)Calculatorprotected
XOR_str_len (defined in Calculator)Calculatorprotected
~Calculator() (defined in Calculator)Calculatorvirtual
libqalculate-2.8.2/docs/reference/html/functions_func_c.html0000644000175000017500000001643713401033110021150 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- c -

libqalculate-2.8.2/docs/reference/html/classNowVariable.html0000644000175000017500000017015613401033110021061 00000000000000 libqalculate-2.8.2: NowVariable Class Reference
libqalculate-2.8.2
NowVariable Class Reference
Inheritance diagram for NowVariable:
DynamicVariable KnownVariable Variable ExpressionItem

Public Member Functions

 NowVariable (const NowVariable *variable)
 
ExpressionItemcopy () const
 
virtual bool representsPositive (bool=false)
 
virtual bool representsNonNegative (bool=false)
 
virtual bool representsNonInteger (bool=false)
 
virtual bool representsNumber (bool b=false)
 
virtual bool representsReal (bool b=false)
 
virtual bool representsNonZero (bool b=false)
 
- Public Member Functions inherited from DynamicVariable
 DynamicVariable (string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true)
 
 DynamicVariable (const DynamicVariable *variable)
 
void set (const ExpressionItem *item)
 
const MathStructureget ()
 
void set (const MathStructure &o)
 
void set (string expression_)
 
int calculatedPrecision () const
 
bool calculatedWithInterval () const
 
virtual bool representsNegative (bool=false)
 
virtual bool representsNonPositive (bool=false)
 
virtual bool representsInteger (bool=false)
 
virtual bool representsRational (bool=false)
 
virtual bool representsComplex (bool=false)
 
virtual bool representsEven (bool=false)
 
virtual bool representsOdd (bool=false)
 
virtual bool representsUndefined (bool=false, bool=false, bool=false)
 
virtual bool representsBoolean ()
 
virtual bool representsNonMatrix ()
 
virtual bool representsScalar ()
 
- Public Member Functions inherited from KnownVariable
 KnownVariable (string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable (string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 KnownVariable ()
 
 KnownVariable (const KnownVariable *variable)
 
bool isKnown () const
 
virtual bool isExpression () const
 
virtual string expression () const
 
virtual string uncertainty () const
 
virtual string unit () const
 
int subtype () const
 
virtual void setUncertainty (string standard_uncertainty)
 
virtual void setUnit (string unit_expression)
 
virtual bool representsFraction (bool=false)
 
virtual bool representsNonComplex (bool=false)
 
- Public Member Functions inherited from Variable
 Variable (string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Variable (const Variable *variable)
 
virtual int type () const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Additional Inherited Members

- Protected Attributes inherited from DynamicVariable
bool always_recalculate
 
- Protected Attributes inherited from KnownVariable
MathStructuremstruct
 
bool b_expression
 
int calculated_precision
 
bool calculated_with_interval
 
bool calculated_with_units
 
string sexpression
 
string suncertainty
 
string sunit
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Member Function Documentation

◆ representsPositive()

virtual bool NowVariable::representsPositive ( bool  = false)
inlinevirtual

Returns if the variable represents a positive value.

Reimplemented from DynamicVariable.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/dir_e1cc17c9b46d352fb89a08ddc5bd498d.html0000644000175000017500000001230013401033110023254 00000000000000 libqalculate-2.8.2: libqalculate Directory Reference
libqalculate-2.8.2
libqalculate Directory Reference

Files

file  Calculator.h
 
file  DataSet.h
 
file  ExpressionItem.h
 
file  Function.h
 
file  includes.h
 
file  MathStructure.h
 
file  Number.h
 
file  Prefix.h
 
file  Unit.h
 
file  util.h
 
file  Variable.h
 
libqalculate-2.8.2/docs/reference/html/classUnknownVariable.png0000644000175000017500000000131113401033110021557 00000000000000‰PNG  IHDRoˆÞZEhPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2XIDATxíí’´* ›‡*ïÿ’_#èÎǦ˜S{²C«@ ãþ&çœ'B–¤i„O’üø¶/•?Iz!nmx2vðIÒÇ|ì+·ôøµ§ÇÖë ´ka{j·YI²ån5´ ÞfßIêŠ ìÛE’)·ïïØÀ™:¾]Mëà»:ßÛ÷7úìBZ÷¥¯F¾å;­´acú½(é(ç€×óet&©+¿;ÏzC~¶L¼ËÏSŠ™Ó~â“dÊï¾FIêùû$É—ðI’_ðåœó<>a˜Èdß²ÌNö­º©ÂÙ¾?ŸŸáp$|~„Àðø>?ÂàGøüÀ9ç<²$M#|’äÇϗ̵k4O]¿$]ò¡o0ûùÊTeº”ê­üöêú¼lý’t˾cÚrߪG­­K’îxgwóµ›—o;¾r^ç}n{Û}[¿$Ýò†¯;×áöRʼôý)zásÇÛZç6óÖª~J’á“$?Â'I~|Á—sÎóø„`"“}Ë2W8Ù·ê¦ gûþ|~†À‘ðø>?ÂàGøü€áð#|¤”ÒDHÓ€_ó•Ûá~e5¦‹¦8÷»ûóßÚðx,O{åñÖˆJknãöz®V™öþK_3•¸Ý¼7´y0`ÃM­­ër-ø¨˜ Ûñfž¾ÞrñµÑå•ݧ92Y;Ð[Ÿ]°i+í½¯ÛïÕ*ÈH¦\ßq>ÇõÂ÷ãûëΤK‘s>ö¾Òo×Uª?ç'ÀÂàGøüø‚/¥”æñ4Ù.s¼‘ÏIEND®B`‚libqalculate-2.8.2/docs/reference/html/classPrefix-members.html0000644000175000017500000001451013401033110021524 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
Prefix Member List

This is the complete list of members for Prefix, including all inherited members.

l_name (defined in Prefix)Prefixprotected
longName(bool return_short_if_no_long=true, bool use_unicode=false) constPrefix
name(bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constPrefix
Prefix(string long_name, string short_name="", string unicode_name="")Prefix
s_name (defined in Prefix)Prefixprotected
setLongName(string long_name)Prefix
setShortName(string short_name)Prefix
setUnicodeName(string unicode_name)Prefix
shortName(bool return_long_if_no_short=true, bool use_unicode=false) constPrefix
type() const =0Prefixpure virtual
u_name (defined in Prefix)Prefixprotected
unicodeName(bool return_short_if_no_uni=true) constPrefix
value(const Number &nexp) const =0Prefixpure virtual
value(int iexp) const =0Prefixpure virtual
value() const =0Prefixpure virtual
~Prefix() (defined in Prefix)Prefixvirtual
libqalculate-2.8.2/docs/reference/html/functions_func_l.html0000644000175000017500000000676213401033110021161 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- l -

libqalculate-2.8.2/docs/reference/html/classDynamicVariable.png0000644000175000017500000000500213401033110021505 00000000000000‰PNG  IHDRvøV¯[JPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2 ‘IDATxíÝÛRò̆ÑÁL÷ÉKv!;@ÐoZÿÊ« !Ò±yèœÂ® Ã0ôƒ€ªªº%;سd’4JvÐ(ÙA@£uv‡óOUÕ7¬öûzâõ{“ìÙFvUUKvðÄÃìÎw‡Óïøè´^ÖÃñïÙõÑx7îyySUÕ\²ƒ={¼Ú]Š97tìÚÙ¡jq›ì¸|ît«ªšIv°gÙfËÙÜ%£ñïäÙUv.ºÉöìñj·‘Ý´ÇñåÍì.{&;˜{y‘]¤7Ýg¹²Õ¡î·ùU5¹%;س‡Ù]V´óš¶¾Èª¦·\d!à{6²»\!oÙÝ.©×—ÆËëä<½Ÿ¯°“ç’¦·uvU5¹­›©ªú¡d{–ì  Q²ƒ€F¯²«ªúuÉö,ÙA@£d’4JvÐh†¡¼ã=’ô9Ó´IvÐ竺t]’´JtÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’4JvÐ(ÙAÀ»†aúAÀN UUÝ’ìY²ƒ€FÉ%;h”ì  Ñw²;Lþ.žœÇcºƒ€6Éú|U—î  K²ƒ€V‰%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;x×0 C?Ø©¡ªª[²ƒ=KvÐ(ÙA@£d’4ZewÿTU=rÙa±Û}óúèÑa’ìÙfv/«ÛÎn`²ƒ€¹­ì® Þárº»µøõäíéqa¼mŸ~o›×½îOTÕä–ì`Ï6²»®d—Ún±fNLwŸlm.žÉölÝuuº4ÞÍ3šæ´Ø^¾+ÙA|ó"û4»Éªx¿žŽ›“w]_¯ªû-ÙÁžme75Þ]~WÙ=Ú}šiUÕL²ƒ=ÛÌnPªf¦7²[¯ŽÉâYv×µìzÕÜÈëÓéõižçͯßÅû«ê~Kv°g«ìªªþµd{–ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ Ã0ôƒ€€w!  G²ƒ€>Çcºƒ€6Éú|U—î  K²ƒ€V‰%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;h”ì  Q²ƒ€FÉ%;x×áp8ôƒ€ú“’ìY²ƒ€FÉ%;h”ì  Ñ¤€Ãéž»ïry´xËòå­Æ’ìÙ4»w‹ØÌnuèdûm™ÝéïéÁùî²ø]ÖÀ¯­ñ•ëSãæ}û¼×ý‹ý“Äóì.ï[§Ûô)æ–ïXìŸì ^¬vÓ åém|ÇòñìÉfd7_ÃfëÖ$»ë5õ¶Ëú·ý¯¯';ˆíì®5ͽÓÛ,»ÅÅvë¸ß’ìÙ2»ëŸ×ÙÝ#å`æv·±²ƒ˜fw¿Î×°¯gÏ!NšíxÛeõŽû•wvMv°kÛüã.’ìÙfÿ:‹d{¶UÀ?¯"ÙÁžýIÉö,ÙA@£d’4JvÐèp8úA@À;ŽÐ#ÙA@Ÿã1ÝA@›d}¾ªKwÐ%ÙA@«D’4JvÐ(ÙA@£d’4JvÐ(ÙA@£d’´;Ç8Ç‚~ýmÏøðw’´ËøÐ.Ó'ÙA»Œ'ÙA»Œí2íðw’´Ëøðw’´ËøÐ.Ó'ÙA»Œ'ÙA»Œí2íðw’´Ëøðw’´ËøÐ.Óç¿<þ0 ÇŽÃ0 ŸÉø;¨ªê6ý·«ªºeü¿?Ó^UÕ,ãgÚ«ªšeüL{UU³ŒŸi¯ªj–ñ {˜ü­ªûmó…ûæõÑÆ_ýÛ‡ÓOUÕÚøôêõÏæÙ´ŸÏc~&¿5ì“ñ7F­ªzí£SÙóŒ~þ?<ÇÙ÷ûnv«ñ>Éî﫪šùðl^|Û_ÎþO'asüšûôTþyv/NàÉjwÚñìTà¸qxyá²ç¸ßéñìUUkO³;îvðÉÑf‡½ŽóáÙ|+»ñfœûpžd7a=Àdf~øylŒ¿:Ì8Ôô~i.^g7NÂòßœöpú¾5žMUÕÂóì&Gï–‡]Ìý›góì&c¯N¨UsïMÂãìîG¸|ÄóoÝo}O²Û˜òÙae.žd·ø˜W#-Ïu#”÷²;ý,:?îb€œÍ{Ù­øÓIxÝæŒoeñÑ©lí—ÿöø~<ϲ»¯ô³óv~çNf‘Ï¿ cFUU W»ûŠ7mq‘]]Z>9›²xû@~2 ¿™Ý'§òü"?®¬Ó·múÓ¹x#»Û%{ñµX_§SRUµáuv³ç¦_½Ù½w6ïgw?ölª?œ„ßÈî'ŸÇ³ìÖ¼å:öó¹xšÝôB¾ŽáÁ([—òªª™oe·±Ônd÷ÑÙ¼—Ý|~c~žÝÏ>Ùª¦·Ùae.žgw[+¬A_/̯B—oàô‰ªª /³GmvØevïÍw²»ŸÂä€óoÿÇ“ðü"7_ÙïÓ?Ÿ™Ÿ|OÆŸüÛ×f¦'ðKsñ0»ªªçÅÇ^UõOý`ü‡_¥ªªïúÿÿ¿2ÉîÍñ¥ºÿ“ì>Ÿ‹d÷Þø¿SÝÿGv?˜‹d—ñ«ªš%»Œ_UÕ,ÙeüªªfÉ.ãWU5Kv¿ªªÙWvÃ0 í&ÿö0 C»Œÿ·ãÿßAÆôÝxÿ”IEND®B`‚libqalculate-2.8.2/docs/reference/html/sync_on.png0000644000175000017500000000151513401033110017102 00000000000000‰PNG  IHDRàw=øIDATxíÝ_HTYÀñï8ã¤ó§i§4-g6ÆËÕ&kQ)¨Ô!Š0ÒURKÚ…„ê¡/»PEÁ>ìK-+KÁ²Ñ.Y”¾dEPaA‰ø°¥¶›ZSÓïÜ;3wºŠ–¯—߯gfîïœsçœWKÇñ.€ÉøD­¨a‘'¬âq_ôˆk¢ÀŒ ÀDŽøQ´ÄïC¨¶åñÏÿgÅ ñ 0„Y‚:qZ¦Á)~õâ€èLý0HVñ× žz-¿‰C“%¨g¦˜6€é8%Úõ¬ëwêÙUÏ¿˜ª³Ä }? ?€·3ÀÀž©Š À”K• @hà a±ðaÇæUe‹ sù~ë2²ì“&Ú&B*AÄljæºììi*˨,Ëçí»÷oÆ£T”,d[˜¼3-*ÁÀ…>å‡Ë çLÉŸçfk˜Ò éw#*AEjKUy>ûšËÉõ&{µ¢8—m5Ki¬ jjƒD*¿NŽÖigwÃ7Dª’mz骹úKÛ¾±ˆ¶M!æ¤ÍkÐ?šoý¬_åÓlXí#Ò~–¸¬ê×ÒÑXŠÓ‘ùRÙ*Eû‚ՂדðEÜ;6«e"Q(²Ù=–¿Ezæ5Kؼָ_ 1òzBªJë ±XŒì96åªjL^7{ùãJÑ÷1½i@%8'7M©_\Qœ#ÓUŒËñýÿyõ Wo Éx8¼s¥v¯ªì|×SnÜ q_m Ýé î>bèÕí[JX,½4[Tú{R£ë¼ôˆ¾þa€tÝjjzzÅ'ÅìȶiIžŽòwÏs ¡€—ÕKøõâC^ŽŒ˜Y­¨µÉ%6¨´êˆº]vÛðhâ½iWv–hôëê°Ò¨¾'æÌ‚·ñ|[ßìúÅ^€YrD=<ýDû]äÇ÷s€Ïõ‹8™ºCì? À ¨—t4õᩎ¡Jã‡W‹É± îr¼cjMɘìx| šE©øNÔ‰œøA¢þ«–€Z¼ñ‡jó î#™§¢¢4gIEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_func_t.html0000644000175000017500000001163013401033110021157 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
libqalculate-2.8.2/docs/reference/html/Number-gmp_8h.html0000644000175000017500000001217113263106346020244 00000000000000 libqalculate-2.4.0: libqalculate/Number-gmp.h File Reference
libqalculate-2.4.0
Number-gmp.h File Reference
#include <libqalculate/includes.h>
#include <gmp.h>
#include <mpfr.h>
#include <cln/cln.h>

Classes

class  Number
 A number. More...
 

Macros

#define EQUALS_PRECISION_DEFAULT   -1
 
#define EQUALS_PRECISION_LOWEST   -2
 
#define EQUALS_PRECISION_HIGHEST   -3
 

Enumerations

enum  NumberType {
  NUMBER_TYPE_RATIONAL, NUMBER_TYPE_FLOAT, NUMBER_TYPE_INFINITY, NUMBER_TYPE_POSITIVE_INFINITY,
  NUMBER_TYPE_NEGATIVE_INFINITY, NUMBER_TYPE_RATIONAL, NUMBER_TYPE_FLOAT, NUMBER_TYPE_PLUS_INFINITY,
  NUMBER_TYPE_MINUS_INFINITY
}
 
libqalculate-2.8.2/docs/reference/html/classDataObject.html0000644000175000017500000005642413401033110020651 00000000000000 libqalculate-2.8.2: DataObject Class Reference
libqalculate-2.8.2

A a data set object. More...

#include <DataSet.h>

Public Member Functions

 DataObject (DataSet *parent_set)
 
void eraseProperty (DataProperty *property)
 
void setProperty (DataProperty *property, string s_value, int is_approximate=-1)
 
void setNonlocalizedKeyProperty (DataProperty *property, string s_value)
 
const MathStructuregetPropertyStruct (DataProperty *property)
 
const string & getProperty (DataProperty *property, int *is_approximate=NULL)
 
const string & getNonlocalizedKeyProperty (DataProperty *property)
 
string getPropertyInputString (DataProperty *property)
 
string getPropertyDisplayString (DataProperty *property)
 
bool isUserModified () const
 
void setUserModified (bool user_modified=true)
 
DataSetparentSet () const
 

Protected Attributes

vector< DataProperty * > properties
 
vector< string > s_properties
 
vector< string > s_nonlocalized_properties
 
vector< MathStructure * > m_properties
 
vector< int > a_properties
 
DataSetparent
 
bool b_uchanged
 

Detailed Description

A a data set object.

Data objects consist of property-value pairs.

Constructor & Destructor Documentation

◆ DataObject()

DataObject::DataObject ( DataSet parent_set)

Create a data object.

Parameters
parent_setData set that the object will belong to.

Member Function Documentation

◆ eraseProperty()

void DataObject::eraseProperty ( DataProperty property)

Unset (erase value) a property.

Parameters
propertyProperty to unset.

◆ getNonlocalizedKeyProperty()

const string& DataObject::getNonlocalizedKeyProperty ( DataProperty property)

Returns unparsed untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key.

Parameters
propertyProperty to read.
Returns
Unparsed untranslated value or empty string if property value is not set.

◆ getProperty()

const string& DataObject::getProperty ( DataProperty property,
int *  is_approximate = NULL 
)

Returns unparsed value for a property.

Parameters
propertyProperty to read.
[out]is_approximateIf the value is approximate. Is set to 1 for approximate, 0 for exact, -1 for property default, if not NULL.
Returns
Unparsed value or empty string if property value is not set.

◆ getPropertyDisplayString()

string DataObject::getPropertyDisplayString ( DataProperty property)

Returns value for a property in a format suitable for display with unit appended.

Parameters
propertyProperty to read.
Returns
Value in display format or empty string if property value is not set.

◆ getPropertyInputString()

string DataObject::getPropertyInputString ( DataProperty property)

Returns value for a property in a format suitable for use in expressions with unit appended.

Parameters
propertyProperty to read.
Returns
Value in input format or empty string if property value is not set.

◆ getPropertyStruct()

const MathStructure* DataObject::getPropertyStruct ( DataProperty property)

Returns parsed value for a property. Parses the text string value if not parsed before

Parameters
propertyProperty to read.
Returns
Parsed value or NULL if property value is not set.

◆ isUserModified()

bool DataObject::isUserModified ( ) const

If the object has been modified by the end user (if setUserModified() has been called).

Returns
true if the object has been modified by the user.

◆ parentSet()

DataSet* DataObject::parentSet ( ) const

Returns the data set that the object belongs to.

Returns
Parent data set.

◆ setNonlocalizedKeyProperty()

void DataObject::setNonlocalizedKeyProperty ( DataProperty property,
string  s_value 
)

Set an untranslated value for a key property. Used when a text value is translated, but the original value still is needed as a reference key.

Parameters
propertyProperty to set (must belong to parent data set).
s_valeValue for the property.

◆ setProperty()

void DataObject::setProperty ( DataProperty property,
string  s_value,
int  is_approximate = -1 
)

Set value for a property.

Parameters
propertyProperty to set (must belong to parent data set).
s_valeValue for the property.
is_approximateIf the value is approximate. 1 for approximate, 0 for exact, -1 for property default.

◆ setUserModified()

void DataObject::setUserModified ( bool  user_modified = true)

Specify if the object has been modified by the end user.

Parameters
user_modifiedtrue if the object has been modified by the user.

The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/structPrintOptions.html0000644000175000017500000011521513401033110021532 00000000000000 libqalculate-2.8.2: PrintOptions Struct Reference
libqalculate-2.8.2

Options for formatting and display of mathematical structures/results. More...

#include <includes.h>

Public Member Functions

const string & comma () const
 Returns the comma sign used (default sign or comma_sign)
 
const string & decimalpoint () const
 Returns the decimal sign used (default sign or decimalpoint_sign)
 

Public Attributes

int min_exp
 
int base
 Number base for displaying numbers. Default: 10.
 
BaseDisplay base_display
 How prefixes for numbers in non-decimal bases will be displayed.
 
bool lower_case_numbers
 Use lower case for non-numeric characters for bases > 10. Default: false.
 
bool lower_case_e
 Use lower case e for base-10 exponent (ex. 1.2e8 instead of 1.2E8). Default: false.
 
NumberFractionFormat number_fraction_format
 If rational numbers will be displayed with decimals, as a fraction, or something in between. Default: FRACTION_DECIMAL.
 
bool indicate_infinite_series
 Show that the digit series of a number continues forever with three dots, instead of rounding (ex. 2/3 displays as 0.666666... instead of 0.666667). Default: false.
 
bool show_ending_zeroes
 Show ending zeroes for approximate numbers to indicate precision (ex.1.2300000 instead of 1.23) . Default: false.
 
bool abbreviate_names
 Prefer abbreviated names of variables, units, functions etc. Default: true.
 
bool use_reference_names
 Prefer reference names of variables, units, functions etc. Default: false.
 
bool place_units_separately
 Isolate units at the end of the displayed expression (ex. x/y m/s instead of (x m)/(y s)). Default: true.
 
bool use_unit_prefixes
 Use prefixes for units when appropriate. Default: true.
 
bool use_prefixes_for_all_units
 Use prefixes for currencies if unit prefixes are om. Default: false.
 
bool use_prefixes_for_currencies
 Use all decimal SI prefixes. If false, prefixes which is not a multiple of thousand (centi, deci, deka, hekto) will not be used automatically. Default: false.
 
bool use_all_prefixes
 Use prefixes for all units (even imperial and similar ones). Default: false.
 
bool use_denominator_prefix
 If set to true, prefixes will be split between numerator and denominator in a unit expression (millimeter per kilogram instead of micrometer per gram). Default: true.
 
bool negative_exponents
 If true, negative exponents will be used instead of division (ex. 5/x^2 becomes 5*x^-2). Default: false.
 
bool short_multiplication
 Avoid using multiplication sign, when appropriate. Default: true.
 
bool limit_implicit_multiplication
 Use a format compatible with ParseOptions::limit_implicit_multiplication. Default: false.
 
bool allow_non_usable
 If it is not necessary that the displayed expression can be parsed correctly. Default: false.
 
bool use_unicode_signs
 If unicode signs can be displayed. Default: false.
 
MultiplicationSign multiplication_sign
 Sign used for display of multiplication. Default: MULTIPLICATION_SIGN_DOT.
 
DivisionSign division_sign
 Sign used for display of division. Default: DIVISION_SIGN_DIVISION_SLASH.
 
bool spacious
 If space will be used to make the output look nicer. Default: true.
 
bool excessive_parenthesis
 Use parentheses even when not necessary. Default: false.
 
bool halfexp_to_sqrt
 Transform raised to 1/2 to square root function. Default: true.
 
int min_decimals
 Minimum number of decimals to display for numbers. Default: 0.
 
int max_decimals
 Maximum number of decimals to display for numbers. A negative value disables the limit. Default: -1.
 
bool use_min_decimals
 Enable use of min_decimals. False is equivalent to a min_decimals value of zero. Default: true.
 
bool use_max_decimals
 Enable use of max_decimals. False is equivalent to a negative max_decimals value. Default: true.
 
bool round_halfway_to_even
 If true round halfway numbers to nearest even number, otherwise round upwards. Default: false.
 
bool improve_division_multipliers
 Multiply numerator and denominator to get integers (ex. (6x+y)/2z instead of (3x+0.5y)/z). Default: true.
 
Prefixprefix
 Force use of a specific prefix for units if not NULL. Default: NULL.
 
bool * is_approximate
 If not NULL will be set to true if the output is approximate. Default: NULL.
 
SortOptions sort_options
 Options for the order of values in the displayed expression. Default: default_sort_options.
 
string comma_sign
 Comma sign or empty string to use default comma sign. Default: empty string.
 
string decimalpoint_sign
 Decimal sign or empty string to use default decimal sign. Default: empty string.
 
bool(* can_display_unicode_string_function )(const char *, void *)
 Function that returns true if a text string with unicode signs can be properly displayed. Default: NULL.
 
void * can_display_unicode_string_arg
 Argument passed to can_display_unicode_string_function. Default: NULL.
 
bool hide_underscore_spaces
 Replace underscores in names with spaces, unless name has suffix. Default: false.
 
bool preserve_format
 Preserves the format of the structure (no sorting, no changed prefixes, no improved division multipliers, etc.). Default: false.
 
bool allow_factorization
 Allows factorization to occur in the output (should be set to true if the structure has been factorized). Default: false.
 
bool spell_out_logical_operators
 If logical operators will be spelled as AND and OR instead of && and ||. Default: false.
 
bool restrict_to_parent_precision
 Displays children of the structure with no higher precision than the parent. Default: true.
 
bool restrict_fraction_length
 Restrict the length of numerators and demonitor as integers in decimal mode for fractional display of numbers. Default: false.
 
bool exp_to_root
 Transform exponentiation positive base and unit fraction exponent (if denominator < 10) to root function. Default: false.
 
bool preserve_precision
 Use the internal precision of each number instead of global precision. Default: false.
 
IntervalDisplay interval_display
 How number intervals will be displayed. Default: INTERVAL_DISPLAY_INTERVAL.
 
DigitGrouping digit_grouping
 Digit grouping separator. Default: DIGIT_GROUPING_NONE.
 
DateTimeFormat date_time_format
 Format for time and date. Default: DATE_TIME_FORMAT_ISO.
 
TimeZone time_zone
 Time zone for time and date. Default: TIME_ZONE_LOCAL.
 
int custom_time_zone
 Offset in minute for custom time zone. Default: 0.
 
bool twos_complement
 Negative binary numbers uses two's complement representation. All binary numbers starting with 1 are negative. Default: true.
 
unsigned int binary_bits
 Number of bits used for binary numbers. Set to 0 for automatic. Default: 0.
 

Detailed Description

Options for formatting and display of mathematical structures/results.


The documentation for this struct was generated from the following file:
libqalculate-2.8.2/docs/reference/html/files.html0000644000175000017500000001201313401033110016707 00000000000000 libqalculate-2.8.2: File List
libqalculate-2.8.2
File List
Here is a list of all documented files with brief descriptions:
libqalculate-2.8.2/docs/reference/html/classIntegerArgument.png0000644000175000017500000000100313401033110021550 00000000000000‰PNG  IHDRiP-)«mPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2’IDATxíí’ƒ E—™¾ÿ#o•¯F©Ýaw:8½1ä ö/Þ{?ExIš E’¤Qý’“¤]ø_“\/êcÒn]¸‡x¹ýì]› mI:ë’£îÈʤ=´yÎlI:ë&©¨˜ÛIªèš´]-RðùŒ”ö¨™“}+Iu‘ìvýâêYR<å ¤øñìåIHRE}߈ÞB#åÜ$i@9]•¥$5´þ5$iT_JòÞûèÖ`Ц‘Y¨i¤'hjé+ÏÞ" k‘FµH£Z$€Q-À¨ `T‹0ªEJ—sÎM`‚ `T@*ÀºwjÐKê^… éÙÞîù¶™ýuz qÄnƒCèŽ=±FƒG eIÁñuhê‹ÀÔˆ³88lXC.ÁN9I/&ŽãÀêð÷¤ýëQæ–V#}¼Z$;¼•“ dÒ1Y¾Éé4¼µzfŸj$»]«÷þìIÅGùå³—ãÝ©ŽfñÜ­®KRI ¢¦ÃíŠOUPUÓaýk|®/%9çÜ ý‹d—æ3IEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_i.html0000644000175000017500000001201613401033110020130 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- i -

libqalculate-2.8.2/docs/reference/html/classDynamicVariable-members.html0000644000175000017500000012055313401033110023326 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
DynamicVariable Member List

This is the complete list of members for DynamicVariable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
always_recalculate (defined in DynamicVariable)DynamicVariableprotected
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_expression (defined in KnownVariable)KnownVariableprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculate() const =0 (defined in DynamicVariable)DynamicVariableprotectedpure virtual
calculated_precision (defined in KnownVariable)KnownVariableprotected
calculated_with_interval (defined in KnownVariable)KnownVariableprotected
calculated_with_units (defined in KnownVariable)KnownVariableprotected
calculatedPrecision() constDynamicVariable
calculatedWithInterval() const (defined in DynamicVariable)DynamicVariable
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const =0 (defined in DynamicVariable)DynamicVariablepure virtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
DynamicVariable(string cat_, string name_, string title_="", bool is_local=false, bool is_builtin=true, bool is_active=true) (defined in DynamicVariable)DynamicVariable
DynamicVariable(const DynamicVariable *variable) (defined in DynamicVariable)DynamicVariable
DynamicVariable() (defined in DynamicVariable)DynamicVariable
expression() constKnownVariablevirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
get()DynamicVariablevirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isExpression() constKnownVariablevirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() constKnownVariableinlinevirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
KnownVariable(string cat_, string name_, const MathStructure &o, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable(string cat_, string name_, string expression_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)KnownVariable
KnownVariable()KnownVariable
KnownVariable(const KnownVariable *variable)KnownVariable
mstruct (defined in KnownVariable)KnownVariableprotected
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsComplex(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsEven(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsFraction(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsInteger(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonComplex(bool=false) (defined in KnownVariable)KnownVariablevirtual
representsNonInteger(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonMatrix() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonNegative(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonPositive(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNonZero(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsNumber(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsOdd(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsPositive(bool=false)DynamicVariableinlinevirtual
representsRational(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsReal(bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
representsScalar() (defined in DynamicVariable)DynamicVariableinlinevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in DynamicVariable)DynamicVariableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in DynamicVariable)DynamicVariablevirtual
set(const MathStructure &o)DynamicVariablevirtual
set(string expression_)DynamicVariablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
setUncertainty(string standard_uncertainty) (defined in KnownVariable)KnownVariablevirtual
setUnit(string unit_expression) (defined in KnownVariable)KnownVariablevirtual
sexpression (defined in KnownVariable)KnownVariableprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constKnownVariableinlinevirtual
suncertainty (defined in KnownVariable)KnownVariableprotected
sunit (defined in KnownVariable)KnownVariableprotected
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constVariableinlinevirtual
uncertainty() const (defined in KnownVariable)KnownVariablevirtual
unit() const (defined in KnownVariable)KnownVariablevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~DynamicVariable() (defined in DynamicVariable)DynamicVariablevirtual
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~KnownVariable() (defined in KnownVariable)KnownVariablevirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-2.8.2/docs/reference/html/classUnitArgument.png0000644000175000017500000000070613401033110021103 00000000000000‰PNG  IHDRWP[æPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2UIDATxíanì „Çƒ”û¹ «¼^…VQYyjBÌg—~#¥”‰$׿þWH2 ïñ]®DÁAnö¢uuŸÓ:u9“4ëq ## ¹q3È=·L$ÍþÏ5™3’w$oÖå^¿Wc"ܺ·Ãzý[’7›áúmþx<·|'û\•Vú¡¥$y³©ó=&3ÜV7IÎk\o§éIr }O¾–›RJÏ fuÀ-âÇð"î‰]^Å}]?lîæ0ÛÜÍÝ\ðÚÜÍý3\‘‚ÀãÚÜâfg9Α>DÓ6\Ÿk3Að¿¸çÄ5¼\ñ§]©Óe¦œ€²¢Ž{\¶õuíýmMâòت~½}®ÉE¸ç7ÉWc"\k‰A½þmœë·yfò¿ãÒ¶;éþñts 0kýÐR~П³Ñn« Õ[›Ú÷äk¹""Ïë ÖçEŒ¤tIEND®B`‚libqalculate-2.8.2/docs/reference/html/classNumberArgument.png0000644000175000017500000000100513401033110021405 00000000000000‰PNG  IHDRnPÏõ°PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2”IDATxíénà g?¤¼ÿ#71—q‘ ÑŠV•§`ìe–ËùK!¬ƒ I«Ø:IrâßéL’&¸}¨³YŸî(-þ–ú³96½ŠX—¤#]êú0%aÑý7÷%Iêñ¾®R‹*h Iê2Ô½þFºøŽƒ.¯ÛptíSIê2«k—Ð{2[]Úu‡dIÚ™%Iê2ýU™=õ’N×”®ŒR’>bnt÷gX’ì Irâëu!„° €Ox¬c­îñXê[«{ÚVúë¾|gn€[àÄÖ8±uNl€[àÄÖ8±uWÌÌÖ¬bëœø+],:î~:³IK®建éIù¥;*OJQê)“œPj¬Qñ4]ãR@ OÁ7ºã½X95Gw¦<ìÅ•û’@»vM¿û“åZÆutç ĨWÌ2ONþðtñOu§5¯»x0ºö鯃Ð.Åõ¦ÐFÕ‹NfÙ §ë²3¯ºp+;³dâ÷Uy·]/À=£Ëg`ÀþpâëuffËøÎ:(²ÃñIIEND®B`‚libqalculate-2.8.2/docs/reference/html/classNumberArgument-members.html0000644000175000017500000004643213401033110023232 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
NumberArgument Member List

This is the complete list of members for NumberArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_complex (defined in NumberArgument)NumberArgumentprotected
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_incl_max (defined in NumberArgument)NumberArgumentprotected
b_incl_min (defined in NumberArgument)NumberArgumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_rational_number (defined in NumberArgument)NumberArgumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
complexAllowed() const (defined in NumberArgument)NumberArgument
copy() constNumberArgumentvirtual
fmax (defined in NumberArgument)NumberArgumentprotected
fmin (defined in NumberArgument)NumberArgumentprotected
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
includeEqualsMax() const (defined in NumberArgument)NumberArgument
includeEqualsMin() const (defined in NumberArgument)NumberArgument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
max() const (defined in NumberArgument)NumberArgument
min() const (defined in NumberArgument)NumberArgument
name() constArgument
NumberArgument(string name_="", ArgumentMinMaxPreDefinition minmax=ARGUMENT_MIN_MAX_NONE, bool does_test=true, bool does_error=true) (defined in NumberArgument)NumberArgument
NumberArgument(const NumberArgument *arg) (defined in NumberArgument)NumberArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constNumberArgumentvirtual
printlong() constArgument
rationalNumber() const (defined in NumberArgument)NumberArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)NumberArgumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setComplexAllowed(bool allow_complex) (defined in NumberArgument)NumberArgument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIncludeEqualsMax(bool include_equals) (defined in NumberArgument)NumberArgument
setIncludeEqualsMin(bool include_equals) (defined in NumberArgument)NumberArgument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setMax(const Number *nmax) (defined in NumberArgument)NumberArgument
setMin(const Number *nmin) (defined in NumberArgument)NumberArgument
setName(string name_)Argument
setRationalNumber(bool rational_number) (defined in NumberArgument)NumberArgument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constNumberArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constNumberArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constNumberArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~NumberArgument() (defined in NumberArgument)NumberArgumentvirtual
libqalculate-2.8.2/docs/reference/html/closed.png0000644000175000017500000000020413401033110016675 00000000000000‰PNG  IHDR à‘KIDATxíÝm @!†ÑGk™É7À-`&séts¦Àñþòð@åk}ª2€… P%Á_Ëþ¿N² .:0Dk¥‹Â›x" Ö›)¡xÒ5õIEND®B`‚libqalculate-2.8.2/docs/reference/html/classDateArgument.png0000644000175000017500000000074713401033110021046 00000000000000‰PNG  IHDR\P£óâPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2vIDATxíéŽÃ ÇRßÿ‘·åŒE.Z±«j©˜Ð$0 ùM!Ì‚ IsXrIêø¹IÒ{íä6jGkKפ¨ÿŸÓ£W•þKÚ–yEoÖWy´¹ûNÒ¶\Ê­j:_IråHþú]ÉS›ayYïË‘û·’\¹)÷KÿÙ²xyN`ËcQæÝRãJråî =S·åu’4­‘ïžIº`}r%©ã«å!„0 €³˜)<&ÚgÊŸîyö©ò/Þ-KгäKбäKбäKÐñoäff³Àæ°ä¿#OÙݾ8º¸ 8Û/ñí»òx3h—M£X§Ý–'yæ©ÅN¿&¯Ý0p¤Žµ*‘\°Ösä'ò†‚»?—§Ì¦Ù¥¹–\ŸÉk¯S¹_ö|äþíînéÖ¼“û¥¿µ,uŸ§¯Y˺—ç¶<em›ã¾{Bïvyë|L“×pÁúät|µÜÌl?ÄYzú—$IEND®B`‚libqalculate-2.8.2/docs/reference/html/doxygen.css0000644000175000017500000006647013401033110017126 00000000000000/* The standard CSS for doxygen 1.8.14 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; } p.reference, p.definition { font: 400 14px/22px Roboto,sans-serif; } /* @group Heading Levels */ h1.groupheader { font-size: 150%; } .title { font: 400 14px/28px Roboto,sans-serif; font-size: 150%; font-weight: bold; margin: 10px 2px; } h2.groupheader { border-bottom: 1px solid #879ECB; color: #354C7B; font-size: 150%; font-weight: normal; margin-top: 1.75em; padding-top: 8px; padding-bottom: 4px; width: 100%; } h3.groupheader { font-size: 100%; } h1, h2, h3, h4, h5, h6 { -webkit-transition: text-shadow 0.5s linear; -moz-transition: text-shadow 0.5s linear; -ms-transition: text-shadow 0.5s linear; -o-transition: text-shadow 0.5s linear; transition: text-shadow 0.5s linear; margin-right: 15px; } h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { text-shadow: 0 0 15px cyan; } dt { font-weight: bold; } div.multicol { -moz-column-gap: 1em; -webkit-column-gap: 1em; -moz-column-count: 3; -webkit-column-count: 3; } p.startli, p.startdd { margin-top: 2px; } p.starttd { margin-top: 0px; } p.endli { margin-bottom: 0px; } p.enddd { margin-bottom: 4px; } p.endtd { margin-bottom: 2px; } /* @end */ caption { font-weight: bold; } span.legend { font-size: 70%; text-align: center; } h3.version { font-size: 90%; text-align: center; } div.qindex, div.navtab{ background-color: #EBEFF6; border: 1px solid #A3B4D7; text-align: center; } div.qindex, div.navpath { width: 100%; line-height: 140%; } div.navtab { margin-right: 15px; } /* @group Link Styling */ a { color: #3D578C; font-weight: normal; text-decoration: none; } .contents a:visited { color: #4665A2; } a:hover { text-decoration: underline; } a.qindex { font-weight: bold; } a.qindexHL { font-weight: bold; background-color: #9CAFD4; color: #ffffff; border: 1px double #869DCA; } .contents a.qindexHL:visited { color: #ffffff; } a.el { font-weight: bold; } a.elRef { } a.code, a.code:visited, a.line, a.line:visited { color: #4665A2; } a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { color: #4665A2; } /* @end */ dl.el { margin-left: -1cm; } pre.fragment { border: 1px solid #C4CFE5; background-color: #FBFCFD; padding: 4px 6px; margin: 4px 8px 4px 2px; overflow: auto; word-wrap: break-word; font-size: 9pt; line-height: 125%; font-family: monospace, fixed; font-size: 105%; } div.fragment { padding: 0px; margin: 4px 8px 4px 2px; background-color: #FBFCFD; border: 1px solid #C4CFE5; } div.line { font-family: monospace, fixed; font-size: 13px; min-height: 13px; line-height: 1.0; text-wrap: unrestricted; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: pre-wrap; /* CSS3 */ word-wrap: break-word; /* IE 5.5+ */ text-indent: -53px; padding-left: 53px; padding-bottom: 0px; margin: 0px; -webkit-transition-property: background-color, box-shadow; -webkit-transition-duration: 0.5s; -moz-transition-property: background-color, box-shadow; -moz-transition-duration: 0.5s; -ms-transition-property: background-color, box-shadow; -ms-transition-duration: 0.5s; -o-transition-property: background-color, box-shadow; -o-transition-duration: 0.5s; transition-property: background-color, box-shadow; transition-duration: 0.5s; } div.line:after { content:"\000A"; white-space: pre; } div.line.glow { background-color: cyan; box-shadow: 0 0 10px cyan; } span.lineno { padding-right: 4px; text-align: right; border-right: 2px solid #0F0; background-color: #E8E8E8; white-space: pre; } span.lineno a { background-color: #D8D8D8; } span.lineno a:hover { background-color: #C8C8C8; } .lineno { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } div.ah, span.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px; padding: 0.2em; border: solid thin #333; border-radius: 0.5em; -webkit-border-radius: .5em; -moz-border-radius: .5em; box-shadow: 2px 2px 3px #999; -webkit-box-shadow: 2px 2px 3px #999; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); } div.classindex ul { list-style: none; padding-left: 0; } div.classindex span.ai { display: inline-block; } div.groupHeader { margin-left: 16px; margin-top: 12px; font-weight: bold; } div.groupText { margin-left: 16px; font-style: italic; } body { background-color: white; color: black; margin: 0; } div.contents { margin-top: 10px; margin-left: 12px; margin-right: 8px; } td.indexkey { background-color: #EBEFF6; font-weight: bold; border: 1px solid #C4CFE5; margin: 2px 0px 2px 0; padding: 2px 10px; white-space: nowrap; vertical-align: top; } td.indexvalue { background-color: #EBEFF6; border: 1px solid #C4CFE5; padding: 2px 10px; margin: 2px 0px; } tr.memlist { background-color: #EEF1F7; } p.formulaDsp { text-align: center; } img.formulaDsp { } img.formulaInl { vertical-align: middle; } div.center { text-align: center; margin-top: 0px; margin-bottom: 0px; padding: 0px; } div.center img { border: 0px; } address.footer { text-align: right; padding-right: 12px; } img.footer { border: 0px; vertical-align: middle; } /* @group Code Colorization */ span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } span.comment { color: #800000 } span.preprocessor { color: #806020 } span.stringliteral { color: #002080 } span.charliteral { color: #008080 } span.vhdldigit { color: #ff00ff } span.vhdlchar { color: #000000 } span.vhdlkeyword { color: #700070 } span.vhdllogic { color: #ff0000 } blockquote { background-color: #F7F8FB; border-left: 2px solid #9CAFD4; margin: 0 24px 0 4px; padding: 0 12px 0 16px; } /* @end */ /* .search { color: #003399; font-weight: bold; } form.search { margin-bottom: 0px; margin-top: 0px; } input.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #e8eef2; } */ td.tiny { font-size: 75%; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #A3B4D7; } th.dirtab { background: #EBEFF6; font-weight: bold; } hr { height: 0px; border: none; border-top: 1px solid #4A6AAA; } hr.footer { height: 1px; } /* @group Member Descriptions */ table.memberdecls { border-spacing: 0px; padding: 0px; } .memberdecls td, .fieldtable tr { -webkit-transition-property: background-color, box-shadow; -webkit-transition-duration: 0.5s; -moz-transition-property: background-color, box-shadow; -moz-transition-duration: 0.5s; -ms-transition-property: background-color, box-shadow; -ms-transition-duration: 0.5s; -o-transition-property: background-color, box-shadow; -o-transition-duration: 0.5s; transition-property: background-color, box-shadow; transition-duration: 0.5s; } .memberdecls td.glow, .fieldtable tr.glow { background-color: cyan; box-shadow: 0 0 15px cyan; } .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { background-color: #F9FAFC; border: none; margin: 4px; padding: 1px 0 0 8px; } .mdescLeft, .mdescRight { padding: 0px 8px 4px 8px; color: #555; } .memSeparator { border-bottom: 1px solid #DEE4F0; line-height: 1px; margin: 0px; padding: 0px; } .memItemLeft, .memTemplItemLeft { white-space: nowrap; } .memItemRight { width: 100%; } .memTemplParams { color: #4665A2; white-space: nowrap; font-size: 80%; } /* @end */ /* @group Member Details */ /* Styles for detailed member documentation */ .memtitle { padding: 8px; border-top: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; border-right: 1px solid #A8B8D9; border-top-right-radius: 4px; border-top-left-radius: 4px; margin-bottom: -1px; background-image: url('nav_f.png'); background-repeat: repeat-x; background-color: #E2E8F2; line-height: 1.25; font-weight: 300; float:left; } .permalink { font-size: 65%; display: inline-block; vertical-align: middle; } .memtemplate { font-size: 80%; color: #4665A2; font-weight: normal; margin-left: 9px; } .memnav { background-color: #EBEFF6; border: 1px solid #A3B4D7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } .mempage { width: 100%; } .memitem { padding: 0; margin-bottom: 10px; margin-right: 5px; -webkit-transition: box-shadow 0.5s linear; -moz-transition: box-shadow 0.5s linear; -ms-transition: box-shadow 0.5s linear; -o-transition: box-shadow 0.5s linear; transition: box-shadow 0.5s linear; display: table !important; width: 100%; } .memitem.glow { box-shadow: 0 0 15px cyan; } .memname { font-weight: 400; margin-left: 6px; } .memname td { vertical-align: bottom; } .memproto, dl.reflist dt { border-top: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; border-right: 1px solid #A8B8D9; padding: 6px 0px 6px 0px; color: #253555; font-weight: bold; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); background-color: #DFE5F1; /* opera specific markup */ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; /* firefox specific markup */ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; -moz-border-radius-topright: 4px; /* webkit specific markup */ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -webkit-border-top-right-radius: 4px; } .overload { font-family: "courier new",courier,monospace; font-size: 65%; } .memdoc, dl.reflist dd { border-bottom: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; border-right: 1px solid #A8B8D9; padding: 6px 10px 2px 10px; background-color: #FBFCFD; border-top-width: 0; background-image:url('nav_g.png'); background-repeat:repeat-x; background-color: #FFFFFF; /* opera specific markup */ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); /* firefox specific markup */ -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; /* webkit specific markup */ -webkit-border-bottom-left-radius: 4px; -webkit-border-bottom-right-radius: 4px; -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); } dl.reflist dt { padding: 5px; } dl.reflist dd { margin: 0px 0px 10px 0px; padding: 5px; } .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #602020; white-space: nowrap; } .paramname em { font-style: normal; } .paramname code { line-height: 14px; } .params, .retval, .exception, .tparams { margin-left: 0px; padding-left: 0px; } .params .paramname, .retval .paramname { font-weight: bold; vertical-align: top; } .params .paramtype { font-style: italic; vertical-align: top; } .params .paramdir { font-family: "courier new",courier,monospace; vertical-align: top; } table.mlabels { border-spacing: 0px; } td.mlabels-left { width: 100%; padding: 0px; } td.mlabels-right { vertical-align: bottom; padding: 0px; white-space: nowrap; } span.mlabels { margin-left: 8px; } span.mlabel { background-color: #728DC1; border-top:1px solid #5373B4; border-left:1px solid #5373B4; border-right:1px solid #C4CFE5; border-bottom:1px solid #C4CFE5; text-shadow: none; color: white; margin-right: 4px; padding: 2px 3px; border-radius: 3px; font-size: 7pt; white-space: nowrap; vertical-align: middle; } /* @end */ /* these are for tree view inside a (index) page */ div.directory { margin: 10px 0px; border-top: 1px solid #9CAFD4; border-bottom: 1px solid #9CAFD4; width: 100%; } .directory table { border-collapse:collapse; } .directory td { margin: 0px; padding: 0px; vertical-align: top; } .directory td.entry { white-space: nowrap; padding-right: 6px; padding-top: 3px; } .directory td.entry a { outline:none; } .directory td.entry a img { border: none; } .directory td.desc { width: 100%; padding-left: 6px; padding-right: 6px; padding-top: 3px; border-left: 1px solid rgba(0,0,0,0.05); } .directory tr.even { padding-left: 6px; background-color: #F7F8FB; } .directory img { vertical-align: -30%; } .directory .levels { white-space: nowrap; width: 100%; text-align: right; font-size: 9pt; } .directory .levels span { cursor: pointer; padding-left: 2px; padding-right: 2px; color: #3D578C; } .arrow { color: #9CAFD4; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; font-size: 80%; display: inline-block; width: 16px; height: 22px; } .icon { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; height: 14px; width: 16px; display: inline-block; background-color: #728DC1; color: white; text-align: center; border-radius: 4px; margin-left: 2px; margin-right: 2px; } .icona { width: 24px; height: 22px; display: inline-block; } .iconfopen { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('folderopen.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .iconfclosed { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('folderclosed.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .icondoc { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('doc.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } table.directory { font: 400 14px Roboto,sans-serif; } /* @end */ div.dynheader { margin-top: 8px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } address { font-style: normal; color: #2A3D61; } table.doxtable caption { caption-side: top; } table.doxtable { border-collapse:collapse; margin-top: 4px; margin-bottom: 4px; } table.doxtable td, table.doxtable th { border: 1px solid #2D4068; padding: 3px 7px 2px; } table.doxtable th { background-color: #374F7F; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; padding-top: 5px; } table.fieldtable { /*width: 100%;*/ margin-bottom: 10px; border: 1px solid #A8B8D9; border-spacing: 0px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); } .fieldtable td, .fieldtable th { padding: 3px 7px 2px; } .fieldtable td.fieldtype, .fieldtable td.fieldname { white-space: nowrap; border-right: 1px solid #A8B8D9; border-bottom: 1px solid #A8B8D9; vertical-align: top; } .fieldtable td.fieldname { padding-top: 3px; } .fieldtable td.fielddoc { border-bottom: 1px solid #A8B8D9; /*width: 100%;*/ } .fieldtable td.fielddoc p:first-child { margin-top: 0px; } .fieldtable td.fielddoc p:last-child { margin-bottom: 2px; } .fieldtable tr:last-child td { border-bottom: none; } .fieldtable th { background-image:url('nav_f.png'); background-repeat:repeat-x; background-color: #E2E8F2; font-size: 90%; color: #253555; padding-bottom: 4px; padding-top: 5px; text-align:left; font-weight: 400; -moz-border-radius-topleft: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom: 1px solid #A8B8D9; } .tabsearch { top: 0px; left: 10px; height: 36px; background-image: url('tab_b.png'); z-index: 101; overflow: hidden; font-size: 13px; } .navpath ul { font-size: 11px; background-image:url('tab_b.png'); background-repeat:repeat-x; background-position: 0 -5px; height:30px; line-height:30px; color:#8AA0CC; border:solid 1px #C2CDE4; overflow:hidden; margin:0px; padding:0px; } .navpath li { list-style-type:none; float:left; padding-left:10px; padding-right:15px; background-image:url('bc_s.png'); background-repeat:no-repeat; background-position:right; color:#364D7C; } .navpath li.navelem a { height:32px; display:block; text-decoration: none; outline: none; color: #283A5D; font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); text-decoration: none; } .navpath li.navelem a:hover { color:#6884BD; } .navpath li.footer { list-style-type:none; float:right; padding-left:10px; padding-right:15px; background-image:none; background-repeat:no-repeat; background-position:right; color:#364D7C; font-size: 8pt; } div.summary { float: right; font-size: 8pt; padding-right: 5px; width: 50%; text-align: right; } div.summary a { white-space: nowrap; } table.classindex { margin: 10px; white-space: nowrap; margin-left: 3%; margin-right: 3%; width: 94%; border: 0; border-spacing: 0; padding: 0; } div.ingroups { font-size: 8pt; width: 50%; text-align: left; } div.ingroups a { white-space: nowrap; } div.header { background-image:url('nav_h.png'); background-repeat:repeat-x; background-color: #F9FAFC; margin: 0px; border-bottom: 1px solid #C4CFE5; } div.headertitle { padding: 5px 5px 5px 10px; } dl { padding: 0 0 0 10px; } /* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ dl.section { margin-left: 0px; padding-left: 0px; } dl.note { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #D0C000; } dl.warning, dl.attention { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #FF0000; } dl.pre, dl.post, dl.invariant { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00D000; } dl.deprecated { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #505050; } dl.todo { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00C0E0; } dl.test { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #3030E0; } dl.bug { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #C08050; } dl.section dd { margin-bottom: 6px; } #projectlogo { text-align: center; vertical-align: bottom; border-collapse: separate; } #projectlogo img { border: 0px none; } #projectalign { vertical-align: middle; } #projectname { font: 300% Tahoma, Arial,sans-serif; margin: 0px; padding: 2px 0px; } #projectbrief { font: 120% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } #projectnumber { font: 50% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } #titlearea { padding: 0px; margin: 0px; width: 100%; border-bottom: 1px solid #5373B4; } .image { text-align: center; } .dotgraph { text-align: center; } .mscgraph { text-align: center; } .plantumlgraph { text-align: center; } .diagraph { text-align: center; } .caption { font-weight: bold; } div.zoom { border: 1px solid #90A5CE; } dl.citelist { margin-bottom:50px; } dl.citelist dt { color:#334975; float:left; font-weight:bold; margin-right:10px; padding:5px; } dl.citelist dd { margin:2px 0; padding:5px 0; } div.toc { padding: 14px 25px; background-color: #F4F6FA; border: 1px solid #D8DFEE; border-radius: 7px 7px 7px 7px; float: right; height: auto; margin: 0 8px 10px 10px; width: 200px; } div.toc li { background: url("bdwn.png") no-repeat scroll 0 5px transparent; font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; margin-top: 5px; padding-left: 10px; padding-top: 2px; } div.toc h3 { font: bold 12px/1.2 Arial,FreeSans,sans-serif; color: #4665A2; border-bottom: 0 none; margin: 0; } div.toc ul { list-style: none outside none; border: medium none; padding: 0px; } div.toc li.level1 { margin-left: 0px; } div.toc li.level2 { margin-left: 15px; } div.toc li.level3 { margin-left: 30px; } div.toc li.level4 { margin-left: 45px; } .inherit_header { font-weight: bold; color: gray; cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .inherit_header td { padding: 6px 0px 2px 5px; } .inherit { display: none; } tr.heading h2 { margin-top: 12px; margin-bottom: 4px; } /* tooltip related style info */ .ttc { position: absolute; display: none; } #powerTip { cursor: default; white-space: nowrap; background-color: white; border: 1px solid gray; border-radius: 4px 4px 4px 4px; box-shadow: 1px 1px 7px gray; display: none; font-size: smaller; max-width: 80%; opacity: 0.9; padding: 1ex 1em 1em; position: absolute; z-index: 2147483647; } #powerTip div.ttdoc { color: grey; font-style: italic; } #powerTip div.ttname a { font-weight: bold; } #powerTip div.ttname { font-weight: bold; } #powerTip div.ttdeci { color: #006318; } #powerTip div { margin: 0px; padding: 0px; font: 12px/16px Roboto,sans-serif; } #powerTip:before, #powerTip:after { content: ""; position: absolute; margin: 0px; } #powerTip.n:after, #powerTip.n:before, #powerTip.s:after, #powerTip.s:before, #powerTip.w:after, #powerTip.w:before, #powerTip.e:after, #powerTip.e:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.se:after, #powerTip.se:before, #powerTip.nw:after, #powerTip.nw:before, #powerTip.sw:after, #powerTip.sw:before { border: solid transparent; content: " "; height: 0; width: 0; position: absolute; } #powerTip.n:after, #powerTip.s:after, #powerTip.w:after, #powerTip.e:after, #powerTip.nw:after, #powerTip.ne:after, #powerTip.sw:after, #powerTip.se:after { border-color: rgba(255, 255, 255, 0); } #powerTip.n:before, #powerTip.s:before, #powerTip.w:before, #powerTip.e:before, #powerTip.nw:before, #powerTip.ne:before, #powerTip.sw:before, #powerTip.se:before { border-color: rgba(128, 128, 128, 0); } #powerTip.n:after, #powerTip.n:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.nw:after, #powerTip.nw:before { top: 100%; } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { border-top-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.n:before { border-top-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.n:after, #powerTip.n:before { left: 50%; } #powerTip.nw:after, #powerTip.nw:before { right: 14px; } #powerTip.ne:after, #powerTip.ne:before { left: 14px; } #powerTip.s:after, #powerTip.s:before, #powerTip.se:after, #powerTip.se:before, #powerTip.sw:after, #powerTip.sw:before { bottom: 100%; } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { border-bottom-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { border-bottom-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.s:after, #powerTip.s:before { left: 50%; } #powerTip.sw:after, #powerTip.sw:before { right: 14px; } #powerTip.se:after, #powerTip.se:before { left: 14px; } #powerTip.e:after, #powerTip.e:before { left: 100%; } #powerTip.e:after { border-left-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.e:before { border-left-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } #powerTip.w:after, #powerTip.w:before { right: 100%; } #powerTip.w:after { border-right-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.w:before { border-right-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } @media print { #top { display: none; } #side-nav { display: none; } #nav-path { display: none; } body { overflow:visible; } h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } .summary { display: none; } .memitem { page-break-inside: avoid; } #doc-content { margin-left:0 !important; height:auto !important; width:auto !important; overflow:inherit; display:inline; } } /* @group Markdown */ /* table.markdownTable { border-collapse:collapse; margin-top: 4px; margin-bottom: 4px; } table.markdownTable td, table.markdownTable th { border: 1px solid #2D4068; padding: 3px 7px 2px; } table.markdownTableHead tr { } table.markdownTableBodyLeft td, table.markdownTable th { border: 1px solid #2D4068; padding: 3px 7px 2px; } th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { background-color: #374F7F; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; padding-top: 5px; } th.markdownTableHeadLeft { text-align: left } th.markdownTableHeadRight { text-align: right } th.markdownTableHeadCenter { text-align: center } */ table.markdownTable { border-collapse:collapse; margin-top: 4px; margin-bottom: 4px; } table.markdownTable td, table.markdownTable th { border: 1px solid #2D4068; padding: 3px 7px 2px; } table.markdownTable tr { } th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { background-color: #374F7F; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; padding-top: 5px; } th.markdownTableHeadLeft, td.markdownTableBodyLeft { text-align: left } th.markdownTableHeadRight, td.markdownTableBodyRight { text-align: right } th.markdownTableHeadCenter, td.markdownTableBodyCenter { text-align: center } /* @end */ libqalculate-2.8.2/docs/reference/html/classCompositeUnit.html0000644000175000017500000021353513401033110021451 00000000000000 libqalculate-2.8.2: CompositeUnit Class Reference
libqalculate-2.8.2

A unit consisting of a number of other units. More...

#include <Unit.h>

Inheritance diagram for CompositeUnit:
Unit ExpressionItem

Public Member Functions

 CompositeUnit (string cat_, string name_, string title_="", string base_expression_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 CompositeUnit (const CompositeUnit *unit)
 
virtual ExpressionItemcopy () const
 
virtual void set (const ExpressionItem *item)
 
virtual void add (Unit *u, int exp=1, Prefix *prefix=NULL)
 
virtual Unitget (size_t index, int *exp=NULL, Prefix **prefix=NULL) const
 
virtual void setExponent (size_t index, int exp)
 
virtual void setPrefix (size_t index, Prefix *prefix)
 
virtual size_t countUnits () const
 
virtual size_t find (Unit *u) const
 
virtual void del (size_t index)
 
virtual string print (bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual int subtype () const
 
virtual bool containsRelativeTo (Unit *u) const
 
virtual MathStructure generateMathStructure (bool make_division=false, bool set_null_prefixes=false) const
 
virtual void setBaseExpression (string base_expression_)
 
virtual void clear ()
 
- Public Member Functions inherited from Unit
 Unit (string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
 Unit (const Unit *unit)
 
bool isSIUnit () const
 
void setAsSIUnit ()
 
void setSystem (string s_system)
 
const string & system () const
 
bool useWithPrefixesByDefault () const
 
void setUseWithPrefixesByDefault (bool use_with_prefixes)
 
bool isCurrency () const
 
const string & countries () const
 
void setCountries (string country_names)
 
virtual const string & plural (bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & singular (bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & abbreviation (bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual bool isUsedByOtherUnits () const
 
virtual UnitbaseUnit () const
 
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue, MathStructure &mexp) const
 
virtual MathStructureconvertToBaseUnit (MathStructure &mvalue) const
 
virtual MathStructureconvertFromBaseUnit (MathStructure &mvalue) const
 
virtual MathStructure convertToBaseUnit () const
 
virtual MathStructure convertFromBaseUnit () const
 
virtual int baseExponent (int exp=1) const
 
virtual int type () const
 
virtual bool isChildOf (Unit *u) const
 
virtual bool isParentOf (Unit *u) const
 
virtual bool hasComplexRelationTo (Unit *u) const
 
bool convert (Unit *u, MathStructure &mvalue, MathStructure &exp) const
 
bool convert (Unit *u, MathStructure &mvalue) const
 
MathStructure convert (Unit *u, bool *converted=NULL) const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Attributes

string sshort
 
vector< AliasUnit_Composite * > units
 
- Protected Attributes inherited from Unit
string ssystem
 
string scountries
 
bool b_si
 
bool b_use_with_prefixes
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Detailed Description

A unit consisting of a number of other units.

Composite units are defined by a unit expression with multiple units. Composite units often have an alias unit associated with them, as they do not have a reference name on their own. For example, a joule is defined as an alias defined in relation to a composite unit defined as "Newton * meter".

The names of composite units is only used to reference the unit in definitions of other units. They can not be used in expressions.

Composite units is definited as a composition of units. The units, with prefixes and exponents, can either be added one by one with add() or parsed from an expression (ex. "cm^3/g) with setBaseExpression().

Member Function Documentation

◆ add()

virtual void CompositeUnit::add ( Unit u,
int  exp = 1,
Prefix prefix = NULL 
)
virtual

Adds a sub/base unit with specified exponent and an optional prefix.

Parameters
uUnit.
expExponent.
prefixPrefix.

◆ clear()

virtual void CompositeUnit::clear ( )
virtual

Removes all sub/base units.

◆ containsRelativeTo()

virtual bool CompositeUnit::containsRelativeTo ( Unit u) const
virtual

If this unit contains a sub/base unit with a relation to the specified unit.

◆ countUnits()

virtual size_t CompositeUnit::countUnits ( ) const
virtual

Returns the number of sub/base units

◆ generateMathStructure()

virtual MathStructure CompositeUnit::generateMathStructure ( bool  make_division = false,
bool  set_null_prefixes = false 
) const
virtual

Creates a MathStructure with the sub/base units of the unit.

◆ get()

virtual Unit* CompositeUnit::get ( size_t  index,
int *  exp = NULL,
Prefix **  prefix = NULL 
) const
virtual

Retrieves information about a sub/base unit

Parameters
indexIndex starting at 1.
[out]expExponent.
[out]prefixPrefix.
Returns
Sub/base unit (AliasUnit_Composite::firstBaseUnit()).

◆ print()

virtual string CompositeUnit::print ( bool  plural_,
bool  short_,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const
virtual

Prints out the sub/base units with prefixes and exponents. This is the representation of the unit in expressions.

Reimplemented from Unit.

◆ subtype()

virtual int CompositeUnit::subtype ( ) const
virtual

Returns the subtype of the unit, corresponding to which subsubclass the object belongs to.

Returns
UnitSubtype.

Reimplemented from Unit.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classBooleanArgument.html0000644000175000017500000007363613401033110021737 00000000000000 libqalculate-2.8.2: BooleanArgument Class Reference
libqalculate-2.8.2

A boolean argument. More...

#include <Function.h>

Inheritance diagram for BooleanArgument:
Argument

Public Member Functions

 BooleanArgument (string name_="", bool does_test=true, bool does_error=true)
 
 BooleanArgument (const BooleanArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A boolean argument.

Accepts zero or one.

Member Function Documentation

◆ copy()

virtual Argument* BooleanArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string BooleanArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string BooleanArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool BooleanArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int BooleanArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classMathFunction-members.html0000644000175000017500000012147213401033110022674 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
MathFunction Member List

This is the complete list of members for MathFunction, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
appendDefaultValues(MathStructure &vargs) (defined in MathFunction)MathFunction
argc (defined in MathFunction)MathFunctionprotected
args() constMathFunction
args(const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)MathFunction
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
calculate(const string &eq, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
calculate(MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options) (defined in MathFunction)MathFunctionvirtual
calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)MathFunctionvirtual
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearArgumentDefinitions()MathFunction
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
condition() constMathFunction
copy() const =0 (defined in MathFunction)MathFunctionpure virtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
createFunctionMathStructureFromSVArgs(vector< string > &svargs) (defined in MathFunction)MathFunctionprotectedvirtual
createFunctionMathStructureFromVArgs(const MathStructure &vargs) (defined in MathFunction)MathFunctionprotectedvirtual
default_values (defined in MathFunction)MathFunctionprotected
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
example(bool raw_format=false, string name_string="") const (defined in MathFunction)MathFunction
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
getArgumentDefinition(size_t index)MathFunction
getDefaultValue(size_t arg_) const (defined in MathFunction)MathFunction
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
last_argdef_index (defined in MathFunction)MathFunctionprotected
lastArgumentDefinitionIndex() constMathFunction
MathFunction(string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true) (defined in MathFunction)MathFunction
MathFunction(const MathFunction *function) (defined in MathFunction)MathFunction
MathFunction() (defined in MathFunction)MathFunction
max_argc (defined in MathFunction)MathFunctionprotected
maxargs() constMathFunction
minargs() constMathFunction
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
parse(const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
parse(MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options) (defined in MathFunction)MathFunctionvirtual
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
printCondition()MathFunction
priv (defined in MathFunction)MathFunctionprotected
produceArgumentsVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
produceVector(const MathStructure &vargs, int begin=-1, int end=-1) (defined in MathFunction)MathFunction
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsEven(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsInteger(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonComplex(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonMatrix(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsNonNegative(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNonZero(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsNumber(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsOdd(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsPositive(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsRational(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsReal(const MathStructure &, bool=false) const (defined in MathFunction)MathFunctionvirtual
representsScalar(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
representsUndefined(const MathStructure &) const (defined in MathFunction)MathFunctionvirtual
scat (defined in ExpressionItem)ExpressionItemprotected
scondition (defined in MathFunction)MathFunctionprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in MathFunction)MathFunctionvirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setArgumentDefinition(size_t index, Argument *argdef)MathFunction
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setCondition(string expression)MathFunction
setDefaultValue(size_t arg_, string value_) (defined in MathFunction)MathFunction
setDescription(string descr_)ExpressionItemvirtual
setExample(string new_example) (defined in MathFunction)MathFunction
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
sexample (defined in MathFunction)MathFunctionprotected
stitle (defined in ExpressionItem)ExpressionItemprotected
stringArgs(const string &str, vector< string > &svargs) (defined in MathFunction)MathFunction
subtype() constMathFunctionvirtual
testArgumentCount(int itmp) (defined in MathFunction)MathFunction
testArguments(MathStructure &vargs) (defined in MathFunction)MathFunctionprotected
testCondition(const MathStructure &vargs)MathFunction
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constMathFunctionvirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~MathFunction() (defined in MathFunction)MathFunctionvirtual
libqalculate-2.8.2/docs/reference/html/functions_e.html0000644000175000017500000000656613401033110020141 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- e -

libqalculate-2.8.2/docs/reference/html/classDataPropertyArgument.png0000644000175000017500000000113713401033110022601 00000000000000‰PNG  IHDRP fPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2îIDATxíë®ã ‡©ïÿÈÛñÆIaÛs„V®4 áOÌ%É9çe KÒ"„$ù„$ùLÛ$Iš`ªÿ¬MšÕù›íšÊ‰ÙÊÏêRõº”²$0iS#o"Õ§ÙláÍ}ó“¤þÙ¦Ó/=¾½HÒ³6¯ß;›Òççmö5ó67¶U’†øÐÆ.Ÿ_ž)kSWm_¼»CÝSMT’†øô,ž= %éšOlZŽ$é+|”›¹£M’ÞßpIò IòYÎ&çœWà <–a)›Çc%¥lž2 é¬e{ àŠ°ð Ÿ°ð Ÿ°ð Ÿ°ð Ÿ°ð Ÿ°ðù?mRJiH‹6>aàÓlÊ’>6˜Mpé2ûŠ»D/؇lÆo_eRǵÙþ·Lô¿n³õÝëJºjÖ^·õ°ØïûÓKCmkeó =ùg›6ìPÚ5{éqºmVµÞ ´v}¤Ÿ›ƒCÐ2` ÏáÏ6ÞˆÓ«ÞÚ”à¶ÔíCª¨Íçÿ=_=Ì?S×¹±---y3¹±­îž³ñÊ…]>C3ÕN•²;ö¥~ج§­pØS%Öñ48.åÚnUÌÿµ§Æ¹tQ?ã»6^uŸ;€{¾jsQ;ò]‰o8Àa೜MJ)­Âq¬ÆA~IEND®B`‚libqalculate-2.8.2/docs/reference/html/classIntegerArgument-members.html0000644000175000017500000004150513401033110023373 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
IntegerArgument Member List

This is the complete list of members for IntegerArgument, including all inherited members.

alerts() constArgument
Argument(string name_="", bool does_test=true, bool does_error=true)Argument
Argument(const Argument *arg)Argument
b_error (defined in Argument)Argumentprotected
b_handle_vector (defined in Argument)Argumentprotected
b_last (defined in Argument)Argumentprotected
b_matrix (defined in Argument)Argumentprotected
b_rational (defined in Argument)Argumentprotected
b_test (defined in Argument)Argumentprotected
b_text (defined in Argument)Argumentprotected
b_zero (defined in Argument)Argumentprotected
copy() constIntegerArgumentvirtual
getCustomCondition() constArgument
handlesVector() const (defined in Argument)Argument
i_inttype (defined in IntegerArgument)IntegerArgumentprotected
imax (defined in IntegerArgument)IntegerArgumentprotected
imin (defined in IntegerArgument)IntegerArgumentprotected
IntegerArgument(string name_="", ArgumentMinMaxPreDefinition minmax=ARGUMENT_MIN_MAX_NONE, bool does_test=true, bool does_error=true, IntegerType integer_type=INTEGER_TYPE_NONE) (defined in IntegerArgument)IntegerArgument
IntegerArgument(const IntegerArgument *arg) (defined in IntegerArgument)IntegerArgument
integerType() const (defined in IntegerArgument)IntegerArgument
isLastArgument() const (defined in Argument)Argument
matrixAllowed() const (defined in Argument)Argument
max() const (defined in IntegerArgument)IntegerArgument
min() const (defined in IntegerArgument)IntegerArgument
name() constArgument
parse(const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
parse(MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) constArgumentvirtual
print() constIntegerArgumentvirtual
printlong() constArgument
rationalPolynomial() constArgument
scondition (defined in Argument)Argumentprotected
set(const Argument *arg)IntegerArgumentvirtual
setAlerts(bool does_error) (defined in Argument)Argument
setCustomCondition(string condition)Argument
setHandleVector(bool handle_vector) (defined in Argument)Argument
setIntegerType(IntegerType integer_type) (defined in IntegerArgument)IntegerArgument
setIsLastArgument(bool is_last) (defined in Argument)Argument
setMatrixAllowed(bool allow_matrix) (defined in Argument)Argument
setMax(const Number *nmax) (defined in IntegerArgument)IntegerArgument
setMin(const Number *nmin) (defined in IntegerArgument)IntegerArgument
setName(string name_)Argument
setRationalPolynomial(bool rational_polynomial) (defined in Argument)Argument
setTests(bool does_error) (defined in Argument)Argument
setZeroForbidden(bool forbid_zero)Argument
sname (defined in Argument)Argumentprotected
subprintlong() constIntegerArgumentprotectedvirtual
subtest(MathStructure &value, const EvaluationOptions &eo) constIntegerArgumentprotectedvirtual
suggestsQuotes() const (defined in Argument)Argumentvirtual
test(MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) constArgument
tests() constArgument
type() constIntegerArgumentvirtual
zeroForbidden() constArgument
~Argument()Argumentvirtual
~IntegerArgument() (defined in IntegerArgument)IntegerArgumentvirtual
libqalculate-2.8.2/docs/reference/html/nav_h.png0000644000175000017500000000014213401033110016520 00000000000000‰PNG  IHDR ,é@)IDATxíÝA @BQ­³šÛ›Ð¢Žáà) )ëý éaÅèÜ¿Æo‡RlÐßIEND®B`‚libqalculate-2.8.2/docs/reference/html/classArgument.html0000644000175000017500000015327013401033110020430 00000000000000 libqalculate-2.8.2: Argument Class Reference
libqalculate-2.8.2

A mathematical function argument definition with free value and base class for all argument definitions. More...

#include <Function.h>

Inheritance diagram for Argument:
AngleArgument ArgumentSet BooleanArgument DataObjectArgument DataPropertyArgument DateArgument ExpressionItemArgument FileArgument FunctionArgument IntegerArgument MatrixArgument NumberArgument SymbolicArgument TextArgument UnitArgument VariableArgument VectorArgument

Public Member Functions

 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
virtual Argumentcopy () const
 
virtual string print () const
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 
virtual int type () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Protected Attributes

string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A mathematical function argument definition with free value and base class for all argument definitions.

Free arguments accepts any value.

Constructor & Destructor Documentation

◆ Argument() [1/2]

Argument::Argument ( string  name_ = "",
bool  does_test = true,
bool  does_error = true 
)

Creates a new argument definition.

Parameters
nameName/title of the argument definition.
does_testIf argument values will be tested.
does_errorIf an error will issued if the value tests false.

◆ Argument() [2/2]

Argument::Argument ( const Argument arg)

Creates a copy of an argument definition.

Parameters
argArgument to copy.

◆ ~Argument()

virtual Argument::~Argument ( )
virtual

Destructor

Member Function Documentation

◆ alerts()

bool Argument::alerts ( ) const

If an error message will be presented to the user if the value for the argument is not allowed.

Returns
true if error messages will be shown.

◆ copy()

◆ getCustomCondition()

string Argument::getCustomCondition ( ) const

Returns the custom condition expression set for argument values.

Returns
Custom condition for argument values.

◆ name()

string Argument::name ( ) const

Returns the name/title of the argument definition.

Returns
Name/title.

◆ parse() [1/2]

virtual MathStructure Argument::parse ( const string &  str,
const ParseOptions po = default_parse_options 
) const
virtual

Parses an expression for an argument value. The default behavior is to use Calculator::parse() directly.

Parameters
strExpression.
poParse options.
Returns
A new mathematical structure with the parsed expression.

◆ parse() [2/2]

virtual void Argument::parse ( MathStructure mstruct,
const string &  str,
const ParseOptions po = default_parse_options 
) const
virtual

Parses an expression for an argument value. The default behavior is to use Calculator::parse() directly.

Parameters
mstructMathematical structure to set with the parsed expression.
strExpression.
poParse options.

Reimplemented in AngleArgument, and DateArgument.

◆ print()

virtual string Argument::print ( ) const
virtual

◆ printlong()

string Argument::printlong ( ) const

Resturns a long description of the argument definition. Ex. "A real number > 2".

Returns
Long description.

◆ rationalPolynomial()

bool Argument::rationalPolynomial ( ) const

If only rational polynomials are allowed as argument value.

See also
MathStructure::isRationalPolynomial()
Returns
true if only rational polynomials is allowed.

◆ set()

virtual void Argument::set ( const Argument arg)
virtual

Sets the argument to a copy of an argument definition.

Parameters
argArgument to copy.

Reimplemented in IntegerArgument, and NumberArgument.

◆ setCustomCondition()

void Argument::setCustomCondition ( string  condition)

Sets a custom condition for argument values. '' is replaced by the argument value in the expression.

Parameters
conditionCondition expression.

◆ setName()

void Argument::setName ( string  name_)

Sets the name/title of the argument definition.

Parameters
name_New name/title.

◆ setZeroForbidden()

void Argument::setZeroForbidden ( bool  forbid_zero)

Sets if a value of zero is forbidden for the argument value.

Parameters
forbid_zeroIf zero shall be forbidden.

◆ subprintlong()

virtual string Argument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented in ArgumentSet, FileArgument, VariableArgument, AngleArgument, UnitArgument, BooleanArgument, FunctionArgument, ExpressionItemArgument, MatrixArgument, VectorArgument, DateArgument, TextArgument, SymbolicArgument, IntegerArgument, NumberArgument, DataObjectArgument, and DataPropertyArgument.

◆ subtest()

virtual bool Argument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented in ArgumentSet, FileArgument, VariableArgument, AngleArgument, UnitArgument, BooleanArgument, FunctionArgument, ExpressionItemArgument, MatrixArgument, VectorArgument, DateArgument, TextArgument, SymbolicArgument, IntegerArgument, NumberArgument, DataObjectArgument, and DataPropertyArgument.

◆ test()

bool Argument::test ( MathStructure value,
int  index,
MathFunction f,
const EvaluationOptions eo = default_evaluation_options 
) const

Tests if a value fulfils the requirements of the argument definition. The value might change if it has not been fully evaluated.

Parameters
valueValue to test.
fMathematical function that the value is an argument for.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

◆ tests()

bool Argument::tests ( ) const

If the value for the argument will be tested. If not, the argument only works as an suggestion and any value is allowed.

Returns
true if the argument value will be tested.

◆ type()

virtual int Argument::type ( ) const
virtual

◆ zeroForbidden()

bool Argument::zeroForbidden ( ) const

If an argument value of zero is forbidden.

Returns
true if zero argument value is forbidden.

The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classAngleArgument.html0000644000175000017500000007673613401033110021412 00000000000000 libqalculate-2.8.2: AngleArgument Class Reference
libqalculate-2.8.2
Inheritance diagram for AngleArgument:
Argument

Public Member Functions

 AngleArgument (string name_="", bool does_test=true, bool does_error=true)
 
 AngleArgument (const AngleArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Member Function Documentation

◆ copy()

virtual Argument* AngleArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ parse()

virtual void AngleArgument::parse ( MathStructure mstruct,
const string &  str,
const ParseOptions po = default_parse_options 
) const
virtual

Parses an expression for an argument value. The default behavior is to use Calculator::parse() directly.

Parameters
mstructMathematical structure to set with the parsed expression.
strExpression.
poParse options.

Reimplemented from Argument.

◆ print()

virtual string AngleArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string AngleArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool AngleArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int AngleArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/tab_h.png0000644000175000017500000000026113401033110016504 00000000000000‰PNG  IHDR$ÇÇ[xIDATxíÝMÁ@†áž~¥ÜÆÎ’Evˆ¿"!•²‘d*×rGq=Š{¼ßSݧçë­ÓÉHÇ uO^õø[À_‡¢ãXvyËþÒ±=·VCffææ{°öŠó´Rçœ%_õçÿŽ¢ö·°Çrug¶(?gh\i>|sIEND®B`‚libqalculate-2.8.2/docs/reference/html/classFileArgument.html0000644000175000017500000007305013401033110021225 00000000000000 libqalculate-2.8.2: FileArgument Class Reference
libqalculate-2.8.2
Inheritance diagram for FileArgument:
Argument

Public Member Functions

 FileArgument (string name_="", bool does_test=true, bool does_error=true)
 
 FileArgument (const FileArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Member Function Documentation

◆ copy()

virtual Argument* FileArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string FileArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string FileArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool FileArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int FileArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classPrefix.png0000644000175000017500000000144513401033110017717 00000000000000‰PNG  IHDR"PŠýˆúPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2´IDATxíí’ê ›CUÞÿ‘¯F“€ Þ2V­9[´®(3L‡¿§“RJçðœV‰„X@ˆ„X@ÈE5o¦[ÏHùWQÔøÅhéWS4/œyE=^šò€¢]NÑìef{‹%\í,zz)ÍÖz\im+é¹É¬¨«¨ú×­£h]E>®[Š—™|+±"€+±"€+±"€+ù!E)¥t ×c0=¬ bšì ÀŠ"n†ì `A!VbE!VbE!VbE!VbE!\Ñ4MÓOpßxÂ<‡„X@ˆ„X@ˆ„X@ˆ„X@ˆ„X@ˆ„X@ˆ„\SQÎ93åœó(?“#KÒ”Ó—¤3øN+’¤+’¤+’¤+’¤JQºÿÝß%©Çò#I[»õìúöÓom¦»u åiäBJªÚX)µ¢N(I[ký¨9¦3ý£ø«¢‘<­Çð†¢¡RšŠæö̵¤|¸-§>÷Ìß?^^3FOx »,ÚG¬—®<­Åø2r§¢ãRºŠSKIEÎvß6àXÑ~Ø\À>ÒQžEkävEÇ¥ô΢âHZƒ¾œe_‘êMEåŒêÏ#yš9*ÏE˜‘Rúm‹²_n˜â Œ+Ú†íªZ¾ÊÓα_媪*(å@Ql]Ãõêª Žo´jtûÙçùEû¨¥|@Ñv×ûE™¤²õµòôr¼¨³h¸”£³èޱηvP_@CŠ–½ß¸ÑŠVÜoGyâ[SIe{¹ÑFK©IRDyÒHRÌ~ú’ôY¾“c<ô{†®¨èMC—\E’ôV$I!V$I!V$I!V$I!?¤(çœO¡˜~Î9ŸÂ7rü3}:¶Ac\$IEND®B`‚libqalculate-2.8.2/docs/reference/html/annotated.html0000644000175000017500000004530613401033110017575 00000000000000 libqalculate-2.8.2: Class List
libqalculate-2.8.2
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
 CAliasUnitAn unit with relation to another unit
 CAliasUnit_CompositeA subunit in a CompositeUnit
 CAngleArgument
 CArgumentA mathematical function argument definition with free value and base class for all argument definitions
 CArgumentSetA set of accepted arguments
 CAssumptionsAn assumption about an unknown mathematical value
 CBinaryPrefixA binary prefix
 CBooleanArgumentA boolean argument
 CCalculatorThe almighty calculator class
 CCalculatorMessageA message with information to the user. Primarily used for errors and warnings
 CCompositeUnitA unit consisting of a number of other units
 CDataObjectA a data set object
 CDataObjectArgumentData object function argument
 CDataPropertyA data set property
 CDataPropertyArgumentData property function argument
 CDataSetA data set
 CDateArgumentA date argument
 CDecimalPrefixA decimal (metric) prefix
 CDynamicVariableAbstract base class for variables with a value which is recalculated when the precision has changed
 CElement
 CEvaluationOptionsOptions for calculation
 CExpressionItemAbstract base class for functions, variables and units
 CExpressionItemArgumentArgument for functions, variables and units
 CExpressionNameA name for an expression item (function, variable or unit)
 CFileArgument
 CFunctionArgumentA function argument
 CIntegerArgumentA definition for integer arguments
 CInternalPrintStruct
 CKnownVariableA variable with a known value
 CMathFunctionAbstract base class for mathematical functions
 CMathStructureA structure representing a mathematical value/expression/result
 CMatrixArgumentA matrix argument
 CNowVariable
 CNumberA number
 CNumberArgumentA definition for numerical arguments
 CNumberPrefixA prefix with a free numerical value
 CParseOptionsOptions for parsing expressions
 CPlotDataParametersParameters for plot data series
 CPlotParametersParameters passed to plotting functions
 CPrecisionVariableDynamic variable for Pi
 CPrefixAbstract class for prefixes
 CPrintOptionsOptions for formatting and display of mathematical structures/results
 CQalculateDateTime
 CSortOptionsOptions for ordering the parts of a mathematical expression/result before display
 CSymbolicArgumentA symbolic argument
 CTextArgumentA text argument
 CThread
 CTodayVariable
 CTomorrowVariable
 CUnitA unit for measurement
 CUnitArgument
 CUnknownVariableA variable with unknown value
 CUserFunctionA user defined mathematical function
 CVariableAbstract base class for variables
 CVariableArgument
 CVectorArgumentA vector argument
 CYesterdayVariable
libqalculate-2.8.2/docs/reference/html/classDataSet.html0000644000175000017500000024672713401033110020205 00000000000000 libqalculate-2.8.2: DataSet Class Reference
libqalculate-2.8.2

A data set. More...

#include <DataSet.h>

Inheritance diagram for DataSet:
MathFunction ExpressionItem

Public Member Functions

 DataSet (string s_category="", string s_name="", string s_default_file="", string s_title="", string s_description="", bool is_local=true)
 
 DataSet (const DataSet *o)
 
ExpressionItemcopy () const
 
void set (const ExpressionItem *item)
 
int subtype () const
 
void setCopyright (string s_copyright)
 
const string & copyright () const
 
void setDefaultDataFile (string s_file)
 
const string & defaultDataFile () const
 
void setDefaultProperty (string property)
 
const string & defaultProperty () const
 
virtual int calculate (MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo)
 
bool loadObjects (const char *file_name=NULL, bool is_user_defs=true)
 
int saveObjects (const char *file_name=NULL, bool save_global=false)
 
bool objectsLoaded () const
 
void setObjectsLoaded (bool objects_loaded)
 
void addProperty (DataProperty *dp)
 
void delProperty (DataProperty *dp)
 
void delProperty (DataPropertyIter *it)
 
DataPropertygetPrimaryKeyProperty ()
 
DataPropertygetProperty (string property)
 
DataPropertygetFirstProperty (DataPropertyIter *it)
 
DataPropertygetNextProperty (DataPropertyIter *it)
 
const string & getFirstPropertyName (DataPropertyIter *it)
 
const string & getNextPropertyName (DataPropertyIter *it)
 
void addObject (DataObject *o)
 
void delObject (DataObject *o)
 
void delObject (DataObjectIter *it)
 
DataObjectgetObject (string object)
 
DataObjectgetObject (const MathStructure &object)
 
DataObjectgetFirstObject (DataObjectIter *it)
 
DataObjectgetNextObject (DataObjectIter *it)
 
const MathStructuregetObjectProperyStruct (string property, string object)
 
const string & getObjectProperty (string property, string object)
 
string getObjectPropertyInputString (string property, string object)
 
string getObjectPropertyDisplayString (string property, string object)
 
string printProperties (string object)
 
string printProperties (DataObject *o)
 
- Public Member Functions inherited from MathFunction
 MathFunction (string name_, int argc_, int max_argc_=0, string cat_="", string title_="", string descr_="", bool is_active=true)
 
 MathFunction (const MathFunction *function)
 
virtual int type () const
 
string example (bool raw_format=false, string name_string="") const
 
void setExample (string new_example)
 
bool testArgumentCount (int itmp)
 
virtual MathStructure calculate (const string &eq, const EvaluationOptions &eo=default_evaluation_options)
 
virtual MathStructure parse (const string &eq, const ParseOptions &po=default_parse_options)
 
virtual int parse (MathStructure &mstruct, const string &eq, const ParseOptions &po=default_parse_options)
 
virtual MathStructure calculate (MathStructure &vargs, const EvaluationOptions &eo=default_evaluation_options)
 
string condition () const
 
string printCondition ()
 
void setCondition (string expression)
 
bool testCondition (const MathStructure &vargs)
 
int args () const
 
int minargs () const
 
int maxargs () const
 
int args (const string &str, MathStructure &vargs, const ParseOptions &po=default_parse_options)
 
size_t lastArgumentDefinitionIndex () const
 
ArgumentgetArgumentDefinition (size_t index)
 
void clearArgumentDefinitions ()
 
void setArgumentDefinition (size_t index, Argument *argdef)
 
int stringArgs (const string &str, vector< string > &svargs)
 
void setDefaultValue (size_t arg_, string value_)
 
const string & getDefaultValue (size_t arg_) const
 
void appendDefaultValues (MathStructure &vargs)
 
MathStructure produceVector (const MathStructure &vargs, int begin=-1, int end=-1)
 
MathStructure produceArgumentsVector (const MathStructure &vargs, int begin=-1, int end=-1)
 
virtual bool representsPositive (const MathStructure &, bool=false) const
 
virtual bool representsNegative (const MathStructure &, bool=false) const
 
virtual bool representsNonNegative (const MathStructure &, bool=false) const
 
virtual bool representsNonPositive (const MathStructure &, bool=false) const
 
virtual bool representsInteger (const MathStructure &, bool=false) const
 
virtual bool representsNumber (const MathStructure &, bool=false) const
 
virtual bool representsRational (const MathStructure &, bool=false) const
 
virtual bool representsNonComplex (const MathStructure &, bool=false) const
 
virtual bool representsReal (const MathStructure &, bool=false) const
 
virtual bool representsComplex (const MathStructure &, bool=false) const
 
virtual bool representsNonZero (const MathStructure &, bool=false) const
 
virtual bool representsEven (const MathStructure &, bool=false) const
 
virtual bool representsOdd (const MathStructure &, bool=false) const
 
virtual bool representsUndefined (const MathStructure &) const
 
virtual bool representsBoolean (const MathStructure &) const
 
virtual bool representsNonMatrix (const MathStructure &) const
 
virtual bool representsScalar (const MathStructure &) const
 
- Public Member Functions inherited from ExpressionItem
 ExpressionItem (string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true)
 
virtual bool destroy ()
 
bool isRegistered () const
 
void setRegistered (bool is_registered)
 For internal use.
 
virtual const string & name (bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & referenceName () const
 
virtual const ExpressionNamepreferredName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredInputName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamepreferredDisplayName (bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const ExpressionNamegetName (size_t index) const
 
virtual void setName (const ExpressionName &ename, size_t index=1, bool force=true)
 
virtual void setName (string sname, size_t index, bool force=true)
 
virtual void addName (const ExpressionName &ename, size_t index=0, bool force=true)
 
virtual void addName (string sname, size_t index=0, bool force=true)
 
virtual size_t countNames () const
 
virtual void clearNames ()
 
virtual void clearNonReferenceNames ()
 
virtual void removeName (size_t index)
 
virtual size_t hasName (const string &sname, bool case_sensitive=true) const
 
virtual size_t hasNameCaseSensitive (const string &sname) const
 
virtual const ExpressionNamefindName (int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual const string & title (bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual void setTitle (string title_)
 
virtual const string & description () const
 
virtual void setDescription (string descr_)
 
virtual const string & category () const
 
virtual void setCategory (string cat_)
 
virtual bool hasChanged () const
 
virtual void setChanged (bool has_changed)
 
virtual bool isLocal () const
 
virtual bool setLocal (bool is_local=true, int will_be_active=-1)
 
virtual bool isBuiltin () const
 
virtual bool isApproximate () const
 
virtual void setApproximate (bool is_approx=true)
 
virtual int precision () const
 
virtual void setPrecision (int prec)
 
virtual bool isActive () const
 
virtual void setActive (bool is_active)
 
virtual bool isHidden () const
 
virtual void setHidden (bool is_hidden)
 
virtual int refcount () const
 
virtual void ref ()
 
virtual void unref ()
 
virtual void ref (ExpressionItem *o)
 
virtual void unref (ExpressionItem *o)
 
virtual ExpressionItemgetReferencer (size_t index=1) const
 
virtual bool changeReference (ExpressionItem *o_from, ExpressionItem *o_to)
 

Protected Attributes

string sfile
 
string scopyright
 
bool b_loaded
 
vector< DataProperty * > properties
 
vector< DataObject * > objects
 
- Protected Attributes inherited from MathFunction
MathFunction_p * priv
 
int argc
 
int max_argc
 
vector< string > default_values
 
size_t last_argdef_index
 
string scondition
 
string sexample
 
- Protected Attributes inherited from ExpressionItem
string scat
 
string stitle
 
string sdescr
 
bool b_local
 
bool b_changed
 
bool b_builtin
 
bool b_approx
 
bool b_active
 
bool b_registered
 
bool b_hidden
 
bool b_destroyed
 
int i_ref
 
int i_precision
 
vector< ExpressionItem * > v_refs
 
vector< ExpressionNamenames
 

Additional Inherited Members

- Protected Member Functions inherited from MathFunction
bool testArguments (MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromVArgs (const MathStructure &vargs)
 
virtual MathStructure createFunctionMathStructureFromSVArgs (vector< string > &svargs)
 

Detailed Description

A data set.

This is a simple database class for storage of many grouped values, when ordinary variables is not practical.

A data set consists of properties and objects, with values for the properties. Qalculate! includes for example a "Planets" data set with properties such as name, mass, speed and density, and an object for each planet in solar system.

A data set is also mathemtical function, dataset(object, property), which retrieves values for objects and properties. Data sets can be saved and loaded from a XML file.

Member Function Documentation

◆ calculate()

virtual int DataSet::calculate ( MathStructure mstruct,
const MathStructure vargs,
const EvaluationOptions eo 
)
virtual

The main function for subclasses to reimplement. Calculates a value from arguments in vargs and puts it in mstruct.

This function expects the number of arguments to be equal to the maximum number of arguments, and checked by the argument definitions.

If the return value is negative, then argument -(return value) has been evaluated in mstruct. If -(return value) is greater than max arguments, then mstruct is a vector of evaluated argument values.

Parameters
[out]mstructStructure that is set with the result of the calculation.
vargsArguments passed to the mathematical function.
eoEvaluation options.
Returns
1 if the calculation was successful.

Reimplemented from MathFunction.

◆ subtype()

int DataSet::subtype ( ) const
virtual

Returns the subtype of the mathematical function, corresponding to which subsubclass the object belongs to.

Returns
FunctionSubtype.

Reimplemented from MathFunction.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classUnit.png0000644000175000017500000000224313401033110017376 00000000000000‰PNG  IHDRÀÑ-=PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT22IDATxíÝí’ª0DÑÎNïÿÈw$|œŽ N¸íœVd“EþJÒÇÉ9çó"IM$œ3˜Á @,3\‚!õ/€Y÷³cß¹Í3¼»1ôéñ7m=J/Ó{Ÿakú˜Ž,'¬s•ÑPzÐ÷ièôÐï‹ .÷= `•ˬ óí®Sº5½‡½+†_&ÉeÖ†5Cô™þ½ÉP޼Cu_§Äc–wžÄ\õu.¶D®),ê–“¢ŒèÕ“bz&<{RT«j˜2×dB=yÜ|3˜áª 3˜Á @,3´ÆsΧE’îN’3ô Ì0+ØÁ ^"%…2ƒÌ )–Ì`I±Ì`3HŠe3˜AR,3˜Á ’b™Á fË f0ƒ¤Xf0ƒ$ź CJ)Ij"§¶Ä f0ƒ¤Xf¸CÒ|æÏÖ{ºÃÛº CRÿè|¼I:=Ÿ1”éð¿OŠ2Ì`3˜a<«<Ãÿø¤¤oÄ f0ƒ¤Xf0ƒ$Å2Ck )¥tZ$éé$É1C¯ÐÙÁ ³‚Ìà%RR(3˜Á ’b™Á fË f¸C×u]‘¤óÒÊ4ƒÌ )–Ì`I±Ì`3HŠe3˜AR,3˜á{íÈ9çÒåœóûi¦à¬D€³b3˜ˆe†Ã i|/‹Ì;7ŽØÊ.†ôóØ‘ê§4ëCZ^÷Ùïm°Ê†g¿ °‘§ ¿]å-†Ççp‡ú÷yÿðu÷íÛÁº5^}hAùµEKúoã‘»›µŸa¼piDµ5ý^½àEŽ0Œ?Ù÷ªú5Ë:جwªÉV’?gØèllÉÃëf`VªyR”F¦–”91Œ€¯3,´§Þdb}‘R¨ƒƒôC†ÅÚð ÛW?´6üC¿êm™gH–¯³‡a¼ú¼þµõ¤(:G›uà ðíìbØÈÞð*f0Ã-¾3˜Á @,3Œ 9ç|ZCÎ9ŸIú$$9fè:;˜aV°ƒ¼DJ e3˜AR,3˜Á ’b™Á fË f0ƒ¤Xf0ƒ$Å2ƒÌ )–Ì`I±Ì`3HŠu†œsþ ]Î9¿Ij"ଘÁ fb™¡Y†4¾—ùÕŸw.ŽH?/€Y]»A†´ìî3†ú˳“6r!†Ççp‹û÷yÿð5Üÿ0HÆ(/.Ô›OoaìoéEµ51Ô{j†ñŒ¾ûÕÁ$–5žÖ:C5“«QòŠa Y]¨y†a©›'EùøÃt¡2'ÆYÑÃâvÍw,NŠ …jv‰ÜfX¬  Ûÿ¼ìÚ°š¼óB7Ï0®ƒÃô,XtyëIQt~R|3 `;—gè×¹8(€ªþ€_c€}1ƒÌÄ2Ck 9ç|Z$©…ü†hÏ+'¾IEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_func_v.html0000644000175000017500000000447313401033110021170 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- v -

libqalculate-2.8.2/docs/reference/html/classVectorArgument.png0000644000175000017500000000077613401033110021435 00000000000000‰PNG  IHDRhPÂëÀSPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2IDATxíÿŽÂ g?ßÿ‘OùYJ¯z’‹ÁdºaÊVÿÅ9çf€“¤Ï³D’4Ä™$uðûøs‘õšîŠ|´p érûÙº^!´%©áT“zGTe‘Ï\Ýgµ$5¼)*”PR×A’ZÎE¯Ï•(Œ¹%Jçs¹£ú[IjéÕGõw®ÅÃ/5ÒǪËk¤–¾_†Þ÷wH”w&Iýtìèäm”¤ Öß„$ ñ•"眛@7€Ì=“L³DOÏÓ4ÑVÝŒ±DC,ÀK0Ä ±DC,ÀKä?ff3À>Ï 1_Bcm—Ñ»°œ¿SÔýö"}ûUó)”Kš&øÞŽ83·ã„ç}™| ÊÓRÈÛ!IÉZ‰Ëô+Q¥Œù÷ýšªûCQj†ß‹_EáÛsQÉp*Ú!`TíèàÑ”"ª²œÑ‘¨>ª÷]îÚTݶpZQ<üR)ý¶nšªàÝé·DeçÜÛQz.XC|¥ÈÌl? QÕÆ‚VIEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_u.html0000644000175000017500000001074413401033110020152 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- u -

libqalculate-2.8.2/docs/reference/html/classTodayVariable.png0000644000175000017500000000217613401033110021212 00000000000000‰PNG  IHDRmøј”PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2 IDATxíë’³*E›*ßÿ‘O¢ÈU“ô0§òõ„%`'ó—cœQ’&á6I²àOmaý“¤ që¹½M’ÞæMÛZ…ç'·žÛÞvŸ¯+©•«¹M’T•“½mëÔôìôø u¥ ìÇžER)gï­,¾e›¯Õè`;8Ù³÷6ÚêeäÛ‡¶-ò[³ÊLÓïCA¥´w³d4©+Ÿœäv CNæì;ËÉ&±ªs¾´IªÊgß>Iêøgm’dŠÛ$É‚é¶cœÀ,Ó˜j[–™º©¶‡l¢n®í«sÒm&¸ À·Xà6 Ü`Û,p€nh‰1Æi%in“$ þg¶P]»ÁªÕÝ—¤#Þ³ ^+Ûú õa!lÕúÙ»öîKÒ÷må¡kº¥—W%I'¼°·Îšl¹²±¥ƒ[OªÝcÚ×nK÷%éŒû¶îD‡êN¢Üù¾•´<°¿·ò–O®žºu­sR’¬p›$Yà6I²`º-Ægð À4¦Ú–e¦nªí!›¨›kûêœt€ n°Àm¸ À·Xà6 Ü`ÛZbŒqDIš„Û$É‚¿´…|‘¤3¶€.¬tSëè1£íGÙ±mðÞ²¥í…­~Vûƒûp>†½ÿüìÝUÎmiÝ›dwäV㮨ëÞpT-­eŸ—«vvý”®ßϺ´U‰ra«Î ZîV³Òý²¤·¥ÓÛÎÂëÕI*åøÐÎSêëíö{«r¥Ê©3Ûz¿^ÕÚ½“’ô›¸M’,p›$Y0ÝcŒ³xƒ`SmË2S7ÕöMÔ͵}uNº À·Xà6 Ü`Û,p€n°Àm-1Æ8 ¢$MÂm’dÁÙÂóO’®)![«›ÒßîîÛÁ\I:åÐ6x¯lÏë³±VÛV·?zùNÊÝÒ_£ÊŒ.þÒ¶5KïYê!©¥ŸÑÅ_ï­> Õ%ÏèÛÍŒ›¶vÅÍ*+[:¸=dœ±Ç—ümûé,ñØÖèÑÄ‹œ¼c«òÄvýÞÊ~Û¯ÙÑNm÷aÆUN~E%É’ÛïÉl¿(óÿ8’d—ÛbŒqo°LcªmYfê¦Ú²‰º¹¶¯ÎI·˜à6 Ü`Û,p€n°Àm¸  %„¦A˜„Û,øSÛž:MP—m .ÝÔ:Üĸ·ŸúǶ!þ%[Ú`ú†l½ž”ž²G•àö”Nm)þY¶*õ0’"STîåUÝ·U'3ìmì7K{×¶eN(“RB QùXú£¼e+llÝ^‡jL”WÞ[ .iy`{ý½ädÿ¶Êp‚ëç…œ8ãÓß—lÿȽbûüÕÿãXðå¶B˜Åg¼XËÆYn­IEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_h.html0000644000175000017500000000613513401033110020134 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- h -

libqalculate-2.8.2/docs/reference/html/classSymbolicArgument.html0000644000175000017500000007371513401033110022137 00000000000000 libqalculate-2.8.2: SymbolicArgument Class Reference
libqalculate-2.8.2

A symbolic argument. More...

#include <Function.h>

Inheritance diagram for SymbolicArgument:
Argument

Public Member Functions

 SymbolicArgument (string name_="", bool does_test=true, bool does_error=true)
 
 SymbolicArgument (const SymbolicArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A symbolic argument.

Accepts variables and symbolic structures.

Member Function Documentation

◆ copy()

virtual Argument* SymbolicArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string SymbolicArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string SymbolicArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool SymbolicArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int SymbolicArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/functions_z.html0000644000175000017500000000417313401033110020156 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- z -

libqalculate-2.8.2/docs/reference/html/classVariable-members.html0000644000175000017500000007545013401033110022026 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
Variable Member List

This is the complete list of members for Variable, including all inherited members.

addName(const ExpressionName &ename, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
addName(string sname, size_t index=0, bool force=true) (defined in ExpressionItem)ExpressionItemvirtual
b_active (defined in ExpressionItem)ExpressionItemprotected
b_approx (defined in ExpressionItem)ExpressionItemprotected
b_builtin (defined in ExpressionItem)ExpressionItemprotected
b_changed (defined in ExpressionItem)ExpressionItemprotected
b_destroyed (defined in ExpressionItem)ExpressionItemprotected
b_hidden (defined in ExpressionItem)ExpressionItemprotected
b_local (defined in ExpressionItem)ExpressionItemprotected
b_registered (defined in ExpressionItem)ExpressionItemprotected
category() constExpressionItemvirtual
changeReference(ExpressionItem *o_from, ExpressionItem *o_to) (defined in ExpressionItem)ExpressionItemvirtual
clearNames()ExpressionItemvirtual
clearNonReferenceNames()ExpressionItemvirtual
copy() const =0 (defined in Variable)Variablepure virtual
countNames() const (defined in ExpressionItem)ExpressionItemvirtual
description() constExpressionItemvirtual
destroy() (defined in ExpressionItem)ExpressionItemvirtual
ExpressionItem(string cat_, string name_, string title_="", string descr_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in ExpressionItem)ExpressionItem
ExpressionItem() (defined in ExpressionItem)ExpressionItem
findName(int abbreviation=-1, int use_unicode=-1, int plural=-1, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
getName(size_t index) constExpressionItemvirtual
getReferencer(size_t index=1) const (defined in ExpressionItem)ExpressionItemvirtual
hasChanged() constExpressionItemvirtual
hasName(const string &sname, bool case_sensitive=true) constExpressionItemvirtual
hasNameCaseSensitive(const string &sname) constExpressionItemvirtual
i_precision (defined in ExpressionItem)ExpressionItemprotected
i_ref (defined in ExpressionItem)ExpressionItemprotected
isActive() constExpressionItemvirtual
isApproximate() constExpressionItemvirtual
isBuiltin() const (defined in ExpressionItem)ExpressionItemvirtual
isHidden() const (defined in ExpressionItem)ExpressionItemvirtual
isKnown() const =0Variablepure virtual
isLocal() const (defined in ExpressionItem)ExpressionItemvirtual
isRegistered() const (defined in ExpressionItem)ExpressionItem
name(bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const (defined in ExpressionItem)ExpressionItemvirtual
names (defined in ExpressionItem)ExpressionItemprotected
precision() constExpressionItemvirtual
preferredDisplayName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredInputName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
preferredName(bool abbreviation=false, bool use_unicode=false, bool plural=false, bool reference=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
ref() (defined in ExpressionItem)ExpressionItemvirtual
ref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
refcount() constExpressionItemvirtual
referenceName() const (defined in ExpressionItem)ExpressionItemvirtual
removeName(size_t index) (defined in ExpressionItem)ExpressionItemvirtual
representsBoolean() (defined in Variable)Variableinlinevirtual
representsComplex(bool=false) (defined in Variable)Variableinlinevirtual
representsEven(bool=false) (defined in Variable)Variableinlinevirtual
representsFraction(bool=false) (defined in Variable)Variableinlinevirtual
representsInteger(bool=false) (defined in Variable)Variableinlinevirtual
representsNegative(bool=false) (defined in Variable)Variableinlinevirtual
representsNonComplex(bool b=false) (defined in Variable)Variableinlinevirtual
representsNonInteger(bool=false) (defined in Variable)Variableinlinevirtual
representsNonMatrix() (defined in Variable)Variableinlinevirtual
representsNonNegative(bool=false) (defined in Variable)Variableinlinevirtual
representsNonPositive(bool=false) (defined in Variable)Variableinlinevirtual
representsNonZero(bool=false) (defined in Variable)Variableinlinevirtual
representsNumber(bool=false) (defined in Variable)Variableinlinevirtual
representsOdd(bool=false) (defined in Variable)Variableinlinevirtual
representsPositive(bool=false)Variableinlinevirtual
representsRational(bool=false) (defined in Variable)Variableinlinevirtual
representsReal(bool=false) (defined in Variable)Variableinlinevirtual
representsScalar() (defined in Variable)Variableinlinevirtual
representsUndefined(bool=false, bool=false, bool=false) (defined in Variable)Variableinlinevirtual
scat (defined in ExpressionItem)ExpressionItemprotected
sdescr (defined in ExpressionItem)ExpressionItemprotected
set(const ExpressionItem *item) (defined in Variable)Variablevirtual
setActive(bool is_active) (defined in ExpressionItem)ExpressionItemvirtual
setApproximate(bool is_approx=true) (defined in ExpressionItem)ExpressionItemvirtual
setCategory(string cat_)ExpressionItemvirtual
setChanged(bool has_changed) (defined in ExpressionItem)ExpressionItemvirtual
setDescription(string descr_)ExpressionItemvirtual
setHidden(bool is_hidden) (defined in ExpressionItem)ExpressionItemvirtual
setLocal(bool is_local=true, int will_be_active=-1) (defined in ExpressionItem)ExpressionItemvirtual
setName(const ExpressionName &ename, size_t index=1, bool force=true)ExpressionItemvirtual
setName(string sname, size_t index, bool force=true)ExpressionItemvirtual
setPrecision(int prec) (defined in ExpressionItem)ExpressionItemvirtual
setRegistered(bool is_registered)ExpressionItem
setTitle(string title_)ExpressionItemvirtual
stitle (defined in ExpressionItem)ExpressionItemprotected
subtype() constVariableinlinevirtual
title(bool return_name_if_no_title=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) constExpressionItemvirtual
type() constVariableinlinevirtual
unref() (defined in ExpressionItem)ExpressionItemvirtual
unref(ExpressionItem *o) (defined in ExpressionItem)ExpressionItemvirtual
v_refs (defined in ExpressionItem)ExpressionItemprotected
Variable(string cat_, string name_, string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true) (defined in Variable)Variable
Variable() (defined in Variable)Variable
Variable(const Variable *variable) (defined in Variable)Variable
~ExpressionItem() (defined in ExpressionItem)ExpressionItemvirtual
~Variable() (defined in Variable)Variablevirtual
libqalculate-2.8.2/docs/reference/html/functions_w.html0000644000175000017500000000410013401033110020141 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- w -

libqalculate-2.8.2/docs/reference/html/Function_8h.html0000644000175000017500000003561113401033110020002 00000000000000 libqalculate-2.8.2: libqalculate/Function.h File Reference
libqalculate-2.8.2
Function.h File Reference

Classes

class  MathFunction
 Abstract base class for mathematical functions. More...
 
class  UserFunction
 A user defined mathematical function. More...
 
class  Argument
 A mathematical function argument definition with free value and base class for all argument definitions. More...
 
class  NumberArgument
 A definition for numerical arguments. More...
 
class  IntegerArgument
 A definition for integer arguments. More...
 
class  SymbolicArgument
 A symbolic argument. More...
 
class  TextArgument
 A text argument. More...
 
class  DateArgument
 A date argument. More...
 
class  VectorArgument
 A vector argument. More...
 
class  MatrixArgument
 A matrix argument. More...
 
class  ExpressionItemArgument
 Argument for functions, variables and units. More...
 
class  FunctionArgument
 A function argument. More...
 
class  BooleanArgument
 A boolean argument. More...
 
class  UnitArgument
 
class  AngleArgument
 
class  VariableArgument
 
class  FileArgument
 
class  ArgumentSet
 A set of accepted arguments. More...
 

Enumerations

enum  ArgumentType {
  ARGUMENT_TYPE_FREE, ARGUMENT_TYPE_SYMBOLIC, ARGUMENT_TYPE_TEXT, ARGUMENT_TYPE_DATE,
  ARGUMENT_TYPE_FILE, ARGUMENT_TYPE_INTEGER, ARGUMENT_TYPE_NUMBER, ARGUMENT_TYPE_VECTOR,
  ARGUMENT_TYPE_MATRIX, ARGUMENT_TYPE_EXPRESSION_ITEM, ARGUMENT_TYPE_FUNCTION, ARGUMENT_TYPE_UNIT,
  ARGUMENT_TYPE_BOOLEAN, ARGUMENT_TYPE_VARIABLE, ARGUMENT_TYPE_ANGLE, ARGUMENT_TYPE_SET,
  ARGUMENT_TYPE_DATA_OBJECT, ARGUMENT_TYPE_DATA_PROPERTY
}
 Argument types.
 
enum  ArgumentMinMaxPreDefinition {
  ARGUMENT_MIN_MAX_NONE, ARGUMENT_MIN_MAX_POSITIVE, ARGUMENT_MIN_MAX_NONZERO, ARGUMENT_MIN_MAX_NONNEGATIVE,
  ARGUMENT_MIN_MAX_NEGATIVE
}
 Predefined max and min values for number and integer arguments.
 
enum  FunctionSubtype { SUBTYPE_FUNCTION, SUBTYPE_USER_FUNCTION, SUBTYPE_DATA_SET }
 Type of mathematical function. More...
 

Enumeration Type Documentation

◆ FunctionSubtype

Type of mathematical function.

Enumerator
SUBTYPE_FUNCTION 

class MathFunction

SUBTYPE_USER_FUNCTION 

class UseFunction

SUBTYPE_DATA_SET 

class DataSet

libqalculate-2.8.2/docs/reference/html/functions_func_r.html0000644000175000017500000000753313401033110021164 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- r -

libqalculate-2.8.2/docs/reference/html/structInternalPrintStruct.html0000644000175000017500000001611513401033110023057 00000000000000 libqalculate-2.8.2: InternalPrintStruct Struct Reference
libqalculate-2.8.2
InternalPrintStruct Struct Reference

Public Attributes

int depth
 
int power_depth
 
int division_depth
 
bool wrap
 
string * num
 
string * den
 
string * re
 
string * im
 
string * exp
 
bool * minus
 
bool * exp_minus
 
bool parent_approximate
 
int parent_precision
 
long int * iexp
 

The documentation for this struct was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classAliasUnit__Composite.png0000644000175000017500000000153513401033110022534 00000000000000‰PNG  IHDR~Àõ='¿PLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2ìIDATxíÙr­ E›*ÿÿ“ïQÀ!Ǩɾ©Ó‰K%M›¼’sÎ>È’ä"ô’dâ?Õ§áG’N°÷ê87÷P/I—yJ?©ÿk}`J|æûÀX›‹yd™$I[Þí¾ÌÖe£/I««¸îë/IÚðöì—íµ”åæ{Õ»ÑqoÏ~«¯ßk~¼«/#ïè›}ÌÔcÖ;UÒrµ$©ådêm_!I«ëÑà—Èm2Îñ£Ìo²µ:šïé%U×½¿’t@è%ÉDè%É„_ŸsÎ6îÐøðê»Îê÷ê_v§ß¬ÿðÌ=€‹Ð˜=€‰Ð˜=€‰Ð˜=€‰Ð\%çœ}%ÉEè%ÉÄßÔ§ù65—†$åýº!I§¸©OJ}µ/.ùïêKØ]Á/[ý'éûLÕ“þ73_’ž ô’d"ô’d¯Ï9gwè|xõ]gõ{õ/»ÓoÖxæ‡ÀEèL„ÀDèL„ÀDèL„ÀDè®’sÎ>È’ä"ô’dâéÓt/•Õƒ¥sg„$íñ }ZkŽôûƒ$iÃ%}_¦TZC}î›ãCIúšóúÉSôMmÖ·=’ô†«ú挛¨ü”¾ÿi‚_ŠßÑ×i¿˜ª8ô«³ÿ5ýÜc¶-'±Œx<ó%éqB/I&B/I&üúœs¶p‡À‡WßuV¿Wÿ²;ýfý‡g~è\„ÀDèL„ÀDèL„ÀDèL„à*)¥äƒà"ô&þ#}©½îë7Ú͸zÄÀïÙ¬]éÇêÎRÛþªq4 `‡ú¾·4Ü—þ±Yí· Êôp\  ^-4´–é‹~ò”ÙMmÖ·=­~š1h›Á$Ö×4íHßœT•wúíš…õc -Á/Å3úy¡û)ú³~õzËÖÁ¿¡‡T]›ÔÛׯÎ~G¿ÿðÛg¿9œ%–“¨â·ýîë³[>“õ't”ùOrjÝËúéÿ5À.?«ø³à-¡0á×§”’D;N#nfÆIEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_func_m.html0000644000175000017500000000456413401033110021160 00000000000000 libqalculate-2.8.2: Class Members - Functions
libqalculate-2.8.2
 

- m -

libqalculate-2.8.2/docs/reference/html/classExpressionItemArgument.html0000644000175000017500000007472213401033110023333 00000000000000 libqalculate-2.8.2: ExpressionItemArgument Class Reference
libqalculate-2.8.2
ExpressionItemArgument Class Reference

Argument for functions, variables and units. More...

#include <Function.h>

Inheritance diagram for ExpressionItemArgument:
Argument

Public Member Functions

 ExpressionItemArgument (string name_="", bool does_test=true, bool does_error=true)
 
 ExpressionItemArgument (const ExpressionItemArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

Argument for functions, variables and units.

Text string representing a function, variable or unit name.

Member Function Documentation

◆ copy()

virtual Argument* ExpressionItemArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string ExpressionItemArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string ExpressionItemArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool ExpressionItemArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int ExpressionItemArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/classDataProperty-members.html0000644000175000017500000004017213401033110022710 00000000000000 libqalculate-2.8.2: Member List
libqalculate-2.8.2
DataProperty Member List

This is the complete list of members for DataProperty, including all inherited members.

addName(string s_name, bool is_ref=false, size_t index=0) (defined in DataProperty)DataProperty
b_approximate (defined in DataProperty)DataPropertyprotected
b_brackets (defined in DataProperty)DataPropertyprotected
b_case (defined in DataProperty)DataPropertyprotected
b_hide (defined in DataProperty)DataPropertyprotected
b_key (defined in DataProperty)DataPropertyprotected
b_uchanged (defined in DataProperty)DataPropertyprotected
clearNames() (defined in DataProperty)DataProperty
countNames() const (defined in DataProperty)DataProperty
DataProperty(DataSet *parent_set, string s_name="", string s_title="", string s_description="")DataProperty
DataProperty(const DataProperty &dp) (defined in DataProperty)DataProperty
description() const (defined in DataProperty)DataProperty
generateStruct(const string &valuestr, int is_approximate=-1) (defined in DataProperty)DataProperty
getDisplayString(const string &valuestr) (defined in DataProperty)DataProperty
getInputString(const string &valuestr) (defined in DataProperty)DataProperty
getName(size_t index=1) const (defined in DataProperty)DataProperty
getReferenceName() const (defined in DataProperty)DataProperty
getUnitString() const (defined in DataProperty)DataProperty
getUnitStruct() (defined in DataProperty)DataProperty
hasName(const string &s_name) (defined in DataProperty)DataProperty
isApproximate() const (defined in DataProperty)DataProperty
isCaseSensitive() const (defined in DataProperty)DataProperty
isHidden() const (defined in DataProperty)DataProperty
isKey() const (defined in DataProperty)DataProperty
isUserModified() const (defined in DataProperty)DataProperty
m_unit (defined in DataProperty)DataPropertyprotected
name_is_ref (defined in DataProperty)DataPropertyprotected
nameIsReference(size_t index=1) const (defined in DataProperty)DataProperty
names (defined in DataProperty)DataPropertyprotected
parent (defined in DataProperty)DataPropertyprotected
parentSet() const (defined in DataProperty)DataProperty
propertyType() const (defined in DataProperty)DataProperty
ptype (defined in DataProperty)DataPropertyprotected
sdescr (defined in DataProperty)DataPropertyprotected
set(const DataProperty &dp) (defined in DataProperty)DataProperty
setApproximate(bool is_approximate=true) (defined in DataProperty)DataProperty
setCaseSensitive(bool is_case_sensitive=true) (defined in DataProperty)DataProperty
setDescription(string s_description) (defined in DataProperty)DataProperty
setHidden(bool is_hidden=true) (defined in DataProperty)DataProperty
setKey(bool is_key=true) (defined in DataProperty)DataProperty
setName(string s_name, bool is_ref=false) (defined in DataProperty)DataProperty
setNameIsReference(size_t index=1, bool is_ref=true) (defined in DataProperty)DataProperty
setPropertyType(PropertyType property_type) (defined in DataProperty)DataProperty
setTitle(string s_title) (defined in DataProperty)DataProperty
setUnit(string s_unit) (defined in DataProperty)DataProperty
setUserModified(bool user_modified=true) (defined in DataProperty)DataProperty
setUsesBrackets(bool uses_brackets=true) (defined in DataProperty)DataProperty
stitle (defined in DataProperty)DataPropertyprotected
sunit (defined in DataProperty)DataPropertyprotected
title(bool return_name_if_no_title=true) const (defined in DataProperty)DataProperty
usesBrackets() const (defined in DataProperty)DataProperty
libqalculate-2.8.2/docs/reference/html/classFileArgument.png0000644000175000017500000000071213401033110021040 00000000000000‰PNG  IHDRWP[æPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2YIDATxíëŽë „ǃÔ÷ämÀ\ÜpTa¢uÅÔ ˜ÏŽMò!„°A$y»œû?¸B’ :ûw¹² ^äF+é?í.×ïé4u˜tM²ŽW©ä s_"‘¬ãš[UM%YC²]îñq“Ï 7×v˜¯]%ÙŒ®-ó×u°\íSmW¦éy(!I6cê}[}Mf¸%o’œ×8ßΡ'Éü;ùXn!Ü/˜Õ 6h÷õÚÞÄ}c·€wqwœë\u8×¹Î+ç:÷ÏpED6·Ë¹¿ÄÕ.·&ÒjØŒ«]Ôòóü‹«ùÆÜ›õhÓ©ŒËyF5yD»ïƒ«{‹ÒžbrÇÑÖ÷‚[e¼Ì}—kóÍQÔ^rKÃ'¸íäGò½|íê°¾'®-ózJ[®ö©¶ëä«!¿8Ÿ³Þ+Üúp­¥|ó¡€ü;ùX®ˆÈýúÐfBf¾­IEND®B`‚libqalculate-2.8.2/docs/reference/html/globals_defs.html0000644000175000017500000000377613401033110020251 00000000000000 libqalculate-2.8.2: File Members
libqalculate-2.8.2
 
libqalculate-2.8.2/docs/reference/html/classPrefix.html0000644000175000017500000006336713401033110020112 00000000000000 libqalculate-2.8.2: Prefix Class Reference
libqalculate-2.8.2

Abstract class for prefixes. More...

#include <Prefix.h>

Inheritance diagram for Prefix:
BinaryPrefix DecimalPrefix NumberPrefix

Public Member Functions

 Prefix (string long_name, string short_name="", string unicode_name="")
 
const string & shortName (bool return_long_if_no_short=true, bool use_unicode=false) const
 
const string & longName (bool return_short_if_no_long=true, bool use_unicode=false) const
 
const string & unicodeName (bool return_short_if_no_uni=true) const
 
void setShortName (string short_name)
 
void setLongName (string long_name)
 
void setUnicodeName (string unicode_name)
 
const string & name (bool short_default=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const
 
virtual Number value (const Number &nexp) const =0
 
virtual Number value (int iexp) const =0
 
virtual Number value () const =0
 
virtual int type () const =0
 

Protected Attributes

string l_name
 
string s_name
 
string u_name
 

Detailed Description

Abstract class for prefixes.

A prefix is prepended to a unit to specificy a quantity multiplicator. A prefix has a numerical value which raised to the units power defines the quantity. In for example the expression "3 kilometers", meter is the unit, 3 is regular quantity, and kilo is a prefix with a value 1000, thus the example equals "3000 meters". If the unit instead had been squared, the value of the prefix would have been raised by two and the total quantity would have been 3.000.000.

Prefixes can have up to free different three names – a long name, a short name and a short unicode name. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed. The names or used to reference the prefix in mathematical expressions and to display a prefix in a result.

Constructor & Destructor Documentation

◆ Prefix()

Prefix::Prefix ( string  long_name,
string  short_name = "",
string  unicode_name = "" 
)

Create a prefix.

Parameters
long_nameLong name.
short_nameShort name.
unicode_nameUnicode name.

Member Function Documentation

◆ longName()

const string& Prefix::longName ( bool  return_short_if_no_long = true,
bool  use_unicode = false 
) const

Returns the long name of the prefix.

Parameters
return_short_if_no_longIf the short name shall be returned if the prefix has not got a long name (if it is empty).
use_unicodeIf a unicode version of the name is allowed and preferred.
Returns
The long name of the prefix.

◆ name()

const string& Prefix::name ( bool  short_default = true,
bool  use_unicode = false,
bool(*)(const char *, void *)  can_display_unicode_string_function = NULL,
void *  can_display_unicode_string_arg = NULL 
) const

Returns a preferred name of the prefix.

Parameters
short_defaultIf a short name is preferred.
use_unicodeIf a unicode name is preferred.
can_display_unicode_string_functionFunction that tests if the unicode characters in a name can be displayed. If the function returns false, the name will be rejected.
can_display_unicode_string_argArgument to pass to the above test function.
Returns
A preferred name.

◆ setLongName()

void Prefix::setLongName ( string  long_name)

Sets the long name of the prefix.

Parameters
long_nameThe new long name for the prefix.

◆ setShortName()

void Prefix::setShortName ( string  short_name)

Sets the short name of the prefix.

Parameters
short_nameThe new short name for the prefix.

◆ setUnicodeName()

void Prefix::setUnicodeName ( string  unicode_name)

Sets the unicode name of the prefix. The unicode name is an alternative to the short name that is preferred if unicode characters can be displayed.

Parameters
unicode_nameThe new unicode name for the prefix.

◆ shortName()

const string& Prefix::shortName ( bool  return_long_if_no_short = true,
bool  use_unicode = false 
) const

Returns the short name of the prefix.

Parameters
return_long_if_no_shortIf the long name shall be returned if the prefix has not got a short name (if it is empty).
use_unicodeIf a unicode version of the name is allowed and preferred.
Returns
The short name of the prefix.

◆ type()

virtual int Prefix::type ( ) const
pure virtual

Returns type, subclass, of the prefix. This can be PREFIX_DECIMAL for prefixes of the class DecimalPrefix, PREFIX_BINARY for BinaryPrefix, or PREFIX_NUMBER for NumberPrefix.

Returns
The type of the prefix.

Implemented in NumberPrefix, BinaryPrefix, and DecimalPrefix.

◆ unicodeName()

const string& Prefix::unicodeName ( bool  return_short_if_no_uni = true) const

Returns the unicode name of the prefix.

Parameters
return_short_if_no_uniIf the short name shall be returned if the prefix has not got a unicode name (if it is empty).
Returns
The unicode name of the prefix.

◆ value() [1/3]

virtual Number Prefix::value ( const Number nexp) const
pure virtual

Returns the value of the prefix.

Parameters
nexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implemented in NumberPrefix, BinaryPrefix, and DecimalPrefix.

◆ value() [2/3]

virtual Number Prefix::value ( int  iexp) const
pure virtual

Returns the value of the prefix.

Parameters
iexpThe power of the prefixed unit.
Returns
The value of the prefix.

Implemented in NumberPrefix, BinaryPrefix, and DecimalPrefix.

◆ value() [3/3]

virtual Number Prefix::value ( ) const
pure virtual

Returns the value of the prefix.

Returns
The value of the prefix.

Implemented in NumberPrefix, BinaryPrefix, and DecimalPrefix.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/includes_8h.html0000644000175000017500000033107013401033110020021 00000000000000 libqalculate-2.8.2: libqalculate/includes.h File Reference
libqalculate-2.8.2
includes.h File Reference
#include <vector>
#include <string>
#include <stack>
#include <list>
#include <errno.h>
#include <stddef.h>
#include <math.h>
#include <float.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <unistd.h>
#include <stdint.h>

Classes

struct  SortOptions
 Options for ordering the parts of a mathematical expression/result before display. More...
 
struct  PrintOptions
 Options for formatting and display of mathematical structures/results. More...
 
struct  InternalPrintStruct
 
struct  ParseOptions
 Options for parsing expressions. More...
 
struct  EvaluationOptions
 Options for calculation. More...
 

Macros

#define QALCULATE_MAJOR_VERSION   (2)
 
#define QALCULATE_MINOR_VERSION   (6)
 
#define QALCULATE_MICRO_VERSION   (0)
 
#define COMPARISON_MIGHT_BE_LESS_OR_GREATER(i)   (i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_NOT_EQUAL)
 
#define COMPARISON_NOT_FULLY_KNOWN(i)   (i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER)
 
#define COMPARISON_IS_EQUAL_OR_GREATER(i)   (i == COMPARISON_RESULT_EQUAL || i == COMPARISON_RESULT_GREATER || i == COMPARISON_RESULT_EQUAL_OR_GREATER)
 
#define COMPARISON_IS_EQUAL_OR_LESS(i)   (i == COMPARISON_RESULT_EQUAL || i == COMPARISON_RESULT_LESS || i == COMPARISON_RESULT_EQUAL_OR_LESS)
 
#define COMPARISON_IS_NOT_EQUAL(i)   (i == COMPARISON_RESULT_NOT_EQUAL || i == COMPARISON_RESULT_LESS || i == COMPARISON_RESULT_GREATER)
 
#define COMPARISON_MIGHT_BE_EQUAL(i)   (i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER)
 
#define COMPARISON_MIGHT_BE_NOT_EQUAL(i)   (i >= COMPARISON_RESULT_UNKNOWN || i == COMPARISON_RESULT_EQUAL_OR_LESS || i == COMPARISON_RESULT_EQUAL_OR_GREATER)
 
#define NR_OF_PRIMES   600
 
#define SQP_LT_1000   11
 
#define SQP_LT_2000   17
 
#define SQP_LT_10000   28
 
#define SQP_LT_25000   40
 
#define SQP_LT_100000   68
 
#define NR_OF_SQUARE_PRIMES   170
 
#define LARGEST_RAISED_PRIME_EXPONENT   10
 
#define BASE_ROMAN_NUMERALS   -1
 
#define BASE_TIME   -2
 
#define BASE_BINARY   2
 
#define BASE_OCTAL   8
 
#define BASE_DECIMAL   10
 
#define BASE_DUODECIMAL   12
 
#define BASE_HEXADECIMAL   16
 
#define BASE_SEXAGESIMAL   60
 
#define EXP_BASE_3   -3
 
#define EXP_PRECISION   -1
 
#define EXP_NONE   0
 
#define EXP_PURE   1
 
#define EXP_SCIENTIFIC   3
 
#define POST_CONVERSION_BEST   POST_CONVERSION_OPTIMAL_SI
 
#define CALCULATOR   calculator
 
#define DEFAULT_PRECISION   8
 
#define PRECISION   (CALCULATOR ? CALCULATOR->getPrecision() : DEFAULT_PRECISION)
 
#define SIGN_DEGREE   "°"
 
#define SIGN_POWER_0   "â°"
 
#define SIGN_POWER_1   "¹"
 
#define SIGN_POWER_2   "²"
 
#define SIGN_POWER_3   "³"
 
#define SIGN_POWER_4   "â´"
 
#define SIGN_POWER_5   "âµ"
 
#define SIGN_POWER_6   "â¶"
 
#define SIGN_POWER_7   "â·"
 
#define SIGN_POWER_8   "â¸"
 
#define SIGN_POWER_9   "â¹"
 
#define SIGN_EURO   "€"
 
#define SIGN_POUND   "£"
 
#define SIGN_CENT   "¢"
 
#define SIGN_YEN   "Â¥"
 
#define SIGN_MICRO   "µ"
 
#define SIGN_PI   "Ï€"
 
#define SIGN_MULTIPLICATION   "×"
 
#define SIGN_MULTIDOT   "â‹…"
 
#define SIGN_MIDDLEDOT   "·"
 
#define SIGN_MULTIBULLET   "∙"
 
#define SIGN_SMALLCIRCLE   "•"
 
#define SIGN_DIVISION_SLASH   "∕"
 
#define SIGN_DIVISION   "÷"
 
#define SIGN_MINUS   "−"
 
#define SIGN_PLUS   "+"
 
#define SIGN_SQRT   "√"
 
#define SIGN_ALMOST_EQUAL   "≈"
 
#define SIGN_APPROXIMATELY_EQUAL   "≅"
 
#define SIGN_ZETA   "ζ"
 
#define SIGN_GAMMA   "γ"
 
#define SIGN_PHI   "φ"
 
#define SIGN_LESS_OR_EQUAL   "≤"
 
#define SIGN_GREATER_OR_EQUAL   "≥"
 
#define SIGN_NOT_EQUAL   "≠"
 
#define SIGN_CAPITAL_SIGMA   "Σ"
 
#define SIGN_CAPITAL_PI   "Π"
 
#define SIGN_CAPITAL_OMEGA   "Ω"
 
#define SIGN_CAPITAL_GAMMA   "Γ"
 
#define SIGN_CAPITAL_BETA   "Î’"
 
#define SIGN_INFINITY   "∞"
 
#define SIGN_PLUSMINUS   "±"
 
#define ID_WRAP_LEFT_CH   '{'
 
#define ID_WRAP_RIGHT_CH   '}'
 
#define DOT_CH   '.'
 
#define ZERO_CH   '0'
 
#define ONE_CH   '1'
 
#define TWO_CH   '2'
 
#define THREE_CH   '3'
 
#define FOUR_CH   '4'
 
#define FIVE_CH   '5'
 
#define SIX_CH   '6'
 
#define SEVEN_CH   '7'
 
#define EIGHT_CH   '8'
 
#define NINE_CH   '9'
 
#define PLUS_CH   '+'
 
#define MINUS_CH   '-'
 
#define MULTIPLICATION_CH   '*'
 
#define MULTIPLICATION_2_CH   ' '
 
#define DIVISION_CH   '/'
 
#define EXP_CH   'E'
 
#define EXP2_CH   'e'
 
#define POWER_CH   '^'
 
#define SPACE_CH   ' '
 
#define LEFT_PARENTHESIS_CH   '('
 
#define RIGHT_PARENTHESIS_CH   ')'
 
#define LEFT_VECTOR_WRAP_CH   '['
 
#define RIGHT_VECTOR_WRAP_CH   ']'
 
#define FUNCTION_VAR_PRE_CH   '\\'
 
#define COMMA_CH   ','
 
#define NAME_NUMBER_PRE_CH   '_'
 
#define UNIT_DIVISION_CH   '/'
 
#define AND_CH   '&'
 
#define OR_CH   '|'
 
#define LESS_CH   '<'
 
#define GREATER_CH   '>'
 
#define BITWISE_NOT_CH   '~'
 
#define LOGICAL_NOT_CH   '!'
 
#define NOT_CH   '!'
 
#define EQUALS_CH   '='
 
#define ID_WRAP_LEFT   "{"
 
#define ID_WRAP_RIGHT   "}"
 
#define ID_WRAPS   "{}"
 
#define DOT   "."
 
#define SEXADOT   ":"
 
#define COMMA   ","
 
#define COMMAS   ",;"
 
#define NUMBERS   "0123456789"
 
#define NUMBER_ELEMENTS   "0123456789.:"
 
#define SIGNS   "+-*/^"
 
#define OPERATORS   "~+-*/^&|!<>="
 
#define PARENTHESISS   "()"
 
#define LEFT_PARENTHESIS   "("
 
#define RIGHT_PARENTHESIS   ")"
 
#define VECTOR_WRAPS   "[]"
 
#define LEFT_VECTOR_WRAP   "["
 
#define RIGHT_VECTOR_WRAP   "]"
 
#define SPACES   " \t\n"
 
#define SPACE   " "
 
#define RESERVED   "\'@\\{}?\""
 
#define PLUS   "+"
 
#define MINUS   "-"
 
#define MULTIPLICATION   "*"
 
#define MULTIPLICATION_2   " "
 
#define DIVISION   "/"
 
#define EXP   "E"
 
#define EXPS   "Ee"
 
#define POWER   "^"
 
#define LOGICAL_AND   "&&"
 
#define LOGICAL_OR   "||"
 
#define LOGICAL_NOT   "!"
 
#define BITWISE_AND   "&"
 
#define BITWISE_OR   "|"
 
#define BITWISE_NOT   "~"
 
#define SHIFT_RIGHT   ">>"
 
#define SHIFT_LEFT   "<<"
 
#define LESS   "<"
 
#define GREATER   ">"
 
#define NOT   "!"
 
#define EQUALS   "="
 
#define SINF   "INF"
 
#define UNDERSCORE   "_"
 
#define NOT_IN_NAMES   RESERVED OPERATORS SPACES SEXADOT DOT VECTOR_WRAPS PARENTHESISS COMMAS
 

Enumerations

enum  ExpressionItemType { TYPE_VARIABLE, TYPE_FUNCTION, TYPE_UNIT }
 Type of ExpressionItem. More...
 
enum  ComparisonResult {
  COMPARISON_RESULT_EQUAL, COMPARISON_RESULT_GREATER, COMPARISON_RESULT_LESS, COMPARISON_RESULT_EQUAL_OR_GREATER,
  COMPARISON_RESULT_EQUAL_OR_LESS, COMPARISON_RESULT_NOT_EQUAL, COMPARISON_RESULT_UNKNOWN, COMPARISON_RESULT_EQUAL_LIMITS,
  COMPARISON_RESULT_CONTAINS, COMPARISON_RESULT_CONTAINED, COMPARISON_RESULT_OVERLAPPING_LESS, COMPARISON_RESULT_OVERLAPPING_GREATER
}
 The result of a comparison of two values.
 
enum  PlotLegendPlacement {
  PLOT_LEGEND_NONE, PLOT_LEGEND_TOP_LEFT, PLOT_LEGEND_TOP_RIGHT, PLOT_LEGEND_BOTTOM_LEFT,
  PLOT_LEGEND_BOTTOM_RIGHT, PLOT_LEGEND_BELOW, PLOT_LEGEND_OUTSIDE
}
 Placement of legend.
 
enum  PlotStyle {
  PLOT_STYLE_LINES, PLOT_STYLE_POINTS, PLOT_STYLE_POINTS_LINES, PLOT_STYLE_BOXES,
  PLOT_STYLE_HISTOGRAM, PLOT_STYLE_STEPS, PLOT_STYLE_CANDLESTICKS, PLOT_STYLE_DOTS
}
 Plot type/style.
 
enum  PlotSmoothing {
  PLOT_SMOOTHING_NONE, PLOT_SMOOTHING_UNIQUE, PLOT_SMOOTHING_CSPLINES, PLOT_SMOOTHING_BEZIER,
  PLOT_SMOOTHING_SBEZIER
}
 Smoothing a plotted lines.
 
enum  PlotFileType {
  PLOT_FILETYPE_AUTO, PLOT_FILETYPE_PNG, PLOT_FILETYPE_PS, PLOT_FILETYPE_EPS,
  PLOT_FILETYPE_LATEX, PLOT_FILETYPE_SVG, PLOT_FILETYPE_FIG, PLOT_FILETYPE_PDF
}
 File type for saving plot to image.
 
enum  MathOperation {
  OPERATION_MULTIPLY, OPERATION_DIVIDE, OPERATION_ADD, OPERATION_SUBTRACT,
  OPERATION_RAISE, OPERATION_EXP10, OPERATION_LOGICAL_AND, OPERATION_LOGICAL_OR,
  OPERATION_LOGICAL_XOR, OPERATION_BITWISE_AND, OPERATION_BITWISE_OR, OPERATION_BITWISE_XOR,
  OPERATION_LESS, OPERATION_GREATER, OPERATION_EQUALS_LESS, OPERATION_EQUALS_GREATER,
  OPERATION_EQUALS, OPERATION_NOT_EQUALS
}
 Mathematical operations.
 
enum  ComparisonType {
  COMPARISON_LESS, COMPARISON_GREATER, COMPARISON_EQUALS_LESS, COMPARISON_EQUALS_GREATER,
  COMPARISON_EQUALS, COMPARISON_NOT_EQUALS
}
 Comparison signs for comparison structures.
 
enum  SortFlags { SORT_DEFAULT = 1 << 0, SORT_SCIENTIFIC = 1 << 1 }
 
enum  NumberFractionFormat { FRACTION_DECIMAL, FRACTION_DECIMAL_EXACT, FRACTION_FRACTIONAL, FRACTION_COMBINED }
 
enum  MultiplicationSign { MULTIPLICATION_SIGN_ASTERISK, MULTIPLICATION_SIGN_DOT, MULTIPLICATION_SIGN_X, MULTIPLICATION_SIGN_ALTDOT }
 
enum  DivisionSign { DIVISION_SIGN_SLASH, DIVISION_SIGN_DIVISION_SLASH, DIVISION_SIGN_DIVISION }
 
enum  BaseDisplay { BASE_DISPLAY_NONE, BASE_DISPLAY_NORMAL, BASE_DISPLAY_ALTERNATIVE }
 
enum  IntervalDisplay {
  INTERVAL_DISPLAY_SIGNIFICANT_DIGITS, INTERVAL_DISPLAY_INTERVAL, INTERVAL_DISPLAY_PLUSMINUS, INTERVAL_DISPLAY_MIDPOINT,
  INTERVAL_DISPLAY_LOWER, INTERVAL_DISPLAY_UPPER
}
 
enum  DigitGrouping { DIGIT_GROUPING_NONE, DIGIT_GROUPING_STANDARD, DIGIT_GROUPING_LOCALE }
 
enum  DateTimeFormat { DATE_TIME_FORMAT_ISO, DATE_TIME_FORMAT_LOCALE }
 
enum  TimeZone { TIME_ZONE_UTC, TIME_ZONE_LOCAL, TIME_ZONE_CUSTOM }
 
enum  ApproximationMode { APPROXIMATION_EXACT, APPROXIMATION_TRY_EXACT, APPROXIMATION_APPROXIMATE, APPROXIMATION_EXACT_VARIABLES }
 
enum  StructuringMode { STRUCTURING_NONE, STRUCTURING_SIMPLIFY, STRUCTURING_FACTORIZE, STRUCTURING_HYBRID }
 
enum  AutoPostConversion { POST_CONVERSION_NONE, POST_CONVERSION_OPTIMAL_SI, POST_CONVERSION_BASE, POST_CONVERSION_OPTIMAL }
 
enum  MixedUnitsConversion {
  MIXED_UNITS_CONVERSION_NONE, MIXED_UNITS_CONVERSION_DOWNWARDS_KEEP, MIXED_UNITS_CONVERSION_DOWNWARDS, MIXED_UNITS_CONVERSION_DEFAULT,
  MIXED_UNITS_CONVERSION_FORCE_INTEGER, MIXED_UNITS_CONVERSION_FORCE_ALL
}
 
enum  ReadPrecisionMode { DONT_READ_PRECISION, ALWAYS_READ_PRECISION, READ_PRECISION_WHEN_DECIMALS }
 
enum  AngleUnit { ANGLE_UNIT_NONE, ANGLE_UNIT_RADIANS, ANGLE_UNIT_DEGREES, ANGLE_UNIT_GRADIANS }
 
enum  ComplexNumberForm { COMPLEX_NUMBER_FORM_RECTANGULAR, COMPLEX_NUMBER_FORM_EXPONENTIAL, COMPLEX_NUMBER_FORM_POLAR }
 
enum  ParsingMode { PARSING_MODE_ADAPTIVE, PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST, PARSING_MODE_CONVENTIONAL }
 

Variables

static string empty_string
 
static const long int PRIMES []
 
static const long int SQUARE_PRIMES []
 
static const long int RAISED_PRIMES [][49]
 
static const struct SortOptions default_sort_options
 
static const struct PrintOptions default_print_options
 
static const struct InternalPrintStruct top_ips
 
static const struct ParseOptions default_parse_options
 
static const struct EvaluationOptions default_evaluation_options
 
MathStructure m_undefined
 
MathStructure m_empty_vector
 
MathStructure m_empty_matrix
 
MathStructure m_zero
 
MathStructure m_one
 
MathStructure m_minus_one
 
MathStructure m_one_i
 
Number nr_zero
 
Number nr_one
 
Number nr_two
 
Number nr_three
 
Number nr_minus_one
 
Number nr_one_i
 
Number nr_minus_i
 
Number nr_half
 
Number nr_minus_half
 
Number nr_plus_inf
 
Number nr_minus_inf
 
EvaluationOptions no_evaluation
 
ExpressionName empty_expression_name
 
Calculatorcalculator
 

Enumeration Type Documentation

◆ ApproximationMode

Enumerator
APPROXIMATION_EXACT 

Allow only exact results.

APPROXIMATION_TRY_EXACT 

Try to make the result as exact as possible.

APPROXIMATION_APPROXIMATE 

Calculate the result approximately directly.

APPROXIMATION_EXACT_VARIABLES 

Used internally.

◆ AutoPostConversion

Enumerator
POST_CONVERSION_NONE 

Do not do any conversion of units in addition to syncing.

POST_CONVERSION_OPTIMAL_SI 

Convert to the least amount of units. Non-SI units are converted to SI units.

POST_CONVERSION_BASE 

Convert to base units.

POST_CONVERSION_OPTIMAL 

Convert to the the least amount of units. Non-SI units is kept (if optimal), but for conversion only SI units are used.

◆ ExpressionItemType

Type of ExpressionItem.

Enumerator
TYPE_VARIABLE 

class Variable

TYPE_FUNCTION 

class MathFunction

TYPE_UNIT 

class Unit

◆ NumberFractionFormat

Enumerator
FRACTION_DECIMAL 

Display numbers in decimal, not fractional, format (ex. 0.333333)

FRACTION_DECIMAL_EXACT 

Display as fraction if necessary to get an exact display of the result (ex. 1/3, but 0.25)

FRACTION_FRACTIONAL 

Display as fraction (ex. 4/3)

FRACTION_COMBINED 

Display as an integer and a fraction (ex. 3 + 1/2)

◆ ParsingMode

Enumerator
PARSING_MODE_ADAPTIVE 

The default adaptive mode works as the "parse implicit multiplication first" mode, unless spaces are found (<quote>1/5x = 1/(5*x)</quote>, but <quote>1/5 x = (1/5)*x</quote>). In the adaptive mode unit expressions are parsed separately (<quote>5 m/5 m/s = (5*m)/(5*(m/s)) = 1 s</quote>).

PARSING_MODE_IMPLICIT_MULTIPLICATION_FIRST 

In the "parse implicit multiplication first" mode, implicit multiplication is parsed before explicit multiplication (<quote>12/2(1+2) = 12/(2*3) = 2</quote>, <quote>5x/5y = (5*x)/(5*y) = x/y</quote>).

PARSING_MODE_CONVENTIONAL 

In the conventional mode implicit multiplication does not differ from explicit multiplication (<quote>12/2(1+2) = 12/2*3 = 18</quote>, <quote>5x/5y = 5*x/5*y = xy</quote>).

◆ StructuringMode

Enumerator
STRUCTURING_NONE 

Do not do any factorization or additional simplifications.

STRUCTURING_SIMPLIFY 

Simplify the result as much as possible (no factorization, normally the same as STRUCTURING_NONE))

STRUCTURING_FACTORIZE 

Factorize the result.

STRUCTURING_HYBRID 

Deprecated: use STRUCTURING_SIMPLIFY instead.

Variable Documentation

◆ RAISED_PRIMES

const long int RAISED_PRIMES[][49]
static
Initial value:
= {
{8L, 27L, 125L, 343L, 1331L, 2197, 4913, 6859, 12167L, 24389L,
29791L, 50653L, 68921L, 79507L, 103823L, 148877L, 205379L, 226981L, 300763L, 357911L,
389017L, 493039L, 571787L, 704969L, 912673L, 1030301L, 1092727L, 1225043L, 1295029, 1442897,
2048383L, 2248091L, 2571353L, 2685619L, 3307949L, 3442951L, 3869893L, 4330747L, 4657463L, 5177717L,
5735339L, 5929741L, 6967871L, 7189057L, 7645373L, 7880599L, 9393931L, 11089567L, 0},
{16L, 81L, 625L, 2401L, 14641L, 28561L, 83521L, 130321L, 279841L, 707281L,
923521L, 1874161L, 2825761L, 3418801L, 4879681L, 7890481L, 12117361L,
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, 0, 0, 0, 0, 0, 0},
{32L, 243L, 3125L, 16807L, 161051L, 371293L, 1419857L, 2476099L, 6436343L, 20511149L,
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{64L, 729L, 15625L, 117649L, 1771561L, 4826809L, 24137569L, 47045881L, 148035889L,
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{128L, 2187L, 78125L, 823543L, 19487171L, 62748517L, 410338673L,
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{256L, 6561L, 390625L, 5764801L, 214358881L, 815730721L,
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{512L, 19683L, 1953125L, 40353607L,
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{1024L, 59049L, 9765625L, 282475249L,
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}

◆ SQUARE_PRIMES

const long int SQUARE_PRIMES[]
static
Initial value:
= {
4L, 9L, 25L, 49L, 121L, 169L, 289L, 361L, 529L, 841L,
961L, 1369L, 1681L, 1849L, 2209L, 2809L, 3481L, 3721L, 4489L, 5041L,
5329L, 6241L, 6889L, 7921L, 9409L, 10201L, 10609L, 11449L, 11881L, 12769L,
16129L, 17161L, 18769L, 19321L, 22201L, 22801L, 24649L, 26569L, 27889L, 29929L,
32041L, 32761L, 36481L, 37249L, 38809L, 39601L, 44521L, 49729L, 51529L, 52441L,
54289L, 57121L, 58081L, 63001L, 66049L, 69169L, 72361L, 73441L, 76729L, 78961L,
80089L, 85849L, 94249L, 96721L, 97969L, 100489L, 109561L, 113569L, 120409L, 121801L,
124609L, 128881L, 134689L, 139129L, 143641L, 146689L, 151321L, 157609L, 160801L, 167281L,
175561L, 177241L, 185761L, 187489L, 192721L, 196249L, 201601L, 208849L, 212521L, 214369L,
218089L, 229441L, 237169L, 241081L, 249001L, 253009L, 259081L, 271441L, 273529L, 292681L,
299209L, 310249L, 316969L, 323761L, 326041L, 332929L, 344569L, 351649L, 358801L, 361201L,
368449L, 375769L, 380689L, 383161L, 398161L, 410881L, 413449L, 418609L, 426409L, 434281L,
436921L, 452929L, 458329L, 466489L, 477481L, 491401L, 502681L, 516961L, 528529L, 537289L,
546121L, 552049L, 564001L, 573049L, 579121L, 591361L, 597529L, 619369L, 635209L, 654481L,
657721L, 674041L, 677329L, 683929L, 687241L, 703921L, 727609L, 734449L, 737881L, 744769L,
769129L, 776161L, 779689L, 786769L, 822649L, 829921L, 844561L, 863041L, 877969L, 885481L,
896809L, 908209L, 935089L, 942841L, 954529L, 966289L, 982081L, 994009L, 1018081L, 1026169L
}
libqalculate-2.8.2/docs/reference/html/classFunctionArgument.html0000644000175000017500000007363213401033110022141 00000000000000 libqalculate-2.8.2: FunctionArgument Class Reference
libqalculate-2.8.2

A function argument. More...

#include <Function.h>

Inheritance diagram for FunctionArgument:
Argument

Public Member Functions

 FunctionArgument (string name_="", bool does_test=true, bool does_error=true)
 
 FunctionArgument (const FunctionArgument *arg)
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A function argument.

Member Function Documentation

◆ copy()

virtual Argument* FunctionArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ print()

virtual string FunctionArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string FunctionArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool FunctionArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int FunctionArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/html/DataSet_8h.html0000644000175000017500000001546713401033110017551 00000000000000 libqalculate-2.8.2: libqalculate/DataSet.h File Reference
libqalculate-2.8.2
DataSet.h File Reference

Classes

class  DataObject
 A a data set object. More...
 
class  DataProperty
 A data set property. More...
 
class  DataSet
 A data set. More...
 
class  DataPropertyArgument
 Data property function argument. More...
 
class  DataObjectArgument
 Data object function argument. More...
 

Typedefs

typedef vector< DataProperty * >::iterator DataObjectPropertyIter
 
typedef vector< DataProperty * >::iterator DataPropertyIter
 
typedef vector< DataObject * >::iterator DataObjectIter
 

Enumerations

enum  PropertyType { PROPERTY_EXPRESSION, PROPERTY_NUMBER, PROPERTY_STRING }
 
libqalculate-2.8.2/docs/reference/html/classArgumentSet.png0000644000175000017500000000072413401033110020717 00000000000000‰PNG  IHDRTP°$¢åPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2cIDATxíÝÝ’ƒ †á7aÆû¿ä­üI¨ŠtâÁÎÐÙo©Š‘h !ïTU}³PUUßœ¢¢ª:‘~þ*³ê GIÿÓ©õûgwÚµéû=šèe¶¢Q1Ûõ2OÑ#Çp0v¡ûg„¦9ѲžÃJíÑIÔ.ío·oÑܘ£?…Êݯכ}£fß…!Z+VU}ša¥_O¶ªê ë§OUÕ7o¡!„à€‡Ù¼óºm/¨o Ó_}ýGÝ_(€s à›…øf¡¾Y(€o ð$""ÞA|³Pß´è,¿Ï½î….ú3=žñUÖ Çô¬ÅZÊžüP§qJ{rÙcÑ D/³ŠÙ®[…9 ?Gí$ö¯2{‰–5¿CÓKtZÔÜÆ]¥æh©Â 7¨]Ú‹ÛoÑa¥¹1Gj_úË–5Kúî˜üþª] µb€é\UjÞ>€™¬Ÿ>ß¼…Šˆ8çgŒ£JáLIEND®B`‚libqalculate-2.8.2/docs/reference/html/functions_r.html0000644000175000017500000001150713401033110020145 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- r -

libqalculate-2.8.2/docs/reference/html/functions_t.html0000644000175000017500000001372713401033110020155 00000000000000 libqalculate-2.8.2: Class Members
libqalculate-2.8.2
Here is a list of all documented class members with links to the class documentation for each member:

- t -

libqalculate-2.8.2/docs/reference/html/tab_b.png0000644000175000017500000000025113401033110016475 00000000000000‰PNG  IHDR$ÇÇ[pIDATxíÝMƒ EáÇ»ÐÔ¸¸u`âÀ´V0РÆ}:t]DÁ²s¿ä®‚¶ýËu¥ø|’xùî½À>ÿ1»& mÄ8ÜSÙÑxÜLÀUûšÞ²ÄiE–ŠåOs„¢’nxàÒêÓKN²~jIEND®B`‚libqalculate-2.8.2/docs/reference/html/classVariableArgument.png0000644000175000017500000000102613401033110021705 00000000000000‰PNG  IHDRrPògÑrPLTEÿÿÿèìõuÂÀÀÀ‰ÜtRNSÿÿÿÿÿÿÿÕÊT2¥IDATxíáŽÂ ‡Ä÷äSJÁEZZ-x‰˜›ʲSèVÿâ½÷cÁKÒH¦R’:ðO•N’NЈ? tg×)Cë–ÿKâÔ¿_^.=š¥/IuÚʘ>Ø¢4)ƒÃŒÓMHR3ÊLn²Ä6’´ÁåãÓR.1)×çØÜ¥•¤ Î+í#íq°VË%WÍ*Š›îF’6xãÛçì7ƒ$ówR™v+Iorv—­÷\’Ì_IêÀÏ(½÷~(ïqËxåí6Ü9^y7Žv~Aù#;•=˜J€L%@¦ S ЩèÀTt`*¶qι±àF2•ø¦ri š¨—Y€6)Çž²þÁ•ÊІþã͉3áZÞûk@œOKC»¼m1$õÍâr8 –ek–4*ãÒ” ¶·WÖwY¦4fpXž&ÊŒ«Ê|Pëi¤s´ÉÖùØî*ËÅue±‹Z2[n]ÚÙ¢ìv³ÔËšGzì`Ó%óèãð¥b­2–K®š5Áó3z©X€8šè"ås¹ìqÕ.×÷ ÁüñèÀÏ(sn({ý×ÅdIEND®B`‚libqalculate-2.8.2/docs/reference/html/classDateArgument.html0000644000175000017500000007740013401033110021226 00000000000000 libqalculate-2.8.2: DateArgument Class Reference
libqalculate-2.8.2

A date argument. More...

#include <Function.h>

Inheritance diagram for DateArgument:
Argument

Public Member Functions

 DateArgument (string name_="", bool does_test=true, bool does_error=true)
 
 DateArgument (const DateArgument *arg)
 
virtual void parse (MathStructure *mstruct, const string &str, const ParseOptions &po=default_parse_options) const
 
virtual int type () const
 
virtual Argumentcopy () const
 
virtual string print () const
 
- Public Member Functions inherited from Argument
 Argument (string name_="", bool does_test=true, bool does_error=true)
 
 Argument (const Argument *arg)
 
virtual ~Argument ()
 
virtual void set (const Argument *arg)
 
string printlong () const
 
bool test (MathStructure &value, int index, MathFunction *f, const EvaluationOptions &eo=default_evaluation_options) const
 
virtual MathStructure parse (const string &str, const ParseOptions &po=default_parse_options) const
 
string name () const
 
void setName (string name_)
 
void setCustomCondition (string condition)
 
string getCustomCondition () const
 
bool tests () const
 
void setTests (bool does_error)
 
bool alerts () const
 
void setAlerts (bool does_error)
 
bool zeroForbidden () const
 
void setZeroForbidden (bool forbid_zero)
 
bool matrixAllowed () const
 
void setMatrixAllowed (bool allow_matrix)
 
bool handlesVector () const
 
void setHandleVector (bool handle_vector)
 
bool isLastArgument () const
 
void setIsLastArgument (bool is_last)
 
bool rationalPolynomial () const
 
void setRationalPolynomial (bool rational_polynomial)
 
virtual bool suggestsQuotes () const
 

Protected Member Functions

virtual bool subtest (MathStructure &value, const EvaluationOptions &eo) const
 
virtual string subprintlong () const
 

Additional Inherited Members

- Protected Attributes inherited from Argument
string sname
 
string scondition
 
bool b_zero
 
bool b_test
 
bool b_matrix
 
bool b_text
 
bool b_error
 
bool b_rational
 
bool b_last
 
bool b_handle_vector
 

Detailed Description

A date argument.

A text argument representing a date.

Member Function Documentation

◆ copy()

virtual Argument* DateArgument::copy ( ) const
virtual

Returns a copy of the argument definition.

Returns
A copy.

Reimplemented from Argument.

◆ parse()

virtual void DateArgument::parse ( MathStructure mstruct,
const string &  str,
const ParseOptions po = default_parse_options 
) const
virtual

Parses an expression for an argument value. The default behavior is to use Calculator::parse() directly.

Parameters
mstructMathematical structure to set with the parsed expression.
strExpression.
poParse options.

Reimplemented from Argument.

◆ print()

virtual string DateArgument::print ( ) const
virtual

Resturns a short description of the argument definition. Ex. "number" for NumberArgument.

Returns
Short description.

Reimplemented from Argument.

◆ subprintlong()

virtual string DateArgument::subprintlong ( ) const
protectedvirtual

This function is called from Argument::printlong() and returns description specific the argument definition type. Should be reimplemented by all subclasses. For example IntegerArgument::subprintlong() might return "an integer" and Argument::printlong() might append " that fulfills the condition: even(\x)".

Returns
Long description.

Reimplemented from Argument.

◆ subtest()

virtual bool DateArgument::subtest ( MathStructure value,
const EvaluationOptions eo 
) const
protectedvirtual

This function is called from Argument::test() and performs validation specific to the argument definition type. Should be reimplemented by all subclasses.

Parameters
valueValue to test.
eoEvaluation options to use if the value needs to be evaluated.
Returns
true if the value is valid for the argument definition.

Reimplemented from Argument.

◆ type()

virtual int DateArgument::type ( ) const
virtual

Returns the type of the argument, corresponding to which subclass the object belongs to.

Returns
ArgumentType.

Reimplemented from Argument.


The documentation for this class was generated from the following file:
libqalculate-2.8.2/docs/reference/Makefile.in0000644000175000017500000004047213401033103016034 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # docs/reference/Makefile.am for qalculate # VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs/reference ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(referencedir)" DATA = $(reference_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEST = @QALCULATE_TEST@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ referencedir = $(docdir)/reference/html reference_DATA = \ $(top_srcdir)/docs/reference/html/*.png \ $(top_srcdir)/docs/reference/html/*.html \ $(top_srcdir)/docs/reference/html/*.css EXTRA_DIST = \ $(top_srcdir)/docs/reference/Doxyfile \ $(top_srcdir)/docs/reference/html/*.png \ $(top_srcdir)/docs/reference/html/*.html \ $(top_srcdir)/docs/reference/html/*.css all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-referenceDATA: $(reference_DATA) @$(NORMAL_INSTALL) @list='$(reference_DATA)'; test -n "$(referencedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(referencedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(referencedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(referencedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(referencedir)" || exit $$?; \ done uninstall-referenceDATA: @$(NORMAL_UNINSTALL) @list='$(reference_DATA)'; test -n "$(referencedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(referencedir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(referencedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-referenceDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-referenceDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-referenceDATA install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-referenceDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libqalculate-2.8.2/docs/reference/Makefile.am0000644000175000017500000000065513067371064016045 00000000000000# # docs/reference/Makefile.am for qalculate # referencedir = $(docdir)/reference/html reference_DATA = \ $(top_srcdir)/docs/reference/html/*.png \ $(top_srcdir)/docs/reference/html/*.html \ $(top_srcdir)/docs/reference/html/*.css EXTRA_DIST = \ $(top_srcdir)/docs/reference/Doxyfile \ $(top_srcdir)/docs/reference/html/*.png \ $(top_srcdir)/docs/reference/html/*.html \ $(top_srcdir)/docs/reference/html/*.css libqalculate-2.8.2/README0000644000175000017500000001227113312400204011756 00000000000000Qalculate! library and CLI Qalculate! is a multi-purpose cross-platform desktop calculator. It is simple to use but provides power and versatility normally reserved for complicated math packages, as well as useful tools for everyday needs (such as currency conversion and percent calculation). Features include a large library of customizable functions, unit calculations and conversion, symbolic calculations (including integrals and equations), arbitrary precision, interval arithmetic, plotting, and a user-friendly interface (GTK+ and CLI). 1. Installation In a terminal window in the top source code directory run ./autogen.sh (not required if using a release source tarball, only if using the git version) ./configure make make install (as root) If libqalculate is installed in /usr/local (default) you may need to add /usr/local/lib to the library path of the system (add /usr/local/lib to a file under /etc/ld.so.conf.d/ and run ldconfig). 2. Requirements * GMP and MPFR * libxml2 * libcurl, icu, gettext (recommended) * iconv, readline (recommended for CLI) * Gnuplot 1.7 (optional) * doxygen (for compilation of git version) 3. API Documentation The API documentation is included in the package and is installed in $docdir/libqalculate/html (usually /usr/share/doc/libqalculate/html). It is generated when running autogen.sh. It is also available online at http://qalculate.github.io/reference/index.html. 4. Using the CLI program 'qalc' To calculate a single expression from the command line (non-interactive mode) enter `qalc mathematical expression` (e.g. qalc 5+2) `qalc --help` shows information about command line options in non-interactive mode. If you run `qalc` without any mathematical expression the program will start in interactive mode, where you can enter multiple expressions with history and completion, manipulate the result and change settings. Type `help` in interactive mode for more information. 5. Other Applications The main user interface for libqalculate is qalculate-gtk (https://github.com/Qalculate/qalculate-gtk). Other software using libqalculate include * KDE Plasma Workspace (https://www.kde.org/workspaces/plasmadesktop/) * Cantor (http://kde.org/applications/education/cantor/) * Step (http://kde.org/applications/education/step/) * Qalculate widget for KDE Plasma (https://store.kde.org/p/1155946/) 6. Features * Calculation and parsing: * Basic operations and operators: + - * / ^ E () && || ! < > >= <= != ~ & | << >> * Fault-tolerant parsing of strings: log 5 / 2 .5 (3) + (2( 3 +5 = ln(5) / (2.5 * 3) + 2 * (3 + 5) * Expressions may contain any combination of numbers, functions, units, variables, vectors and matrices, and dates * Supports complex and infinite numbers * Interval arithmetic (for determination of the number of significant digits or direct calculation with intervals of numbers) * Supports all number bases from 2 to 36, time format and roman numerals * Ability to disable functions, variables, units or unknown variables for less confusion: ex. when you do not want (a+b)^2 to mean (are+barn)^2 but ("a"+"b")^2 * Controllable implicit multiplication * Matrices and vectors, and related operations (determinants etc.) * Verbose error messages * Arbitrary precision * RPN mode * Result display: * Supports all number bases from 2 to 36, plus sexagesimal numbers, time format and roman numerals * Many customization options: precision, max/min decimals, multiplication sign, etc. * Exact or approximate * Fractions: 4 / 6 * 2 = 1.333... = 4/3 = 1 + 1/3 * Symbolic calculation: * Ex. (x + y)^2 = x^2 + 2xy + y^2; 4 "apples" + 3 "oranges" * Factorization and simplification * Differentiation and integration * Can solve most equations and inequalities * Customizable assumptions give different results (ex. ln(2x) = ln(2) + ln(x) if x is assumed positive) * Functions: * All the usual functions: sine, log, etc... : ln 5 = 1.609; sqrt(tan(20) - 5) = sqrt(-2.76283905578) * Lots of statistical, financial, geometrical, and more functions (approx. 200) * If..then..else function, optional arguments and more features for flexible function creation * Can easily be created, edit and saved to a standard XML file * Units: * Supports all SI units and prefixes (including binary), as well as imperial and other unit systems * Automatic conversion: ft + yd + m = 2.2192 m * Implicit conversion: 5m/s to mi/h = 11.18 miles/hour * Smart conversion: can automatically convert 5 kg*m/s^2 to 5 newton * Currency conversion with retrieval of daily exchange rates * Different name forms: abbreviation, singular, plural (m, meter, meters) * Can easily be created, edit and saved to a standard XML file * Variables and constants: * Basic constants: pi, e * Lots of physical constants and elements * CSV file import and export * Can easily be created, edit and saved to a standard XML file * Flexible, can contain simple numbers, units or whole expressions * Data sets with objects and associated properties in database-like structure * Plotting: * Uses Gnuplot * Can plot functions or data (matrices and vectors) * Ability to save plot to PNG image, postscript, etc. * Several customization options * and more... libqalculate-2.8.2/po-defs/0000755000175000017500000000000013401033233012513 500000000000000libqalculate-2.8.2/po-defs/nl.po0000644000175000017500000064267113365262305013441 00000000000000# translation of libqalculate-defs.po to # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # # Rinse de Vries , 2006. # Jaap Woldringh , 2006, 2007. # R.F. Pels , 2006. msgid "" msgstr "" "Project-Id-Version: libqalculate-defs\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-28 08:27+0100\n" "PO-Revision-Date: 2007-05-18 15:47+0200\n" "Last-Translator: Jaap Woldringh \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../data/currencies.xml.in.h:1 msgid "Currency" msgstr "Valuta" #: ../data/currencies.xml.in.h:2 msgid "European Euros" msgstr "Europese euro" #: ../data/currencies.xml.in.h:3 msgid "ar:EUR,au:€,euro,p:euros" msgstr "" #: ../data/currencies.xml.in.h:4 msgid "" "Andorra, Austria, Belgium, Cyprus, Estonia, Finland, France, Germany, " "Greece, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, " "Portugal, San Marino, Slovakia, Slovenia, Spain, Vatican City" msgstr "" #: ../data/currencies.xml.in.h:5 msgid "U.S. Dollars" msgstr "U.S. dollar" #: ../data/currencies.xml.in.h:6 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "" #: ../data/currencies.xml.in.h:7 msgid "" "United States, East Timor, Ecuador, El Salvador, Micronesia, Marshall " "Islands, Palau, Zimbabwe" msgstr "" #: ../data/currencies.xml.in.h:8 msgid "Japanese Yen" msgstr "Japanse yen" #: ../data/currencies.xml.in.h:9 msgid "ar:JPY,au:¥,yen" msgstr "" #: ../data/currencies.xml.in.h:10 msgid "Japan" msgstr "" #: ../data/currencies.xml.in.h:11 msgid "Danish Kroner" msgstr "Deense kroon" #: ../data/currencies.xml.in.h:12 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:13 msgid "Denmark" msgstr "" #: ../data/currencies.xml.in.h:14 msgid "British Pounds" msgstr "Britse Pond" #: ../data/currencies.xml.in.h:15 msgid "ar:GBP,au:£" msgstr "" #: ../data/currencies.xml.in.h:16 msgid "United Kingdom" msgstr "" #: ../data/currencies.xml.in.h:17 msgid "Thai Baht" msgstr "Thailandse bat" #: ../data/currencies.xml.in.h:18 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:19 msgid "Thailand" msgstr "" #: ../data/currencies.xml.in.h:20 msgid "Swedish Krona" msgstr "Zweedse kroon" #: ../data/currencies.xml.in.h:21 msgid "ar:SEK" msgstr "" #: ../data/currencies.xml.in.h:22 msgid "Sweden" msgstr "" #: ../data/currencies.xml.in.h:23 msgid "Swiss Francs" msgstr "Zwitserse franc" #: ../data/currencies.xml.in.h:24 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:25 msgid "Switzerland" msgstr "" #: ../data/currencies.xml.in.h:26 msgid "Norwegian Kroner" msgstr "Noorse kroon" #: ../data/currencies.xml.in.h:27 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:28 msgid "Norway" msgstr "" #: ../data/currencies.xml.in.h:29 msgid "Bulgarian Lev" msgstr "Bulgaarse Lev" #: ../data/currencies.xml.in.h:30 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:31 #, fuzzy msgid "Bulgaria" msgstr "Bulgaarse Lev" #: ../data/currencies.xml.in.h:32 msgid "Russian Ruble" msgstr "Russische roebel" #: ../data/currencies.xml.in.h:33 msgid "ar:RUB,au:₽,ruble" msgstr "a:RUB,au:₽,roebel" #: ../data/currencies.xml.in.h:34 #, fuzzy msgid "Russia" msgstr "Russische roebel" #: ../data/currencies.xml.in.h:35 msgid "Philippine Peso" msgstr "Filippijnse peso" #: ../data/currencies.xml.in.h:36 msgid "ar:PHP,au:₱" msgstr "" #: ../data/currencies.xml.in.h:37 #, fuzzy msgid "Philippines" msgstr "Filippijnse peso" #: ../data/currencies.xml.in.h:38 msgid "Malaysian Ringgit" msgstr "Maleisische ringgit" #: ../data/currencies.xml.in.h:39 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:40 #, fuzzy msgid "Malaysia" msgstr "Maleisische ringgit" #: ../data/currencies.xml.in.h:41 msgid "Croatian Kuna" msgstr "Kroatische kuna" #: ../data/currencies.xml.in.h:42 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:43 #, fuzzy msgid "Croatia" msgstr "Kroatische kuna" #: ../data/currencies.xml.in.h:44 msgid "Yuan Renminbi (PR China)" msgstr "" #: ../data/currencies.xml.in.h:45 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:46 msgid "China" msgstr "" #: ../data/currencies.xml.in.h:47 msgid "Indonesian Rupiah" msgstr "Indonesische roepiah" #: ../data/currencies.xml.in.h:48 msgid "ar:IDR,rupiah" msgstr "" #: ../data/currencies.xml.in.h:49 #, fuzzy msgid "Indonesia" msgstr "Indonesische roepiah" #: ../data/currencies.xml.in.h:50 msgid "Czech Koruna" msgstr "Tsjechische kroon" #: ../data/currencies.xml.in.h:51 msgid "ar:CZK,au-c:Kč" msgstr "" #: ../data/currencies.xml.in.h:52 msgid "Czech Republic" msgstr "" #: ../data/currencies.xml.in.h:53 msgid "Hungarian Forint" msgstr "Hongaarse forint" #: ../data/currencies.xml.in.h:54 msgid "forint,ar:HUF" msgstr "" #: ../data/currencies.xml.in.h:55 msgid "Hungary" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "Polish Zloty" msgstr "Poolse zloty" #: ../data/currencies.xml.in.h:57 #, fuzzy msgid "ar:PLN,au:zł,zloty" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:58 msgid "Poland" msgstr "" #: ../data/currencies.xml.in.h:59 #, fuzzy msgid "Romanian Leu" msgstr "Nieuwe Roemeense leu" #: ../data/currencies.xml.in.h:60 msgid "ar:RON" msgstr "" #: ../data/currencies.xml.in.h:61 #, fuzzy msgid "Romania" msgstr "Nieuwe Roemeense leu" #: ../data/currencies.xml.in.h:62 msgid "Turkish New Lira" msgstr "Nieuwe Turkse lire" #: ../data/currencies.xml.in.h:63 msgid "ar:TRY,au:₺" msgstr "" #: ../data/currencies.xml.in.h:64 msgid "Turkey" msgstr "" #: ../data/currencies.xml.in.h:65 msgid "Australian Dollars" msgstr "Australische dollar" #: ../data/currencies.xml.in.h:66 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:67 #, fuzzy msgid "Australia" msgstr "Australische dollar" #: ../data/currencies.xml.in.h:68 msgid "Canadian Dollars" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:69 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:70 msgid "Canada" msgstr "" #: ../data/currencies.xml.in.h:71 msgid "Hong Kong Dollars" msgstr "Hongkong dollar" #: ../data/currencies.xml.in.h:72 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:73 msgid "New Zealand Dollars" msgstr "Nieuwzeelandse dollar" #: ../data/currencies.xml.in.h:74 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:75 #, fuzzy msgid "New Zealand" msgstr "Nieuwzeelandse dollar" #: ../data/currencies.xml.in.h:76 msgid "Singapore Dollars" msgstr "Singapore dollar" #: ../data/currencies.xml.in.h:77 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:78 #, fuzzy msgid "Singapore" msgstr "Singapore dollar" #: ../data/currencies.xml.in.h:79 msgid "South Korean Won" msgstr "Zuid-Koreaanse won" #: ../data/currencies.xml.in.h:80 msgid "ar:KRW,au:₩,won" msgstr "" #: ../data/currencies.xml.in.h:81 #, fuzzy msgid "South Korea" msgstr "Zuid-Koreaanse won" #: ../data/currencies.xml.in.h:82 msgid "South African Rand" msgstr "Zuid-Afrikaanse rand" #: ../data/currencies.xml.in.h:83 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:84 #, fuzzy msgid "South Africa" msgstr "Zuid-Afrikaanse rand" #: ../data/currencies.xml.in.h:85 msgid "Indian Rupee" msgstr "" #: ../data/currencies.xml.in.h:86 msgid "ar:INR,au:₹,rupee" msgstr "" #: ../data/currencies.xml.in.h:87 msgid "India" msgstr "" #: ../data/currencies.xml.in.h:88 msgid "Israeli New Sheqel" msgstr "" #: ../data/currencies.xml.in.h:89 msgid "ar:ILS,au:₪,sheqel" msgstr "" #: ../data/currencies.xml.in.h:90 msgid "Israel" msgstr "" #: ../data/currencies.xml.in.h:91 msgid "Mexican Peso" msgstr "" #: ../data/currencies.xml.in.h:92 msgid "ar:MXN" msgstr "" #: ../data/currencies.xml.in.h:93 msgid "Mexico" msgstr "" #: ../data/currencies.xml.in.h:94 msgid "Brazilian Real" msgstr "" #: ../data/currencies.xml.in.h:95 msgid "ar:BRL" msgstr "" #: ../data/currencies.xml.in.h:96 msgid "Brazil" msgstr "" #: ../data/currencies.xml.in.h:97 #, fuzzy msgid "Icelandic Krónur" msgstr "IJslandse kroon" #: ../data/currencies.xml.in.h:98 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:99 msgid "Iceland" msgstr "" #: ../data/currencies.xml.in.h:100 msgid "Bitcoins" msgstr "" #: ../data/currencies.xml.in.h:101 msgid "ar:BTC,au:₿,a:XBT,bitcoin,p:bitcoins" msgstr "" #: ../data/currencies.xml.in.h:102 #, fuzzy msgid "Kenya Shilling" msgstr "Oostenrijkse schilling" #: ../data/currencies.xml.in.h:103 msgid "ar:KES" msgstr "" #: ../data/currencies.xml.in.h:104 msgid "Kenya" msgstr "" #: ../data/currencies.xml.in.h:105 msgid "Afghan Afghani" msgstr "" #: ../data/currencies.xml.in.h:106 #, fuzzy msgid "ar:AFN,aiu:؋" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:107 msgid "Afghanistan" msgstr "" #: ../data/currencies.xml.in.h:108 #, fuzzy msgid "Albanian Lek" msgstr "Nieuwe Roemeense leu" #: ../data/currencies.xml.in.h:109 msgid "ar:ALL" msgstr "" #: ../data/currencies.xml.in.h:110 msgid "Albania" msgstr "" #: ../data/currencies.xml.in.h:111 msgid "Algerian Dinar" msgstr "" #: ../data/currencies.xml.in.h:112 msgid "ar:DZD" msgstr "" #: ../data/currencies.xml.in.h:113 #, fuzzy msgid "Algeria" msgstr "Algebra" #: ../data/currencies.xml.in.h:114 msgid "Angolan Kwanza" msgstr "" #: ../data/currencies.xml.in.h:115 msgid "ar:AOA" msgstr "" #: ../data/currencies.xml.in.h:116 msgid "Angola" msgstr "" #: ../data/currencies.xml.in.h:117 #, fuzzy msgid "Eastern Caribbean Dollar" msgstr "Australische dollar" #: ../data/currencies.xml.in.h:118 msgid "ar:XCD" msgstr "" #: ../data/currencies.xml.in.h:119 msgid "" "Antigua and Barbuda, Dominica, Grenada, Montserrat, Saint Kitts and Nevis, " "Saint Lucia, Saint Vincent and the Grenadines, Anguilla" msgstr "" #: ../data/currencies.xml.in.h:120 msgid "Argentine Peso" msgstr "" #: ../data/currencies.xml.in.h:121 msgid "ar:ARS" msgstr "" #: ../data/currencies.xml.in.h:122 msgid "Argentina" msgstr "" #: ../data/currencies.xml.in.h:123 msgid "Armenian Dram" msgstr "" #: ../data/currencies.xml.in.h:124 #, fuzzy msgid "ar:AMD,au:֏" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:125 msgid "Armenia" msgstr "" #: ../data/currencies.xml.in.h:126 #, fuzzy msgid "Aruban Florin" msgstr "Hongaarse forint" #: ../data/currencies.xml.in.h:127 msgid "ar:AWG" msgstr "" #: ../data/currencies.xml.in.h:128 msgid "Aruba" msgstr "" #: ../data/currencies.xml.in.h:129 msgid "Netherlands Antillean Guilder" msgstr "" #: ../data/currencies.xml.in.h:130 msgid "ar:ANG" msgstr "" #: ../data/currencies.xml.in.h:131 msgid "Curaçao, Sint Maarten" msgstr "" #: ../data/currencies.xml.in.h:132 msgid "Azerbaijani Manat" msgstr "" #: ../data/currencies.xml.in.h:133 #, fuzzy msgid "ar:AZN,au:₼" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:134 msgid "Azerbaijan" msgstr "" #: ../data/currencies.xml.in.h:135 #, fuzzy msgid "Bahamian Dollar" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:136 msgid "ar:BSD" msgstr "" #: ../data/currencies.xml.in.h:137 msgid "Bahamas" msgstr "" #: ../data/currencies.xml.in.h:138 msgid "Bahraini Dinar" msgstr "" #: ../data/currencies.xml.in.h:139 msgid "ar:BHD" msgstr "" #: ../data/currencies.xml.in.h:140 msgid "Bahrain" msgstr "" #: ../data/currencies.xml.in.h:141 msgid "Bangladeshi Taka" msgstr "" #: ../data/currencies.xml.in.h:142 #, fuzzy msgid "ar:BDT,au:৳" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:143 msgid "Bangladesh" msgstr "" #: ../data/currencies.xml.in.h:144 #, fuzzy msgid "Barbadian Dollar" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:145 msgid "ar:BBD" msgstr "" #: ../data/currencies.xml.in.h:146 msgid "Barbados" msgstr "" #: ../data/currencies.xml.in.h:147 msgid "Belarusian Ruble p. (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:148 msgid "ar:BYR" msgstr "" #: ../data/currencies.xml.in.h:149 #, fuzzy msgid "Belize Dollar" msgstr "Singapore dollar" #: ../data/currencies.xml.in.h:150 msgid "ar:BZD" msgstr "" #: ../data/currencies.xml.in.h:151 msgid "Belize" msgstr "" #: ../data/currencies.xml.in.h:152 #, fuzzy msgid "West African CFA Franc" msgstr "Zuid-Afrikaanse rand" #: ../data/currencies.xml.in.h:153 msgid "ar:XOF,a:CFA" msgstr "" #: ../data/currencies.xml.in.h:154 msgid "" "Benin, Burkina Faso, Guinea-Bissau, Ivory Coast, Mali, Niger, Senegal, Togo" msgstr "" #: ../data/currencies.xml.in.h:155 #, fuzzy msgid "Bermudian Dollar" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:156 msgid "ar:BMD" msgstr "" #: ../data/currencies.xml.in.h:157 msgid "Bermuda" msgstr "" #: ../data/currencies.xml.in.h:158 msgid "Bolivian Boliviano Bs" msgstr "" #: ../data/currencies.xml.in.h:159 msgid "ar:BOB" msgstr "" #: ../data/currencies.xml.in.h:160 msgid "Bolivia" msgstr "" #: ../data/currencies.xml.in.h:161 msgid "Bosnia and Herzegovina Convertible Mark" msgstr "" #: ../data/currencies.xml.in.h:162 msgid "ar:BAM" msgstr "" #: ../data/currencies.xml.in.h:163 msgid "Bosnia and Herzegovina" msgstr "" #: ../data/currencies.xml.in.h:164 msgid "Botswana Pula" msgstr "" #: ../data/currencies.xml.in.h:165 msgid "ar:BWP" msgstr "" #: ../data/currencies.xml.in.h:166 msgid "Botswana" msgstr "" #: ../data/currencies.xml.in.h:167 #, fuzzy msgid "Brunei Dollar" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:168 msgid "ar:BND" msgstr "" #: ../data/currencies.xml.in.h:169 msgid "Brunei" msgstr "" #: ../data/currencies.xml.in.h:170 #, fuzzy msgid "Burundian Franc" msgstr "Belgische frank" #: ../data/currencies.xml.in.h:171 msgid "ar:BIF" msgstr "" #: ../data/currencies.xml.in.h:172 msgid "Burundi" msgstr "" #: ../data/currencies.xml.in.h:173 msgid "Cambodian Riel" msgstr "" #: ../data/currencies.xml.in.h:174 #, fuzzy msgid "ar:KHR,aiu:៛" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:175 msgid "Cambodia" msgstr "" #: ../data/currencies.xml.in.h:176 msgid "Central African CFA Franc" msgstr "" #: ../data/currencies.xml.in.h:177 msgid "ar:XAF,a:FCFA" msgstr "" #: ../data/currencies.xml.in.h:178 msgid "" "Cameroon, Central African Republic, Chad, Republic of the Congo, Equatorial " "Guinea, Gabon" msgstr "" #: ../data/currencies.xml.in.h:179 msgid "Cape Verdean Escudo" msgstr "" #: ../data/currencies.xml.in.h:180 msgid "ar:CVE" msgstr "" #: ../data/currencies.xml.in.h:181 msgid "Cape Verde" msgstr "" #: ../data/currencies.xml.in.h:182 #, fuzzy msgid "Cayman Islands Dollar" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:183 msgid "ar:KYD" msgstr "" #: ../data/currencies.xml.in.h:184 msgid "Cayman Islands" msgstr "" #: ../data/currencies.xml.in.h:185 #, fuzzy msgid "Chilean Peso" msgstr "Filippijnse peso" #: ../data/currencies.xml.in.h:186 msgid "ar:CLP" msgstr "" #: ../data/currencies.xml.in.h:187 msgid "Chile" msgstr "" #: ../data/currencies.xml.in.h:188 #, fuzzy msgid "Colombian Peso" msgstr "Combinaties" #: ../data/currencies.xml.in.h:189 msgid "ar:COP" msgstr "" #: ../data/currencies.xml.in.h:190 #, fuzzy msgid "Colombia" msgstr "Combinaties" #: ../data/currencies.xml.in.h:191 #, fuzzy msgid "Comorian Franc" msgstr "Belgische frank" #: ../data/currencies.xml.in.h:192 msgid "ar:KMF" msgstr "" #: ../data/currencies.xml.in.h:193 msgid "Comoros" msgstr "" #: ../data/currencies.xml.in.h:194 msgid "Democratic Republic of the Congo (Congolese Franc)" msgstr "" #: ../data/currencies.xml.in.h:195 msgid "ar:CDF" msgstr "" #: ../data/currencies.xml.in.h:196 msgid "Democratic Republic of the Congo" msgstr "" #: ../data/currencies.xml.in.h:197 msgid "Costa Rican colón" msgstr "" #: ../data/currencies.xml.in.h:198 msgid "ar:CRC" msgstr "" #: ../data/currencies.xml.in.h:199 msgid "Costa Rica" msgstr "" #: ../data/currencies.xml.in.h:200 msgid "Cuban Peso" msgstr "" #: ../data/currencies.xml.in.h:201 msgid "ar:CUP" msgstr "" #: ../data/currencies.xml.in.h:202 msgid "Cuba" msgstr "" #: ../data/currencies.xml.in.h:203 #, fuzzy msgid "Djiboutian Franc" msgstr "Belgische frank" #: ../data/currencies.xml.in.h:204 msgid "ar:DJF" msgstr "" #: ../data/currencies.xml.in.h:205 msgid "Djibouti" msgstr "" #: ../data/currencies.xml.in.h:206 msgid "Dominican Peso" msgstr "" #: ../data/currencies.xml.in.h:207 msgid "ar:DOP" msgstr "" #: ../data/currencies.xml.in.h:208 msgid "Dominican Republic" msgstr "" #: ../data/currencies.xml.in.h:209 #, fuzzy msgid "Egyptian Pound" msgstr "Cypriotische pond" #: ../data/currencies.xml.in.h:210 msgid "ar:EGP" msgstr "" #: ../data/currencies.xml.in.h:211 msgid "Egypt" msgstr "" #: ../data/currencies.xml.in.h:212 msgid "El Salvadoran Colon (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:213 msgid "ar:SVC" msgstr "" #: ../data/currencies.xml.in.h:214 msgid "Eritrean Nafka" msgstr "" #: ../data/currencies.xml.in.h:215 msgid "ar:ERN" msgstr "" #: ../data/currencies.xml.in.h:216 msgid "Eritrea" msgstr "" #: ../data/currencies.xml.in.h:217 msgid "Ethiopian Birr" msgstr "" #: ../data/currencies.xml.in.h:218 msgid "ar:ETB" msgstr "" #: ../data/currencies.xml.in.h:219 msgid "Ethiopia" msgstr "" #: ../data/currencies.xml.in.h:220 msgid "Falkland Islands Pound" msgstr "" #: ../data/currencies.xml.in.h:221 msgid "ar:FKP" msgstr "" #: ../data/currencies.xml.in.h:222 msgid "Falkland Islands" msgstr "" #: ../data/currencies.xml.in.h:223 #, fuzzy msgid "Fijian Dollar" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:224 msgid "ar:FJD" msgstr "" #: ../data/currencies.xml.in.h:225 msgid "Fiji" msgstr "" #: ../data/currencies.xml.in.h:226 msgid "CFP franc" msgstr "" #: ../data/currencies.xml.in.h:227 msgid "ar:XPF" msgstr "" #: ../data/currencies.xml.in.h:228 msgid "French Polynesia, New Caledonia, Wallis and Futuna" msgstr "" #: ../data/currencies.xml.in.h:229 #, fuzzy msgid "Gambian Dalasi" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:230 msgid "ar:GMD" msgstr "" #: ../data/currencies.xml.in.h:231 msgid "Gambia" msgstr "" #: ../data/currencies.xml.in.h:232 msgid "Georgian Lari" msgstr "" #: ../data/currencies.xml.in.h:233 #, fuzzy msgid "ar:GEL,au:₾" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:234 msgid "Georgia" msgstr "" #: ../data/currencies.xml.in.h:235 msgid "Ghanaian Cedi" msgstr "" #: ../data/currencies.xml.in.h:236 #, fuzzy msgid "ar:GHS,au:₵" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:237 msgid "Ghana" msgstr "" #: ../data/currencies.xml.in.h:238 msgid "Gibraltar Pound" msgstr "" #: ../data/currencies.xml.in.h:239 msgid "ar:GIP" msgstr "" #: ../data/currencies.xml.in.h:240 msgid "Gibraltar" msgstr "" #: ../data/currencies.xml.in.h:241 msgid "Guatemalan Quetzal" msgstr "" #: ../data/currencies.xml.in.h:242 msgid "ar:GTQ" msgstr "" #: ../data/currencies.xml.in.h:243 msgid "Guatemala" msgstr "" #: ../data/currencies.xml.in.h:244 #, fuzzy msgid "Guernsey Pound" msgstr "Ierse pond" #: ../data/currencies.xml.in.h:245 msgid "ar:GGP" msgstr "" #: ../data/currencies.xml.in.h:246 msgid "Guernsey" msgstr "" #: ../data/currencies.xml.in.h:247 #, fuzzy msgid "Guinean Franc" msgstr "Belgische frank" #: ../data/currencies.xml.in.h:248 msgid "ar:GNF" msgstr "" #: ../data/currencies.xml.in.h:249 msgid "Guinea" msgstr "" #: ../data/currencies.xml.in.h:250 #, fuzzy msgid "Guyanese Dollar" msgstr "Australische dollar" #: ../data/currencies.xml.in.h:251 msgid "ar:GYD" msgstr "" #: ../data/currencies.xml.in.h:252 msgid "Guyana" msgstr "" #: ../data/currencies.xml.in.h:253 msgid "Haitian Gourde" msgstr "" #: ../data/currencies.xml.in.h:254 msgid "ar:HTG" msgstr "" #: ../data/currencies.xml.in.h:255 msgid "Haiti" msgstr "" #: ../data/currencies.xml.in.h:256 msgid "Honduran Lempira" msgstr "" #: ../data/currencies.xml.in.h:257 msgid "ar:HNL" msgstr "" #: ../data/currencies.xml.in.h:258 msgid "Honduras" msgstr "" #: ../data/currencies.xml.in.h:259 #, fuzzy msgid "Iranian Rial" msgstr "Italiaanse lire" #: ../data/currencies.xml.in.h:260 #, fuzzy msgid "ar:IRR,aiu:﷼" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:261 msgid "Iran" msgstr "" #: ../data/currencies.xml.in.h:262 msgid "Iraqi Dinar" msgstr "" #: ../data/currencies.xml.in.h:263 msgid "ar:IQD" msgstr "" #: ../data/currencies.xml.in.h:264 msgid "Iraq" msgstr "" #: ../data/currencies.xml.in.h:265 #, fuzzy msgid "Jamaican Dollar" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:266 msgid "ar:JMD" msgstr "" #: ../data/currencies.xml.in.h:267 msgid "Jamaica" msgstr "" #: ../data/currencies.xml.in.h:268 msgid "Jordanian Dinar" msgstr "" #: ../data/currencies.xml.in.h:269 msgid "ar:JOD" msgstr "" #: ../data/currencies.xml.in.h:270 msgid "Jordan" msgstr "" #: ../data/currencies.xml.in.h:271 msgid "Kazakhstani Tenge" msgstr "" #: ../data/currencies.xml.in.h:272 #, fuzzy msgid "ar:KZT,au:₸" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:273 msgid "Kazakhstan" msgstr "" #: ../data/currencies.xml.in.h:274 #, fuzzy msgid "North Korean Won" msgstr "Zuid-Koreaanse won" #: ../data/currencies.xml.in.h:275 msgid "ar:KPW" msgstr "" #: ../data/currencies.xml.in.h:276 #, fuzzy msgid "North Korea" msgstr "Zuid-Koreaanse won" #: ../data/currencies.xml.in.h:277 msgid "Kuwaiti Dinar" msgstr "" #: ../data/currencies.xml.in.h:278 msgid "ar:KWD" msgstr "" #: ../data/currencies.xml.in.h:279 msgid "Kuwait" msgstr "" #: ../data/currencies.xml.in.h:280 msgid "Kyrgyzstani Som" msgstr "" #: ../data/currencies.xml.in.h:281 #, fuzzy msgid "ar:KGS,au:с" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:282 msgid "Kyrgyzstan" msgstr "" #: ../data/currencies.xml.in.h:283 msgid "Lao Kip" msgstr "" #: ../data/currencies.xml.in.h:284 #, fuzzy msgid "ar:LAK,au:₭" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:285 msgid "Laos" msgstr "" #: ../data/currencies.xml.in.h:286 msgid "Lebanese Pound" msgstr "" #: ../data/currencies.xml.in.h:287 msgid "ar:LBP" msgstr "" #: ../data/currencies.xml.in.h:288 msgid "Lebanon" msgstr "" #: ../data/currencies.xml.in.h:289 msgid "Lesotho Loti" msgstr "" #: ../data/currencies.xml.in.h:290 msgid "ar:LSL" msgstr "" #: ../data/currencies.xml.in.h:291 msgid "Lesotho" msgstr "" #: ../data/currencies.xml.in.h:292 #, fuzzy msgid "Liberian Dollar" msgstr "Australische dollar" #: ../data/currencies.xml.in.h:293 msgid "ar:LRD" msgstr "" #: ../data/currencies.xml.in.h:294 msgid "Liberia" msgstr "" #: ../data/currencies.xml.in.h:295 msgid "Libyan Dinar" msgstr "" #: ../data/currencies.xml.in.h:296 msgid "ar:LYD" msgstr "" #: ../data/currencies.xml.in.h:297 msgid "Libya" msgstr "" #: ../data/currencies.xml.in.h:298 msgid "Macanese Pataca" msgstr "" #: ../data/currencies.xml.in.h:299 msgid "ar:MOP" msgstr "" #: ../data/currencies.xml.in.h:300 msgid "Macedonian Denar" msgstr "" #: ../data/currencies.xml.in.h:301 msgid "ar:MKD" msgstr "" #: ../data/currencies.xml.in.h:302 msgid "Macedonia" msgstr "" #: ../data/currencies.xml.in.h:303 msgid "Malagasy Ariary" msgstr "" #: ../data/currencies.xml.in.h:304 msgid "ar:MGA" msgstr "" #: ../data/currencies.xml.in.h:305 msgid "Madagascar" msgstr "" #: ../data/currencies.xml.in.h:306 msgid "Malawian Kwacha" msgstr "" #: ../data/currencies.xml.in.h:307 msgid "ar:MWK" msgstr "" #: ../data/currencies.xml.in.h:308 msgid "Malawi" msgstr "" #: ../data/currencies.xml.in.h:309 msgid "Maldivian Rufiyaa" msgstr "" #: ../data/currencies.xml.in.h:310 msgid "ar:MVR" msgstr "" #: ../data/currencies.xml.in.h:311 msgid "Maldives" msgstr "" #: ../data/currencies.xml.in.h:312 msgid "Mauritanian Ouguiya (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:313 msgid "ar:MRO" msgstr "" #: ../data/currencies.xml.in.h:314 msgid "Mauritian Rupee" msgstr "" #: ../data/currencies.xml.in.h:315 msgid "ar:MUR" msgstr "" #: ../data/currencies.xml.in.h:316 msgid "Mauritius" msgstr "" #: ../data/currencies.xml.in.h:317 msgid "Moldovan Leu" msgstr "" #: ../data/currencies.xml.in.h:318 msgid "ar:MDL" msgstr "" #: ../data/currencies.xml.in.h:319 msgid "Moldova" msgstr "" #: ../data/currencies.xml.in.h:320 msgid "Mongolian Tögrög" msgstr "" #: ../data/currencies.xml.in.h:321 #, fuzzy msgid "ar:MNT,au:₮" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:322 msgid "Mongolia" msgstr "" #: ../data/currencies.xml.in.h:323 msgid "Moroccan Dirham" msgstr "" #: ../data/currencies.xml.in.h:324 msgid "ar:MAD" msgstr "" #: ../data/currencies.xml.in.h:325 msgid "Morocco" msgstr "" #: ../data/currencies.xml.in.h:326 msgid "Mozambican Metical" msgstr "" #: ../data/currencies.xml.in.h:327 msgid "ar:MZN" msgstr "" #: ../data/currencies.xml.in.h:328 msgid "Mozambique" msgstr "" #: ../data/currencies.xml.in.h:329 msgid "Myanmar (Burmese Kyat)" msgstr "" #: ../data/currencies.xml.in.h:330 msgid "ar:MMK" msgstr "" #: ../data/currencies.xml.in.h:331 msgid "Myanmar" msgstr "" #: ../data/currencies.xml.in.h:332 #, fuzzy msgid "Namibian Dollar" msgstr "Canadese dollar" #: ../data/currencies.xml.in.h:333 #, fuzzy msgid "ar:NAD" msgstr "a:NLG,gulden" #: ../data/currencies.xml.in.h:334 msgid "Namibia" msgstr "" #: ../data/currencies.xml.in.h:335 msgid "Nepalese Rupee" msgstr "" #: ../data/currencies.xml.in.h:336 #, fuzzy msgid "ar:NPR" msgstr "a:NLG,gulden" #: ../data/currencies.xml.in.h:337 msgid "Nepal" msgstr "" #: ../data/currencies.xml.in.h:338 msgid "Nicaraguan Córdoba" msgstr "" #: ../data/currencies.xml.in.h:339 #, fuzzy msgid "ar:NIO" msgstr "a:NLG,gulden" #: ../data/currencies.xml.in.h:340 msgid "Nicaragua" msgstr "" #: ../data/currencies.xml.in.h:341 msgid "Nigerian Naira" msgstr "" #: ../data/currencies.xml.in.h:342 #, fuzzy msgid "ar:NGN,au:₦" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:343 msgid "Nigeria" msgstr "" #: ../data/currencies.xml.in.h:344 msgid "Omani Rial" msgstr "" #: ../data/currencies.xml.in.h:345 msgid "ar:OMR" msgstr "" #: ../data/currencies.xml.in.h:346 msgid "Oman" msgstr "" #: ../data/currencies.xml.in.h:347 msgid "Pakistani Rupee" msgstr "" #: ../data/currencies.xml.in.h:348 msgid "ar:PKR" msgstr "" #: ../data/currencies.xml.in.h:349 #, fuzzy msgid "Pakistan" msgstr "Planck constante" #: ../data/currencies.xml.in.h:350 msgid "Panamaian Balboa" msgstr "" #: ../data/currencies.xml.in.h:351 msgid "ar:PAB" msgstr "" #: ../data/currencies.xml.in.h:352 msgid "Panama" msgstr "" #: ../data/currencies.xml.in.h:353 msgid "Papua New Guinean Kina" msgstr "" #: ../data/currencies.xml.in.h:354 msgid "ar:PGK" msgstr "" #: ../data/currencies.xml.in.h:355 msgid "Papua New Guinea" msgstr "" #: ../data/currencies.xml.in.h:356 msgid "Paraguayan Guaraní" msgstr "" #: ../data/currencies.xml.in.h:357 #, fuzzy msgid "ar:PYG,au:₲" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:358 msgid "Paraguay" msgstr "" #: ../data/currencies.xml.in.h:359 msgid "Peruvian Sol" msgstr "" #: ../data/currencies.xml.in.h:360 msgid "ar:PEN" msgstr "" #: ../data/currencies.xml.in.h:361 msgid "Peru" msgstr "" #: ../data/currencies.xml.in.h:362 msgid "Qatari Riyal" msgstr "" #: ../data/currencies.xml.in.h:363 msgid "ar:QAR" msgstr "" #: ../data/currencies.xml.in.h:364 msgid "Qatar" msgstr "" #: ../data/currencies.xml.in.h:365 #, fuzzy msgid "Rwandan Franc" msgstr "Belgische frank" #: ../data/currencies.xml.in.h:366 msgid "ar:RWF" msgstr "" #: ../data/currencies.xml.in.h:367 msgid "Rwanda" msgstr "" #: ../data/currencies.xml.in.h:368 msgid "São Tomé and Príncipe Dobra" msgstr "" #: ../data/currencies.xml.in.h:369 msgid "ar:STD" msgstr "" #: ../data/currencies.xml.in.h:370 msgid "Sao Tome and Principe" msgstr "" #: ../data/currencies.xml.in.h:371 msgid "Saudi Riyal" msgstr "" #: ../data/currencies.xml.in.h:372 msgid "ar:SAR" msgstr "" #: ../data/currencies.xml.in.h:373 msgid "Saudi Arabia" msgstr "" #: ../data/currencies.xml.in.h:374 msgid "Serbian Dinar" msgstr "" #: ../data/currencies.xml.in.h:375 msgid "ar:RSD" msgstr "" #: ../data/currencies.xml.in.h:376 msgid "Serbia" msgstr "" #: ../data/currencies.xml.in.h:377 msgid "Seychellois Rupee" msgstr "" #: ../data/currencies.xml.in.h:378 msgid "ar:SCR" msgstr "" #: ../data/currencies.xml.in.h:379 msgid "Seychelles" msgstr "" #: ../data/currencies.xml.in.h:380 msgid "Sierra Leonean Leone" msgstr "" #: ../data/currencies.xml.in.h:381 msgid "ar:SLL" msgstr "" #: ../data/currencies.xml.in.h:382 msgid "Sierra Leone" msgstr "" #: ../data/currencies.xml.in.h:383 msgid "Solomon Islands Dollar" msgstr "" #: ../data/currencies.xml.in.h:384 msgid "ar:SBD" msgstr "" #: ../data/currencies.xml.in.h:385 msgid "Solomon Islands" msgstr "" #: ../data/currencies.xml.in.h:386 #, fuzzy msgid "Somali Shilling" msgstr "Oostenrijkse schilling" #: ../data/currencies.xml.in.h:387 msgid "ar:SOS" msgstr "" #: ../data/currencies.xml.in.h:388 msgid "Somalia" msgstr "" #: ../data/currencies.xml.in.h:389 msgid "Sri Lankan Rupee;" msgstr "" #: ../data/currencies.xml.in.h:390 #, fuzzy msgid "ar:LKR,au:௹" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:391 msgid "Sri Lanka" msgstr "" #: ../data/currencies.xml.in.h:392 msgid "Sudanese Pound" msgstr "" #: ../data/currencies.xml.in.h:393 msgid "ar:SDG" msgstr "" #: ../data/currencies.xml.in.h:394 msgid "Sudan" msgstr "" #: ../data/currencies.xml.in.h:395 #, fuzzy msgid "Surinamese Dollar" msgstr "Singapore dollar" #: ../data/currencies.xml.in.h:396 msgid "ar:SRD" msgstr "" #: ../data/currencies.xml.in.h:397 #, fuzzy msgid "Suriname" msgstr "naam" #: ../data/currencies.xml.in.h:398 msgid "Swazi Lilangeni" msgstr "" #: ../data/currencies.xml.in.h:399 msgid "ar:SZL" msgstr "" #: ../data/currencies.xml.in.h:400 msgid "Swaziland" msgstr "" #: ../data/currencies.xml.in.h:401 #, fuzzy msgid "Syrian Pound" msgstr "Cypriotische pond" #: ../data/currencies.xml.in.h:402 msgid "ar:SYP" msgstr "" #: ../data/currencies.xml.in.h:403 msgid "Syria" msgstr "" #: ../data/currencies.xml.in.h:404 #, fuzzy msgid "New Taiwan Dollar" msgstr "Nieuwzeelandse dollar" #: ../data/currencies.xml.in.h:405 msgid "ar:TWD" msgstr "" #: ../data/currencies.xml.in.h:406 msgid "Taiwan" msgstr "" #: ../data/currencies.xml.in.h:407 msgid "Tajikistani Somoni" msgstr "" #: ../data/currencies.xml.in.h:408 msgid "ar:TJS" msgstr "" #: ../data/currencies.xml.in.h:409 msgid "Tajikistan" msgstr "" #: ../data/currencies.xml.in.h:410 #, fuzzy msgid "Tanzanian Shilling" msgstr "Oostenrijkse schilling" #: ../data/currencies.xml.in.h:411 msgid "ar:TZS" msgstr "" #: ../data/currencies.xml.in.h:412 msgid "Tanzania" msgstr "" #: ../data/currencies.xml.in.h:413 msgid "Tongan PaÊ»anga" msgstr "" #: ../data/currencies.xml.in.h:414 msgid "ar:TOP" msgstr "" #: ../data/currencies.xml.in.h:415 msgid "Tonga" msgstr "" #: ../data/currencies.xml.in.h:416 msgid "Trinidad and Tobago dollar" msgstr "" #: ../data/currencies.xml.in.h:417 msgid "ar:TTD" msgstr "" #: ../data/currencies.xml.in.h:418 msgid "Trinidad and Tobago" msgstr "" #: ../data/currencies.xml.in.h:419 msgid "Tunisian Dinar" msgstr "" #: ../data/currencies.xml.in.h:420 msgid "ar:TND" msgstr "" #: ../data/currencies.xml.in.h:421 msgid "Tunisia" msgstr "" #: ../data/currencies.xml.in.h:422 msgid "Turkmenistan Manat" msgstr "" #: ../data/currencies.xml.in.h:423 msgid "ar:TMT" msgstr "" #: ../data/currencies.xml.in.h:424 msgid "Turkmenistan" msgstr "" #: ../data/currencies.xml.in.h:425 #, fuzzy msgid "Ugandan Shilling" msgstr "Oostenrijkse schilling" #: ../data/currencies.xml.in.h:426 msgid "ar:UGX" msgstr "" #: ../data/currencies.xml.in.h:427 msgid "Uganda" msgstr "" #: ../data/currencies.xml.in.h:428 msgid "Ukrainian Hryvnia" msgstr "" #: ../data/currencies.xml.in.h:429 #, fuzzy msgid "ar:UAH,au:₴" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:430 msgid "Ukraine" msgstr "" #: ../data/currencies.xml.in.h:431 msgid "United Arab Emirates Dirham" msgstr "" #: ../data/currencies.xml.in.h:432 msgid "ar:AED" msgstr "" #: ../data/currencies.xml.in.h:433 msgid "United Arab Emirates" msgstr "" #: ../data/currencies.xml.in.h:434 msgid "Uruguayan Peso" msgstr "" #: ../data/currencies.xml.in.h:435 msgid "ar:UYU" msgstr "" #: ../data/currencies.xml.in.h:436 msgid "Uruguay" msgstr "" #: ../data/currencies.xml.in.h:437 msgid "Uzbekistan SoÊ»m" msgstr "" #: ../data/currencies.xml.in.h:438 msgid "ar:UZS" msgstr "" #: ../data/currencies.xml.in.h:439 msgid "Uzbekistan" msgstr "" #: ../data/currencies.xml.in.h:440 msgid "Vanuatu Vatu" msgstr "" #: ../data/currencies.xml.in.h:441 msgid "ar:VUV" msgstr "" #: ../data/currencies.xml.in.h:442 msgid "Vanuatu" msgstr "" #: ../data/currencies.xml.in.h:443 msgid "Venezuelan Bolívar" msgstr "" #: ../data/currencies.xml.in.h:444 msgid "ar:VEF" msgstr "" #: ../data/currencies.xml.in.h:445 msgid "Venezuela" msgstr "" #: ../data/currencies.xml.in.h:446 msgid "Vietnamese Dồng" msgstr "" #: ../data/currencies.xml.in.h:447 #, fuzzy msgid "ar:VND,au:₫" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:448 msgid "Vietnam" msgstr "" #: ../data/currencies.xml.in.h:449 msgid "Yemeni Rial" msgstr "" #: ../data/currencies.xml.in.h:450 msgid "ar:YER" msgstr "" #: ../data/currencies.xml.in.h:451 #, fuzzy msgid "Yemen" msgstr "Elementen" #: ../data/currencies.xml.in.h:452 msgid "Zambian Kwacha (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:453 msgid "ar:ZMK" msgstr "" #: ../data/currencies.xml.in.h:454 msgid "Euro Cent" msgstr "Eurocent" #: ../data/currencies.xml.in.h:455 msgid "r:eurocent,p:eurocents" msgstr "eurocent,p:eurocenten" #: ../data/currencies.xml.in.h:456 msgid "Cent (USD)" msgstr "Cent (USD)" #: ../data/currencies.xml.in.h:457 msgid "au:¢,r:cent,p:cents" msgstr "au:¢,cent,p:centen" #: ../data/currencies.xml.in.h:458 #, fuzzy msgid "Belgian Franc (obsolete)" msgstr "Belgische frank" #: ../data/currencies.xml.in.h:459 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:460 #, fuzzy msgid "Greek Drachma (obsolete)" msgstr "Griekse drachme" #: ../data/currencies.xml.in.h:461 #, fuzzy msgid "ar:GRD,au:₯" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:462 #, fuzzy msgid "French Franc (obsolete)" msgstr "Franse franc" #: ../data/currencies.xml.in.h:463 #, fuzzy msgid "ar:FRF,au:₣" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:464 #, fuzzy msgid "Italian Lira (obsolete)" msgstr "Italiaanse lire" #: ../data/currencies.xml.in.h:465 msgid "ar:ITL" msgstr "" #: ../data/currencies.xml.in.h:466 #, fuzzy msgid "Dutch Guilder (obsolete)" msgstr "Nederlandse gulden" #: ../data/currencies.xml.in.h:467 #, fuzzy msgid "ar:NLG" msgstr "a:NLG,gulden" #: ../data/currencies.xml.in.h:468 #, fuzzy msgid "Portuguese Escudo (obsolete)" msgstr "Portugese escudo" #: ../data/currencies.xml.in.h:469 msgid "ar:PTE" msgstr "" #: ../data/currencies.xml.in.h:470 #, fuzzy msgid "Deutsche Mark (obsolete)" msgstr "Duitse mark" #: ../data/currencies.xml.in.h:471 msgid "ar:DEM" msgstr "" #: ../data/currencies.xml.in.h:472 #, fuzzy msgid "Spanish Peseta (obsolete)" msgstr "Spaanse peseta" #: ../data/currencies.xml.in.h:473 #, fuzzy msgid "ar:ESP,au:₧" msgstr "a:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:474 #, fuzzy msgid "Irish Pound (obsolete)" msgstr "Ierse pond" #: ../data/currencies.xml.in.h:475 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:476 #, fuzzy msgid "Luxembourg Franc (obsolete)" msgstr "Luxemburgse frank" #: ../data/currencies.xml.in.h:477 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:478 #, fuzzy msgid "Austrian Schilling (obsolete)" msgstr "Oostenrijkse schilling" #: ../data/currencies.xml.in.h:479 msgid "ar:ATS" msgstr "" #: ../data/currencies.xml.in.h:480 #, fuzzy msgid "Finnish Markka (obsolete)" msgstr "Finse mark" #: ../data/currencies.xml.in.h:481 msgid "ar:FIM" msgstr "" #: ../data/currencies.xml.in.h:482 #, fuzzy msgid "Slovenian Tolar (obsolete)" msgstr "Sloveense tolar" #: ../data/currencies.xml.in.h:483 msgid "ar:SIT" msgstr "" #: ../data/currencies.xml.in.h:484 #, fuzzy msgid "Cypriot Pound (obsolete)" msgstr "Cypriotische pond" #: ../data/currencies.xml.in.h:485 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:486 #, fuzzy msgid "Estonian Kroon (obsolete)" msgstr "Estlandse kroon" #: ../data/currencies.xml.in.h:487 msgid "ar:EEK" msgstr "" #: ../data/currencies.xml.in.h:488 #, fuzzy msgid "Slovak Koruna (obsolete)" msgstr "Slowaakse kroon" #: ../data/currencies.xml.in.h:489 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:490 #, fuzzy msgid "Maltese Lira (obsolete)" msgstr "Maltese Lira" #: ../data/currencies.xml.in.h:491 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:492 #, fuzzy msgid "Latvian Lats (obsolete)" msgstr "Letlandse lat" #: ../data/currencies.xml.in.h:493 msgid "ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:494 #, fuzzy msgid "Lithuanian Litas (obsolete)" msgstr "Litouwse litas" #: ../data/currencies.xml.in.h:495 msgid "ar:LTL" msgstr "" #: ../data/currencies.xml.in.h:496 #, fuzzy msgid "Belarusian Ruble" msgstr "Russische roebel" #: ../data/currencies.xml.in.h:497 msgid "ar:BYN" msgstr "" #: ../data/currencies.xml.in.h:498 msgid "Belarus" msgstr "" #: ../data/currencies.xml.in.h:499 msgid "Zambian Kwacha" msgstr "" #: ../data/currencies.xml.in.h:500 msgid "ar:ZMW" msgstr "" #: ../data/currencies.xml.in.h:501 msgid "Zambia" msgstr "" #: ../data/currencies.xml.in.h:502 msgid "Mauritanian Ouguiya" msgstr "" #: ../data/currencies.xml.in.h:503 msgid "ar:MRU" msgstr "" #: ../data/currencies.xml.in.h:504 #, fuzzy msgid "Mauritania" msgstr "Vervaldatum" #: ../data/datasets.xml.in.h:1 msgid "Data Sets" msgstr "Gegevensverzamelingen" #. Data set for chemical elements #: ../data/datasets.xml.in.h:3 msgid "!datasets!Elements" msgstr "Elementen" #: ../data/datasets.xml.in.h:4 msgid "r:atom" msgstr "atoom" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:6 msgid "!datasets!Element" msgstr "" #: ../data/datasets.xml.in.h:7 msgid "Symbol" msgstr "Symbool" #: ../data/datasets.xml.in.h:8 msgid "r:symbol" msgstr "symbool" #. Chemical elements number #: ../data/datasets.xml.in.h:10 msgid "!datasets!Number" msgstr "Getal" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "getal" #: ../data/datasets.xml.in.h:13 ../data/functions.xml.in.h:647 msgid "Name" msgstr "Naam" #: ../data/datasets.xml.in.h:14 msgid "r:name" msgstr "naam" #: ../data/datasets.xml.in.h:15 msgid "Classification" msgstr "Klassificatie" #: ../data/datasets.xml.in.h:16 #, fuzzy msgid "" "A number representing an element group: 1 Alkali Metal 2 Alkaline-" "Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 " "Metal 7 Metalloid 8 Polyatomic Non-Metal 9 Diatomic Non-" "Metal 10 Noble Gas 11 Unknown chemical properties" msgstr "" "Een getal vertegenwoordigt een groep van elementen: 1 Alkalisch " "metaal 2 Alkalischaardmetaal 3 Lanthanide 4 Actinide 5 " "Overgangsmetaal 6 Metaal 7 Metalloïde 8 Niet-metaal 9 " "Halogeen 10 Edelgas 11 Transactinide" #: ../data/datasets.xml.in.h:17 msgid "r:class" msgstr "klasse" #: ../data/datasets.xml.in.h:18 ../data/functions.xml.in.h:414 msgid "Weight" msgstr "Gewicht" #: ../data/datasets.xml.in.h:19 msgid "r:weight,mass" msgstr "gewicht,massa" #: ../data/datasets.xml.in.h:20 msgid "Boiling Point" msgstr "Kookpunt" #: ../data/datasets.xml.in.h:21 msgid "r:boiling" msgstr "kokend" #: ../data/datasets.xml.in.h:22 msgid "Melting Point" msgstr "Smeltpunt" #: ../data/datasets.xml.in.h:23 msgid "r:melting" msgstr "smeltend" #: ../data/datasets.xml.in.h:24 ../data/units.xml.in.h:117 msgid "Density" msgstr "Dichtheid" #: ../data/datasets.xml.in.h:25 msgid "Density at 295K" msgstr "Dichtheid bij 295K" #: ../data/datasets.xml.in.h:26 msgid "r:density" msgstr "dichtheid" #: ../data/datasets.xml.in.h:27 msgid "X Position" msgstr "X Positie" #: ../data/datasets.xml.in.h:28 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:29 msgid "Y Position" msgstr "Y Positie" #: ../data/datasets.xml.in.h:30 msgid "r:y_pos" msgstr "" #: ../data/datasets.xml.in.h:31 msgid "Planets" msgstr "Planeten" #: ../data/datasets.xml.in.h:32 msgid "r:planet" msgstr "planeet" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "Planeet" #: ../data/datasets.xml.in.h:34 msgid "Orbital Period (Year)" msgstr "Omloopperiode (Jaar)" #. Orbital period for planet #: ../data/datasets.xml.in.h:36 msgid "!datasets!r:year" msgstr "jaar" #: ../data/datasets.xml.in.h:37 msgid "Average Orbital Speed" msgstr "Gemiddelde baansnelheid" #: ../data/datasets.xml.in.h:38 msgid "r:speed" msgstr "snelheid" #: ../data/datasets.xml.in.h:39 msgid "Eccentricity" msgstr "Excentriciteit" #: ../data/datasets.xml.in.h:40 msgid "r:eccentricity" msgstr "excentriciteit" #: ../data/datasets.xml.in.h:41 msgid "Inclination" msgstr "Inclinatie" #: ../data/datasets.xml.in.h:42 msgid "r:inclination" msgstr "inclinatie" #: ../data/datasets.xml.in.h:43 msgid "Number of Satellites" msgstr "Aantal satellieten" #: ../data/datasets.xml.in.h:44 msgid "r:satellites" msgstr "satellieten" #. Planet mass #: ../data/datasets.xml.in.h:46 msgid "!datasets!Mass" msgstr "Massa" #: ../data/datasets.xml.in.h:47 msgid "r:mass" msgstr "massa" #: ../data/datasets.xml.in.h:48 msgid "Mean Density" msgstr "Gemiddelde dichtheid" #: ../data/datasets.xml.in.h:49 msgid "Surface Area" msgstr "Oppervlak (3D)" #. Surface area of planet #: ../data/datasets.xml.in.h:51 msgid "!datasets!r:area" msgstr "oppervlak" #: ../data/datasets.xml.in.h:52 msgid "Equatorial Gravity" msgstr "Equatoriale zwaartekracht" #: ../data/datasets.xml.in.h:53 msgid "r:gravity" msgstr "zwaartekracht" #: ../data/datasets.xml.in.h:54 msgid "Mean Surface Temperature" msgstr "Gemiddelde oppervlaktetemperatuur" #: ../data/datasets.xml.in.h:55 msgid "r:temperature" msgstr "temperatuur" #: ../data/elements.xml.in.h:1 msgid "Hydrogen" msgstr "Waterstof" #: ../data/elements.xml.in.h:2 msgid "Helium" msgstr "" #: ../data/elements.xml.in.h:3 msgid "Lithium" msgstr "" #: ../data/elements.xml.in.h:4 msgid "Beryllium" msgstr "" #: ../data/elements.xml.in.h:5 msgid "Boron" msgstr "Boor" #: ../data/elements.xml.in.h:6 msgid "Carbon" msgstr "Koolstof" #: ../data/elements.xml.in.h:7 msgid "Nitrogen" msgstr "Stikstof" #: ../data/elements.xml.in.h:8 msgid "Oxygen" msgstr "Zuurstof" #: ../data/elements.xml.in.h:9 msgid "Fluorine" msgstr "Fluor" #: ../data/elements.xml.in.h:10 msgid "Neon" msgstr "" #: ../data/elements.xml.in.h:11 msgid "Sodium" msgstr "Natrium" #: ../data/elements.xml.in.h:12 msgid "Magnesium" msgstr "" #: ../data/elements.xml.in.h:13 msgid "Aluminum" msgstr "Aluminium" #: ../data/elements.xml.in.h:14 msgid "Silicon" msgstr "Silicium" #: ../data/elements.xml.in.h:15 msgid "Phosphorus" msgstr "Fosfor" #: ../data/elements.xml.in.h:16 msgid "Sulfur" msgstr "Zwavel" #: ../data/elements.xml.in.h:17 msgid "Chlorine" msgstr "Chloor" #: ../data/elements.xml.in.h:18 msgid "Argon" msgstr "" #: ../data/elements.xml.in.h:19 msgid "Potassium" msgstr "Kalium" #: ../data/elements.xml.in.h:20 msgid "Calcium" msgstr "" #: ../data/elements.xml.in.h:21 msgid "Scandium" msgstr "" #: ../data/elements.xml.in.h:22 msgid "Titanium" msgstr "Titaan" #: ../data/elements.xml.in.h:23 msgid "Vanadium" msgstr "" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "Chroom" #: ../data/elements.xml.in.h:25 msgid "Manganese" msgstr "Mangaan" #: ../data/elements.xml.in.h:26 msgid "Iron" msgstr "IJzer" #: ../data/elements.xml.in.h:27 msgid "Cobalt" msgstr "Kobalt" #: ../data/elements.xml.in.h:28 msgid "Nickel" msgstr "Nikkel" #: ../data/elements.xml.in.h:29 msgid "Copper" msgstr "Koper" #: ../data/elements.xml.in.h:30 msgid "Zinc" msgstr "Zink" #: ../data/elements.xml.in.h:31 msgid "Gallium" msgstr "" #: ../data/elements.xml.in.h:32 msgid "Germanium" msgstr "" #: ../data/elements.xml.in.h:33 msgid "Arsenic" msgstr "Arsenicum" #: ../data/elements.xml.in.h:34 msgid "Selenium" msgstr "" #: ../data/elements.xml.in.h:35 msgid "Bromine" msgstr "Broom" #: ../data/elements.xml.in.h:36 msgid "Krypton" msgstr "" #: ../data/elements.xml.in.h:37 msgid "Rubidium" msgstr "" #: ../data/elements.xml.in.h:38 msgid "Strontium" msgstr "" #: ../data/elements.xml.in.h:39 msgid "Yttrium" msgstr "" #: ../data/elements.xml.in.h:40 msgid "Zirconium" msgstr "" #: ../data/elements.xml.in.h:41 msgid "Niobium" msgstr "" #: ../data/elements.xml.in.h:42 msgid "Molybdenum" msgstr "Molybdeen" #: ../data/elements.xml.in.h:43 msgid "Technetium" msgstr "" #: ../data/elements.xml.in.h:44 msgid "Ruthenium" msgstr "" #: ../data/elements.xml.in.h:45 msgid "Rhodium" msgstr "" #: ../data/elements.xml.in.h:46 msgid "Palladium" msgstr "" #: ../data/elements.xml.in.h:47 msgid "Silver" msgstr "Zilver" #: ../data/elements.xml.in.h:48 msgid "Cadmium" msgstr "" #: ../data/elements.xml.in.h:49 msgid "Indium" msgstr "" #: ../data/elements.xml.in.h:50 msgid "Tin" msgstr "" #: ../data/elements.xml.in.h:51 msgid "Antimony" msgstr "Antimoon" #: ../data/elements.xml.in.h:52 msgid "Tellurium" msgstr "Telluur" #: ../data/elements.xml.in.h:53 msgid "Iodine" msgstr "Jood" #: ../data/elements.xml.in.h:54 msgid "Xenon" msgstr "" #: ../data/elements.xml.in.h:55 msgid "Cesium" msgstr "" #: ../data/elements.xml.in.h:56 msgid "Barium" msgstr "" #: ../data/elements.xml.in.h:57 msgid "Lanthanum" msgstr "Lanthaan" #: ../data/elements.xml.in.h:58 msgid "Cerium" msgstr "" #: ../data/elements.xml.in.h:59 msgid "Praseodymium" msgstr "" #: ../data/elements.xml.in.h:60 msgid "Neodymium" msgstr "" #: ../data/elements.xml.in.h:61 msgid "Promethium" msgstr "" #: ../data/elements.xml.in.h:62 msgid "Samarium" msgstr "" #: ../data/elements.xml.in.h:63 msgid "Europium" msgstr "" #: ../data/elements.xml.in.h:64 msgid "Gadolinium" msgstr "" #: ../data/elements.xml.in.h:65 msgid "Terbium" msgstr "" #: ../data/elements.xml.in.h:66 msgid "Dysprosium" msgstr "" #: ../data/elements.xml.in.h:67 msgid "Holmium" msgstr "" #: ../data/elements.xml.in.h:68 msgid "Erbium" msgstr "" #: ../data/elements.xml.in.h:69 msgid "Thulium" msgstr "" #: ../data/elements.xml.in.h:70 msgid "Ytterbium" msgstr "" #: ../data/elements.xml.in.h:71 msgid "Lutetium" msgstr "" #: ../data/elements.xml.in.h:72 msgid "Hafnium" msgstr "" #: ../data/elements.xml.in.h:73 msgid "Tantalum" msgstr "Tantaal" #: ../data/elements.xml.in.h:74 msgid "Tungsten" msgstr "" #: ../data/elements.xml.in.h:75 msgid "Rhenium" msgstr "" #: ../data/elements.xml.in.h:76 msgid "Osmium" msgstr "" #: ../data/elements.xml.in.h:77 msgid "Iridium" msgstr "" #: ../data/elements.xml.in.h:78 msgid "Platinum" msgstr "Platina" #: ../data/elements.xml.in.h:79 msgid "Gold" msgstr "Goud" #. Chemical element #: ../data/elements.xml.in.h:81 msgid "!elements!Mercury" msgstr "Kwik" #: ../data/elements.xml.in.h:82 msgid "Thallium" msgstr "" #: ../data/elements.xml.in.h:83 msgid "Lead" msgstr "Lood" #: ../data/elements.xml.in.h:84 msgid "Bismuth" msgstr "Bismut" #: ../data/elements.xml.in.h:85 msgid "Polonium" msgstr "" #: ../data/elements.xml.in.h:86 msgid "Astatine" msgstr "" #: ../data/elements.xml.in.h:87 msgid "Radon" msgstr "" #: ../data/elements.xml.in.h:88 msgid "Francium" msgstr "" #: ../data/elements.xml.in.h:89 msgid "Radium" msgstr "" #: ../data/elements.xml.in.h:90 msgid "Actinium" msgstr "" #: ../data/elements.xml.in.h:91 msgid "Thorium" msgstr "" #: ../data/elements.xml.in.h:92 msgid "Protactinium" msgstr "" #: ../data/elements.xml.in.h:93 msgid "Uranium" msgstr "Uraan" #: ../data/elements.xml.in.h:94 msgid "Neptunium" msgstr "" #: ../data/elements.xml.in.h:95 msgid "Plutonium" msgstr "" #: ../data/elements.xml.in.h:96 msgid "Americium" msgstr "" #: ../data/elements.xml.in.h:97 msgid "Curium" msgstr "" #: ../data/elements.xml.in.h:98 msgid "Berkelium" msgstr "" #: ../data/elements.xml.in.h:99 msgid "Californium" msgstr "" #: ../data/elements.xml.in.h:100 msgid "Einsteinium" msgstr "" #: ../data/elements.xml.in.h:101 msgid "Fermium" msgstr "" #: ../data/elements.xml.in.h:102 msgid "Mendelevium" msgstr "" #: ../data/elements.xml.in.h:103 msgid "Nobelium" msgstr "" #: ../data/elements.xml.in.h:104 msgid "Lawrencium" msgstr "" #: ../data/elements.xml.in.h:105 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:106 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Copernicium" msgstr "" #: ../data/elements.xml.in.h:114 #, fuzzy msgid "Nihonium" msgstr "Titaan" #: ../data/elements.xml.in.h:115 msgid "Flerovium" msgstr "" #: ../data/elements.xml.in.h:116 msgid "Moscovium" msgstr "" #: ../data/elements.xml.in.h:117 msgid "Livermorium" msgstr "" #: ../data/elements.xml.in.h:118 #, fuzzy msgid "Tennessine" msgstr "Regressie" #: ../data/elements.xml.in.h:119 msgid "Oganesson" msgstr "" #: ../data/functions.xml.in.h:1 msgid "Matrices & Vectors" msgstr "Matrices & vectoren" #: ../data/functions.xml.in.h:2 msgid "Construct Vector" msgstr "Vector construeren" #: ../data/functions.xml.in.h:3 msgid "r:vector" msgstr "" #: ../data/functions.xml.in.h:4 msgid "Returns a vector with listed elements." msgstr "Retourneert een vector met de opgegeven elementen." #. Vector/matrix elements #: ../data/functions.xml.in.h:6 msgid "Elements" msgstr "Elementen" #: ../data/functions.xml.in.h:7 msgid "Generate Vector" msgstr "Vector aanmaken" #: ../data/functions.xml.in.h:8 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:9 msgid "" "Returns a vector generated from a function with a variable (default x) " "running from min to max. The fourth argument is either the requested number " "of elements if the sixth argument is false (default) or the step between " "each value of the variable." msgstr "" "Berekent een vector met behulp van een functie waarvan de variabele " "(standaard x) waarden krijgt tussen min en max. Het vierde argument is of " "het vereiste aantal elementen indien het zesde argument onwaar is " "(standaard) of de stapgrootte tussen elke waarde van de variabele." #: ../data/functions.xml.in.h:10 msgid "Function" msgstr "Functie" #: ../data/functions.xml.in.h:11 msgid "Min" msgstr "" #: ../data/functions.xml.in.h:12 msgid "Max" msgstr "" #: ../data/functions.xml.in.h:13 msgid "Dimension / Step size" msgstr "Dimensie / stapgrootte" #: ../data/functions.xml.in.h:14 msgid "Variable" msgstr "Variabele" #: ../data/functions.xml.in.h:15 msgid "Use step size" msgstr "Stapgrootte gebruiken" #: ../data/functions.xml.in.h:16 msgid "Sort" msgstr "Sorteren" #: ../data/functions.xml.in.h:17 msgid "r:sort" msgstr "sorteren" #: ../data/functions.xml.in.h:18 #, fuzzy msgid "Returns a sorted vector." msgstr "Retourneert de inhoud van het RPN-stapelgeheugen als een vector." #: ../data/functions.xml.in.h:19 msgid "Vector" msgstr "" #: ../data/functions.xml.in.h:20 msgid "Ascending" msgstr "Oplopend" #: ../data/functions.xml.in.h:21 msgid "Rank" msgstr "Rangorde" #: ../data/functions.xml.in.h:22 msgid "r:rank" msgstr "rangorde" #: ../data/functions.xml.in.h:23 msgid "" "Returns a vector with values of elements replaced with their mutual ranks." msgstr "" "Retourneert een vector waarin de elementen zijn vervangen door hun " "onderlinge rangorde." #: ../data/functions.xml.in.h:24 msgid "Vector Limits" msgstr "Vectorgrenzen" #: ../data/functions.xml.in.h:25 msgid "r:limits" msgstr "grenzen" #: ../data/functions.xml.in.h:26 msgid "Returns a part of a vector between two positions." msgstr "Retourneert een deel van een vector tussen twee posities." #: ../data/functions.xml.in.h:27 msgid "Lower limit" msgstr "Ondergrens" #: ../data/functions.xml.in.h:28 msgid "Upper limit" msgstr "Bovengrens" #: ../data/functions.xml.in.h:29 msgid "Dimension" msgstr "Dimensie" #: ../data/functions.xml.in.h:30 msgid "r:dimension" msgstr "dimensie" #: ../data/functions.xml.in.h:31 msgid "Returns the number of elements in a vector." msgstr "Retourneert het aantal elementen in een vector." #: ../data/functions.xml.in.h:32 msgid "Merge Vectors" msgstr "Vectoren samenvoegen" #: ../data/functions.xml.in.h:33 msgid "r:mergevectors" msgstr "vectorensamenvoegen" #: ../data/functions.xml.in.h:34 msgid "Returns a vector with the elements from two vectors." msgstr "Retourneert een vector met de elementen van twee vectoren." #: ../data/functions.xml.in.h:35 msgid "Vector 1" msgstr "" #: ../data/functions.xml.in.h:36 msgid "Vector 2" msgstr "" #: ../data/functions.xml.in.h:37 msgid "Construct Matrix" msgstr "Matrix construeren" #: ../data/functions.xml.in.h:38 msgid "r:matrix" msgstr "" #: ../data/functions.xml.in.h:39 msgid "" "Returns a matrix with specified dimensions and listed elements. Omitted " "elements are set to zero." msgstr "" "Retourneert een matrix met opgegeven dimensies en gegeven elementen. " "Weggelaten elementen worden op nul gesteld." #: ../data/functions.xml.in.h:40 msgid "Rows" msgstr "Rijen" #: ../data/functions.xml.in.h:41 msgid "Columns" msgstr "Kolommen" #: ../data/functions.xml.in.h:42 msgid "Convert Matrix to Vector" msgstr "Matrix naar vector converteren" #: ../data/functions.xml.in.h:43 msgid "r:matrix2vector" msgstr "" #: ../data/functions.xml.in.h:44 msgid "Puts each element of a matrix in vertical order in a vector." msgstr "" "Ieder element van een matrix wordt in verticale volgorde in een vector " "geplaatst." #: ../data/functions.xml.in.h:45 msgid "Matrix" msgstr "" #: ../data/functions.xml.in.h:46 msgid "Matrix Area" msgstr "Matrixbereik" #. Matrix area #: ../data/functions.xml.in.h:48 msgid "r:area" msgstr "oppervlak" #: ../data/functions.xml.in.h:49 msgid "Returns a part of a matrix." msgstr "Retourneert een deel van een matrix." #: ../data/functions.xml.in.h:50 msgid "Start row" msgstr "Startrij" #: ../data/functions.xml.in.h:51 msgid "Start column" msgstr "Startkolom" #: ../data/functions.xml.in.h:52 msgid "End row" msgstr "Einde rij" #: ../data/functions.xml.in.h:53 msgid "End column" msgstr "Einde kolom" #: ../data/functions.xml.in.h:54 msgid "r:rows" msgstr "rijen" #: ../data/functions.xml.in.h:55 msgid "Returns the number of rows in a matrix." msgstr "Retourneert het aantal rijen in een matrix." #: ../data/functions.xml.in.h:56 msgid "r:columns" msgstr "kolommen" #: ../data/functions.xml.in.h:57 msgid "Returns the number of columns in a matrix." msgstr "Retourneert het aantal kolommen in een matrix." #: ../data/functions.xml.in.h:58 msgid "Extract row as vector" msgstr "Rij als vector uit (matrix) halen" #: ../data/functions.xml.in.h:59 msgid "r:row" msgstr "rij" #: ../data/functions.xml.in.h:60 msgid "Returns a row in a matrix as a vector." msgstr "Retourneert een rij in een matrix als een vector." #: ../data/functions.xml.in.h:61 msgid "Row" msgstr "Rij" #: ../data/functions.xml.in.h:62 msgid "Extract Column as Vector" msgstr "Kolom als vector uit (matrix) halen" #: ../data/functions.xml.in.h:63 msgid "r:column" msgstr "kolom" #: ../data/functions.xml.in.h:64 msgid "Returns a column in a matrix as a vector." msgstr "Retourneert een kolom van een matrix als een vector." #: ../data/functions.xml.in.h:65 msgid "Column" msgstr "Kolom" #: ../data/functions.xml.in.h:66 msgid "r:elements" msgstr "elementen" #: ../data/functions.xml.in.h:67 msgid "Returns the number of elements in a matrix or vector." msgstr "Retourneert het aantal elementen in een matrix of vector." #: ../data/functions.xml.in.h:68 msgid "Matrix or vector" msgstr "Matrix of vector" #. Vector/matrix element #: ../data/functions.xml.in.h:70 msgid "Element" msgstr "" #: ../data/functions.xml.in.h:71 msgid "r:element" msgstr "" #: ../data/functions.xml.in.h:72 msgid "" "Returns the element at specified position in a matrix (row and column) or " "vector (index)." msgstr "" "Retourneert het element op de opgegeven positie in een matrix (rij en kolom) " "of vector (index)." #: ../data/functions.xml.in.h:73 msgid "Matrix/vector" msgstr "Matrix/vector" #: ../data/functions.xml.in.h:74 msgid "Row/index" msgstr "Rij/Index" #: ../data/functions.xml.in.h:75 msgid "Transpose" msgstr "Transponeren" #: ../data/functions.xml.in.h:76 msgid "r:transpose" msgstr "transponeren" #: ../data/functions.xml.in.h:77 msgid "Returns the transpose of a matrix." msgstr "Retourneert de getransponeerde van een matrix." #: ../data/functions.xml.in.h:78 msgid "Identity" msgstr "Identiteit" #: ../data/functions.xml.in.h:79 msgid "r:identity" msgstr "identiteit" #: ../data/functions.xml.in.h:80 msgid "" "Returns the identity matrix of a matrix or with specified number of rows/" "columns." msgstr "" "Retourneert de eenheidsmatrix bij een matrix of met een opgegeven aantal " "rijen/kolommen." #: ../data/functions.xml.in.h:81 msgid "Matrix or rows/columns" msgstr "Matrix of rijen/kolommen" #: ../data/functions.xml.in.h:82 msgid "Determinant" msgstr "" #: ../data/functions.xml.in.h:83 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:84 msgid "Calculates the determinant of a matrix." msgstr "Berekent de determinant van een matrix." #: ../data/functions.xml.in.h:85 msgid "Permanent" msgstr "" #: ../data/functions.xml.in.h:86 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:87 msgid "" "Calculates the permanent of a matrix. The permanent differs from a " "determinant in that all signs in the expansion by minors are taken as " "positive." msgstr "" "Berekent de permanent van een matrix. Het verschil met de determinant is dat " "alle subdeterminanten met +1 worden vermenigvuldigd, en bij de determinant " "om en om met +1 en met -1." #: ../data/functions.xml.in.h:88 msgid "Adjugate (Adjoint)" msgstr "Aangrenzend" #: ../data/functions.xml.in.h:89 msgid "r:adj" msgstr "" #: ../data/functions.xml.in.h:90 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "Berekent de geadjungeerde matrix." #: ../data/functions.xml.in.h:91 msgid "Cofactor" msgstr "" #: ../data/functions.xml.in.h:92 msgid "r:cofactor" msgstr "" #: ../data/functions.xml.in.h:93 msgid "Calculates the cofactor of the element at specified position." msgstr "Berekent de cofactor van het element op de opgegeven positie." #: ../data/functions.xml.in.h:94 msgid "Matrix Inverse" msgstr "Inverse matrix" #: ../data/functions.xml.in.h:95 msgid "r:inverse" msgstr "" #: ../data/functions.xml.in.h:96 msgid "" "Calculates the inverse of a matrix. The inverse is the matrix that " "multiplied by the original matrix equals the identity matrix (AB = BA = I)." msgstr "" "Retourneert de inverse van een matrix. De inverse matrix is de matrix die, " "vermenigvuldigd met de originele matrix, de eenheidsmatrix geeft (AB = BA = " "E)." #: ../data/functions.xml.in.h:97 msgid "Load CSV File" msgstr "Inlezen CSV-bestand" #: ../data/functions.xml.in.h:98 msgid "r:load" msgstr "lees" #: ../data/functions.xml.in.h:99 msgid "Returns a matrix imported from a CSV data file." msgstr "Retourneert een matrix, geïmporteerd uit een CSV-gegevensbestand." #: ../data/functions.xml.in.h:100 msgid "Filename" msgstr "Bestandsnaam" #: ../data/functions.xml.in.h:101 msgid "First data row" msgstr "Eerste gegevensrij" #: ../data/functions.xml.in.h:102 msgid "Separator" msgstr "Scheidingsteken" #: ../data/functions.xml.in.h:103 msgid "Export To CSV File" msgstr "Exporteren naar CSV-bestand" #: ../data/functions.xml.in.h:104 msgid "r:export" msgstr "exporteren" #: ../data/functions.xml.in.h:105 msgid "Exports a matrix to a CSV data file." msgstr "Exporteert een matrix naar een CSV-gegevensbestand." #: ../data/functions.xml.in.h:106 msgid "Magnitude" msgstr "" #: ../data/functions.xml.in.h:107 msgid "r:magnitude" msgstr "" #: ../data/functions.xml.in.h:108 msgid "" "Calculates the magnitude of a value. This function returns the same value as " "abs() for all values except vectors." msgstr "" #: ../data/functions.xml.in.h:109 msgid "Value" msgstr "Waarde" #: ../data/functions.xml.in.h:110 #, fuzzy msgid "Hadamard Product" msgstr "Uitproduct" #: ../data/functions.xml.in.h:111 #, fuzzy msgid "r:hadamard" msgstr "harmgem" #: ../data/functions.xml.in.h:112 msgid "" "Mulitplies each separate element in matrix 1 with the corresponding element " "in matrix 2." msgstr "" #: ../data/functions.xml.in.h:113 #, fuzzy msgid "Matrix 1" msgstr "Matrixbereik" #: ../data/functions.xml.in.h:114 #, fuzzy msgid "Matrix 2" msgstr "Matrixbereik" #: ../data/functions.xml.in.h:115 #, fuzzy msgid "Entrywise Function" msgstr "Functie" #: ../data/functions.xml.in.h:116 msgid "r:entrywise" msgstr "" #: ../data/functions.xml.in.h:117 msgid "" "Calculates a new matrix or vector using each separate element in matrix/" "vector 1 and the corresponding (in the same row and column) elements in " "matrix/vector 2. An unlimited number of matrices/vectors can be specified, " "with each matrix/vector argument followed by the corresponding variable used " "in the function argument." msgstr "" #: ../data/functions.xml.in.h:118 #, fuzzy msgid "Matrices/vectors and variables" msgstr "Vectorvariabele" #: ../data/functions.xml.in.h:119 msgid "Norm (length)" msgstr "Norm (lengte)" #: ../data/functions.xml.in.h:120 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:121 msgid "Calculates the norm/length of a vector." msgstr "Berekent de norm/lengte van een vector." #: ../data/functions.xml.in.h:122 msgid "Cross Product" msgstr "Uitproduct" #: ../data/functions.xml.in.h:123 msgid "r:cross" msgstr "uitproduct" #: ../data/functions.xml.in.h:124 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "Berekent het uitproduct van twee 3-dimensionale vectoren." #: ../data/functions.xml.in.h:125 msgid "Combinatorics" msgstr "Combinatoriek" #: ../data/functions.xml.in.h:126 msgid "Factorial" msgstr "Faculteit" #: ../data/functions.xml.in.h:127 msgid "" "Calculates the factorial of an integer. Multiplies the argument with every " "lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number " "followed by one exclamation mark." msgstr "" "Berekent de faculteit van een positief geheel getal n: (n(n-1)(n-2)... " "*2*1. Kan ook worden ingevoerd als een positief geheel getal, gevolgd door " "een uitroepteken." #: ../data/functions.xml.in.h:128 msgid "r:factorial" msgstr "faculteit" #: ../data/functions.xml.in.h:129 msgid "Double Factorial" msgstr "Dubbele faculteit" #: ../data/functions.xml.in.h:130 msgid "r:factorial2" msgstr "faculteit2" #: ../data/functions.xml.in.h:131 msgid "" "Calculates the double factorial of an integer. Multiplies the argument with " "every second lesser positive integer (n(n-2)(n-4)...). Can also be entered " "as a number followed by two exclamation marks." msgstr "" "Berekent de dubbelfaculteit van een positief geheel getal n: (n(n-2)(n-4)... " "Kan ook worden ingevoerd als een positief geheel getal, gevolgd door twee " "uitroeptekens." #: ../data/functions.xml.in.h:132 msgid "Multifactorial" msgstr "Multifaculteit" #: ../data/functions.xml.in.h:133 msgid "r:multifactorial" msgstr "multifaculteit" #: ../data/functions.xml.in.h:134 msgid "" "Calculates the multifactorial of an integer. Multiplies the argument with " "every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a " "number followed by three or more exclamation marks." msgstr "" "Berekent de multifaculteit van een positief geheel getal n: (n(n-x)" "(n-2x)...). Kan ook worden ingevoerd als een positief geheel getal gevolgd " "door drie of meer uitroeptekens." #: ../data/functions.xml.in.h:135 msgid "Binomial Coefficient" msgstr "Binomiaalcoëfficiënt" #: ../data/functions.xml.in.h:136 msgid "r:binomial" msgstr "binomiaal" #: ../data/functions.xml.in.h:137 msgid "Exponent" msgstr "" #: ../data/functions.xml.in.h:138 msgid "Index" msgstr "" #: ../data/functions.xml.in.h:139 msgid "Hyperfactorial" msgstr "Hyperfaculteit" #: ../data/functions.xml.in.h:140 msgid "r:hyperfactorial" msgstr "hyperfaculteit" #: ../data/functions.xml.in.h:141 msgid "" "Calculates the hyperfactorial of an integer. Multiplies the argument raised " "by itself with every lesser positive integer raised by themselves (1^1 * " "2^2 ... n^n)." msgstr "" "Berekent de hyperfaculteit van een positief geheel getal n: " "(n^n*(n-1)^(n-1)...*2^2*1^1." #: ../data/functions.xml.in.h:142 msgid "Superfactorial" msgstr "Superfaculteit" #: ../data/functions.xml.in.h:143 msgid "r:superfactorial" msgstr "superfaculteit" #: ../data/functions.xml.in.h:144 msgid "" "Calculates the superfactorial of an integer. Multiplies the factorial of the " "argument with the factorial of every lesser positive integer (1! * 2! ... " "n!)." msgstr "" "Berekent de superfaculteit van een positief geheel getal n: (n!*(n-1)!...*2!" "*1!)" #: ../data/functions.xml.in.h:145 msgid "Permutations (Variations)" msgstr "Permutaties (Variaties)" #: ../data/functions.xml.in.h:146 msgid "r:perm,variations" msgstr "perm,variaties" #: ../data/functions.xml.in.h:147 msgid "" "Returns the number of possible arrangements of an ordered list with a number " "of objects to choose from and a list size. If there are three objects (1, 2 " "and 3) that is put in a list with two positions, the alternatives are [1, " "2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of " "permutations is 6." msgstr "" "Retourneert op hoeveel manieren een bepaald aantal objecten op een geordende " "manier kunnen worden gekozen uit een verzameling van (verschillende) " "objecten. Stel er zijn drie objecten (1, 2, en 3) waarvan er twee moeten " "worden gekozen in een geordende lijst, dan zijn de mogelijkheden [1, 2], [2, " "1], [1, 3], [3, 1], [2, 3] en [3, 2], en is het aantal permutaties dus 6." #: ../data/functions.xml.in.h:148 msgid "Objects" msgstr "Objecten" #: ../data/functions.xml.in.h:149 msgid "Size" msgstr "Grootte" #: ../data/functions.xml.in.h:150 msgid "Combinations" msgstr "Combinaties" #: ../data/functions.xml.in.h:151 msgid "r:comb" msgstr "kam" #: ../data/functions.xml.in.h:152 msgid "" "Returns the number of possible arrangements of an unordered list with a " "number of objects to choose from and a list size. If there are three objects " "(1, 2 and 3) that is put in a list with place for two, the alternatives are " "[1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3." msgstr "" "Retourneert op hoeveel manieren een bepaald aantal objecten op een niet " "geordende manier kunnen worden gekozen uit een verzameling van " "(verschillende) objecten. Stel er zijn drie objecten (1, 2, en 3) waarvan er " "twee moeten worden gekozen in een niet geordende lijst, dan zijn de " "mogelijkheden [1, 2], [1, 3] en [2, 3], en is het aantal combinaties dus 6." #: ../data/functions.xml.in.h:153 msgid "Derangements" msgstr "Derangementen" #: ../data/functions.xml.in.h:154 msgid "r:derangements" msgstr "derangementen" #: ../data/functions.xml.in.h:155 msgid "" "Returns the number of possible rearrangements of an ordered list, of a " "certain size, where none of the objects are on their original position. If " "the original list is [1, 2, 3], the possible derangements are [2, 3, 1] and " "[3, 1, 2], and thus the number of derangements is 2." msgstr "" "Retourneert op hoeveel manieren een geordende lijst van objecten zo kan " "worden herschikt dat geen der objecten op zijn oorspronkelijke posite " "terecht komt. Indien de oorspronkelijke lijst [1, 2, 3] is, zijn de " "mogelijke herschikkingen [2, 3, 1] en [3, 1, 2], en is het aantal mogelijke " "herschikkingen dus 2." #: ../data/functions.xml.in.h:156 msgid "Number of elements" msgstr "Aantal elementen" #: ../data/functions.xml.in.h:157 msgid "Number Theory" msgstr "Getallentheorie" #: ../data/functions.xml.in.h:158 msgid "Absolute Value" msgstr "Absolute waarde" #: ../data/functions.xml.in.h:159 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:160 msgid "Arithmetic" msgstr "Rekenen" #: ../data/functions.xml.in.h:161 msgid "Signum" msgstr "" #: ../data/functions.xml.in.h:162 msgid "r:sgn" msgstr "" #. A numerical value #: ../data/functions.xml.in.h:164 msgid "Number" msgstr "Nummer" #: ../data/functions.xml.in.h:165 msgid "Value for zero" msgstr "" #: ../data/functions.xml.in.h:166 msgid "Numerator" msgstr "Teller" #: ../data/functions.xml.in.h:167 msgid "r:numerator" msgstr "noemer" #: ../data/functions.xml.in.h:168 msgid "Denominator" msgstr "Noemer" #: ../data/functions.xml.in.h:169 msgid "r:denominator" msgstr "noemer" #: ../data/functions.xml.in.h:170 msgid "Remainder" msgstr "Rest" #: ../data/functions.xml.in.h:171 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:172 msgid "Modulus" msgstr "Modulus" #: ../data/functions.xml.in.h:173 msgid "r:mod" msgstr "." #: ../data/functions.xml.in.h:174 msgid "Negate" msgstr "Ander teken" #: ../data/functions.xml.in.h:175 msgid "r:neg" msgstr "anderteken" #: ../data/functions.xml.in.h:176 msgid "Reciprocal" msgstr "Omgekeerde waarde (x naar 1/x)" #: ../data/functions.xml.in.h:177 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:178 msgid "Multiply" msgstr "Vermenigvuldigen" #: ../data/functions.xml.in.h:179 msgid "r:multiply" msgstr "vermenigvuldigen" #: ../data/functions.xml.in.h:180 msgid "Factors" msgstr "Factoren" #: ../data/functions.xml.in.h:181 msgid "Add" msgstr "Optellen" #: ../data/functions.xml.in.h:182 msgid "r:add" msgstr "optellen" #: ../data/functions.xml.in.h:183 msgid "Terms" msgstr "Termen" #: ../data/functions.xml.in.h:184 msgid "Subtract" msgstr "Aftrekken" #: ../data/functions.xml.in.h:185 msgid "r:subtract" msgstr "aftrekken" #: ../data/functions.xml.in.h:186 msgid "Divide" msgstr "Delen" #: ../data/functions.xml.in.h:187 msgid "r:divide" msgstr "delen" #: ../data/functions.xml.in.h:188 msgid "Raise" msgstr "Machtverheffen" #: ../data/functions.xml.in.h:189 msgid "r:raise" msgstr "machtverheffen" #: ../data/functions.xml.in.h:190 msgid "Base" msgstr "Grondtal" #: ../data/functions.xml.in.h:191 msgid "Polynomials" msgstr "Polynomen (veeltermen)" #: ../data/functions.xml.in.h:192 msgid "Coefficient" msgstr "Coëfficiënt" #: ../data/functions.xml.in.h:193 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:194 msgid "Polynomial" msgstr "Polynoom (veelterm)" #: ../data/functions.xml.in.h:195 msgid "Leading Coefficient" msgstr "Eerste coëfficiënt" #: ../data/functions.xml.in.h:196 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:197 msgid "Trailing Coefficient" msgstr "Laatste coëfficiënt" #: ../data/functions.xml.in.h:198 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:199 msgid "Polynomial Degree" msgstr "Graad van polynoom (veelterm)" #: ../data/functions.xml.in.h:200 msgid "r:degree" msgstr "graad" #: ../data/functions.xml.in.h:201 msgid "Lowest Degree (Valuation)" msgstr "Laagste graad (waardebepaling)" #: ../data/functions.xml.in.h:202 msgid "r:ldegree" msgstr "lgraad" #: ../data/functions.xml.in.h:203 msgid "Content Part" msgstr "Inhoudgedeelte" #: ../data/functions.xml.in.h:204 msgid "r:pcontent" msgstr "pinhoud" #: ../data/functions.xml.in.h:205 msgid "Primitive Part" msgstr "Primitieve deel" #: ../data/functions.xml.in.h:206 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:207 msgid "Unit Part" msgstr "Eenheidsgedeelte" #: ../data/functions.xml.in.h:208 msgid "r:punit" msgstr "peenheid" #: ../data/functions.xml.in.h:209 msgid "Greatest Common Divisor" msgstr "Grootste gemene deler" #: ../data/functions.xml.in.h:210 msgid "r:gcd" msgstr "ggd" #: ../data/functions.xml.in.h:211 msgid "1st value" msgstr "1e waarde" #: ../data/functions.xml.in.h:212 msgid "2nd value" msgstr "2de waarde" #: ../data/functions.xml.in.h:213 msgid "Least Common Multiple" msgstr "Kleinste gemene veelvoud" #: ../data/functions.xml.in.h:214 msgid "r:lcm" msgstr "kgv" #: ../data/functions.xml.in.h:215 #, fuzzy msgid "Fibonacci Number" msgstr "Romeins getal" #: ../data/functions.xml.in.h:216 msgid "r:fibonacci" msgstr "" #: ../data/functions.xml.in.h:217 #, fuzzy msgid "Returns the n-th term of the Fibonacci sequence." msgstr "Retourneert het aantal elementen in een vector." #: ../data/functions.xml.in.h:218 #, fuzzy msgid "Index (n)" msgstr "Index" #: ../data/functions.xml.in.h:219 msgid "Rounding" msgstr "Afronding" #: ../data/functions.xml.in.h:220 msgid "Round" msgstr "Afronden" #: ../data/functions.xml.in.h:221 msgid "r:round" msgstr "afronden" #: ../data/functions.xml.in.h:222 msgid "Round Downwards" msgstr "Naar beneden afronden" #: ../data/functions.xml.in.h:223 msgid "r:floor" msgstr "" #: ../data/functions.xml.in.h:224 msgid "Round Upwards" msgstr "Naar boven afronden" #: ../data/functions.xml.in.h:225 msgid "r:ceil" msgstr "" #: ../data/functions.xml.in.h:226 msgid "Round Towards Zero" msgstr "Afronden in de richting van nul" #: ../data/functions.xml.in.h:227 msgid "r:trunc" msgstr "afkap" #: ../data/functions.xml.in.h:228 msgid "Extract Integer Part" msgstr "Gehele deel uit (getal) halen" #: ../data/functions.xml.in.h:229 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:230 msgid "Extract Fractional Part" msgstr "Fractionele deel uit (getal) halen" #: ../data/functions.xml.in.h:231 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:232 msgid "Number Bases" msgstr "Grondtallen voor talstelsels" #: ../data/functions.xml.in.h:233 msgid "Number Base" msgstr "Grondtal talstelsel" #: ../data/functions.xml.in.h:234 msgid "r:base" msgstr "grondtal" #: ../data/functions.xml.in.h:235 #, fuzzy msgid "" "Returns an value from an expression using a specified base between 2 and 36" msgstr "" "Converteert een getal in een opgegeven basis tussen 2 en 36 naar een geheel " "getal" #: ../data/functions.xml.in.h:236 msgid "Binary" msgstr "Binair" #: ../data/functions.xml.in.h:237 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:238 msgid "" "Returns a value from a binary expression. If two's complement is true, " "numbers beginning with '1' is interpreted as negative binary numbers using " "two's complement." msgstr "" #: ../data/functions.xml.in.h:239 msgid "Binary number" msgstr "Binair getal" #: ../data/functions.xml.in.h:240 msgid "Two's complement" msgstr "" #: ../data/functions.xml.in.h:241 msgid "Octal" msgstr "Octaal" #: ../data/functions.xml.in.h:242 msgid "r:oct" msgstr "" #: ../data/functions.xml.in.h:243 #, fuzzy msgid "Returns a value from an octal expression." msgstr "Converteert een hexadecimaal getal naar een getal" #: ../data/functions.xml.in.h:244 msgid "Octal number" msgstr "Octaal getal" #: ../data/functions.xml.in.h:245 msgid "Hexadecimal" msgstr "Hexadecimaal" #: ../data/functions.xml.in.h:246 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:247 #, fuzzy msgid "Returns a value from a hexadecimal expression." msgstr "Converteert een hexadecimaal getal naar een getal" #: ../data/functions.xml.in.h:248 msgid "Hexadecimal number" msgstr "Hexadecimaal getal" #: ../data/functions.xml.in.h:249 msgid "Integers" msgstr "Gehele getallen" #: ../data/functions.xml.in.h:250 msgid "Even" msgstr "" #: ../data/functions.xml.in.h:251 msgid "r:even" msgstr "" #: ../data/functions.xml.in.h:252 msgid "Odd" msgstr "Oneven" #: ../data/functions.xml.in.h:253 msgid "r:odd" msgstr "oneven" #: ../data/functions.xml.in.h:254 msgid "Step Functions" msgstr "Stapfuncties" #: ../data/functions.xml.in.h:255 msgid "Heaviside Step Function" msgstr "Heaviside stapfunctie" #: ../data/functions.xml.in.h:256 #, fuzzy msgid "r:heaviside,au:θ" msgstr "gemiddelde" #: ../data/functions.xml.in.h:257 msgid "" "Discontinuous function also known as \"unit step function\". Returns 0 if x " "< 0, 1 if x > 0, and 1/2 if x = 0." msgstr "" "Discontinue functie die ook bekend staat als de \"eenheids stapfunctie\". " "Retourneert 0 indien x < 0, 1 indien x ;gt; 0, en 1/2 indien x=0." #: ../data/functions.xml.in.h:258 #, fuzzy msgid "Dirac Delta Function" msgstr "Beta-functie" #: ../data/functions.xml.in.h:259 #, fuzzy msgid "r:dirac,au:δ" msgstr "gouden,φ" #: ../data/functions.xml.in.h:260 #, fuzzy msgid "Returns 0 if x is non-zero, and infinity if x is zero." msgstr "Retourneert 0 indien i != j en 1 if i = j." #: ../data/functions.xml.in.h:261 msgid "Ramp Function" msgstr "Rampfunctie" #: ../data/functions.xml.in.h:262 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:263 msgid "Rectangular Function" msgstr "Rechthoekige functie" #: ../data/functions.xml.in.h:264 msgid "r:rectangular" msgstr "rechthoekig" #: ../data/functions.xml.in.h:265 msgid "Sigmoid Function" msgstr "Sigmoïde functie" #: ../data/functions.xml.in.h:266 msgid "r:sigmoid" msgstr "sigmoïde" #: ../data/functions.xml.in.h:267 msgid "Logit Transformation" msgstr "Logit transformatie" #: ../data/functions.xml.in.h:268 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:269 msgid "Triangular Function" msgstr "Driehoekige functie" #: ../data/functions.xml.in.h:270 msgid "r:triangular" msgstr "driehoekig" #: ../data/functions.xml.in.h:271 #, fuzzy msgid "Special Functions" msgstr "Stapfuncties" #: ../data/functions.xml.in.h:272 msgid "Gamma Function" msgstr "Gamma-functie" #: ../data/functions.xml.in.h:273 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:274 #, fuzzy msgid "Digamma Function" msgstr "Gamma-functie" #: ../data/functions.xml.in.h:275 msgid "r:digamma,psi" msgstr "" #: ../data/functions.xml.in.h:276 msgid "Beta Function" msgstr "Beta-functie" #: ../data/functions.xml.in.h:277 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:278 #, fuzzy msgid "Error Function" msgstr "Functie" #: ../data/functions.xml.in.h:279 #, fuzzy msgid "r:erf" msgstr "fout" #: ../data/functions.xml.in.h:280 msgid "Complementary Error Function" msgstr "" #: ../data/functions.xml.in.h:281 #, fuzzy msgid "r:erfc" msgstr "fout" #: ../data/functions.xml.in.h:282 #, fuzzy msgid "Polylogarithm" msgstr "Natuurlijke logaritme" #: ../data/functions.xml.in.h:283 msgid "rc:Li,polylog" msgstr "" #: ../data/functions.xml.in.h:284 msgid "Order" msgstr "Orde" #: ../data/functions.xml.in.h:285 #, fuzzy msgid "Argument" msgstr "Argumenten" #: ../data/functions.xml.in.h:286 #, fuzzy msgid "Airy Function" msgstr "Functie" #: ../data/functions.xml.in.h:287 msgid "r:airy" msgstr "" #: ../data/functions.xml.in.h:288 msgid "Bessel Function of the First Kind" msgstr "" #: ../data/functions.xml.in.h:289 msgid "r:besselj" msgstr "" #: ../data/functions.xml.in.h:290 msgid "Bessel Function of the Second Kind" msgstr "" #: ../data/functions.xml.in.h:291 msgid "r:bessely" msgstr "" #: ../data/functions.xml.in.h:292 msgid "Riemann Zeta" msgstr "Riemann Zeta" #: ../data/functions.xml.in.h:293 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:294 msgid "Integral point" msgstr "Gehele waarde" #: ../data/functions.xml.in.h:295 msgid "Kronecker Delta" msgstr "Kronecker Delta" #: ../data/functions.xml.in.h:296 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:297 msgid "Returns 0 if i != j and 1 if i = j." msgstr "Retourneert 0 indien i != j en 1 if i = j." #: ../data/functions.xml.in.h:298 msgid "Value 1 (i)" msgstr "Waarde 1 (i)" #: ../data/functions.xml.in.h:299 msgid "Value 2 (j)" msgstr "Waarde 2 (j)" #: ../data/functions.xml.in.h:300 #, fuzzy msgid "Complex Numbers" msgstr "Complex getal" #: ../data/functions.xml.in.h:301 msgid "Real Part" msgstr "Reële deel" #: ../data/functions.xml.in.h:302 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:303 msgid "Complex number" msgstr "Complex getal" #: ../data/functions.xml.in.h:304 msgid "Imaginary Part" msgstr "Imaginaire deel" #: ../data/functions.xml.in.h:305 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:306 #, fuzzy msgid "Principal Argument" msgstr "Hoofdsom" #: ../data/functions.xml.in.h:307 #, fuzzy msgid "r:arg" msgstr "oppervlak" #: ../data/functions.xml.in.h:308 #, fuzzy msgid "Complex Conjugate" msgstr "Complex getal" #: ../data/functions.xml.in.h:309 #, fuzzy msgid "r:conj" msgstr "kegel" #: ../data/functions.xml.in.h:310 msgid "Exponents & Logarithms" msgstr "Exponenten & Logaritmen" #: ../data/functions.xml.in.h:311 msgid "Square Root" msgstr "Vierkantswortel" #: ../data/functions.xml.in.h:312 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:313 msgid "" "Returns the principal square root (for positive values the positive root is " "returned)." msgstr "" #: ../data/functions.xml.in.h:314 msgid "Cube Root" msgstr "Derdemachtswortel" #: ../data/functions.xml.in.h:315 #, fuzzy msgid "au:∛,r:cbrt" msgstr "a:∞,oneindig" #: ../data/functions.xml.in.h:316 #, fuzzy msgid "Returns the third real root." msgstr "Retourneert de grootste waarde." #: ../data/functions.xml.in.h:317 msgid "Nth root" msgstr "N-de wortel" #: ../data/functions.xml.in.h:318 msgid "r:root" msgstr "wortel" #: ../data/functions.xml.in.h:319 msgid "" "Returns the real root. For negative values the degree must be odd. Complex " "values are not allowed." msgstr "" #: ../data/functions.xml.in.h:320 ../data/units.xml.in.h:61 msgid "Degree" msgstr "Graad" #: ../data/functions.xml.in.h:321 msgid "Square" msgstr "Vierkant" #: ../data/functions.xml.in.h:322 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:323 msgid "Exponential (e^x)" msgstr "Exponent (e^x)" #: ../data/functions.xml.in.h:324 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:325 msgid "Natural Logarithm" msgstr "Natuurlijke logaritme" #: ../data/functions.xml.in.h:326 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:327 msgid "Base-N Logarithm" msgstr "Logaritme met grondtal N" #: ../data/functions.xml.in.h:328 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:329 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "Lambert W Functie (Omega Functie, Product Log)" #: ../data/functions.xml.in.h:330 msgid "r:lambertw,productlog" msgstr "" #: ../data/functions.xml.in.h:331 #, fuzzy msgid "" "Returns the inverse function for mx*e^x as ln() does for e^x. Only the " "principal branch and real valued results are currently supported." msgstr "" "Retourneert de inverse functie van mx*e^x (zoals ln(x) de inverse functie is " "van e^x)." #: ../data/functions.xml.in.h:332 msgid "Branch" msgstr "" #: ../data/functions.xml.in.h:333 msgid "Base-2 Logarithm" msgstr "Logaritme met grondtal 2" #: ../data/functions.xml.in.h:334 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:335 msgid "Returns the base n logarithm." msgstr "Retourneert de logaritme met grondtal n." #: ../data/functions.xml.in.h:336 msgid "Base-10 Logarithm" msgstr "Logaritme met grondtal 10" #: ../data/functions.xml.in.h:337 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:338 msgid "Complex Exponential (Cis)" msgstr "Complex Exponentieel (Cis)" #: ../data/functions.xml.in.h:339 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:340 msgid "2 raised to the power X" msgstr "2 tot de macht X" #: ../data/functions.xml.in.h:341 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:342 msgid "10 raised to the power X" msgstr "10 tot de macht X" #: ../data/functions.xml.in.h:343 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:344 msgid "X raised to the power Y" msgstr "X tot de macht Y" #: ../data/functions.xml.in.h:345 msgid "r:pow" msgstr "macht" #: ../data/functions.xml.in.h:346 msgid "Square root (x * pi)" msgstr "Vierkantswortel (x * pi)" #: ../data/functions.xml.in.h:347 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:348 msgid "Returns the non-negative square root of x * pi" msgstr "Retourneert de niet-negatieve vierkantswortel van x * pi" #: ../data/functions.xml.in.h:349 msgid "Non-negative value" msgstr "Niet-negatieve waarde" #: ../data/functions.xml.in.h:350 msgid "Trigonometry" msgstr "Goniometrie" #: ../data/functions.xml.in.h:351 msgid "Sine" msgstr "Sinus" #: ../data/functions.xml.in.h:352 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:353 msgid "Angle" msgstr "Hoek" #: ../data/functions.xml.in.h:354 msgid "Cosine" msgstr "Cosinus" #: ../data/functions.xml.in.h:355 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:356 msgid "Tangent" msgstr "Tangens" #: ../data/functions.xml.in.h:357 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:358 msgid "Inverse Sine" msgstr "Inverse sinus" #: ../data/functions.xml.in.h:359 msgid "r:asin" msgstr "" #: ../data/functions.xml.in.h:360 msgid "Inverse Cosine" msgstr "Inverse cosinus" #: ../data/functions.xml.in.h:361 msgid "r:acos" msgstr "" #: ../data/functions.xml.in.h:362 msgid "Inverse Tangent" msgstr "Inverse tangens" #: ../data/functions.xml.in.h:363 msgid "r:atan" msgstr "" #: ../data/functions.xml.in.h:364 msgid "Hyperbolic Sine" msgstr "Hyperbolische sinus" #: ../data/functions.xml.in.h:365 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:366 msgid "Hyperbolic Cosine" msgstr "Hyperbolische cosinus" #: ../data/functions.xml.in.h:367 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:368 msgid "Hyperbolic Tangent" msgstr "Hyperbolische tangens" #: ../data/functions.xml.in.h:369 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:370 msgid "Inverse Hyperbolic Sine" msgstr "Inverse hyperbolische sinus" #: ../data/functions.xml.in.h:371 msgid "r:asinh" msgstr "" #: ../data/functions.xml.in.h:372 msgid "Inverse Hyperbolic Cosine" msgstr "Inverse hyperbolische cosinus" #: ../data/functions.xml.in.h:373 msgid "r:acosh" msgstr "" #: ../data/functions.xml.in.h:374 msgid "Inverse Hyperbolic Tangent" msgstr "Inverse hyperbolische tangens" #: ../data/functions.xml.in.h:375 msgid "r:atanh" msgstr "" #: ../data/functions.xml.in.h:376 #, fuzzy msgid "Four-quadrant Inverse Tangent" msgstr "Inverse tangens" #: ../data/functions.xml.in.h:377 #, fuzzy msgid "r:atan2" msgstr "atoom" #: ../data/functions.xml.in.h:378 msgid "" "Computes the principal value of the argument function applied to the complex " "number x+iy." msgstr "" #: ../data/functions.xml.in.h:379 msgid "Y" msgstr "" #: ../data/functions.xml.in.h:380 msgid "X" msgstr "X" #: ../data/functions.xml.in.h:381 #, fuzzy msgid "Cardinal Sine (Sinc Function)" msgstr "Lineaire functie bepalen" #: ../data/functions.xml.in.h:382 msgid "r:sinc" msgstr "" #: ../data/functions.xml.in.h:383 msgid "Radians to Default Angle Unit" msgstr "Radialen naar standaard hoekeenheid" #: ../data/functions.xml.in.h:384 msgid "r:radtodef" msgstr "radnaardef" #: ../data/functions.xml.in.h:385 msgid "Radians" msgstr "Radialen" #: ../data/functions.xml.in.h:386 msgid "Secant" msgstr "Secans" #: ../data/functions.xml.in.h:387 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:388 msgid "Cosecant" msgstr "Cosecant" #: ../data/functions.xml.in.h:389 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:390 msgid "Cotangent" msgstr "Cotangens" #: ../data/functions.xml.in.h:391 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:392 msgid "Hyperbolic Secant" msgstr "Hyperbolische secans" #: ../data/functions.xml.in.h:393 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:394 msgid "Hyperbolic Cosecant" msgstr "Hyperbolische cosecans" #: ../data/functions.xml.in.h:395 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:396 msgid "Hyperbolic Cotangent" msgstr "Hyperbolische cotangens" #: ../data/functions.xml.in.h:397 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:398 msgid "Inverse Secant" msgstr "Inverse secans" #: ../data/functions.xml.in.h:399 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:400 msgid "Inverse Cosecant" msgstr "Inverse cosecans" #: ../data/functions.xml.in.h:401 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:402 msgid "Inverse Cotangent" msgstr "Inverse cotangens" #: ../data/functions.xml.in.h:403 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:404 msgid "Inverse Hyperbolic Secant" msgstr "Inverse hyperbolische secans" #: ../data/functions.xml.in.h:405 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:406 msgid "Inverse Hyperbolic Cosecant" msgstr "Inverse hyperbolische cosecans" #: ../data/functions.xml.in.h:407 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:408 msgid "Inverse Hyperbolic Cotangent" msgstr "Inverse hyperbolische cotangens" #: ../data/functions.xml.in.h:409 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:410 msgid "Miscellaneous" msgstr "Diversen" #: ../data/functions.xml.in.h:411 msgid "Body Mass Index (BMI)" msgstr "Body Mass Index (BMI) (Index voor lichaamsmassa)" #: ../data/functions.xml.in.h:412 msgid "-r:bmi" msgstr "" #: ../data/functions.xml.in.h:413 msgid "" "Calculates the Body Mass Index. The resulting BMI-value is sometimes " "interpreted as follows (although varies with age, sex, etc.): " "Underweight < 18.5 Normal weight 18.5-25 Overweight 25-30 " "Obesity > 30 Note that you must use units for weight (ex. 59kg) " "and length (ex. 174cm)." msgstr "" "Berekent de zg. Body Mass Index (index voor de lichaamsmassa). De berekende " "BMI wordt als volgt beoordeeld (hoewel dit varieert met leeftijd, geslacht, " "enz): Te laag gewicht < 18.5 Normaal gewicht ;18.5-25 " "Te hoog gewicht& 25-30 Zwaarlijvigheid > 30 Let er opdat u " "eenheden gebruikt voor gewicht (bv. 59kg) en lengte (bv. 174cm)." #: ../data/functions.xml.in.h:415 msgid "Length" msgstr "Lengte" #: ../data/functions.xml.in.h:416 msgid "Roman Number" msgstr "Romeins getal" #: ../data/functions.xml.in.h:417 msgid "r:roman" msgstr "romeins" #: ../data/functions.xml.in.h:418 msgid "Returns the value of a roman number." msgstr "Retourneert de waarde van een Romeins getal." #: ../data/functions.xml.in.h:419 msgid "Roman number" msgstr "Romeins getal" #: ../data/functions.xml.in.h:420 msgid "Statistics" msgstr "Statistiek" #: ../data/functions.xml.in.h:421 msgid "Descriptive Statistics" msgstr "Beschrijvende statistiek" #: ../data/functions.xml.in.h:422 msgid "Sum (total)" msgstr "Som (totaal)" #: ../data/functions.xml.in.h:423 msgid "r:total" msgstr "totaal" #: ../data/functions.xml.in.h:424 msgid "Data" msgstr "Gegevens" #: ../data/functions.xml.in.h:425 msgid "Percentile" msgstr "Percentiel" #: ../data/functions.xml.in.h:426 msgid "r:percentile" msgstr "percentiel" #: ../data/functions.xml.in.h:428 #, no-c-format msgid "Percentile (%)" msgstr "Percentiel (%)" #: ../data/functions.xml.in.h:429 msgid "Quantile Algorithm (as in R)" msgstr "" #: ../data/functions.xml.in.h:430 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:431 msgid "Returns the lowest value." msgstr "Retourneert de kleinste waarde." #: ../data/functions.xml.in.h:432 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:433 msgid "Returns the highest value." msgstr "Retourneert de grootste waarde." #: ../data/functions.xml.in.h:434 msgid "Mode" msgstr "Modus" #: ../data/functions.xml.in.h:435 msgid "r:mode" msgstr "modus" #: ../data/functions.xml.in.h:436 msgid "Returns the most frequently occurring value." msgstr "Retourneert de meest voorkomende waarde." #: ../data/functions.xml.in.h:437 msgid "Range" msgstr "Bereik" #: ../data/functions.xml.in.h:438 msgid "r:range" msgstr "bereik" #: ../data/functions.xml.in.h:439 msgid "Calculates the difference between the min and max value." msgstr "Berekent het verschil tussen de kleinste en de grootste waarde." #: ../data/functions.xml.in.h:440 msgid "Median" msgstr "Mediaan" #: ../data/functions.xml.in.h:441 msgid "r:median" msgstr "mediaan" #: ../data/functions.xml.in.h:442 msgid "Quartile" msgstr "Kwartiel" #: ../data/functions.xml.in.h:443 msgid "r:quartile" msgstr "kwartiel" #: ../data/functions.xml.in.h:444 msgid "Decile" msgstr "Deciel" #: ../data/functions.xml.in.h:445 msgid "r:decile" msgstr "deciel" #: ../data/functions.xml.in.h:446 msgid "Interquartile Range" msgstr "Interkwartiel bereik" #: ../data/functions.xml.in.h:447 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:448 msgid "Calculates the difference between the first and third quartile." msgstr "Berekent het verschil tussen het eerste en het derde kwartiel." #: ../data/functions.xml.in.h:449 msgid "Number of Samples" msgstr "Aantal monsters" #. Number of samples #: ../data/functions.xml.in.h:451 msgid "r:number" msgstr "getal" #: ../data/functions.xml.in.h:452 msgid "Returns the number of samples." msgstr "Retourneert het aantal monsters." #: ../data/functions.xml.in.h:453 msgid "Random Number" msgstr "Willekeurig getal" #: ../data/functions.xml.in.h:454 msgid "r:rand" msgstr "wilk" #: ../data/functions.xml.in.h:455 msgid "" "Generates a pseudo-random number. Returns a real number between 0 and 1, if " "ceil is zero (default), or an integer between 1 and (including) ceil." msgstr "" "Levert een pseudowillekeurig getal. Retourneert een reëel getal tussen 0 en " "1 als ceil nul is (standaard), of een getal tussen 1 en ceil (inclusief)." #: ../data/functions.xml.in.h:456 msgid "Ceil" msgstr "Ceil" #: ../data/functions.xml.in.h:457 msgid "Random Number Between Limits" msgstr "Willekeurig getal tussen twee grenswaarden" #: ../data/functions.xml.in.h:458 msgid "r:randbetween" msgstr "wilktussen" #: ../data/functions.xml.in.h:459 msgid "Returns an integer between (including) bottom and top." msgstr "Retourneert een geheel getal tussen onder- en bovengrens (inclusief)." #: ../data/functions.xml.in.h:460 msgid "Bottom" msgstr "Onder" #: ../data/functions.xml.in.h:461 msgid "Top" msgstr "Boven" #: ../data/functions.xml.in.h:462 msgid "Means" msgstr "Gemiddelden" #: ../data/functions.xml.in.h:463 msgid "Mean" msgstr "Gemiddelde" #: ../data/functions.xml.in.h:464 #, fuzzy msgid "r:mean,average,au:x̄" msgstr "gemiddelde" #: ../data/functions.xml.in.h:465 msgid "Harmonic Mean" msgstr "Harmonisch gemiddelde" #: ../data/functions.xml.in.h:466 msgid "r:harmmean" msgstr "harmgem" #: ../data/functions.xml.in.h:467 msgid "Geometric Mean" msgstr "Meetkundig gemiddelde" #: ../data/functions.xml.in.h:468 msgid "r:geomean" msgstr "meetkgem" #: ../data/functions.xml.in.h:469 msgid "Trimmed Mean" msgstr "Getrimd gemiddelde" #: ../data/functions.xml.in.h:470 msgid "r:trimmean" msgstr "trimgemidd" #: ../data/functions.xml.in.h:471 msgid "Trimmed percentage (at each end)" msgstr "Getrimd percentage (aan beide kanten)" #: ../data/functions.xml.in.h:472 msgid "Winsorized Mean" msgstr "Gewinsoriseerd gemiddelde" #: ../data/functions.xml.in.h:473 msgid "r:winsormean" msgstr "winsorgemidd" #: ../data/functions.xml.in.h:474 msgid "Winsorized percentage (at each end)" msgstr "Gewinsoriseerd percentage (aan beide kanten)" #: ../data/functions.xml.in.h:475 msgid "Weighted Mean" msgstr "Gewogen gemiddelde" #: ../data/functions.xml.in.h:476 msgid "r:weighmean" msgstr "gewogengemidd" #: ../data/functions.xml.in.h:477 msgid "Weights" msgstr "Gewichten" #: ../data/functions.xml.in.h:478 msgid "Quadratic Mean (RMS)" msgstr "Kwadratisch gemiddelde (RMS)" #: ../data/functions.xml.in.h:479 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:480 msgid "Moments" msgstr "Momenten" #: ../data/functions.xml.in.h:481 msgid "Standard Deviation (entire population)" msgstr "Standaarddeviatie (gehele populatie)" #: ../data/functions.xml.in.h:482 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:483 msgid "Standard Deviation (random sampling)" msgstr "Standaarddeviatie (willekeurige steekproef)" #: ../data/functions.xml.in.h:484 msgid "r:stdev" msgstr "" #: ../data/functions.xml.in.h:485 msgid "Variance (entire population)" msgstr "Variantie (gehele populatie)" #: ../data/functions.xml.in.h:486 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:487 msgid "Variance (random sampling)" msgstr "Variantie (willekeurige steekproef)" #: ../data/functions.xml.in.h:488 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:489 msgid "Standard Error" msgstr "Standaardfout" #: ../data/functions.xml.in.h:490 msgid "r:stderr" msgstr "" #: ../data/functions.xml.in.h:491 msgid "Mean Deviation" msgstr "Gemiddelde afwijking" #: ../data/functions.xml.in.h:492 msgid "r:meandev" msgstr "gemiddev" #: ../data/functions.xml.in.h:493 msgid "Covariance" msgstr "Covariantie" #: ../data/functions.xml.in.h:494 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:495 msgid "Data 1" msgstr "Gegevens 1" #: ../data/functions.xml.in.h:496 msgid "Data 2" msgstr "Gegevens 2" #: ../data/functions.xml.in.h:497 msgid "Pooled Variance" msgstr "Pooled variantie" #: ../data/functions.xml.in.h:498 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:499 msgid "Regression" msgstr "Regressie" #: ../data/functions.xml.in.h:500 msgid "Statistical Correlation" msgstr "Statistische correlatie" #: ../data/functions.xml.in.h:501 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:502 msgid "Pearson's Correlation Coefficient" msgstr "Pearson's correlatiecoëfficiënt" #: ../data/functions.xml.in.h:503 msgid "r:pearson,r:correl" msgstr "" #: ../data/functions.xml.in.h:504 msgid "Spearman's Rho" msgstr "Spearman's Rho" #: ../data/functions.xml.in.h:505 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:506 msgid "Statistical Tests" msgstr "Statistische testen" #: ../data/functions.xml.in.h:507 msgid "Unpaired T-Test" msgstr "Ongepaarde T-proef" #: ../data/functions.xml.in.h:508 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:509 msgid "Paired T-Test" msgstr "Gepaarde t-proef" #: ../data/functions.xml.in.h:510 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:511 msgid "Distribution" msgstr "Distributie" #: ../data/functions.xml.in.h:512 msgid "Rayleigh Distribution" msgstr "Rayleigh-verdeling" #: ../data/functions.xml.in.h:513 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:514 msgid "" "Returns the probability density p(x) at x for a Rayleigh distribution with " "scale parameter sigma. (from Gnumeric)" msgstr "" "Retourneert de kansdichtheid p(x) in x voor een Rayleigh-verdeling met " "schaalparameter sigma. (van Gnumeric)" #: ../data/functions.xml.in.h:515 msgid "Sigma" msgstr "Sigma" #: ../data/functions.xml.in.h:516 msgid "Rayleigh Tail Distribution" msgstr "Rayleigh-staartverdeling" #: ../data/functions.xml.in.h:517 msgid "r:rayleightail" msgstr "rayleighstaart" #: ../data/functions.xml.in.h:518 msgid "" "Returns the probability density p(x) at x for a Rayleigh tail distribution " "with scale parameter sigma and a lower limit. (from Gnumeric)" msgstr "" "Retourneert de kansdichtheid p(x) in x voor een Rayleigh-staartverdeling met " "schaalparameter sigma en een ondergrens. (van Gnumeric)" #: ../data/functions.xml.in.h:519 msgid "Pareto Distribution" msgstr "Paretoverdeling" #: ../data/functions.xml.in.h:520 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:521 msgid "" "Returns the probability density p(x) at x for a Pareto distribution with " "exponent and scale. (from Gnumeric)" msgstr "" "Retourneert de kansdichtheid p(x) in x voor een Pareto-verdeling met " "exponent en schaal. (van Gnumeric)" #: ../data/functions.xml.in.h:522 msgid "Scale" msgstr "Schaal" #: ../data/functions.xml.in.h:523 msgid "Logistic Distribution" msgstr "Logistische verdeling" #: ../data/functions.xml.in.h:524 msgid "r:logistic" msgstr "logistisch" #: ../data/functions.xml.in.h:525 msgid "" "Returns the probability density p(x) at x for a logistic distribution with " "scale parameter. (from Gnumeric)" msgstr "" "Retourneert de kansdichtheid p(x) in x voor een logistische verdeling met " "schaalparameter. (van Gnumeric)" #: ../data/functions.xml.in.h:526 ../data/variables.xml.in.h:173 msgid "Date & Time" msgstr "Datum & Tijd" #: ../data/functions.xml.in.h:527 #, fuzzy msgid "Construct Date" msgstr "Matrix construeren" #: ../data/functions.xml.in.h:528 #, fuzzy msgid "r:date" msgstr "dag" #: ../data/functions.xml.in.h:529 msgid "" "Returns a date. Available calendars gregorian (1), hebrew (2), islamic (3), " "persian (4), indian (5), chinese (6), julian (7), milankovic (8), coptic " "(9), ethiopian (10), egyptian (11). The Chinese year uses an epoch of 2697 " "BEC and chinese leap months are indicated by adding 12 to the month number " "(e.g. leap month 4 = 16)." msgstr "" #: ../data/functions.xml.in.h:530 msgid "Year" msgstr "Jaar" #: ../data/functions.xml.in.h:531 ../data/units.xml.in.h:145 msgid "Month" msgstr "Maand" #: ../data/functions.xml.in.h:532 ../data/units.xml.in.h:137 msgid "Day" msgstr "Dag" #: ../data/functions.xml.in.h:533 msgid "Calendar" msgstr "" #: ../data/functions.xml.in.h:534 #, fuzzy msgid "Construct Date and Time" msgstr "Matrix construeren" #: ../data/functions.xml.in.h:535 #, fuzzy msgid "r:datetime" msgstr "dag" #: ../data/functions.xml.in.h:536 ../data/units.xml.in.h:135 msgid "Hour" msgstr "Uur" #: ../data/functions.xml.in.h:537 ../data/units.xml.in.h:133 msgid "Minute" msgstr "Minuut" #: ../data/functions.xml.in.h:538 ../data/units.xml.in.h:131 msgid "Second" msgstr "Seconde" #: ../data/functions.xml.in.h:539 msgid "Days between two dates" msgstr "Aantal dagen tussen twee data" #: ../data/functions.xml.in.h:540 msgid "r:days" msgstr "dagen" #: ../data/functions.xml.in.h:541 msgid "" "Returns the number of days between two dates. Basis is the type of " "day counting you want to use: 0: US 30/360, 1: real days (default), 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Retourneert het aantal dagen tussen twee data. Basis is de " "dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke " "dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees " "30/360." #: ../data/functions.xml.in.h:542 msgid "First date" msgstr "Eerste datum" #: ../data/functions.xml.in.h:543 msgid "Second date" msgstr "Tweede datum" #: ../data/functions.xml.in.h:544 msgid "Day counting basis" msgstr "Basis dagtelling" #: ../data/functions.xml.in.h:545 msgid "Financial function mode" msgstr "Financiële functiemodus" #: ../data/functions.xml.in.h:546 msgid "Years between two dates" msgstr "Jaren tussen twee data" #: ../data/functions.xml.in.h:547 msgid "r:yearfrac" msgstr "jaarfrac" #: ../data/functions.xml.in.h:548 msgid "" "Returns the number of years (fractional) between two dates. Basis " "is the type of day counting you want to use: 0: US 30/360, 1: real days " "(default), 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Retourneert het aantal jaren (niet noodzakelijk geheel) tussen twee data. " " Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 " "(standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke " "dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:549 msgid "Week of Year" msgstr "Week van het jaar" #: ../data/functions.xml.in.h:550 msgid "r:week" msgstr "" #: ../data/functions.xml.in.h:551 msgid "Date" msgstr "Datum" #: ../data/functions.xml.in.h:552 msgid "Week begins on Sunday" msgstr "Week begint op zondag" #: ../data/functions.xml.in.h:553 msgid "Day of Week" msgstr "Dag van de week" #: ../data/functions.xml.in.h:554 msgid "r:weekday" msgstr "weekdag" #: ../data/functions.xml.in.h:555 msgid "r:month" msgstr "maand" #: ../data/functions.xml.in.h:556 msgid "Day of Month" msgstr "Dag van de maand" #: ../data/functions.xml.in.h:557 msgid "r:day" msgstr "dag" #: ../data/functions.xml.in.h:558 msgid "r:year" msgstr "jaar" #: ../data/functions.xml.in.h:559 msgid "Day of Year" msgstr "Dag van het jaar" #: ../data/functions.xml.in.h:560 msgid "r:yearday" msgstr "jaardag" #: ../data/functions.xml.in.h:561 msgid "Current Time" msgstr "Huidige tijd" #: ../data/functions.xml.in.h:562 msgid "r:time" msgstr "tijd" #: ../data/functions.xml.in.h:563 #, fuzzy msgid "Time Value" msgstr "Uiterste waarden" #: ../data/functions.xml.in.h:564 #, fuzzy msgid "r:timevalue" msgstr "tijd" #: ../data/functions.xml.in.h:565 msgid "Returns the time part, in fractional hours, of a date and time value." msgstr "" #: ../data/functions.xml.in.h:566 msgid "Date to Unix Timestamp" msgstr "Datum naar Unix-timestamp" #: ../data/functions.xml.in.h:567 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:568 msgid "Unix Timestamp to Date" msgstr "Unix Timestamp naar datum" #: ../data/functions.xml.in.h:569 #, fuzzy msgid "r:stamptodate,unix2date" msgstr "stampnaardatum" #: ../data/functions.xml.in.h:570 msgid "" "Returns the local date and time represented by the specified Unix timestamp " "(seconds, excluding leap seconds, since 1970-01-01). Supports time units." msgstr "" #: ../data/functions.xml.in.h:571 msgid "Timestamp" msgstr "Timestamp" #: ../data/functions.xml.in.h:572 msgid "Add Days" msgstr "Dagen bijtellen" #: ../data/functions.xml.in.h:573 msgid "r:addDays" msgstr "dagen bijtellen" #: ../data/functions.xml.in.h:574 msgid "Days" msgstr "Dagen" #: ../data/functions.xml.in.h:575 msgid "Add Months" msgstr "Maanden bijtellen" #: ../data/functions.xml.in.h:576 msgid "r:addMonths" msgstr "maanden bijtellen" #: ../data/functions.xml.in.h:577 msgid "Months" msgstr "Maanden" #: ../data/functions.xml.in.h:578 msgid "Add Years" msgstr "Jaren bijtellen" #: ../data/functions.xml.in.h:579 msgid "r:addYears" msgstr "jaren bijtellen" #: ../data/functions.xml.in.h:580 msgid "Years" msgstr "Jaren" #: ../data/functions.xml.in.h:581 msgid "Add Time" msgstr "Tijd optellen" #: ../data/functions.xml.in.h:582 msgid "r:addTime" msgstr "tijd bijtellen" #: ../data/functions.xml.in.h:583 msgid "" "Adds a time value to a date. The value can be positive or negative, but must " "use a unit based on seconds (such as day and year). Fractions of days are " "truncated." msgstr "" "Telt een tijdswaarde op bij een datum. Deze waarde kan zowel positief zijn " "als negatief, maar moet in een eenheid zijn uitgedrukt die op seconden is " "gebaseerd (zoals dag of jaar). Fracties van dagen worden afgekapt tot hele " "dagen." #: ../data/functions.xml.in.h:584 ../data/units.xml.in.h:130 msgid "Time" msgstr "Tijd" #: ../data/functions.xml.in.h:585 msgid "Lunar Phase" msgstr "" #: ../data/functions.xml.in.h:586 msgid "r:lunarphase" msgstr "" #: ../data/functions.xml.in.h:587 msgid "" "Returns the lunar phase, as a number between 0 and 1, for the specified " "date. 0 represents new moon, 0.5 full moon, and 0.25 and 0.75 quarter moons." msgstr "" #: ../data/functions.xml.in.h:588 msgid "Find Lunar Phase" msgstr "" #: ../data/functions.xml.in.h:589 msgid "r:nextlunarphase" msgstr "" #: ../data/functions.xml.in.h:590 msgid "" "Returns the date when the specified lunar phase occurs. The function " "searches forward beginning at the specified date. The lunar phase are " "specified as a number between 0 and 1, where 0 represents new moon, 0.5 full " "moon, and 0.25 and 0.75 quarter moons." msgstr "" #: ../data/functions.xml.in.h:591 #, fuzzy msgid "Start Date" msgstr "Matrix construeren" #: ../data/functions.xml.in.h:592 msgid "Utilities" msgstr "Hulpmiddelen" #: ../data/functions.xml.in.h:593 msgid "Plot Functions and Vectors" msgstr "" #: ../data/functions.xml.in.h:594 #, fuzzy msgid "r:plot" msgstr "planeet" #: ../data/functions.xml.in.h:595 #, fuzzy msgid "Expression or vector" msgstr "Matrix of vector" #: ../data/functions.xml.in.h:596 msgid "Minimum x value" msgstr "" #: ../data/functions.xml.in.h:597 #, fuzzy msgid "Maximum x value" msgstr "Matrixvariabele" #: ../data/functions.xml.in.h:598 msgid "Number of samples / Step size" msgstr "Aantal monsters / stapgrootte" #: ../data/functions.xml.in.h:599 #, fuzzy msgid "X variable" msgstr "Rijvariabele" #: ../data/functions.xml.in.h:600 msgid "" "Plots one or more expressions or vectors. Use a vector for the first " "argument to plot multiple series. Only the first argument is used for vector " "series. It is also possible to plot a matrix where each row is a pair of x " "and y values." msgstr "" #: ../data/functions.xml.in.h:601 msgid "ASCII Value" msgstr "ASCII-waarde" #: ../data/functions.xml.in.h:602 msgid "r:code" msgstr "" #: ../data/functions.xml.in.h:603 msgid "Character" msgstr "Karakter" #: ../data/functions.xml.in.h:604 msgid "ASCII Char" msgstr "ASCII-kar" #: ../data/functions.xml.in.h:605 msgid "r:char" msgstr "" #: ../data/functions.xml.in.h:606 msgid "Length of string" msgstr "Lengte van karakterrij" #: ../data/functions.xml.in.h:607 msgid "r:len" msgstr "" #: ../data/functions.xml.in.h:608 msgid "Text" msgstr "Tekst" #: ../data/functions.xml.in.h:609 msgid "Concatenate Strings" msgstr "Karakterrijen samenvoegen" #: ../data/functions.xml.in.h:610 msgid "r:concatenate" msgstr "samenvoegen" #: ../data/functions.xml.in.h:611 msgid "Text string 1" msgstr "Tekstrij 1" #: ../data/functions.xml.in.h:612 msgid "Text string 2" msgstr "Tekstrij 2" #: ../data/functions.xml.in.h:613 msgid "Replace" msgstr "Vervangen" #: ../data/functions.xml.in.h:614 msgid "r:replace" msgstr "vervangen" #: ../data/functions.xml.in.h:615 msgid "" "Replaces a certain value in an expression with a new value. The expression " "is calculated before the replacement if the fourth argument is true." msgstr "" "Vervangt een waarde in een expressie door een nieuwe waarde. Eerst wordt de " "expressie berekend indien het vierde argument waar (true) is." #: ../data/functions.xml.in.h:616 msgid "Expression" msgstr "Expressie" #: ../data/functions.xml.in.h:617 msgid "Original value" msgstr "Originele waarde" #: ../data/functions.xml.in.h:618 msgid "New value" msgstr "Nieuwe waarde" #: ../data/functions.xml.in.h:619 msgid "Precalculate expression" msgstr "Voorbereken expressie" #: ../data/functions.xml.in.h:620 msgid "Strip Units" msgstr "Eenheden verwijderen" #: ../data/functions.xml.in.h:621 msgid "r:nounit,strip_units" msgstr "geeneenheid,eenheden_weg" #: ../data/functions.xml.in.h:622 msgid "" "Removes all units from an expression. The expression is calculated before " "the removal." msgstr "" "Verwijdert alle eenheden uit een expressie. De expressie wordt hierbij eerst " "berekend." #: ../data/functions.xml.in.h:623 msgid "Process Vector Elements" msgstr "Vector-elementen verwerken" #: ../data/functions.xml.in.h:624 msgid "r:process" msgstr "verwerken" #: ../data/functions.xml.in.h:625 msgid "Element variable" msgstr "Elementvariabele" #: ../data/functions.xml.in.h:626 msgid "Index variable" msgstr "Indexvariabele" #: ../data/functions.xml.in.h:627 msgid "Vector variable" msgstr "Vectorvariabele" #: ../data/functions.xml.in.h:628 msgid "Process Matrix Elements" msgstr "Matrix-elementen verwerken" #: ../data/functions.xml.in.h:629 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:630 msgid "Row variable" msgstr "Rijvariabele" #: ../data/functions.xml.in.h:631 msgid "Column variable" msgstr "Kolomvariabele" #: ../data/functions.xml.in.h:632 msgid "Matrix variable" msgstr "Matrixvariabele" #: ../data/functions.xml.in.h:633 msgid "Custom Sum of Elements" msgstr "Aangepaste som van elementen" #: ../data/functions.xml.in.h:634 msgid "r:csum" msgstr "csom" #: ../data/functions.xml.in.h:635 msgid "First element" msgstr "Eerste element" #: ../data/functions.xml.in.h:636 msgid "Last element" msgstr "Laatste element" #: ../data/functions.xml.in.h:637 msgid "Initial value" msgstr "Beginwaarde" #: ../data/functions.xml.in.h:638 msgid "Value variable" msgstr "Waarde variabele" #: ../data/functions.xml.in.h:639 msgid "Select Vector Elements" msgstr "Vectorelementen selecteren" #: ../data/functions.xml.in.h:640 msgid "r:select" msgstr "selecteer" #: ../data/functions.xml.in.h:641 msgid "Condition" msgstr "Conditie" #: ../data/functions.xml.in.h:642 msgid "Select first match" msgstr "Eerste overeenkomst secteren" #: ../data/functions.xml.in.h:643 msgid "r:function" msgstr "functie" #: ../data/functions.xml.in.h:644 msgid "Arguments" msgstr "Argumenten" #: ../data/functions.xml.in.h:645 msgid "Title" msgstr "Titel" #: ../data/functions.xml.in.h:646 msgid "r:title" msgstr "titel" #: ../data/functions.xml.in.h:648 msgid "Display Error" msgstr "Weergavefout" #: ../data/functions.xml.in.h:649 msgid "r:error" msgstr "fout" #: ../data/functions.xml.in.h:650 msgid "Message" msgstr "Bericht" #: ../data/functions.xml.in.h:651 msgid "Display Warning" msgstr "Waarschuwing weergeven" #: ../data/functions.xml.in.h:652 msgid "r:warning" msgstr "waarschuwing" #: ../data/functions.xml.in.h:653 msgid "Display Message" msgstr "Bericht weergeven" #: ../data/functions.xml.in.h:654 msgid "r:message" msgstr "bericht" #: ../data/functions.xml.in.h:655 msgid "Save as Variable" msgstr "Opslaan als variabele" #: ../data/functions.xml.in.h:656 msgid "r:save" msgstr "opslaan" #: ../data/functions.xml.in.h:657 msgid "Category" msgstr "Categorie" #: ../data/functions.xml.in.h:658 msgid "RPN Stack Register" msgstr "RPN-register in stapelgeheugen" #: ../data/functions.xml.in.h:659 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:660 msgid "Returns the value of a RPN stack register." msgstr "Retourneert de waarde in een register van het RPN-stapelgeheugen." #: ../data/functions.xml.in.h:661 msgid "RPN Stack Vector" msgstr "RPN-vector in stapelgeheugen" #: ../data/functions.xml.in.h:662 msgid "r:stack" msgstr "stapelgeheugen" #: ../data/functions.xml.in.h:663 msgid "Returns the RPN stack as a vector." msgstr "Retourneert de inhoud van het RPN-stapelgeheugen als een vector." #: ../data/functions.xml.in.h:664 msgid "Is Number" msgstr "Is een getal" #: ../data/functions.xml.in.h:665 msgid "r:isNumber" msgstr "isGetal" #: ../data/functions.xml.in.h:666 msgid "Is Real" msgstr "Is een reëel getal" #: ../data/functions.xml.in.h:667 msgid "r:isReal" msgstr "isReëel" #: ../data/functions.xml.in.h:668 msgid "Is Rational" msgstr "Is een rationaal getal" #: ../data/functions.xml.in.h:669 msgid "r:isRational" msgstr "isRationaal" #: ../data/functions.xml.in.h:670 msgid "Is Integer" msgstr "Is een geheel getal" #: ../data/functions.xml.in.h:671 msgid "r:isInteger" msgstr "isGeheel" #: ../data/functions.xml.in.h:672 msgid "Represents Number" msgstr "Geeft een getal weer" #: ../data/functions.xml.in.h:673 msgid "r:representsNumber" msgstr "isGetal" #: ../data/functions.xml.in.h:674 msgid "Represents Real" msgstr "Geeft een reëel getal weer" #: ../data/functions.xml.in.h:675 msgid "r:representsReal" msgstr "isReëel" #: ../data/functions.xml.in.h:676 msgid "Represents Rational" msgstr "Geeft een rationaal getal weer" #: ../data/functions.xml.in.h:677 msgid "r:representsRational" msgstr "isRationaalgetal" #: ../data/functions.xml.in.h:678 msgid "Represents Integer" msgstr "Geeft een geheel getal weer" #: ../data/functions.xml.in.h:679 msgid "r:representsInteger" msgstr "isGeheelgetal" #: ../data/functions.xml.in.h:680 #, fuzzy msgid "Interval" msgstr "Integreren" #: ../data/functions.xml.in.h:681 #, fuzzy msgid "r:interval" msgstr "integreren" #: ../data/functions.xml.in.h:682 #, fuzzy msgid "Lower endpoint" msgstr "Ondergrens" #: ../data/functions.xml.in.h:683 #, fuzzy msgid "Upper endpoint" msgstr "Bovengrens" #: ../data/functions.xml.in.h:684 msgid "Logical" msgstr "Logisch" #: ../data/functions.xml.in.h:685 msgid "For...Do" msgstr "For...Do" #: ../data/functions.xml.in.h:686 msgid "r:for" msgstr "" #: ../data/functions.xml.in.h:687 msgid "Initial value of counter" msgstr "Beginwaarde van teller" #: ../data/functions.xml.in.h:688 msgid "Counter variable" msgstr "Tellervariabele" #: ../data/functions.xml.in.h:689 msgid "For condition" msgstr "For-voorwaarde" #: ../data/functions.xml.in.h:690 msgid "Counter update function" msgstr "Functie voor bijwerken van de teller" #: ../data/functions.xml.in.h:691 msgid "Do function" msgstr "Do-functie" #: ../data/functions.xml.in.h:692 msgid "If...Then...Else" msgstr "If...Then...Else" #: ../data/functions.xml.in.h:693 msgid "r:if" msgstr "" #: ../data/functions.xml.in.h:694 msgid "Tests a condition and returns a value depending on the result." msgstr "" "Test een conditie en retourneert een waarde afhankelijk van het resultaat." #: ../data/functions.xml.in.h:695 msgid "Expression if condition is met" msgstr "Expressie indien aan conditie wordt voldaan" #: ../data/functions.xml.in.h:696 msgid "Expression if condition is NOT met" msgstr "Expressie indien NIET aan conditie wordt voldaan" #: ../data/functions.xml.in.h:697 msgid "Logical Exclusive OR" msgstr "Booleaanse XOR" #: ../data/functions.xml.in.h:698 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:699 msgid "Value 1" msgstr "Waarde 1" #: ../data/functions.xml.in.h:700 msgid "Value 2" msgstr "Waarde 2" #: ../data/functions.xml.in.h:701 msgid "Bitwise Exclusive OR" msgstr "Bitsgewijs XOR" #: ../data/functions.xml.in.h:702 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:703 msgid "Bitwise Shift" msgstr "Bitsgewijs verschuiven (shift)" #: ../data/functions.xml.in.h:704 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:705 msgid "Bits" msgstr "Bits" #: ../data/functions.xml.in.h:706 msgid "Bitwise Complement (Not)" msgstr "" #: ../data/functions.xml.in.h:707 msgid "r:bitcmp" msgstr "" #: ../data/functions.xml.in.h:708 msgid "Algebra" msgstr "Algebra" #: ../data/functions.xml.in.h:709 #, fuzzy msgid "Summation" msgstr "Vergelijking" #: ../data/functions.xml.in.h:710 msgid "au:Σ,r:sum" msgstr "au:Σ,som" #: ../data/functions.xml.in.h:711 #, fuzzy msgid "" "Corresponds to the summation symbol. Adds terms for each x ranging from the " "lower to the upper limit." msgstr "" "Komt overeen met symbool voor optellen. Telt termen op met een waarde tussen " "de kleinste en de grootste grenswaarde." #: ../data/functions.xml.in.h:712 msgid "Term expression" msgstr "Expressie voor term" #: ../data/functions.xml.in.h:713 msgid "Lower limit (i)" msgstr "Ondergrens (i)" #: ../data/functions.xml.in.h:714 msgid "Upper limit (n)" msgstr "Bovengrens (n)" #: ../data/functions.xml.in.h:715 msgid "Product of a sequence" msgstr "" #: ../data/functions.xml.in.h:716 msgid "au:Π,r:product" msgstr "" #: ../data/functions.xml.in.h:717 msgid "" "Corresponds to the product symbol. Multiplies factors for each x ranging " "from the lower to the upper limit." msgstr "" "Komt overeen met het symbool voor vermenigvuldiging. Vermenigvuldigt met " "factoren met een waarde tussen de kleinste en de grootste grenswaarde." #: ../data/functions.xml.in.h:718 msgid "Factor expression" msgstr "Expressie voor factor" #: ../data/functions.xml.in.h:719 msgid "Solve for multiple variables" msgstr "Oplossen voor meerdere variabelen" #: ../data/functions.xml.in.h:720 msgid "r:multisolve" msgstr "meerdereoplossen" #: ../data/functions.xml.in.h:721 msgid "Equation vector" msgstr "Vergelijkingsvector" #: ../data/functions.xml.in.h:722 msgid "Variable vector" msgstr "Variabele vector" #: ../data/functions.xml.in.h:723 msgid "Solve equation" msgstr "Vergelijking oplossen" #: ../data/functions.xml.in.h:724 msgid "r:solve" msgstr "oplossen" #: ../data/functions.xml.in.h:725 msgid "Equation" msgstr "Vergelijking" #: ../data/functions.xml.in.h:726 msgid "With respect to" msgstr "Met betrekking tot" #: ../data/functions.xml.in.h:727 #, fuzzy msgid "Solve differential equation" msgstr "Vergelijking oplossen" #: ../data/functions.xml.in.h:728 #, fuzzy msgid "r:dsolve" msgstr "oplossen" #: ../data/functions.xml.in.h:729 msgid "Initial condition: function value (y)" msgstr "" #: ../data/functions.xml.in.h:730 msgid "Initial condition: argument value (x)" msgstr "" #: ../data/functions.xml.in.h:731 msgid "" "Solves a differential equation and returns the value of y(x). The derivative " "in the equation should be in the format diff(y, x). Only first-order " "differential equations are currently supported." msgstr "" #: ../data/functions.xml.in.h:732 msgid "Solve for two variables" msgstr "Oplossen voor twee variabelen" #: ../data/functions.xml.in.h:733 msgid "r:solve2" msgstr "oplossen2" #: ../data/functions.xml.in.h:734 msgid "" "Solves two equations with two unknown variables. Returns the value of the " "first variable." msgstr "" "Lost twee vergelijkingen op in twee variabelen. Retourneert de waarde van de " "eerste variabele." #: ../data/functions.xml.in.h:735 msgid "Equation 1" msgstr "Vergelijking 1" #: ../data/functions.xml.in.h:736 msgid "Equation 2" msgstr "Vergelijking 2" #: ../data/functions.xml.in.h:737 msgid "Variable 1" msgstr "Variabele 1" #: ../data/functions.xml.in.h:738 msgid "Variable 2" msgstr "Variabele 2" #: ../data/functions.xml.in.h:739 msgid "Find Linear Function" msgstr "Lineaire functie bepalen" #: ../data/functions.xml.in.h:740 msgid "r:linearfunction" msgstr "lineairefunctie" #: ../data/functions.xml.in.h:741 msgid "" "Finds the linear function for the straight line between two distinct points." msgstr "" "Bepaalt de lineaire functie voor de rechte lijn tussen twee verschillende " "punten." #: ../data/functions.xml.in.h:742 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:743 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:744 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:745 msgid "y2" msgstr "" #: ../data/functions.xml.in.h:746 msgid "Calculus" msgstr "Calculus" #: ../data/functions.xml.in.h:747 #, fuzzy msgid "Differentiate" msgstr "Percentiel" #: ../data/functions.xml.in.h:748 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:749 msgid "Integrate" msgstr "Integreren" #: ../data/functions.xml.in.h:750 msgid "r:integrate" msgstr "integreren" #: ../data/functions.xml.in.h:751 msgid "Variable of integration" msgstr "Integratievariabele" #: ../data/functions.xml.in.h:752 #, fuzzy msgid "Limit" msgstr "Ondergrens" #: ../data/functions.xml.in.h:753 msgid "" "Returns the two-sided limit of the function if direction is zero, limit from " "left (below) if direction is -1, or limit from right (above) if direction is " "+1." msgstr "" #: ../data/functions.xml.in.h:754 #, fuzzy msgid "r:limit" msgstr "grenzen" #: ../data/functions.xml.in.h:755 msgid "Value to approach" msgstr "" #: ../data/functions.xml.in.h:756 #, fuzzy msgid "Direction" msgstr "Sectie" #: ../data/functions.xml.in.h:757 msgid "Extreme Values" msgstr "Uiterste waarden" #: ../data/functions.xml.in.h:758 msgid "r:extremum" msgstr "uiterste" #: ../data/functions.xml.in.h:759 #, fuzzy msgid "Named Integrals" msgstr "Gehele getallen" #: ../data/functions.xml.in.h:760 msgid "Logarithmic Integral" msgstr "" #: ../data/functions.xml.in.h:761 #, fuzzy msgid "rc:li,logint" msgstr "logistisch" #: ../data/functions.xml.in.h:762 msgid "The integral of 1/ln(x)." msgstr "" #: ../data/functions.xml.in.h:763 #, fuzzy msgid "Exponential Integral" msgstr "Exponent (e^x)" #: ../data/functions.xml.in.h:764 msgid "rc:Ei,expint" msgstr "" #: ../data/functions.xml.in.h:765 msgid "The integral of e^x/x." msgstr "" #: ../data/functions.xml.in.h:766 #, fuzzy msgid "Sine Integral" msgstr "Integreren" #: ../data/functions.xml.in.h:767 msgid "rc:Si,sinint" msgstr "" #: ../data/functions.xml.in.h:768 msgid "The integral of sin(x)/x." msgstr "" #: ../data/functions.xml.in.h:769 #, fuzzy msgid "Cosine Integral" msgstr "Is een geheel getal" #: ../data/functions.xml.in.h:770 msgid "rc:Ci,cosint" msgstr "" #: ../data/functions.xml.in.h:771 msgid "The integral of cos(x)/x." msgstr "" #: ../data/functions.xml.in.h:772 #, fuzzy msgid "Hyperbolic Sine Integral" msgstr "Hyperbolische sinus" #: ../data/functions.xml.in.h:773 msgid "rc:Shi,sinhint" msgstr "" #: ../data/functions.xml.in.h:774 msgid "The integral of sinh(x)/x." msgstr "" #: ../data/functions.xml.in.h:775 #, fuzzy msgid "Hyperbolic Cosine Integral" msgstr "Hyperbolische cosinus" #: ../data/functions.xml.in.h:776 msgid "rc:Chi,coshint" msgstr "" #: ../data/functions.xml.in.h:777 msgid "The integral of cosh(x)/x." msgstr "" #: ../data/functions.xml.in.h:778 #, fuzzy msgid "Upper Incomplete Gamma Function" msgstr "Gamma-functie" #: ../data/functions.xml.in.h:779 msgid "r:igamma" msgstr "" #: ../data/functions.xml.in.h:780 #, fuzzy msgid "Lower Incomplete Gamma Function" msgstr "Gamma-functie" #: ../data/functions.xml.in.h:781 msgid "r:gammainc" msgstr "" #: ../data/functions.xml.in.h:782 msgid "Geometry" msgstr "Meetkunde" #: ../data/functions.xml.in.h:783 msgid "Triangle" msgstr "Driehoek" #: ../data/functions.xml.in.h:784 msgid "Hypotenuse" msgstr "Hypotenusa" #: ../data/functions.xml.in.h:785 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:786 msgid "Side A" msgstr "Zijde A" #: ../data/functions.xml.in.h:787 msgid "Side B" msgstr "Zijde B" #: ../data/functions.xml.in.h:788 msgid "Triangle Area" msgstr "Oppervlakte van driehoek" #: ../data/functions.xml.in.h:789 msgid "r:triangle" msgstr "driehoek" #: ../data/functions.xml.in.h:790 msgid "Height" msgstr "Hoogte" #: ../data/functions.xml.in.h:791 msgid "Triangle Perimeter" msgstr "Omtrek van driehoek" #: ../data/functions.xml.in.h:792 msgid "r:triangle_perimeter" msgstr "driehoek_omtrek" #: ../data/functions.xml.in.h:793 msgid "Side C" msgstr "Zijde C" #: ../data/functions.xml.in.h:794 msgid "Circle" msgstr "Cirkel" #: ../data/functions.xml.in.h:795 msgid "Circle Area" msgstr "Cirkeloppervlak" #: ../data/functions.xml.in.h:796 msgid "r:circle" msgstr "cirkel" #: ../data/functions.xml.in.h:797 msgid "Calculates the area of a circle using the radius" msgstr "Berekent met de straal het oppervlak van een cirkel" #: ../data/functions.xml.in.h:798 msgid "Radius" msgstr "Straal" #: ../data/functions.xml.in.h:799 msgid "Circle Circumference" msgstr "Cirkelomtrek" #: ../data/functions.xml.in.h:800 msgid "r:circumference" msgstr "cirkelomtrek" #: ../data/functions.xml.in.h:801 msgid "Cylinder" msgstr "Cilinder" #: ../data/functions.xml.in.h:802 msgid "Cylinder Volume" msgstr "Volume van cilinder" #: ../data/functions.xml.in.h:803 msgid "r:cylinder" msgstr "cilinder" #: ../data/functions.xml.in.h:804 msgid "Surface Area of Cylinder" msgstr "Oppervlaktegrootte van cilinder" #: ../data/functions.xml.in.h:805 msgid "r:cylinder_sa" msgstr "cilinder_opp" #: ../data/functions.xml.in.h:806 msgid "Cone" msgstr "Kegel" #: ../data/functions.xml.in.h:807 msgid "Cone Volume" msgstr "Volume van kegel" #: ../data/functions.xml.in.h:808 msgid "r:cone" msgstr "kegel" #: ../data/functions.xml.in.h:809 msgid "Surface Area of Cone" msgstr "Oppervlaktegrootte van kegel" #: ../data/functions.xml.in.h:810 msgid "r:cone_sa" msgstr "kegel_opp" #: ../data/functions.xml.in.h:811 msgid "Sphere" msgstr "Bol" #: ../data/functions.xml.in.h:812 msgid "Sphere Volume" msgstr "Volume van bol" #: ../data/functions.xml.in.h:813 msgid "r:sphere" msgstr "bol" #: ../data/functions.xml.in.h:814 msgid "Surface Area of Sphere" msgstr "Oppervlaktegrootte van bol" #: ../data/functions.xml.in.h:815 msgid "r:sphere_sa" msgstr "bol_oppervlak" #: ../data/functions.xml.in.h:816 msgid "Square Area" msgstr "Oppervlakte van vierkant" #: ../data/functions.xml.in.h:817 msgid "r:square" msgstr "vierkant" #: ../data/functions.xml.in.h:818 msgid "Length of side" msgstr "Lengte van zijde" #: ../data/functions.xml.in.h:819 msgid "Square Perimeter" msgstr "Omtrek van vierkant" #: ../data/functions.xml.in.h:820 msgid "r:square_perimeter" msgstr "vierkant_omtrek" #: ../data/functions.xml.in.h:821 msgid "Cube" msgstr "Derdemacht" #: ../data/functions.xml.in.h:822 msgid "Cube Volume" msgstr "Volume kubus" #: ../data/functions.xml.in.h:823 msgid "r:cube" msgstr "kubus" #: ../data/functions.xml.in.h:824 msgid "Surface Area of Cube" msgstr "Oppervlaktegrootte van kubus" #: ../data/functions.xml.in.h:825 msgid "r:cube_sa" msgstr "kubus_opp" #: ../data/functions.xml.in.h:826 msgid "Rectangle" msgstr "Rechthoek" #: ../data/functions.xml.in.h:827 msgid "Rectangle Area" msgstr "Oppervlak rechthoek" #: ../data/functions.xml.in.h:828 msgid "r:rect" msgstr "" #: ../data/functions.xml.in.h:829 msgid "Width" msgstr "Breedte" #: ../data/functions.xml.in.h:830 msgid "Rectangle Perimeter" msgstr "Omtrek rechthoek" #: ../data/functions.xml.in.h:831 msgid "r:rect_perimeter" msgstr "rect_omtrek" #: ../data/functions.xml.in.h:832 msgid "Prism" msgstr "Prisma" #: ../data/functions.xml.in.h:833 msgid "Volume of Rectangular Prism" msgstr "Inhoud van rechthoekig prisma" #: ../data/functions.xml.in.h:834 msgid "r:rectprism" msgstr "rectprisma" #: ../data/functions.xml.in.h:835 msgid "Calculates the volume of a prism with rectangular base." msgstr "Berekent de inhoud van een prisma met een rechthoekig basisvlak." #: ../data/functions.xml.in.h:836 msgid "Surface Area of Rectangular Prism" msgstr "Oppervlaktegrootte van rechthoekig prisma" #: ../data/functions.xml.in.h:837 msgid "r:rectprism_sa" msgstr "rectprisma_opp" #: ../data/functions.xml.in.h:838 msgid "Calculates the surface area of a prism with rectangular base." msgstr "Berekent de oppervlakte van een prisma met een rechthoekig basisvlak." #: ../data/functions.xml.in.h:839 msgid "Volume of Triangular Prism" msgstr "Inhoud van driehoekig prisma" #: ../data/functions.xml.in.h:840 msgid "r:triangleprism" msgstr "driehoekprisma" #: ../data/functions.xml.in.h:841 msgid "Calculates the volume of a prism with triangular base." msgstr "Berekent de inhoud van een prisma met een driehoekig basisvlak." #: ../data/functions.xml.in.h:842 msgid "Pyramid" msgstr "Piramide" #: ../data/functions.xml.in.h:843 msgid "Pyramid Volume" msgstr "Volume van piramide" #: ../data/functions.xml.in.h:844 msgid "r:pyramid" msgstr "piramide" #: ../data/functions.xml.in.h:845 msgid "" "Calculates the volume of a 3-dimensional shape standing on a rectangular " "base and terminating in a point at the top." msgstr "" "Berekent de inhoud van een 3-dimensionaal lichaam met een rechthoekig " "basisvlak en een top in de vorm van een punt." #: ../data/functions.xml.in.h:846 msgid "Length of base" msgstr "Lengte van basis" #: ../data/functions.xml.in.h:847 msgid "Width of base" msgstr "Basislengte" #: ../data/functions.xml.in.h:848 msgid "Volume of Regular Tetrahedron" msgstr "Inhoud van regelmatig viervlak (tetraëder)" #: ../data/functions.xml.in.h:849 msgid "r:tetrahedron" msgstr "tetraëder" #: ../data/functions.xml.in.h:850 msgid "Surface Area of Regular Tetrahedron" msgstr "Oppervlaktegrootte van regelmatig viervlak (tetraëder)" #: ../data/functions.xml.in.h:851 msgid "r:tetrahedron_sa" msgstr "tetraëder_opp" #: ../data/functions.xml.in.h:852 msgid "Height of Regular Tetrahedron" msgstr " Hoogte van een regelmatig viervlak (tetraëder)" #: ../data/functions.xml.in.h:853 msgid "r:tetrahedron_height" msgstr "tetraëder_hoogte" #: ../data/functions.xml.in.h:854 msgid "Volume of Square Pyramid" msgstr "Inhoud van vierkant prisma" #: ../data/functions.xml.in.h:855 msgid "r:sqpyramid" msgstr "vierkpiramide" #: ../data/functions.xml.in.h:856 msgid "Surface Area of Square Pyramid" msgstr "Oppervlaktegrootte van vierkante piramide" #: ../data/functions.xml.in.h:857 msgid "r:sqpyramid_sa" msgstr "vierkpiramide_opp" #: ../data/functions.xml.in.h:858 msgid "Height of Square Pyramid" msgstr "Hoogte van een vierkante piramide" #: ../data/functions.xml.in.h:859 msgid "r:sqpyramid_height" msgstr "midhoogte_vierkpiramide" #: ../data/functions.xml.in.h:860 msgid "Parallelogram" msgstr "Parallellogram" #: ../data/functions.xml.in.h:861 msgid "Parallelogram Area" msgstr "Oppervlak van parallellogram" #: ../data/functions.xml.in.h:862 msgid "r:parallelogram" msgstr "parallellogram" #: ../data/functions.xml.in.h:863 msgid "" "Calculates the area of a four-sided figure whose opposite sides are both " "parallel and equal in length." msgstr "" "Berekent de oppervlakte van een figuur met vier zijden waarvan de " "overstaande zijden zowel evenwijdig als even lang zijn." #: ../data/functions.xml.in.h:864 msgid "Parallelogram Perimeter" msgstr "Omtrek van parallellogram" #: ../data/functions.xml.in.h:865 msgid "r:parallelogram_perimeter" msgstr "parallellogram_omtrek" #: ../data/functions.xml.in.h:866 msgid "" "Calculates the perimeter of a four-sided figure whose opposite sides are " "both parallel and equal in length." msgstr "" "Berekent de omtrek van een figuur met vier zijden waarvan de overstaande " "zijden zowel evenwijdig als even lang zijn." #: ../data/functions.xml.in.h:867 msgid "Trapezoid" msgstr "Trapezium" #: ../data/functions.xml.in.h:868 msgid "Trapezoid Area" msgstr "Oppervlakte van trapezium" #: ../data/functions.xml.in.h:869 msgid "r:trapezoid" msgstr "trapezium" #: ../data/functions.xml.in.h:870 msgid "Calculates the area of a four-sided figure with two parallel sides." msgstr "" "Berekent de oppervlakte van een figuur met vier zijden waarvan twee zijden " "evenwijdig zijn." #: ../data/functions.xml.in.h:871 msgid "Economics" msgstr "Economie" #: ../data/functions.xml.in.h:872 msgid "Microeconomics" msgstr "Microëconomie" #: ../data/functions.xml.in.h:873 msgid "Elasticity" msgstr "Elasticiteit" #: ../data/functions.xml.in.h:874 msgid "r:elasticity" msgstr "elasticiteit" #: ../data/functions.xml.in.h:875 msgid "" "Calculates the demand elasticity. Also works for supply elasticity, income " "elasticity, cross-price elasticity, etc. Just replace demand with supply, or " "price with income... eg. elasticity(100-x^2, 3) calculates the " "demand elasticity when the price is 3 for the function \"Q = 100 - x^2\" " "where x is the default price variable." msgstr "" "Berekent de vraagelasticiteit. Is ook toepasbaar op aanbodelasticiteit, " "inkomenselasticiteit, prijselasticiteit, enzovoorts. Vervang vraag door " "aanbod of prijs met inkomen... %#10; De formule elasticity(100-x^2, 3) " "bijvoorbeeld berekent de vraagelasticiteit als de prijs 3 is voor de functie " "\"Q = 100 -x^2\". waar x de standaard prijsvariabele is." #: ../data/functions.xml.in.h:876 msgid "Demand function" msgstr "Vraagfunctie" #: ../data/functions.xml.in.h:877 msgid "Price" msgstr "Prijs" #: ../data/functions.xml.in.h:878 msgid "Price variable" msgstr "Prijsvariabele" #: ../data/functions.xml.in.h:879 msgid "Sum-of-Years Digits Depreciation" msgstr "Afschrijving volgens som der jaren" #: ../data/functions.xml.in.h:880 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:881 msgid "" "Calculates the sum-of-years digits depreciation for an asset based on its " "cost, salvage value, anticipated life, and a particular period. This method " "accelerates the rate of the depreciation, so that more depreciation expense " "occurs in earlier periods than in later ones. The depreciable cost is the " "actual cost minus the salvage value. The useful life is the number of " "periods (typically years) over which the asset is depreciated." msgstr "" "Berekent de afschrijving naar leeftijd voor een actief gebaseerd op de " "aanschafkosten, de restwaarde, de verwachte economische levensduur en een " "bepaalde periode. Deze methode vermindert de afschrijvingskosten naarmate " "het actief ouder word. De afschrijvingskosten zijn dus aan het begin het " "hoogst. De af te schrijven waarde wordt berekend uit het verschil tussen " "aanschaf- en restwaarde. De economische levensduur is het aantal perioden " "(meestal jaren) waarin het actief word afgeschreven." #: ../data/functions.xml.in.h:882 msgid "Cost" msgstr "Kosten" #: ../data/functions.xml.in.h:883 msgid "Salvage value" msgstr "Restwaarde" #: ../data/functions.xml.in.h:884 msgid "Life" msgstr "Levensduur" #: ../data/functions.xml.in.h:885 msgid "Period" msgstr "Termijn" #: ../data/functions.xml.in.h:886 msgid "Straight Line Depreciation" msgstr "Gelijkblijvende afschrijving" #: ../data/functions.xml.in.h:887 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:888 msgid "" "Determines the straight line depreciation of an asset for a single period." " Cost is the amount you paid for the asset. Salvage is the value of " "the asset at the end of the period. Life is the number of periods over which " "the asset is depreciated. SLN divides the cost evenly over the life of an " "asset." msgstr "" "Bepaalt de waardevermindering volgens een rechte lijn van een bezit " "gedurende een enkele termijn. Kosten is het voor het bezit " "betaalde bedrag. Restwaarde is de waarde van het bezit aan het einde van de " "termijn. Levensduur is het aantal termijnen waarover het bezit wordt " "afgeschreven. Door deze vorm van afschrijven worden de kosten gelijkelijk " "verdeeld over de gehele afschrijvingsduur." #: ../data/functions.xml.in.h:889 msgid "Present Value" msgstr "Huidige waarde" #: ../data/functions.xml.in.h:890 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:891 msgid "" "Returns the present value of an investment. If type = 1 then the " "payment is made at the beginning of the period, If type = 0 (or omitted) it " "is made at the end of each period." msgstr "" "Berekent de huidige waarde van een investering. Indien type = 1 is " "de uitbetaling aan het begin van de termijn, indien type = 0 (of weggelaten) " "aan het einde van elke termijn." #: ../data/functions.xml.in.h:892 msgid "Interest rate" msgstr "Rentepercentage" #: ../data/functions.xml.in.h:893 msgid "Number of periods" msgstr "Aantal termijnen" #: ../data/functions.xml.in.h:894 msgid "Payment made each period" msgstr "Termijnbetaling" #: ../data/functions.xml.in.h:895 msgid "Future value" msgstr "Toekomstige waarde" #: ../data/functions.xml.in.h:896 msgid "Type" msgstr "Type" #: ../data/functions.xml.in.h:897 msgid "Nominal Interest Rate" msgstr "Nominaal rentepercentage" #: ../data/functions.xml.in.h:898 msgid "r:nominal" msgstr "nominaal" #: ../data/functions.xml.in.h:899 msgid "" "Calculates the nominal interest rate from a given effective interest rate " "compounded at given intervals." msgstr "" "Berekent de nominale rente uit de effectieve rente betaald over het " "opgegeven tijdsinterval." #: ../data/functions.xml.in.h:900 msgid "Effective interest rate" msgstr "Effectief rentepercentage" #: ../data/functions.xml.in.h:901 msgid "Periods" msgstr "Termijnen" #: ../data/functions.xml.in.h:902 msgid "Zero Coupon" msgstr "Zonder coupons" #: ../data/functions.xml.in.h:903 msgid "r:zero_coupon" msgstr "geen_coupon" #: ../data/functions.xml.in.h:904 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "Berekent de waarde van een obligatie zonder coupons." #: ../data/functions.xml.in.h:905 msgid "Face value" msgstr "Nominale waarde" #: ../data/functions.xml.in.h:906 msgid "Treasury Bill Yield" msgstr "Opbrengst kortlopende overheidsobligatie zonder coupons" #: ../data/functions.xml.in.h:907 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:908 msgid "Returns the yield for a treasury bill." msgstr "" "Berekent de opbrengst van een kortlopende overheidsobligatie zonder coupons." #: ../data/functions.xml.in.h:909 msgid "Settlement date" msgstr "Afwikkeldatum" #: ../data/functions.xml.in.h:910 msgid "Maturity date" msgstr "Vervaldatum" #: ../data/functions.xml.in.h:911 msgid "Price per $100 face value" msgstr "Prijs per €100 nominale waarde" #: ../data/functions.xml.in.h:912 msgid "Treasury Bill Price" msgstr "Prijs kortlopende overheidsobligatie zonder coupons" #: ../data/functions.xml.in.h:913 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:914 msgid "Returns the price per $100 value for a treasury bill." msgstr "" "Berekent de prijs per € 100 voor een kortlopende overheidsobligatie zonder " "coupons." #: ../data/functions.xml.in.h:915 msgid "Discount rate" msgstr "Discontopercentage" #: ../data/functions.xml.in.h:916 msgid "Treasury Bill Equivalent" msgstr "Equivalent van kortlopende overheidsobligatie zonder coupons" #: ../data/functions.xml.in.h:917 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:918 msgid "Returns the bond equivalent for a treasury bill." msgstr "" "Berekent het obligatie-equivalent voor een kortlopende overheidsobligatie " "zonder coupons." #: ../data/functions.xml.in.h:919 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "Rente betaald over een gegeven investeringstermijn (ISPMT)" #: ../data/functions.xml.in.h:920 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:921 msgid "Calculates the interest paid on a given period of an investment." msgstr "Berekent de betaalde rente over de opgegeven investeringstermijn." #: ../data/functions.xml.in.h:922 msgid "Periodic interest rate" msgstr "Periodiek rentepercentage" #: ../data/functions.xml.in.h:923 msgid "Amortizement period" msgstr "Amortisatieperiode" #: ../data/functions.xml.in.h:924 msgid "Present value" msgstr "Huidige waarde" #: ../data/functions.xml.in.h:925 msgid "Payment for a loan" msgstr "Betaling voor een lening" #: ../data/functions.xml.in.h:926 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:927 #, fuzzy msgid "" "Returns the amount of payment (negative) each period for a loan based on a " "constant interest rate and constant payments (each payment is equal amount)." " If type = 1 then the payment is made at the beginning of the " "period, If type = 0 (or omitted) it is made at the end of each period. " " Note that the interest rate here refers to the rate for each period and " "if you calculate with an annual rate, each period will be interpreted as a " "whole year. To get monthly payments divide the annual interest rate by 12 " "and enter the total number of months (12 times number of year) in the " "periods field." msgstr "" "Berekent het te betalen bedrag voor een lening gebaseerd op een vast " "rentepercentage en gelijkblijvende betalingen (elke keer moet hetzelfde " "bedrag worden betaald). Indien type = 1 moet er aan het begin van " "de termijn worden betaald, Indien type = 0 (ofweggelaten) aan het einde van " "elke termijn." #: ../data/functions.xml.in.h:928 msgid "Rate" msgstr "" #: ../data/functions.xml.in.h:929 msgid "Periods of an investment" msgstr "Termijnen van een investering" #: ../data/functions.xml.in.h:930 msgid "r:nper" msgstr "nterm" #: ../data/functions.xml.in.h:931 msgid "" "Calculates number of periods of an investment based on periodic constant " "payments and a constant interest rate. Type defines the due date. 1 " "for payment at the beginning of a period and 0 (default) for payment at the " "end of a period." msgstr "" "Berekent het aantal termijnen voor een investering op basis van periodiek " "gelijkblijvende betalingen en een gelijkblijvende rente. Type " "bepaalt de datum waarop moet worden betaald. 1 voor betalen aan het begin " "van een termijn en 0 (standaard) voor betalen aan het eind van een termijn." #: ../data/functions.xml.in.h:932 msgid "Periods for investment to attain desired value" msgstr "Termijnen waarin een investering de gewenste waarde bereikt" #: ../data/functions.xml.in.h:933 msgid "r:g_duration" msgstr "g_duur" #: ../data/functions.xml.in.h:934 msgid "" "Returns the number of periods needed for an investment to attain a desired " "value." msgstr "" "Retourneert het aantal benodigde termijnen waarna een investering een " "gewenste waarde bereikt." #: ../data/functions.xml.in.h:935 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "Aflossingsdeel van een termijn van een annuïteit (PPMT)" #: ../data/functions.xml.in.h:936 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:937 msgid "" "Calculates the amount of a payment of an annuity going towards principal." " Type defines the due date. 1 for payment at the beginning of a " "period and 0 (default) for payment at the end of a period." msgstr "" "Berekent het aflossingsdeel van een periodieke betaling voor een annuïteit." " Type bepaalt de vervaldatum van de betaling. 1 voor betaling " "aanhet het begin van de termijn en 0 (standaard) voor betaling aan het einde " "van de termijn." #: ../data/functions.xml.in.h:938 msgid "Desired future value" msgstr "Gewenste toekomstige waarde" #: ../data/functions.xml.in.h:939 msgid "Effective Interest Rate" msgstr "Effectief rentepercentage" #: ../data/functions.xml.in.h:940 msgid "r:effect" msgstr "" #: ../data/functions.xml.in.h:941 msgid "Calculates the effective interest for a given nominal rate." msgstr "Berekent de effectieve rente bij een gegeven nominale rente." #: ../data/functions.xml.in.h:942 msgid "Nominal interest rate" msgstr "Nominaal rentepercentage" #: ../data/functions.xml.in.h:943 msgid "Future Value" msgstr "Toekomstige waarde" #: ../data/functions.xml.in.h:944 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:945 msgid "" "Computes the future value of an investment. This is based on periodic, " "constant payments and a constant interest rate. If type = 1 then " "the payment is made at the beginning of the period, If type = 0 (or omitted) " "it is made at the end of each period." msgstr "" "Berekent de waarde van een investering. Dit wordt gebaseerd op periodieke " "gelijkblijvende betalingen en een gelijkblijvende rente. Indien " "type = 1 wordt er betaald aanhet het begin van de termijn, als type = 0 (of " "weggelaten)wordt er betaald aan het einde van elke termijn." #: ../data/functions.xml.in.h:946 msgid "Return on continuously compounded interest" msgstr "Opbrengst van continu samengestelde rente" #: ../data/functions.xml.in.h:947 msgid "r:continuous" msgstr "continu" #: ../data/functions.xml.in.h:948 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "" "Berekent de opbrengst bij een continu samengestelde rente, gegeven de " "hoofdsom, nominale rente en de tijd in jaren." #: ../data/functions.xml.in.h:949 msgid "Principal" msgstr "Hoofdsom" #: ../data/functions.xml.in.h:950 msgid "Compound" msgstr "Samengesteld" #: ../data/functions.xml.in.h:951 msgid "r:compound" msgstr "samenstellen" #: ../data/functions.xml.in.h:952 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "" "Berekent de waarde van een investering, gegeven de hoofdsom, nominale rente, " "samenstellingsfrequentie en tijdsduur." #: ../data/functions.xml.in.h:953 msgid "Periods per year" msgstr "Termijnen per jaar" #: ../data/functions.xml.in.h:954 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "Interestdeel van een termijn van een annuïteit (IPMT)" #: ../data/functions.xml.in.h:955 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:956 msgid "" "Calculates the amount of a payment of an annuity going towards interest. " " Type defines the due date. 1 for payment at the beginning of a period " "and 0 (default) for payment at the end of a period." msgstr "" "Berekent het interestdeel van een periodieke betaling voor een annuïteit." " Type bepaalt de vervaldatum van de betaling. 1 voor betaling " "aanhet het begin van de termijn en 0 (standaard) voor betaling aan het einde " "van de termijn." #: ../data/functions.xml.in.h:957 msgid "Interest rate for a fully invested security" msgstr "" "Interestpercentage voor een waardepapier waarvan de hoofdsom aan het einde " "vrijvalt" #: ../data/functions.xml.in.h:958 msgid "r:intrate" msgstr "renteperc" #: ../data/functions.xml.in.h:959 msgid "" "Returns the interest rate for a fully invested security. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent het rentepercentage voor een volledig geïnvesteerd waardepapier. " " Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 " "(standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke " "dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:960 msgid "Investment" msgstr "Investering" #: ../data/functions.xml.in.h:961 msgid "Redemption" msgstr "Aflossing" #: ../data/functions.xml.in.h:962 msgid "Dollar Fraction" msgstr "Dollar fractie" #: ../data/functions.xml.in.h:963 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:964 msgid "" "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "" "Converteert een prijs in decimale dollars naar een prijs in dollars " "uitgedrukt als een breuk." #: ../data/functions.xml.in.h:965 msgid "Decimal dollar" msgstr "Decimale dollar" #: ../data/functions.xml.in.h:966 msgid "Denominator of fraction" msgstr "Noemer van breuk" #: ../data/functions.xml.in.h:967 msgid "Dollar Decimal" msgstr "Dollar decimaal" #: ../data/functions.xml.in.h:968 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:969 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "" "Converteert een prijs in dollars uitgedrukt als een breuk naar een prijs " "uitgedrukt in een decimaal getal." #: ../data/functions.xml.in.h:970 msgid "Fractional dollar" msgstr "Dollar als breuk" #: ../data/functions.xml.in.h:971 msgid "Amount received at maturity for a security bond" msgstr "Ontvangen bedrag voor een waardepapier op vervaldatum" #: ../data/functions.xml.in.h:972 msgid "r:received" msgstr "ontvangen" #: ../data/functions.xml.in.h:973 msgid "" "Returns the amount received at the maturity date for an invested security." " Basis is the type of day counting you want to use: 0: US 30/360 " "(default), 1: real days, 2: real days/360, 3: real days/365 or 4: European " "30/360. The settlement date must be before maturity date." msgstr "" "Berekent het te ontvangen bedrag na de afloopdatum van een " "investeringswaardepapier. Basis is de dagtelling die u wilt " "gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke " "dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360. De afwikkeling " "moet plaats vinden voor de afloopdatum." #: ../data/functions.xml.in.h:974 msgid "Discount rate for a security" msgstr "Discontopercentage voor een waardepapier" #: ../data/functions.xml.in.h:975 msgid "r:disc" msgstr "kort" #: ../data/functions.xml.in.h:976 msgid "" "Returns the discount rate for a security. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent het rentepercentage voor een waardepapier. Basis is de " "dagtelling die u wilt gebruiken: 0: US 30/360 (standaard), 1: werkelijke " "dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: Europees " "30/360." #: ../data/functions.xml.in.h:977 msgid "Accrued interest of security paying at maturity" msgstr "Totale rente van waardepapier op vervaldatum" #: ../data/functions.xml.in.h:978 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:979 msgid "" "Returns the accrued interest for a security which pays interest at maturity " "date. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "Berekent de aangegroeide rente voor een waardepapier waarvan de rente wordt " "uitgekeerd na de afloopdatum. Basis is de dagtelling die u wilt " "gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke " "dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:980 msgid "Issue date" msgstr "Uitgiftedatum" #: ../data/functions.xml.in.h:981 msgid "Annual rate of security" msgstr "Jaarlijkse rente van waardepapier" #: ../data/functions.xml.in.h:982 msgid "Par value" msgstr "Nominale waarde" #: ../data/functions.xml.in.h:983 msgid "Accrued interest of security with periodic interest payments" msgstr "Totale rente van waardepapier met periodieke renteuitkeringen" #: ../data/functions.xml.in.h:984 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:985 msgid "" "Returns accrued interest for a security which pays periodic interest. " " Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. " "Basis is the type of day counting you want to use: 0: US 30/360 (default), " "1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent de aangegroeide rente voor een waardepapier met een periodieke " "rente-uitkering. Mogelijke frequenties zijn 1 - jaarlijks, 2 - " "halfjaarlijks of 4 - per kwartaal. Basis is de dagtelling die u wilt " "gebruiken: 0: US 30/360 (standaard), 1: werkelijke dagen, 2: werkelijke " "dagen/360, 3: werkelijke dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:986 msgid "First interest" msgstr "Eerste rente" #: ../data/functions.xml.in.h:987 msgid "Frequency" msgstr "Frequentie" #: ../data/functions.xml.in.h:988 msgid "Number of coupons to be paid" msgstr "Aantal te betalen coupons" #: ../data/functions.xml.in.h:989 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:990 msgid "" "Returns the number of coupons to be paid between the settlement and the " "maturity. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "berekent het aantal te betalen coupons tussen afwikkeling en de afloopdatum. " " Basis is de dagtelling die u wilt gebruiken: 0: US 30/360 " "(standaard), 1: werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke " "dagen/365 of 4: Europees 30/360." #: ../data/functions.xml.in.h:991 #, fuzzy msgid "Price per $100 face value of a discounted security" msgstr "Prijs per €100 nominale waarde van een waardepapier" #: ../data/functions.xml.in.h:992 msgid "r:pricedisc" msgstr "prijskorting" #: ../data/functions.xml.in.h:993 #, fuzzy msgid "" "Calculates and returns the price per $100 face value of a discounted " "security. The security does not pay interest at maturity. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent en retourneert de prijs per €100 nominaal van een " "waardepapier. Er wordt na de vervaldatum geen rente uitgekeerd. " "Basis is de manier waarop dagen worden geteld: 0: US 30/360 (standaard), 1: " "werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: " "Europees 30/360." #: ../data/functions.xml.in.h:994 msgid "Discount" msgstr "Korting" #: ../data/functions.xml.in.h:995 msgid "Price per $100 face value of a security" msgstr "Prijs per €100 nominale waarde van een waardepapier" #: ../data/functions.xml.in.h:996 msgid "r:pricemat" msgstr "prijsmat" #: ../data/functions.xml.in.h:997 msgid "" "Calculates and returns the price per $100 face value of a security. The " "security pays interest at maturity. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Berekent en retourneert de prijs per €100 nominale waarde van een " "waardepapier. De rente wordt uitgekeerd op de vervaldatum. Basis is " "de manier waarop dagen worden geteld: 0: US 30/360 (standaard), 1: " "werkelijke dagen, 2: werkelijke dagen/360, 3: werkelijke dagen/365 of 4: " "Europees 30/360." #: ../data/functions.xml.in.h:998 msgid "Annual yield" msgstr "Opbrengst per jaar" #: ../data/functions.xml.in.h:999 msgid "Level-Coupon Bond" msgstr "Obligatie met gelijkblijvende coupons" #: ../data/functions.xml.in.h:1000 msgid "r:level_coupon" msgstr "gelijke_coupon" #: ../data/functions.xml.in.h:1001 msgid "Calculates the value of a level-coupon bond." msgstr "Berekent de waarde van een obligatie met gelijkblijvende coupons." #: ../data/functions.xml.in.h:1002 msgid "Coupon rate" msgstr "Couponrente" #: ../data/functions.xml.in.h:1003 msgid "Coupons per year" msgstr "Aantal coupons per jaar" #: ../data/functions.xml.in.h:1004 msgid "Market interest rate" msgstr "Marktrente" #: ../data/planets.xml.in.h:1 msgid "Earth" msgstr "Aarde" #: ../data/planets.xml.in.h:2 msgid "Mars" msgstr "" #. Planet #: ../data/planets.xml.in.h:4 msgid "!planets!Mercury" msgstr "Mercurius" #: ../data/planets.xml.in.h:5 msgid "Venus" msgstr "" #: ../data/planets.xml.in.h:6 msgid "Jupiter" msgstr "" #: ../data/planets.xml.in.h:7 msgid "Saturn" msgstr "Saturnus" #: ../data/planets.xml.in.h:8 msgid "Neptune" msgstr "Neptunus" #: ../data/planets.xml.in.h:9 msgid "Pluto" msgstr "" #: ../data/planets.xml.in.h:10 msgid "Uranus" msgstr "" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Length" msgstr "Lengte" #: ../data/units.xml.in.h:3 msgid "Meter" msgstr "" #: ../data/units.xml.in.h:4 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "a:m,meter,p:meters" #: ../data/units.xml.in.h:5 msgid "Kilometer" msgstr "" #: ../data/units.xml.in.h:6 msgid "Decimeter" msgstr "" #: ../data/units.xml.in.h:7 msgid "Centimeter" msgstr "" #: ../data/units.xml.in.h:8 msgid "Millimeter" msgstr "Milimeter" #: ../data/units.xml.in.h:9 msgid "Nautical Mile" msgstr "Nautische mijl" #: ../data/units.xml.in.h:10 msgid "r:nautical_mile,p:nautical_miles" msgstr "nautische_mijl,p:nautische_mijlen" #: ../data/units.xml.in.h:11 msgid "Ångström" msgstr "" #: ../data/units.xml.in.h:12 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:13 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:14 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:15 msgid "Inch" msgstr "" #: ../data/units.xml.in.h:16 msgid "ar:in,inch,p:inches" msgstr "" #: ../data/units.xml.in.h:17 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:18 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:19 msgid "Foot" msgstr "Voet" #: ../data/units.xml.in.h:20 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:21 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:22 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:23 msgid "Link" msgstr "" #: ../data/units.xml.in.h:24 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:25 msgid "Yard" msgstr "" #: ../data/units.xml.in.h:26 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:27 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:28 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:29 msgid "Fathom" msgstr "Vadem" #: ../data/units.xml.in.h:30 msgid "r:fathom,p:fathoms" msgstr "vadem,p:vadems" #: ../data/units.xml.in.h:31 msgid "Chain" msgstr "" #: ../data/units.xml.in.h:32 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:33 msgid "Furlong" msgstr "" #: ../data/units.xml.in.h:34 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:35 msgid "Mile" msgstr "Mijl" #: ../data/units.xml.in.h:36 msgid "ar:mi,mile,p:miles" msgstr "a:mi,mijl,p:mijlen" #: ../data/units.xml.in.h:37 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:38 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:39 msgid "Mil (1/1000 in)" msgstr "" #: ../data/units.xml.in.h:40 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:41 msgid "Astronomical Unit" msgstr "Astronomische eenheid" #: ../data/units.xml.in.h:42 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "a:AU,astronomische_eenheid,p:astronomische_eenheden" #: ../data/units.xml.in.h:43 msgid "Light Year" msgstr "Lichtjaar" #: ../data/units.xml.in.h:44 msgid "ar:ly,lightyear,p:lightyears" msgstr "a:lj,lichtjaar,p:lichtjaren" #: ../data/units.xml.in.h:45 msgid "Parsec" msgstr "" #: ../data/units.xml.in.h:46 msgid "ar:pc,parsec,p:parsecs" msgstr "" #: ../data/units.xml.in.h:47 msgid "Pied du roi (French Royal Foot)" msgstr "Pied du roi (Franse koninklijke voet)" #: ../data/units.xml.in.h:48 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:49 msgid "Pouce (French Royal Inch)" msgstr "Pouce (Franse koninklijke duim)" #: ../data/units.xml.in.h:50 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:51 msgid "Ligne" msgstr "Ligne (1/40 inch)" #: ../data/units.xml.in.h:52 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:53 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:54 msgid "r:toise" msgstr "" #. Unit category #: ../data/units.xml.in.h:56 msgid "!units!Angle" msgstr "Hoek" #: ../data/units.xml.in.h:57 msgid "Plane Angle" msgstr "Vlakke hoek" #: ../data/units.xml.in.h:58 msgid "Meter per Meter" msgstr "Meter per meter" #: ../data/units.xml.in.h:59 msgid "Radian" msgstr "Radiaal" #: ../data/units.xml.in.h:60 msgid "ar:rad,radian,p:radians" msgstr "a:rad,radiaal,p:radialen" #: ../data/units.xml.in.h:62 msgid "ar:deg,au:°,degree,p:degrees" msgstr "a:grd,au:°,graad,p:graden" #: ../data/units.xml.in.h:63 msgid "Gradian (Gon)" msgstr "Grad (Gon)" #: ../data/units.xml.in.h:64 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "a:gra,grad,p:grads,gon,p:gons" #: ../data/units.xml.in.h:65 msgid "Arcminute" msgstr "Boogminuut" #: ../data/units.xml.in.h:66 msgid "ar:arcmin,arcminute,p:arcminutes" msgstr "boogminuut,p:boogminuten" #: ../data/units.xml.in.h:67 msgid "Arcsecond" msgstr "Boogseconde" #: ../data/units.xml.in.h:68 msgid "ar:arcsec,arcsecond,p:arcseconds" msgstr "boogseconde,p:boogseconden" #: ../data/units.xml.in.h:69 msgid "Turn" msgstr "Slag" #: ../data/units.xml.in.h:70 msgid "r:turn,p:turns" msgstr "slag,p:slagen" #: ../data/units.xml.in.h:71 msgid "Solid Angle" msgstr "Ruimtehoek" #: ../data/units.xml.in.h:72 msgid "Square Meter per Square Meter" msgstr "Vierkante meter per vierkante meter" #: ../data/units.xml.in.h:73 msgid "Steradian" msgstr "Steradiaal" #: ../data/units.xml.in.h:74 msgid "ar:sr,steradian,p:steradians" msgstr "a:sr,steradiaal,p:steradialen" #: ../data/units.xml.in.h:75 msgid "Angular Acceleration" msgstr "Hoekversnelling" #: ../data/units.xml.in.h:76 msgid "Radians per Second Squared" msgstr "Radialen per seconde kwadraat" #: ../data/units.xml.in.h:77 msgid "Angular Velocity" msgstr "Hoeksnelheid" #: ../data/units.xml.in.h:78 msgid "Radians per Second" msgstr "Radialen per seconde" #. Unit category #: ../data/units.xml.in.h:80 msgid "!units!Mass" msgstr "Massa" #: ../data/units.xml.in.h:81 msgid "Gram" msgstr "" #: ../data/units.xml.in.h:82 msgid "ar:g,gram,p:grams" msgstr "a:g,gram,p:grammen" #: ../data/units.xml.in.h:83 msgid "Kilogram" msgstr "" #: ../data/units.xml.in.h:84 msgid "Hectogram" msgstr "" #: ../data/units.xml.in.h:85 msgid "Metric Ton (Tonne)" msgstr "Metrische ton (Ton)" #: ../data/units.xml.in.h:86 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "a:t,ton,p:tonnen" #: ../data/units.xml.in.h:87 msgid "Grain" msgstr "" #: ../data/units.xml.in.h:88 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:89 msgid "Pennyweight" msgstr "" #: ../data/units.xml.in.h:90 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:91 msgid "Ounce (troy)" msgstr "" #: ../data/units.xml.in.h:92 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:93 msgid "Pound (troy)" msgstr "" #: ../data/units.xml.in.h:94 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:95 msgid "Dram" msgstr "" #: ../data/units.xml.in.h:96 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:97 msgid "Ounce" msgstr "" #: ../data/units.xml.in.h:98 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:99 msgid "Pound" msgstr "" #: ../data/units.xml.in.h:100 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:101 #, fuzzy msgid "Short Hundredweight (Cental)" msgstr "Short hundredweight" #: ../data/units.xml.in.h:102 msgid "ar:cwt,hundredweight,cental,p:hundredweights,centals" msgstr "" #: ../data/units.xml.in.h:103 msgid "Long Hundredweight" msgstr "Long hundredweight" #: ../data/units.xml.in.h:104 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:105 msgid "Short Ton" msgstr "Short ton" #: ../data/units.xml.in.h:106 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:107 msgid "Long Ton" msgstr "Long ton" #: ../data/units.xml.in.h:108 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:109 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:110 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:111 msgid "Carat" msgstr "Karaat" #: ../data/units.xml.in.h:112 msgid "r:carat,p:carats" msgstr "karaat" #: ../data/units.xml.in.h:113 msgid "Pfund" msgstr "Pond" #: ../data/units.xml.in.h:114 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:115 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:116 msgid "r:zentner" msgstr "" #: ../data/units.xml.in.h:118 msgid "Kilogram per Cubic Meter" msgstr "Kilogram per kubieke meter" #: ../data/units.xml.in.h:119 msgid "Gram per Cubic Decimeter" msgstr "Gram per kubieke decimeter" #: ../data/units.xml.in.h:120 msgid "Gram per Cubic Centimeter" msgstr "Gram per kubieke centimeter" #: ../data/units.xml.in.h:121 #, fuzzy msgid "Atomic Mass" msgstr "Atomaire massa-eenheid" #: ../data/units.xml.in.h:122 msgid "Gram per Mole" msgstr "Gram per mol" #: ../data/units.xml.in.h:123 msgid "Atomic Mass Unit" msgstr "Atomaire massa-eenheid" #: ../data/units.xml.in.h:124 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "AMU,atomaire_massa_eenheid,atomaire_massa_eenheden" #: ../data/units.xml.in.h:125 msgid "Dalton" msgstr "" #: ../data/units.xml.in.h:126 #, fuzzy msgid "ar:Da,dalton,p:daltons" msgstr "a:rad,radiaal,p:radialen" #: ../data/units.xml.in.h:127 #, fuzzy msgid "Kilodalton" msgstr "Kilowattuur" #: ../data/units.xml.in.h:128 msgid "Mass Fraction" msgstr "Massafractie" #: ../data/units.xml.in.h:129 msgid "Kilogram per Kilogram" msgstr "Kilogram per kilogram" #: ../data/units.xml.in.h:132 msgid "ar:s,second,p:seconds" msgstr "a:s,seconde,p:seconden" #: ../data/units.xml.in.h:134 msgid "ar:min,minute,p:minutes" msgstr "a:min,minuut,p:minuten" #: ../data/units.xml.in.h:136 msgid "ar:h,hour,p:hours" msgstr "a:h,uur,p:uren" #: ../data/units.xml.in.h:138 msgid "ar:d,day,p:days" msgstr "a:d,dag,p:dagen" #: ../data/units.xml.in.h:139 msgid "Week" msgstr "" #: ../data/units.xml.in.h:140 msgid "r:week,p:weeks" msgstr "week,p:weken" #: ../data/units.xml.in.h:141 msgid "Fortnight" msgstr "" #: ../data/units.xml.in.h:142 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:143 msgid "Julian Year" msgstr "Juliaans jaar" #: ../data/units.xml.in.h:144 msgid "r:year,p:years" msgstr "jaar,p:jaren" #: ../data/units.xml.in.h:146 #, fuzzy msgid "r:month,p:months" msgstr "a:min,minuut,p:minuten" #. Unit category #: ../data/units.xml.in.h:148 msgid "!units!Frequency" msgstr "Frequentie" #: ../data/units.xml.in.h:149 msgid "Hertz" msgstr "" #: ../data/units.xml.in.h:150 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:151 msgid "Electricity" msgstr "Elektriciteit" #: ../data/units.xml.in.h:152 msgid "Electric Current" msgstr "Elektrische stroom" #: ../data/units.xml.in.h:153 msgid "Ampere" msgstr "" #: ../data/units.xml.in.h:154 msgid "ar:A,ampere,p:amperes" msgstr "" #: ../data/units.xml.in.h:155 msgid "Abampere" msgstr "" #: ../data/units.xml.in.h:156 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:157 msgid "Current Density" msgstr "Stroomdichtheid" #: ../data/units.xml.in.h:158 msgid "Ampere per Meter Squared" msgstr "Ampere per meter kwadraat" #: ../data/units.xml.in.h:159 msgid "Electric Charge" msgstr "Elektrische lading" #: ../data/units.xml.in.h:160 msgid "Second Ampere" msgstr "Seconde ampere" #: ../data/units.xml.in.h:161 msgid "Coulomb" msgstr "" #: ../data/units.xml.in.h:162 msgid "ar:C,coulomb,p:coulombs" msgstr "" #: ../data/units.xml.in.h:163 msgid "Abcoulomb" msgstr "" #: ../data/units.xml.in.h:164 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:165 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:166 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:167 msgid "Electric Charge Density" msgstr "Elektrische ladingsdichtheid" #: ../data/units.xml.in.h:168 msgid "Coulomb per Cubic Meter" msgstr "Coulomb per kubieke meter" #: ../data/units.xml.in.h:169 msgid "Electric Flux Density" msgstr "Elektrische fluxdichtheid" #: ../data/units.xml.in.h:170 msgid "Coulomb per Meter Squared" msgstr "Coulomb per vierkante meter" #: ../data/units.xml.in.h:171 msgid "Electric Potential" msgstr "Elektrische potentiaal" #: ../data/units.xml.in.h:172 msgid "Watt per Ampere" msgstr "Watt per ampere" #: ../data/units.xml.in.h:173 msgid "Volt" msgstr "" #: ../data/units.xml.in.h:174 msgid "ar:V,volt,p:volts" msgstr "" #: ../data/units.xml.in.h:175 msgid "Statvolt" msgstr "" #: ../data/units.xml.in.h:176 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:177 msgid "Abvolt" msgstr "" #: ../data/units.xml.in.h:178 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:179 msgid "Capacitance" msgstr "Capaciteit" #: ../data/units.xml.in.h:180 msgid "Coulomb per Volt" msgstr "Coulomb per volt" #: ../data/units.xml.in.h:181 msgid "Farad" msgstr "" #: ../data/units.xml.in.h:182 msgid "ar:F,farad,p:farads" msgstr "" #: ../data/units.xml.in.h:183 msgid "Electric Resistance" msgstr "Elektrische weerstand" #: ../data/units.xml.in.h:184 msgid "Volt per Ampere" msgstr "Volt per ampere" #: ../data/units.xml.in.h:185 msgid "Ohm" msgstr "" #: ../data/units.xml.in.h:186 msgid "au:Ω,r:ohm,p:ohms" msgstr "au:Ω,ohm" #: ../data/units.xml.in.h:187 msgid "Abohm" msgstr "" #: ../data/units.xml.in.h:188 msgid "r:abohm,p:abohms,au:abΩ" msgstr "" #: ../data/units.xml.in.h:189 msgid "Statohm" msgstr "" #: ../data/units.xml.in.h:190 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:191 msgid "Electric Conductance" msgstr "Elektrisch geleidingsvermogen" #: ../data/units.xml.in.h:192 msgid "Ampere per Volt" msgstr "Ampere per volt" #: ../data/units.xml.in.h:193 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:194 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:195 msgid "Electric Field Strength" msgstr "Elektrische veldsterkte" #: ../data/units.xml.in.h:196 msgid "Volt per Meter" msgstr "Volt per meter" #: ../data/units.xml.in.h:197 msgid "Permittivity" msgstr "Permittiviteit" #: ../data/units.xml.in.h:198 msgid "Farad per Meter" msgstr "Farad per meter" #: ../data/units.xml.in.h:199 msgid "Inductance" msgstr "Zelfinductie" #: ../data/units.xml.in.h:200 msgid "Weber per Ampere" msgstr "Weber per ampere" #: ../data/units.xml.in.h:201 msgid "Henry" msgstr "" #: ../data/units.xml.in.h:202 msgid "ar:H,henry,p:henrys" msgstr "" #: ../data/units.xml.in.h:203 msgid "Permeability" msgstr "Permeabiliteit" #: ../data/units.xml.in.h:204 msgid "Henry per Meter" msgstr "Henry per meter" #: ../data/units.xml.in.h:205 msgid "Temperature" msgstr "Temperatuur" #: ../data/units.xml.in.h:206 msgid "Kelvin" msgstr "Kelvin" #: ../data/units.xml.in.h:207 msgid "ar:K,kelvin,p:kelvins" msgstr "" #: ../data/units.xml.in.h:208 msgid "Degree Celsius" msgstr "Graden Celsius" #: ../data/units.xml.in.h:209 #, fuzzy msgid "" "ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades" msgstr "grd,°,graad,graden" #: ../data/units.xml.in.h:210 msgid "Degree Rankine" msgstr "Graden Rankine" #: ../data/units.xml.in.h:211 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:212 msgid "Degree Fahrenheit" msgstr "Graden Fahrenheit" #: ../data/units.xml.in.h:213 msgid "ar:oF,au:°F,au:℉,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:214 msgid "Substance" msgstr "Stofhoeveelheid" #: ../data/units.xml.in.h:215 msgid "Mole" msgstr "Mol" #: ../data/units.xml.in.h:216 msgid "ar:mol,mole,p:moles" msgstr "a:mol,mol,p:molen" #: ../data/units.xml.in.h:217 msgid "Einstein" msgstr "" #: ../data/units.xml.in.h:218 msgid "r:einstein,p:einsteins" msgstr "" #: ../data/units.xml.in.h:219 msgid "Substance Concentration" msgstr "Concentratie van stof" #: ../data/units.xml.in.h:220 msgid "Mole per Cubic Meter" msgstr "Mol per kubieke meter" #: ../data/units.xml.in.h:221 msgid "Catalytic Activity" msgstr "Katalitische activiteit" #: ../data/units.xml.in.h:222 msgid "Reciprocal Seconds Mole" msgstr "Omgekeerde seconden mol" #: ../data/units.xml.in.h:223 msgid "Katal" msgstr "" #: ../data/units.xml.in.h:224 msgid "ar:kat,katal,p:katals" msgstr "" #: ../data/units.xml.in.h:225 msgid "Catalytic Concentration" msgstr "Catalitische concentratie" #: ../data/units.xml.in.h:226 msgid "Katal per Cubic Meter" msgstr "Katal per kubieke meter" #: ../data/units.xml.in.h:227 msgid "Light" msgstr "Licht" #: ../data/units.xml.in.h:228 msgid "Luminous Intensity" msgstr "Lichtsterkte" #: ../data/units.xml.in.h:229 msgid "Candela" msgstr "" #: ../data/units.xml.in.h:230 msgid "ar:cd,candela,p:candelas" msgstr "" #: ../data/units.xml.in.h:231 msgid "Luminance" msgstr "Luminantie" #: ../data/units.xml.in.h:232 msgid "Candela per Meter Squared" msgstr "Candela per vierkante meter" #: ../data/units.xml.in.h:233 msgid "Stilb" msgstr "" #: ../data/units.xml.in.h:234 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:235 msgid "Luminous Flux" msgstr "Lichtstroom" #: ../data/units.xml.in.h:236 msgid "Candela Steradian" msgstr "Candela-steradiaal" #: ../data/units.xml.in.h:237 msgid "Lumen" msgstr "" #: ../data/units.xml.in.h:238 msgid "ar:lm,lumen,p:lumens" msgstr "a:lm,lumen" #: ../data/units.xml.in.h:239 msgid "Illuminance" msgstr "Verlichtingssterkte" #: ../data/units.xml.in.h:240 msgid "Lumen per Meter Squared" msgstr "Lumen per vierkante meter" #: ../data/units.xml.in.h:241 msgid "Lumen per Foot Squared" msgstr "Lumen per vierkante voet" #: ../data/units.xml.in.h:242 msgid "Lux" msgstr "" #: ../data/units.xml.in.h:243 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:244 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:245 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:246 msgid "Phot" msgstr "" #: ../data/units.xml.in.h:247 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:248 msgid "Radiant Intensity" msgstr "Stralingsintensiteit" #: ../data/units.xml.in.h:249 msgid "Watt per Steradian" msgstr "Watt per steradiaal" #: ../data/units.xml.in.h:250 msgid "Irradiance" msgstr "Irradiantie" #: ../data/units.xml.in.h:251 msgid "Watt per Meter Squared" msgstr "Watt per meter kwadraat" #: ../data/units.xml.in.h:252 msgid "Einstein per Meter Squared per Second" msgstr "Einstein per vierkante meter per seconde" #: ../data/units.xml.in.h:253 msgid "Microeinstein per Meter Squared per Second" msgstr "Micro-einstein per vierkante meter per seconde" #: ../data/units.xml.in.h:254 msgid "Radiance" msgstr "Radiantie" #: ../data/units.xml.in.h:255 msgid "Watt per Square Meter Steradian" msgstr "Watt per vierkante meter per steradiaal" #: ../data/units.xml.in.h:256 msgid "Area" msgstr "Oppervlak" #: ../data/units.xml.in.h:257 msgid "Square Meter" msgstr "Vierkante meter" #: ../data/units.xml.in.h:258 msgid "Square Kilometer" msgstr "Vierkante kilometer" #: ../data/units.xml.in.h:259 msgid "Are" msgstr "" #: ../data/units.xml.in.h:260 msgid "ar:a,are,p:ares" msgstr "" #: ../data/units.xml.in.h:261 msgid "Hectare" msgstr "" #: ../data/units.xml.in.h:262 msgid "Barn" msgstr "" #: ../data/units.xml.in.h:263 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:264 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:265 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:266 msgid "Acre" msgstr "" #: ../data/units.xml.in.h:267 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:268 msgid "Section" msgstr "Sectie" #: ../data/units.xml.in.h:269 msgid "r:section,p:sections" msgstr "sectie,p:secties" #: ../data/units.xml.in.h:270 msgid "Township" msgstr "" #: ../data/units.xml.in.h:271 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:272 msgid "Square Foot" msgstr "Vierkante voet" #: ../data/units.xml.in.h:273 msgid "Square Inch" msgstr "Vierkante inch" #: ../data/units.xml.in.h:274 msgid "Square Mile" msgstr "Vierkante mijl" #: ../data/units.xml.in.h:275 msgid "Volume" msgstr "" #: ../data/units.xml.in.h:276 msgid "Cubic Meter" msgstr "Kubieke meter" #: ../data/units.xml.in.h:277 msgid "Liter" msgstr "" #: ../data/units.xml.in.h:278 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "a:L,a:l,liter,p:liters" #: ../data/units.xml.in.h:279 msgid "Milliliter" msgstr "Mililiter" #: ../data/units.xml.in.h:280 msgid "Centiliter" msgstr "" #: ../data/units.xml.in.h:281 msgid "Deciliter" msgstr "" #: ../data/units.xml.in.h:282 msgid "Cubic Inch" msgstr "Kubieke inch" #: ../data/units.xml.in.h:283 msgid "Fuel Economy" msgstr "Brandstofgebruik" #: ../data/units.xml.in.h:284 msgid "Liter per Kilometer" msgstr "Liter per kilometer" #: ../data/units.xml.in.h:285 msgid "Kilometer per Liter" msgstr "Kilometer per liter" #: ../data/units.xml.in.h:286 msgid "Miles per Gallon" msgstr "" #: ../data/units.xml.in.h:287 msgid "a-cr:mpg" msgstr "" #: ../data/units.xml.in.h:288 msgid "Cooking" msgstr "Koken" #: ../data/units.xml.in.h:289 msgid "Teaspoon" msgstr "Theelepel" #: ../data/units.xml.in.h:290 msgid "r:teaspoon,p:teaspoons" msgstr "theelepel,p:theelepels" #: ../data/units.xml.in.h:291 msgid "Dessertspoon" msgstr "Dessertlepel" #: ../data/units.xml.in.h:292 msgid "r:dessertspoon,p:dessertspoons" msgstr "dessertlepel,p:dessertlepels" #: ../data/units.xml.in.h:293 msgid "Tablespoon" msgstr "Eetlepel" #: ../data/units.xml.in.h:294 msgid "r:tablespoon,p:tablespoons" msgstr "eetlepel,p:eetlepels" #: ../data/units.xml.in.h:295 msgid "Cup (U.S.)" msgstr "" #: ../data/units.xml.in.h:296 msgid "r:cup,p:cups" msgstr "kop,p:koppen" #: ../data/units.xml.in.h:297 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:298 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:299 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:300 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:301 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:302 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:303 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:304 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:305 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:306 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:307 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:308 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:309 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:310 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:311 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:312 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:313 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:314 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:315 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:316 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:317 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:318 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:319 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:320 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:321 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:322 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:323 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:324 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:325 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:326 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:327 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:328 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:329 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:330 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:331 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:332 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:333 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:334 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:335 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:336 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:337 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:338 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:339 #, fuzzy msgid "U.S. Barrel (oil)" msgstr "U.S. Barrell (olie)" #: ../data/units.xml.in.h:340 #, fuzzy msgid "ar:bbl,barrel,p:barrels" msgstr "bar" #: ../data/units.xml.in.h:341 msgid "Specific Volume" msgstr "Soortelijk volume" #: ../data/units.xml.in.h:342 msgid "Cubic Meter per Kilogram" msgstr "Kubieke meter per kilogram" #: ../data/units.xml.in.h:343 msgid "Speed" msgstr "Snelheid" #: ../data/units.xml.in.h:344 msgid "Meter per Second" msgstr "Meter per seconde" #: ../data/units.xml.in.h:345 msgid "Kilometer per Hour" msgstr "Kilometer per uur" #: ../data/units.xml.in.h:346 msgid "Nautical Mile per Hour" msgstr "Nautische mijl per uur" #: ../data/units.xml.in.h:347 msgid "Knot" msgstr "Knoop" #: ../data/units.xml.in.h:348 msgid "r:knot,p:knots" msgstr "knoop,p:knopen" #: ../data/units.xml.in.h:349 msgid "Miles per Hour" msgstr "" #: ../data/units.xml.in.h:350 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:351 msgid "Acceleration" msgstr "Versnelling" #: ../data/units.xml.in.h:352 msgid "Meter per Second Squared" msgstr "Meter per seconde kwadraat" #: ../data/units.xml.in.h:353 msgid "Galileo" msgstr "" #: ../data/units.xml.in.h:354 msgid "ar:Gal,galileo,p:galileos" msgstr "" #: ../data/units.xml.in.h:355 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:356 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:357 msgid "Magnetism" msgstr "Magnetisme" #: ../data/units.xml.in.h:358 msgid "Wave Number" msgstr "Golfgetal" #: ../data/units.xml.in.h:359 msgid "Reciprocal Meter" msgstr "Omgekeerde meter" #: ../data/units.xml.in.h:360 msgid "Magnetic Field Strength" msgstr "Magnetische veldsterkte" #: ../data/units.xml.in.h:361 msgid "Ampere per Meter" msgstr "Ampere per meter" #: ../data/units.xml.in.h:362 msgid "Oersted" msgstr "" #: ../data/units.xml.in.h:363 msgid "ar:Oe,oersted,p:oersteds" msgstr "Oe,oersted,oersteds" #: ../data/units.xml.in.h:364 msgid "Magnetic Flux" msgstr "Magnetische flux" #: ../data/units.xml.in.h:365 msgid "Volt Seconds" msgstr "Volt seconden" #: ../data/units.xml.in.h:366 msgid "Weber" msgstr "" #: ../data/units.xml.in.h:367 msgid "ar:Wb,weber,p:webers" msgstr "" #: ../data/units.xml.in.h:368 msgid "Maxwell" msgstr "" #: ../data/units.xml.in.h:369 msgid "ar:Mx,maxwell,p:maxwells" msgstr "" #: ../data/units.xml.in.h:370 msgid "Magnetic Flux Density" msgstr "Magnetische fluxdichtheid" #: ../data/units.xml.in.h:371 msgid "Weber per Meter Squared" msgstr "Weber per meter kwadraat" #: ../data/units.xml.in.h:372 msgid "Tesla" msgstr "" #: ../data/units.xml.in.h:373 msgid "ar:T,tesla,p:teslas" msgstr "" #: ../data/units.xml.in.h:374 msgid "Gauss" msgstr "" #: ../data/units.xml.in.h:375 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:376 msgid "Force" msgstr "Kracht" #: ../data/units.xml.in.h:377 msgid "Meter Kilogram per Second Squared" msgstr "Meter kilogram per seconde kwadraat" #: ../data/units.xml.in.h:378 msgid "Newton" msgstr "" #: ../data/units.xml.in.h:379 msgid "ar:N,newton,p:newtons" msgstr "" #: ../data/units.xml.in.h:380 msgid "Dyne" msgstr "" #: ../data/units.xml.in.h:381 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:382 msgid "Pound-force" msgstr "" #: ../data/units.xml.in.h:383 msgid "ar:lbf,pound_force" msgstr "" #: ../data/units.xml.in.h:384 msgid "Pound Foot per Second Squared" msgstr "Pound Foot per seconde kwadraat" #: ../data/units.xml.in.h:385 msgid "Poundal" msgstr "" #: ../data/units.xml.in.h:386 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:387 msgid "Pond (Gram-Force)" msgstr "Pond (gram-kracht)" #: ../data/units.xml.in.h:388 msgid "r:pond,p:ponds,a:gf" msgstr "pond,p:ponden,a:gf" #: ../data/units.xml.in.h:389 msgid "Kilopond (Kilogram-Force)" msgstr "Kilopond (Kilogram-kracht)" #: ../data/units.xml.in.h:390 msgid "Moment of Force" msgstr "Krachtmoment" #: ../data/units.xml.in.h:391 msgid "Newton Meter" msgstr "Newtonmeter" #: ../data/units.xml.in.h:392 msgid "Pressure" msgstr "Druk" #: ../data/units.xml.in.h:393 msgid "Newton per Meter Squared" msgstr "Newton per vierkante meter" #: ../data/units.xml.in.h:394 msgid "Pound-force per Square Inch" msgstr "Pound-force per inch kwadraat" #: ../data/units.xml.in.h:395 msgid "Pascal" msgstr "" #: ../data/units.xml.in.h:396 msgid "ar:Pa,pascal,p:pascals" msgstr "" #: ../data/units.xml.in.h:397 msgid "Pound-force per Square Inch (psi)" msgstr "Pound-force per inch kwadraat (psi)" #: ../data/units.xml.in.h:398 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:399 msgid "Bar" msgstr "" #: ../data/units.xml.in.h:400 msgid "r:bar,p:bars" msgstr "bar" #: ../data/units.xml.in.h:401 msgid "Atmosphere" msgstr "Atmosfeer" #: ../data/units.xml.in.h:402 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "a:atm,atmosfeer" #: ../data/units.xml.in.h:403 msgid "Torr" msgstr "" #: ../data/units.xml.in.h:404 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:405 msgid "Millimeter of Mercury" msgstr "Milimeter kwik" #: ../data/units.xml.in.h:406 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:407 msgid "Inch of Mercury" msgstr "Inches kwik" #: ../data/units.xml.in.h:408 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:409 msgid "Dynamic Viscosity" msgstr "Dynamische viscositeit" #: ../data/units.xml.in.h:410 msgid "Pascal Second" msgstr "Pascal seconde" #: ../data/units.xml.in.h:411 msgid "Poise" msgstr "" #: ../data/units.xml.in.h:412 msgid "ar:P,poise,p:poises" msgstr "" #: ../data/units.xml.in.h:413 msgid "Kinematic Viscosity" msgstr "Kinematische viscositeit" #: ../data/units.xml.in.h:414 msgid "Square Meter per Second" msgstr "Vierkante meter per seconde" #: ../data/units.xml.in.h:415 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:416 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:417 msgid "Surface Tension" msgstr "Oppervlaktespanning" #: ../data/units.xml.in.h:418 msgid "Newton per Meter" msgstr "Newton per meter" #: ../data/units.xml.in.h:419 msgid "Energy" msgstr "Energie" #: ../data/units.xml.in.h:420 msgid "Joule" msgstr "" #: ../data/units.xml.in.h:421 msgid "ar:J,joule,p:joules" msgstr "" #: ../data/units.xml.in.h:422 msgid "Watt Hour" msgstr "Wattuur" #: ../data/units.xml.in.h:423 msgid "Kilowatt Hour" msgstr "Kilowattuur" #: ../data/units.xml.in.h:424 msgid "Calorie (international table)" msgstr "Calorie (internationale tabel)" #: ../data/units.xml.in.h:425 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "ais:cal_IT,a:cal,c:calorie,cp:calorieën" #: ../data/units.xml.in.h:426 msgid "Calorie (capital C)" msgstr "Calorie (hoofdletter C)" #: ../data/units.xml.in.h:427 msgid "cr:Calorie,cp:Calories" msgstr "c:Calorie,cp:Calorieën" #: ../data/units.xml.in.h:428 msgid "Calorie (thermochemical)" msgstr "Calorie (thermochemisch)" #: ../data/units.xml.in.h:429 msgid "ars:cal_th" msgstr "as:cal_th" #: ../data/units.xml.in.h:430 msgid "Gram of TNT" msgstr "Gram TNT" #: ../data/units.xml.in.h:431 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:432 msgid "Ton of TNT" msgstr "Ton TNT" #: ../data/units.xml.in.h:433 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:434 msgid "Calorie (15 degrees Celsius)" msgstr "Calorie (15 graden Celcius)" #: ../data/units.xml.in.h:435 msgid "ars:cal_fifteen" msgstr "as:cal_fifteen" #: ../data/units.xml.in.h:436 msgid "Calorie (mean)" msgstr "Calorie (gemiddeld)" #: ../data/units.xml.in.h:437 msgid "ars:cal_mean" msgstr "as:cal_gemiddeld" #: ../data/units.xml.in.h:438 msgid "British Thermal Unit (IT)" msgstr "" #: ../data/units.xml.in.h:439 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:440 msgid "Electron Volt" msgstr "Elektronvolt" #: ../data/units.xml.in.h:441 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "" #: ../data/units.xml.in.h:442 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:443 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:444 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:445 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:446 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:447 msgid "Hartree" msgstr "" #: ../data/units.xml.in.h:448 msgid "ar:Ha,as:E_h,hartree" msgstr "" #: ../data/units.xml.in.h:449 #, fuzzy msgid "Rydberg" msgstr "Rydberg constante" #: ../data/units.xml.in.h:450 msgid "ar:Ry,s:rydberg_unit" msgstr "" #: ../data/units.xml.in.h:451 msgid "Specific Energy" msgstr "Soortelijke energie" #: ../data/units.xml.in.h:452 msgid "Joule per Kilogram" msgstr "Joule per kilogram" #: ../data/units.xml.in.h:453 msgid "Power" msgstr "Vermogen" #: ../data/units.xml.in.h:454 msgid "Joule per Second" msgstr "Joule per seconde" #: ../data/units.xml.in.h:455 msgid "Watt" msgstr "Watt" #: ../data/units.xml.in.h:456 msgid "ar:W,watt,p:watts" msgstr "" #: ../data/units.xml.in.h:457 msgid "Horse Power" msgstr "Paardekracht (Engels)" #: ../data/units.xml.in.h:458 msgid "ar:hp,horsepower,p:horsepowers" msgstr "" #: ../data/units.xml.in.h:459 msgid "Pferdestärke" msgstr "Paardekracht (metrisch)" #: ../data/units.xml.in.h:460 msgid "ar:PS,u:pferdestärke" msgstr "pk,paardekracht,paardekrachten" #: ../data/units.xml.in.h:461 msgid "Entropy" msgstr "Entropie" #: ../data/units.xml.in.h:462 msgid "Joule per Kelvin" msgstr "Joule per Kelvin" #: ../data/units.xml.in.h:463 msgid "Specific Entropy" msgstr "Soortelijke entropie" #: ../data/units.xml.in.h:464 msgid "Joule per Kilogram Kelvin" msgstr "Joule per kilogram Kelvin" #: ../data/units.xml.in.h:465 msgid "Thermal Conductivity" msgstr "Thermisch geleidingsvermogen" #: ../data/units.xml.in.h:466 msgid "Watt per Meter Kelvin" msgstr "Watt per meter Kelvin" #: ../data/units.xml.in.h:467 msgid "Energy Density" msgstr "Energiedichtheid" #: ../data/units.xml.in.h:468 msgid "Joule per Cubic Meter" msgstr "Joule per kubieke meter" #: ../data/units.xml.in.h:469 msgid "Molar Energy" msgstr "Molaire energie" #: ../data/units.xml.in.h:470 msgid "Joule per Mole" msgstr "Joule per mol" #: ../data/units.xml.in.h:471 msgid "Molar Entropy" msgstr "Molaire entropy" #: ../data/units.xml.in.h:472 msgid "Joule per Mole Kelvin" msgstr "Joule per mol Kelvin" #: ../data/units.xml.in.h:473 msgid "Radioactivity" msgstr "Radioactiviteit" #: ../data/units.xml.in.h:474 msgid "Becquerel" msgstr "" #: ../data/units.xml.in.h:475 msgid "ar:Bq,becquerel,p:becquerels" msgstr "" #: ../data/units.xml.in.h:476 msgid "Curie" msgstr "" #: ../data/units.xml.in.h:477 msgid "ar:Ci,curie,p:curies" msgstr "" #: ../data/units.xml.in.h:478 msgid "Absorbed Dose" msgstr "Absorptiedosis" #: ../data/units.xml.in.h:479 msgid "Gray" msgstr "" #: ../data/units.xml.in.h:480 msgid "ar:Gy,gray,p:grays" msgstr "" #: ../data/units.xml.in.h:481 msgid "Rad" msgstr "" #: ../data/units.xml.in.h:482 msgid "r:rad_radioactivity" msgstr "" #: ../data/units.xml.in.h:483 msgid "Dose Equivalent" msgstr "Dosisequivalent" #: ../data/units.xml.in.h:484 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:485 msgid "ar:Sv,sievert,p:sieverts" msgstr "" #: ../data/units.xml.in.h:486 msgid "Rem" msgstr "" #: ../data/units.xml.in.h:487 msgid "r:rem_radioactivity" msgstr "" #: ../data/units.xml.in.h:488 msgid "Exposure" msgstr "Belichting" #: ../data/units.xml.in.h:489 msgid "Coulomb per Kilogram" msgstr "Coulomb per kilogram" #: ../data/units.xml.in.h:490 msgid "Roentgen" msgstr "" #: ../data/units.xml.in.h:491 msgid "ar:R,roentgen,p:roentgens" msgstr "" #: ../data/units.xml.in.h:492 msgid "Absorbed Dose Rate" msgstr "Absorptiesnelheid" #: ../data/units.xml.in.h:493 msgid "Gray per Second" msgstr "Gray per seconde" #: ../data/units.xml.in.h:494 msgid "Ratio" msgstr "Verhouding" #: ../data/units.xml.in.h:495 msgid "Neper" msgstr "" #: ../data/units.xml.in.h:496 msgid "ar:Np,neper,p:nepers" msgstr "" #: ../data/units.xml.in.h:497 msgid "Bel" msgstr "" #: ../data/units.xml.in.h:498 msgid "ar:B,bel,p:bels" msgstr "" #: ../data/units.xml.in.h:499 msgid "Decibel" msgstr "" #: ../data/units.xml.in.h:500 msgid "Information" msgstr "Informatie" #: ../data/units.xml.in.h:501 msgid "Bit" msgstr "" #: ../data/units.xml.in.h:502 msgid "r:bit,p:bits" msgstr "" #: ../data/units.xml.in.h:503 msgid "Byte (8-bit)" msgstr "" #: ../data/units.xml.in.h:504 msgid "r:byte,p:bytes,octet,p:octets" msgstr "" #: ../data/units.xml.in.h:505 msgid "Nibble" msgstr "Nibble" #: ../data/units.xml.in.h:506 msgid "r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets" msgstr "" #: ../data/units.xml.in.h:507 msgid "Tribble" msgstr "" #: ../data/units.xml.in.h:508 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:509 msgid "Word (16-bit)" msgstr "" #: ../data/units.xml.in.h:510 msgid "r:word,p:words" msgstr "woord,p:woorden" #: ../data/units.xml.in.h:511 msgid "Kilobyte" msgstr "" #: ../data/units.xml.in.h:512 msgid "Kibibyte" msgstr "" #: ../data/units.xml.in.h:513 msgid "Mebibyte" msgstr "" #: ../data/units.xml.in.h:514 msgid "Gibibyte" msgstr "" #: ../data/units.xml.in.h:515 msgid "Megabyte" msgstr "" #: ../data/units.xml.in.h:516 msgid "Gigabyte" msgstr "" #: ../data/units.xml.in.h:517 msgid "Terabyte" msgstr "" #: ../data/units.xml.in.h:518 msgid "Kilobit" msgstr "" #: ../data/units.xml.in.h:519 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:520 msgid "Mebibit" msgstr "" #: ../data/units.xml.in.h:521 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:522 msgid "Megabit" msgstr "" #: ../data/units.xml.in.h:523 msgid "Gigabit" msgstr "" #: ../data/units.xml.in.h:524 msgid "Terabit" msgstr "" #: ../data/units.xml.in.h:525 msgid "Typography" msgstr "Typografie" #: ../data/units.xml.in.h:526 msgid "PostScript Point" msgstr "" #: ../data/units.xml.in.h:527 msgid "ar:pt,a:pts,point,p:points" msgstr "" #: ../data/units.xml.in.h:528 msgid "PostScript Pica" msgstr "" #: ../data/units.xml.in.h:529 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:530 msgid "ATA Pica" msgstr "" #: ../data/units.xml.in.h:531 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:532 msgid "ATA Point" msgstr "" #: ../data/units.xml.in.h:533 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:534 msgid "New Didot Point" msgstr "Nieuwe Didot Point" #: ../data/units.xml.in.h:535 msgid "r:new_didot" msgstr "nieuwe_didot" #: ../data/units.xml.in.h:536 msgid "Didot Point" msgstr "" #: ../data/units.xml.in.h:537 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:538 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:539 msgid "r:cicero" msgstr "" #: ../data/variables.xml.in.h:1 msgid "Small Numbers" msgstr "Kleine getallen" #: ../data/variables.xml.in.h:2 msgid "Per Mille" msgstr "Per mille" #: ../data/variables.xml.in.h:3 msgid "r:permille,au:‰" msgstr "" #: ../data/variables.xml.in.h:4 msgid "Per Myriad" msgstr "Per myriad" #: ../data/variables.xml.in.h:5 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:6 msgid "Percent" msgstr "Procent" #: ../data/variables.xml.in.h:8 #, fuzzy, no-c-format msgid "a:%,r:percent" msgstr "percentiel" #: ../data/variables.xml.in.h:9 msgid "Large Numbers" msgstr "Grote getallen" #: ../data/variables.xml.in.h:10 msgid "Googolplex" msgstr "Googolplex" #: ../data/variables.xml.in.h:11 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:12 msgid "Googol" msgstr "Googol" #: ../data/variables.xml.in.h:13 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:14 msgid "Centillion" msgstr "Quinquagintiljard" #: ../data/variables.xml.in.h:15 msgid "-r:centillion" msgstr "quinquagintiljard" #: ../data/variables.xml.in.h:16 msgid "Vigintillion" msgstr "Deciljard" #: ../data/variables.xml.in.h:17 msgid "-r:vigintillion" msgstr "deciljard" #: ../data/variables.xml.in.h:18 msgid "Novemdecillion" msgstr "deciljoen" #: ../data/variables.xml.in.h:19 msgid "-r:novemdecillion" msgstr "deciljoen" #: ../data/variables.xml.in.h:20 msgid "Octodecillion" msgstr "Noniljard" #: ../data/variables.xml.in.h:21 msgid "-r:octodecillion" msgstr "noniljard" #: ../data/variables.xml.in.h:22 msgid "Septendecillion" msgstr "Noniljoen" #: ../data/variables.xml.in.h:23 msgid "-r:septendecillion" msgstr "noniljoen" #: ../data/variables.xml.in.h:24 msgid "Sexdecillion" msgstr "Octiljard" #: ../data/variables.xml.in.h:25 msgid "-r:sexdecillion" msgstr "octiljard" #: ../data/variables.xml.in.h:26 msgid "Quindecillion" msgstr "Octiljoen" #: ../data/variables.xml.in.h:27 msgid "-r:quindecillion" msgstr "octiljoen" #: ../data/variables.xml.in.h:28 msgid "Quattuordecillion" msgstr "Septiljard" #: ../data/variables.xml.in.h:29 msgid "-r:quattuordecillion" msgstr "septiljard" #: ../data/variables.xml.in.h:30 msgid "Tredecillion" msgstr "Septiljoen" #: ../data/variables.xml.in.h:31 msgid "-r:tredecillion" msgstr "septiljoen" #: ../data/variables.xml.in.h:32 msgid "Duodecillion" msgstr "Sextiljard" #: ../data/variables.xml.in.h:33 msgid "-r:duodecillion" msgstr "sextiljard" #: ../data/variables.xml.in.h:34 msgid "Undecillion" msgstr "Sextiljoen" #: ../data/variables.xml.in.h:35 msgid "-r:undecillion" msgstr "sextiljoen" #: ../data/variables.xml.in.h:36 msgid "Decillion" msgstr "Quintiljard" #: ../data/variables.xml.in.h:37 msgid "-r:decillion" msgstr "quintiljard" #: ../data/variables.xml.in.h:38 msgid "Nonillion" msgstr "Quintiljoen" #: ../data/variables.xml.in.h:39 msgid "-r:nonillion" msgstr "quintiljoen" #: ../data/variables.xml.in.h:40 msgid "Octillion" msgstr "Quadriljard" #: ../data/variables.xml.in.h:41 msgid "-r:octillion" msgstr "quadriljard" #: ../data/variables.xml.in.h:42 msgid "Septillion" msgstr "Quadriljoen" #: ../data/variables.xml.in.h:43 msgid "-r:septillion" msgstr "quadriljoen" #: ../data/variables.xml.in.h:44 msgid "Sextillion" msgstr "Triljard" #: ../data/variables.xml.in.h:45 msgid "-r:sextillion" msgstr "triljard" #: ../data/variables.xml.in.h:46 msgid "Quintillion" msgstr "Triljoen" #: ../data/variables.xml.in.h:47 msgid "-r:quintillion" msgstr "triljoen" #: ../data/variables.xml.in.h:48 msgid "Quadrillion" msgstr "Biljard" #: ../data/variables.xml.in.h:49 msgid "-r:quadrillion" msgstr "biljard" #: ../data/variables.xml.in.h:50 msgid "Trillion" msgstr "Biljoen" #: ../data/variables.xml.in.h:51 msgid "-r:trillion" msgstr "biljoen" #: ../data/variables.xml.in.h:52 msgid "Billion" msgstr "Miljard" #: ../data/variables.xml.in.h:53 msgid "-r:billion" msgstr "miljard" #: ../data/variables.xml.in.h:54 msgid "Million" msgstr "Miljoen" #: ../data/variables.xml.in.h:55 msgid "-r:million" msgstr "miljoen" #: ../data/variables.xml.in.h:56 msgid "Thousand" msgstr "Duizend" #: ../data/variables.xml.in.h:57 msgid "-r:thousand" msgstr "duizend" #: ../data/variables.xml.in.h:58 msgid "Hundred" msgstr "Honderd" #: ../data/variables.xml.in.h:59 msgid "-r:hundred" msgstr "honderd" #: ../data/variables.xml.in.h:60 msgid "Physical Constants" msgstr "Natuurkundige constanten" #: ../data/variables.xml.in.h:61 msgid "Universal Constants" msgstr "Universele constanten" #: ../data/variables.xml.in.h:62 msgid "Speed of Light in Vacuum" msgstr "Lichtsnelheid in vacuüm" #: ../data/variables.xml.in.h:63 msgid "ar:c,speed_of_light" msgstr "a:c,licht_snelheid" #: ../data/variables.xml.in.h:64 msgid "Planck Time" msgstr "Plancktijd" #: ../data/variables.xml.in.h:65 msgid "r:planck_time,ais:t_P" msgstr "planck_tijd,ais:t_P" #: ../data/variables.xml.in.h:66 msgid "Planck Temperature" msgstr "Plancktemperatuur" #: ../data/variables.xml.in.h:67 msgid "r:planck_temperature,ais:T_P" msgstr "planck_temperatuur,ais:T_P" #: ../data/variables.xml.in.h:68 msgid "Planck Mass" msgstr "Planckmassa" #: ../data/variables.xml.in.h:69 msgid "r:planck_mass,ais:m_P" msgstr "planck_massa,ais:m_P" #: ../data/variables.xml.in.h:70 msgid "Planck Length" msgstr "Plancklengte" #: ../data/variables.xml.in.h:71 msgid "r:planck_length,ais:l_P" msgstr "planck_lengte,ais:l_P" #: ../data/variables.xml.in.h:72 msgid "Planck Constant" msgstr "Planck constante" #: ../data/variables.xml.in.h:73 #, fuzzy msgid "r:planck,au:ℎ" msgstr "gouden,φ" #: ../data/variables.xml.in.h:74 msgid "Planck Constant over 2 pi" msgstr "Planck constante gedeeld door 2 pi" #: ../data/variables.xml.in.h:75 msgid "r:planck2pi,au:ℏ" msgstr "" #: ../data/variables.xml.in.h:76 msgid "Newtonian Constant of Gravitation" msgstr "Newtons zwaartekrachtconstante" #: ../data/variables.xml.in.h:77 msgid "r:newtonian_constant,a:G" msgstr "newton_constante,a:G" #: ../data/variables.xml.in.h:78 msgid "Electric Constant (Permittivity of Free Space)" msgstr "Elektrische constante (permittiviteit vrije ruimte)" #: ../data/variables.xml.in.h:79 #, fuzzy msgid "r:electric_constant,asu:ε_0,vacuum_permittivity,aos:epsilon_0" msgstr "elektrische_constante,aisu:ε_0" #: ../data/variables.xml.in.h:80 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "Magnetische constante (permeabiliteit vrije ruimte)" #: ../data/variables.xml.in.h:81 #, fuzzy msgid "r:magnetic_constant,asu:μ_0,vacuum_permeability,aos:mu_0" msgstr "magnetische_constante,aisu:μ_0" #: ../data/variables.xml.in.h:82 msgid "Characteristic Impedance of Vacuum" msgstr "Karakteristieke impedantie vacuüm" #: ../data/variables.xml.in.h:83 msgid "r:characteristic_impedance,ais:Z_0" msgstr "karakteristieke_impedantie,ais:Z_0" #: ../data/variables.xml.in.h:84 msgid "Electromagnetic Constants" msgstr "Elektromagnetische constanten" #: ../data/variables.xml.in.h:85 msgid "Bohr Magneton" msgstr "" #: ../data/variables.xml.in.h:86 #, fuzzy msgid "r:bohr_magneton,asu:μ_B,aos:mu_B" msgstr "nucleaire_magneton,aisu:μ_N" #: ../data/variables.xml.in.h:87 msgid "Conductance Quantum" msgstr "Geleidingsvermogen kwantum" #: ../data/variables.xml.in.h:88 msgid "r:conductance_quantum,ais:G_0" msgstr "geleidings_kwantum,ais:G_0" #: ../data/variables.xml.in.h:89 msgid "Elementary Charge" msgstr "Elementaire lading" #: ../data/variables.xml.in.h:90 msgid "r:elementary_charge,ais:e_charge" msgstr "elementaire_lading,ais:e_lading" #: ../data/variables.xml.in.h:91 msgid "Josephson Constant" msgstr "Josephson constante" #: ../data/variables.xml.in.h:92 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:93 msgid "Magnetic Flux Quantum" msgstr "Magnetische flux kwantum" #: ../data/variables.xml.in.h:94 #, fuzzy msgid "r:magnetic_flux_quantum,asu:Φ_0,aos:phi_0" msgstr "magnetische_flux_kwantum,aisu:Φ_0" #: ../data/variables.xml.in.h:95 msgid "Nuclear Magneton" msgstr "Nucleaire magneton" #: ../data/variables.xml.in.h:96 #, fuzzy msgid "r:nuclear_magneton,asu:μ_N,aos:mu_N" msgstr "nucleaire_magneton,aisu:μ_N" #: ../data/variables.xml.in.h:97 msgid "von Klitzing Constant" msgstr "von Klitzing constante" #: ../data/variables.xml.in.h:98 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:99 msgid "Atomic and Nuclear Constants" msgstr "Atomaire- en nucleaire constanten" #: ../data/variables.xml.in.h:100 msgid "Alpha Particle Mass" msgstr "Massa alfadeeltje" #: ../data/variables.xml.in.h:101 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "alfa_deeltje_massa,aisu:m_α" #: ../data/variables.xml.in.h:102 msgid "Bohr Radius" msgstr "Bohr-straal" #: ../data/variables.xml.in.h:103 #, fuzzy msgid "r:bohr_radius,ais:a_0" msgstr "eerste_straling,ais:c_1" #: ../data/variables.xml.in.h:104 msgid "Classical Electron Radius" msgstr "Klassieke straal elektron" #: ../data/variables.xml.in.h:105 msgid "r:classical_electron_radius,ais:r_e" msgstr "klassieke_electron_radius,ais:r_e" #: ../data/variables.xml.in.h:106 msgid "Compton Wavelength" msgstr "Compton golflengte" #: ../data/variables.xml.in.h:107 #, fuzzy msgid "r:compton_wavelength,asu:λ_C,aos:lambda_C" msgstr "compton_golflengte,aisu:λ_C" #: ../data/variables.xml.in.h:108 msgid "Electron Mass" msgstr "Elektronmassa" #: ../data/variables.xml.in.h:109 msgid "r:electron_mass,ais:m_e" msgstr "elektron_massa,ais:m_e" #: ../data/variables.xml.in.h:110 msgid "Helion Mass" msgstr "Helionmassa" #: ../data/variables.xml.in.h:111 msgid "r:helion_mass,ais:m_h" msgstr "helion_massa,ais:m_h" #: ../data/variables.xml.in.h:112 msgid "Neutron Mass" msgstr "Neutronmassa" #: ../data/variables.xml.in.h:113 msgid "r:neutron_mass,ais:m_n" msgstr "neutron_massa,ais:m_n" #: ../data/variables.xml.in.h:114 msgid "Proton Mass" msgstr "Protonmassa" #: ../data/variables.xml.in.h:115 msgid "r:proton_mass,ais:m_p" msgstr "proton_massa,ais:m_p" #: ../data/variables.xml.in.h:116 msgid "Rydberg Constant" msgstr "Rydberg constante" #: ../data/variables.xml.in.h:117 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:118 msgid "Tau Mass" msgstr "Tau massa" #: ../data/variables.xml.in.h:119 msgid "r:tau_mass,aisu:m_τ" msgstr "tau_massa,aisu:m_τ" #: ../data/variables.xml.in.h:120 msgid "Physico-Chemical Constants" msgstr "Fysisch-chemische constanten" #: ../data/variables.xml.in.h:121 msgid "Atomic Mass Constant" msgstr "Atomaire massaconstante" #: ../data/variables.xml.in.h:122 msgid "r:atomic_mass,ais:m_u" msgstr "atoommassa,ais:m_u" #: ../data/variables.xml.in.h:123 msgid "Avogadro Constant" msgstr "Avogadro's constante" #: ../data/variables.xml.in.h:124 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:125 msgid "Boltzmann Constant" msgstr "Constante van Boltzmann" #: ../data/variables.xml.in.h:126 #, fuzzy msgid "r:boltzmann,ais:k_B" msgstr "proton_massa,ais:m_p" #: ../data/variables.xml.in.h:127 msgid "Faraday Constant" msgstr "Faraday constante" #: ../data/variables.xml.in.h:128 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:129 msgid "First Radiation Constant" msgstr "Eerste stralingsconstante" #: ../data/variables.xml.in.h:130 msgid "r:first_radiation,ais:c_1" msgstr "eerste_straling,ais:c_1" #: ../data/variables.xml.in.h:131 msgid "Ideal Gas Constant" msgstr "Ideale gasconstante" #: ../data/variables.xml.in.h:132 msgid "r:ideal_gas" msgstr "ideale_gas" #: ../data/variables.xml.in.h:133 msgid "Second Radiation Constant" msgstr "Tweede stralingsconstante" #: ../data/variables.xml.in.h:134 msgid "r:second_radiation,ais:c_2" msgstr "tweede_straling,aisc_2" #: ../data/variables.xml.in.h:135 msgid "Basic Constants" msgstr "Basisconstanten" #: ../data/variables.xml.in.h:136 msgid "Golden Ratio" msgstr "Gulden snede" #: ../data/variables.xml.in.h:137 msgid "r:golden,au:φ" msgstr "gouden,φ" #: ../data/variables.xml.in.h:138 msgid "Omega Constant" msgstr "Omega constante" #: ../data/variables.xml.in.h:139 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:140 msgid "Pythagoras' Constant (sqrt 2)" msgstr "Pythagoras constante (sqrt 2)" #: ../data/variables.xml.in.h:141 msgid "r:pythagoras" msgstr "" #: ../data/variables.xml.in.h:142 msgid "Apery's Constant" msgstr "Apery's constante" #: ../data/variables.xml.in.h:143 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:144 msgid "Base of Natural Logarithms (e)" msgstr "Grondtal natuurlijke logaritmen (e)" #: ../data/variables.xml.in.h:145 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:146 msgid "Archimedes' Constant (pi)" msgstr "Archimede's constante (pi)" #: ../data/variables.xml.in.h:147 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:148 msgid "Euler's Constant" msgstr "Euler's constante" #: ../data/variables.xml.in.h:149 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:150 msgid "Catalan's Constant" msgstr "Catalan's constante" #: ../data/variables.xml.in.h:151 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:152 msgid "Special Numbers" msgstr "Bijzondere getallen" #: ../data/variables.xml.in.h:153 msgid "Imaginary i (sqrt -1)" msgstr "Imaginaire i (sqrt -1)" #: ../data/variables.xml.in.h:154 msgid "r:i" msgstr "." #: ../data/variables.xml.in.h:155 msgid "Positive Infinity" msgstr "Positief oneindig" #: ../data/variables.xml.in.h:156 #, fuzzy msgid "a:∞,r:plus_infinity,r:infinity" msgstr "a:∞,oneindig" #: ../data/variables.xml.in.h:157 msgid "Negative Infinity" msgstr "Negatief oneindig" #: ../data/variables.xml.in.h:158 msgid "r:minus_infinity" msgstr "min_oneindig" #: ../data/variables.xml.in.h:159 msgid "Undefined" msgstr "Ongedefinieerd" #: ../data/variables.xml.in.h:160 msgid "r:undefined" msgstr "ongedefinieerd" #: ../data/variables.xml.in.h:161 #, fuzzy msgid "Precision" msgstr "Regressie" #: ../data/variables.xml.in.h:162 #, fuzzy msgid "r:precision" msgstr "Expressie" #: ../data/variables.xml.in.h:163 msgid "False" msgstr "Onwaar" #: ../data/variables.xml.in.h:164 msgid "r:false,r:no" msgstr "onwaar,nee" #: ../data/variables.xml.in.h:165 msgid "True" msgstr "Waar" #: ../data/variables.xml.in.h:166 msgid "r:true,r:yes" msgstr "waar,ja" #: ../data/variables.xml.in.h:167 msgid "Unknowns" msgstr "Onbekenden" #: ../data/variables.xml.in.h:168 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:170 msgid "r:z" msgstr "" #: ../data/variables.xml.in.h:171 #, fuzzy msgid "n (integer)" msgstr "Is een geheel getal" #: ../data/variables.xml.in.h:172 #, fuzzy msgid "r:n" msgstr "anderteken" #: ../data/variables.xml.in.h:174 msgid "Today" msgstr "" #: ../data/variables.xml.in.h:175 #, fuzzy msgid "r:today" msgstr "totaal" #: ../data/variables.xml.in.h:176 msgid "Tomorrow" msgstr "" #: ../data/variables.xml.in.h:177 msgid "r:tomorrow" msgstr "" #: ../data/variables.xml.in.h:178 msgid "Yesterday" msgstr "" #: ../data/variables.xml.in.h:179 #, fuzzy msgid "r:yesterday" msgstr "jaardag" #: ../data/variables.xml.in.h:180 msgid "Now (date and time)" msgstr "" #: ../data/variables.xml.in.h:181 msgid "r:now" msgstr "" #, fuzzy #~ msgid "ar:MVR,au:ރ" #~ msgstr "a:ITL,au:₤,lire" #~ msgid "r:arcminute,p:arcminutes,a:arcmin" #~ msgstr "boogminuut,p:boogminuten,a:arcmin" #~ msgid "Returns an integer from a binary number" #~ msgstr "Converteert een binair getal naar een geheel getal" #~ msgid "Returns an integer from an octal number" #~ msgstr "Converteert een octaal getal naar een geheel getal" #~ msgid "Standard Date Format" #~ msgstr "Standaardnotatie voor datum" #~ msgid "Local Date Format" #~ msgstr "Lokale datumnotatie" #~ msgid "r:localdate" #~ msgstr "lokaledatum" #~ msgid "Infinity" #~ msgstr "Oneindig" #~ msgid "r:plus_infinity" #~ msgstr "plus_oneindig" #~ msgid "Analysis" #~ msgstr "Analyse" #~ msgid "Durbin-Watson" #~ msgstr "Durbin-Watson" #~ msgid "Sum" #~ msgstr "Som" #~ msgid "Product" #~ msgstr "Product" #~ msgid "Consumer Surplus" #~ msgstr "Consumentenoverschot" #~ msgid "Supply function or price" #~ msgstr "Aanbodfunctie of prijs" #~ msgid "Quantity variabel" #~ msgstr "Hoeveelheidvariabele" #~ msgid "Producer Surplus" #~ msgstr "Producentenoverschot" #~ msgid "Supply function" #~ msgstr "Aanbodfunctie" #~ msgid "Demand function or price" #~ msgstr "Vraagfunctie of prijs" #~ msgid "Finance" #~ msgstr "Financiën" #~ msgid "Duration" #~ msgstr "Duur" #~ msgid "r:duration" #~ msgstr "tijdsduur" #~ msgid "Calculates the duration of a security." #~ msgstr "Berekent de looptijd van een waardepapier." #~ msgid "Annual coupon rate (%)" #~ msgstr "Jaarlijkse couponopbrengst (%)" #~ msgid "Annualized yield (%)" #~ msgstr "Teruggerekende opbrengst per jaar (%)" #~ msgid "Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6]" #~ msgstr "" #~ "Retourneert een gesorteerde vector. bv. sort([6, 1, 4])=[1, 4, 6]" #~ msgid "Ununseptium" #~ msgstr "Ununseptium" #~ msgid "Ununoctium" #~ msgstr "Ununoctium" #~ msgid "Cup" #~ msgstr "Kop" #~ msgid "Ionization Potential" #~ msgstr "Ionisatiepotentiaal" #~ msgid "r:ionization" #~ msgstr "ionisatie" #~ msgid "Covalent Radius" #~ msgstr "Covalente straal" #~ msgid "r:covalent" #~ msgstr "covalent" #~ msgid "Ununbium" #~ msgstr "Ununbium" #~ msgid "Ununquadium" #~ msgstr "Ununquadium" #~ msgid "Ununhexium" #~ msgstr "Ununhexium" #, fuzzy #~ msgid "Value 1 (n)" #~ msgstr "Waarde 1 (i)" #~ msgid "Price per $100 face value of a security bond" #~ msgstr "Prijs per €100 nominale waarde van een obligatie" #~ msgid "Derive" #~ msgstr "Afleiden" libqalculate-2.8.2/po-defs/sv.po0000644000175000017500000063710013374225243013447 00000000000000# This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. # Hanna Knutsson , 2003. # msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-11-07 07:18+0100\n" "PO-Revision-Date: 2007-06-15 11:13+0100\n" "Last-Translator: Hanna Knutsson \n" "Language-Team: Swedish\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../data/currencies.xml.in.h:1 msgid "Currency" msgstr "Valuta" #: ../data/currencies.xml.in.h:2 msgid "European Euros" msgstr "Euro" #: ../data/currencies.xml.in.h:3 msgid "ar:EUR,au:€,euro,p:euros" msgstr "a:EUR,au:€,euro" #: ../data/currencies.xml.in.h:4 msgid "" "Andorra, Austria, Belgium, Cyprus, Estonia, Finland, France, Germany, " "Greece, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, " "Portugal, San Marino, Slovakia, Slovenia, Spain, Vatican City" msgstr "" #: ../data/currencies.xml.in.h:5 msgid "U.S. Dollars" msgstr "Amerikanska dollar" #: ../data/currencies.xml.in.h:6 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "a:$,a:USD,dollar" #: ../data/currencies.xml.in.h:7 msgid "" "United States, East Timor, Ecuador, El Salvador, Micronesia, Marshall " "Islands, Palau, Zimbabwe" msgstr "" #: ../data/currencies.xml.in.h:8 msgid "Japanese Yen" msgstr "Japanska yen" #: ../data/currencies.xml.in.h:9 msgid "ar:JPY,au:¥,yen" msgstr "" #: ../data/currencies.xml.in.h:10 msgid "Japan" msgstr "" #: ../data/currencies.xml.in.h:11 msgid "Danish Kroner" msgstr "Danska kronor" #: ../data/currencies.xml.in.h:12 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:13 msgid "Denmark" msgstr "" #: ../data/currencies.xml.in.h:14 msgid "British Pounds" msgstr "Brittiska pund" #: ../data/currencies.xml.in.h:15 msgid "ar:GBP,au:£" msgstr "" #: ../data/currencies.xml.in.h:16 msgid "United Kingdom" msgstr "" #: ../data/currencies.xml.in.h:17 msgid "Thai Baht" msgstr "Thailändska baht" #: ../data/currencies.xml.in.h:18 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:19 msgid "Thailand" msgstr "" #: ../data/currencies.xml.in.h:20 msgid "Swedish Krona" msgstr "Svenska kronor" #: ../data/currencies.xml.in.h:21 msgid "ar:SEK" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:22 msgid "Sweden" msgstr "" #: ../data/currencies.xml.in.h:23 msgid "Swiss Francs" msgstr "Schweizerfranc" #: ../data/currencies.xml.in.h:24 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:25 msgid "Switzerland" msgstr "" #: ../data/currencies.xml.in.h:26 msgid "Norwegian Kroner" msgstr "Norska kronor" #: ../data/currencies.xml.in.h:27 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:28 msgid "Norway" msgstr "" #: ../data/currencies.xml.in.h:29 msgid "Bulgarian Lev" msgstr "Bulgariska lev" #: ../data/currencies.xml.in.h:30 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:31 #, fuzzy msgid "Bulgaria" msgstr "Bulgariska lev" #: ../data/currencies.xml.in.h:32 msgid "Russian Ruble" msgstr "Ryska rubel" #: ../data/currencies.xml.in.h:33 msgid "ar:RUB,au:₽,ruble" msgstr "a:RUB,au:₽,rubel" #: ../data/currencies.xml.in.h:34 #, fuzzy msgid "Russia" msgstr "Ryska rubel" #: ../data/currencies.xml.in.h:35 msgid "Philippine Peso" msgstr "Filippinska peso" #: ../data/currencies.xml.in.h:36 msgid "ar:PHP,au:₱" msgstr "" #: ../data/currencies.xml.in.h:37 #, fuzzy msgid "Philippines" msgstr "Filippinska peso" #: ../data/currencies.xml.in.h:38 msgid "Malaysian Ringgit" msgstr "Malaysiska ringgit" #: ../data/currencies.xml.in.h:39 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:40 #, fuzzy msgid "Malaysia" msgstr "Malaysiska ringgit" #: ../data/currencies.xml.in.h:41 msgid "Croatian Kuna" msgstr "Kroatiska kuna" #: ../data/currencies.xml.in.h:42 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:43 #, fuzzy msgid "Croatia" msgstr "Kroatiska kuna" #: ../data/currencies.xml.in.h:44 msgid "Yuan Renminbi (PR China)" msgstr "" #: ../data/currencies.xml.in.h:45 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:46 msgid "China" msgstr "" #: ../data/currencies.xml.in.h:47 msgid "Indonesian Rupiah" msgstr "Indonesiska rupiah" #: ../data/currencies.xml.in.h:48 msgid "ar:IDR,rupiah" msgstr "" #: ../data/currencies.xml.in.h:49 #, fuzzy msgid "Indonesia" msgstr "Indonesiska rupiah" #: ../data/currencies.xml.in.h:50 msgid "Czech Koruna" msgstr "Tjeckiska koruna" #: ../data/currencies.xml.in.h:51 msgid "ar:CZK,au-c:Kč" msgstr "" #: ../data/currencies.xml.in.h:52 msgid "Czech Republic" msgstr "" #: ../data/currencies.xml.in.h:53 msgid "Hungarian Forint" msgstr "Ungerska forint" #: ../data/currencies.xml.in.h:54 msgid "forint,ar:HUF" msgstr "" #: ../data/currencies.xml.in.h:55 msgid "Hungary" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "Polish Zloty" msgstr "Polska zloty" #: ../data/currencies.xml.in.h:57 msgid "ar:PLN,au:zł,zloty" msgstr "" #: ../data/currencies.xml.in.h:58 msgid "Poland" msgstr "" #: ../data/currencies.xml.in.h:59 msgid "Romanian Leu" msgstr "Rumänska leu" #: ../data/currencies.xml.in.h:60 msgid "ar:RON" msgstr "" #: ../data/currencies.xml.in.h:61 #, fuzzy msgid "Romania" msgstr "Rumänska leu" #: ../data/currencies.xml.in.h:62 msgid "Turkish New Lira" msgstr "Turkiska nya lira" #: ../data/currencies.xml.in.h:63 msgid "ar:TRY,au:₺" msgstr "" #: ../data/currencies.xml.in.h:64 msgid "Turkey" msgstr "" #: ../data/currencies.xml.in.h:65 msgid "Australian Dollars" msgstr "Australiensiska dollar" #: ../data/currencies.xml.in.h:66 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:67 #, fuzzy msgid "Australia" msgstr "Australiensiska dollar" #: ../data/currencies.xml.in.h:68 msgid "Canadian Dollars" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:69 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:70 msgid "Canada" msgstr "" #: ../data/currencies.xml.in.h:71 msgid "Hong Kong Dollars" msgstr "Hong Kong dollar" #: ../data/currencies.xml.in.h:72 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:73 msgid "New Zealand Dollars" msgstr "Nya Zeeländska dollar" #: ../data/currencies.xml.in.h:74 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:75 #, fuzzy msgid "New Zealand" msgstr "Nya Zeeländska dollar" #: ../data/currencies.xml.in.h:76 msgid "Singapore Dollars" msgstr "Singaporedollar" #: ../data/currencies.xml.in.h:77 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:78 #, fuzzy msgid "Singapore" msgstr "Singaporedollar" #: ../data/currencies.xml.in.h:79 msgid "South Korean Won" msgstr "Sydkoreanska won" #: ../data/currencies.xml.in.h:80 msgid "ar:KRW,au:₩,won" msgstr "" #: ../data/currencies.xml.in.h:81 #, fuzzy msgid "South Korea" msgstr "Sydkoreanska won" #: ../data/currencies.xml.in.h:82 msgid "South African Rand" msgstr "Sydafrikanska rand" #: ../data/currencies.xml.in.h:83 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:84 #, fuzzy msgid "South Africa" msgstr "Sydafrikanska rand" #: ../data/currencies.xml.in.h:85 msgid "Indian Rupee" msgstr "Indiska rupier" #: ../data/currencies.xml.in.h:86 msgid "ar:INR,au:₹,rupee" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:87 msgid "India" msgstr "" #: ../data/currencies.xml.in.h:88 msgid "Israeli New Sheqel" msgstr "Israeliska Sheqels" #: ../data/currencies.xml.in.h:89 msgid "ar:ILS,au:₪,sheqel" msgstr "a:ILS,au:₪,sheqel" #: ../data/currencies.xml.in.h:90 msgid "Israel" msgstr "" #: ../data/currencies.xml.in.h:91 msgid "Mexican Peso" msgstr "Mexikanska pesos" #: ../data/currencies.xml.in.h:92 msgid "ar:MXN" msgstr "" #: ../data/currencies.xml.in.h:93 #, fuzzy msgid "Mexico" msgstr "Mexikanska pesos" #: ../data/currencies.xml.in.h:94 msgid "Brazilian Real" msgstr "Brasilianska real" #: ../data/currencies.xml.in.h:95 msgid "ar:BRL" msgstr "" #: ../data/currencies.xml.in.h:96 #, fuzzy msgid "Brazil" msgstr "Brasilianska real" #: ../data/currencies.xml.in.h:97 msgid "Icelandic Krónur" msgstr "Isländska kronor" #: ../data/currencies.xml.in.h:98 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:99 msgid "Iceland" msgstr "" #: ../data/currencies.xml.in.h:100 msgid "Bitcoins" msgstr "" #: ../data/currencies.xml.in.h:101 msgid "ar:BTC,au:₿,a:XBT,bitcoin,p:bitcoins" msgstr "" #: ../data/currencies.xml.in.h:102 #, fuzzy msgid "Kenya Shilling" msgstr "Österrikiska schilling" #: ../data/currencies.xml.in.h:103 msgid "ar:KES" msgstr "" #: ../data/currencies.xml.in.h:104 msgid "Kenya" msgstr "" #: ../data/currencies.xml.in.h:105 msgid "Afghan Afghani" msgstr "" #: ../data/currencies.xml.in.h:106 #, fuzzy msgid "ar:AFN,aiu:؋" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:107 msgid "Afghanistan" msgstr "" #: ../data/currencies.xml.in.h:108 #, fuzzy msgid "Albanian Lek" msgstr "Rumänska leu" #: ../data/currencies.xml.in.h:109 msgid "ar:ALL" msgstr "" #: ../data/currencies.xml.in.h:110 msgid "Albania" msgstr "" #: ../data/currencies.xml.in.h:111 msgid "Algerian Dinar" msgstr "" #: ../data/currencies.xml.in.h:112 msgid "ar:DZD" msgstr "" #: ../data/currencies.xml.in.h:113 #, fuzzy msgid "Algeria" msgstr "Algebra" #: ../data/currencies.xml.in.h:114 msgid "Angolan Kwanza" msgstr "" #: ../data/currencies.xml.in.h:115 msgid "ar:AOA" msgstr "" #: ../data/currencies.xml.in.h:116 msgid "Angola" msgstr "" #: ../data/currencies.xml.in.h:117 #, fuzzy msgid "Eastern Caribbean Dollar" msgstr "Australiensiska dollar" #: ../data/currencies.xml.in.h:118 msgid "ar:XCD" msgstr "" #: ../data/currencies.xml.in.h:119 msgid "" "Antigua and Barbuda, Dominica, Grenada, Montserrat, Saint Kitts and Nevis, " "Saint Lucia, Saint Vincent and the Grenadines, Anguilla" msgstr "" #: ../data/currencies.xml.in.h:120 #, fuzzy msgid "Argentine Peso" msgstr "Mexikanska pesos" #: ../data/currencies.xml.in.h:121 msgid "ar:ARS" msgstr "" #: ../data/currencies.xml.in.h:122 msgid "Argentina" msgstr "" #: ../data/currencies.xml.in.h:123 msgid "Armenian Dram" msgstr "" #: ../data/currencies.xml.in.h:124 msgid "ar:AMD,au:֏" msgstr "" #: ../data/currencies.xml.in.h:125 msgid "Armenia" msgstr "" #: ../data/currencies.xml.in.h:126 #, fuzzy msgid "Aruban Florin" msgstr "Ungerska forint" #: ../data/currencies.xml.in.h:127 msgid "ar:AWG" msgstr "" #: ../data/currencies.xml.in.h:128 msgid "Aruba" msgstr "" #: ../data/currencies.xml.in.h:129 msgid "Netherlands Antillean Guilder" msgstr "" #: ../data/currencies.xml.in.h:130 msgid "ar:ANG" msgstr "" #: ../data/currencies.xml.in.h:131 msgid "Curaçao, Sint Maarten" msgstr "" #: ../data/currencies.xml.in.h:132 msgid "Azerbaijani Manat" msgstr "" #: ../data/currencies.xml.in.h:133 #, fuzzy msgid "ar:AZN,au:₼" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:134 msgid "Azerbaijan" msgstr "" #: ../data/currencies.xml.in.h:135 #, fuzzy msgid "Bahamian Dollar" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:136 msgid "ar:BSD" msgstr "" #: ../data/currencies.xml.in.h:137 msgid "Bahamas" msgstr "" #: ../data/currencies.xml.in.h:138 msgid "Bahraini Dinar" msgstr "" #: ../data/currencies.xml.in.h:139 msgid "ar:BHD" msgstr "" #: ../data/currencies.xml.in.h:140 msgid "Bahrain" msgstr "" #: ../data/currencies.xml.in.h:141 msgid "Bangladeshi Taka" msgstr "" #: ../data/currencies.xml.in.h:142 #, fuzzy msgid "ar:BDT,au:৳" msgstr "a:RUB,au:₽,rubel" #: ../data/currencies.xml.in.h:143 msgid "Bangladesh" msgstr "" #: ../data/currencies.xml.in.h:144 #, fuzzy msgid "Barbadian Dollar" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:145 msgid "ar:BBD" msgstr "" #: ../data/currencies.xml.in.h:146 msgid "Barbados" msgstr "" #: ../data/currencies.xml.in.h:147 msgid "Belarusian Ruble p. (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:148 msgid "ar:BYR" msgstr "" #: ../data/currencies.xml.in.h:149 #, fuzzy msgid "Belize Dollar" msgstr "Singaporedollar" #: ../data/currencies.xml.in.h:150 msgid "ar:BZD" msgstr "" #: ../data/currencies.xml.in.h:151 msgid "Belize" msgstr "" #: ../data/currencies.xml.in.h:152 #, fuzzy msgid "West African CFA Franc" msgstr "Sydafrikanska rand" #: ../data/currencies.xml.in.h:153 msgid "ar:XOF,a:CFA" msgstr "" #: ../data/currencies.xml.in.h:154 msgid "" "Benin, Burkina Faso, Guinea-Bissau, Ivory Coast, Mali, Niger, Senegal, Togo" msgstr "" #: ../data/currencies.xml.in.h:155 #, fuzzy msgid "Bermudian Dollar" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:156 msgid "ar:BMD" msgstr "" #: ../data/currencies.xml.in.h:157 msgid "Bermuda" msgstr "" #: ../data/currencies.xml.in.h:158 msgid "Bolivian Boliviano Bs" msgstr "" #: ../data/currencies.xml.in.h:159 msgid "ar:BOB" msgstr "" #: ../data/currencies.xml.in.h:160 msgid "Bolivia" msgstr "" #: ../data/currencies.xml.in.h:161 msgid "Bosnia and Herzegovina Convertible Mark" msgstr "" #: ../data/currencies.xml.in.h:162 msgid "ar:BAM" msgstr "" #: ../data/currencies.xml.in.h:163 msgid "Bosnia and Herzegovina" msgstr "" #: ../data/currencies.xml.in.h:164 msgid "Botswana Pula" msgstr "" #: ../data/currencies.xml.in.h:165 msgid "ar:BWP" msgstr "" #: ../data/currencies.xml.in.h:166 msgid "Botswana" msgstr "" #: ../data/currencies.xml.in.h:167 #, fuzzy msgid "Brunei Dollar" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:168 msgid "ar:BND" msgstr "" #: ../data/currencies.xml.in.h:169 msgid "Brunei" msgstr "" #: ../data/currencies.xml.in.h:170 #, fuzzy msgid "Burundian Franc" msgstr "Belgiska franc" #: ../data/currencies.xml.in.h:171 msgid "ar:BIF" msgstr "" #: ../data/currencies.xml.in.h:172 msgid "Burundi" msgstr "" #: ../data/currencies.xml.in.h:173 msgid "Cambodian Riel" msgstr "" #: ../data/currencies.xml.in.h:174 #, fuzzy msgid "ar:KHR,aiu:៛" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:175 msgid "Cambodia" msgstr "" #: ../data/currencies.xml.in.h:176 msgid "Central African CFA Franc" msgstr "" #: ../data/currencies.xml.in.h:177 msgid "ar:XAF,a:FCFA" msgstr "" #: ../data/currencies.xml.in.h:178 msgid "" "Cameroon, Central African Republic, Chad, Republic of the Congo, Equatorial " "Guinea, Gabon" msgstr "" #: ../data/currencies.xml.in.h:179 msgid "Cape Verdean Escudo" msgstr "" #: ../data/currencies.xml.in.h:180 msgid "ar:CVE" msgstr "" #: ../data/currencies.xml.in.h:181 msgid "Cape Verde" msgstr "" #: ../data/currencies.xml.in.h:182 #, fuzzy msgid "Cayman Islands Dollar" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:183 msgid "ar:KYD" msgstr "" #: ../data/currencies.xml.in.h:184 msgid "Cayman Islands" msgstr "" #: ../data/currencies.xml.in.h:185 #, fuzzy msgid "Chilean Peso" msgstr "Mexikanska pesos" #: ../data/currencies.xml.in.h:186 msgid "ar:CLP" msgstr "" #: ../data/currencies.xml.in.h:187 msgid "Chile" msgstr "" #: ../data/currencies.xml.in.h:188 #, fuzzy msgid "Colombian Peso" msgstr "Mexikanska pesos" #: ../data/currencies.xml.in.h:189 msgid "ar:COP" msgstr "" #: ../data/currencies.xml.in.h:190 #, fuzzy msgid "Colombia" msgstr "Coulomb" #: ../data/currencies.xml.in.h:191 #, fuzzy msgid "Comorian Franc" msgstr "Belgiska franc" #: ../data/currencies.xml.in.h:192 msgid "ar:KMF" msgstr "" #: ../data/currencies.xml.in.h:193 #, fuzzy msgid "Comoros" msgstr "Imorgon" #: ../data/currencies.xml.in.h:194 msgid "Democratic Republic of the Congo (Congolese Franc)" msgstr "" #: ../data/currencies.xml.in.h:195 msgid "ar:CDF" msgstr "" #: ../data/currencies.xml.in.h:196 msgid "Democratic Republic of the Congo" msgstr "" #: ../data/currencies.xml.in.h:197 msgid "Costa Rican colón" msgstr "" #: ../data/currencies.xml.in.h:198 msgid "ar:CRC" msgstr "" #: ../data/currencies.xml.in.h:199 msgid "Costa Rica" msgstr "" #: ../data/currencies.xml.in.h:200 #, fuzzy msgid "Cuban Peso" msgstr "Mexikanska pesos" #: ../data/currencies.xml.in.h:201 msgid "ar:CUP" msgstr "" #: ../data/currencies.xml.in.h:202 msgid "Cuba" msgstr "" #: ../data/currencies.xml.in.h:203 #, fuzzy msgid "Djiboutian Franc" msgstr "Belgiska franc" #: ../data/currencies.xml.in.h:204 msgid "ar:DJF" msgstr "" #: ../data/currencies.xml.in.h:205 msgid "Djibouti" msgstr "" #: ../data/currencies.xml.in.h:206 #, fuzzy msgid "Dominican Peso" msgstr "Mexikanska pesos" #: ../data/currencies.xml.in.h:207 msgid "ar:DOP" msgstr "" #: ../data/currencies.xml.in.h:208 msgid "Dominican Republic" msgstr "" #: ../data/currencies.xml.in.h:209 #, fuzzy msgid "Egyptian Pound" msgstr "Cypriotiska pund" #: ../data/currencies.xml.in.h:210 msgid "ar:EGP" msgstr "" #: ../data/currencies.xml.in.h:211 msgid "Egypt" msgstr "" #: ../data/currencies.xml.in.h:212 msgid "El Salvadoran Colon (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:213 #, fuzzy msgid "ar:SVC" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:214 msgid "Eritrean Nafka" msgstr "" #: ../data/currencies.xml.in.h:215 msgid "ar:ERN" msgstr "" #: ../data/currencies.xml.in.h:216 msgid "Eritrea" msgstr "" #: ../data/currencies.xml.in.h:217 msgid "Ethiopian Birr" msgstr "" #: ../data/currencies.xml.in.h:218 msgid "ar:ETB" msgstr "" #: ../data/currencies.xml.in.h:219 msgid "Ethiopia" msgstr "" #: ../data/currencies.xml.in.h:220 msgid "Falkland Islands Pound" msgstr "" #: ../data/currencies.xml.in.h:221 msgid "ar:FKP" msgstr "" #: ../data/currencies.xml.in.h:222 msgid "Falkland Islands" msgstr "" #: ../data/currencies.xml.in.h:223 #, fuzzy msgid "Fijian Dollar" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:224 msgid "ar:FJD" msgstr "" #: ../data/currencies.xml.in.h:225 msgid "Fiji" msgstr "" #: ../data/currencies.xml.in.h:226 msgid "CFP franc" msgstr "" #: ../data/currencies.xml.in.h:227 msgid "ar:XPF" msgstr "" #: ../data/currencies.xml.in.h:228 msgid "French Polynesia, New Caledonia, Wallis and Futuna" msgstr "" #: ../data/currencies.xml.in.h:229 #, fuzzy msgid "Gambian Dalasi" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:230 msgid "ar:GMD" msgstr "" #: ../data/currencies.xml.in.h:231 msgid "Gambia" msgstr "" #: ../data/currencies.xml.in.h:232 msgid "Georgian Lari" msgstr "" #: ../data/currencies.xml.in.h:233 #, fuzzy msgid "ar:GEL,au:₾" msgstr "a:RUB,au:₽,rubel" #: ../data/currencies.xml.in.h:234 msgid "Georgia" msgstr "" #: ../data/currencies.xml.in.h:235 msgid "Ghanaian Cedi" msgstr "" #: ../data/currencies.xml.in.h:236 #, fuzzy msgid "ar:GHS,au:₵" msgstr "a:RUB,au:₽,rubel" #: ../data/currencies.xml.in.h:237 msgid "Ghana" msgstr "" #: ../data/currencies.xml.in.h:238 msgid "Gibraltar Pound" msgstr "" #: ../data/currencies.xml.in.h:239 msgid "ar:GIP" msgstr "" #: ../data/currencies.xml.in.h:240 msgid "Gibraltar" msgstr "" #: ../data/currencies.xml.in.h:241 msgid "Guatemalan Quetzal" msgstr "" #: ../data/currencies.xml.in.h:242 msgid "ar:GTQ" msgstr "" #: ../data/currencies.xml.in.h:243 msgid "Guatemala" msgstr "" #: ../data/currencies.xml.in.h:244 #, fuzzy msgid "Guernsey Pound" msgstr "Irländska pund" #: ../data/currencies.xml.in.h:245 msgid "ar:GGP" msgstr "" #: ../data/currencies.xml.in.h:246 msgid "Guernsey" msgstr "" #: ../data/currencies.xml.in.h:247 #, fuzzy msgid "Guinean Franc" msgstr "Belgiska franc" #: ../data/currencies.xml.in.h:248 msgid "ar:GNF" msgstr "" #: ../data/currencies.xml.in.h:249 msgid "Guinea" msgstr "" #: ../data/currencies.xml.in.h:250 #, fuzzy msgid "Guyanese Dollar" msgstr "Australiensiska dollar" #: ../data/currencies.xml.in.h:251 msgid "ar:GYD" msgstr "" #: ../data/currencies.xml.in.h:252 msgid "Guyana" msgstr "" #: ../data/currencies.xml.in.h:253 msgid "Haitian Gourde" msgstr "" #: ../data/currencies.xml.in.h:254 msgid "ar:HTG" msgstr "" #: ../data/currencies.xml.in.h:255 msgid "Haiti" msgstr "" #: ../data/currencies.xml.in.h:256 msgid "Honduran Lempira" msgstr "" #: ../data/currencies.xml.in.h:257 msgid "ar:HNL" msgstr "" #: ../data/currencies.xml.in.h:258 msgid "Honduras" msgstr "" #: ../data/currencies.xml.in.h:259 #, fuzzy msgid "Iranian Rial" msgstr "Brasilianska real" #: ../data/currencies.xml.in.h:260 #, fuzzy msgid "ar:IRR,aiu:﷼" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:261 msgid "Iran" msgstr "" #: ../data/currencies.xml.in.h:262 msgid "Iraqi Dinar" msgstr "" #: ../data/currencies.xml.in.h:263 msgid "ar:IQD" msgstr "" #: ../data/currencies.xml.in.h:264 msgid "Iraq" msgstr "" #: ../data/currencies.xml.in.h:265 #, fuzzy msgid "Jamaican Dollar" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:266 msgid "ar:JMD" msgstr "" #: ../data/currencies.xml.in.h:267 msgid "Jamaica" msgstr "" #: ../data/currencies.xml.in.h:268 msgid "Jordanian Dinar" msgstr "" #: ../data/currencies.xml.in.h:269 msgid "ar:JOD" msgstr "" #: ../data/currencies.xml.in.h:270 msgid "Jordan" msgstr "" #: ../data/currencies.xml.in.h:271 msgid "Kazakhstani Tenge" msgstr "" #: ../data/currencies.xml.in.h:272 #, fuzzy msgid "ar:KZT,au:₸" msgstr "a:RUB,au:₽,rubel" #: ../data/currencies.xml.in.h:273 msgid "Kazakhstan" msgstr "" #: ../data/currencies.xml.in.h:274 #, fuzzy msgid "North Korean Won" msgstr "Sydkoreanska won" #: ../data/currencies.xml.in.h:275 msgid "ar:KPW" msgstr "" #: ../data/currencies.xml.in.h:276 #, fuzzy msgid "North Korea" msgstr "Sydkoreanska won" #: ../data/currencies.xml.in.h:277 msgid "Kuwaiti Dinar" msgstr "" #: ../data/currencies.xml.in.h:278 msgid "ar:KWD" msgstr "" #: ../data/currencies.xml.in.h:279 msgid "Kuwait" msgstr "" #: ../data/currencies.xml.in.h:280 msgid "Kyrgyzstani Som" msgstr "" #: ../data/currencies.xml.in.h:281 #, fuzzy msgid "ar:KGS,au:с" msgstr "a:ILS,au:₪,sheqel" #: ../data/currencies.xml.in.h:282 msgid "Kyrgyzstan" msgstr "" #: ../data/currencies.xml.in.h:283 msgid "Lao Kip" msgstr "" #: ../data/currencies.xml.in.h:284 #, fuzzy msgid "ar:LAK,au:₭" msgstr "a:ILS,au:₪,sheqel" #: ../data/currencies.xml.in.h:285 msgid "Laos" msgstr "" #: ../data/currencies.xml.in.h:286 msgid "Lebanese Pound" msgstr "" #: ../data/currencies.xml.in.h:287 msgid "ar:LBP" msgstr "" #: ../data/currencies.xml.in.h:288 msgid "Lebanon" msgstr "" #: ../data/currencies.xml.in.h:289 msgid "Lesotho Loti" msgstr "" #: ../data/currencies.xml.in.h:290 msgid "ar:LSL" msgstr "" #: ../data/currencies.xml.in.h:291 msgid "Lesotho" msgstr "" #: ../data/currencies.xml.in.h:292 #, fuzzy msgid "Liberian Dollar" msgstr "Australiensiska dollar" #: ../data/currencies.xml.in.h:293 msgid "ar:LRD" msgstr "" #: ../data/currencies.xml.in.h:294 msgid "Liberia" msgstr "" #: ../data/currencies.xml.in.h:295 msgid "Libyan Dinar" msgstr "" #: ../data/currencies.xml.in.h:296 msgid "ar:LYD" msgstr "" #: ../data/currencies.xml.in.h:297 msgid "Libya" msgstr "" #: ../data/currencies.xml.in.h:298 msgid "Macanese Pataca" msgstr "" #: ../data/currencies.xml.in.h:299 msgid "ar:MOP" msgstr "" #: ../data/currencies.xml.in.h:300 msgid "Macedonian Denar" msgstr "" #: ../data/currencies.xml.in.h:301 msgid "ar:MKD" msgstr "" #: ../data/currencies.xml.in.h:302 msgid "Macedonia" msgstr "" #: ../data/currencies.xml.in.h:303 msgid "Malagasy Ariary" msgstr "" #: ../data/currencies.xml.in.h:304 msgid "ar:MGA" msgstr "" #: ../data/currencies.xml.in.h:305 msgid "Madagascar" msgstr "" #: ../data/currencies.xml.in.h:306 msgid "Malawian Kwacha" msgstr "" #: ../data/currencies.xml.in.h:307 msgid "ar:MWK" msgstr "" #: ../data/currencies.xml.in.h:308 msgid "Malawi" msgstr "" #: ../data/currencies.xml.in.h:309 msgid "Maldivian Rufiyaa" msgstr "" #: ../data/currencies.xml.in.h:310 msgid "ar:MVR" msgstr "" #: ../data/currencies.xml.in.h:311 msgid "Maldives" msgstr "" #: ../data/currencies.xml.in.h:312 msgid "Mauritanian Ouguiya (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:313 msgid "ar:MRO" msgstr "" #: ../data/currencies.xml.in.h:314 #, fuzzy msgid "Mauritian Rupee" msgstr "Indiska rupier" #: ../data/currencies.xml.in.h:315 msgid "ar:MUR" msgstr "" #: ../data/currencies.xml.in.h:316 msgid "Mauritius" msgstr "" #: ../data/currencies.xml.in.h:317 msgid "Moldovan Leu" msgstr "" #: ../data/currencies.xml.in.h:318 msgid "ar:MDL" msgstr "" #: ../data/currencies.xml.in.h:319 msgid "Moldova" msgstr "" #: ../data/currencies.xml.in.h:320 msgid "Mongolian Tögrög" msgstr "" #: ../data/currencies.xml.in.h:321 #, fuzzy msgid "ar:MNT,au:₮" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:322 msgid "Mongolia" msgstr "" #: ../data/currencies.xml.in.h:323 msgid "Moroccan Dirham" msgstr "" #: ../data/currencies.xml.in.h:324 msgid "ar:MAD" msgstr "" #: ../data/currencies.xml.in.h:325 msgid "Morocco" msgstr "" #: ../data/currencies.xml.in.h:326 msgid "Mozambican Metical" msgstr "" #: ../data/currencies.xml.in.h:327 msgid "ar:MZN" msgstr "" #: ../data/currencies.xml.in.h:328 msgid "Mozambique" msgstr "" #: ../data/currencies.xml.in.h:329 msgid "Myanmar (Burmese Kyat)" msgstr "" #: ../data/currencies.xml.in.h:330 msgid "ar:MMK" msgstr "" #: ../data/currencies.xml.in.h:331 msgid "Myanmar" msgstr "" #: ../data/currencies.xml.in.h:332 #, fuzzy msgid "Namibian Dollar" msgstr "Kanadensiska dollar" #: ../data/currencies.xml.in.h:333 msgid "ar:NAD" msgstr "" #: ../data/currencies.xml.in.h:334 msgid "Namibia" msgstr "" #: ../data/currencies.xml.in.h:335 msgid "Nepalese Rupee" msgstr "" #: ../data/currencies.xml.in.h:336 msgid "ar:NPR" msgstr "" #: ../data/currencies.xml.in.h:337 msgid "Nepal" msgstr "" #: ../data/currencies.xml.in.h:338 msgid "Nicaraguan Córdoba" msgstr "" #: ../data/currencies.xml.in.h:339 msgid "ar:NIO" msgstr "" #: ../data/currencies.xml.in.h:340 msgid "Nicaragua" msgstr "" #: ../data/currencies.xml.in.h:341 msgid "Nigerian Naira" msgstr "" #: ../data/currencies.xml.in.h:342 #, fuzzy msgid "ar:NGN,au:₦" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:343 msgid "Nigeria" msgstr "" #: ../data/currencies.xml.in.h:344 msgid "Omani Rial" msgstr "" #: ../data/currencies.xml.in.h:345 msgid "ar:OMR" msgstr "" #: ../data/currencies.xml.in.h:346 msgid "Oman" msgstr "" #: ../data/currencies.xml.in.h:347 #, fuzzy msgid "Pakistani Rupee" msgstr "Indiska rupier" #: ../data/currencies.xml.in.h:348 msgid "ar:PKR" msgstr "" #: ../data/currencies.xml.in.h:349 #, fuzzy msgid "Pakistan" msgstr "Plancks konstant" #: ../data/currencies.xml.in.h:350 msgid "Panamaian Balboa" msgstr "" #: ../data/currencies.xml.in.h:351 msgid "ar:PAB" msgstr "" #: ../data/currencies.xml.in.h:352 msgid "Panama" msgstr "" #: ../data/currencies.xml.in.h:353 msgid "Papua New Guinean Kina" msgstr "" #: ../data/currencies.xml.in.h:354 msgid "ar:PGK" msgstr "" #: ../data/currencies.xml.in.h:355 msgid "Papua New Guinea" msgstr "" #: ../data/currencies.xml.in.h:356 msgid "Paraguayan Guaraní" msgstr "" #: ../data/currencies.xml.in.h:357 #, fuzzy msgid "ar:PYG,au:₲" msgstr "a:RUB,au:₽,rubel" #: ../data/currencies.xml.in.h:358 msgid "Paraguay" msgstr "" #: ../data/currencies.xml.in.h:359 msgid "Peruvian Sol" msgstr "" #: ../data/currencies.xml.in.h:360 msgid "ar:PEN" msgstr "" #: ../data/currencies.xml.in.h:361 msgid "Peru" msgstr "" #: ../data/currencies.xml.in.h:362 msgid "Qatari Riyal" msgstr "" #: ../data/currencies.xml.in.h:363 msgid "ar:QAR" msgstr "" #: ../data/currencies.xml.in.h:364 msgid "Qatar" msgstr "" #: ../data/currencies.xml.in.h:365 #, fuzzy msgid "Rwandan Franc" msgstr "Belgiska franc" #: ../data/currencies.xml.in.h:366 msgid "ar:RWF" msgstr "" #: ../data/currencies.xml.in.h:367 msgid "Rwanda" msgstr "" #: ../data/currencies.xml.in.h:368 msgid "São Tomé and Príncipe Dobra" msgstr "" #: ../data/currencies.xml.in.h:369 #, fuzzy msgid "ar:STD" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:370 msgid "Sao Tome and Principe" msgstr "" #: ../data/currencies.xml.in.h:371 msgid "Saudi Riyal" msgstr "" #: ../data/currencies.xml.in.h:372 #, fuzzy msgid "ar:SAR" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:373 msgid "Saudi Arabia" msgstr "" #: ../data/currencies.xml.in.h:374 msgid "Serbian Dinar" msgstr "" #: ../data/currencies.xml.in.h:375 msgid "ar:RSD" msgstr "" #: ../data/currencies.xml.in.h:376 msgid "Serbia" msgstr "" #: ../data/currencies.xml.in.h:377 msgid "Seychellois Rupee" msgstr "" #: ../data/currencies.xml.in.h:378 #, fuzzy msgid "ar:SCR" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:379 msgid "Seychelles" msgstr "" #: ../data/currencies.xml.in.h:380 msgid "Sierra Leonean Leone" msgstr "" #: ../data/currencies.xml.in.h:381 #, fuzzy msgid "ar:SLL" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:382 msgid "Sierra Leone" msgstr "" #: ../data/currencies.xml.in.h:383 msgid "Solomon Islands Dollar" msgstr "" #: ../data/currencies.xml.in.h:384 #, fuzzy msgid "ar:SBD" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:385 msgid "Solomon Islands" msgstr "" #: ../data/currencies.xml.in.h:386 #, fuzzy msgid "Somali Shilling" msgstr "Österrikiska schilling" #: ../data/currencies.xml.in.h:387 #, fuzzy msgid "ar:SOS" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:388 msgid "Somalia" msgstr "" #: ../data/currencies.xml.in.h:389 #, fuzzy msgid "Sri Lankan Rupee;" msgstr "Indiska rupier" #: ../data/currencies.xml.in.h:390 #, fuzzy msgid "ar:LKR,au:௹" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:391 msgid "Sri Lanka" msgstr "" #: ../data/currencies.xml.in.h:392 msgid "Sudanese Pound" msgstr "" #: ../data/currencies.xml.in.h:393 #, fuzzy msgid "ar:SDG" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:394 msgid "Sudan" msgstr "" #: ../data/currencies.xml.in.h:395 #, fuzzy msgid "Surinamese Dollar" msgstr "Singaporedollar" #: ../data/currencies.xml.in.h:396 #, fuzzy msgid "ar:SRD" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:397 #, fuzzy msgid "Suriname" msgstr "namn" #: ../data/currencies.xml.in.h:398 msgid "Swazi Lilangeni" msgstr "" #: ../data/currencies.xml.in.h:399 #, fuzzy msgid "ar:SZL" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:400 msgid "Swaziland" msgstr "" #: ../data/currencies.xml.in.h:401 #, fuzzy msgid "Syrian Pound" msgstr "Cypriotiska pund" #: ../data/currencies.xml.in.h:402 #, fuzzy msgid "ar:SYP" msgstr "a:kr,a:SEK,krona,p:kronor" #: ../data/currencies.xml.in.h:403 msgid "Syria" msgstr "" #: ../data/currencies.xml.in.h:404 #, fuzzy msgid "New Taiwan Dollar" msgstr "Nya Zeeländska dollar" #: ../data/currencies.xml.in.h:405 msgid "ar:TWD" msgstr "" #: ../data/currencies.xml.in.h:406 msgid "Taiwan" msgstr "" #: ../data/currencies.xml.in.h:407 msgid "Tajikistani Somoni" msgstr "" #: ../data/currencies.xml.in.h:408 msgid "ar:TJS" msgstr "" #: ../data/currencies.xml.in.h:409 msgid "Tajikistan" msgstr "" #: ../data/currencies.xml.in.h:410 #, fuzzy msgid "Tanzanian Shilling" msgstr "Österrikiska schilling" #: ../data/currencies.xml.in.h:411 msgid "ar:TZS" msgstr "" #: ../data/currencies.xml.in.h:412 msgid "Tanzania" msgstr "" #: ../data/currencies.xml.in.h:413 msgid "Tongan PaÊ»anga" msgstr "" #: ../data/currencies.xml.in.h:414 msgid "ar:TOP" msgstr "" #: ../data/currencies.xml.in.h:415 msgid "Tonga" msgstr "" #: ../data/currencies.xml.in.h:416 msgid "Trinidad and Tobago dollar" msgstr "" #: ../data/currencies.xml.in.h:417 msgid "ar:TTD" msgstr "" #: ../data/currencies.xml.in.h:418 msgid "Trinidad and Tobago" msgstr "" #: ../data/currencies.xml.in.h:419 msgid "Tunisian Dinar" msgstr "" #: ../data/currencies.xml.in.h:420 msgid "ar:TND" msgstr "" #: ../data/currencies.xml.in.h:421 msgid "Tunisia" msgstr "" #: ../data/currencies.xml.in.h:422 msgid "Turkmenistan Manat" msgstr "" #: ../data/currencies.xml.in.h:423 msgid "ar:TMT" msgstr "" #: ../data/currencies.xml.in.h:424 msgid "Turkmenistan" msgstr "" #: ../data/currencies.xml.in.h:425 #, fuzzy msgid "Ugandan Shilling" msgstr "Österrikiska schilling" #: ../data/currencies.xml.in.h:426 msgid "ar:UGX" msgstr "" #: ../data/currencies.xml.in.h:427 msgid "Uganda" msgstr "" #: ../data/currencies.xml.in.h:428 msgid "Ukrainian Hryvnia" msgstr "" #: ../data/currencies.xml.in.h:429 #, fuzzy msgid "ar:UAH,au:₴" msgstr "a:RUB,au:₽,rubel" #: ../data/currencies.xml.in.h:430 msgid "Ukraine" msgstr "" #: ../data/currencies.xml.in.h:431 msgid "United Arab Emirates Dirham" msgstr "" #: ../data/currencies.xml.in.h:432 msgid "ar:AED" msgstr "" #: ../data/currencies.xml.in.h:433 msgid "United Arab Emirates" msgstr "" #: ../data/currencies.xml.in.h:434 msgid "Uruguayan Peso" msgstr "" #: ../data/currencies.xml.in.h:435 msgid "ar:UYU" msgstr "" #: ../data/currencies.xml.in.h:436 msgid "Uruguay" msgstr "" #: ../data/currencies.xml.in.h:437 msgid "Uzbekistan SoÊ»m" msgstr "" #: ../data/currencies.xml.in.h:438 msgid "ar:UZS" msgstr "" #: ../data/currencies.xml.in.h:439 msgid "Uzbekistan" msgstr "" #: ../data/currencies.xml.in.h:440 msgid "Vanuatu Vatu" msgstr "" #: ../data/currencies.xml.in.h:441 msgid "ar:VUV" msgstr "" #: ../data/currencies.xml.in.h:442 msgid "Vanuatu" msgstr "" #: ../data/currencies.xml.in.h:443 msgid "Venezuelan Bolívar" msgstr "" #: ../data/currencies.xml.in.h:444 msgid "ar:VEF" msgstr "" #: ../data/currencies.xml.in.h:445 msgid "Venezuela" msgstr "" #: ../data/currencies.xml.in.h:446 msgid "Vietnamese Dồng" msgstr "" #: ../data/currencies.xml.in.h:447 #, fuzzy msgid "ar:VND,au:₫" msgstr "a:INR,au:₹,rupie,p:rupier" #: ../data/currencies.xml.in.h:448 msgid "Vietnam" msgstr "" #: ../data/currencies.xml.in.h:449 msgid "Yemeni Rial" msgstr "" #: ../data/currencies.xml.in.h:450 msgid "ar:YER" msgstr "" #: ../data/currencies.xml.in.h:451 #, fuzzy msgid "Yemen" msgstr "Element" #: ../data/currencies.xml.in.h:452 msgid "Zambian Kwacha (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:453 msgid "ar:ZMK" msgstr "" #: ../data/currencies.xml.in.h:454 msgid "Euro Cent" msgstr "Eurocent" #: ../data/currencies.xml.in.h:455 msgid "r:eurocent,p:eurocents" msgstr "eurocent" #: ../data/currencies.xml.in.h:456 msgid "Cent (USD)" msgstr "Cent (USD)" #: ../data/currencies.xml.in.h:457 msgid "au:¢,r:cent,p:cents" msgstr "au:¢,cent" #: ../data/currencies.xml.in.h:458 #, fuzzy msgid "Belgian Franc (obsolete)" msgstr "Belgiska franc" #: ../data/currencies.xml.in.h:459 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:460 #, fuzzy msgid "Greek Drachma (obsolete)" msgstr "Grekiska drachmer" #: ../data/currencies.xml.in.h:461 msgid "ar:GRD,au:₯" msgstr "" #: ../data/currencies.xml.in.h:462 #, fuzzy msgid "French Franc (obsolete)" msgstr "Franska franc" #: ../data/currencies.xml.in.h:463 msgid "ar:FRF,au:₣" msgstr "" #: ../data/currencies.xml.in.h:464 #, fuzzy msgid "Italian Lira (obsolete)" msgstr "Italienska lire" #: ../data/currencies.xml.in.h:465 msgid "ar:ITL" msgstr "" #: ../data/currencies.xml.in.h:466 #, fuzzy msgid "Dutch Guilder (obsolete)" msgstr "Nederländska gulden" #: ../data/currencies.xml.in.h:467 msgid "ar:NLG" msgstr "" #: ../data/currencies.xml.in.h:468 #, fuzzy msgid "Portuguese Escudo (obsolete)" msgstr "Portugisiska escudos" #: ../data/currencies.xml.in.h:469 msgid "ar:PTE" msgstr "" #: ../data/currencies.xml.in.h:470 #, fuzzy msgid "Deutsche Mark (obsolete)" msgstr "Tyska mark" #: ../data/currencies.xml.in.h:471 msgid "ar:DEM" msgstr "" #: ../data/currencies.xml.in.h:472 #, fuzzy msgid "Spanish Peseta (obsolete)" msgstr "Spanska pesetas" #: ../data/currencies.xml.in.h:473 msgid "ar:ESP,au:₧" msgstr "" #: ../data/currencies.xml.in.h:474 #, fuzzy msgid "Irish Pound (obsolete)" msgstr "Irländska pund" #: ../data/currencies.xml.in.h:475 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:476 #, fuzzy msgid "Luxembourg Franc (obsolete)" msgstr "Luxemburgfranc" #: ../data/currencies.xml.in.h:477 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:478 #, fuzzy msgid "Austrian Schilling (obsolete)" msgstr "Österrikiska schilling" #: ../data/currencies.xml.in.h:479 msgid "ar:ATS" msgstr "" #: ../data/currencies.xml.in.h:480 #, fuzzy msgid "Finnish Markka (obsolete)" msgstr "Finska mark" #: ../data/currencies.xml.in.h:481 msgid "ar:FIM" msgstr "" #: ../data/currencies.xml.in.h:482 #, fuzzy msgid "Slovenian Tolar (obsolete)" msgstr "Slovenska tolar" #: ../data/currencies.xml.in.h:483 msgid "ar:SIT" msgstr "" #: ../data/currencies.xml.in.h:484 #, fuzzy msgid "Cypriot Pound (obsolete)" msgstr "Cypriotiska pund" #: ../data/currencies.xml.in.h:485 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:486 #, fuzzy msgid "Estonian Kroon (obsolete)" msgstr "Estoniska kroon" #: ../data/currencies.xml.in.h:487 msgid "ar:EEK" msgstr "" #: ../data/currencies.xml.in.h:488 #, fuzzy msgid "Slovak Koruna (obsolete)" msgstr "Slovakiska koruna" #: ../data/currencies.xml.in.h:489 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:490 #, fuzzy msgid "Maltese Lira (obsolete)" msgstr "Maltesiska lire" #: ../data/currencies.xml.in.h:491 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:492 #, fuzzy msgid "Latvian Lats (obsolete)" msgstr "Lettiska lats" #: ../data/currencies.xml.in.h:493 msgid "ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:494 #, fuzzy msgid "Lithuanian Litas (obsolete)" msgstr "Litauiska litas" #: ../data/currencies.xml.in.h:495 msgid "ar:LTL" msgstr "" #: ../data/currencies.xml.in.h:496 #, fuzzy msgid "Belarusian Ruble" msgstr "Ryska rubel" #: ../data/currencies.xml.in.h:497 msgid "ar:BYN" msgstr "" #: ../data/currencies.xml.in.h:498 msgid "Belarus" msgstr "" #: ../data/currencies.xml.in.h:499 msgid "Zambian Kwacha" msgstr "" #: ../data/currencies.xml.in.h:500 msgid "ar:ZMW" msgstr "" #: ../data/currencies.xml.in.h:501 msgid "Zambia" msgstr "" #: ../data/currencies.xml.in.h:502 msgid "Mauritanian Ouguiya" msgstr "" #: ../data/currencies.xml.in.h:503 msgid "ar:MRU" msgstr "" #: ../data/currencies.xml.in.h:504 #, fuzzy msgid "Mauritania" msgstr "Mognadsdatum" #: ../data/datasets.xml.in.h:1 msgid "Data Sets" msgstr "Dataset" #. Data set for chemical elements #: ../data/datasets.xml.in.h:3 msgid "!datasets!Elements" msgstr "Grundämnen" #: ../data/datasets.xml.in.h:4 msgid "r:atom" msgstr "" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:6 msgid "!datasets!Element" msgstr "Element" #: ../data/datasets.xml.in.h:7 msgid "Symbol" msgstr "Symbol" #: ../data/datasets.xml.in.h:8 msgid "r:symbol" msgstr "" #. Chemical elements number #: ../data/datasets.xml.in.h:10 msgid "!datasets!Number" msgstr "Nummer" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "nummer" #: ../data/datasets.xml.in.h:13 ../data/functions.xml.in.h:647 msgid "Name" msgstr "Namn" #: ../data/datasets.xml.in.h:14 msgid "r:name" msgstr "namn" #: ../data/datasets.xml.in.h:15 msgid "Classification" msgstr "Klassificering" #: ../data/datasets.xml.in.h:16 msgid "" "A number representing an element group: 1 Alkali Metal 2 Alkaline-" "Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 " "Metal 7 Metalloid 8 Polyatomic Non-Metal 9 Diatomic Non-" "Metal 10 Noble Gas 11 Unknown chemical properties" msgstr "" "Ett nummer som representerar en elementgrupp: 1 Alkalimetall 2 " "Jordalkalimetall 3 Lantanid 4 Aktinid 5 ÖvergÃ¥ngsmetall 6 " "Metall 7 Halvmetall 8 Polyatomisk icke-metall 9 Diatomisk icke-" "metall 10 Ädelgas 11 Okända kemiska egenskaper" #: ../data/datasets.xml.in.h:17 msgid "r:class" msgstr "klass" #: ../data/datasets.xml.in.h:18 ../data/functions.xml.in.h:414 msgid "Weight" msgstr "Vikt" #: ../data/datasets.xml.in.h:19 msgid "r:weight,mass" msgstr "vikt,massa" #: ../data/datasets.xml.in.h:20 msgid "Boiling Point" msgstr "Kokpunkt" #: ../data/datasets.xml.in.h:21 msgid "r:boiling" msgstr "kokpunkt" #: ../data/datasets.xml.in.h:22 msgid "Melting Point" msgstr "Smältpunkt" #: ../data/datasets.xml.in.h:23 msgid "r:melting" msgstr "smältpunkt" #: ../data/datasets.xml.in.h:24 ../data/units.xml.in.h:117 msgid "Density" msgstr "Densitet" #: ../data/datasets.xml.in.h:25 msgid "Density at 295K" msgstr "Densitet vid 295K" #: ../data/datasets.xml.in.h:26 msgid "r:density" msgstr "densitet" #: ../data/datasets.xml.in.h:27 msgid "X Position" msgstr "" #: ../data/datasets.xml.in.h:28 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:29 msgid "Y Position" msgstr "" #: ../data/datasets.xml.in.h:30 msgid "r:y_pos" msgstr "" #: ../data/datasets.xml.in.h:31 msgid "Planets" msgstr "Planeter" #: ../data/datasets.xml.in.h:32 msgid "r:planet" msgstr "" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "" #: ../data/datasets.xml.in.h:34 msgid "Orbital Period (Year)" msgstr "Omkretstid (Ã¥r)" #. Orbital period for planet #: ../data/datasets.xml.in.h:36 msgid "!datasets!r:year" msgstr "Ã¥r" #: ../data/datasets.xml.in.h:37 msgid "Average Orbital Speed" msgstr "Genomsnittlig kretsloppshastighet" #: ../data/datasets.xml.in.h:38 msgid "r:speed" msgstr "hastighet" #: ../data/datasets.xml.in.h:39 msgid "Eccentricity" msgstr "Excentricitet" #: ../data/datasets.xml.in.h:40 msgid "r:eccentricity" msgstr "excentricitet" #: ../data/datasets.xml.in.h:41 msgid "Inclination" msgstr "Inklination" #: ../data/datasets.xml.in.h:42 msgid "r:inclination" msgstr "inklination" #: ../data/datasets.xml.in.h:43 msgid "Number of Satellites" msgstr "Antal satelliter" #: ../data/datasets.xml.in.h:44 msgid "r:satellites" msgstr "satelliter" #. Planet mass #: ../data/datasets.xml.in.h:46 msgid "!datasets!Mass" msgstr "Massa" #: ../data/datasets.xml.in.h:47 msgid "r:mass" msgstr "massa" #: ../data/datasets.xml.in.h:48 msgid "Mean Density" msgstr "Genomsnittlig densitet" #: ../data/datasets.xml.in.h:49 msgid "Surface Area" msgstr "Ytarea" #. Surface area of planet #: ../data/datasets.xml.in.h:51 msgid "!datasets!r:area" msgstr "" #: ../data/datasets.xml.in.h:52 msgid "Equatorial Gravity" msgstr "Ekvatoriell tyngdkraft" #: ../data/datasets.xml.in.h:53 msgid "r:gravity" msgstr "tyngdkraft" #: ../data/datasets.xml.in.h:54 msgid "Mean Surface Temperature" msgstr "Genomsnittlig yttemperatur" #: ../data/datasets.xml.in.h:55 msgid "r:temperature" msgstr "temperatur" #: ../data/elements.xml.in.h:1 msgid "Hydrogen" msgstr "Väte" #: ../data/elements.xml.in.h:2 msgid "Helium" msgstr "" #: ../data/elements.xml.in.h:3 msgid "Lithium" msgstr "Litium" #: ../data/elements.xml.in.h:4 msgid "Beryllium" msgstr "" #: ../data/elements.xml.in.h:5 msgid "Boron" msgstr "Bor" #: ../data/elements.xml.in.h:6 msgid "Carbon" msgstr "Kol" #: ../data/elements.xml.in.h:7 msgid "Nitrogen" msgstr "Kväve" #: ../data/elements.xml.in.h:8 msgid "Oxygen" msgstr "Syre" #: ../data/elements.xml.in.h:9 msgid "Fluorine" msgstr "Fluor" #: ../data/elements.xml.in.h:10 msgid "Neon" msgstr "" #: ../data/elements.xml.in.h:11 msgid "Sodium" msgstr "Natrium" #: ../data/elements.xml.in.h:12 msgid "Magnesium" msgstr "" #: ../data/elements.xml.in.h:13 msgid "Aluminum" msgstr "Aluminium" #: ../data/elements.xml.in.h:14 msgid "Silicon" msgstr "Kisel" #: ../data/elements.xml.in.h:15 msgid "Phosphorus" msgstr "Fosfor" #: ../data/elements.xml.in.h:16 msgid "Sulfur" msgstr "Svavel" #: ../data/elements.xml.in.h:17 msgid "Chlorine" msgstr "Klor" #: ../data/elements.xml.in.h:18 msgid "Argon" msgstr "" #: ../data/elements.xml.in.h:19 msgid "Potassium" msgstr "Kalium" #: ../data/elements.xml.in.h:20 msgid "Calcium" msgstr "Kalcium" #: ../data/elements.xml.in.h:21 msgid "Scandium" msgstr "Skandium" #: ../data/elements.xml.in.h:22 msgid "Titanium" msgstr "Titan" #: ../data/elements.xml.in.h:23 msgid "Vanadium" msgstr "Vanadin" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "Krom" #: ../data/elements.xml.in.h:25 msgid "Manganese" msgstr "Mangan" #: ../data/elements.xml.in.h:26 msgid "Iron" msgstr "Järn" #: ../data/elements.xml.in.h:27 msgid "Cobalt" msgstr "Kobolt" #: ../data/elements.xml.in.h:28 msgid "Nickel" msgstr "" #: ../data/elements.xml.in.h:29 msgid "Copper" msgstr "Koppar" #: ../data/elements.xml.in.h:30 msgid "Zinc" msgstr "Zink" #: ../data/elements.xml.in.h:31 msgid "Gallium" msgstr "" #: ../data/elements.xml.in.h:32 msgid "Germanium" msgstr "" #: ../data/elements.xml.in.h:33 msgid "Arsenic" msgstr "Arsenik" #: ../data/elements.xml.in.h:34 msgid "Selenium" msgstr "Selen" #: ../data/elements.xml.in.h:35 msgid "Bromine" msgstr "Brom" #: ../data/elements.xml.in.h:36 msgid "Krypton" msgstr "" #: ../data/elements.xml.in.h:37 msgid "Rubidium" msgstr "" #: ../data/elements.xml.in.h:38 msgid "Strontium" msgstr "" #: ../data/elements.xml.in.h:39 msgid "Yttrium" msgstr "" #: ../data/elements.xml.in.h:40 msgid "Zirconium" msgstr "Zirkonium" #: ../data/elements.xml.in.h:41 msgid "Niobium" msgstr "Niob" #: ../data/elements.xml.in.h:42 msgid "Molybdenum" msgstr "Molybden" #: ../data/elements.xml.in.h:43 msgid "Technetium" msgstr "Teknetium" #: ../data/elements.xml.in.h:44 msgid "Ruthenium" msgstr "Rutenium" #: ../data/elements.xml.in.h:45 msgid "Rhodium" msgstr "Rodium" #: ../data/elements.xml.in.h:46 msgid "Palladium" msgstr "" #: ../data/elements.xml.in.h:47 msgid "Silver" msgstr "" #: ../data/elements.xml.in.h:48 msgid "Cadmium" msgstr "Kadmium" #: ../data/elements.xml.in.h:49 msgid "Indium" msgstr "" #: ../data/elements.xml.in.h:50 msgid "Tin" msgstr "Tenn" #: ../data/elements.xml.in.h:51 msgid "Antimony" msgstr "Antimon" #: ../data/elements.xml.in.h:52 msgid "Tellurium" msgstr "Tellur" #: ../data/elements.xml.in.h:53 msgid "Iodine" msgstr "Jod" #: ../data/elements.xml.in.h:54 msgid "Xenon" msgstr "" #: ../data/elements.xml.in.h:55 msgid "Cesium" msgstr "" #: ../data/elements.xml.in.h:56 msgid "Barium" msgstr "" #: ../data/elements.xml.in.h:57 msgid "Lanthanum" msgstr "Lantan" #: ../data/elements.xml.in.h:58 msgid "Cerium" msgstr "" #: ../data/elements.xml.in.h:59 msgid "Praseodymium" msgstr "Praseodym" #: ../data/elements.xml.in.h:60 msgid "Neodymium" msgstr "Neodym" #: ../data/elements.xml.in.h:61 msgid "Promethium" msgstr "Prometium" #: ../data/elements.xml.in.h:62 msgid "Samarium" msgstr "" #: ../data/elements.xml.in.h:63 msgid "Europium" msgstr "" #: ../data/elements.xml.in.h:64 msgid "Gadolinium" msgstr "Gadolinium guld" #: ../data/elements.xml.in.h:65 msgid "Terbium" msgstr "" #: ../data/elements.xml.in.h:66 msgid "Dysprosium" msgstr "" #: ../data/elements.xml.in.h:67 msgid "Holmium" msgstr "" #: ../data/elements.xml.in.h:68 msgid "Erbium" msgstr "" #: ../data/elements.xml.in.h:69 msgid "Thulium" msgstr "Tulium" #: ../data/elements.xml.in.h:70 msgid "Ytterbium" msgstr "" #: ../data/elements.xml.in.h:71 msgid "Lutetium" msgstr "" #: ../data/elements.xml.in.h:72 msgid "Hafnium" msgstr "" #: ../data/elements.xml.in.h:73 msgid "Tantalum" msgstr "Tantal" #: ../data/elements.xml.in.h:74 msgid "Tungsten" msgstr "Volfram" #: ../data/elements.xml.in.h:75 msgid "Rhenium" msgstr "" #: ../data/elements.xml.in.h:76 msgid "Osmium" msgstr "" #: ../data/elements.xml.in.h:77 msgid "Iridium" msgstr "" #: ../data/elements.xml.in.h:78 msgid "Platinum" msgstr "Platina" #: ../data/elements.xml.in.h:79 msgid "Gold" msgstr "Guld" #. Chemical element #: ../data/elements.xml.in.h:81 msgid "!elements!Mercury" msgstr "Kvicksilver" #: ../data/elements.xml.in.h:82 msgid "Thallium" msgstr "Tallium" #: ../data/elements.xml.in.h:83 msgid "Lead" msgstr "Bly" #: ../data/elements.xml.in.h:84 msgid "Bismuth" msgstr "Vismut" #: ../data/elements.xml.in.h:85 msgid "Polonium" msgstr "" #: ../data/elements.xml.in.h:86 msgid "Astatine" msgstr "Astat" #: ../data/elements.xml.in.h:87 msgid "Radon" msgstr "" #: ../data/elements.xml.in.h:88 msgid "Francium" msgstr "" #: ../data/elements.xml.in.h:89 msgid "Radium" msgstr "" #: ../data/elements.xml.in.h:90 msgid "Actinium" msgstr "Aktinium" #: ../data/elements.xml.in.h:91 msgid "Thorium" msgstr "Torium" #: ../data/elements.xml.in.h:92 msgid "Protactinium" msgstr "Protaktinium" #: ../data/elements.xml.in.h:93 msgid "Uranium" msgstr "Uran" #: ../data/elements.xml.in.h:94 msgid "Neptunium" msgstr "" #: ../data/elements.xml.in.h:95 msgid "Plutonium" msgstr "" #: ../data/elements.xml.in.h:96 msgid "Americium" msgstr "" #: ../data/elements.xml.in.h:97 msgid "Curium" msgstr "" #: ../data/elements.xml.in.h:98 msgid "Berkelium" msgstr "" #: ../data/elements.xml.in.h:99 msgid "Californium" msgstr "" #: ../data/elements.xml.in.h:100 msgid "Einsteinium" msgstr "" #: ../data/elements.xml.in.h:101 msgid "Fermium" msgstr "" #: ../data/elements.xml.in.h:102 msgid "Mendelevium" msgstr "" #: ../data/elements.xml.in.h:103 msgid "Nobelium" msgstr "" #: ../data/elements.xml.in.h:104 msgid "Lawrencium" msgstr "" #: ../data/elements.xml.in.h:105 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:106 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Copernicium" msgstr "" #: ../data/elements.xml.in.h:114 msgid "Nihonium" msgstr "" #: ../data/elements.xml.in.h:115 msgid "Flerovium" msgstr "" #: ../data/elements.xml.in.h:116 msgid "Moscovium" msgstr "" #: ../data/elements.xml.in.h:117 msgid "Livermorium" msgstr "" #: ../data/elements.xml.in.h:118 msgid "Tennessine" msgstr "" #: ../data/elements.xml.in.h:119 msgid "Oganesson" msgstr "" #: ../data/functions.xml.in.h:1 msgid "Matrices & Vectors" msgstr "Matriser & Vektorer" #: ../data/functions.xml.in.h:2 msgid "Construct Vector" msgstr "Skapa vektor" #: ../data/functions.xml.in.h:3 msgid "r:vector" msgstr "vektor" #: ../data/functions.xml.in.h:4 msgid "Returns a vector with listed elements." msgstr "Returnerar en vektor med listade element." #. Vector/matrix elements #: ../data/functions.xml.in.h:6 msgid "Elements" msgstr "Antal element" #: ../data/functions.xml.in.h:7 msgid "Generate Vector" msgstr "Generera vektor" #: ../data/functions.xml.in.h:8 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:9 msgid "" "Returns a vector generated from a function with a variable (default x) " "running from min to max. The fourth argument is either the requested number " "of elements if the sixth argument is false (default) or the step between " "each value of the variable." msgstr "" "Returnerar en vektor skapad frÃ¥n en funktion med en variabel (förvald: x) " "som gÃ¥r frÃ¥n min till max. Den fjärde parametern är antingen det " "efterfrÃ¥gade antalet element, om det sjätte argumentet är falskt (förvalt), " "eller steget mellan varje värde för variabeln." #: ../data/functions.xml.in.h:10 msgid "Function" msgstr "Funktion" #: ../data/functions.xml.in.h:11 msgid "Min" msgstr "Min" #: ../data/functions.xml.in.h:12 msgid "Max" msgstr "Max" #: ../data/functions.xml.in.h:13 msgid "Dimension / Step size" msgstr "Dimension / stegstorlek" #: ../data/functions.xml.in.h:14 msgid "Variable" msgstr "Variabel" #: ../data/functions.xml.in.h:15 msgid "Use step size" msgstr "Använd stegstorlek" #: ../data/functions.xml.in.h:16 msgid "Sort" msgstr "Sortera" #: ../data/functions.xml.in.h:17 msgid "r:sort" msgstr "sortera" #: ../data/functions.xml.in.h:18 msgid "Returns a sorted vector." msgstr "Returnerar en sorterad vektor." #: ../data/functions.xml.in.h:19 msgid "Vector" msgstr "Vektor" #: ../data/functions.xml.in.h:20 msgid "Ascending" msgstr "Stigande" #: ../data/functions.xml.in.h:21 msgid "Rank" msgstr "Rangordna" #: ../data/functions.xml.in.h:22 msgid "r:rank" msgstr "rangordna" #: ../data/functions.xml.in.h:23 msgid "" "Returns a vector with values of elements replaced with their mutual ranks." msgstr "" "Returnerar en vektor med elementens värden ersatta av deras inbördes " "rangordning." #: ../data/functions.xml.in.h:24 msgid "Vector Limits" msgstr "Vektorgränser" #: ../data/functions.xml.in.h:25 msgid "r:limits" msgstr "gränser" #: ../data/functions.xml.in.h:26 msgid "Returns a part of a vector between two positions." msgstr "Returnerar en del av en vektor mellan tvÃ¥ positioner." #: ../data/functions.xml.in.h:27 msgid "Lower limit" msgstr "Undre gräns" #: ../data/functions.xml.in.h:28 msgid "Upper limit" msgstr "Övre gräns" #: ../data/functions.xml.in.h:29 msgid "Dimension" msgstr "Dimension" #: ../data/functions.xml.in.h:30 msgid "r:dimension" msgstr "" #: ../data/functions.xml.in.h:31 msgid "Returns the number of elements in a vector." msgstr "Returnerar antalet element i en vektor." #: ../data/functions.xml.in.h:32 msgid "Merge Vectors" msgstr "SammanslÃ¥ vektorer" #: ../data/functions.xml.in.h:33 msgid "r:mergevectors" msgstr "" #: ../data/functions.xml.in.h:34 msgid "Returns a vector with the elements from two vectors." msgstr "Returnerar en vektor med element frÃ¥n tvÃ¥ vektorer." #: ../data/functions.xml.in.h:35 msgid "Vector 1" msgstr "Vektor 1" #: ../data/functions.xml.in.h:36 msgid "Vector 2" msgstr "Vektor 2" #: ../data/functions.xml.in.h:37 msgid "Construct Matrix" msgstr "Skapa matris" #: ../data/functions.xml.in.h:38 msgid "r:matrix" msgstr "matris" #: ../data/functions.xml.in.h:39 msgid "" "Returns a matrix with specified dimensions and listed elements. Omitted " "elements are set to zero." msgstr "" "Returnerar en matris med specifierat antal rader och kolumner, och angivna " "element. Utelämnade element sätts till noll." #: ../data/functions.xml.in.h:40 msgid "Rows" msgstr "Rader" #: ../data/functions.xml.in.h:41 msgid "Columns" msgstr "Kolumner" #: ../data/functions.xml.in.h:42 msgid "Convert Matrix to Vector" msgstr "Omvandla matris till vektor" #: ../data/functions.xml.in.h:43 msgid "r:matrix2vector" msgstr "" #: ../data/functions.xml.in.h:44 msgid "Puts each element of a matrix in vertical order in a vector." msgstr "Placerar varje element i en matris i vertikal ordning i en vektor." #: ../data/functions.xml.in.h:45 msgid "Matrix" msgstr "Matris" #: ../data/functions.xml.in.h:46 msgid "Matrix Area" msgstr "Matrisarea" #. Matrix area #: ../data/functions.xml.in.h:48 msgid "r:area" msgstr "" #: ../data/functions.xml.in.h:49 msgid "Returns a part of a matrix." msgstr "Returnerar en del av en matris." #: ../data/functions.xml.in.h:50 msgid "Start row" msgstr "Startrad" #: ../data/functions.xml.in.h:51 msgid "Start column" msgstr "Startkolumn" #: ../data/functions.xml.in.h:52 msgid "End row" msgstr "Slutrad" #: ../data/functions.xml.in.h:53 msgid "End column" msgstr "Slutkolumn" #: ../data/functions.xml.in.h:54 msgid "r:rows" msgstr "rader" #: ../data/functions.xml.in.h:55 msgid "Returns the number of rows in a matrix." msgstr "Returnerar antalet rader i en matris." #: ../data/functions.xml.in.h:56 msgid "r:columns" msgstr "kolumner" #: ../data/functions.xml.in.h:57 msgid "Returns the number of columns in a matrix." msgstr "Returner antalet kolumner i en matris." #: ../data/functions.xml.in.h:58 msgid "Extract row as vector" msgstr "Skapa vektor frÃ¥n rad" #: ../data/functions.xml.in.h:59 msgid "r:row" msgstr "rad" #: ../data/functions.xml.in.h:60 msgid "Returns a row in a matrix as a vector." msgstr "Returnerar en rad i en matris som en vektor." #: ../data/functions.xml.in.h:61 msgid "Row" msgstr "Rad" #: ../data/functions.xml.in.h:62 msgid "Extract Column as Vector" msgstr "Extrahera kolumn som vektor" #: ../data/functions.xml.in.h:63 msgid "r:column" msgstr "kolumn" #: ../data/functions.xml.in.h:64 msgid "Returns a column in a matrix as a vector." msgstr "Returnerar en kolumn i en matris som en vektor." #: ../data/functions.xml.in.h:65 msgid "Column" msgstr "Kolumn" #: ../data/functions.xml.in.h:66 msgid "r:elements" msgstr "" #: ../data/functions.xml.in.h:67 msgid "Returns the number of elements in a matrix or vector." msgstr "Returnerar antalet element i en matris eller vektor." #: ../data/functions.xml.in.h:68 msgid "Matrix or vector" msgstr "Matris eller vektor" #. Vector/matrix element #: ../data/functions.xml.in.h:70 msgid "Element" msgstr "Element" #: ../data/functions.xml.in.h:71 msgid "r:element" msgstr "" #: ../data/functions.xml.in.h:72 msgid "" "Returns the element at specified position in a matrix (row and column) or " "vector (index)." msgstr "" "Returnerar elementet pÃ¥ angiven position i en matris (rad och kolumn) eller " "en vektor (index)." #: ../data/functions.xml.in.h:73 msgid "Matrix/vector" msgstr "Matris/vektor" #: ../data/functions.xml.in.h:74 msgid "Row/index" msgstr "Rad/index" #: ../data/functions.xml.in.h:75 msgid "Transpose" msgstr "Transponera" #: ../data/functions.xml.in.h:76 msgid "r:transpose" msgstr "transponera" #: ../data/functions.xml.in.h:77 msgid "Returns the transpose of a matrix." msgstr "Returnerar transponeringen av en matris." #: ../data/functions.xml.in.h:78 msgid "Identity" msgstr "Identitetsmatris" #: ../data/functions.xml.in.h:79 msgid "r:identity" msgstr "identitetsmatris" #: ../data/functions.xml.in.h:80 msgid "" "Returns the identity matrix of a matrix or with specified number of rows/" "columns." msgstr "" "Returnerar identitetsmatrisen för en matris eller med angivet antal rader/" "kolumner." #: ../data/functions.xml.in.h:81 msgid "Matrix or rows/columns" msgstr "Matris eller rader/kolumner" #: ../data/functions.xml.in.h:82 msgid "Determinant" msgstr "Determinanten" #: ../data/functions.xml.in.h:83 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:84 msgid "Calculates the determinant of a matrix." msgstr "Beräknar determinanten för en matris." #: ../data/functions.xml.in.h:85 msgid "Permanent" msgstr "Permanent" #: ../data/functions.xml.in.h:86 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:87 msgid "" "Calculates the permanent of a matrix. The permanent differs from a " "determinant in that all signs in the expansion by minors are taken as " "positive." msgstr "" "Beräknar permanenten av en matris. Permanenten skiljer sig frÃ¥n en " "determinant genom att alla tecken i expansionen sätts som positiva." #: ../data/functions.xml.in.h:88 msgid "Adjugate (Adjoint)" msgstr "Adjungerad matris (Adjunkt)" #: ../data/functions.xml.in.h:89 msgid "r:adj" msgstr "" #: ../data/functions.xml.in.h:90 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "Beräknar den adjungerade matrisen eller adjunkten för en matris." #: ../data/functions.xml.in.h:91 msgid "Cofactor" msgstr "Kofaktor" #: ../data/functions.xml.in.h:92 msgid "r:cofactor" msgstr "kofaktor" #: ../data/functions.xml.in.h:93 msgid "Calculates the cofactor of the element at specified position." msgstr "Beräknar kofaktorn för elementet pÃ¥ angiven position" #: ../data/functions.xml.in.h:94 msgid "Matrix Inverse" msgstr "Matrisinvers" #: ../data/functions.xml.in.h:95 msgid "r:inverse" msgstr "invers" #: ../data/functions.xml.in.h:96 msgid "" "Calculates the inverse of a matrix. The inverse is the matrix that " "multiplied by the original matrix equals the identity matrix (AB = BA = I)." msgstr "" "Beräknar inversen av en matris. Inversen är den matrix som multiplicerad med " "den ursprungliga matrisen är lika med identitetsmatrisen (AB = BA = I)." #: ../data/functions.xml.in.h:97 msgid "Load CSV File" msgstr "Ladda CSV-fil" #: ../data/functions.xml.in.h:98 msgid "r:load" msgstr "ladda" #: ../data/functions.xml.in.h:99 msgid "Returns a matrix imported from a CSV data file." msgstr "Returnerar en matris importerad frÃ¥n en CSV-datafil." #: ../data/functions.xml.in.h:100 msgid "Filename" msgstr "Filnamn" #: ../data/functions.xml.in.h:101 msgid "First data row" msgstr "Första raden med data" #: ../data/functions.xml.in.h:102 msgid "Separator" msgstr "Avskiljare" #: ../data/functions.xml.in.h:103 msgid "Export To CSV File" msgstr "Exportera till CSV-fil" #: ../data/functions.xml.in.h:104 msgid "r:export" msgstr "exportera" #: ../data/functions.xml.in.h:105 msgid "Exports a matrix to a CSV data file." msgstr "Exporterar en matris till en CSV-datafil" #: ../data/functions.xml.in.h:106 msgid "Magnitude" msgstr "Magnitud" #: ../data/functions.xml.in.h:107 msgid "r:magnitude" msgstr "magnutud" #: ../data/functions.xml.in.h:108 msgid "" "Calculates the magnitude of a value. This function returns the same value as " "abs() for all values except vectors." msgstr "" "Beräknar magnituden av ett värde. Funktionen returnerar samma värde som " "abs() för alla värden utom vektorer." #: ../data/functions.xml.in.h:109 msgid "Value" msgstr "Värde" #: ../data/functions.xml.in.h:110 msgid "Hadamard Product" msgstr "Hadamardprodukt" #: ../data/functions.xml.in.h:111 msgid "r:hadamard" msgstr "" #: ../data/functions.xml.in.h:112 msgid "" "Mulitplies each separate element in matrix 1 with the corresponding element " "in matrix 2." msgstr "" "Multiplicerar varje separat element i matris 1 med motsvarande element i " "matrix 2." #: ../data/functions.xml.in.h:113 msgid "Matrix 1" msgstr "Matris 1" #: ../data/functions.xml.in.h:114 msgid "Matrix 2" msgstr "Matris 2" #: ../data/functions.xml.in.h:115 msgid "Entrywise Function" msgstr "Komponentvis funktion" #: ../data/functions.xml.in.h:116 msgid "r:entrywise" msgstr "" #: ../data/functions.xml.in.h:117 msgid "" "Calculates a new matrix or vector using each separate element in matrix/" "vector 1 and the corresponding (in the same row and column) elements in " "matrix/vector 2. An unlimited number of matrices/vectors can be specified, " "with each matrix/vector argument followed by the corresponding variable used " "in the function argument." msgstr "" "Beräknar en ny matris eller vektor utifrÃ¥n varje separat element i matris/" "vektor 1 och motsvarande (i samma rad och kolumnen) element i matris/vektor " "2. Ett obegränsat antal matriser/vektorer kan anges, med varje matris-/" "vektorparameter följd av motsvarande variabel used in the " "functionsparametern." #: ../data/functions.xml.in.h:118 msgid "Matrices/vectors and variables" msgstr "Matriser/vektorer och variabler" #: ../data/functions.xml.in.h:119 msgid "Norm (length)" msgstr "Normal" #: ../data/functions.xml.in.h:120 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:121 msgid "Calculates the norm/length of a vector." msgstr "Beräknar normalen för en vektor." #: ../data/functions.xml.in.h:122 msgid "Cross Product" msgstr "Vektoriell produkt" #: ../data/functions.xml.in.h:123 msgid "r:cross" msgstr "vektoriell" #: ../data/functions.xml.in.h:124 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "Beräknar den vektoriella produkten för tvÃ¥ 3-dimensionella vektorer." #: ../data/functions.xml.in.h:125 msgid "Combinatorics" msgstr "Kombinatorik" #: ../data/functions.xml.in.h:126 msgid "Factorial" msgstr "Fakultet" #: ../data/functions.xml.in.h:127 msgid "" "Calculates the factorial of an integer. Multiplies the argument with every " "lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number " "followed by one exclamation mark." msgstr "" "Beräknar fakulteten för ett heltal. Multiplicerar parametern med varje " "mindre positivt heltal (n(n-1)(n-2)...2*1). Kan ocksÃ¥ skrivas som ett nummer " "följt av ett utropstecken." #: ../data/functions.xml.in.h:128 msgid "r:factorial" msgstr "fakultet" #: ../data/functions.xml.in.h:129 msgid "Double Factorial" msgstr "Dubbelfakultet" #: ../data/functions.xml.in.h:130 msgid "r:factorial2" msgstr "fakultet2" #: ../data/functions.xml.in.h:131 msgid "" "Calculates the double factorial of an integer. Multiplies the argument with " "every second lesser positive integer (n(n-2)(n-4)...). Can also be entered " "as a number followed by two exclamation marks." msgstr "" "Beräknar dubbelfakulteten för ett heltal. Multiplicerar parametern med " "varannan mindre positivt heltal (n(n-2)(n-4)...). Kan ocksÃ¥ skrivas som ett " "nummer följt av tvÃ¥ utropstecken." #: ../data/functions.xml.in.h:132 msgid "Multifactorial" msgstr "Multifakultet" #: ../data/functions.xml.in.h:133 msgid "r:multifactorial" msgstr "multifakultet" #: ../data/functions.xml.in.h:134 msgid "" "Calculates the multifactorial of an integer. Multiplies the argument with " "every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a " "number followed by three or more exclamation marks." msgstr "" "Beräknar multifakulteten för ett heltal. Multiplicerar parametern med varje " "x mindre positivt heltal (n(n-x)(n-2x)...). Kan ocksÃ¥ skrivas som ett nummer " "följt av tre eller fler utropstecken." #: ../data/functions.xml.in.h:135 msgid "Binomial Coefficient" msgstr "Binomial koefficient" #: ../data/functions.xml.in.h:136 msgid "r:binomial" msgstr "" #: ../data/functions.xml.in.h:137 msgid "Exponent" msgstr "Exponent" #: ../data/functions.xml.in.h:138 msgid "Index" msgstr "Index" #: ../data/functions.xml.in.h:139 msgid "Hyperfactorial" msgstr "Hyperfakultet" #: ../data/functions.xml.in.h:140 msgid "r:hyperfactorial" msgstr "hyperfakultet" #: ../data/functions.xml.in.h:141 msgid "" "Calculates the hyperfactorial of an integer. Multiplies the argument raised " "by itself with every lesser positive integer raised by themselves (1^1 * " "2^2 ... n^n)." msgstr "" "Beräknar hyperfakulteten för ett heltal. Multiplicerar parametern upphöjt " "med varje mindre positivt heltal upphöjt dem själva(1^1 * 2^2 ... n^n)." #: ../data/functions.xml.in.h:142 msgid "Superfactorial" msgstr "Superfakultet" #: ../data/functions.xml.in.h:143 msgid "r:superfactorial" msgstr "superfakultet" #: ../data/functions.xml.in.h:144 msgid "" "Calculates the superfactorial of an integer. Multiplies the factorial of the " "argument with the factorial of every lesser positive integer (1! * 2! ... " "n!)." msgstr "" "Beräknar superfakulteten för ett heltal. Mulitplicerar fakulteten av " "parametern med fakulteten för varje mindre positivt heltal (1! * 2! ... n!)." #: ../data/functions.xml.in.h:145 msgid "Permutations (Variations)" msgstr "Permutationer (Variationer)" #: ../data/functions.xml.in.h:146 msgid "r:perm,variations" msgstr "variationer" #: ../data/functions.xml.in.h:147 msgid "" "Returns the number of possible arrangements of an ordered list with a number " "of objects to choose from and a list size. If there are three objects (1, 2 " "and 3) that is put in a list with two positions, the alternatives are [1, " "2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of " "permutations is 6." msgstr "" "Returnerar antalet möjliga arrangemang av en ordnad lista med ett antal " "objekt att välja mellan och en liststorlek. Om det finns tre olika objekt " "(1, 2 och 3) som sätts i en lista med tvÃ¥ positioner, dÃ¥ är möjliga " "alternativ [1, 2], [2, 1], [1, 3], [3, 1], [2, 3] och [3, 2], och därmed är " "antalet permutationer 6." #: ../data/functions.xml.in.h:148 msgid "Objects" msgstr "Objekt" #: ../data/functions.xml.in.h:149 msgid "Size" msgstr "Storlek" #: ../data/functions.xml.in.h:150 msgid "Combinations" msgstr "Kombinationer" #: ../data/functions.xml.in.h:151 msgid "r:comb" msgstr "kombinationer" #: ../data/functions.xml.in.h:152 msgid "" "Returns the number of possible arrangements of an unordered list with a " "number of objects to choose from and a list size. If there are three objects " "(1, 2 and 3) that is put in a list with place for two, the alternatives are " "[1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3." msgstr "" "Returnerar antalet möjliga arrangemang av en oordnad lista med ett antal " "objekt att välja mellan och en liststorlek. Om det finns tre olika objekt " "(1, 2 och 3) som sätts i en lista med plats för tvÃ¥, dÃ¥ är möjliga " "alternativ [1, 2], [1, 3], och [2, 3], och därmed är antalet kombinationer 3." #: ../data/functions.xml.in.h:153 msgid "Derangements" msgstr "Derangemang" #: ../data/functions.xml.in.h:154 msgid "r:derangements" msgstr "derangemang" #: ../data/functions.xml.in.h:155 msgid "" "Returns the number of possible rearrangements of an ordered list, of a " "certain size, where none of the objects are on their original position. If " "the original list is [1, 2, 3], the possible derangements are [2, 3, 1] and " "[3, 1, 2], and thus the number of derangements is 2." msgstr "" "Returnerar antalet möjliga omarrangemang av en ordnad lista, med en viss " "storlek, där inget av objekten är pÃ¥ sin ursprungliga position. Om den " "ursprungliga listan är [1, 2, 3], dÃ¥ är de möjliga omarrangemangen [2, 3, 1] " "och [3, 1, 2], och därmed returneras 2." #: ../data/functions.xml.in.h:156 msgid "Number of elements" msgstr "Antal element" #: ../data/functions.xml.in.h:157 msgid "Number Theory" msgstr "Nummerteori" #: ../data/functions.xml.in.h:158 msgid "Absolute Value" msgstr "Absolut värde" #: ../data/functions.xml.in.h:159 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:160 msgid "Arithmetic" msgstr "Aritmetik" #: ../data/functions.xml.in.h:161 msgid "Signum" msgstr "Sigma" #: ../data/functions.xml.in.h:162 msgid "r:sgn" msgstr "" #. A numerical value #: ../data/functions.xml.in.h:164 msgid "Number" msgstr "Nummer" #: ../data/functions.xml.in.h:165 msgid "Value for zero" msgstr "" #: ../data/functions.xml.in.h:166 msgid "Numerator" msgstr "Täljare" #: ../data/functions.xml.in.h:167 msgid "r:numerator" msgstr "täljare" #: ../data/functions.xml.in.h:168 msgid "Denominator" msgstr "Nämnare" #: ../data/functions.xml.in.h:169 msgid "r:denominator" msgstr "nämnare" #: ../data/functions.xml.in.h:170 msgid "Remainder" msgstr "Rest" #: ../data/functions.xml.in.h:171 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:172 msgid "Modulus" msgstr "Modulus" #: ../data/functions.xml.in.h:173 msgid "r:mod" msgstr "" #: ../data/functions.xml.in.h:174 msgid "Negate" msgstr "Negera" #: ../data/functions.xml.in.h:175 msgid "r:neg" msgstr "" #: ../data/functions.xml.in.h:176 msgid "Reciprocal" msgstr "Reciprok" #: ../data/functions.xml.in.h:177 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:178 msgid "Multiply" msgstr "Multiplicera" #: ../data/functions.xml.in.h:179 msgid "r:multiply" msgstr "multiplicera" #: ../data/functions.xml.in.h:180 msgid "Factors" msgstr "Faktorer" #: ../data/functions.xml.in.h:181 msgid "Add" msgstr "Addera" #: ../data/functions.xml.in.h:182 msgid "r:add" msgstr "addera" #: ../data/functions.xml.in.h:183 msgid "Terms" msgstr "Termer" #: ../data/functions.xml.in.h:184 msgid "Subtract" msgstr "Subtrahera" #: ../data/functions.xml.in.h:185 msgid "r:subtract" msgstr "subtrahera" #: ../data/functions.xml.in.h:186 msgid "Divide" msgstr "Dela" #: ../data/functions.xml.in.h:187 msgid "r:divide" msgstr "dela" #: ../data/functions.xml.in.h:188 msgid "Raise" msgstr "Upphöj" #: ../data/functions.xml.in.h:189 msgid "r:raise" msgstr "upphöj" #: ../data/functions.xml.in.h:190 msgid "Base" msgstr "Bas" #: ../data/functions.xml.in.h:191 msgid "Polynomials" msgstr "Polynomer" #: ../data/functions.xml.in.h:192 msgid "Coefficient" msgstr "Koefficient" #: ../data/functions.xml.in.h:193 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:194 msgid "Polynomial" msgstr "Polynom" #: ../data/functions.xml.in.h:195 msgid "Leading Coefficient" msgstr "Ledande koefficient" #: ../data/functions.xml.in.h:196 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:197 msgid "Trailing Coefficient" msgstr "Avslutande koefficient" #: ../data/functions.xml.in.h:198 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:199 msgid "Polynomial Degree" msgstr "Polynomgrad" #: ../data/functions.xml.in.h:200 msgid "r:degree" msgstr "grad" #: ../data/functions.xml.in.h:201 msgid "Lowest Degree (Valuation)" msgstr "Lägsta grad (valuering)" #: ../data/functions.xml.in.h:202 msgid "r:ldegree" msgstr "" #: ../data/functions.xml.in.h:203 msgid "Content Part" msgstr "InnehÃ¥llsdel" #: ../data/functions.xml.in.h:204 msgid "r:pcontent" msgstr "" #: ../data/functions.xml.in.h:205 msgid "Primitive Part" msgstr "Primitiv del" #: ../data/functions.xml.in.h:206 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:207 msgid "Unit Part" msgstr "Enhetsdel" #: ../data/functions.xml.in.h:208 msgid "r:punit" msgstr "" #: ../data/functions.xml.in.h:209 msgid "Greatest Common Divisor" msgstr "Största gemensamma delare" #: ../data/functions.xml.in.h:210 msgid "r:gcd" msgstr "" #: ../data/functions.xml.in.h:211 msgid "1st value" msgstr "1:a värdet" #: ../data/functions.xml.in.h:212 msgid "2nd value" msgstr "2:a värdet" #: ../data/functions.xml.in.h:213 msgid "Least Common Multiple" msgstr "Minsta gemensamma multipel" #: ../data/functions.xml.in.h:214 msgid "r:lcm" msgstr "" #: ../data/functions.xml.in.h:215 msgid "Fibonacci Number" msgstr "Fibonaccital" #: ../data/functions.xml.in.h:216 msgid "r:fibonacci" msgstr "" #: ../data/functions.xml.in.h:217 msgid "Returns the n-th term of the Fibonacci sequence." msgstr "Returnerar tal n i Fibonaccis talföljd." #: ../data/functions.xml.in.h:218 msgid "Index (n)" msgstr "Index (n)" #: ../data/functions.xml.in.h:219 msgid "Rounding" msgstr "Avrundning" #: ../data/functions.xml.in.h:220 msgid "Round" msgstr "Avrunda" #: ../data/functions.xml.in.h:221 msgid "r:round" msgstr "avrunda" #: ../data/functions.xml.in.h:222 msgid "Round Downwards" msgstr "Avrunda nerÃ¥t" #: ../data/functions.xml.in.h:223 msgid "r:floor" msgstr "golv" #: ../data/functions.xml.in.h:224 msgid "Round Upwards" msgstr "Avrunda uppÃ¥t" #: ../data/functions.xml.in.h:225 msgid "r:ceil" msgstr "tak" #: ../data/functions.xml.in.h:226 msgid "Round Towards Zero" msgstr "Avrunda mot noll" #: ../data/functions.xml.in.h:227 msgid "r:trunc" msgstr "" #: ../data/functions.xml.in.h:228 msgid "Extract Integer Part" msgstr "Extrahera heltal" #: ../data/functions.xml.in.h:229 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:230 msgid "Extract Fractional Part" msgstr "Extrahera brÃ¥kdel" #: ../data/functions.xml.in.h:231 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:232 msgid "Number Bases" msgstr "Talbaser" #: ../data/functions.xml.in.h:233 msgid "Number Base" msgstr "Talbas" #: ../data/functions.xml.in.h:234 msgid "r:base" msgstr "bas" #: ../data/functions.xml.in.h:235 msgid "" "Returns an value from an expression using a specified base between 2 and 36" msgstr "Returnerar ett värde frÃ¥n ett uttryck med angiven bas mellan 2 och 36." #: ../data/functions.xml.in.h:236 msgid "Binary" msgstr "Binär" #: ../data/functions.xml.in.h:237 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:238 msgid "" "Returns a value from a binary expression. If two's complement is true, " "numbers beginning with '1' is interpreted as negative binary numbers using " "two's complement." msgstr "" "Returnerar ett värde frÃ¥n ett binärt uttryck. Om tvÃ¥komplementsform är sant, " "kommer tal som börjar med '1' att tolkas som negative binära tal som " "använder tvÃ¥komplementsform." #: ../data/functions.xml.in.h:239 msgid "Binary number" msgstr "Binärt nummer" #: ../data/functions.xml.in.h:240 msgid "Two's complement" msgstr "TvÃ¥komplementsform" #: ../data/functions.xml.in.h:241 msgid "Octal" msgstr "Oktal" #: ../data/functions.xml.in.h:242 msgid "r:oct" msgstr "okt" #: ../data/functions.xml.in.h:243 msgid "Returns a value from an octal expression." msgstr "Returnerar ett värde frÃ¥n ett oktalt uttryck." #: ../data/functions.xml.in.h:244 msgid "Octal number" msgstr "Oktalt nummer" #: ../data/functions.xml.in.h:245 msgid "Hexadecimal" msgstr "Hexadecimal" #: ../data/functions.xml.in.h:246 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:247 msgid "Returns a value from a hexadecimal expression." msgstr "Returnerar ett värde frÃ¥n ett hexadecimalt uttryck." #: ../data/functions.xml.in.h:248 msgid "Hexadecimal number" msgstr "Hexadecimalt nummer" #: ../data/functions.xml.in.h:249 msgid "Integers" msgstr "Heltal" #: ../data/functions.xml.in.h:250 msgid "Even" msgstr "Jämnt" #: ../data/functions.xml.in.h:251 msgid "r:even" msgstr "jämn" #: ../data/functions.xml.in.h:252 msgid "Odd" msgstr "Ojämnt" #: ../data/functions.xml.in.h:253 msgid "r:odd" msgstr "udda" #: ../data/functions.xml.in.h:254 msgid "Step Functions" msgstr "SprÃ¥ngfunktioner" #: ../data/functions.xml.in.h:255 msgid "Heaviside Step Function" msgstr "Heavisides stegfunktion" #: ../data/functions.xml.in.h:256 msgid "r:heaviside,au:θ" msgstr "" #: ../data/functions.xml.in.h:257 msgid "" "Discontinuous function also known as \"unit step function\". Returns 0 if x " "< 0, 1 if x > 0, and 1/2 if x = 0." msgstr "" "Stegfunktion även kallad \"enhetsstegfunktion\". Returnerar 0 om x < 0, 1 " "om x > 0, och 1/2 om x = 0." #: ../data/functions.xml.in.h:258 msgid "Dirac Delta Function" msgstr "Diracs deltafunktion" #: ../data/functions.xml.in.h:259 msgid "r:dirac,au:δ" msgstr "" #: ../data/functions.xml.in.h:260 msgid "Returns 0 if x is non-zero, and infinity if x is zero." msgstr "Returnerar 0 om x inte är noĺl, och oändlighet om x är noll." #: ../data/functions.xml.in.h:261 msgid "Ramp Function" msgstr "Rampfunktion" #: ../data/functions.xml.in.h:262 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:263 msgid "Rectangular Function" msgstr "Rektangulär funktion" #: ../data/functions.xml.in.h:264 msgid "r:rectangular" msgstr "rektangulär" #: ../data/functions.xml.in.h:265 msgid "Sigmoid Function" msgstr "Sigmoidfunktion" #: ../data/functions.xml.in.h:266 msgid "r:sigmoid" msgstr "" #: ../data/functions.xml.in.h:267 msgid "Logit Transformation" msgstr "Logit transformation" #: ../data/functions.xml.in.h:268 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:269 msgid "Triangular Function" msgstr "Triangulär funktion" #: ../data/functions.xml.in.h:270 msgid "r:triangular" msgstr "triangulär" #: ../data/functions.xml.in.h:271 msgid "Special Functions" msgstr "Speciella funktioner" #: ../data/functions.xml.in.h:272 msgid "Gamma Function" msgstr "Gammafunktion" #: ../data/functions.xml.in.h:273 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:274 msgid "Digamma Function" msgstr "Digammafunktion" #: ../data/functions.xml.in.h:275 msgid "r:digamma,psi" msgstr "" #: ../data/functions.xml.in.h:276 msgid "Beta Function" msgstr "Betafunktion" #: ../data/functions.xml.in.h:277 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:278 msgid "Error Function" msgstr "Felfunktion" #: ../data/functions.xml.in.h:279 msgid "r:erf" msgstr "" #: ../data/functions.xml.in.h:280 msgid "Complementary Error Function" msgstr "Komplementära felfunktionen" #: ../data/functions.xml.in.h:281 msgid "r:erfc" msgstr "" #: ../data/functions.xml.in.h:282 msgid "Polylogarithm" msgstr "Polylogaritm" #: ../data/functions.xml.in.h:283 msgid "rc:Li,polylog" msgstr "" #: ../data/functions.xml.in.h:284 msgid "Order" msgstr "Ordning" #: ../data/functions.xml.in.h:285 msgid "Argument" msgstr "" #: ../data/functions.xml.in.h:286 msgid "Airy Function" msgstr "Airyfunktion" #: ../data/functions.xml.in.h:287 msgid "r:airy" msgstr "" #: ../data/functions.xml.in.h:288 msgid "Bessel Function of the First Kind" msgstr "Besselfunktion av det första slaget" #: ../data/functions.xml.in.h:289 msgid "r:besselj" msgstr "" #: ../data/functions.xml.in.h:290 msgid "Bessel Function of the Second Kind" msgstr "Besselfunktion av det andra slaget" #: ../data/functions.xml.in.h:291 msgid "r:bessely" msgstr "" #: ../data/functions.xml.in.h:292 msgid "Riemann Zeta" msgstr "Riemanns Zeta" #: ../data/functions.xml.in.h:293 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:294 msgid "Integral point" msgstr "Integralpunkt" #: ../data/functions.xml.in.h:295 msgid "Kronecker Delta" msgstr "Kroneckerdelta" #: ../data/functions.xml.in.h:296 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:297 msgid "Returns 0 if i != j and 1 if i = j." msgstr "Returnerar 0 om i != j och 1 if i = j." #: ../data/functions.xml.in.h:298 msgid "Value 1 (i)" msgstr "Värde 1 (i)" #: ../data/functions.xml.in.h:299 msgid "Value 2 (j)" msgstr "Värde 2 (j)" #: ../data/functions.xml.in.h:300 msgid "Complex Numbers" msgstr "Komplexa tal" #: ../data/functions.xml.in.h:301 msgid "Real Part" msgstr "Reell del" #: ../data/functions.xml.in.h:302 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:303 msgid "Complex number" msgstr "Komplext nummer" #: ../data/functions.xml.in.h:304 msgid "Imaginary Part" msgstr "Imaginär del" #: ../data/functions.xml.in.h:305 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:306 msgid "Principal Argument" msgstr "Principialargument" #: ../data/functions.xml.in.h:307 msgid "r:arg" msgstr "" #: ../data/functions.xml.in.h:308 msgid "Complex Conjugate" msgstr "Komplexkonjugat" #: ../data/functions.xml.in.h:309 msgid "r:conj" msgstr "" #: ../data/functions.xml.in.h:310 msgid "Exponents & Logarithms" msgstr "Exponenter & Logaritmer" #: ../data/functions.xml.in.h:311 msgid "Square Root" msgstr "Kvadratrot" #: ../data/functions.xml.in.h:312 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:313 msgid "" "Returns the principal square root (for positive values the positive root is " "returned)." msgstr "" "Returnerar principalkvadratroten (för positiva värden returneras den " "positiva roten)." #: ../data/functions.xml.in.h:314 msgid "Cube Root" msgstr "Kubikrot" #: ../data/functions.xml.in.h:315 msgid "au:∛,r:cbrt" msgstr "" #: ../data/functions.xml.in.h:316 msgid "Returns the third real root." msgstr "Returnerar den tredje reella roten." #: ../data/functions.xml.in.h:317 msgid "Nth root" msgstr "N:te roten" #: ../data/functions.xml.in.h:318 msgid "r:root" msgstr "rot" #: ../data/functions.xml.in.h:319 msgid "" "Returns the real root. For negative values the degree must be odd. Complex " "values are not allowed." msgstr "" "Returnerar den reella roten. För negativa värden krävs en udda grad. " "Komplexa värden är inte tillÃ¥tna." #: ../data/functions.xml.in.h:320 ../data/units.xml.in.h:61 msgid "Degree" msgstr "Grad" #: ../data/functions.xml.in.h:321 msgid "Square" msgstr "Kvadrat" #: ../data/functions.xml.in.h:322 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:323 msgid "Exponential (e^x)" msgstr "Exponentialfunktion (e^x)" #: ../data/functions.xml.in.h:324 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:325 msgid "Natural Logarithm" msgstr "Naturlig logaritm" #: ../data/functions.xml.in.h:326 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:327 msgid "Base-N Logarithm" msgstr "Bas-N-logaritm" #: ../data/functions.xml.in.h:328 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:329 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "Lambers W-funktion (Omegafunktionen)" #: ../data/functions.xml.in.h:330 msgid "r:lambertw,productlog" msgstr "" #: ../data/functions.xml.in.h:331 msgid "" "Returns the inverse function for mx*e^x as ln() does for e^x. Only the " "principal branch and real valued results are currently supported." msgstr "" "Returnerar den inverterade funktionen för mx*e^x sÃ¥som ln() gör för e^x. " "Enbart principalgrenen och värden som ger reeala result stöds för " "närvarande. " #: ../data/functions.xml.in.h:332 msgid "Branch" msgstr "Gren" #: ../data/functions.xml.in.h:333 msgid "Base-2 Logarithm" msgstr "Bas-2-logaritm" #: ../data/functions.xml.in.h:334 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:335 msgid "Returns the base n logarithm." msgstr "Returnerar logaritmen för bas n." #: ../data/functions.xml.in.h:336 msgid "Base-10 Logarithm" msgstr "Bas-10-logaritm" #: ../data/functions.xml.in.h:337 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:338 msgid "Complex Exponential (Cis)" msgstr "Komplex exponentialfunction (Cis)" #: ../data/functions.xml.in.h:339 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:340 msgid "2 raised to the power X" msgstr "2 upphöjt med X" #: ../data/functions.xml.in.h:341 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:342 msgid "10 raised to the power X" msgstr "10 upphöjt med X" #: ../data/functions.xml.in.h:343 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:344 msgid "X raised to the power Y" msgstr "X upphöjt med Y" #: ../data/functions.xml.in.h:345 msgid "r:pow" msgstr "upphöj" #: ../data/functions.xml.in.h:346 msgid "Square root (x * pi)" msgstr "Kvadratrot (x * pi)" #: ../data/functions.xml.in.h:347 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:348 msgid "Returns the non-negative square root of x * pi" msgstr "Returnerar icke-negativa kvadratroten av x * pi" #: ../data/functions.xml.in.h:349 msgid "Non-negative value" msgstr "Icke-negativt nummer" #: ../data/functions.xml.in.h:350 msgid "Trigonometry" msgstr "Trigonometri" #: ../data/functions.xml.in.h:351 msgid "Sine" msgstr "Sinus" #: ../data/functions.xml.in.h:352 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:353 msgid "Angle" msgstr "Vinkel" #: ../data/functions.xml.in.h:354 msgid "Cosine" msgstr "Cosinus" #: ../data/functions.xml.in.h:355 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:356 msgid "Tangent" msgstr "Tangens" #: ../data/functions.xml.in.h:357 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:358 msgid "Inverse Sine" msgstr "Invers sinus" #: ../data/functions.xml.in.h:359 msgid "r:asin" msgstr "" #: ../data/functions.xml.in.h:360 msgid "Inverse Cosine" msgstr "Invers cosinus" #: ../data/functions.xml.in.h:361 msgid "r:acos" msgstr "" #: ../data/functions.xml.in.h:362 msgid "Inverse Tangent" msgstr "Invers tangens" #: ../data/functions.xml.in.h:363 msgid "r:atan" msgstr "" #: ../data/functions.xml.in.h:364 msgid "Hyperbolic Sine" msgstr "Sinus hyperbolicus" #: ../data/functions.xml.in.h:365 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:366 msgid "Hyperbolic Cosine" msgstr "Cosinus hyperbolicus" #: ../data/functions.xml.in.h:367 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:368 msgid "Hyperbolic Tangent" msgstr "Tangens hyperbolicus" #: ../data/functions.xml.in.h:369 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:370 msgid "Inverse Hyperbolic Sine" msgstr "Invers sinus hyperbolicus" #: ../data/functions.xml.in.h:371 msgid "r:asinh" msgstr "" #: ../data/functions.xml.in.h:372 msgid "Inverse Hyperbolic Cosine" msgstr "Invers cosinus hyperbolicus" #: ../data/functions.xml.in.h:373 msgid "r:acosh" msgstr "" #: ../data/functions.xml.in.h:374 msgid "Inverse Hyperbolic Tangent" msgstr "Invers tangens hyperbolicus" #: ../data/functions.xml.in.h:375 msgid "r:atanh" msgstr "" #: ../data/functions.xml.in.h:376 msgid "Four-quadrant Inverse Tangent" msgstr "Fyra kvadranters invers tangens" #: ../data/functions.xml.in.h:377 msgid "r:atan2" msgstr "" #: ../data/functions.xml.in.h:378 msgid "" "Computes the principal value of the argument function applied to the complex " "number x+iy." msgstr "" "Beräknar principalvärdet för argumentfunktionen applicerad pÃ¥ det komplex " "talet x+iy." #: ../data/functions.xml.in.h:379 msgid "Y" msgstr "" #: ../data/functions.xml.in.h:380 msgid "X" msgstr "X" #: ../data/functions.xml.in.h:381 msgid "Cardinal Sine (Sinc Function)" msgstr "Sinc-funktionen" #: ../data/functions.xml.in.h:382 msgid "r:sinc" msgstr "" #: ../data/functions.xml.in.h:383 msgid "Radians to Default Angle Unit" msgstr "Radians till färvald vinkelenhet" #: ../data/functions.xml.in.h:384 msgid "r:radtodef" msgstr "" #: ../data/functions.xml.in.h:385 msgid "Radians" msgstr "Radianer" #: ../data/functions.xml.in.h:386 msgid "Secant" msgstr "Sekant" #: ../data/functions.xml.in.h:387 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:388 msgid "Cosecant" msgstr "Cosekant" #: ../data/functions.xml.in.h:389 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:390 msgid "Cotangent" msgstr "Cotangens" #: ../data/functions.xml.in.h:391 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:392 msgid "Hyperbolic Secant" msgstr "Sekant hyperbolicus" #: ../data/functions.xml.in.h:393 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:394 msgid "Hyperbolic Cosecant" msgstr "Cosekant hyperbolicus" #: ../data/functions.xml.in.h:395 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:396 msgid "Hyperbolic Cotangent" msgstr "Cotangens hyperbolicus" #: ../data/functions.xml.in.h:397 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:398 msgid "Inverse Secant" msgstr "Invers sekant" #: ../data/functions.xml.in.h:399 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:400 msgid "Inverse Cosecant" msgstr "Invers cosekant" #: ../data/functions.xml.in.h:401 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:402 msgid "Inverse Cotangent" msgstr "Invers cotangens" #: ../data/functions.xml.in.h:403 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:404 msgid "Inverse Hyperbolic Secant" msgstr "Invers sekant hyperbolicus" #: ../data/functions.xml.in.h:405 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:406 msgid "Inverse Hyperbolic Cosecant" msgstr "Invers cosekant hyperbolicus" #: ../data/functions.xml.in.h:407 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:408 msgid "Inverse Hyperbolic Cotangent" msgstr "Invers cotangens hyperbolicus" #: ../data/functions.xml.in.h:409 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:410 msgid "Miscellaneous" msgstr "Diverse" #: ../data/functions.xml.in.h:411 msgid "Body Mass Index (BMI)" msgstr "" #: ../data/functions.xml.in.h:412 msgid "-r:bmi" msgstr "" #: ../data/functions.xml.in.h:413 msgid "" "Calculates the Body Mass Index. The resulting BMI-value is sometimes " "interpreted as follows (although varies with age, sex, etc.): " "Underweight < 18.5 Normal weight 18.5-25 Overweight 25-30 " "Obesity > 30 Note that you must use units for weight (ex. 59kg) " "and length (ex. 174cm)." msgstr "" "Beräknar BMI (Body Mass Index). Det resulterande BMI-värdet tolkas ibland " "som följer: Undervikt < 18.5 Idealvikt 18.5-25 Övervikt " "25-30 Fetma > 30 Notera att du mÃ¥ste använda enheter för " "vikt (ex. 59kg) och längd (ex. 174cm)." #: ../data/functions.xml.in.h:415 msgid "Length" msgstr "Längd" #: ../data/functions.xml.in.h:416 msgid "Roman Number" msgstr "Romerskt tal" #: ../data/functions.xml.in.h:417 msgid "r:roman" msgstr "" #: ../data/functions.xml.in.h:418 msgid "Returns the value of a roman number." msgstr "Returnerar värdet för romerska siffror." #: ../data/functions.xml.in.h:419 msgid "Roman number" msgstr "Romerskt tal" #: ../data/functions.xml.in.h:420 msgid "Statistics" msgstr "Statistik" #: ../data/functions.xml.in.h:421 msgid "Descriptive Statistics" msgstr "Beskrivande statistik" #: ../data/functions.xml.in.h:422 msgid "Sum (total)" msgstr "Summa (total)" #: ../data/functions.xml.in.h:423 msgid "r:total" msgstr "totalt" #: ../data/functions.xml.in.h:424 msgid "Data" msgstr "Data" #: ../data/functions.xml.in.h:425 msgid "Percentile" msgstr "Percentil" #: ../data/functions.xml.in.h:426 msgid "r:percentile" msgstr "percentil" #: ../data/functions.xml.in.h:428 #, no-c-format msgid "Percentile (%)" msgstr "Percentil (%)" #: ../data/functions.xml.in.h:429 msgid "Quantile Algorithm (as in R)" msgstr "Kvantilalgoritm (som i R)" #: ../data/functions.xml.in.h:430 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:431 msgid "Returns the lowest value." msgstr "Returnerar det lägsta värdet." #: ../data/functions.xml.in.h:432 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:433 msgid "Returns the highest value." msgstr "Returnerar det högsta värdet." #: ../data/functions.xml.in.h:434 msgid "Mode" msgstr "Typvärde" #: ../data/functions.xml.in.h:435 msgid "r:mode" msgstr "typvärde" #: ../data/functions.xml.in.h:436 msgid "Returns the most frequently occurring value." msgstr "Returnerar det mest förekommande värdet." #: ../data/functions.xml.in.h:437 msgid "Range" msgstr "OmfÃ¥ng" #: ../data/functions.xml.in.h:438 msgid "r:range" msgstr "omfÃ¥ng" #: ../data/functions.xml.in.h:439 msgid "Calculates the difference between the min and max value." msgstr "Beräknar skillnaden mellan min och max värdet." #: ../data/functions.xml.in.h:440 msgid "Median" msgstr "Median" #: ../data/functions.xml.in.h:441 msgid "r:median" msgstr "" #: ../data/functions.xml.in.h:442 msgid "Quartile" msgstr "Kvartil" #: ../data/functions.xml.in.h:443 msgid "r:quartile" msgstr "kvartil" #: ../data/functions.xml.in.h:444 msgid "Decile" msgstr "Decil" #: ../data/functions.xml.in.h:445 msgid "r:decile" msgstr "decil" #: ../data/functions.xml.in.h:446 msgid "Interquartile Range" msgstr "KvartilavstÃ¥nd" #: ../data/functions.xml.in.h:447 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:448 msgid "Calculates the difference between the first and third quartile." msgstr "Beräknar skillnaden mellan den första och tredje kvartilen." #: ../data/functions.xml.in.h:449 msgid "Number of Samples" msgstr "Antal" #. Number of samples #: ../data/functions.xml.in.h:451 msgid "r:number" msgstr "antal" #: ../data/functions.xml.in.h:452 msgid "Returns the number of samples." msgstr "Returnerar antalet prov." #: ../data/functions.xml.in.h:453 msgid "Random Number" msgstr "Slumptal" #: ../data/functions.xml.in.h:454 msgid "r:rand" msgstr "slumptal" #: ../data/functions.xml.in.h:455 msgid "" "Generates a pseudo-random number. Returns a real number between 0 and 1, if " "ceil is zero (default), or an integer between 1 and (including) ceil." msgstr "" "Generar ett pseudo-slumpmässigt nummer. Returnerar ett reealt tal mellan 0 " "och 1, om taket är noll (förval), eller ett heltal mellan 1 och (inklusive) " "taket." #: ../data/functions.xml.in.h:456 msgid "Ceil" msgstr "Tak" #: ../data/functions.xml.in.h:457 msgid "Random Number Between Limits" msgstr "Slumptal mellan gränser" #: ../data/functions.xml.in.h:458 msgid "r:randbetween" msgstr "" #: ../data/functions.xml.in.h:459 msgid "Returns an integer between (including) bottom and top." msgstr "Returnerar ett heltal mellan (inklusive) nedre och övre gräns" #: ../data/functions.xml.in.h:460 msgid "Bottom" msgstr "Nedre gräns" #: ../data/functions.xml.in.h:461 msgid "Top" msgstr "Övre gräns" #: ../data/functions.xml.in.h:462 msgid "Means" msgstr "Medelvärde" #: ../data/functions.xml.in.h:463 msgid "Mean" msgstr "Medelvärde" #: ../data/functions.xml.in.h:464 msgid "r:mean,average,au:x̄" msgstr "medel,genomsnitt,au:x̄" #: ../data/functions.xml.in.h:465 msgid "Harmonic Mean" msgstr "Harmoniskt medelvärde" #: ../data/functions.xml.in.h:466 msgid "r:harmmean" msgstr "harmmedel" #: ../data/functions.xml.in.h:467 msgid "Geometric Mean" msgstr "Geometriskt medelvärde" #: ../data/functions.xml.in.h:468 msgid "r:geomean" msgstr "geomedel" #: ../data/functions.xml.in.h:469 msgid "Trimmed Mean" msgstr "Trimmat medelvärde" #: ../data/functions.xml.in.h:470 msgid "r:trimmean" msgstr "" #: ../data/functions.xml.in.h:471 msgid "Trimmed percentage (at each end)" msgstr "Trimmad procent (i bÃ¥da ändarna)" #: ../data/functions.xml.in.h:472 msgid "Winsorized Mean" msgstr "Winsor-medelvärde" #: ../data/functions.xml.in.h:473 msgid "r:winsormean" msgstr "" #: ../data/functions.xml.in.h:474 msgid "Winsorized percentage (at each end)" msgstr "Winsorprocent (i bÃ¥da ändarna)" #: ../data/functions.xml.in.h:475 msgid "Weighted Mean" msgstr "Viktat medelvärde" #: ../data/functions.xml.in.h:476 msgid "r:weighmean" msgstr "" #: ../data/functions.xml.in.h:477 msgid "Weights" msgstr "Vikter" #: ../data/functions.xml.in.h:478 msgid "Quadratic Mean (RMS)" msgstr "Kvadratiskt medelvärde" #: ../data/functions.xml.in.h:479 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:480 msgid "Moments" msgstr "Moment" #: ../data/functions.xml.in.h:481 msgid "Standard Deviation (entire population)" msgstr "Standardavvikelse (komplett population)" #: ../data/functions.xml.in.h:482 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:483 msgid "Standard Deviation (random sampling)" msgstr "Standardavvikelse (slumpmässigt urval)" #: ../data/functions.xml.in.h:484 msgid "r:stdev" msgstr "standardavvikelse" #: ../data/functions.xml.in.h:485 msgid "Variance (entire population)" msgstr "Varians (komplett population)" #: ../data/functions.xml.in.h:486 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:487 msgid "Variance (random sampling)" msgstr "Varians (slumpmässigt urval)" #: ../data/functions.xml.in.h:488 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:489 msgid "Standard Error" msgstr "Standardfel" #: ../data/functions.xml.in.h:490 msgid "r:stderr" msgstr "standardfel" #: ../data/functions.xml.in.h:491 msgid "Mean Deviation" msgstr "Medelavvikelse" #: ../data/functions.xml.in.h:492 msgid "r:meandev" msgstr "medelavvikelse" #: ../data/functions.xml.in.h:493 msgid "Covariance" msgstr "Kovarians" #: ../data/functions.xml.in.h:494 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:495 msgid "Data 1" msgstr "Data 1" #: ../data/functions.xml.in.h:496 msgid "Data 2" msgstr "Data 2" #: ../data/functions.xml.in.h:497 msgid "Pooled Variance" msgstr "Gemensam varians" #: ../data/functions.xml.in.h:498 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:499 msgid "Regression" msgstr "Regression" #: ../data/functions.xml.in.h:500 msgid "Statistical Correlation" msgstr "Statistisk korrelation" #: ../data/functions.xml.in.h:501 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:502 msgid "Pearson's Correlation Coefficient" msgstr "Pearsons korrelationskoefficient" #: ../data/functions.xml.in.h:503 msgid "r:pearson,r:correl" msgstr "korrelation" #: ../data/functions.xml.in.h:504 msgid "Spearman's Rho" msgstr "Spearmans Rho" #: ../data/functions.xml.in.h:505 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:506 msgid "Statistical Tests" msgstr "Statistika tester" #: ../data/functions.xml.in.h:507 msgid "Unpaired T-Test" msgstr "T-test" #: ../data/functions.xml.in.h:508 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:509 msgid "Paired T-Test" msgstr "Parvist t-test" #: ../data/functions.xml.in.h:510 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:511 msgid "Distribution" msgstr "Distribution" #: ../data/functions.xml.in.h:512 msgid "Rayleigh Distribution" msgstr "Rayleighfördelning" #: ../data/functions.xml.in.h:513 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:514 msgid "" "Returns the probability density p(x) at x for a Rayleigh distribution with " "scale parameter sigma. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:515 msgid "Sigma" msgstr "Sigma" #: ../data/functions.xml.in.h:516 msgid "Rayleigh Tail Distribution" msgstr "Rayleighsvansfördelning" #: ../data/functions.xml.in.h:517 msgid "r:rayleightail" msgstr "" #: ../data/functions.xml.in.h:518 msgid "" "Returns the probability density p(x) at x for a Rayleigh tail distribution " "with scale parameter sigma and a lower limit. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:519 msgid "Pareto Distribution" msgstr "Paretofördelning" #: ../data/functions.xml.in.h:520 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:521 msgid "" "Returns the probability density p(x) at x for a Pareto distribution with " "exponent and scale. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:522 msgid "Scale" msgstr "Skala" #: ../data/functions.xml.in.h:523 msgid "Logistic Distribution" msgstr "Logistisk distribution" #: ../data/functions.xml.in.h:524 msgid "r:logistic" msgstr "" #: ../data/functions.xml.in.h:525 msgid "" "Returns the probability density p(x) at x for a logistic distribution with " "scale parameter. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:526 ../data/variables.xml.in.h:173 msgid "Date & Time" msgstr "Datum & Tid" #: ../data/functions.xml.in.h:527 msgid "Construct Date" msgstr "Skapa datum" #: ../data/functions.xml.in.h:528 msgid "r:date" msgstr "datum" #: ../data/functions.xml.in.h:529 msgid "" "Returns a date. Available calendars gregorian (1), hebrew (2), islamic (3), " "persian (4), indian (5), chinese (6), julian (7), milankovic (8), coptic " "(9), ethiopian (10), egyptian (11). The Chinese year uses an epoch of 2697 " "BEC and chinese leap months are indicated by adding 12 to the month number " "(e.g. leap month 4 = 16)." msgstr "" "Returnerar ett datum. Tillgängliga kalendrar är grekorinsk (1), hebreisk " "(2), muslimsk(3), persisk(4), indisk (5), kinesisk (6), juliansk (7), " "milnkovic (8), koptisk (9), etiopisk (10), egyptisk (11). Det kinesiska Ã¥ret " "använder en epok som börjar 2697 f.Kr. och kinesiska skottmÃ¥nader indikeras " "genom att addera 12 till mÃ¥nadens nummer (t.ex. skottmÃ¥nad 4 = 16)." #: ../data/functions.xml.in.h:530 msgid "Year" msgstr "Ã…r" #: ../data/functions.xml.in.h:531 ../data/units.xml.in.h:145 msgid "Month" msgstr "MÃ¥nad" #: ../data/functions.xml.in.h:532 ../data/units.xml.in.h:137 msgid "Day" msgstr "Dag" #: ../data/functions.xml.in.h:533 msgid "Calendar" msgstr "Kalender" #: ../data/functions.xml.in.h:534 msgid "Construct Date and Time" msgstr "Skapa datum och tid" #: ../data/functions.xml.in.h:535 #, fuzzy msgid "r:datetime" msgstr "datum" #: ../data/functions.xml.in.h:536 ../data/units.xml.in.h:135 msgid "Hour" msgstr "Timme" #: ../data/functions.xml.in.h:537 ../data/units.xml.in.h:133 msgid "Minute" msgstr "Minut" #: ../data/functions.xml.in.h:538 ../data/units.xml.in.h:131 msgid "Second" msgstr "Sekund" #: ../data/functions.xml.in.h:539 msgid "Days between two dates" msgstr "Antal dagar mellan tvÃ¥ datum" #: ../data/functions.xml.in.h:540 msgid "r:days" msgstr "dagar" #: ../data/functions.xml.in.h:541 msgid "" "Returns the number of days between two dates. Basis is the type of " "day counting you want to use: 0: US 30/360, 1: real days (default), 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Returnerar antalet dagar mellan tvÃ¥ datum. Dagsräkningssystem kan " "vara: 0: Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga " "dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360" #: ../data/functions.xml.in.h:542 msgid "First date" msgstr "Första datumet" #: ../data/functions.xml.in.h:543 msgid "Second date" msgstr "Andra datumet" #: ../data/functions.xml.in.h:544 msgid "Day counting basis" msgstr "Dagsräkningssystem" #: ../data/functions.xml.in.h:545 msgid "Financial function mode" msgstr "Läge för financiella funktioner" #: ../data/functions.xml.in.h:546 msgid "Years between two dates" msgstr "Antal Ã¥r mellan tvÃ¥ datum" #: ../data/functions.xml.in.h:547 msgid "r:yearfrac" msgstr "" #: ../data/functions.xml.in.h:548 msgid "" "Returns the number of years (fractional) between two dates. Basis " "is the type of day counting you want to use: 0: US 30/360, 1: real days " "(default), 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Returnerar antalet Ã¥r (decimala) mellan tvÃ¥ datum. " "Dagsräkningssystem kan vara: 0: Amerikanskt 30/360, 1: verkliga dagar " "(förvald), 2: verkliga dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt " "30/360" #: ../data/functions.xml.in.h:549 msgid "Week of Year" msgstr "Vecka pÃ¥ Ã¥ret" #: ../data/functions.xml.in.h:550 msgid "r:week" msgstr "vecka" #: ../data/functions.xml.in.h:551 msgid "Date" msgstr "Datum" #: ../data/functions.xml.in.h:552 msgid "Week begins on Sunday" msgstr "Veckor börjar pÃ¥ söndag" #: ../data/functions.xml.in.h:553 msgid "Day of Week" msgstr "Veckodag" #: ../data/functions.xml.in.h:554 msgid "r:weekday" msgstr "veckodag" #: ../data/functions.xml.in.h:555 msgid "r:month" msgstr "mÃ¥nad" #: ../data/functions.xml.in.h:556 msgid "Day of Month" msgstr "MÃ¥nadsdag" #: ../data/functions.xml.in.h:557 msgid "r:day" msgstr "dag" #: ../data/functions.xml.in.h:558 msgid "r:year" msgstr "Ã¥r" #: ../data/functions.xml.in.h:559 msgid "Day of Year" msgstr "Dag pÃ¥ Ã¥ret" #: ../data/functions.xml.in.h:560 msgid "r:yearday" msgstr "Ã¥rsdag" #: ../data/functions.xml.in.h:561 msgid "Current Time" msgstr "Nuvarande tid" #: ../data/functions.xml.in.h:562 msgid "r:time" msgstr "tid" #: ../data/functions.xml.in.h:563 msgid "Time Value" msgstr "Tidsvärde" #: ../data/functions.xml.in.h:564 msgid "r:timevalue" msgstr "tidsvärde" #: ../data/functions.xml.in.h:565 msgid "Returns the time part, in fractional hours, of a date and time value." msgstr "Returnerar tidsdelen, i timmar, för ett datum och tid-värde." #: ../data/functions.xml.in.h:566 msgid "Date to Unix Timestamp" msgstr "Datum till Unixtid" #: ../data/functions.xml.in.h:567 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:568 msgid "Unix Timestamp to Date" msgstr "Unixtid till datum" #: ../data/functions.xml.in.h:569 msgid "r:stamptodate,unix2date" msgstr "" #: ../data/functions.xml.in.h:570 msgid "" "Returns the local date and time represented by the specified Unix timestamp " "(seconds, excluding leap seconds, since 1970-01-01). Supports time units." msgstr "" "Returnerar det lokala datum och tid som representeras av den angivna " "Unixtiden (sekunderar, exklusive skottsekunders, sedan 1970-01-01). " "Tidsenheter stöds." #: ../data/functions.xml.in.h:571 msgid "Timestamp" msgstr "Unixtid" #: ../data/functions.xml.in.h:572 msgid "Add Days" msgstr "Addera dagar" #: ../data/functions.xml.in.h:573 msgid "r:addDays" msgstr "adderaDagar" #: ../data/functions.xml.in.h:574 msgid "Days" msgstr "Dagar" #: ../data/functions.xml.in.h:575 msgid "Add Months" msgstr "Addera mÃ¥nader" #: ../data/functions.xml.in.h:576 msgid "r:addMonths" msgstr "adderaMÃ¥nader" #: ../data/functions.xml.in.h:577 msgid "Months" msgstr "MÃ¥nader" #: ../data/functions.xml.in.h:578 msgid "Add Years" msgstr "Addera Ã¥r" #: ../data/functions.xml.in.h:579 msgid "r:addYears" msgstr "adderaÃ…r" #: ../data/functions.xml.in.h:580 msgid "Years" msgstr "Antal Ã¥r" #: ../data/functions.xml.in.h:581 msgid "Add Time" msgstr "Addera tid" #: ../data/functions.xml.in.h:582 msgid "r:addTime" msgstr "adderaTid" #: ../data/functions.xml.in.h:583 msgid "" "Adds a time value to a date. The value can be positive or negative, but must " "use a unit based on seconds (such as day and year). Fractions of days are " "truncated." msgstr "" "Adderar ett tidsvärde till ett datum. Värdet kan vara positivt eller " "negativt, men mÃ¥ste använda en enhet baserad pÃ¥ sekunder (sÃ¥som dag och Ã¥r). " "Delar av dagar avrundas mot noll." #: ../data/functions.xml.in.h:584 ../data/units.xml.in.h:130 msgid "Time" msgstr "Tid" #: ../data/functions.xml.in.h:585 msgid "Lunar Phase" msgstr "MÃ¥nfas" #: ../data/functions.xml.in.h:586 msgid "r:lunarphase" msgstr "mÃ¥nfas" #: ../data/functions.xml.in.h:587 msgid "" "Returns the lunar phase, as a number between 0 and 1, for the specified " "date. 0 represents new moon, 0.5 full moon, and 0.25 and 0.75 quarter moons." msgstr "" "Returnerar mÃ¥nfasen, som ett nummer mellan 0 och 1, för det angivna datumet. " "0 representerar nymÃ¥ne, 0,5 fullmÃ¥nar, och 0,25 samt 0,75 kvartsmÃ¥nar." #: ../data/functions.xml.in.h:588 msgid "Find Lunar Phase" msgstr "Hitta mÃ¥nfas" #: ../data/functions.xml.in.h:589 msgid "r:nextlunarphase" msgstr "nästamÃ¥nfas" #: ../data/functions.xml.in.h:590 msgid "" "Returns the date when the specified lunar phase occurs. The function " "searches forward beginning at the specified date. The lunar phase are " "specified as a number between 0 and 1, where 0 represents new moon, 0.5 full " "moon, and 0.25 and 0.75 quarter moons." msgstr "" "Returnerar datumet när den angivna mÃ¥nfasen inträffar. Funktion söker framÃ¥t " "med början pÃ¥ angivet datum. MÃ¥nfasen anges som ett nummer mellan 0 och 1, " "där 0 representerar nymÃ¥ne, 0,5 fullmÃ¥nar, och 0,25 samt 0,75 kvartsmÃ¥nar." #: ../data/functions.xml.in.h:591 msgid "Start Date" msgstr "Startdatum" #: ../data/functions.xml.in.h:592 msgid "Utilities" msgstr "Verktyg" #: ../data/functions.xml.in.h:593 msgid "Plot Functions and Vectors" msgstr "Rita funktioner och vektorer" #: ../data/functions.xml.in.h:594 msgid "r:plot" msgstr "" #: ../data/functions.xml.in.h:595 msgid "Expression or vector" msgstr "Uttryck eller vektor" #: ../data/functions.xml.in.h:596 msgid "Minimum x value" msgstr "Minsta x-värde" #: ../data/functions.xml.in.h:597 msgid "Maximum x value" msgstr "Högsta x-värde" #: ../data/functions.xml.in.h:598 msgid "Number of samples / Step size" msgstr "Antal värden / stegstorlek" #: ../data/functions.xml.in.h:599 msgid "X variable" msgstr "X-variabel" #: ../data/functions.xml.in.h:600 msgid "" "Plots one or more expressions or vectors. Use a vector for the first " "argument to plot multiple series. Only the first argument is used for vector " "series. It is also possible to plot a matrix where each row is a pair of x " "and y values." msgstr "" "Ritar en eller flera uttryck eller vektorer i ett linjediagram. Använd en " "vektor till den första parametern för att rita flera serier. Enbart den " "första parametern används för vektorserier. Det är även möjligt att rita en " "matrix där varje rad utgör parvisa x och y värden." #: ../data/functions.xml.in.h:601 msgid "ASCII Value" msgstr "ASCII värde" #: ../data/functions.xml.in.h:602 msgid "r:code" msgstr "kod" #: ../data/functions.xml.in.h:603 msgid "Character" msgstr "Tecken" #: ../data/functions.xml.in.h:604 msgid "ASCII Char" msgstr "ASCII tecken" #: ../data/functions.xml.in.h:605 msgid "r:char" msgstr "tecken" #: ../data/functions.xml.in.h:606 msgid "Length of string" msgstr "Textsträngslängd" #: ../data/functions.xml.in.h:607 msgid "r:len" msgstr "längd" #: ../data/functions.xml.in.h:608 msgid "Text" msgstr "Text" #: ../data/functions.xml.in.h:609 msgid "Concatenate Strings" msgstr "Sammanfoga textsträngar" #: ../data/functions.xml.in.h:610 msgid "r:concatenate" msgstr "sammanfoga" #: ../data/functions.xml.in.h:611 msgid "Text string 1" msgstr "Textsträng 1" #: ../data/functions.xml.in.h:612 msgid "Text string 2" msgstr "Textsträng 2" #: ../data/functions.xml.in.h:613 msgid "Replace" msgstr "Ersätt" #: ../data/functions.xml.in.h:614 msgid "r:replace" msgstr "ersätt" #: ../data/functions.xml.in.h:615 msgid "" "Replaces a certain value in an expression with a new value. The expression " "is calculated before the replacement if the fourth argument is true." msgstr "" "Ersätt ett visst värde i ett uttryck med ett nytt värde. Uttrycket beräknas " "innan ersättandet om den parametern är satt till sant." #: ../data/functions.xml.in.h:616 msgid "Expression" msgstr "Uttryck" #: ../data/functions.xml.in.h:617 msgid "Original value" msgstr "Ursprungligt värde" #: ../data/functions.xml.in.h:618 msgid "New value" msgstr "Nytt värde" #: ../data/functions.xml.in.h:619 msgid "Precalculate expression" msgstr "Beräkna uttrycket först" #: ../data/functions.xml.in.h:620 msgid "Strip Units" msgstr "Ta bort enheter" #: ../data/functions.xml.in.h:621 msgid "r:nounit,strip_units" msgstr "" #: ../data/functions.xml.in.h:622 msgid "" "Removes all units from an expression. The expression is calculated before " "the removal." msgstr "" "Tar bort alla enheter frÃ¥n ett uttryck. Uttrycket beräknas innan " "borttagandet." #: ../data/functions.xml.in.h:623 msgid "Process Vector Elements" msgstr "Modifiera vektorelement" #: ../data/functions.xml.in.h:624 msgid "r:process" msgstr "" #: ../data/functions.xml.in.h:625 msgid "Element variable" msgstr "Elementvariabel" #: ../data/functions.xml.in.h:626 msgid "Index variable" msgstr "Indexvariabel" #: ../data/functions.xml.in.h:627 msgid "Vector variable" msgstr "Vektorvariabel" #: ../data/functions.xml.in.h:628 msgid "Process Matrix Elements" msgstr "Modifiera matriselement" #: ../data/functions.xml.in.h:629 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:630 msgid "Row variable" msgstr "Radvariabel" #: ../data/functions.xml.in.h:631 msgid "Column variable" msgstr "Kolumnvariabel" #: ../data/functions.xml.in.h:632 msgid "Matrix variable" msgstr "Matrisvariabel" #: ../data/functions.xml.in.h:633 msgid "Custom Sum of Elements" msgstr "Anpassad elementsumma" #: ../data/functions.xml.in.h:634 msgid "r:csum" msgstr "" #: ../data/functions.xml.in.h:635 msgid "First element" msgstr "Första elementet" #: ../data/functions.xml.in.h:636 msgid "Last element" msgstr "Sista elementet" #: ../data/functions.xml.in.h:637 msgid "Initial value" msgstr "Initialt värde" #: ../data/functions.xml.in.h:638 msgid "Value variable" msgstr "Värdevariabel" #: ../data/functions.xml.in.h:639 msgid "Select Vector Elements" msgstr "Utvälj vektorelement" #: ../data/functions.xml.in.h:640 msgid "r:select" msgstr "" #: ../data/functions.xml.in.h:641 msgid "Condition" msgstr "Förutsättning" #: ../data/functions.xml.in.h:642 msgid "Select first match" msgstr "Välj första matchande element" #: ../data/functions.xml.in.h:643 msgid "r:function" msgstr "funktion" #: ../data/functions.xml.in.h:644 msgid "Arguments" msgstr "Parametrar" #: ../data/functions.xml.in.h:645 msgid "Title" msgstr "Titel" #: ../data/functions.xml.in.h:646 msgid "r:title" msgstr "titel" #: ../data/functions.xml.in.h:648 msgid "Display Error" msgstr "Visa felmeddelande" #: ../data/functions.xml.in.h:649 msgid "r:error" msgstr "fel" #: ../data/functions.xml.in.h:650 msgid "Message" msgstr "Meddelande" #: ../data/functions.xml.in.h:651 msgid "Display Warning" msgstr "Visa varning" #: ../data/functions.xml.in.h:652 msgid "r:warning" msgstr "varning" #: ../data/functions.xml.in.h:653 msgid "Display Message" msgstr "Visa meddelande" #: ../data/functions.xml.in.h:654 msgid "r:message" msgstr "meddelande" #: ../data/functions.xml.in.h:655 msgid "Save as Variable" msgstr "Spara som variabel" #: ../data/functions.xml.in.h:656 msgid "r:save" msgstr "spara" #: ../data/functions.xml.in.h:657 msgid "Category" msgstr "Kategori" #: ../data/functions.xml.in.h:658 msgid "RPN Stack Register" msgstr "RPN-stackregister" #: ../data/functions.xml.in.h:659 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:660 msgid "Returns the value of a RPN stack register." msgstr "Returnerar värdet för ett register pÃ¥ RPN-stacken." #: ../data/functions.xml.in.h:661 msgid "RPN Stack Vector" msgstr "RPN-stackvektor" #: ../data/functions.xml.in.h:662 msgid "r:stack" msgstr "" #: ../data/functions.xml.in.h:663 msgid "Returns the RPN stack as a vector." msgstr "Returnerar RPN-stacken som en vektor." #: ../data/functions.xml.in.h:664 msgid "Is Number" msgstr "Är nummer" #: ../data/functions.xml.in.h:665 msgid "r:isNumber" msgstr "ärNummer" #: ../data/functions.xml.in.h:666 msgid "Is Real" msgstr "Är reellt" #: ../data/functions.xml.in.h:667 msgid "r:isReal" msgstr "ärReellt" #: ../data/functions.xml.in.h:668 msgid "Is Rational" msgstr "Är rationellt" #: ../data/functions.xml.in.h:669 msgid "r:isRational" msgstr "ärRationellt" #: ../data/functions.xml.in.h:670 msgid "Is Integer" msgstr "Är heltal" #: ../data/functions.xml.in.h:671 msgid "r:isInteger" msgstr "ärHeltal" #: ../data/functions.xml.in.h:672 msgid "Represents Number" msgstr "Representar nummer" #: ../data/functions.xml.in.h:673 msgid "r:representsNumber" msgstr "representerarNummer" #: ../data/functions.xml.in.h:674 msgid "Represents Real" msgstr "Representerar reellt tal" #: ../data/functions.xml.in.h:675 msgid "r:representsReal" msgstr "representerarReelt" #: ../data/functions.xml.in.h:676 msgid "Represents Rational" msgstr "Representerar rationellt tal" #: ../data/functions.xml.in.h:677 msgid "r:representsRational" msgstr "representerarRationellt" #: ../data/functions.xml.in.h:678 msgid "Represents Integer" msgstr "Representerar ett heltal" #: ../data/functions.xml.in.h:679 msgid "r:representsInteger" msgstr "representarHeltal" #: ../data/functions.xml.in.h:680 msgid "Interval" msgstr "Intervall" #: ../data/functions.xml.in.h:681 msgid "r:interval" msgstr "intervall" #: ../data/functions.xml.in.h:682 msgid "Lower endpoint" msgstr "Undre gräns" #: ../data/functions.xml.in.h:683 msgid "Upper endpoint" msgstr "Övre gräns" #: ../data/functions.xml.in.h:684 msgid "Logical" msgstr "Logik" #: ../data/functions.xml.in.h:685 msgid "For...Do" msgstr "För...utför" #: ../data/functions.xml.in.h:686 msgid "r:for" msgstr "för" #: ../data/functions.xml.in.h:687 msgid "Initial value of counter" msgstr "Initialt värde för räknare" #: ../data/functions.xml.in.h:688 msgid "Counter variable" msgstr "Räknarvariabel" #: ../data/functions.xml.in.h:689 msgid "For condition" msgstr "Medans-villkor" #: ../data/functions.xml.in.h:690 msgid "Counter update function" msgstr "Funktion för uppdatering av räknare" #: ../data/functions.xml.in.h:691 msgid "Do function" msgstr "Utför-funktion" #: ../data/functions.xml.in.h:692 msgid "If...Then...Else" msgstr "Om...dÃ¥...annars" #: ../data/functions.xml.in.h:693 msgid "r:if" msgstr "om" #: ../data/functions.xml.in.h:694 msgid "Tests a condition and returns a value depending on the result." msgstr "Testar ett villkor och returnerar ett värde beroende av result." #: ../data/functions.xml.in.h:695 msgid "Expression if condition is met" msgstr "Uttryck om villkoret uppfylls" #: ../data/functions.xml.in.h:696 msgid "Expression if condition is NOT met" msgstr "Uttryck om villkoret INTE uppfylls" #: ../data/functions.xml.in.h:697 msgid "Logical Exclusive OR" msgstr "" #: ../data/functions.xml.in.h:698 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:699 msgid "Value 1" msgstr "Värde 1" #: ../data/functions.xml.in.h:700 msgid "Value 2" msgstr "Värde 2" #: ../data/functions.xml.in.h:701 msgid "Bitwise Exclusive OR" msgstr "" #: ../data/functions.xml.in.h:702 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:703 msgid "Bitwise Shift" msgstr "" #: ../data/functions.xml.in.h:704 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:705 msgid "Bits" msgstr "" #: ../data/functions.xml.in.h:706 msgid "Bitwise Complement (Not)" msgstr "" #: ../data/functions.xml.in.h:707 msgid "r:bitcmp" msgstr "" #: ../data/functions.xml.in.h:708 msgid "Algebra" msgstr "Algebra" #: ../data/functions.xml.in.h:709 msgid "Summation" msgstr "Summa" #: ../data/functions.xml.in.h:710 msgid "au:Σ,r:sum" msgstr "au:Σ,summa" #: ../data/functions.xml.in.h:711 msgid "" "Corresponds to the summation symbol. Adds terms for each x ranging from the " "lower to the upper limit." msgstr "" "Motsvarar summasymbolen. Adderar termer för varje x frÃ¥n den undre till den " "övre gränsen." #: ../data/functions.xml.in.h:712 msgid "Term expression" msgstr "Termuttryck" #: ../data/functions.xml.in.h:713 msgid "Lower limit (i)" msgstr "Undre gräns (i)" #: ../data/functions.xml.in.h:714 msgid "Upper limit (n)" msgstr "Övre gräns (n)" #: ../data/functions.xml.in.h:715 msgid "Product of a sequence" msgstr "Produkt av en serie" #: ../data/functions.xml.in.h:716 msgid "au:Π,r:product" msgstr "au:Π,produkt" #: ../data/functions.xml.in.h:717 msgid "" "Corresponds to the product symbol. Multiplies factors for each x ranging " "from the lower to the upper limit." msgstr "" "Motsvarar produktsymbolen. Multiplicerar faktorer för varje x frÃ¥n den undre " "till den övre gränsen." #: ../data/functions.xml.in.h:718 msgid "Factor expression" msgstr "Faktoruttryck" #: ../data/functions.xml.in.h:719 msgid "Solve for multiple variables" msgstr "Lös för flera variabler" #: ../data/functions.xml.in.h:720 msgid "r:multisolve" msgstr "" #: ../data/functions.xml.in.h:721 msgid "Equation vector" msgstr "Ekvationsvektor" #: ../data/functions.xml.in.h:722 msgid "Variable vector" msgstr "Variabelvektor" #: ../data/functions.xml.in.h:723 msgid "Solve equation" msgstr "Lös ekvation" #: ../data/functions.xml.in.h:724 msgid "r:solve" msgstr "lös" #: ../data/functions.xml.in.h:725 msgid "Equation" msgstr "Ekvation" #: ../data/functions.xml.in.h:726 msgid "With respect to" msgstr "Med avseende pÃ¥" #: ../data/functions.xml.in.h:727 msgid "Solve differential equation" msgstr "Lös differentialekvation" #: ../data/functions.xml.in.h:728 msgid "r:dsolve" msgstr "" #: ../data/functions.xml.in.h:729 msgid "Initial condition: function value (y)" msgstr "Initialt villkor: funktionsvärde (y)" #: ../data/functions.xml.in.h:730 msgid "Initial condition: argument value (x)" msgstr "Initialt villkor: parametervärde (x)" #: ../data/functions.xml.in.h:731 msgid "" "Solves a differential equation and returns the value of y(x). The derivative " "in the equation should be in the format diff(y, x). Only first-order " "differential equations are currently supported." msgstr "" "Löser en differentialekvation och returnerar värdet pÃ¥ y(x). Derivatan i " "ekvation mÃ¥ste vara i formatet diff(y; x). Enbart första ordningens " "differentialekvationer stöds för nuvarande." #: ../data/functions.xml.in.h:732 msgid "Solve for two variables" msgstr "Lös för tvÃ¥ variabler" #: ../data/functions.xml.in.h:733 msgid "r:solve2" msgstr "lös2" #: ../data/functions.xml.in.h:734 msgid "" "Solves two equations with two unknown variables. Returns the value of the " "first variable." msgstr "" "Lös tvÃ¥ ekvationer med tvÃ¥ okända variabler. Returnerar värdet pÃ¥ den första " "variabeln." #: ../data/functions.xml.in.h:735 msgid "Equation 1" msgstr "Ekvation 1" #: ../data/functions.xml.in.h:736 msgid "Equation 2" msgstr "Ekvation 2" #: ../data/functions.xml.in.h:737 msgid "Variable 1" msgstr "Variabel 1" #: ../data/functions.xml.in.h:738 msgid "Variable 2" msgstr "Variabel 2" #: ../data/functions.xml.in.h:739 msgid "Find Linear Function" msgstr "Finn linjär funktion" #: ../data/functions.xml.in.h:740 msgid "r:linearfunction" msgstr "linjär_funktion" #: ../data/functions.xml.in.h:741 msgid "" "Finds the linear function for the straight line between two distinct points." msgstr "" "Finner den linjära funktionen för den räta linjen mellan tvÃ¥ distinkta " "punkter." #: ../data/functions.xml.in.h:742 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:743 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:744 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:745 msgid "y2" msgstr "" #: ../data/functions.xml.in.h:746 msgid "Calculus" msgstr "Calculus" #: ../data/functions.xml.in.h:747 msgid "Differentiate" msgstr "Derivera" #: ../data/functions.xml.in.h:748 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:749 msgid "Integrate" msgstr "Integrera" #: ../data/functions.xml.in.h:750 msgid "r:integrate" msgstr "integrera" #: ../data/functions.xml.in.h:751 msgid "Variable of integration" msgstr "Variabel för integration" #: ../data/functions.xml.in.h:752 msgid "Limit" msgstr "Gränsvärde" #: ../data/functions.xml.in.h:753 msgid "" "Returns the two-sided limit of the function if direction is zero, limit from " "left (below) if direction is -1, or limit from right (above) if direction is " "+1." msgstr "" "Returnerar det tvÃ¥-sidiga gränsvärdet för funktionen om riktning är noll, " "gränsvärdet frÃ¥n vänster (underifrÃ¥n) om riktning är -1 eller gränsvärdet " "frpn höger (ovanifrÃ¥n) om riktning är +1." #: ../data/functions.xml.in.h:754 msgid "r:limit" msgstr "" #: ../data/functions.xml.in.h:755 msgid "Value to approach" msgstr "Värde att närma" #: ../data/functions.xml.in.h:756 msgid "Direction" msgstr "Riktning" #: ../data/functions.xml.in.h:757 msgid "Extreme Values" msgstr "Extremvärden" #: ../data/functions.xml.in.h:758 msgid "r:extremum" msgstr "" #: ../data/functions.xml.in.h:759 msgid "Named Integrals" msgstr "Namngivna integraler" #: ../data/functions.xml.in.h:760 msgid "Logarithmic Integral" msgstr "Logaritmisk integral" #: ../data/functions.xml.in.h:761 msgid "rc:li,logint" msgstr "" #: ../data/functions.xml.in.h:762 msgid "The integral of 1/ln(x)." msgstr "Integralen av 1/ln(x)." #: ../data/functions.xml.in.h:763 msgid "Exponential Integral" msgstr "Exponentiell integral" #: ../data/functions.xml.in.h:764 msgid "rc:Ei,expint" msgstr "" #: ../data/functions.xml.in.h:765 msgid "The integral of e^x/x." msgstr "Integralen av e^x/x." #: ../data/functions.xml.in.h:766 msgid "Sine Integral" msgstr "Sineintegral" #: ../data/functions.xml.in.h:767 msgid "rc:Si,sinint" msgstr "" #: ../data/functions.xml.in.h:768 msgid "The integral of sin(x)/x." msgstr "Integralen av sin(x)/x" #: ../data/functions.xml.in.h:769 msgid "Cosine Integral" msgstr "Cosineintegral" #: ../data/functions.xml.in.h:770 msgid "rc:Ci,cosint" msgstr "" #: ../data/functions.xml.in.h:771 msgid "The integral of cos(x)/x." msgstr "Integralen av cos(x)/x." #: ../data/functions.xml.in.h:772 msgid "Hyperbolic Sine Integral" msgstr "Sinus hyperbolicus-integral" #: ../data/functions.xml.in.h:773 msgid "rc:Shi,sinhint" msgstr "" #: ../data/functions.xml.in.h:774 msgid "The integral of sinh(x)/x." msgstr "Integralen av sinh(x)/x." #: ../data/functions.xml.in.h:775 msgid "Hyperbolic Cosine Integral" msgstr "Cosinus hyperbolicus-integral" #: ../data/functions.xml.in.h:776 msgid "rc:Chi,coshint" msgstr "" #: ../data/functions.xml.in.h:777 msgid "The integral of cosh(x)/x." msgstr "Integralen av cosh(x)/x." #: ../data/functions.xml.in.h:778 msgid "Upper Incomplete Gamma Function" msgstr "Övre ofullständig gammafunktion" #: ../data/functions.xml.in.h:779 msgid "r:igamma" msgstr "" #: ../data/functions.xml.in.h:780 msgid "Lower Incomplete Gamma Function" msgstr "Undre ofullständig gammafunktion" #: ../data/functions.xml.in.h:781 msgid "r:gammainc" msgstr "" #: ../data/functions.xml.in.h:782 msgid "Geometry" msgstr "Geometri" #: ../data/functions.xml.in.h:783 msgid "Triangle" msgstr "Triangel" #: ../data/functions.xml.in.h:784 msgid "Hypotenuse" msgstr "Hypotenusa" #: ../data/functions.xml.in.h:785 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:786 msgid "Side A" msgstr "Sida A" #: ../data/functions.xml.in.h:787 msgid "Side B" msgstr "Sida B" #: ../data/functions.xml.in.h:788 msgid "Triangle Area" msgstr "Triangelarea" #: ../data/functions.xml.in.h:789 msgid "r:triangle" msgstr "triangel" #: ../data/functions.xml.in.h:790 msgid "Height" msgstr "Höjd" #: ../data/functions.xml.in.h:791 msgid "Triangle Perimeter" msgstr "Rektangelomkrets" #: ../data/functions.xml.in.h:792 msgid "r:triangle_perimeter" msgstr "triangelomkrets" #: ../data/functions.xml.in.h:793 msgid "Side C" msgstr "Sida C" #: ../data/functions.xml.in.h:794 msgid "Circle" msgstr "Cirkel" #: ../data/functions.xml.in.h:795 msgid "Circle Area" msgstr "Cirkelarea" #: ../data/functions.xml.in.h:796 msgid "r:circle" msgstr "cirkel" #: ../data/functions.xml.in.h:797 msgid "Calculates the area of a circle using the radius" msgstr "Beräknar arean för en cirkel." #: ../data/functions.xml.in.h:798 msgid "Radius" msgstr "Radie" #: ../data/functions.xml.in.h:799 msgid "Circle Circumference" msgstr "Cirkelomkrets" #: ../data/functions.xml.in.h:800 msgid "r:circumference" msgstr "omkrets" #: ../data/functions.xml.in.h:801 msgid "Cylinder" msgstr "Cylinder" #: ../data/functions.xml.in.h:802 msgid "Cylinder Volume" msgstr "Cylindervolym" #: ../data/functions.xml.in.h:803 msgid "r:cylinder" msgstr "" #: ../data/functions.xml.in.h:804 msgid "Surface Area of Cylinder" msgstr "Ytarea för en cylinder" #: ../data/functions.xml.in.h:805 msgid "r:cylinder_sa" msgstr "cylinderyta" #: ../data/functions.xml.in.h:806 msgid "Cone" msgstr "Kon" #: ../data/functions.xml.in.h:807 msgid "Cone Volume" msgstr "Konvolym" #: ../data/functions.xml.in.h:808 msgid "r:cone" msgstr "kon" #: ../data/functions.xml.in.h:809 msgid "Surface Area of Cone" msgstr "Ytarea för en kon" #: ../data/functions.xml.in.h:810 msgid "r:cone_sa" msgstr "konyta" #: ../data/functions.xml.in.h:811 msgid "Sphere" msgstr "Sfär" #: ../data/functions.xml.in.h:812 msgid "Sphere Volume" msgstr "Sfärvolym" #: ../data/functions.xml.in.h:813 msgid "r:sphere" msgstr "sfär" #: ../data/functions.xml.in.h:814 msgid "Surface Area of Sphere" msgstr "Ytarea för en sfär" #: ../data/functions.xml.in.h:815 msgid "r:sphere_sa" msgstr "sfäryta" #: ../data/functions.xml.in.h:816 msgid "Square Area" msgstr "Kvadratarea" #: ../data/functions.xml.in.h:817 msgid "r:square" msgstr "kvadrat" #: ../data/functions.xml.in.h:818 msgid "Length of side" msgstr "Sidans längd" #: ../data/functions.xml.in.h:819 msgid "Square Perimeter" msgstr "Kvadratomkrets" #: ../data/functions.xml.in.h:820 msgid "r:square_perimeter" msgstr "kvadratomkrets" #: ../data/functions.xml.in.h:821 msgid "Cube" msgstr "Kub" #: ../data/functions.xml.in.h:822 msgid "Cube Volume" msgstr "Kubvolym" #: ../data/functions.xml.in.h:823 msgid "r:cube" msgstr "kub" #: ../data/functions.xml.in.h:824 msgid "Surface Area of Cube" msgstr "Ytarea för en kub" #: ../data/functions.xml.in.h:825 msgid "r:cube_sa" msgstr "kubyta" #: ../data/functions.xml.in.h:826 msgid "Rectangle" msgstr "Rektangel" #: ../data/functions.xml.in.h:827 msgid "Rectangle Area" msgstr "Rektangelarea" #: ../data/functions.xml.in.h:828 msgid "r:rect" msgstr "rektangel" #: ../data/functions.xml.in.h:829 msgid "Width" msgstr "Bredd" #: ../data/functions.xml.in.h:830 msgid "Rectangle Perimeter" msgstr "Rektangelomkrets" #: ../data/functions.xml.in.h:831 msgid "r:rect_perimeter" msgstr "rektangelomkrets" #: ../data/functions.xml.in.h:832 msgid "Prism" msgstr "Prism" #: ../data/functions.xml.in.h:833 msgid "Volume of Rectangular Prism" msgstr "Volym för en rektangulär prism" #: ../data/functions.xml.in.h:834 msgid "r:rectprism" msgstr "rektangelprism" #: ../data/functions.xml.in.h:835 msgid "Calculates the volume of a prism with rectangular base." msgstr "Beräknar volymen för en prisma med rektangulär bas." #: ../data/functions.xml.in.h:836 msgid "Surface Area of Rectangular Prism" msgstr "Ytarea för en rektangulär prism" #: ../data/functions.xml.in.h:837 msgid "r:rectprism_sa" msgstr "rektangelprismyta" #: ../data/functions.xml.in.h:838 msgid "Calculates the surface area of a prism with rectangular base." msgstr "Beräknar ytarean för en prisma med rektangulär bas." #: ../data/functions.xml.in.h:839 msgid "Volume of Triangular Prism" msgstr "Volym för en triangulär prism" #: ../data/functions.xml.in.h:840 msgid "r:triangleprism" msgstr "triangelprism" #: ../data/functions.xml.in.h:841 msgid "Calculates the volume of a prism with triangular base." msgstr "Beräknar volymen för en prisma med triangulär bas." #: ../data/functions.xml.in.h:842 msgid "Pyramid" msgstr "Pyramid" #: ../data/functions.xml.in.h:843 msgid "Pyramid Volume" msgstr "Pyramidvolym" #: ../data/functions.xml.in.h:844 msgid "r:pyramid" msgstr "" #: ../data/functions.xml.in.h:845 msgid "" "Calculates the volume of a 3-dimensional shape standing on a rectangular " "base and terminating in a point at the top." msgstr "" "Beräknar volymen för en 3-dimensionell form som stÃ¥r pÃ¥ en rektangulär bas " "och som slutar en punkt pÃ¥ toppen." #: ../data/functions.xml.in.h:846 msgid "Length of base" msgstr "Basens längd" #: ../data/functions.xml.in.h:847 msgid "Width of base" msgstr "Basens bredd" #: ../data/functions.xml.in.h:848 msgid "Volume of Regular Tetrahedron" msgstr "Volym för en liksidig tetrahedron" #: ../data/functions.xml.in.h:849 msgid "r:tetrahedron" msgstr "" #: ../data/functions.xml.in.h:850 msgid "Surface Area of Regular Tetrahedron" msgstr "Ytarea för en liksidig tetrahedron" #: ../data/functions.xml.in.h:851 msgid "r:tetrahedron_sa" msgstr "tetrahedronyta" #: ../data/functions.xml.in.h:852 msgid "Height of Regular Tetrahedron" msgstr "Höjden pÃ¥ en liksidig tetrahedron" #: ../data/functions.xml.in.h:853 msgid "r:tetrahedron_height" msgstr "tetrahedronhöjd" #: ../data/functions.xml.in.h:854 msgid "Volume of Square Pyramid" msgstr "Volym för en kvadratisk pyramid" #: ../data/functions.xml.in.h:855 msgid "r:sqpyramid" msgstr "kvpyramid" #: ../data/functions.xml.in.h:856 msgid "Surface Area of Square Pyramid" msgstr "Ytarea för en kvadratisk pyramid" #: ../data/functions.xml.in.h:857 msgid "r:sqpyramid_sa" msgstr "kvpyramidyta" #: ../data/functions.xml.in.h:858 msgid "Height of Square Pyramid" msgstr "Höjden pÃ¥ en kvadratisk pyramid" #: ../data/functions.xml.in.h:859 msgid "r:sqpyramid_height" msgstr "kvpyramidhöjd" #: ../data/functions.xml.in.h:860 msgid "Parallelogram" msgstr "Parallelogram" #: ../data/functions.xml.in.h:861 msgid "Parallelogram Area" msgstr "Parallelogramarea" #: ../data/functions.xml.in.h:862 msgid "r:parallelogram" msgstr "parallellogram" #: ../data/functions.xml.in.h:863 msgid "" "Calculates the area of a four-sided figure whose opposite sides are both " "parallel and equal in length." msgstr "" "Beräknar arean för en fyrsidig figur vars motstÃ¥ende sidor är parallella och " "är lika lÃ¥nga." #: ../data/functions.xml.in.h:864 msgid "Parallelogram Perimeter" msgstr "Parallelogramomkrets" #: ../data/functions.xml.in.h:865 msgid "r:parallelogram_perimeter" msgstr "parallellogramomkrets" #: ../data/functions.xml.in.h:866 msgid "" "Calculates the perimeter of a four-sided figure whose opposite sides are " "both parallel and equal in length." msgstr "" "Beräknar omkretsen för en fyrsidig figur vars motstÃ¥ende sidor är bÃ¥de " "parallella och lika lÃ¥nga." #: ../data/functions.xml.in.h:867 msgid "Trapezoid" msgstr "Trapetsoid" #: ../data/functions.xml.in.h:868 msgid "Trapezoid Area" msgstr "Trapetsoidarea" #: ../data/functions.xml.in.h:869 msgid "r:trapezoid" msgstr "trapetsoid" #: ../data/functions.xml.in.h:870 msgid "Calculates the area of a four-sided figure with two parallel sides." msgstr "Beräknar arean för en fyrsidig figur med tvÃ¥ parallella sidor." #: ../data/functions.xml.in.h:871 msgid "Economics" msgstr "Ekonomi" #: ../data/functions.xml.in.h:872 msgid "Microeconomics" msgstr "Mikroekonomi" #: ../data/functions.xml.in.h:873 msgid "Elasticity" msgstr "Elasticitet" #: ../data/functions.xml.in.h:874 msgid "r:elasticity" msgstr "elasticitet" #: ../data/functions.xml.in.h:875 msgid "" "Calculates the demand elasticity. Also works for supply elasticity, income " "elasticity, cross-price elasticity, etc. Just replace demand with supply, or " "price with income... eg. elasticity(100-x^2, 3) calculates the " "demand elasticity when the price is 3 for the function \"Q = 100 - x^2\" " "where x is the default price variable." msgstr "" "Beräknar efterfrÃ¥geelasticitet. Fungerar lika bra för tillgÃ¥ng- och " "inkomstelasticitet, etc. Ersätt bara efterfrÃ¥gan med tillgÃ¥ng, eller pris " "med inkomst... t ex elasticity(100-x^2, 3) beräknar " "efterfrÃ¥geelasticiteten när priset är 3 för functionen \"Q = 100 - x^2\" där " "x är den förvalda prisvariabeln." #: ../data/functions.xml.in.h:876 msgid "Demand function" msgstr "EfterfrÃ¥gefunktion" #: ../data/functions.xml.in.h:877 msgid "Price" msgstr "Pris" #: ../data/functions.xml.in.h:878 msgid "Price variable" msgstr "Prisvariabel" #: ../data/functions.xml.in.h:879 msgid "Sum-of-Years Digits Depreciation" msgstr "Ã…rlig avskrivningssumma" #: ../data/functions.xml.in.h:880 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:881 msgid "" "Calculates the sum-of-years digits depreciation for an asset based on its " "cost, salvage value, anticipated life, and a particular period. This method " "accelerates the rate of the depreciation, so that more depreciation expense " "occurs in earlier periods than in later ones. The depreciable cost is the " "actual cost minus the salvage value. The useful life is the number of " "periods (typically years) over which the asset is depreciated." msgstr "" "Beräknar \"sum-of-years digits\"-avskrivningen för en tillgÃ¥ng, baserat pÃ¥ " "dess kostnad, slutvärde, förväntad livslängd och en given period. Metoden " "accelererar värdeminskningen, sÃ¥ att störst värdeminskning sker i början. " "Den avskrivbara kostnaden är den faktiskta kostnaden minus slutvärdet. " "Livslängden är den period (anges ofta i Ã¥r) som värdeminskningen pÃ¥gÃ¥r." #: ../data/functions.xml.in.h:882 msgid "Cost" msgstr "Kostnad" #: ../data/functions.xml.in.h:883 msgid "Salvage value" msgstr "Slutvärde" #: ../data/functions.xml.in.h:884 msgid "Life" msgstr "Livslängd" #: ../data/functions.xml.in.h:885 msgid "Period" msgstr "Period" #: ../data/functions.xml.in.h:886 msgid "Straight Line Depreciation" msgstr "Linjär avskrivning" #: ../data/functions.xml.in.h:887 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:888 msgid "" "Determines the straight line depreciation of an asset for a single period." " Cost is the amount you paid for the asset. Salvage is the value of " "the asset at the end of the period. Life is the number of periods over which " "the asset is depreciated. SLN divides the cost evenly over the life of an " "asset." msgstr "" #: ../data/functions.xml.in.h:889 msgid "Present Value" msgstr "Nuvärde" #: ../data/functions.xml.in.h:890 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:891 msgid "" "Returns the present value of an investment. If type = 1 then the " "payment is made at the beginning of the period, If type = 0 (or omitted) it " "is made at the end of each period." msgstr "" #: ../data/functions.xml.in.h:892 msgid "Interest rate" msgstr "Räntesats" #: ../data/functions.xml.in.h:893 msgid "Number of periods" msgstr "Antal perioder" #: ../data/functions.xml.in.h:894 msgid "Payment made each period" msgstr "Periodisk avbetalning " #: ../data/functions.xml.in.h:895 msgid "Future value" msgstr "Framtida värde" #: ../data/functions.xml.in.h:896 msgid "Type" msgstr "Typ" #: ../data/functions.xml.in.h:897 msgid "Nominal Interest Rate" msgstr "Nominell räntesats" #: ../data/functions.xml.in.h:898 msgid "r:nominal" msgstr "" #: ../data/functions.xml.in.h:899 msgid "" "Calculates the nominal interest rate from a given effective interest rate " "compounded at given intervals." msgstr "Beräknar den nominella räntesatsen frÃ¥n en given effektiv ränta." #: ../data/functions.xml.in.h:900 msgid "Effective interest rate" msgstr "Effektiv räntesats" #: ../data/functions.xml.in.h:901 msgid "Periods" msgstr "Antal perioder" #: ../data/functions.xml.in.h:902 msgid "Zero Coupon" msgstr "Nollkupong" #: ../data/functions.xml.in.h:903 msgid "r:zero_coupon" msgstr "" #: ../data/functions.xml.in.h:904 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "" #: ../data/functions.xml.in.h:905 msgid "Face value" msgstr "Nominellt värde" #: ../data/functions.xml.in.h:906 msgid "Treasury Bill Yield" msgstr "Avkastningen för statsskuldväxel" #: ../data/functions.xml.in.h:907 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:908 msgid "Returns the yield for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:909 msgid "Settlement date" msgstr "Avräkningsdatum" #: ../data/functions.xml.in.h:910 msgid "Maturity date" msgstr "Mognadsdatum" #: ../data/functions.xml.in.h:911 msgid "Price per $100 face value" msgstr "Pris per 100 kr nominellt värde" #: ../data/functions.xml.in.h:912 msgid "Treasury Bill Price" msgstr "Värde för statsskuldväxel" #: ../data/functions.xml.in.h:913 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:914 msgid "Returns the price per $100 value for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:915 msgid "Discount rate" msgstr "Diskonto" #: ../data/functions.xml.in.h:916 msgid "Treasury Bill Equivalent" msgstr "Statsskultväxelavkastning motsvarande obligation" #: ../data/functions.xml.in.h:917 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:918 msgid "Returns the bond equivalent for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:919 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "Ränta betalad under specifik betalningsperiod (ISPMT)" #: ../data/functions.xml.in.h:920 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:921 msgid "Calculates the interest paid on a given period of an investment." msgstr "Beräknar den betalda räntan för en viss period av en investering." #: ../data/functions.xml.in.h:922 msgid "Periodic interest rate" msgstr "Periodisk räntesats" #: ../data/functions.xml.in.h:923 msgid "Amortizement period" msgstr "Amorteringsperiod" #: ../data/functions.xml.in.h:924 msgid "Present value" msgstr "Nuvärde" #: ../data/functions.xml.in.h:925 msgid "Payment for a loan" msgstr "Betalning för ett lÃ¥n" #: ../data/functions.xml.in.h:926 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:927 msgid "" "Returns the amount of payment (negative) each period for a loan based on a " "constant interest rate and constant payments (each payment is equal amount)." " If type = 1 then the payment is made at the beginning of the " "period, If type = 0 (or omitted) it is made at the end of each period. " " Note that the interest rate here refers to the rate for each period and " "if you calculate with an annual rate, each period will be interpreted as a " "whole year. To get monthly payments divide the annual interest rate by 12 " "and enter the total number of months (12 times number of year) in the " "periods field." msgstr "" "Returnerar storleken pÃ¥ betalningar (negativt) under varje period för ett " "lÃ¥n baserat pÃ¥ en fast räntesats och fasta betalningar (varje betalning är " "lika stor). Om typ = 1 sÃ¥ sker betalningen vid början av perioden, " "om typ = 2 görs betalningarna i slutet av varje period. Observera " "att räntan här syftar pÃ¥ räntan för varje period och om du anger Ã¥rsräntan " "tolkas varje period som ett helt Ã¥r. För att erhÃ¥lla mÃ¥natliga betalningar, " "dela Ã¥rsräntan med 12 och ange det totala antalet mÃ¥nader (12 gÃ¥nger antalet " "Ã¥r) i fältet för period." #: ../data/functions.xml.in.h:928 msgid "Rate" msgstr "Räntesats" #: ../data/functions.xml.in.h:929 msgid "Periods of an investment" msgstr "Perioder för en investering" #: ../data/functions.xml.in.h:930 msgid "r:nper" msgstr "" #: ../data/functions.xml.in.h:931 msgid "" "Calculates number of periods of an investment based on periodic constant " "payments and a constant interest rate. Type defines the due date. 1 " "for payment at the beginning of a period and 0 (default) for payment at the " "end of a period." msgstr "" "Beräknar anatalet perioder för investering baserad pÃ¥ periodiska, konstanta " "betalningar och konstant ränta. Typ anger när betalningarna sker. 1 " "för betalning i början av perioden och 0 (förvald) för betalning i slutet av " "perioden." #: ../data/functions.xml.in.h:932 msgid "Periods for investment to attain desired value" msgstr "Perioder för investering att uppnÃ¥ önskat värde" #: ../data/functions.xml.in.h:933 msgid "r:g_duration" msgstr "" #: ../data/functions.xml.in.h:934 msgid "" "Returns the number of periods needed for an investment to attain a desired " "value." msgstr "" "Returnerar antalet perioder som krävs för en investering att uppnÃ¥ ett " "önskat värde." #: ../data/functions.xml.in.h:935 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "Betalning för livränta som gÃ¥r mot kapital (PPMT)" #: ../data/functions.xml.in.h:936 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:937 msgid "" "Calculates the amount of a payment of an annuity going towards principal." " Type defines the due date. 1 for payment at the beginning of a " "period and 0 (default) for payment at the end of a period." msgstr "" "Beräknar summan av en betalning pÃ¥ en livränta som gÃ¥r mot kapital. " "Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 " "(förvald) för betalning i slutet av perioden." #: ../data/functions.xml.in.h:938 msgid "Desired future value" msgstr "Önskat framtida värde" #: ../data/functions.xml.in.h:939 msgid "Effective Interest Rate" msgstr "Effektiv räntesats" #: ../data/functions.xml.in.h:940 msgid "r:effect" msgstr "" #: ../data/functions.xml.in.h:941 msgid "Calculates the effective interest for a given nominal rate." msgstr "Beräknar den effektiva räntan frÃ¥n en given nominell räntesats." #: ../data/functions.xml.in.h:942 msgid "Nominal interest rate" msgstr "Nominell räntesats" #: ../data/functions.xml.in.h:943 msgid "Future Value" msgstr "Framtida värde" #: ../data/functions.xml.in.h:944 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:945 msgid "" "Computes the future value of an investment. This is based on periodic, " "constant payments and a constant interest rate. If type = 1 then " "the payment is made at the beginning of the period, If type = 0 (or omitted) " "it is made at the end of each period." msgstr "" "Beräknar anatalet perioder för investering baserad pÃ¥ periodiska, konstanta " "betalningar och konstant ränta. Typ anger när betalningarna sker. 1 " "för betalning i början av perioden och 0 (förvald) för betalning i slutet av " "perioden." #: ../data/functions.xml.in.h:946 msgid "Return on continuously compounded interest" msgstr "Avkastning pÃ¥ fortlöpande sammansatt ränta" #: ../data/functions.xml.in.h:947 msgid "r:continuous" msgstr "" #: ../data/functions.xml.in.h:948 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "" #: ../data/functions.xml.in.h:949 msgid "Principal" msgstr "" #: ../data/functions.xml.in.h:950 msgid "Compound" msgstr "Sammansatt" #: ../data/functions.xml.in.h:951 msgid "r:compound" msgstr "" #: ../data/functions.xml.in.h:952 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "" #: ../data/functions.xml.in.h:953 msgid "Periods per year" msgstr "Perioder per Ã¥r" #: ../data/functions.xml.in.h:954 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "Betalning för livränta som gÃ¥r mot ränta (IPMT)" #: ../data/functions.xml.in.h:955 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:956 msgid "" "Calculates the amount of a payment of an annuity going towards interest. " " Type defines the due date. 1 for payment at the beginning of a period " "and 0 (default) for payment at the end of a period." msgstr "" "Beräknar summan av en betalning pÃ¥ en livränta som gÃ¥r mot ränta. " "Typ anger när betalningarna sker. 1 för betalning i början av perioden och 0 " "(förvald) för betalning i slutet av perioden." #: ../data/functions.xml.in.h:957 msgid "Interest rate for a fully invested security" msgstr "Räntesats för betalt värdepapper" #: ../data/functions.xml.in.h:958 msgid "r:intrate" msgstr "" #: ../data/functions.xml.in.h:959 msgid "" "Returns the interest rate for a fully invested security. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" #: ../data/functions.xml.in.h:960 msgid "Investment" msgstr "Investering" #: ../data/functions.xml.in.h:961 msgid "Redemption" msgstr "Utlösande summa" #: ../data/functions.xml.in.h:962 msgid "Dollar Fraction" msgstr "Kronor till brÃ¥ktal" #: ../data/functions.xml.in.h:963 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:964 msgid "" "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "" #: ../data/functions.xml.in.h:965 msgid "Decimal dollar" msgstr "BrÃ¥ktal till kronor" #: ../data/functions.xml.in.h:966 msgid "Denominator of fraction" msgstr "BrÃ¥ktalets nämnare " #: ../data/functions.xml.in.h:967 msgid "Dollar Decimal" msgstr "Decimaltal" #: ../data/functions.xml.in.h:968 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:969 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "" #: ../data/functions.xml.in.h:970 msgid "Fractional dollar" msgstr "BrÃ¥ktal" #: ../data/functions.xml.in.h:971 msgid "Amount received at maturity for a security bond" msgstr "ErhÃ¥llet belopp för en säkerhet vid mognad" #: ../data/functions.xml.in.h:972 msgid "r:received" msgstr "" #: ../data/functions.xml.in.h:973 msgid "" "Returns the amount received at the maturity date for an invested security." " Basis is the type of day counting you want to use: 0: US 30/360 " "(default), 1: real days, 2: real days/360, 3: real days/365 or 4: European " "30/360. The settlement date must be before maturity date." msgstr "" #: ../data/functions.xml.in.h:974 msgid "Discount rate for a security" msgstr "Reduceringshastighet för säkerhet" #: ../data/functions.xml.in.h:975 msgid "r:disc" msgstr "" #: ../data/functions.xml.in.h:976 msgid "" "Returns the discount rate for a security. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" #: ../data/functions.xml.in.h:977 msgid "Accrued interest of security paying at maturity" msgstr "Ränta för en säkerhet frÃ¥n start till mognad" #: ../data/functions.xml.in.h:978 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:979 msgid "" "Returns the accrued interest for a security which pays interest at maturity " "date. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" #: ../data/functions.xml.in.h:980 msgid "Issue date" msgstr "Startdatum" #: ../data/functions.xml.in.h:981 msgid "Annual rate of security" msgstr "Ã…rlig hastighet" #: ../data/functions.xml.in.h:982 msgid "Par value" msgstr "Nominellt värde" #: ../data/functions.xml.in.h:983 msgid "Accrued interest of security with periodic interest payments" msgstr "Ränta för en säkerhet med periodisk ränta" #: ../data/functions.xml.in.h:984 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:985 msgid "" "Returns accrued interest for a security which pays periodic interest. " " Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. " "Basis is the type of day counting you want to use: 0: US 30/360 (default), " "1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" #: ../data/functions.xml.in.h:986 msgid "First interest" msgstr "Första ränteinbetalning" #: ../data/functions.xml.in.h:987 msgid "Frequency" msgstr "Frekvens" #: ../data/functions.xml.in.h:988 msgid "Number of coupons to be paid" msgstr "Antal förfallande kuponger" #: ../data/functions.xml.in.h:989 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:990 msgid "" "Returns the number of coupons to be paid between the settlement and the " "maturity. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" #: ../data/functions.xml.in.h:991 msgid "Price per $100 face value of a discounted security" msgstr "Pris per 100 kr nominellt värde för diskonterat värdepapper" #: ../data/functions.xml.in.h:992 msgid "r:pricedisc" msgstr "" #: ../data/functions.xml.in.h:993 msgid "" "Calculates and returns the price per $100 face value of a discounted " "security. The security does not pay interest at maturity. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Beräknar och returnerar priset per 100 kr värde av en diskonterad säkerhet. " "Säkerheten betalar inte ränta vid mognad. Dagsräkningssystem kan " "vara: 0: Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga " "dagar/360, 3: verkliga dagar/365, eller 4: Europeiskt 30/360" #: ../data/functions.xml.in.h:994 msgid "Discount" msgstr "Diskonto" #: ../data/functions.xml.in.h:995 msgid "Price per $100 face value of a security" msgstr "Pris per 100 kr nominellt värde för säkerhet" #: ../data/functions.xml.in.h:996 msgid "r:pricemat" msgstr "" #: ../data/functions.xml.in.h:997 msgid "" "Calculates and returns the price per $100 face value of a security. The " "security pays interest at maturity. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Beräknar och returnerar priset per $100 värde av en säkerhet. Säkerheten " "betalar ränta vid mognad. Dagsräkningssystem kan vara: 0: " "Amerikanskt 30/360 (förvald), 1: verkliga dagar, 2: verkliga dagar/360, 3: " "verkliga dagar/365, eller 4: Europeiskt 30/360" #: ../data/functions.xml.in.h:998 msgid "Annual yield" msgstr "Ã…rlig avkastning" #: ../data/functions.xml.in.h:999 msgid "Level-Coupon Bond" msgstr "Jämn kupongobligation" #: ../data/functions.xml.in.h:1000 msgid "r:level_coupon" msgstr "" #: ../data/functions.xml.in.h:1001 msgid "Calculates the value of a level-coupon bond." msgstr "" #: ../data/functions.xml.in.h:1002 msgid "Coupon rate" msgstr "Kupongränta" #: ../data/functions.xml.in.h:1003 msgid "Coupons per year" msgstr "Antal kuponger per Ã¥r" #: ../data/functions.xml.in.h:1004 msgid "Market interest rate" msgstr "Marknadsränta" #: ../data/planets.xml.in.h:1 msgid "Earth" msgstr "Jorden" #: ../data/planets.xml.in.h:2 msgid "Mars" msgstr "" #. Planet #: ../data/planets.xml.in.h:4 msgid "!planets!Mercury" msgstr "Merkurius" #: ../data/planets.xml.in.h:5 msgid "Venus" msgstr "" #: ../data/planets.xml.in.h:6 msgid "Jupiter" msgstr "" #: ../data/planets.xml.in.h:7 msgid "Saturn" msgstr "Saturnus" #: ../data/planets.xml.in.h:8 msgid "Neptune" msgstr "Neptunus" #: ../data/planets.xml.in.h:9 msgid "Pluto" msgstr "" #: ../data/planets.xml.in.h:10 msgid "Uranus" msgstr "" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Length" msgstr "Längd" #: ../data/units.xml.in.h:3 msgid "Meter" msgstr "" #: ../data/units.xml.in.h:4 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "a:m,meter" #: ../data/units.xml.in.h:5 msgid "Kilometer" msgstr "" #: ../data/units.xml.in.h:6 msgid "Decimeter" msgstr "" #: ../data/units.xml.in.h:7 msgid "Centimeter" msgstr "Centimeter" #: ../data/units.xml.in.h:8 msgid "Millimeter" msgstr "" #: ../data/units.xml.in.h:9 msgid "Nautical Mile" msgstr "Sjömil" #: ../data/units.xml.in.h:10 msgid "r:nautical_mile,p:nautical_miles" msgstr "sjömil" #: ../data/units.xml.in.h:11 msgid "Ångström" msgstr "Ã…ngström" #: ../data/units.xml.in.h:12 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:13 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:14 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:15 msgid "Inch" msgstr "Tum" #: ../data/units.xml.in.h:16 msgid "ar:in,inch,p:inches" msgstr "tum,a:in,inch" #: ../data/units.xml.in.h:17 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:18 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:19 msgid "Foot" msgstr "Engelsk Fot" #: ../data/units.xml.in.h:20 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:21 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:22 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:23 msgid "Link" msgstr "Länk" #: ../data/units.xml.in.h:24 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:25 msgid "Yard" msgstr "" #: ../data/units.xml.in.h:26 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:27 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:28 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:29 msgid "Fathom" msgstr "Famn" #: ../data/units.xml.in.h:30 msgid "r:fathom,p:fathoms" msgstr "" #: ../data/units.xml.in.h:31 msgid "Chain" msgstr "" #: ../data/units.xml.in.h:32 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:33 msgid "Furlong" msgstr "" #: ../data/units.xml.in.h:34 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:35 msgid "Mile" msgstr "" #: ../data/units.xml.in.h:36 msgid "ar:mi,mile,p:miles" msgstr "" #: ../data/units.xml.in.h:37 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:38 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:39 msgid "Mil (1/1000 in)" msgstr "" #: ../data/units.xml.in.h:40 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:41 msgid "Astronomical Unit" msgstr "Astronomisk enhet" #: ../data/units.xml.in.h:42 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "a:AU,astronomisk_enhet,p:astronomiska_enheter" #: ../data/units.xml.in.h:43 msgid "Light Year" msgstr "LjusÃ¥r" #: ../data/units.xml.in.h:44 msgid "ar:ly,lightyear,p:lightyears" msgstr "a:ly,ljusÃ¥r" #: ../data/units.xml.in.h:45 msgid "Parsec" msgstr "" #: ../data/units.xml.in.h:46 msgid "ar:pc,parsec,p:parsecs" msgstr "a:pc,parsek,p:parseks" #: ../data/units.xml.in.h:47 msgid "Pied du roi (French Royal Foot)" msgstr "" #: ../data/units.xml.in.h:48 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:49 msgid "Pouce (French Royal Inch)" msgstr "" #: ../data/units.xml.in.h:50 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:51 msgid "Ligne" msgstr "" #: ../data/units.xml.in.h:52 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:53 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:54 msgid "r:toise" msgstr "" #. Unit category #: ../data/units.xml.in.h:56 msgid "!units!Angle" msgstr "Vinkel" #: ../data/units.xml.in.h:57 msgid "Plane Angle" msgstr "Planvinkel" #: ../data/units.xml.in.h:58 msgid "Meter per Meter" msgstr "Meter per meter" #: ../data/units.xml.in.h:59 msgid "Radian" msgstr "Radian" #: ../data/units.xml.in.h:60 msgid "ar:rad,radian,p:radians" msgstr "" #: ../data/units.xml.in.h:62 msgid "ar:deg,au:°,degree,p:degrees" msgstr "a:deg,au:°,grad,p:grader" #: ../data/units.xml.in.h:63 msgid "Gradian (Gon)" msgstr "Gradient (Gon)" #: ../data/units.xml.in.h:64 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "" #: ../data/units.xml.in.h:65 msgid "Arcminute" msgstr "BÃ¥gminut" #: ../data/units.xml.in.h:66 msgid "ar:arcmin,arcminute,p:arcminutes" msgstr "bÃ¥gminut,p:bÃ¥gminuter" #: ../data/units.xml.in.h:67 msgid "Arcsecond" msgstr "BÃ¥gsekund" #: ../data/units.xml.in.h:68 msgid "ar:arcsec,arcsecond,p:arcseconds" msgstr "bÃ¥gsekund,p:bÃ¥gsekunder" #: ../data/units.xml.in.h:69 msgid "Turn" msgstr "" #: ../data/units.xml.in.h:70 msgid "r:turn,p:turns" msgstr "" #: ../data/units.xml.in.h:71 msgid "Solid Angle" msgstr "Rymdvinkel" #: ../data/units.xml.in.h:72 msgid "Square Meter per Square Meter" msgstr "Kvadratmeter per kvadratmeter" #: ../data/units.xml.in.h:73 msgid "Steradian" msgstr "Steradian" #: ../data/units.xml.in.h:74 msgid "ar:sr,steradian,p:steradians" msgstr "" #: ../data/units.xml.in.h:75 msgid "Angular Acceleration" msgstr "Vinkelacceleration" #: ../data/units.xml.in.h:76 msgid "Radians per Second Squared" msgstr "Radianter per kvadratsekund" #: ../data/units.xml.in.h:77 msgid "Angular Velocity" msgstr "Vinkelhastighet" #: ../data/units.xml.in.h:78 msgid "Radians per Second" msgstr "Radianter per sekund" #. Unit category #: ../data/units.xml.in.h:80 msgid "!units!Mass" msgstr "Massa" #: ../data/units.xml.in.h:81 msgid "Gram" msgstr "" #: ../data/units.xml.in.h:82 msgid "ar:g,gram,p:grams" msgstr "a:g,gram" #: ../data/units.xml.in.h:83 msgid "Kilogram" msgstr "" #: ../data/units.xml.in.h:84 msgid "Hectogram" msgstr "Hektogram" #: ../data/units.xml.in.h:85 msgid "Metric Ton (Tonne)" msgstr "Ton" #: ../data/units.xml.in.h:86 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "a:t,ton" #: ../data/units.xml.in.h:87 msgid "Grain" msgstr "" #: ../data/units.xml.in.h:88 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:89 msgid "Pennyweight" msgstr "" #: ../data/units.xml.in.h:90 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:91 msgid "Ounce (troy)" msgstr "" #: ../data/units.xml.in.h:92 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:93 msgid "Pound (troy)" msgstr "Pund (troy)" #: ../data/units.xml.in.h:94 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:95 msgid "Dram" msgstr "" #: ../data/units.xml.in.h:96 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:97 msgid "Ounce" msgstr "" #: ../data/units.xml.in.h:98 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:99 msgid "Pound" msgstr "Pund" #: ../data/units.xml.in.h:100 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:101 msgid "Short Hundredweight (Cental)" msgstr "" #: ../data/units.xml.in.h:102 msgid "ar:cwt,hundredweight,cental,p:hundredweights,centals" msgstr "" #: ../data/units.xml.in.h:103 msgid "Long Hundredweight" msgstr "" #: ../data/units.xml.in.h:104 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:105 msgid "Short Ton" msgstr "" #: ../data/units.xml.in.h:106 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:107 msgid "Long Ton" msgstr "" #: ../data/units.xml.in.h:108 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:109 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:110 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:111 msgid "Carat" msgstr "Karat" #: ../data/units.xml.in.h:112 msgid "r:carat,p:carats" msgstr "karat" #: ../data/units.xml.in.h:113 msgid "Pfund" msgstr "" #: ../data/units.xml.in.h:114 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:115 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:116 msgid "r:zentner" msgstr "" #: ../data/units.xml.in.h:118 msgid "Kilogram per Cubic Meter" msgstr "Kilogram per kubikmeter" #: ../data/units.xml.in.h:119 msgid "Gram per Cubic Decimeter" msgstr "Gram per kubikdecimeter" #: ../data/units.xml.in.h:120 msgid "Gram per Cubic Centimeter" msgstr "Gram per kubikcentimeter" #: ../data/units.xml.in.h:121 msgid "Atomic Mass" msgstr "Atommassa" #: ../data/units.xml.in.h:122 msgid "Gram per Mole" msgstr "Gram per mol" #: ../data/units.xml.in.h:123 msgid "Atomic Mass Unit" msgstr "Atommassenhet" #: ../data/units.xml.in.h:124 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "a:u,a:AMU,atommassenhet,p:atommassenheter" #: ../data/units.xml.in.h:125 msgid "Dalton" msgstr "" #: ../data/units.xml.in.h:126 msgid "ar:Da,dalton,p:daltons" msgstr "" #: ../data/units.xml.in.h:127 msgid "Kilodalton" msgstr "Kilodalton" #: ../data/units.xml.in.h:128 msgid "Mass Fraction" msgstr "MassbrÃ¥k" #: ../data/units.xml.in.h:129 msgid "Kilogram per Kilogram" msgstr "Kilogram per kilogram" #: ../data/units.xml.in.h:132 msgid "ar:s,second,p:seconds" msgstr "a:s,sekund,p:sekunder" #: ../data/units.xml.in.h:134 msgid "ar:min,minute,p:minutes" msgstr "a:min,minut,p:minuter" #: ../data/units.xml.in.h:136 msgid "ar:h,hour,p:hours" msgstr "a:h,timme,p:timmar" #: ../data/units.xml.in.h:138 msgid "ar:d,day,p:days" msgstr "a:d,dag,day,p:dagar,days" #: ../data/units.xml.in.h:139 msgid "Week" msgstr "Vecka" #: ../data/units.xml.in.h:140 msgid "r:week,p:weeks" msgstr "vecka,p:veckor" #: ../data/units.xml.in.h:141 msgid "Fortnight" msgstr "" #: ../data/units.xml.in.h:142 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:143 msgid "Julian Year" msgstr "Julianskt Ã¥r" #: ../data/units.xml.in.h:144 msgid "r:year,p:years" msgstr "Ã¥r" #: ../data/units.xml.in.h:146 msgid "r:month,p:months" msgstr "a:mÃ¥nad,p:mÃ¥nader" #. Unit category #: ../data/units.xml.in.h:148 msgid "!units!Frequency" msgstr "Frekvens" #: ../data/units.xml.in.h:149 msgid "Hertz" msgstr "" #: ../data/units.xml.in.h:150 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:151 msgid "Electricity" msgstr "Elektricitet" #: ../data/units.xml.in.h:152 msgid "Electric Current" msgstr "Elektrisk ström" #: ../data/units.xml.in.h:153 msgid "Ampere" msgstr "Ampere" #: ../data/units.xml.in.h:154 msgid "ar:A,ampere,p:amperes" msgstr "a:A,ampere" #: ../data/units.xml.in.h:155 msgid "Abampere" msgstr "Abampere" #: ../data/units.xml.in.h:156 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:157 msgid "Current Density" msgstr "Strömtäthet" #: ../data/units.xml.in.h:158 msgid "Ampere per Meter Squared" msgstr "Ampere per kvadratmeter" #: ../data/units.xml.in.h:159 msgid "Electric Charge" msgstr "Elektrisk laddning" #: ../data/units.xml.in.h:160 msgid "Second Ampere" msgstr "Sekundampere" #: ../data/units.xml.in.h:161 msgid "Coulomb" msgstr "Coulomb" #: ../data/units.xml.in.h:162 msgid "ar:C,coulomb,p:coulombs" msgstr "a:C,coulomb" #: ../data/units.xml.in.h:163 msgid "Abcoulomb" msgstr "Abcoulomb" #: ../data/units.xml.in.h:164 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:165 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:166 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:167 msgid "Electric Charge Density" msgstr "Laddningstäthet" #: ../data/units.xml.in.h:168 msgid "Coulomb per Cubic Meter" msgstr "Coulomb per kubikmeter" #: ../data/units.xml.in.h:169 msgid "Electric Flux Density" msgstr "Elektrisk flödestäthet" #: ../data/units.xml.in.h:170 msgid "Coulomb per Meter Squared" msgstr "Coulomb per kvadratmeter" #: ../data/units.xml.in.h:171 msgid "Electric Potential" msgstr "Elektrisk potential" #: ../data/units.xml.in.h:172 msgid "Watt per Ampere" msgstr "Watt per ampere" #: ../data/units.xml.in.h:173 msgid "Volt" msgstr "" #: ../data/units.xml.in.h:174 msgid "ar:V,volt,p:volts" msgstr "a:V,volt" #: ../data/units.xml.in.h:175 msgid "Statvolt" msgstr "" #: ../data/units.xml.in.h:176 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:177 msgid "Abvolt" msgstr "Abvolt" #: ../data/units.xml.in.h:178 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:179 msgid "Capacitance" msgstr "Kapasitans" #: ../data/units.xml.in.h:180 msgid "Coulomb per Volt" msgstr "Coloumb per volt" #: ../data/units.xml.in.h:181 msgid "Farad" msgstr "" #: ../data/units.xml.in.h:182 msgid "ar:F,farad,p:farads" msgstr "a:F,farad" #: ../data/units.xml.in.h:183 msgid "Electric Resistance" msgstr "Resistans" #: ../data/units.xml.in.h:184 msgid "Volt per Ampere" msgstr "Volt per ampere" #: ../data/units.xml.in.h:185 msgid "Ohm" msgstr "" #: ../data/units.xml.in.h:186 msgid "au:Ω,r:ohm,p:ohms" msgstr "au:Ω,ohm" #: ../data/units.xml.in.h:187 msgid "Abohm" msgstr "Abohm" #: ../data/units.xml.in.h:188 msgid "r:abohm,p:abohms,au:abΩ" msgstr "" #: ../data/units.xml.in.h:189 msgid "Statohm" msgstr "" #: ../data/units.xml.in.h:190 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:191 msgid "Electric Conductance" msgstr "Induktion" #: ../data/units.xml.in.h:192 msgid "Ampere per Volt" msgstr "Ampere per volt" #: ../data/units.xml.in.h:193 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:194 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:195 msgid "Electric Field Strength" msgstr "Elektrisk fältstyrka" #: ../data/units.xml.in.h:196 msgid "Volt per Meter" msgstr "Volt per meter" #: ../data/units.xml.in.h:197 msgid "Permittivity" msgstr "Permitivitet" #: ../data/units.xml.in.h:198 msgid "Farad per Meter" msgstr "Farad per meter" #: ../data/units.xml.in.h:199 msgid "Inductance" msgstr "Induktans" #: ../data/units.xml.in.h:200 msgid "Weber per Ampere" msgstr "Weber per ampere" #: ../data/units.xml.in.h:201 msgid "Henry" msgstr "" #: ../data/units.xml.in.h:202 msgid "ar:H,henry,p:henrys" msgstr "a:H,henry" #: ../data/units.xml.in.h:203 msgid "Permeability" msgstr "Permeabilitet" #: ../data/units.xml.in.h:204 msgid "Henry per Meter" msgstr "Henry per meter" #: ../data/units.xml.in.h:205 msgid "Temperature" msgstr "Temperatur" #: ../data/units.xml.in.h:206 msgid "Kelvin" msgstr "" #: ../data/units.xml.in.h:207 msgid "ar:K,kelvin,p:kelvins" msgstr "a:K,kelvin" #: ../data/units.xml.in.h:208 msgid "Degree Celsius" msgstr "Grader Celsius" #: ../data/units.xml.in.h:209 msgid "" "ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades" msgstr "ar:oC,au:°C,au:℃,r:celsius" #: ../data/units.xml.in.h:210 msgid "Degree Rankine" msgstr "Grader Rankine" #: ../data/units.xml.in.h:211 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:212 msgid "Degree Fahrenheit" msgstr "Grader Fahrenheit" #: ../data/units.xml.in.h:213 msgid "ar:oF,au:°F,au:℉,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:214 msgid "Substance" msgstr "Substans" #: ../data/units.xml.in.h:215 msgid "Mole" msgstr "Mol" #: ../data/units.xml.in.h:216 msgid "ar:mol,mole,p:moles" msgstr "mol" #: ../data/units.xml.in.h:217 msgid "Einstein" msgstr "" #: ../data/units.xml.in.h:218 msgid "r:einstein,p:einsteins" msgstr "einstein" #: ../data/units.xml.in.h:219 msgid "Substance Concentration" msgstr "Substanskoncentration" #: ../data/units.xml.in.h:220 msgid "Mole per Cubic Meter" msgstr "Mol per kubikmeter" #: ../data/units.xml.in.h:221 msgid "Catalytic Activity" msgstr "Katalytisk aktivitet" #: ../data/units.xml.in.h:222 msgid "Reciprocal Seconds Mole" msgstr "Reciproka sekundmol" #: ../data/units.xml.in.h:223 msgid "Katal" msgstr "" #: ../data/units.xml.in.h:224 msgid "ar:kat,katal,p:katals" msgstr "a:kat,katal" #: ../data/units.xml.in.h:225 msgid "Catalytic Concentration" msgstr "Katalytisk koncentration" #: ../data/units.xml.in.h:226 msgid "Katal per Cubic Meter" msgstr "Katal per kubikmeter" #: ../data/units.xml.in.h:227 msgid "Light" msgstr "Ljus" #: ../data/units.xml.in.h:228 msgid "Luminous Intensity" msgstr "Luminansintensitet" #: ../data/units.xml.in.h:229 msgid "Candela" msgstr "Candela" #: ../data/units.xml.in.h:230 msgid "ar:cd,candela,p:candelas" msgstr "a:cd,candela" #: ../data/units.xml.in.h:231 msgid "Luminance" msgstr "Luminans" #: ../data/units.xml.in.h:232 msgid "Candela per Meter Squared" msgstr "Candela per kvadratmeter" #: ../data/units.xml.in.h:233 msgid "Stilb" msgstr "" #: ../data/units.xml.in.h:234 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:235 msgid "Luminous Flux" msgstr "Luminansflöde" #: ../data/units.xml.in.h:236 msgid "Candela Steradian" msgstr "Candelasteradian" #: ../data/units.xml.in.h:237 msgid "Lumen" msgstr "" #: ../data/units.xml.in.h:238 msgid "ar:lm,lumen,p:lumens" msgstr "a:lm,lumen" #: ../data/units.xml.in.h:239 msgid "Illuminance" msgstr "Illuminans" #: ../data/units.xml.in.h:240 msgid "Lumen per Meter Squared" msgstr "Lumen per kvadratmeter" #: ../data/units.xml.in.h:241 msgid "Lumen per Foot Squared" msgstr "Lumen per kvadratfor" #: ../data/units.xml.in.h:242 msgid "Lux" msgstr "" #: ../data/units.xml.in.h:243 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:244 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:245 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:246 msgid "Phot" msgstr "" #: ../data/units.xml.in.h:247 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:248 msgid "Radiant Intensity" msgstr "StrÃ¥lningsstyrka" #: ../data/units.xml.in.h:249 msgid "Watt per Steradian" msgstr "Watt per steradian" #: ../data/units.xml.in.h:250 msgid "Irradiance" msgstr "Irradians" #: ../data/units.xml.in.h:251 msgid "Watt per Meter Squared" msgstr "Watt per kvadratmeter" #: ../data/units.xml.in.h:252 msgid "Einstein per Meter Squared per Second" msgstr "Einsteins per kvadratmeter per sekund" #: ../data/units.xml.in.h:253 msgid "Microeinstein per Meter Squared per Second" msgstr "Kikroeinstein per kvadratmeter per sekund" #: ../data/units.xml.in.h:254 msgid "Radiance" msgstr "Radians" #: ../data/units.xml.in.h:255 msgid "Watt per Square Meter Steradian" msgstr "Watt per steradiankvadratmeter" #: ../data/units.xml.in.h:256 msgid "Area" msgstr "" #: ../data/units.xml.in.h:257 msgid "Square Meter" msgstr "Kvadratmeter" #: ../data/units.xml.in.h:258 msgid "Square Kilometer" msgstr "Kvadratkilometer" #: ../data/units.xml.in.h:259 msgid "Are" msgstr "Ar" #: ../data/units.xml.in.h:260 msgid "ar:a,are,p:ares" msgstr "a:a,ar,are" #: ../data/units.xml.in.h:261 msgid "Hectare" msgstr "Hektar" #: ../data/units.xml.in.h:262 msgid "ar:ha,hectare,p:hectares" msgstr "a:ha,hektar,hectare" #: ../data/units.xml.in.h:263 msgid "Decare" msgstr "Dekar" #: ../data/units.xml.in.h:264 msgid "a:da,r:decare,p:decares" msgstr "a:da,dekar,decare" #: ../data/units.xml.in.h:265 msgid "Barn" msgstr "" #: ../data/units.xml.in.h:266 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:267 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:268 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:269 msgid "Acre" msgstr "" #: ../data/units.xml.in.h:270 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:271 msgid "Section" msgstr "" #: ../data/units.xml.in.h:272 msgid "r:section,p:sections" msgstr "" #: ../data/units.xml.in.h:273 msgid "Township" msgstr "" #: ../data/units.xml.in.h:274 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:275 msgid "Square Foot" msgstr "Kvadratfot" #: ../data/units.xml.in.h:276 msgid "Square Inch" msgstr "Kvadrattum" #: ../data/units.xml.in.h:277 msgid "Square Mile" msgstr "Kvadratmile" #: ../data/units.xml.in.h:278 msgid "Volume" msgstr "Volym" #: ../data/units.xml.in.h:279 msgid "Cubic Meter" msgstr "Kubikmeter" #: ../data/units.xml.in.h:280 msgid "Liter" msgstr "" #: ../data/units.xml.in.h:281 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "a:L,a:l,liter" #: ../data/units.xml.in.h:282 msgid "Milliliter" msgstr "" #: ../data/units.xml.in.h:283 msgid "Centiliter" msgstr "Centiliter" #: ../data/units.xml.in.h:284 msgid "Deciliter" msgstr "" #: ../data/units.xml.in.h:285 msgid "Cubic Inch" msgstr "Kubiktum" #: ../data/units.xml.in.h:286 msgid "Fuel Economy" msgstr "Bränsleförbrukning" #: ../data/units.xml.in.h:287 msgid "Liter per Kilometer" msgstr "Liter per kilometer" #: ../data/units.xml.in.h:288 msgid "Kilometer per Liter" msgstr "Kilometer per liter" #: ../data/units.xml.in.h:289 msgid "Miles per Gallon" msgstr "" #: ../data/units.xml.in.h:290 msgid "a-cr:mpg" msgstr "" #: ../data/units.xml.in.h:291 msgid "Cooking" msgstr "Matlagning" #: ../data/units.xml.in.h:292 msgid "Teaspoon" msgstr "Tesked" #: ../data/units.xml.in.h:293 msgid "r:teaspoon,p:teaspoons" msgstr "tesked,p:teskedar" #: ../data/units.xml.in.h:294 msgid "Dessertspoon" msgstr "Dessertsked" #: ../data/units.xml.in.h:295 msgid "r:dessertspoon,p:dessertspoons" msgstr "dessertsked,p:dessertskedar" #: ../data/units.xml.in.h:296 msgid "Tablespoon" msgstr "Matsked" #: ../data/units.xml.in.h:297 msgid "r:tablespoon,p:tablespoons" msgstr "matsked,p:matskedar" #: ../data/units.xml.in.h:298 msgid "Cup (U.S.)" msgstr "" #: ../data/units.xml.in.h:299 msgid "r:cup,p:cups" msgstr "" #: ../data/units.xml.in.h:300 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:301 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:302 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:303 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:304 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:305 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:306 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:307 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:308 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:309 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:310 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:311 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:312 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:313 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:314 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:315 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:316 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:317 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:318 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:319 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:320 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:321 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:322 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:323 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:324 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:325 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:326 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:327 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:328 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:329 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:330 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:331 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:332 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:333 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:334 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:335 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:336 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:337 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:338 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:339 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:340 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:341 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:342 msgid "U.S. Barrel (oil)" msgstr "" #: ../data/units.xml.in.h:343 msgid "ar:bbl,barrel,p:barrels" msgstr "" #: ../data/units.xml.in.h:344 msgid "Specific Volume" msgstr "Specifik volym" #: ../data/units.xml.in.h:345 msgid "Cubic Meter per Kilogram" msgstr "Kubikmeter per kilogram" #: ../data/units.xml.in.h:346 msgid "Speed" msgstr "Hastighet" #: ../data/units.xml.in.h:347 msgid "Meter per Second" msgstr "Meter per sekund" #: ../data/units.xml.in.h:348 msgid "Kilometer per Hour" msgstr "Kilometer per timme" #: ../data/units.xml.in.h:349 msgid "Nautical Mile per Hour" msgstr "Sjömil per timme" #: ../data/units.xml.in.h:350 msgid "Knot" msgstr "Knop" #: ../data/units.xml.in.h:351 msgid "r:knot,p:knots" msgstr "knop" #: ../data/units.xml.in.h:352 msgid "Miles per Hour" msgstr "Miles per Hour" #: ../data/units.xml.in.h:353 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:354 msgid "Acceleration" msgstr "Acceleration" #: ../data/units.xml.in.h:355 msgid "Meter per Second Squared" msgstr "Meter per kvadratsekund" #: ../data/units.xml.in.h:356 msgid "Galileo" msgstr "" #: ../data/units.xml.in.h:357 msgid "ar:Gal,galileo,p:galileos" msgstr "a:Gal,galileo" #: ../data/units.xml.in.h:358 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:359 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:360 msgid "Magnetism" msgstr "Magnetism" #: ../data/units.xml.in.h:361 msgid "Wave Number" msgstr "VÃ¥gtal" #: ../data/units.xml.in.h:362 msgid "Reciprocal Meter" msgstr "Reciproka meter" #: ../data/units.xml.in.h:363 msgid "Magnetic Field Strength" msgstr "Magnetisk fältstyrka" #: ../data/units.xml.in.h:364 msgid "Ampere per Meter" msgstr "Ampere per meter" #: ../data/units.xml.in.h:365 msgid "Oersted" msgstr "" #: ../data/units.xml.in.h:366 msgid "ar:Oe,oersted,p:oersteds" msgstr "a:Oe,oersted" #: ../data/units.xml.in.h:367 msgid "Magnetic Flux" msgstr "Magnetiskt flöde" #: ../data/units.xml.in.h:368 msgid "Volt Seconds" msgstr "Voltsekund" #: ../data/units.xml.in.h:369 msgid "Weber" msgstr "" #: ../data/units.xml.in.h:370 msgid "ar:Wb,weber,p:webers" msgstr "a:Wb,weber" #: ../data/units.xml.in.h:371 msgid "Maxwell" msgstr "" #: ../data/units.xml.in.h:372 msgid "ar:Mx,maxwell,p:maxwells" msgstr "a:Mx,maxwell" #: ../data/units.xml.in.h:373 msgid "Magnetic Flux Density" msgstr "Magnetisk flödestäthet" #: ../data/units.xml.in.h:374 msgid "Weber per Meter Squared" msgstr "Weber per kvadratmeter" #: ../data/units.xml.in.h:375 msgid "Tesla" msgstr "" #: ../data/units.xml.in.h:376 msgid "ar:T,tesla,p:teslas" msgstr "a:T,tesla" #: ../data/units.xml.in.h:377 msgid "Gauss" msgstr "" #: ../data/units.xml.in.h:378 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:379 msgid "Force" msgstr "Kraft" #: ../data/units.xml.in.h:380 msgid "Meter Kilogram per Second Squared" msgstr "Meterkilogram per kvadratsekund" #: ../data/units.xml.in.h:381 msgid "Newton" msgstr "" #: ../data/units.xml.in.h:382 msgid "ar:N,newton,p:newtons" msgstr "a:N,newton" #: ../data/units.xml.in.h:383 msgid "Dyne" msgstr "" #: ../data/units.xml.in.h:384 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:385 msgid "Pound-force" msgstr "" #: ../data/units.xml.in.h:386 msgid "ar:lbf,pound_force" msgstr "" #: ../data/units.xml.in.h:387 msgid "Pound Foot per Second Squared" msgstr "Pundfot per kvadratsekund" #: ../data/units.xml.in.h:388 msgid "Poundal" msgstr "" #: ../data/units.xml.in.h:389 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:390 msgid "Pond (Gram-Force)" msgstr "" #: ../data/units.xml.in.h:391 msgid "r:pond,p:ponds,a:gf" msgstr "" #: ../data/units.xml.in.h:392 msgid "Kilopond (Kilogram-Force)" msgstr "" #: ../data/units.xml.in.h:393 msgid "Moment of Force" msgstr "Kraftmoment" #: ../data/units.xml.in.h:394 msgid "Newton Meter" msgstr "Newtonmeter" #: ../data/units.xml.in.h:395 msgid "Pressure" msgstr "Tryck" #: ../data/units.xml.in.h:396 msgid "Newton per Meter Squared" msgstr "Newton per kvadratmeter" #: ../data/units.xml.in.h:397 msgid "Pound-force per Square Inch" msgstr "Pound-force per kvadrattum" #: ../data/units.xml.in.h:398 msgid "Pascal" msgstr "" #: ../data/units.xml.in.h:399 msgid "ar:Pa,pascal,p:pascals" msgstr "a:Pa,pascal" #: ../data/units.xml.in.h:400 msgid "Pound-force per Square Inch (psi)" msgstr "Pound-force per kvadrattum (psi)" #: ../data/units.xml.in.h:401 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:402 msgid "Bar" msgstr "Bar" #: ../data/units.xml.in.h:403 msgid "r:bar,p:bars" msgstr "" #: ../data/units.xml.in.h:404 msgid "Atmosphere" msgstr "Atmosfär" #: ../data/units.xml.in.h:405 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "a:atm,atmosfär,p:atmosfärer" #: ../data/units.xml.in.h:406 msgid "Torr" msgstr "" #: ../data/units.xml.in.h:407 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:408 msgid "Millimeter of Mercury" msgstr "Millimeter kvicksilver" #: ../data/units.xml.in.h:409 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:410 msgid "Inch of Mercury" msgstr "Fot kvicksilver" #: ../data/units.xml.in.h:411 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:412 msgid "Dynamic Viscosity" msgstr "Dynamisk viskositet" #: ../data/units.xml.in.h:413 msgid "Pascal Second" msgstr "Pascalsekund" #: ../data/units.xml.in.h:414 msgid "Poise" msgstr "" #: ../data/units.xml.in.h:415 msgid "ar:P,poise,p:poises" msgstr "a:P,poise" #: ../data/units.xml.in.h:416 msgid "Kinematic Viscosity" msgstr "Kinematisk viskositet" #: ../data/units.xml.in.h:417 msgid "Square Meter per Second" msgstr "Kvadratmeter per sekund" #: ../data/units.xml.in.h:418 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:419 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:420 msgid "Surface Tension" msgstr "Ytspänning" #: ../data/units.xml.in.h:421 msgid "Newton per Meter" msgstr "Newton per meter" #: ../data/units.xml.in.h:422 msgid "Energy" msgstr "Energi" #: ../data/units.xml.in.h:423 msgid "Joule" msgstr "" #: ../data/units.xml.in.h:424 msgid "ar:J,joule,p:joules" msgstr "a:J,joule" #: ../data/units.xml.in.h:425 msgid "Watt Hour" msgstr "Watttimme" #: ../data/units.xml.in.h:426 msgid "Kilowatt Hour" msgstr "Kilowatttimme" #: ../data/units.xml.in.h:427 msgid "Calorie (international table)" msgstr "Kalorier (international table)" #: ../data/units.xml.in.h:428 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "ais:cal_IT,a:cal,c:kalori,cp:kalorier" #: ../data/units.xml.in.h:429 msgid "Calorie (capital C)" msgstr "Kalorier (med stort K)" #: ../data/units.xml.in.h:430 msgid "cr:Calorie,cp:Calories" msgstr "" #: ../data/units.xml.in.h:431 msgid "Calorie (thermochemical)" msgstr "Kalorier (termokemiska)" #: ../data/units.xml.in.h:432 msgid "ars:cal_th" msgstr "" #: ../data/units.xml.in.h:433 msgid "Gram of TNT" msgstr "Gram TNT" #: ../data/units.xml.in.h:434 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:435 msgid "Ton of TNT" msgstr "Ton TNT" #: ../data/units.xml.in.h:436 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:437 msgid "Calorie (15 degrees Celsius)" msgstr "Kalorier (15 grader Celsius)" #: ../data/units.xml.in.h:438 msgid "ars:cal_fifteen" msgstr "as:cal_femton" #: ../data/units.xml.in.h:439 msgid "Calorie (mean)" msgstr "Kalorier (medel)" #: ../data/units.xml.in.h:440 msgid "ars:cal_mean" msgstr "as:cal_medel" #: ../data/units.xml.in.h:441 msgid "British Thermal Unit (IT)" msgstr "" #: ../data/units.xml.in.h:442 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:443 msgid "Electron Volt" msgstr "Elektronvolt" #: ../data/units.xml.in.h:444 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "a:eV,elektronvolt" #: ../data/units.xml.in.h:445 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:446 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:447 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:448 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:449 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:450 msgid "Hartree" msgstr "" #: ../data/units.xml.in.h:451 msgid "ar:Ha,as:E_h,hartree" msgstr "" #: ../data/units.xml.in.h:452 msgid "Rydberg" msgstr "Rydberg" #: ../data/units.xml.in.h:453 msgid "ar:Ry,s:rydberg_unit" msgstr "ar:Ry,s:rydberg_enhet" #: ../data/units.xml.in.h:454 msgid "Specific Energy" msgstr "Specifik energi" #: ../data/units.xml.in.h:455 msgid "Joule per Kilogram" msgstr "Joule per kilogram" #: ../data/units.xml.in.h:456 msgid "Power" msgstr "Effekt" #: ../data/units.xml.in.h:457 msgid "Joule per Second" msgstr "Joule per sekund" #: ../data/units.xml.in.h:458 msgid "Watt" msgstr "" #: ../data/units.xml.in.h:459 msgid "ar:W,watt,p:watts" msgstr "a:W,watt" #: ../data/units.xml.in.h:460 msgid "Horse Power" msgstr "Hästkraft" #: ../data/units.xml.in.h:461 msgid "ar:hp,horsepower,p:horsepowers" msgstr "a:hp,hästkraft,p:hästkrafter" #: ../data/units.xml.in.h:462 msgid "Pferdestärke" msgstr "" #: ../data/units.xml.in.h:463 msgid "ar:PS,u:pferdestärke" msgstr "" #: ../data/units.xml.in.h:464 msgid "Entropy" msgstr "Entropi" #: ../data/units.xml.in.h:465 msgid "Joule per Kelvin" msgstr "Joule per Kelvin" #: ../data/units.xml.in.h:466 msgid "Specific Entropy" msgstr "Specifik entropi" #: ../data/units.xml.in.h:467 msgid "Joule per Kilogram Kelvin" msgstr "Joule per kilogram kelvin" #: ../data/units.xml.in.h:468 msgid "Thermal Conductivity" msgstr "Termisk konduktivitet" #: ../data/units.xml.in.h:469 msgid "Watt per Meter Kelvin" msgstr "Watt per meter kelvin" #: ../data/units.xml.in.h:470 msgid "Energy Density" msgstr "Energitäthet" #: ../data/units.xml.in.h:471 msgid "Joule per Cubic Meter" msgstr "Joule per kubikmeter" #: ../data/units.xml.in.h:472 msgid "Molar Energy" msgstr "Molarenergi" #: ../data/units.xml.in.h:473 msgid "Joule per Mole" msgstr "Joule per mol" #: ../data/units.xml.in.h:474 msgid "Molar Entropy" msgstr "Molarentropi" #: ../data/units.xml.in.h:475 msgid "Joule per Mole Kelvin" msgstr "Joule per mol kelvin" #: ../data/units.xml.in.h:476 msgid "Radioactivity" msgstr "Radioaktivitet" #: ../data/units.xml.in.h:477 msgid "Becquerel" msgstr "Becquerel" #: ../data/units.xml.in.h:478 msgid "ar:Bq,becquerel,p:becquerels" msgstr "a:Bq,becquerel" #: ../data/units.xml.in.h:479 msgid "Curie" msgstr "" #: ../data/units.xml.in.h:480 msgid "ar:Ci,curie,p:curies" msgstr "a:Ci,curie" #: ../data/units.xml.in.h:481 msgid "Absorbed Dose" msgstr "Absorberad dos" #: ../data/units.xml.in.h:482 msgid "Gray" msgstr "" #: ../data/units.xml.in.h:483 msgid "ar:Gy,gray,p:grays" msgstr "a:Gy,gray" #: ../data/units.xml.in.h:484 msgid "Rad" msgstr "Rad" #: ../data/units.xml.in.h:485 msgid "r:rad_radioactivity" msgstr "rad_radioaktivitet" #: ../data/units.xml.in.h:486 msgid "Dose Equivalent" msgstr "Dosekvivalent" #: ../data/units.xml.in.h:487 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:488 msgid "ar:Sv,sievert,p:sieverts" msgstr "a:Sv,sievert" #: ../data/units.xml.in.h:489 msgid "Rem" msgstr "" #: ../data/units.xml.in.h:490 msgid "r:rem_radioactivity" msgstr "rem_radioaktivitet" #: ../data/units.xml.in.h:491 msgid "Exposure" msgstr "Exponering" #: ../data/units.xml.in.h:492 msgid "Coulomb per Kilogram" msgstr "Coloumb per kilogram" #: ../data/units.xml.in.h:493 msgid "Roentgen" msgstr "Röntgen" #: ../data/units.xml.in.h:494 msgid "ar:R,roentgen,p:roentgens" msgstr "a:R,roentgen" #: ../data/units.xml.in.h:495 msgid "Absorbed Dose Rate" msgstr "Absorberad dosrat" #: ../data/units.xml.in.h:496 msgid "Gray per Second" msgstr "Gray per sekund" #: ../data/units.xml.in.h:497 msgid "Ratio" msgstr "" #: ../data/units.xml.in.h:498 msgid "Neper" msgstr "" #: ../data/units.xml.in.h:499 msgid "ar:Np,neper,p:nepers" msgstr "a:Np,neper" #: ../data/units.xml.in.h:500 msgid "Bel" msgstr "" #: ../data/units.xml.in.h:501 msgid "ar:B,bel,p:bels" msgstr "a:B,bel" #: ../data/units.xml.in.h:502 msgid "Decibel" msgstr "" #: ../data/units.xml.in.h:503 msgid "Information" msgstr "" #: ../data/units.xml.in.h:504 msgid "Bit" msgstr "Bit" #: ../data/units.xml.in.h:505 msgid "r:bit,p:bits" msgstr "bit,p:bitar" #: ../data/units.xml.in.h:506 msgid "Byte (8-bit)" msgstr "Byte (8-bit)" #: ../data/units.xml.in.h:507 msgid "r:byte,p:bytes,octet,p:octets" msgstr "byte,oktet" #: ../data/units.xml.in.h:508 msgid "Nibble" msgstr "" #: ../data/units.xml.in.h:509 msgid "r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets" msgstr "" #: ../data/units.xml.in.h:510 msgid "Tribble" msgstr "" #: ../data/units.xml.in.h:511 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:512 msgid "Word (16-bit)" msgstr "" #: ../data/units.xml.in.h:513 msgid "r:word,p:words" msgstr "" #: ../data/units.xml.in.h:514 msgid "Kilobyte" msgstr "" #: ../data/units.xml.in.h:515 msgid "Kibibyte" msgstr "" #: ../data/units.xml.in.h:516 msgid "Mebibyte" msgstr "" #: ../data/units.xml.in.h:517 msgid "Gibibyte" msgstr "" #: ../data/units.xml.in.h:518 msgid "Megabyte" msgstr "" #: ../data/units.xml.in.h:519 msgid "Gigabyte" msgstr "" #: ../data/units.xml.in.h:520 msgid "Terabyte" msgstr "" #: ../data/units.xml.in.h:521 msgid "Kilobit" msgstr "" #: ../data/units.xml.in.h:522 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:523 msgid "Mebibit" msgstr "" #: ../data/units.xml.in.h:524 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:525 msgid "Megabit" msgstr "" #: ../data/units.xml.in.h:526 msgid "Gigabit" msgstr "" #: ../data/units.xml.in.h:527 msgid "Terabit" msgstr "" #: ../data/units.xml.in.h:528 msgid "Typography" msgstr "Typografi" #: ../data/units.xml.in.h:529 msgid "PostScript Point" msgstr "PostScipt-punkt" #: ../data/units.xml.in.h:530 msgid "ar:pt,a:pts,point,p:points" msgstr "punkt,point,p:punkter,p:points" #: ../data/units.xml.in.h:531 msgid "PostScript Pica" msgstr "PostScript-pica" #: ../data/units.xml.in.h:532 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:533 msgid "ATA Pica" msgstr "ATA-pica" #: ../data/units.xml.in.h:534 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:535 msgid "ATA Point" msgstr "ATA-punkt" #: ../data/units.xml.in.h:536 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:537 msgid "New Didot Point" msgstr "Ny Didotpunkt" #: ../data/units.xml.in.h:538 msgid "r:new_didot" msgstr "" #: ../data/units.xml.in.h:539 msgid "Didot Point" msgstr "Didotpunkt" #: ../data/units.xml.in.h:540 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:541 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:542 msgid "r:cicero" msgstr "" #: ../data/variables.xml.in.h:1 msgid "Small Numbers" msgstr "SmÃ¥ tal" #: ../data/variables.xml.in.h:2 msgid "Per Mille" msgstr "Promille" #: ../data/variables.xml.in.h:3 msgid "r:permille,au:‰" msgstr "promille,au:‰" #: ../data/variables.xml.in.h:4 msgid "Per Myriad" msgstr "Permyriad" #: ../data/variables.xml.in.h:5 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:6 msgid "Percent" msgstr "Procent" #: ../data/variables.xml.in.h:8 #, no-c-format msgid "a:%,r:percent" msgstr "a:%,r:procent" #: ../data/variables.xml.in.h:9 msgid "Large Numbers" msgstr "Stora tal" #: ../data/variables.xml.in.h:10 msgid "Googolplex" msgstr "" #: ../data/variables.xml.in.h:11 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:12 msgid "Googol" msgstr "" #: ../data/variables.xml.in.h:13 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:14 msgid "Centillion" msgstr "" #: ../data/variables.xml.in.h:15 msgid "-r:centillion" msgstr "" #: ../data/variables.xml.in.h:16 msgid "Vigintillion" msgstr "Deciljard" #: ../data/variables.xml.in.h:17 msgid "-r:vigintillion" msgstr "deciljard,p:deciljarder" #: ../data/variables.xml.in.h:18 msgid "Novemdecillion" msgstr "Deciljon" #: ../data/variables.xml.in.h:19 msgid "-r:novemdecillion" msgstr "deciljon,p:deciljoner" #: ../data/variables.xml.in.h:20 msgid "Octodecillion" msgstr "Noniljard" #: ../data/variables.xml.in.h:21 msgid "-r:octodecillion" msgstr "noniljard,p:noniljarder" #: ../data/variables.xml.in.h:22 msgid "Septendecillion" msgstr "Noniljon" #: ../data/variables.xml.in.h:23 msgid "-r:septendecillion" msgstr "noniljon,p:noniljoner" #: ../data/variables.xml.in.h:24 msgid "Sexdecillion" msgstr "Oktiljard" #: ../data/variables.xml.in.h:25 msgid "-r:sexdecillion" msgstr "oktiljard,p:oktiljarder" #: ../data/variables.xml.in.h:26 msgid "Quindecillion" msgstr "Oktiljon" #: ../data/variables.xml.in.h:27 msgid "-r:quindecillion" msgstr "oktiljon,p:oktiljoner" #: ../data/variables.xml.in.h:28 msgid "Quattuordecillion" msgstr "Septiljard" #: ../data/variables.xml.in.h:29 msgid "-r:quattuordecillion" msgstr "septiljard,p:septiljarder" #: ../data/variables.xml.in.h:30 msgid "Tredecillion" msgstr "Septiljon" #: ../data/variables.xml.in.h:31 msgid "-r:tredecillion" msgstr "septiljon,p:septiljoner" #: ../data/variables.xml.in.h:32 msgid "Duodecillion" msgstr "Sextiljard" #: ../data/variables.xml.in.h:33 msgid "-r:duodecillion" msgstr "sextiljard,p:sextiljarder" #: ../data/variables.xml.in.h:34 msgid "Undecillion" msgstr "Sextiljon" #: ../data/variables.xml.in.h:35 msgid "-r:undecillion" msgstr "sextiljon,p:sextiljoner" #: ../data/variables.xml.in.h:36 msgid "Decillion" msgstr "Kvintiljard" #: ../data/variables.xml.in.h:37 msgid "-r:decillion" msgstr "kvintiljard,p:kvintiljarder" #: ../data/variables.xml.in.h:38 msgid "Nonillion" msgstr "Kvintiljon" #: ../data/variables.xml.in.h:39 msgid "-r:nonillion" msgstr "kvintiljon,p:kvintiljoner" #: ../data/variables.xml.in.h:40 msgid "Octillion" msgstr "Kvadriljard" #: ../data/variables.xml.in.h:41 msgid "-r:octillion" msgstr "kvadriljard,p:kvadriljarder" #: ../data/variables.xml.in.h:42 msgid "Septillion" msgstr "Kvadriljon" #: ../data/variables.xml.in.h:43 msgid "-r:septillion" msgstr "kvadriljon,p:kvadriljoner" #: ../data/variables.xml.in.h:44 msgid "Sextillion" msgstr "Triljard" #: ../data/variables.xml.in.h:45 msgid "-r:sextillion" msgstr "triljard,p:triljarder" #: ../data/variables.xml.in.h:46 msgid "Quintillion" msgstr "Triljon" #: ../data/variables.xml.in.h:47 msgid "-r:quintillion" msgstr "triljon,p:triljoner" #: ../data/variables.xml.in.h:48 msgid "Quadrillion" msgstr "Biljard" #: ../data/variables.xml.in.h:49 msgid "-r:quadrillion" msgstr "biljard,p:biljarder" #: ../data/variables.xml.in.h:50 msgid "Trillion" msgstr "Biljon" #: ../data/variables.xml.in.h:51 msgid "-r:trillion" msgstr "biljon,p:biljoner" #: ../data/variables.xml.in.h:52 msgid "Billion" msgstr "Miljard" #: ../data/variables.xml.in.h:53 msgid "-r:billion" msgstr "miljard,p:miljarder" #: ../data/variables.xml.in.h:54 msgid "Million" msgstr "Miljon" #: ../data/variables.xml.in.h:55 msgid "-r:million" msgstr "miljon,p:miljoner" #: ../data/variables.xml.in.h:56 msgid "Thousand" msgstr "Tusen" #: ../data/variables.xml.in.h:57 msgid "-r:thousand" msgstr "tusen" #: ../data/variables.xml.in.h:58 msgid "Hundred" msgstr "Hundra" #: ../data/variables.xml.in.h:59 msgid "-r:hundred" msgstr "hundra" #: ../data/variables.xml.in.h:60 msgid "Physical Constants" msgstr "Fysikaliska konstanter" #: ../data/variables.xml.in.h:61 msgid "Universal Constants" msgstr "Universala konstanter" #: ../data/variables.xml.in.h:62 msgid "Speed of Light in Vacuum" msgstr "Ljusets hastighet i vakuum" #: ../data/variables.xml.in.h:63 msgid "ar:c,speed_of_light" msgstr "a:c,ljusets_hastighet" #: ../data/variables.xml.in.h:64 msgid "Planck Time" msgstr "Planck-tid" #: ../data/variables.xml.in.h:65 msgid "r:planck_time,ais:t_P" msgstr "" #: ../data/variables.xml.in.h:66 msgid "Planck Temperature" msgstr "Planck-temperatur" #: ../data/variables.xml.in.h:67 msgid "r:planck_temperature,ais:T_P" msgstr "" #: ../data/variables.xml.in.h:68 msgid "Planck Mass" msgstr "Planck-massa" #: ../data/variables.xml.in.h:69 msgid "r:planck_mass,ais:m_P" msgstr "" #: ../data/variables.xml.in.h:70 msgid "Planck Length" msgstr "Planck-längd" #: ../data/variables.xml.in.h:71 msgid "r:planck_length,ais:l_P" msgstr "" #: ../data/variables.xml.in.h:72 msgid "Planck Constant" msgstr "Plancks konstant" #: ../data/variables.xml.in.h:73 msgid "r:planck,au:ℎ" msgstr "" #: ../data/variables.xml.in.h:74 msgid "Planck Constant over 2 pi" msgstr "Plancks konstant över 2 pi" #: ../data/variables.xml.in.h:75 msgid "r:planck2pi,au:ℏ" msgstr "" #: ../data/variables.xml.in.h:76 msgid "Newtonian Constant of Gravitation" msgstr "Newtonska gravitationskonstanten" #: ../data/variables.xml.in.h:77 msgid "r:newtonian_constant,a:G" msgstr "" #: ../data/variables.xml.in.h:78 msgid "Electric Constant (Permittivity of Free Space)" msgstr "Elektriska konstanten" #: ../data/variables.xml.in.h:79 msgid "r:electric_constant,asu:ε_0,vacuum_permittivity,aos:epsilon_0" msgstr "" #: ../data/variables.xml.in.h:80 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "Magnetiska konstanten" #: ../data/variables.xml.in.h:81 msgid "r:magnetic_constant,asu:μ_0,vacuum_permeability,aos:mu_0" msgstr "" #: ../data/variables.xml.in.h:82 msgid "Characteristic Impedance of Vacuum" msgstr "Karaktäristisk impedans för vakuum" #: ../data/variables.xml.in.h:83 msgid "r:characteristic_impedance,ais:Z_0" msgstr "" #: ../data/variables.xml.in.h:84 msgid "Electromagnetic Constants" msgstr "Elektromagnetiska konstanter" #: ../data/variables.xml.in.h:85 msgid "Bohr Magneton" msgstr "Bohrs magneton" #: ../data/variables.xml.in.h:86 msgid "r:bohr_magneton,asu:μ_B,aos:mu_B" msgstr "" #: ../data/variables.xml.in.h:87 msgid "Conductance Quantum" msgstr "Konduktanskvantum" #: ../data/variables.xml.in.h:88 msgid "r:conductance_quantum,ais:G_0" msgstr "" #: ../data/variables.xml.in.h:89 msgid "Elementary Charge" msgstr "Elementarladdning" #: ../data/variables.xml.in.h:90 msgid "r:elementary_charge,ais:e_charge" msgstr "" #: ../data/variables.xml.in.h:91 msgid "Josephson Constant" msgstr "Josephsons konstant" #: ../data/variables.xml.in.h:92 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:93 msgid "Magnetic Flux Quantum" msgstr "Magnetflödeskonstanten" #: ../data/variables.xml.in.h:94 msgid "r:magnetic_flux_quantum,asu:Φ_0,aos:phi_0" msgstr "" #: ../data/variables.xml.in.h:95 msgid "Nuclear Magneton" msgstr "Kärnmagneton" #: ../data/variables.xml.in.h:96 msgid "r:nuclear_magneton,asu:μ_N,aos:mu_N" msgstr "" #: ../data/variables.xml.in.h:97 msgid "von Klitzing Constant" msgstr "von Klitzing-konstanten" #: ../data/variables.xml.in.h:98 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:99 msgid "Atomic and Nuclear Constants" msgstr "Atomära och nukleära konstanter" #: ../data/variables.xml.in.h:100 msgid "Alpha Particle Mass" msgstr "Alfapartikelmassa" #: ../data/variables.xml.in.h:101 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "" #: ../data/variables.xml.in.h:102 msgid "Bohr Radius" msgstr "Bohr-radie" #: ../data/variables.xml.in.h:103 msgid "r:bohr_radius,ais:a_0" msgstr "" #: ../data/variables.xml.in.h:104 msgid "Classical Electron Radius" msgstr "Klassisk elektron-radie" #: ../data/variables.xml.in.h:105 msgid "r:classical_electron_radius,ais:r_e" msgstr "" #: ../data/variables.xml.in.h:106 msgid "Compton Wavelength" msgstr "Compton-vÃ¥glängd" #: ../data/variables.xml.in.h:107 msgid "r:compton_wavelength,asu:λ_C,aos:lambda_C" msgstr "" #: ../data/variables.xml.in.h:108 msgid "Electron Mass" msgstr "Elektronmassa" #: ../data/variables.xml.in.h:109 msgid "r:electron_mass,ais:m_e" msgstr "" #: ../data/variables.xml.in.h:110 msgid "Helion Mass" msgstr "Helion-massa" #: ../data/variables.xml.in.h:111 msgid "r:helion_mass,ais:m_h" msgstr "" #: ../data/variables.xml.in.h:112 msgid "Neutron Mass" msgstr "Neutronmassa" #: ../data/variables.xml.in.h:113 msgid "r:neutron_mass,ais:m_n" msgstr "" #: ../data/variables.xml.in.h:114 msgid "Proton Mass" msgstr "Protonmassa" #: ../data/variables.xml.in.h:115 msgid "r:proton_mass,ais:m_p" msgstr "" #: ../data/variables.xml.in.h:116 msgid "Rydberg Constant" msgstr "Rydbergs konstant" #: ../data/variables.xml.in.h:117 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:118 msgid "Tau Mass" msgstr "Tau-massa" #: ../data/variables.xml.in.h:119 msgid "r:tau_mass,aisu:m_τ" msgstr "" #: ../data/variables.xml.in.h:120 msgid "Physico-Chemical Constants" msgstr "Fysikalisk-kemiska konstanter" #: ../data/variables.xml.in.h:121 msgid "Atomic Mass Constant" msgstr "Atommassenhet" #: ../data/variables.xml.in.h:122 msgid "r:atomic_mass,ais:m_u" msgstr "atommassa,ais:m_u" #: ../data/variables.xml.in.h:123 msgid "Avogadro Constant" msgstr "Avogadros konstant" #: ../data/variables.xml.in.h:124 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:125 msgid "Boltzmann Constant" msgstr "Boltzmanns konstant" #: ../data/variables.xml.in.h:126 msgid "r:boltzmann,ais:k_B" msgstr "" #: ../data/variables.xml.in.h:127 msgid "Faraday Constant" msgstr "Faradays konstant" #: ../data/variables.xml.in.h:128 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:129 msgid "First Radiation Constant" msgstr "Första strÃ¥lningskonstanten" #: ../data/variables.xml.in.h:130 msgid "r:first_radiation,ais:c_1" msgstr "" #: ../data/variables.xml.in.h:131 msgid "Ideal Gas Constant" msgstr "Gaskonstant" #: ../data/variables.xml.in.h:132 msgid "r:ideal_gas" msgstr "" #: ../data/variables.xml.in.h:133 msgid "Second Radiation Constant" msgstr "Andra strÃ¥lningskonstanten" #: ../data/variables.xml.in.h:134 msgid "r:second_radiation,ais:c_2" msgstr "" #: ../data/variables.xml.in.h:135 msgid "Basic Constants" msgstr "Grundläggande konstanter" #: ../data/variables.xml.in.h:136 msgid "Golden Ratio" msgstr "Golden ratio" #: ../data/variables.xml.in.h:137 msgid "r:golden,au:φ" msgstr "" #: ../data/variables.xml.in.h:138 msgid "Omega Constant" msgstr "Omegakonstanten" #: ../data/variables.xml.in.h:139 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:140 msgid "Pythagoras' Constant (sqrt 2)" msgstr "Pythagoras konstant (sqrt 2)" #: ../data/variables.xml.in.h:141 msgid "r:pythagoras" msgstr "" #: ../data/variables.xml.in.h:142 msgid "Apery's Constant" msgstr "Aperys konstant" #: ../data/variables.xml.in.h:143 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:144 msgid "Base of Natural Logarithms (e)" msgstr "Basen för naturliga logaritmer (e)" #: ../data/variables.xml.in.h:145 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:146 msgid "Archimedes' Constant (pi)" msgstr "Archimedes konstant (pi)" #: ../data/variables.xml.in.h:147 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:148 msgid "Euler's Constant" msgstr "Eulers konstant" #: ../data/variables.xml.in.h:149 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:150 msgid "Catalan's Constant" msgstr "Catalans konstant" #: ../data/variables.xml.in.h:151 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:152 msgid "Special Numbers" msgstr "Speciella nummer" #: ../data/variables.xml.in.h:153 msgid "Imaginary i (sqrt -1)" msgstr "Imaginärt i (sqrt -1)" #: ../data/variables.xml.in.h:154 msgid "r:i" msgstr "" #: ../data/variables.xml.in.h:155 msgid "Positive Infinity" msgstr "Positiv oändlighet" #: ../data/variables.xml.in.h:156 msgid "a:∞,r:plus_infinity,r:infinity" msgstr "a:∞,oändlighet" #: ../data/variables.xml.in.h:157 msgid "Negative Infinity" msgstr "Negativ oändlighet" #: ../data/variables.xml.in.h:158 msgid "r:minus_infinity" msgstr "minus_oändlighet" #: ../data/variables.xml.in.h:159 msgid "Undefined" msgstr "Odefinierad" #: ../data/variables.xml.in.h:160 msgid "r:undefined" msgstr "odefinierad" #: ../data/variables.xml.in.h:161 msgid "Precision" msgstr "Precision" #: ../data/variables.xml.in.h:162 msgid "r:precision" msgstr "" #: ../data/variables.xml.in.h:163 msgid "False" msgstr "Falskt" #: ../data/variables.xml.in.h:164 msgid "r:false,r:no" msgstr "falskt,nej" #: ../data/variables.xml.in.h:165 msgid "True" msgstr "Sant" #: ../data/variables.xml.in.h:166 msgid "r:true,r:yes" msgstr "sant,ja" #: ../data/variables.xml.in.h:167 msgid "Unknowns" msgstr "Okända" #: ../data/variables.xml.in.h:168 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:170 msgid "r:z" msgstr "" #: ../data/variables.xml.in.h:171 msgid "n (integer)" msgstr "n (heltal)" #: ../data/variables.xml.in.h:172 #, fuzzy msgid "r:n" msgstr "längd" #: ../data/variables.xml.in.h:174 msgid "Today" msgstr "Idag" #: ../data/variables.xml.in.h:175 msgid "r:today" msgstr "idag" #: ../data/variables.xml.in.h:176 msgid "Tomorrow" msgstr "Imorgon" #: ../data/variables.xml.in.h:177 msgid "r:tomorrow" msgstr "imorgon" #: ../data/variables.xml.in.h:178 msgid "Yesterday" msgstr "IgÃ¥r" #: ../data/variables.xml.in.h:179 msgid "r:yesterday" msgstr "igÃ¥r" #: ../data/variables.xml.in.h:180 msgid "Now (date and time)" msgstr "Nu (datum och tid)" #: ../data/variables.xml.in.h:181 msgid "r:now" msgstr "" #~ msgid "Matrix/vector 1" #~ msgstr "Matris/vektor 1" #~ msgid "Matrix/vector 2" #~ msgstr "Matris/vektor 2" #~ msgid "Variable for element in matrix/vector 1" #~ msgstr "Variabel för element i matris/vektor 1" #~ msgid "Variable for element in matrix/vector 2" #~ msgstr "Variabel för element i matris/vektor 2" #, fuzzy #~ msgid "ar:MVR,au:ރ" #~ msgstr "a:INR,au:₹,rupie,p:rupier" #~ msgid "r:arcminute,p:arcminutes,a:arcmin" #~ msgstr "bÃ¥gminuter,p:bÃ¥gminuter,a:arcmin" #~ msgid "Returns an integer from an octal number" #~ msgstr "Returnerar ett heltal frÃ¥n ett oktalt tal" #~ msgid "Returns an integer from a binary number" #~ msgstr "Returnerar ett heltal frÃ¥n ett binärt tal" #~ msgid "Now" #~ msgstr "Nu" #~ msgid "Standard Date Format" #~ msgstr "Standard-datumformat" #~ msgid "Local Date Format" #~ msgstr "Lokalt datumformat" #~ msgid "r:localdate" #~ msgstr "lokalt_datum" #, fuzzy #~ msgid "r:li" #~ msgstr "gränser" #~ msgid "Triangle Perimeter (of right triangle)" #~ msgstr "Triangelomkrets (rätvinklig)" #~ msgid "Infinity" #~ msgstr "Oändlighet" #~ msgid "r:plus_infinity" #~ msgstr "plus_oändlighet" #~ msgid "" #~ "For negative values, the root of odd degrees returns the real root. " #~ " For even degrees and complex values the root that satisfies the " #~ "condition root(root(x,a),b)^c=root(x,a*b/c) is returned." #~ msgstr "" #~ "För negativa värden och rötter av ojämn grad returneras den reella roten." #~ " För jämna grader och komplexa värden returneras roten som " #~ "uppfyller villkoret root(root(x;a);b)^c=root(x;a*b/c)." #~ msgid "au:∫,r:integrate" #~ msgstr "au:∫,integrera" #~ msgid "Sum" #~ msgstr "Summa" #~ msgid "Product" #~ msgstr "Produkt" #~ msgid "Finance" #~ msgstr "Finans" #, fuzzy #~ msgid "Do expression" #~ msgstr "Faktoruttryck" #~ msgid "Analysis" #~ msgstr "Analys" #~ msgid "Durbin-Watson" #~ msgstr "Durbin-Watson" #~ msgid "Consumer Surplus" #~ msgstr "Konsumentöverskott" #~ msgid "r:csurplus" #~ msgstr "konsumentöverskott" #~ msgid "Supply function or price" #~ msgstr "TillgÃ¥ngsfunktion eller pris" #~ msgid "Quantity variabel" #~ msgstr "Kvantitetsvariabel" #~ msgid "Producer Surplus" #~ msgstr "Producentöverskott" #~ msgid "r:psurplus" #~ msgstr "producentöverskott" #~ msgid "Supply function" #~ msgstr "TillgÃ¥ngsfunktion" #~ msgid "Demand function or price" #~ msgstr "EfterfrÃ¥gefunktion eller pris" #~ msgid "Calculates the duration of a security." #~ msgstr "Beräknar livslängden pÃ¥ en säkerhet." #~ msgid "Annual coupon rate (%)" #~ msgstr "Ã…rlig kupongränta (%)" #~ msgid "Annualized yield (%)" #~ msgstr "Ã…rlig avkastning (%)" #~ msgid "" #~ "Plots one or more expressions or vectors. Use a vector for the first " #~ "argument to plot multiple series. Only the first argument is used for " #~ "vector series. It is also possible to plot a matrix where each row is a " #~ "pair of x and y values. Example: plot([x^2; 2x; [0;1;4;8;16]]; 0; 4)." #~ msgstr "" #~ "Ritar en eller flera uttryck eller vektorer i ett linjediagram. Använd en " #~ "vektor till den första parametern för att rita flera serier. Enbart den " #~ "första parametern används för vektorserier. Det är även möjligt att rita " #~ "en matrix där varje rad utgör parvisa x och y värden. Exempel: plot([x^2; " #~ "2x; [0;1;4;8;16]]; 0; 4)." #, fuzzy #~ msgid "Plot Functions and Vectors (with sampling rate)" #~ msgstr "Rita funktioner och vektorer" #, fuzzy #~ msgid "Step size" #~ msgstr "Använd stegstorlek" #~ msgid "Ionization Potential" #~ msgstr "Joniseringspotential" #~ msgid "r:ionization" #~ msgstr "jonisering" #~ msgid "Covalent Radius" #~ msgstr "Kovalent radie" #~ msgid "r:covalent" #~ msgstr "kovalent" #~ msgid "Value 1 (n)" #~ msgstr "Värde 1 (n)" #~ msgid "Derive" #~ msgstr "Derivera" #~ msgid "Calculates the area of a circle using the diameter" #~ msgstr "Beräknar omkretsen för en cirkel." #~ msgid "Diameter" #~ msgstr "Diameter" libqalculate-2.8.2/po-defs/Makefile.in0000644000175000017500000003334613401033103014505 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # # po-defs/Makefile.am for qalculate # VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = po-defs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in ChangeLog DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTLLIBS = @INTLLIBS@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ INTLTOOL_MERGE = @INTLTOOL_MERGE@ INTLTOOL_PERL = @INTLTOOL_PERL@ INTLTOOL_QALCULATE_DEFINITIONS_RULE = @INTLTOOL_QALCULATE_DEFINITIONS_RULE@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ LIBCURL_LIBS = @LIBCURL_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LIPO = @LIPO@ LN_QALCULATE = @LN_QALCULATE@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POSUB = @POSUB@ QALCULATE_AGE = @QALCULATE_AGE@ QALCULATE_CURRENT = @QALCULATE_CURRENT@ QALCULATE_DEFS2DOC = @QALCULATE_DEFS2DOC@ QALCULATE_REVISION = @QALCULATE_REVISION@ QALCULATE_TEST = @QALCULATE_TEST@ QALCULATE_TEXT = @QALCULATE_TEXT@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intltool__v_merge_options_ = @intltool__v_merge_options_@ intltool__v_merge_options_0 = @intltool__v_merge_options_0@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ POTFILES.in *.po all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu po-defs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu po-defs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libqalculate-2.8.2/po-defs/ChangeLog0000644000175000017500000000000012705146643014213 00000000000000libqalculate-2.8.2/po-defs/fr.po0000644000175000017500000062414313365262303013427 00000000000000# translation of fr.po to Français # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Nicolas Laug , 2006. msgid "" msgstr "" "Project-Id-Version: fr\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-28 08:26+0100\n" "PO-Revision-Date: 2006-12-06 15:54-0500\n" "Last-Translator: Nicolas Laug \n" "Language-Team: Français \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #: ../data/currencies.xml.in.h:1 msgid "Currency" msgstr "Monnaie" #: ../data/currencies.xml.in.h:2 msgid "European Euros" msgstr "Euros européens" #: ../data/currencies.xml.in.h:3 msgid "ar:EUR,au:€,euro,p:euros" msgstr "" #: ../data/currencies.xml.in.h:4 msgid "" "Andorra, Austria, Belgium, Cyprus, Estonia, Finland, France, Germany, " "Greece, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, " "Portugal, San Marino, Slovakia, Slovenia, Spain, Vatican City" msgstr "" #: ../data/currencies.xml.in.h:5 msgid "U.S. Dollars" msgstr "Dollar US" #: ../data/currencies.xml.in.h:6 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "" #: ../data/currencies.xml.in.h:7 msgid "" "United States, East Timor, Ecuador, El Salvador, Micronesia, Marshall " "Islands, Palau, Zimbabwe" msgstr "" #: ../data/currencies.xml.in.h:8 msgid "Japanese Yen" msgstr "Yen japonais" #: ../data/currencies.xml.in.h:9 msgid "ar:JPY,au:¥,yen" msgstr "" #: ../data/currencies.xml.in.h:10 msgid "Japan" msgstr "" #: ../data/currencies.xml.in.h:11 msgid "Danish Kroner" msgstr "Couronne danoise" #: ../data/currencies.xml.in.h:12 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:13 msgid "Denmark" msgstr "" #: ../data/currencies.xml.in.h:14 msgid "British Pounds" msgstr "Livre sterling" #: ../data/currencies.xml.in.h:15 msgid "ar:GBP,au:£" msgstr "" #: ../data/currencies.xml.in.h:16 msgid "United Kingdom" msgstr "" #: ../data/currencies.xml.in.h:17 msgid "Thai Baht" msgstr "Baht thailandais" #: ../data/currencies.xml.in.h:18 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:19 msgid "Thailand" msgstr "" #: ../data/currencies.xml.in.h:20 msgid "Swedish Krona" msgstr "Couronne suédoise" #: ../data/currencies.xml.in.h:21 msgid "ar:SEK" msgstr "" #: ../data/currencies.xml.in.h:22 msgid "Sweden" msgstr "" #: ../data/currencies.xml.in.h:23 msgid "Swiss Francs" msgstr "Franc suisse" #: ../data/currencies.xml.in.h:24 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:25 msgid "Switzerland" msgstr "" #: ../data/currencies.xml.in.h:26 msgid "Norwegian Kroner" msgstr "Couronne norvégienne" #: ../data/currencies.xml.in.h:27 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:28 msgid "Norway" msgstr "" #: ../data/currencies.xml.in.h:29 msgid "Bulgarian Lev" msgstr "Lev bulgare" #: ../data/currencies.xml.in.h:30 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:31 #, fuzzy msgid "Bulgaria" msgstr "Lev bulgare" #: ../data/currencies.xml.in.h:32 msgid "Russian Ruble" msgstr "Rouble russe" #: ../data/currencies.xml.in.h:33 msgid "ar:RUB,au:₽,ruble" msgstr "ar:RUB,au:₽,rouble" #: ../data/currencies.xml.in.h:34 #, fuzzy msgid "Russia" msgstr "Rouble russe" #: ../data/currencies.xml.in.h:35 msgid "Philippine Peso" msgstr "Peso philippin" #: ../data/currencies.xml.in.h:36 msgid "ar:PHP,au:₱" msgstr "" #: ../data/currencies.xml.in.h:37 #, fuzzy msgid "Philippines" msgstr "Peso philippin" #: ../data/currencies.xml.in.h:38 msgid "Malaysian Ringgit" msgstr "Ringgit malaisien" #: ../data/currencies.xml.in.h:39 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:40 #, fuzzy msgid "Malaysia" msgstr "Ringgit malaisien" #: ../data/currencies.xml.in.h:41 msgid "Croatian Kuna" msgstr "Kuna croate" #: ../data/currencies.xml.in.h:42 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:43 #, fuzzy msgid "Croatia" msgstr "Kuna croate" #: ../data/currencies.xml.in.h:44 msgid "Yuan Renminbi (PR China)" msgstr "Yuan renminbi (rep. pop. de Chine)" #: ../data/currencies.xml.in.h:45 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:46 msgid "China" msgstr "" #: ../data/currencies.xml.in.h:47 msgid "Indonesian Rupiah" msgstr "Rouple indonésienne" #: ../data/currencies.xml.in.h:48 msgid "ar:IDR,rupiah" msgstr "" #: ../data/currencies.xml.in.h:49 #, fuzzy msgid "Indonesia" msgstr "Rouple indonésienne" #: ../data/currencies.xml.in.h:50 msgid "Czech Koruna" msgstr "Koruna tchèque" #: ../data/currencies.xml.in.h:51 msgid "ar:CZK,au-c:Kč" msgstr "" #: ../data/currencies.xml.in.h:52 msgid "Czech Republic" msgstr "" #: ../data/currencies.xml.in.h:53 msgid "Hungarian Forint" msgstr "Florin hongrois" #: ../data/currencies.xml.in.h:54 msgid "forint,ar:HUF" msgstr "florint hongrois,ar:HUF" #: ../data/currencies.xml.in.h:55 msgid "Hungary" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "Polish Zloty" msgstr "Zloty polonais" #: ../data/currencies.xml.in.h:57 #, fuzzy msgid "ar:PLN,au:zł,zloty" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:58 msgid "Poland" msgstr "" #: ../data/currencies.xml.in.h:59 #, fuzzy msgid "Romanian Leu" msgstr "Nouveau Leu roumain" #: ../data/currencies.xml.in.h:60 msgid "ar:RON" msgstr "" #: ../data/currencies.xml.in.h:61 #, fuzzy msgid "Romania" msgstr "Nouveau Leu roumain" #: ../data/currencies.xml.in.h:62 msgid "Turkish New Lira" msgstr "Nouvelle livre turque" #: ../data/currencies.xml.in.h:63 msgid "ar:TRY,au:₺" msgstr "" #: ../data/currencies.xml.in.h:64 msgid "Turkey" msgstr "" #: ../data/currencies.xml.in.h:65 msgid "Australian Dollars" msgstr "Dollar australien" #: ../data/currencies.xml.in.h:66 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:67 #, fuzzy msgid "Australia" msgstr "Dollar australien" #: ../data/currencies.xml.in.h:68 msgid "Canadian Dollars" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:69 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:70 msgid "Canada" msgstr "" #: ../data/currencies.xml.in.h:71 msgid "Hong Kong Dollars" msgstr "Dollar de Hong Kong" #: ../data/currencies.xml.in.h:72 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:73 msgid "New Zealand Dollars" msgstr "Dollars néo-zélandais" #: ../data/currencies.xml.in.h:74 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:75 #, fuzzy msgid "New Zealand" msgstr "Dollars néo-zélandais" #: ../data/currencies.xml.in.h:76 msgid "Singapore Dollars" msgstr "Dollar de Singapour" #: ../data/currencies.xml.in.h:77 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:78 #, fuzzy msgid "Singapore" msgstr "Dollar de Singapour" #: ../data/currencies.xml.in.h:79 msgid "South Korean Won" msgstr "Won sud corréenne" #: ../data/currencies.xml.in.h:80 msgid "ar:KRW,au:₩,won" msgstr "" #: ../data/currencies.xml.in.h:81 #, fuzzy msgid "South Korea" msgstr "Won sud corréenne" #: ../data/currencies.xml.in.h:82 msgid "South African Rand" msgstr "Rand sudafricaine" #: ../data/currencies.xml.in.h:83 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:84 #, fuzzy msgid "South Africa" msgstr "Rand sudafricaine" #: ../data/currencies.xml.in.h:85 msgid "Indian Rupee" msgstr "" #: ../data/currencies.xml.in.h:86 msgid "ar:INR,au:₹,rupee" msgstr "" #: ../data/currencies.xml.in.h:87 msgid "India" msgstr "" #: ../data/currencies.xml.in.h:88 msgid "Israeli New Sheqel" msgstr "" #: ../data/currencies.xml.in.h:89 msgid "ar:ILS,au:₪,sheqel" msgstr "" #: ../data/currencies.xml.in.h:90 msgid "Israel" msgstr "" #: ../data/currencies.xml.in.h:91 msgid "Mexican Peso" msgstr "" #: ../data/currencies.xml.in.h:92 msgid "ar:MXN" msgstr "" #: ../data/currencies.xml.in.h:93 msgid "Mexico" msgstr "" #: ../data/currencies.xml.in.h:94 msgid "Brazilian Real" msgstr "" #: ../data/currencies.xml.in.h:95 msgid "ar:BRL" msgstr "" #: ../data/currencies.xml.in.h:96 msgid "Brazil" msgstr "" #: ../data/currencies.xml.in.h:97 #, fuzzy msgid "Icelandic Krónur" msgstr "Couronne islandaise" #: ../data/currencies.xml.in.h:98 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:99 msgid "Iceland" msgstr "" #: ../data/currencies.xml.in.h:100 msgid "Bitcoins" msgstr "" #: ../data/currencies.xml.in.h:101 msgid "ar:BTC,au:₿,a:XBT,bitcoin,p:bitcoins" msgstr "" #: ../data/currencies.xml.in.h:102 #, fuzzy msgid "Kenya Shilling" msgstr "Shilling autrichien" #: ../data/currencies.xml.in.h:103 msgid "ar:KES" msgstr "" #: ../data/currencies.xml.in.h:104 msgid "Kenya" msgstr "" #: ../data/currencies.xml.in.h:105 msgid "Afghan Afghani" msgstr "" #: ../data/currencies.xml.in.h:106 #, fuzzy msgid "ar:AFN,aiu:؋" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:107 msgid "Afghanistan" msgstr "" #: ../data/currencies.xml.in.h:108 #, fuzzy msgid "Albanian Lek" msgstr "Nouveau Leu roumain" #: ../data/currencies.xml.in.h:109 msgid "ar:ALL" msgstr "" #: ../data/currencies.xml.in.h:110 msgid "Albania" msgstr "" #: ../data/currencies.xml.in.h:111 msgid "Algerian Dinar" msgstr "" #: ../data/currencies.xml.in.h:112 msgid "ar:DZD" msgstr "" #: ../data/currencies.xml.in.h:113 #, fuzzy msgid "Algeria" msgstr "Algèbre" #: ../data/currencies.xml.in.h:114 msgid "Angolan Kwanza" msgstr "" #: ../data/currencies.xml.in.h:115 msgid "ar:AOA" msgstr "" #: ../data/currencies.xml.in.h:116 msgid "Angola" msgstr "" #: ../data/currencies.xml.in.h:117 #, fuzzy msgid "Eastern Caribbean Dollar" msgstr "Dollar australien" #: ../data/currencies.xml.in.h:118 msgid "ar:XCD" msgstr "" #: ../data/currencies.xml.in.h:119 msgid "" "Antigua and Barbuda, Dominica, Grenada, Montserrat, Saint Kitts and Nevis, " "Saint Lucia, Saint Vincent and the Grenadines, Anguilla" msgstr "" #: ../data/currencies.xml.in.h:120 msgid "Argentine Peso" msgstr "" #: ../data/currencies.xml.in.h:121 msgid "ar:ARS" msgstr "" #: ../data/currencies.xml.in.h:122 msgid "Argentina" msgstr "" #: ../data/currencies.xml.in.h:123 msgid "Armenian Dram" msgstr "" #: ../data/currencies.xml.in.h:124 #, fuzzy msgid "ar:AMD,au:֏" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:125 msgid "Armenia" msgstr "" #: ../data/currencies.xml.in.h:126 #, fuzzy msgid "Aruban Florin" msgstr "Florin hongrois" #: ../data/currencies.xml.in.h:127 msgid "ar:AWG" msgstr "" #: ../data/currencies.xml.in.h:128 msgid "Aruba" msgstr "" #: ../data/currencies.xml.in.h:129 msgid "Netherlands Antillean Guilder" msgstr "" #: ../data/currencies.xml.in.h:130 msgid "ar:ANG" msgstr "" #: ../data/currencies.xml.in.h:131 msgid "Curaçao, Sint Maarten" msgstr "" #: ../data/currencies.xml.in.h:132 msgid "Azerbaijani Manat" msgstr "" #: ../data/currencies.xml.in.h:133 #, fuzzy msgid "ar:AZN,au:₼" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:134 msgid "Azerbaijan" msgstr "" #: ../data/currencies.xml.in.h:135 #, fuzzy msgid "Bahamian Dollar" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:136 msgid "ar:BSD" msgstr "" #: ../data/currencies.xml.in.h:137 msgid "Bahamas" msgstr "" #: ../data/currencies.xml.in.h:138 msgid "Bahraini Dinar" msgstr "" #: ../data/currencies.xml.in.h:139 msgid "ar:BHD" msgstr "" #: ../data/currencies.xml.in.h:140 msgid "Bahrain" msgstr "" #: ../data/currencies.xml.in.h:141 msgid "Bangladeshi Taka" msgstr "" #: ../data/currencies.xml.in.h:142 #, fuzzy msgid "ar:BDT,au:৳" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:143 msgid "Bangladesh" msgstr "" #: ../data/currencies.xml.in.h:144 #, fuzzy msgid "Barbadian Dollar" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:145 msgid "ar:BBD" msgstr "" #: ../data/currencies.xml.in.h:146 msgid "Barbados" msgstr "" #: ../data/currencies.xml.in.h:147 msgid "Belarusian Ruble p. (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:148 msgid "ar:BYR" msgstr "" #: ../data/currencies.xml.in.h:149 #, fuzzy msgid "Belize Dollar" msgstr "Dollar de Singapour" #: ../data/currencies.xml.in.h:150 msgid "ar:BZD" msgstr "" #: ../data/currencies.xml.in.h:151 msgid "Belize" msgstr "" #: ../data/currencies.xml.in.h:152 #, fuzzy msgid "West African CFA Franc" msgstr "Rand sudafricaine" #: ../data/currencies.xml.in.h:153 msgid "ar:XOF,a:CFA" msgstr "" #: ../data/currencies.xml.in.h:154 msgid "" "Benin, Burkina Faso, Guinea-Bissau, Ivory Coast, Mali, Niger, Senegal, Togo" msgstr "" #: ../data/currencies.xml.in.h:155 #, fuzzy msgid "Bermudian Dollar" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:156 msgid "ar:BMD" msgstr "" #: ../data/currencies.xml.in.h:157 msgid "Bermuda" msgstr "" #: ../data/currencies.xml.in.h:158 msgid "Bolivian Boliviano Bs" msgstr "" #: ../data/currencies.xml.in.h:159 msgid "ar:BOB" msgstr "" #: ../data/currencies.xml.in.h:160 msgid "Bolivia" msgstr "" #: ../data/currencies.xml.in.h:161 msgid "Bosnia and Herzegovina Convertible Mark" msgstr "" #: ../data/currencies.xml.in.h:162 msgid "ar:BAM" msgstr "" #: ../data/currencies.xml.in.h:163 msgid "Bosnia and Herzegovina" msgstr "" #: ../data/currencies.xml.in.h:164 msgid "Botswana Pula" msgstr "" #: ../data/currencies.xml.in.h:165 msgid "ar:BWP" msgstr "" #: ../data/currencies.xml.in.h:166 msgid "Botswana" msgstr "" #: ../data/currencies.xml.in.h:167 #, fuzzy msgid "Brunei Dollar" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:168 msgid "ar:BND" msgstr "" #: ../data/currencies.xml.in.h:169 msgid "Brunei" msgstr "" #: ../data/currencies.xml.in.h:170 #, fuzzy msgid "Burundian Franc" msgstr "Franc belge" #: ../data/currencies.xml.in.h:171 msgid "ar:BIF" msgstr "" #: ../data/currencies.xml.in.h:172 msgid "Burundi" msgstr "" #: ../data/currencies.xml.in.h:173 msgid "Cambodian Riel" msgstr "" #: ../data/currencies.xml.in.h:174 #, fuzzy msgid "ar:KHR,aiu:៛" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:175 msgid "Cambodia" msgstr "" #: ../data/currencies.xml.in.h:176 msgid "Central African CFA Franc" msgstr "" #: ../data/currencies.xml.in.h:177 msgid "ar:XAF,a:FCFA" msgstr "" #: ../data/currencies.xml.in.h:178 msgid "" "Cameroon, Central African Republic, Chad, Republic of the Congo, Equatorial " "Guinea, Gabon" msgstr "" #: ../data/currencies.xml.in.h:179 msgid "Cape Verdean Escudo" msgstr "" #: ../data/currencies.xml.in.h:180 msgid "ar:CVE" msgstr "" #: ../data/currencies.xml.in.h:181 msgid "Cape Verde" msgstr "" #: ../data/currencies.xml.in.h:182 #, fuzzy msgid "Cayman Islands Dollar" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:183 msgid "ar:KYD" msgstr "" #: ../data/currencies.xml.in.h:184 msgid "Cayman Islands" msgstr "" #: ../data/currencies.xml.in.h:185 #, fuzzy msgid "Chilean Peso" msgstr "Peso philippin" #: ../data/currencies.xml.in.h:186 msgid "ar:CLP" msgstr "" #: ../data/currencies.xml.in.h:187 msgid "Chile" msgstr "" #: ../data/currencies.xml.in.h:188 #, fuzzy msgid "Colombian Peso" msgstr "Combinaisons" #: ../data/currencies.xml.in.h:189 msgid "ar:COP" msgstr "" #: ../data/currencies.xml.in.h:190 #, fuzzy msgid "Colombia" msgstr "Combinaisons" #: ../data/currencies.xml.in.h:191 #, fuzzy msgid "Comorian Franc" msgstr "Franc belge" #: ../data/currencies.xml.in.h:192 msgid "ar:KMF" msgstr "" #: ../data/currencies.xml.in.h:193 msgid "Comoros" msgstr "" #: ../data/currencies.xml.in.h:194 msgid "Democratic Republic of the Congo (Congolese Franc)" msgstr "" #: ../data/currencies.xml.in.h:195 msgid "ar:CDF" msgstr "" #: ../data/currencies.xml.in.h:196 msgid "Democratic Republic of the Congo" msgstr "" #: ../data/currencies.xml.in.h:197 msgid "Costa Rican colón" msgstr "" #: ../data/currencies.xml.in.h:198 msgid "ar:CRC" msgstr "" #: ../data/currencies.xml.in.h:199 msgid "Costa Rica" msgstr "" #: ../data/currencies.xml.in.h:200 msgid "Cuban Peso" msgstr "" #: ../data/currencies.xml.in.h:201 msgid "ar:CUP" msgstr "" #: ../data/currencies.xml.in.h:202 msgid "Cuba" msgstr "" #: ../data/currencies.xml.in.h:203 #, fuzzy msgid "Djiboutian Franc" msgstr "Franc belge" #: ../data/currencies.xml.in.h:204 msgid "ar:DJF" msgstr "" #: ../data/currencies.xml.in.h:205 msgid "Djibouti" msgstr "" #: ../data/currencies.xml.in.h:206 msgid "Dominican Peso" msgstr "" #: ../data/currencies.xml.in.h:207 msgid "ar:DOP" msgstr "" #: ../data/currencies.xml.in.h:208 msgid "Dominican Republic" msgstr "" #: ../data/currencies.xml.in.h:209 #, fuzzy msgid "Egyptian Pound" msgstr "Livre chypriote" #: ../data/currencies.xml.in.h:210 msgid "ar:EGP" msgstr "" #: ../data/currencies.xml.in.h:211 msgid "Egypt" msgstr "" #: ../data/currencies.xml.in.h:212 msgid "El Salvadoran Colon (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:213 msgid "ar:SVC" msgstr "" #: ../data/currencies.xml.in.h:214 msgid "Eritrean Nafka" msgstr "" #: ../data/currencies.xml.in.h:215 msgid "ar:ERN" msgstr "" #: ../data/currencies.xml.in.h:216 msgid "Eritrea" msgstr "" #: ../data/currencies.xml.in.h:217 msgid "Ethiopian Birr" msgstr "" #: ../data/currencies.xml.in.h:218 msgid "ar:ETB" msgstr "" #: ../data/currencies.xml.in.h:219 msgid "Ethiopia" msgstr "" #: ../data/currencies.xml.in.h:220 msgid "Falkland Islands Pound" msgstr "" #: ../data/currencies.xml.in.h:221 msgid "ar:FKP" msgstr "" #: ../data/currencies.xml.in.h:222 msgid "Falkland Islands" msgstr "" #: ../data/currencies.xml.in.h:223 #, fuzzy msgid "Fijian Dollar" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:224 msgid "ar:FJD" msgstr "" #: ../data/currencies.xml.in.h:225 msgid "Fiji" msgstr "" #: ../data/currencies.xml.in.h:226 msgid "CFP franc" msgstr "" #: ../data/currencies.xml.in.h:227 msgid "ar:XPF" msgstr "" #: ../data/currencies.xml.in.h:228 msgid "French Polynesia, New Caledonia, Wallis and Futuna" msgstr "" #: ../data/currencies.xml.in.h:229 #, fuzzy msgid "Gambian Dalasi" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:230 msgid "ar:GMD" msgstr "" #: ../data/currencies.xml.in.h:231 msgid "Gambia" msgstr "" #: ../data/currencies.xml.in.h:232 msgid "Georgian Lari" msgstr "" #: ../data/currencies.xml.in.h:233 #, fuzzy msgid "ar:GEL,au:₾" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:234 msgid "Georgia" msgstr "" #: ../data/currencies.xml.in.h:235 msgid "Ghanaian Cedi" msgstr "" #: ../data/currencies.xml.in.h:236 #, fuzzy msgid "ar:GHS,au:₵" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:237 msgid "Ghana" msgstr "" #: ../data/currencies.xml.in.h:238 msgid "Gibraltar Pound" msgstr "" #: ../data/currencies.xml.in.h:239 msgid "ar:GIP" msgstr "" #: ../data/currencies.xml.in.h:240 msgid "Gibraltar" msgstr "" #: ../data/currencies.xml.in.h:241 msgid "Guatemalan Quetzal" msgstr "" #: ../data/currencies.xml.in.h:242 msgid "ar:GTQ" msgstr "" #: ../data/currencies.xml.in.h:243 msgid "Guatemala" msgstr "" #: ../data/currencies.xml.in.h:244 #, fuzzy msgid "Guernsey Pound" msgstr "Livre irlandaise" #: ../data/currencies.xml.in.h:245 msgid "ar:GGP" msgstr "" #: ../data/currencies.xml.in.h:246 msgid "Guernsey" msgstr "" #: ../data/currencies.xml.in.h:247 #, fuzzy msgid "Guinean Franc" msgstr "Franc belge" #: ../data/currencies.xml.in.h:248 msgid "ar:GNF" msgstr "" #: ../data/currencies.xml.in.h:249 msgid "Guinea" msgstr "" #: ../data/currencies.xml.in.h:250 #, fuzzy msgid "Guyanese Dollar" msgstr "Dollar australien" #: ../data/currencies.xml.in.h:251 msgid "ar:GYD" msgstr "" #: ../data/currencies.xml.in.h:252 msgid "Guyana" msgstr "" #: ../data/currencies.xml.in.h:253 msgid "Haitian Gourde" msgstr "" #: ../data/currencies.xml.in.h:254 msgid "ar:HTG" msgstr "" #: ../data/currencies.xml.in.h:255 msgid "Haiti" msgstr "" #: ../data/currencies.xml.in.h:256 msgid "Honduran Lempira" msgstr "" #: ../data/currencies.xml.in.h:257 msgid "ar:HNL" msgstr "" #: ../data/currencies.xml.in.h:258 msgid "Honduras" msgstr "" #: ../data/currencies.xml.in.h:259 #, fuzzy msgid "Iranian Rial" msgstr "Lire italienne" #: ../data/currencies.xml.in.h:260 #, fuzzy msgid "ar:IRR,aiu:﷼" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:261 msgid "Iran" msgstr "" #: ../data/currencies.xml.in.h:262 msgid "Iraqi Dinar" msgstr "" #: ../data/currencies.xml.in.h:263 msgid "ar:IQD" msgstr "" #: ../data/currencies.xml.in.h:264 msgid "Iraq" msgstr "" #: ../data/currencies.xml.in.h:265 #, fuzzy msgid "Jamaican Dollar" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:266 msgid "ar:JMD" msgstr "" #: ../data/currencies.xml.in.h:267 msgid "Jamaica" msgstr "" #: ../data/currencies.xml.in.h:268 msgid "Jordanian Dinar" msgstr "" #: ../data/currencies.xml.in.h:269 msgid "ar:JOD" msgstr "" #: ../data/currencies.xml.in.h:270 msgid "Jordan" msgstr "" #: ../data/currencies.xml.in.h:271 msgid "Kazakhstani Tenge" msgstr "" #: ../data/currencies.xml.in.h:272 #, fuzzy msgid "ar:KZT,au:₸" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:273 msgid "Kazakhstan" msgstr "" #: ../data/currencies.xml.in.h:274 #, fuzzy msgid "North Korean Won" msgstr "Won sud corréenne" #: ../data/currencies.xml.in.h:275 msgid "ar:KPW" msgstr "" #: ../data/currencies.xml.in.h:276 #, fuzzy msgid "North Korea" msgstr "Won sud corréenne" #: ../data/currencies.xml.in.h:277 msgid "Kuwaiti Dinar" msgstr "" #: ../data/currencies.xml.in.h:278 msgid "ar:KWD" msgstr "" #: ../data/currencies.xml.in.h:279 msgid "Kuwait" msgstr "" #: ../data/currencies.xml.in.h:280 msgid "Kyrgyzstani Som" msgstr "" #: ../data/currencies.xml.in.h:281 #, fuzzy msgid "ar:KGS,au:с" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:282 msgid "Kyrgyzstan" msgstr "" #: ../data/currencies.xml.in.h:283 msgid "Lao Kip" msgstr "" #: ../data/currencies.xml.in.h:284 #, fuzzy msgid "ar:LAK,au:₭" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:285 msgid "Laos" msgstr "" #: ../data/currencies.xml.in.h:286 msgid "Lebanese Pound" msgstr "" #: ../data/currencies.xml.in.h:287 msgid "ar:LBP" msgstr "" #: ../data/currencies.xml.in.h:288 msgid "Lebanon" msgstr "" #: ../data/currencies.xml.in.h:289 msgid "Lesotho Loti" msgstr "" #: ../data/currencies.xml.in.h:290 msgid "ar:LSL" msgstr "" #: ../data/currencies.xml.in.h:291 msgid "Lesotho" msgstr "" #: ../data/currencies.xml.in.h:292 #, fuzzy msgid "Liberian Dollar" msgstr "Dollar australien" #: ../data/currencies.xml.in.h:293 msgid "ar:LRD" msgstr "" #: ../data/currencies.xml.in.h:294 msgid "Liberia" msgstr "" #: ../data/currencies.xml.in.h:295 msgid "Libyan Dinar" msgstr "" #: ../data/currencies.xml.in.h:296 msgid "ar:LYD" msgstr "" #: ../data/currencies.xml.in.h:297 msgid "Libya" msgstr "" #: ../data/currencies.xml.in.h:298 msgid "Macanese Pataca" msgstr "" #: ../data/currencies.xml.in.h:299 msgid "ar:MOP" msgstr "" #: ../data/currencies.xml.in.h:300 msgid "Macedonian Denar" msgstr "" #: ../data/currencies.xml.in.h:301 msgid "ar:MKD" msgstr "" #: ../data/currencies.xml.in.h:302 msgid "Macedonia" msgstr "" #: ../data/currencies.xml.in.h:303 msgid "Malagasy Ariary" msgstr "" #: ../data/currencies.xml.in.h:304 msgid "ar:MGA" msgstr "" #: ../data/currencies.xml.in.h:305 msgid "Madagascar" msgstr "" #: ../data/currencies.xml.in.h:306 msgid "Malawian Kwacha" msgstr "" #: ../data/currencies.xml.in.h:307 msgid "ar:MWK" msgstr "" #: ../data/currencies.xml.in.h:308 msgid "Malawi" msgstr "" #: ../data/currencies.xml.in.h:309 msgid "Maldivian Rufiyaa" msgstr "" #: ../data/currencies.xml.in.h:310 msgid "ar:MVR" msgstr "" #: ../data/currencies.xml.in.h:311 msgid "Maldives" msgstr "" #: ../data/currencies.xml.in.h:312 msgid "Mauritanian Ouguiya (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:313 msgid "ar:MRO" msgstr "" #: ../data/currencies.xml.in.h:314 msgid "Mauritian Rupee" msgstr "" #: ../data/currencies.xml.in.h:315 msgid "ar:MUR" msgstr "" #: ../data/currencies.xml.in.h:316 msgid "Mauritius" msgstr "" #: ../data/currencies.xml.in.h:317 msgid "Moldovan Leu" msgstr "" #: ../data/currencies.xml.in.h:318 msgid "ar:MDL" msgstr "" #: ../data/currencies.xml.in.h:319 msgid "Moldova" msgstr "" #: ../data/currencies.xml.in.h:320 msgid "Mongolian Tögrög" msgstr "" #: ../data/currencies.xml.in.h:321 #, fuzzy msgid "ar:MNT,au:₮" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:322 msgid "Mongolia" msgstr "" #: ../data/currencies.xml.in.h:323 msgid "Moroccan Dirham" msgstr "" #: ../data/currencies.xml.in.h:324 msgid "ar:MAD" msgstr "" #: ../data/currencies.xml.in.h:325 msgid "Morocco" msgstr "" #: ../data/currencies.xml.in.h:326 msgid "Mozambican Metical" msgstr "" #: ../data/currencies.xml.in.h:327 msgid "ar:MZN" msgstr "" #: ../data/currencies.xml.in.h:328 msgid "Mozambique" msgstr "" #: ../data/currencies.xml.in.h:329 msgid "Myanmar (Burmese Kyat)" msgstr "" #: ../data/currencies.xml.in.h:330 msgid "ar:MMK" msgstr "" #: ../data/currencies.xml.in.h:331 msgid "Myanmar" msgstr "" #: ../data/currencies.xml.in.h:332 #, fuzzy msgid "Namibian Dollar" msgstr "Dollar canadien" #: ../data/currencies.xml.in.h:333 #, fuzzy msgid "ar:NAD" msgstr "ar:NLG,florin" #: ../data/currencies.xml.in.h:334 msgid "Namibia" msgstr "" #: ../data/currencies.xml.in.h:335 msgid "Nepalese Rupee" msgstr "" #: ../data/currencies.xml.in.h:336 #, fuzzy msgid "ar:NPR" msgstr "ar:NLG,florin" #: ../data/currencies.xml.in.h:337 msgid "Nepal" msgstr "" #: ../data/currencies.xml.in.h:338 msgid "Nicaraguan Córdoba" msgstr "" #: ../data/currencies.xml.in.h:339 #, fuzzy msgid "ar:NIO" msgstr "ar:NLG,florin" #: ../data/currencies.xml.in.h:340 msgid "Nicaragua" msgstr "" #: ../data/currencies.xml.in.h:341 msgid "Nigerian Naira" msgstr "" #: ../data/currencies.xml.in.h:342 #, fuzzy msgid "ar:NGN,au:₦" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:343 msgid "Nigeria" msgstr "" #: ../data/currencies.xml.in.h:344 msgid "Omani Rial" msgstr "" #: ../data/currencies.xml.in.h:345 msgid "ar:OMR" msgstr "" #: ../data/currencies.xml.in.h:346 msgid "Oman" msgstr "" #: ../data/currencies.xml.in.h:347 msgid "Pakistani Rupee" msgstr "" #: ../data/currencies.xml.in.h:348 msgid "ar:PKR" msgstr "" #: ../data/currencies.xml.in.h:349 #, fuzzy msgid "Pakistan" msgstr "Constantes de Planck" #: ../data/currencies.xml.in.h:350 msgid "Panamaian Balboa" msgstr "" #: ../data/currencies.xml.in.h:351 msgid "ar:PAB" msgstr "" #: ../data/currencies.xml.in.h:352 msgid "Panama" msgstr "" #: ../data/currencies.xml.in.h:353 msgid "Papua New Guinean Kina" msgstr "" #: ../data/currencies.xml.in.h:354 msgid "ar:PGK" msgstr "" #: ../data/currencies.xml.in.h:355 msgid "Papua New Guinea" msgstr "" #: ../data/currencies.xml.in.h:356 msgid "Paraguayan Guaraní" msgstr "" #: ../data/currencies.xml.in.h:357 #, fuzzy msgid "ar:PYG,au:₲" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:358 msgid "Paraguay" msgstr "" #: ../data/currencies.xml.in.h:359 msgid "Peruvian Sol" msgstr "" #: ../data/currencies.xml.in.h:360 msgid "ar:PEN" msgstr "" #: ../data/currencies.xml.in.h:361 msgid "Peru" msgstr "" #: ../data/currencies.xml.in.h:362 msgid "Qatari Riyal" msgstr "" #: ../data/currencies.xml.in.h:363 msgid "ar:QAR" msgstr "" #: ../data/currencies.xml.in.h:364 msgid "Qatar" msgstr "" #: ../data/currencies.xml.in.h:365 #, fuzzy msgid "Rwandan Franc" msgstr "Franc belge" #: ../data/currencies.xml.in.h:366 msgid "ar:RWF" msgstr "" #: ../data/currencies.xml.in.h:367 msgid "Rwanda" msgstr "" #: ../data/currencies.xml.in.h:368 msgid "São Tomé and Príncipe Dobra" msgstr "" #: ../data/currencies.xml.in.h:369 msgid "ar:STD" msgstr "" #: ../data/currencies.xml.in.h:370 msgid "Sao Tome and Principe" msgstr "" #: ../data/currencies.xml.in.h:371 msgid "Saudi Riyal" msgstr "" #: ../data/currencies.xml.in.h:372 msgid "ar:SAR" msgstr "" #: ../data/currencies.xml.in.h:373 msgid "Saudi Arabia" msgstr "" #: ../data/currencies.xml.in.h:374 msgid "Serbian Dinar" msgstr "" #: ../data/currencies.xml.in.h:375 msgid "ar:RSD" msgstr "" #: ../data/currencies.xml.in.h:376 msgid "Serbia" msgstr "" #: ../data/currencies.xml.in.h:377 msgid "Seychellois Rupee" msgstr "" #: ../data/currencies.xml.in.h:378 msgid "ar:SCR" msgstr "" #: ../data/currencies.xml.in.h:379 msgid "Seychelles" msgstr "" #: ../data/currencies.xml.in.h:380 msgid "Sierra Leonean Leone" msgstr "" #: ../data/currencies.xml.in.h:381 msgid "ar:SLL" msgstr "" #: ../data/currencies.xml.in.h:382 msgid "Sierra Leone" msgstr "" #: ../data/currencies.xml.in.h:383 msgid "Solomon Islands Dollar" msgstr "" #: ../data/currencies.xml.in.h:384 msgid "ar:SBD" msgstr "" #: ../data/currencies.xml.in.h:385 msgid "Solomon Islands" msgstr "" #: ../data/currencies.xml.in.h:386 #, fuzzy msgid "Somali Shilling" msgstr "Shilling autrichien" #: ../data/currencies.xml.in.h:387 msgid "ar:SOS" msgstr "" #: ../data/currencies.xml.in.h:388 msgid "Somalia" msgstr "" #: ../data/currencies.xml.in.h:389 msgid "Sri Lankan Rupee;" msgstr "" #: ../data/currencies.xml.in.h:390 #, fuzzy msgid "ar:LKR,au:௹" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:391 msgid "Sri Lanka" msgstr "" #: ../data/currencies.xml.in.h:392 msgid "Sudanese Pound" msgstr "" #: ../data/currencies.xml.in.h:393 msgid "ar:SDG" msgstr "" #: ../data/currencies.xml.in.h:394 msgid "Sudan" msgstr "" #: ../data/currencies.xml.in.h:395 #, fuzzy msgid "Surinamese Dollar" msgstr "Dollar de Singapour" #: ../data/currencies.xml.in.h:396 msgid "ar:SRD" msgstr "" #: ../data/currencies.xml.in.h:397 #, fuzzy msgid "Suriname" msgstr "r:nom" #: ../data/currencies.xml.in.h:398 msgid "Swazi Lilangeni" msgstr "" #: ../data/currencies.xml.in.h:399 msgid "ar:SZL" msgstr "" #: ../data/currencies.xml.in.h:400 msgid "Swaziland" msgstr "" #: ../data/currencies.xml.in.h:401 #, fuzzy msgid "Syrian Pound" msgstr "Livre chypriote" #: ../data/currencies.xml.in.h:402 msgid "ar:SYP" msgstr "" #: ../data/currencies.xml.in.h:403 msgid "Syria" msgstr "" #: ../data/currencies.xml.in.h:404 #, fuzzy msgid "New Taiwan Dollar" msgstr "Dollars néo-zélandais" #: ../data/currencies.xml.in.h:405 msgid "ar:TWD" msgstr "" #: ../data/currencies.xml.in.h:406 msgid "Taiwan" msgstr "" #: ../data/currencies.xml.in.h:407 msgid "Tajikistani Somoni" msgstr "" #: ../data/currencies.xml.in.h:408 msgid "ar:TJS" msgstr "" #: ../data/currencies.xml.in.h:409 msgid "Tajikistan" msgstr "" #: ../data/currencies.xml.in.h:410 #, fuzzy msgid "Tanzanian Shilling" msgstr "Shilling autrichien" #: ../data/currencies.xml.in.h:411 msgid "ar:TZS" msgstr "" #: ../data/currencies.xml.in.h:412 msgid "Tanzania" msgstr "" #: ../data/currencies.xml.in.h:413 msgid "Tongan PaÊ»anga" msgstr "" #: ../data/currencies.xml.in.h:414 msgid "ar:TOP" msgstr "" #: ../data/currencies.xml.in.h:415 msgid "Tonga" msgstr "" #: ../data/currencies.xml.in.h:416 msgid "Trinidad and Tobago dollar" msgstr "" #: ../data/currencies.xml.in.h:417 msgid "ar:TTD" msgstr "" #: ../data/currencies.xml.in.h:418 msgid "Trinidad and Tobago" msgstr "" #: ../data/currencies.xml.in.h:419 msgid "Tunisian Dinar" msgstr "" #: ../data/currencies.xml.in.h:420 msgid "ar:TND" msgstr "" #: ../data/currencies.xml.in.h:421 msgid "Tunisia" msgstr "" #: ../data/currencies.xml.in.h:422 msgid "Turkmenistan Manat" msgstr "" #: ../data/currencies.xml.in.h:423 msgid "ar:TMT" msgstr "" #: ../data/currencies.xml.in.h:424 msgid "Turkmenistan" msgstr "" #: ../data/currencies.xml.in.h:425 #, fuzzy msgid "Ugandan Shilling" msgstr "Shilling autrichien" #: ../data/currencies.xml.in.h:426 msgid "ar:UGX" msgstr "" #: ../data/currencies.xml.in.h:427 msgid "Uganda" msgstr "" #: ../data/currencies.xml.in.h:428 msgid "Ukrainian Hryvnia" msgstr "" #: ../data/currencies.xml.in.h:429 #, fuzzy msgid "ar:UAH,au:₴" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:430 msgid "Ukraine" msgstr "" #: ../data/currencies.xml.in.h:431 msgid "United Arab Emirates Dirham" msgstr "" #: ../data/currencies.xml.in.h:432 msgid "ar:AED" msgstr "" #: ../data/currencies.xml.in.h:433 msgid "United Arab Emirates" msgstr "" #: ../data/currencies.xml.in.h:434 msgid "Uruguayan Peso" msgstr "" #: ../data/currencies.xml.in.h:435 msgid "ar:UYU" msgstr "" #: ../data/currencies.xml.in.h:436 msgid "Uruguay" msgstr "" #: ../data/currencies.xml.in.h:437 msgid "Uzbekistan SoÊ»m" msgstr "" #: ../data/currencies.xml.in.h:438 msgid "ar:UZS" msgstr "" #: ../data/currencies.xml.in.h:439 msgid "Uzbekistan" msgstr "" #: ../data/currencies.xml.in.h:440 msgid "Vanuatu Vatu" msgstr "" #: ../data/currencies.xml.in.h:441 msgid "ar:VUV" msgstr "" #: ../data/currencies.xml.in.h:442 msgid "Vanuatu" msgstr "" #: ../data/currencies.xml.in.h:443 msgid "Venezuelan Bolívar" msgstr "" #: ../data/currencies.xml.in.h:444 msgid "ar:VEF" msgstr "" #: ../data/currencies.xml.in.h:445 msgid "Venezuela" msgstr "" #: ../data/currencies.xml.in.h:446 msgid "Vietnamese Dồng" msgstr "" #: ../data/currencies.xml.in.h:447 #, fuzzy msgid "ar:VND,au:₫" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:448 msgid "Vietnam" msgstr "" #: ../data/currencies.xml.in.h:449 msgid "Yemeni Rial" msgstr "" #: ../data/currencies.xml.in.h:450 msgid "ar:YER" msgstr "" #: ../data/currencies.xml.in.h:451 #, fuzzy msgid "Yemen" msgstr "Élément" #: ../data/currencies.xml.in.h:452 msgid "Zambian Kwacha (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:453 msgid "ar:ZMK" msgstr "" #: ../data/currencies.xml.in.h:454 msgid "Euro Cent" msgstr "centime d'Euro" #: ../data/currencies.xml.in.h:455 msgid "r:eurocent,p:eurocents" msgstr "" #: ../data/currencies.xml.in.h:456 msgid "Cent (USD)" msgstr "" #: ../data/currencies.xml.in.h:457 msgid "au:¢,r:cent,p:cents" msgstr "" #: ../data/currencies.xml.in.h:458 #, fuzzy msgid "Belgian Franc (obsolete)" msgstr "Franc belge" #: ../data/currencies.xml.in.h:459 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:460 #, fuzzy msgid "Greek Drachma (obsolete)" msgstr "Drachme grecque" #: ../data/currencies.xml.in.h:461 #, fuzzy msgid "ar:GRD,au:₯" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:462 #, fuzzy msgid "French Franc (obsolete)" msgstr "Franc français" #: ../data/currencies.xml.in.h:463 #, fuzzy msgid "ar:FRF,au:₣" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:464 #, fuzzy msgid "Italian Lira (obsolete)" msgstr "Lire italienne" #: ../data/currencies.xml.in.h:465 msgid "ar:ITL" msgstr "" #: ../data/currencies.xml.in.h:466 #, fuzzy msgid "Dutch Guilder (obsolete)" msgstr "Florin néerlandais" #: ../data/currencies.xml.in.h:467 #, fuzzy msgid "ar:NLG" msgstr "ar:NLG,florin" #: ../data/currencies.xml.in.h:468 #, fuzzy msgid "Portuguese Escudo (obsolete)" msgstr "Escudo portugais" #: ../data/currencies.xml.in.h:469 msgid "ar:PTE" msgstr "" #: ../data/currencies.xml.in.h:470 msgid "Deutsche Mark (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:471 msgid "ar:DEM" msgstr "" #: ../data/currencies.xml.in.h:472 #, fuzzy msgid "Spanish Peseta (obsolete)" msgstr "Peseta espagnole" #: ../data/currencies.xml.in.h:473 #, fuzzy msgid "ar:ESP,au:₧" msgstr "ar:ITL,au:₤,lire" #: ../data/currencies.xml.in.h:474 #, fuzzy msgid "Irish Pound (obsolete)" msgstr "Livre irlandaise" #: ../data/currencies.xml.in.h:475 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:476 #, fuzzy msgid "Luxembourg Franc (obsolete)" msgstr "Franc luxembourgeois" #: ../data/currencies.xml.in.h:477 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:478 #, fuzzy msgid "Austrian Schilling (obsolete)" msgstr "Shilling autrichien" #: ../data/currencies.xml.in.h:479 msgid "ar:ATS" msgstr "" #: ../data/currencies.xml.in.h:480 #, fuzzy msgid "Finnish Markka (obsolete)" msgstr "Markka finnois" #: ../data/currencies.xml.in.h:481 msgid "ar:FIM" msgstr "" #: ../data/currencies.xml.in.h:482 #, fuzzy msgid "Slovenian Tolar (obsolete)" msgstr "Tolar slovène" #: ../data/currencies.xml.in.h:483 msgid "ar:SIT" msgstr "" #: ../data/currencies.xml.in.h:484 #, fuzzy msgid "Cypriot Pound (obsolete)" msgstr "Livre chypriote" #: ../data/currencies.xml.in.h:485 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:486 #, fuzzy msgid "Estonian Kroon (obsolete)" msgstr "Kroon estonienne" #: ../data/currencies.xml.in.h:487 msgid "ar:EEK" msgstr "" #: ../data/currencies.xml.in.h:488 #, fuzzy msgid "Slovak Koruna (obsolete)" msgstr "Couronne slovaque" #: ../data/currencies.xml.in.h:489 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:490 #, fuzzy msgid "Maltese Lira (obsolete)" msgstr "Lire maltaise" #: ../data/currencies.xml.in.h:491 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:492 #, fuzzy msgid "Latvian Lats (obsolete)" msgstr "Lats letton" #: ../data/currencies.xml.in.h:493 msgid "ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:494 #, fuzzy msgid "Lithuanian Litas (obsolete)" msgstr "Litas lituanien" #: ../data/currencies.xml.in.h:495 msgid "ar:LTL" msgstr "" #: ../data/currencies.xml.in.h:496 #, fuzzy msgid "Belarusian Ruble" msgstr "Rouble russe" #: ../data/currencies.xml.in.h:497 msgid "ar:BYN" msgstr "" #: ../data/currencies.xml.in.h:498 msgid "Belarus" msgstr "" #: ../data/currencies.xml.in.h:499 msgid "Zambian Kwacha" msgstr "" #: ../data/currencies.xml.in.h:500 msgid "ar:ZMW" msgstr "" #: ../data/currencies.xml.in.h:501 msgid "Zambia" msgstr "" #: ../data/currencies.xml.in.h:502 msgid "Mauritanian Ouguiya" msgstr "" #: ../data/currencies.xml.in.h:503 msgid "ar:MRU" msgstr "" #: ../data/currencies.xml.in.h:504 #, fuzzy msgid "Mauritania" msgstr "Échéance" #: ../data/datasets.xml.in.h:1 msgid "Data Sets" msgstr "Ensembles de Données" #. Data set for chemical elements #: ../data/datasets.xml.in.h:3 msgid "!datasets!Elements" msgstr "" #: ../data/datasets.xml.in.h:4 msgid "r:atom" msgstr "r:atome" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:6 msgid "!datasets!Element" msgstr "" #: ../data/datasets.xml.in.h:7 msgid "Symbol" msgstr "Symbole" #: ../data/datasets.xml.in.h:8 msgid "r:symbol" msgstr "r:symbole" #. Chemical elements number #: ../data/datasets.xml.in.h:10 msgid "!datasets!Number" msgstr "Nombre" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "r:nombre" #: ../data/datasets.xml.in.h:13 ../data/functions.xml.in.h:647 msgid "Name" msgstr "Nom" #: ../data/datasets.xml.in.h:14 msgid "r:name" msgstr "r:nom" #: ../data/datasets.xml.in.h:15 msgid "Classification" msgstr "" #: ../data/datasets.xml.in.h:16 #, fuzzy msgid "" "A number representing an element group: 1 Alkali Metal 2 Alkaline-" "Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 " "Metal 7 Metalloid 8 Polyatomic Non-Metal 9 Diatomic Non-" "Metal 10 Noble Gas 11 Unknown chemical properties" msgstr "" "Un nombre qui représente un groupe d'éléments: 1 Métal Alcalin 2 " "Métal Alcalino-Terreux 3 Lanthanide 4 Actinide 5 Métal de " "transition 6 Métal 7 Métalloïde 8 Non-métal 9 " "Halogène 10 Gaz Noble 11 Transactinide" #: ../data/datasets.xml.in.h:17 msgid "r:class" msgstr "r:classe" #: ../data/datasets.xml.in.h:18 ../data/functions.xml.in.h:414 msgid "Weight" msgstr "Poids" #: ../data/datasets.xml.in.h:19 msgid "r:weight,mass" msgstr "r:poids,masse" #: ../data/datasets.xml.in.h:20 msgid "Boiling Point" msgstr "" #: ../data/datasets.xml.in.h:21 msgid "r:boiling" msgstr "" #: ../data/datasets.xml.in.h:22 msgid "Melting Point" msgstr "" #: ../data/datasets.xml.in.h:23 msgid "r:melting" msgstr "" #: ../data/datasets.xml.in.h:24 ../data/units.xml.in.h:117 msgid "Density" msgstr "Densité" #: ../data/datasets.xml.in.h:25 #, fuzzy msgid "Density at 295K" msgstr "Densité" #: ../data/datasets.xml.in.h:26 msgid "r:density" msgstr "r:densité" #: ../data/datasets.xml.in.h:27 msgid "X Position" msgstr "Position en X" #: ../data/datasets.xml.in.h:28 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:29 msgid "Y Position" msgstr "Position en Y" #: ../data/datasets.xml.in.h:30 msgid "r:y_pos" msgstr "" #: ../data/datasets.xml.in.h:31 msgid "Planets" msgstr "Planètes" #: ../data/datasets.xml.in.h:32 msgid "r:planet" msgstr "r:planète" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "Planète" #: ../data/datasets.xml.in.h:34 msgid "Orbital Period (Year)" msgstr "Période Orbitale (Année)" #. Orbital period for planet #: ../data/datasets.xml.in.h:36 msgid "!datasets!r:year" msgstr "r:année" #: ../data/datasets.xml.in.h:37 msgid "Average Orbital Speed" msgstr "Vitesse Orbitale Moyenne" #: ../data/datasets.xml.in.h:38 msgid "r:speed" msgstr "r:vitesse" #: ../data/datasets.xml.in.h:39 msgid "Eccentricity" msgstr "Excentricité" #: ../data/datasets.xml.in.h:40 msgid "r:eccentricity" msgstr "r:excentricité" #: ../data/datasets.xml.in.h:41 msgid "Inclination" msgstr "Inclinaison" #: ../data/datasets.xml.in.h:42 msgid "r:inclination" msgstr "r:inclinaison" #: ../data/datasets.xml.in.h:43 msgid "Number of Satellites" msgstr "Nombre de Satellites" #: ../data/datasets.xml.in.h:44 msgid "r:satellites" msgstr "" #. Planet mass #: ../data/datasets.xml.in.h:46 msgid "!datasets!Mass" msgstr "Masse" #: ../data/datasets.xml.in.h:47 msgid "r:mass" msgstr "r:masse" #: ../data/datasets.xml.in.h:48 msgid "Mean Density" msgstr "Densité Moyenne" #: ../data/datasets.xml.in.h:49 msgid "Surface Area" msgstr "Aire" #. Surface area of planet #: ../data/datasets.xml.in.h:51 msgid "!datasets!r:area" msgstr "r:aire" #: ../data/datasets.xml.in.h:52 msgid "Equatorial Gravity" msgstr "Gravité Équatoriale" #: ../data/datasets.xml.in.h:53 msgid "r:gravity" msgstr "r:gravité" #: ../data/datasets.xml.in.h:54 msgid "Mean Surface Temperature" msgstr "Température Moyenne de Surface" #: ../data/datasets.xml.in.h:55 msgid "r:temperature" msgstr "r:température" #: ../data/elements.xml.in.h:1 msgid "Hydrogen" msgstr "Hydrogène" #: ../data/elements.xml.in.h:2 msgid "Helium" msgstr "Hélium" #: ../data/elements.xml.in.h:3 msgid "Lithium" msgstr "" #: ../data/elements.xml.in.h:4 msgid "Beryllium" msgstr "Béryllium" #: ../data/elements.xml.in.h:5 msgid "Boron" msgstr "Bore" #: ../data/elements.xml.in.h:6 msgid "Carbon" msgstr "Carbone" #: ../data/elements.xml.in.h:7 msgid "Nitrogen" msgstr "Azote" #: ../data/elements.xml.in.h:8 msgid "Oxygen" msgstr "Oxygène" #: ../data/elements.xml.in.h:9 msgid "Fluorine" msgstr "Fluor" #: ../data/elements.xml.in.h:10 msgid "Neon" msgstr "Néon" #: ../data/elements.xml.in.h:11 msgid "Sodium" msgstr "" #: ../data/elements.xml.in.h:12 msgid "Magnesium" msgstr "Magnésium" #: ../data/elements.xml.in.h:13 msgid "Aluminum" msgstr "" #: ../data/elements.xml.in.h:14 msgid "Silicon" msgstr "Silicium" #: ../data/elements.xml.in.h:15 msgid "Phosphorus" msgstr "Phosphore" #: ../data/elements.xml.in.h:16 msgid "Sulfur" msgstr "Soufre" #: ../data/elements.xml.in.h:17 msgid "Chlorine" msgstr "Chlore" #: ../data/elements.xml.in.h:18 msgid "Argon" msgstr "" #: ../data/elements.xml.in.h:19 msgid "Potassium" msgstr "" #: ../data/elements.xml.in.h:20 msgid "Calcium" msgstr "" #: ../data/elements.xml.in.h:21 msgid "Scandium" msgstr "" #: ../data/elements.xml.in.h:22 msgid "Titanium" msgstr "Titane" #: ../data/elements.xml.in.h:23 msgid "Vanadium" msgstr "" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "Chrome" #: ../data/elements.xml.in.h:25 msgid "Manganese" msgstr "Manganèse" #: ../data/elements.xml.in.h:26 msgid "Iron" msgstr "Fer" #: ../data/elements.xml.in.h:27 msgid "Cobalt" msgstr "" #: ../data/elements.xml.in.h:28 msgid "Nickel" msgstr "" #: ../data/elements.xml.in.h:29 msgid "Copper" msgstr "Cuivre" #: ../data/elements.xml.in.h:30 msgid "Zinc" msgstr "" #: ../data/elements.xml.in.h:31 msgid "Gallium" msgstr "" #: ../data/elements.xml.in.h:32 msgid "Germanium" msgstr "" #: ../data/elements.xml.in.h:33 msgid "Arsenic" msgstr "" #: ../data/elements.xml.in.h:34 msgid "Selenium" msgstr "Sélénium" #: ../data/elements.xml.in.h:35 msgid "Bromine" msgstr "Brome" #: ../data/elements.xml.in.h:36 msgid "Krypton" msgstr "" #: ../data/elements.xml.in.h:37 msgid "Rubidium" msgstr "" #: ../data/elements.xml.in.h:38 msgid "Strontium" msgstr "" #: ../data/elements.xml.in.h:39 msgid "Yttrium" msgstr "" #: ../data/elements.xml.in.h:40 msgid "Zirconium" msgstr "" #: ../data/elements.xml.in.h:41 msgid "Niobium" msgstr "" #: ../data/elements.xml.in.h:42 msgid "Molybdenum" msgstr "Molybdène" #: ../data/elements.xml.in.h:43 msgid "Technetium" msgstr "Technétium" #: ../data/elements.xml.in.h:44 msgid "Ruthenium" msgstr "" #: ../data/elements.xml.in.h:45 msgid "Rhodium" msgstr "" #: ../data/elements.xml.in.h:46 msgid "Palladium" msgstr "" #: ../data/elements.xml.in.h:47 msgid "Silver" msgstr "Argent" #: ../data/elements.xml.in.h:48 msgid "Cadmium" msgstr "" #: ../data/elements.xml.in.h:49 msgid "Indium" msgstr "" #: ../data/elements.xml.in.h:50 msgid "Tin" msgstr "Étain" #: ../data/elements.xml.in.h:51 msgid "Antimony" msgstr "Antimoine" #: ../data/elements.xml.in.h:52 msgid "Tellurium" msgstr "Tellure" #: ../data/elements.xml.in.h:53 msgid "Iodine" msgstr "Iode" #: ../data/elements.xml.in.h:54 msgid "Xenon" msgstr "Xénon" #: ../data/elements.xml.in.h:55 msgid "Cesium" msgstr "Césium" #: ../data/elements.xml.in.h:56 msgid "Barium" msgstr "Baryum" #: ../data/elements.xml.in.h:57 msgid "Lanthanum" msgstr "Lanthane" #: ../data/elements.xml.in.h:58 msgid "Cerium" msgstr "Cérium" #: ../data/elements.xml.in.h:59 msgid "Praseodymium" msgstr "Praséodyme" #: ../data/elements.xml.in.h:60 msgid "Neodymium" msgstr "Néodyme" #: ../data/elements.xml.in.h:61 msgid "Promethium" msgstr "Prométhium" #: ../data/elements.xml.in.h:62 msgid "Samarium" msgstr "" #: ../data/elements.xml.in.h:63 msgid "Europium" msgstr "" #: ../data/elements.xml.in.h:64 msgid "Gadolinium" msgstr "" #: ../data/elements.xml.in.h:65 msgid "Terbium" msgstr "" #: ../data/elements.xml.in.h:66 msgid "Dysprosium" msgstr "" #: ../data/elements.xml.in.h:67 msgid "Holmium" msgstr "" #: ../data/elements.xml.in.h:68 msgid "Erbium" msgstr "" #: ../data/elements.xml.in.h:69 msgid "Thulium" msgstr "" #: ../data/elements.xml.in.h:70 msgid "Ytterbium" msgstr "" #: ../data/elements.xml.in.h:71 msgid "Lutetium" msgstr "" #: ../data/elements.xml.in.h:72 msgid "Hafnium" msgstr "" #: ../data/elements.xml.in.h:73 msgid "Tantalum" msgstr "Tantale" #: ../data/elements.xml.in.h:74 msgid "Tungsten" msgstr "Tungstène" #: ../data/elements.xml.in.h:75 msgid "Rhenium" msgstr "Rhénium" #: ../data/elements.xml.in.h:76 msgid "Osmium" msgstr "" #: ../data/elements.xml.in.h:77 msgid "Iridium" msgstr "" #: ../data/elements.xml.in.h:78 msgid "Platinum" msgstr "Platine" #: ../data/elements.xml.in.h:79 msgid "Gold" msgstr "Or" #. Chemical element #: ../data/elements.xml.in.h:81 msgid "!elements!Mercury" msgstr "Mercure" #: ../data/elements.xml.in.h:82 msgid "Thallium" msgstr "" #: ../data/elements.xml.in.h:83 msgid "Lead" msgstr "Plomb" #: ../data/elements.xml.in.h:84 msgid "Bismuth" msgstr "" #: ../data/elements.xml.in.h:85 msgid "Polonium" msgstr "" #: ../data/elements.xml.in.h:86 msgid "Astatine" msgstr "Astate" #: ../data/elements.xml.in.h:87 msgid "Radon" msgstr "" #: ../data/elements.xml.in.h:88 msgid "Francium" msgstr "" #: ../data/elements.xml.in.h:89 msgid "Radium" msgstr "" #: ../data/elements.xml.in.h:90 msgid "Actinium" msgstr "" #: ../data/elements.xml.in.h:91 msgid "Thorium" msgstr "" #: ../data/elements.xml.in.h:92 msgid "Protactinium" msgstr "" #: ../data/elements.xml.in.h:93 msgid "Uranium" msgstr "" #: ../data/elements.xml.in.h:94 msgid "Neptunium" msgstr "" #: ../data/elements.xml.in.h:95 msgid "Plutonium" msgstr "" #: ../data/elements.xml.in.h:96 msgid "Americium" msgstr "" #: ../data/elements.xml.in.h:97 msgid "Curium" msgstr "" #: ../data/elements.xml.in.h:98 msgid "Berkelium" msgstr "Berkélium" #: ../data/elements.xml.in.h:99 msgid "Californium" msgstr "" #: ../data/elements.xml.in.h:100 msgid "Einsteinium" msgstr "" #: ../data/elements.xml.in.h:101 msgid "Fermium" msgstr "" #: ../data/elements.xml.in.h:102 msgid "Mendelevium" msgstr "" #: ../data/elements.xml.in.h:103 msgid "Nobelium" msgstr "" #: ../data/elements.xml.in.h:104 msgid "Lawrencium" msgstr "" #: ../data/elements.xml.in.h:105 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:106 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Copernicium" msgstr "" #: ../data/elements.xml.in.h:114 #, fuzzy msgid "Nihonium" msgstr "Rhénium" #: ../data/elements.xml.in.h:115 msgid "Flerovium" msgstr "" #: ../data/elements.xml.in.h:116 msgid "Moscovium" msgstr "" #: ../data/elements.xml.in.h:117 msgid "Livermorium" msgstr "" #: ../data/elements.xml.in.h:118 #, fuzzy msgid "Tennessine" msgstr "Régression" #: ../data/elements.xml.in.h:119 msgid "Oganesson" msgstr "" #: ../data/functions.xml.in.h:1 msgid "Matrices & Vectors" msgstr "Matrices & Vecteurs" #: ../data/functions.xml.in.h:2 msgid "Construct Vector" msgstr "Construire un Vecteur" #: ../data/functions.xml.in.h:3 msgid "r:vector" msgstr "" #: ../data/functions.xml.in.h:4 msgid "Returns a vector with listed elements." msgstr "Retourne un vecteur avec les éléments listés." #. Vector/matrix elements #: ../data/functions.xml.in.h:6 msgid "Elements" msgstr "Éléments" #: ../data/functions.xml.in.h:7 msgid "Generate Vector" msgstr "Générer un vecteur" #: ../data/functions.xml.in.h:8 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:9 msgid "" "Returns a vector generated from a function with a variable (default x) " "running from min to max. The fourth argument is either the requested number " "of elements if the sixth argument is false (default) or the step between " "each value of the variable." msgstr "" "Retourne un vecteur généré par une fonction à une variable (par défaut : x) " "parcourant des valeurs entre min et max. Le quatrième argument est soit le " "nombre d'éléments voulus si le sixième argument est faux (par défaut) ou le " "pas entre chaque valeur de la variable." #: ../data/functions.xml.in.h:10 msgid "Function" msgstr "Fonction" #: ../data/functions.xml.in.h:11 msgid "Min" msgstr "" #: ../data/functions.xml.in.h:12 msgid "Max" msgstr "" #: ../data/functions.xml.in.h:13 msgid "Dimension / Step size" msgstr "Dimension / Taille du pas" #: ../data/functions.xml.in.h:14 msgid "Variable" msgstr "" #: ../data/functions.xml.in.h:15 msgid "Use step size" msgstr "Utiliser le pas" #: ../data/functions.xml.in.h:16 msgid "Sort" msgstr "Trier" #: ../data/functions.xml.in.h:17 msgid "r:sort" msgstr "" #: ../data/functions.xml.in.h:18 #, fuzzy msgid "Returns a sorted vector." msgstr "Retourne la pile NPI sous forme de vecteur." #: ../data/functions.xml.in.h:19 msgid "Vector" msgstr "Vecteur" #: ../data/functions.xml.in.h:20 msgid "Ascending" msgstr "Ascendant" #: ../data/functions.xml.in.h:21 msgid "Rank" msgstr "" #: ../data/functions.xml.in.h:22 msgid "r:rank" msgstr "" #: ../data/functions.xml.in.h:23 msgid "" "Returns a vector with values of elements replaced with their mutual ranks." msgstr "" "Retourne un vecteur dont les valeurs de éléments ont été remplacées par leur " "rang respectif." #: ../data/functions.xml.in.h:24 msgid "Vector Limits" msgstr "Limites de Vecteur" #: ../data/functions.xml.in.h:25 msgid "r:limits" msgstr "limites" #: ../data/functions.xml.in.h:26 msgid "Returns a part of a vector between two positions." msgstr "Retourne une partie de vecteur entre deux positions." #: ../data/functions.xml.in.h:27 msgid "Lower limit" msgstr "Limite inférieure" #: ../data/functions.xml.in.h:28 msgid "Upper limit" msgstr "Limite Supérieure" #: ../data/functions.xml.in.h:29 msgid "Dimension" msgstr "" #: ../data/functions.xml.in.h:30 msgid "r:dimension" msgstr "" #: ../data/functions.xml.in.h:31 msgid "Returns the number of elements in a vector." msgstr "Retourne le nombre d'éléments dans un vecteur." #: ../data/functions.xml.in.h:32 msgid "Merge Vectors" msgstr "Regrouper les Vecteurs" #: ../data/functions.xml.in.h:33 msgid "r:mergevectors" msgstr "regrouper_vecteurs" #: ../data/functions.xml.in.h:34 msgid "Returns a vector with the elements from two vectors." msgstr "Retourne un vecteur avec les éléments de deux vecteurs." #: ../data/functions.xml.in.h:35 msgid "Vector 1" msgstr "Vecteur 1" #: ../data/functions.xml.in.h:36 msgid "Vector 2" msgstr "Vecteur 2" #: ../data/functions.xml.in.h:37 msgid "Construct Matrix" msgstr "Construire une Matrice" #: ../data/functions.xml.in.h:38 msgid "r:matrix" msgstr "matrice" #: ../data/functions.xml.in.h:39 msgid "" "Returns a matrix with specified dimensions and listed elements. Omitted " "elements are set to zero." msgstr "" "Retourne une matrice avec les dimensions spécifiées et les éléments listés. " "Les éléments omis sont fixés à zéro." #: ../data/functions.xml.in.h:40 msgid "Rows" msgstr "Lignes" #: ../data/functions.xml.in.h:41 msgid "Columns" msgstr "Colonnes" #: ../data/functions.xml.in.h:42 msgid "Convert Matrix to Vector" msgstr "Convertir une matrice en vecteur" #: ../data/functions.xml.in.h:43 msgid "r:matrix2vector" msgstr "matrice_vers_vecteur" #: ../data/functions.xml.in.h:44 msgid "Puts each element of a matrix in vertical order in a vector." msgstr "" "Met chaque élément d'une matrice dans un vecteur en la parcourant " "verticalement." #: ../data/functions.xml.in.h:45 msgid "Matrix" msgstr "Matrice" #: ../data/functions.xml.in.h:46 msgid "Matrix Area" msgstr "" #. Matrix area #: ../data/functions.xml.in.h:48 msgid "r:area" msgstr "" #: ../data/functions.xml.in.h:49 msgid "Returns a part of a matrix." msgstr "Retourne une partie de matrice." #: ../data/functions.xml.in.h:50 msgid "Start row" msgstr "Ligne de départ" #: ../data/functions.xml.in.h:51 msgid "Start column" msgstr "Colonne de départ" #: ../data/functions.xml.in.h:52 msgid "End row" msgstr "Terminer la ligne" #: ../data/functions.xml.in.h:53 msgid "End column" msgstr "Terminer la colonne" #: ../data/functions.xml.in.h:54 msgid "r:rows" msgstr "" #: ../data/functions.xml.in.h:55 msgid "Returns the number of rows in a matrix." msgstr "Retourne le nombre de lignes d'une matrice." #: ../data/functions.xml.in.h:56 msgid "r:columns" msgstr "colonnes" #: ../data/functions.xml.in.h:57 msgid "Returns the number of columns in a matrix." msgstr "Retourne le nombre de colonnes dans une matrice." #: ../data/functions.xml.in.h:58 msgid "Extract row as vector" msgstr "Extraire une ligne comme vecteur" #: ../data/functions.xml.in.h:59 msgid "r:row" msgstr "" #: ../data/functions.xml.in.h:60 msgid "Returns a row in a matrix as a vector." msgstr "Retourne une ligne dans une matrice sous forme de vecteur." #: ../data/functions.xml.in.h:61 msgid "Row" msgstr "Ligne" #: ../data/functions.xml.in.h:62 msgid "Extract Column as Vector" msgstr "Extraire une Colonne comme Vecteur" #: ../data/functions.xml.in.h:63 msgid "r:column" msgstr "colonne" #: ../data/functions.xml.in.h:64 msgid "Returns a column in a matrix as a vector." msgstr "Retourne une colonne de matrice comme vecteur." #: ../data/functions.xml.in.h:65 msgid "Column" msgstr "Colonne" #: ../data/functions.xml.in.h:66 msgid "r:elements" msgstr "éléments" #: ../data/functions.xml.in.h:67 msgid "Returns the number of elements in a matrix or vector." msgstr "Retourne le nombre d'éléments dans une matrice ou un vecteur." #: ../data/functions.xml.in.h:68 msgid "Matrix or vector" msgstr "Matrice ou vecteur" #. Vector/matrix element #: ../data/functions.xml.in.h:70 msgid "Element" msgstr "Élément" #: ../data/functions.xml.in.h:71 msgid "r:element" msgstr "élément" #: ../data/functions.xml.in.h:72 msgid "" "Returns the element at specified position in a matrix (row and column) or " "vector (index)." msgstr "" "Retourne l'élément de matrice à la position spécifiée (ligne et colonne) ou " "vecteur (index)." #: ../data/functions.xml.in.h:73 msgid "Matrix/vector" msgstr "Matrice/Vecteur" #: ../data/functions.xml.in.h:74 msgid "Row/index" msgstr "Ligne/indice" #: ../data/functions.xml.in.h:75 msgid "Transpose" msgstr "Transposée" #: ../data/functions.xml.in.h:76 msgid "r:transpose" msgstr "" #: ../data/functions.xml.in.h:77 msgid "Returns the transpose of a matrix." msgstr "Retourne la transposée d'une matrice." #: ../data/functions.xml.in.h:78 msgid "Identity" msgstr "Identité" #: ../data/functions.xml.in.h:79 msgid "r:identity" msgstr "identité" #: ../data/functions.xml.in.h:80 msgid "" "Returns the identity matrix of a matrix or with specified number of rows/" "columns." msgstr "" "Retourne la matrice identité ou une matrice avec le nombre indiqué de lignes/" "colonnes." #: ../data/functions.xml.in.h:81 msgid "Matrix or rows/columns" msgstr "Matrice ou lignes/colonnes" #: ../data/functions.xml.in.h:82 msgid "Determinant" msgstr "Déterminant" #: ../data/functions.xml.in.h:83 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:84 msgid "Calculates the determinant of a matrix." msgstr "Calcule le déterminant d'une matrice." #: ../data/functions.xml.in.h:85 msgid "Permanent" msgstr "" #: ../data/functions.xml.in.h:86 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:87 msgid "" "Calculates the permanent of a matrix. The permanent differs from a " "determinant in that all signs in the expansion by minors are taken as " "positive." msgstr "" "Calcule le permanent d'une matrice. Le permanent diffère du déterminant dans " "le fait que tous les signes dans le développement en mineurs sont pris " "positifs." #: ../data/functions.xml.in.h:88 msgid "Adjugate (Adjoint)" msgstr "Comatrice" #: ../data/functions.xml.in.h:89 msgid "r:adj" msgstr "" #: ../data/functions.xml.in.h:90 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "Calcule la comatrice de la matrice" #: ../data/functions.xml.in.h:91 msgid "Cofactor" msgstr "Cofacteur" #: ../data/functions.xml.in.h:92 msgid "r:cofactor" msgstr "cofacteur" #: ../data/functions.xml.in.h:93 msgid "Calculates the cofactor of the element at specified position." msgstr "Calcule le cofacteur à la position désignée." #: ../data/functions.xml.in.h:94 msgid "Matrix Inverse" msgstr "Inverse de Matrice" #: ../data/functions.xml.in.h:95 msgid "r:inverse" msgstr "" #: ../data/functions.xml.in.h:96 msgid "" "Calculates the inverse of a matrix. The inverse is the matrix that " "multiplied by the original matrix equals the identity matrix (AB = BA = I)." msgstr "" "Calcule l'inverse d'une matrice. L'inverse est la matrice qui multipliée à " "la matrice originale est égale à la matrice identité (AB = BA = I)." #: ../data/functions.xml.in.h:97 msgid "Load CSV File" msgstr "Charger un Fichier CSV" #: ../data/functions.xml.in.h:98 msgid "r:load" msgstr "" #: ../data/functions.xml.in.h:99 msgid "Returns a matrix imported from a CSV data file." msgstr "Retourne une matrice importée d'un fichier de données CSV." #: ../data/functions.xml.in.h:100 msgid "Filename" msgstr "Nom de fichier" #: ../data/functions.xml.in.h:101 msgid "First data row" msgstr "Première ligne de données" #: ../data/functions.xml.in.h:102 msgid "Separator" msgstr "Séparateur" #: ../data/functions.xml.in.h:103 msgid "Export To CSV File" msgstr "Exporter dans un ficher CSV" #: ../data/functions.xml.in.h:104 msgid "r:export" msgstr "" #: ../data/functions.xml.in.h:105 msgid "Exports a matrix to a CSV data file." msgstr "Exporte une matrice dans un fichier de données CSV." #: ../data/functions.xml.in.h:106 #, fuzzy msgid "Magnitude" msgstr "Magnésium" #: ../data/functions.xml.in.h:107 msgid "r:magnitude" msgstr "" #: ../data/functions.xml.in.h:108 msgid "" "Calculates the magnitude of a value. This function returns the same value as " "abs() for all values except vectors." msgstr "" #: ../data/functions.xml.in.h:109 msgid "Value" msgstr "Valeur" #: ../data/functions.xml.in.h:110 #, fuzzy msgid "Hadamard Product" msgstr "Produit" #: ../data/functions.xml.in.h:111 msgid "r:hadamard" msgstr "" #: ../data/functions.xml.in.h:112 msgid "" "Mulitplies each separate element in matrix 1 with the corresponding element " "in matrix 2." msgstr "" #: ../data/functions.xml.in.h:113 #, fuzzy msgid "Matrix 1" msgstr "Matrice" #: ../data/functions.xml.in.h:114 #, fuzzy msgid "Matrix 2" msgstr "Matrice" #: ../data/functions.xml.in.h:115 #, fuzzy msgid "Entrywise Function" msgstr "Fonction" #: ../data/functions.xml.in.h:116 msgid "r:entrywise" msgstr "" #: ../data/functions.xml.in.h:117 msgid "" "Calculates a new matrix or vector using each separate element in matrix/" "vector 1 and the corresponding (in the same row and column) elements in " "matrix/vector 2. An unlimited number of matrices/vectors can be specified, " "with each matrix/vector argument followed by the corresponding variable used " "in the function argument." msgstr "" #: ../data/functions.xml.in.h:118 #, fuzzy msgid "Matrices/vectors and variables" msgstr "Variable vecteur" #: ../data/functions.xml.in.h:119 msgid "Norm (length)" msgstr "Norme (longueur)" #: ../data/functions.xml.in.h:120 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:121 msgid "Calculates the norm/length of a vector." msgstr "Calcule la norme d'un vecteur." #: ../data/functions.xml.in.h:122 msgid "Cross Product" msgstr "" #: ../data/functions.xml.in.h:123 msgid "r:cross" msgstr "" #: ../data/functions.xml.in.h:124 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "" #: ../data/functions.xml.in.h:125 msgid "Combinatorics" msgstr "Combinatoire" #: ../data/functions.xml.in.h:126 msgid "Factorial" msgstr "Factorielle" #: ../data/functions.xml.in.h:127 msgid "" "Calculates the factorial of an integer. Multiplies the argument with every " "lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number " "followed by one exclamation mark." msgstr "" "Calcule la factorielle d'un entier. Multiplie l'argument avec tous les " "entiers positifs plus petits : n(n-1)(n-2)...2*1. Peut aussi être entré " "comme un nombre suivi d'un point d'exclamation." #: ../data/functions.xml.in.h:128 msgid "r:factorial" msgstr "factorielle" #: ../data/functions.xml.in.h:129 msgid "Double Factorial" msgstr "Factorielle double" #: ../data/functions.xml.in.h:130 msgid "r:factorial2" msgstr "factorielle2" #: ../data/functions.xml.in.h:131 msgid "" "Calculates the double factorial of an integer. Multiplies the argument with " "every second lesser positive integer (n(n-2)(n-4)...). Can also be entered " "as a number followed by two exclamation marks." msgstr "" "Calcule la double factorielle d'un entier. Multiplie l'argument avec tous " "les deuxièmes entiers positifs plus petits : n(n-2)(n-4)... Peut aussi être " "entré comme un nombre suivi de deux points d'exclamation." #: ../data/functions.xml.in.h:132 msgid "Multifactorial" msgstr "Multifactorielle" #: ../data/functions.xml.in.h:133 msgid "r:multifactorial" msgstr "multifactorielle" #: ../data/functions.xml.in.h:134 msgid "" "Calculates the multifactorial of an integer. Multiplies the argument with " "every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a " "number followed by three or more exclamation marks." msgstr "" "Calcule la multifactorielle d'un entier. Multiplie l'argument avec tous les " "entiers positifs plus petits placés tous les x (n(n-x)(n-2x)...). Peut aussi " "être entré comme un nombre suivi de trois points d'exclamation ou plus." #: ../data/functions.xml.in.h:135 msgid "Binomial Coefficient" msgstr "Coefficient binomial" #: ../data/functions.xml.in.h:136 msgid "r:binomial" msgstr "" #: ../data/functions.xml.in.h:137 msgid "Exponent" msgstr "Exposant" #: ../data/functions.xml.in.h:138 msgid "Index" msgstr "" #: ../data/functions.xml.in.h:139 msgid "Hyperfactorial" msgstr "Hyperfactorielle" #: ../data/functions.xml.in.h:140 msgid "r:hyperfactorial" msgstr "hyperfactorielle" #: ../data/functions.xml.in.h:141 msgid "" "Calculates the hyperfactorial of an integer. Multiplies the argument raised " "by itself with every lesser positive integer raised by themselves (1^1 * " "2^2 ... n^n)." msgstr "" "Calcule l'hyperfactorielle d'un entier. Multiplie l'argument élevé à lui-" "même avec tous les entiers positifs plus petits élevés à eux-mêmes (1^1 * " "2^2 ... n^n)." #: ../data/functions.xml.in.h:142 msgid "Superfactorial" msgstr "Superfactorielle" #: ../data/functions.xml.in.h:143 msgid "r:superfactorial" msgstr "" #: ../data/functions.xml.in.h:144 msgid "" "Calculates the superfactorial of an integer. Multiplies the factorial of the " "argument with the factorial of every lesser positive integer (1! * 2! ... " "n!)." msgstr "" "Calcule la superfactorielle d'un entier. Multiplie la factorielle de " "l'argument avec la factorielle de tous les entiers positifs plus petits (1! " "* 2! ... n!)." #: ../data/functions.xml.in.h:145 msgid "Permutations (Variations)" msgstr "" #: ../data/functions.xml.in.h:146 msgid "r:perm,variations" msgstr "" #: ../data/functions.xml.in.h:147 msgid "" "Returns the number of possible arrangements of an ordered list with a number " "of objects to choose from and a list size. If there are three objects (1, 2 " "and 3) that is put in a list with two positions, the alternatives are [1, " "2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of " "permutations is 6." msgstr "" "Retourne le nombre d'arrangements possibles d'une liste ordonnée avec un " "nombre d'objets à choisir et une taille de liste. Si il y a trois objets (1, " "2 et 3) qui sont mis dans une liste à deux positions, les alternatives sont " "[1, 2], [2, 1], [1, 3], [3, 1], [2, 3] et [3, 2], et le nombre de " "permutations est donc 6." #: ../data/functions.xml.in.h:148 msgid "Objects" msgstr "Objets" #: ../data/functions.xml.in.h:149 msgid "Size" msgstr "Taille" #: ../data/functions.xml.in.h:150 msgid "Combinations" msgstr "Combinaisons" #: ../data/functions.xml.in.h:151 msgid "r:comb" msgstr "" #: ../data/functions.xml.in.h:152 msgid "" "Returns the number of possible arrangements of an unordered list with a " "number of objects to choose from and a list size. If there are three objects " "(1, 2 and 3) that is put in a list with place for two, the alternatives are " "[1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3." msgstr "" "Retourne le nombre d'arrangements possibles d'une liste non ordonnée avec un " "nombre d'objets à choisir et une taille de liste. S'il y a trois objets (1,2 " "et 3) qui sont mis dans une liste à deux positions, les alternatives sont " "[1, 2], [1, 3], et [2, 3], et le nombre de combinaisons est donc 3." #: ../data/functions.xml.in.h:153 msgid "Derangements" msgstr "Arrangements" #: ../data/functions.xml.in.h:154 msgid "r:derangements" msgstr "" #: ../data/functions.xml.in.h:155 msgid "" "Returns the number of possible rearrangements of an ordered list, of a " "certain size, where none of the objects are on their original position. If " "the original list is [1, 2, 3], the possible derangements are [2, 3, 1] and " "[3, 1, 2], and thus the number of derangements is 2." msgstr "" "Retourne le nombre de réarrangements possibles d'une liste non ordonnée, " "d'une certaine taille, où aucun des objets n'est à sa position initiale. Si " "la liste de départ est [1, 2, 3], les réarrangements possibles sont [2, 3, " "1] et [3, 1, 2]; le nombre de réarrangements est donc 2." #: ../data/functions.xml.in.h:156 msgid "Number of elements" msgstr "Nombre d'éléments" #: ../data/functions.xml.in.h:157 msgid "Number Theory" msgstr "Théorie des Nombres" #: ../data/functions.xml.in.h:158 msgid "Absolute Value" msgstr "Valeur absolue" #: ../data/functions.xml.in.h:159 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:160 msgid "Arithmetic" msgstr "Arithmétique" #: ../data/functions.xml.in.h:161 msgid "Signum" msgstr "" #: ../data/functions.xml.in.h:162 msgid "r:sgn" msgstr "" #. A numerical value #: ../data/functions.xml.in.h:164 msgid "Number" msgstr "Nombre" #: ../data/functions.xml.in.h:165 msgid "Value for zero" msgstr "" #: ../data/functions.xml.in.h:166 msgid "Numerator" msgstr "Numérateur" #: ../data/functions.xml.in.h:167 msgid "r:numerator" msgstr "numérateur" #: ../data/functions.xml.in.h:168 msgid "Denominator" msgstr "Dénominateur" #: ../data/functions.xml.in.h:169 msgid "r:denominator" msgstr "dénominateur" #: ../data/functions.xml.in.h:170 msgid "Remainder" msgstr "Reste" #: ../data/functions.xml.in.h:171 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:172 msgid "Modulus" msgstr "Coefficient" #: ../data/functions.xml.in.h:173 msgid "r:mod" msgstr "" #: ../data/functions.xml.in.h:174 msgid "Negate" msgstr "Opposé" #: ../data/functions.xml.in.h:175 msgid "r:neg" msgstr "" #: ../data/functions.xml.in.h:176 msgid "Reciprocal" msgstr "Réciproque" #: ../data/functions.xml.in.h:177 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:178 msgid "Multiply" msgstr "Multiplier" #: ../data/functions.xml.in.h:179 msgid "r:multiply" msgstr "multiplier" #: ../data/functions.xml.in.h:180 msgid "Factors" msgstr "Facteurs" #: ../data/functions.xml.in.h:181 msgid "Add" msgstr "Ajouter" #: ../data/functions.xml.in.h:182 msgid "r:add" msgstr "" #: ../data/functions.xml.in.h:183 msgid "Terms" msgstr "Termes" #: ../data/functions.xml.in.h:184 msgid "Subtract" msgstr "" #: ../data/functions.xml.in.h:185 msgid "r:subtract" msgstr "" #: ../data/functions.xml.in.h:186 msgid "Divide" msgstr "Diviser" #: ../data/functions.xml.in.h:187 msgid "r:divide" msgstr "divise" #: ../data/functions.xml.in.h:188 msgid "Raise" msgstr "Élever" #: ../data/functions.xml.in.h:189 msgid "r:raise" msgstr "" #: ../data/functions.xml.in.h:190 msgid "Base" msgstr "" #: ../data/functions.xml.in.h:191 msgid "Polynomials" msgstr "Polynômes" #: ../data/functions.xml.in.h:192 msgid "Coefficient" msgstr "" #: ../data/functions.xml.in.h:193 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:194 msgid "Polynomial" msgstr "Polynôme" #: ../data/functions.xml.in.h:195 msgid "Leading Coefficient" msgstr "Coefficient dominant" #: ../data/functions.xml.in.h:196 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:197 msgid "Trailing Coefficient" msgstr "" #: ../data/functions.xml.in.h:198 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:199 msgid "Polynomial Degree" msgstr "Degré du Polynôme" #: ../data/functions.xml.in.h:200 msgid "r:degree" msgstr "degré" #: ../data/functions.xml.in.h:201 msgid "Lowest Degree (Valuation)" msgstr "Plus Petit Degré (Estimation)" #: ../data/functions.xml.in.h:202 msgid "r:ldegree" msgstr "" #: ../data/functions.xml.in.h:203 msgid "Content Part" msgstr "Part du Montant" #: ../data/functions.xml.in.h:204 msgid "r:pcontent" msgstr "" #: ../data/functions.xml.in.h:205 msgid "Primitive Part" msgstr "" #: ../data/functions.xml.in.h:206 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:207 msgid "Unit Part" msgstr "" #: ../data/functions.xml.in.h:208 msgid "r:punit" msgstr "" #: ../data/functions.xml.in.h:209 msgid "Greatest Common Divisor" msgstr "Plus Grand Diviseur Commun" #: ../data/functions.xml.in.h:210 msgid "r:gcd" msgstr "pgcd" #: ../data/functions.xml.in.h:211 msgid "1st value" msgstr "1ère valeur" #: ../data/functions.xml.in.h:212 msgid "2nd value" msgstr "2e valeur" #: ../data/functions.xml.in.h:213 msgid "Least Common Multiple" msgstr "Plus Petit Facteur Commun" #: ../data/functions.xml.in.h:214 msgid "r:lcm" msgstr "" #: ../data/functions.xml.in.h:215 msgid "Fibonacci Number" msgstr "" #: ../data/functions.xml.in.h:216 msgid "r:fibonacci" msgstr "" #: ../data/functions.xml.in.h:217 msgid "Returns the n-th term of the Fibonacci sequence." msgstr "" #: ../data/functions.xml.in.h:218 msgid "Index (n)" msgstr "" #: ../data/functions.xml.in.h:219 msgid "Rounding" msgstr "Arrondi" #: ../data/functions.xml.in.h:220 msgid "Round" msgstr "Arrondi" #: ../data/functions.xml.in.h:221 msgid "r:round" msgstr "" #: ../data/functions.xml.in.h:222 msgid "Round Downwards" msgstr "Arrondi à la Valeur Inférieure" #: ../data/functions.xml.in.h:223 msgid "r:floor" msgstr "plancher" #: ../data/functions.xml.in.h:224 msgid "Round Upwards" msgstr "Arrondi à la Valeur Supérieure" #: ../data/functions.xml.in.h:225 msgid "r:ceil" msgstr "plafond" #: ../data/functions.xml.in.h:226 msgid "Round Towards Zero" msgstr "" #: ../data/functions.xml.in.h:227 msgid "r:trunc" msgstr "" #: ../data/functions.xml.in.h:228 msgid "Extract Integer Part" msgstr "Extraire la Partie Entière" #: ../data/functions.xml.in.h:229 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:230 msgid "Extract Fractional Part" msgstr "Extraire la Partie Fractionnaire" #: ../data/functions.xml.in.h:231 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:232 msgid "Number Bases" msgstr "Bases Numériques" #: ../data/functions.xml.in.h:233 msgid "Number Base" msgstr "Base Numérique" #: ../data/functions.xml.in.h:234 msgid "r:base" msgstr "" #: ../data/functions.xml.in.h:235 #, fuzzy msgid "" "Returns an value from an expression using a specified base between 2 and 36" msgstr "" "Retourne un entier à partir d'un nombre dans une base spécifiée entre 2 et 36" #: ../data/functions.xml.in.h:236 msgid "Binary" msgstr "Binaire" #: ../data/functions.xml.in.h:237 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:238 msgid "" "Returns a value from a binary expression. If two's complement is true, " "numbers beginning with '1' is interpreted as negative binary numbers using " "two's complement." msgstr "" #: ../data/functions.xml.in.h:239 msgid "Binary number" msgstr "Nombre binaire" #: ../data/functions.xml.in.h:240 msgid "Two's complement" msgstr "" #: ../data/functions.xml.in.h:241 msgid "Octal" msgstr "" #: ../data/functions.xml.in.h:242 msgid "r:oct" msgstr "" #: ../data/functions.xml.in.h:243 #, fuzzy msgid "Returns a value from an octal expression." msgstr "Retourne une valeur à partir d'un nombre hexadécimal" #: ../data/functions.xml.in.h:244 msgid "Octal number" msgstr "Nombre octal" #: ../data/functions.xml.in.h:245 msgid "Hexadecimal" msgstr "Hexadécimal" #: ../data/functions.xml.in.h:246 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:247 #, fuzzy msgid "Returns a value from a hexadecimal expression." msgstr "Retourne une valeur à partir d'un nombre hexadécimal" #: ../data/functions.xml.in.h:248 msgid "Hexadecimal number" msgstr "Nombre hexadécimal" #: ../data/functions.xml.in.h:249 msgid "Integers" msgstr "Entiers" #: ../data/functions.xml.in.h:250 msgid "Even" msgstr "Pair" #: ../data/functions.xml.in.h:251 msgid "r:even" msgstr "pair" #: ../data/functions.xml.in.h:252 msgid "Odd" msgstr "Impair" #: ../data/functions.xml.in.h:253 msgid "r:odd" msgstr "impair" #: ../data/functions.xml.in.h:254 msgid "Step Functions" msgstr "" #: ../data/functions.xml.in.h:255 msgid "Heaviside Step Function" msgstr "" #: ../data/functions.xml.in.h:256 #, fuzzy msgid "r:heaviside,au:θ" msgstr "pourmille,au:‰" #: ../data/functions.xml.in.h:257 msgid "" "Discontinuous function also known as \"unit step function\". Returns 0 if x " "< 0, 1 if x > 0, and 1/2 if x = 0." msgstr "" #: ../data/functions.xml.in.h:258 #, fuzzy msgid "Dirac Delta Function" msgstr "Fonction bêta" #: ../data/functions.xml.in.h:259 #, fuzzy msgid "r:dirac,au:δ" msgstr "pourmille,au:‰" #: ../data/functions.xml.in.h:260 msgid "Returns 0 if x is non-zero, and infinity if x is zero." msgstr "" #: ../data/functions.xml.in.h:261 msgid "Ramp Function" msgstr "" #: ../data/functions.xml.in.h:262 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:263 msgid "Rectangular Function" msgstr "" #: ../data/functions.xml.in.h:264 msgid "r:rectangular" msgstr "" #: ../data/functions.xml.in.h:265 msgid "Sigmoid Function" msgstr "" #: ../data/functions.xml.in.h:266 msgid "r:sigmoid" msgstr "" #: ../data/functions.xml.in.h:267 msgid "Logit Transformation" msgstr "" #: ../data/functions.xml.in.h:268 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:269 msgid "Triangular Function" msgstr "" #: ../data/functions.xml.in.h:270 msgid "r:triangular" msgstr "" #: ../data/functions.xml.in.h:271 #, fuzzy msgid "Special Functions" msgstr "Fonction bêta" #: ../data/functions.xml.in.h:272 msgid "Gamma Function" msgstr "Fonction Gamma" #: ../data/functions.xml.in.h:273 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:274 #, fuzzy msgid "Digamma Function" msgstr "Fonction Gamma" #: ../data/functions.xml.in.h:275 msgid "r:digamma,psi" msgstr "" #: ../data/functions.xml.in.h:276 msgid "Beta Function" msgstr "Fonction bêta" #: ../data/functions.xml.in.h:277 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:278 #, fuzzy msgid "Error Function" msgstr "Fonction" #: ../data/functions.xml.in.h:279 #, fuzzy msgid "r:erf" msgstr "erreur" #: ../data/functions.xml.in.h:280 msgid "Complementary Error Function" msgstr "" #: ../data/functions.xml.in.h:281 #, fuzzy msgid "r:erfc" msgstr "erreur" #: ../data/functions.xml.in.h:282 #, fuzzy msgid "Polylogarithm" msgstr "Logarithme Naturel (népérien)" #: ../data/functions.xml.in.h:283 msgid "rc:Li,polylog" msgstr "" #: ../data/functions.xml.in.h:284 msgid "Order" msgstr "Ordre" #: ../data/functions.xml.in.h:285 #, fuzzy msgid "Argument" msgstr "Arguments" #: ../data/functions.xml.in.h:286 #, fuzzy msgid "Airy Function" msgstr "Fonction" #: ../data/functions.xml.in.h:287 msgid "r:airy" msgstr "" #: ../data/functions.xml.in.h:288 msgid "Bessel Function of the First Kind" msgstr "" #: ../data/functions.xml.in.h:289 msgid "r:besselj" msgstr "" #: ../data/functions.xml.in.h:290 msgid "Bessel Function of the Second Kind" msgstr "" #: ../data/functions.xml.in.h:291 msgid "r:bessely" msgstr "" #: ../data/functions.xml.in.h:292 msgid "Riemann Zeta" msgstr "" #: ../data/functions.xml.in.h:293 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:294 msgid "Integral point" msgstr "Point intégral" #: ../data/functions.xml.in.h:295 msgid "Kronecker Delta" msgstr "" #: ../data/functions.xml.in.h:296 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:297 msgid "Returns 0 if i != j and 1 if i = j." msgstr "" #: ../data/functions.xml.in.h:298 msgid "Value 1 (i)" msgstr "Valeur 1 (i)" #: ../data/functions.xml.in.h:299 msgid "Value 2 (j)" msgstr "Valeur 2 (j)" #: ../data/functions.xml.in.h:300 #, fuzzy msgid "Complex Numbers" msgstr "Nombre complexe" #: ../data/functions.xml.in.h:301 msgid "Real Part" msgstr "Partie Réelle" #: ../data/functions.xml.in.h:302 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:303 msgid "Complex number" msgstr "Nombre complexe" #: ../data/functions.xml.in.h:304 msgid "Imaginary Part" msgstr "Partie Imaginaire" #: ../data/functions.xml.in.h:305 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:306 #, fuzzy msgid "Principal Argument" msgstr "Capital" #: ../data/functions.xml.in.h:307 msgid "r:arg" msgstr "" #: ../data/functions.xml.in.h:308 #, fuzzy msgid "Complex Conjugate" msgstr "Nombre complexe" #: ../data/functions.xml.in.h:309 #, fuzzy msgid "r:conj" msgstr "cône" #: ../data/functions.xml.in.h:310 msgid "Exponents & Logarithms" msgstr "Exponentielles et logarithmes" #: ../data/functions.xml.in.h:311 msgid "Square Root" msgstr "Racine Carrée" #: ../data/functions.xml.in.h:312 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:313 msgid "" "Returns the principal square root (for positive values the positive root is " "returned)." msgstr "" #: ../data/functions.xml.in.h:314 msgid "Cube Root" msgstr "Racine Cubique" #: ../data/functions.xml.in.h:315 msgid "au:∛,r:cbrt" msgstr "" #: ../data/functions.xml.in.h:316 #, fuzzy msgid "Returns the third real root." msgstr "Retourne la plus grande valeur." #: ../data/functions.xml.in.h:317 msgid "Nth root" msgstr "Racine n-ième" #: ../data/functions.xml.in.h:318 msgid "r:root" msgstr "" #: ../data/functions.xml.in.h:319 msgid "" "Returns the real root. For negative values the degree must be odd. Complex " "values are not allowed." msgstr "" #: ../data/functions.xml.in.h:320 ../data/units.xml.in.h:61 msgid "Degree" msgstr "Degré" #: ../data/functions.xml.in.h:321 msgid "Square" msgstr "Carré" #: ../data/functions.xml.in.h:322 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:323 msgid "Exponential (e^x)" msgstr "Exponentielle (e^x)" #: ../data/functions.xml.in.h:324 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:325 msgid "Natural Logarithm" msgstr "Logarithme Naturel (népérien)" #: ../data/functions.xml.in.h:326 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:327 msgid "Base-N Logarithm" msgstr "Logarithme en base N" #: ../data/functions.xml.in.h:328 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:329 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "" #: ../data/functions.xml.in.h:330 msgid "r:lambertw,productlog" msgstr "" #: ../data/functions.xml.in.h:331 msgid "" "Returns the inverse function for mx*e^x as ln() does for e^x. Only the " "principal branch and real valued results are currently supported." msgstr "" #: ../data/functions.xml.in.h:332 msgid "Branch" msgstr "" #: ../data/functions.xml.in.h:333 msgid "Base-2 Logarithm" msgstr "Logarithme en base 2" #: ../data/functions.xml.in.h:334 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:335 msgid "Returns the base n logarithm." msgstr "Retourne le logarithme en base n." #: ../data/functions.xml.in.h:336 msgid "Base-10 Logarithm" msgstr "Logarithme en base 10" #: ../data/functions.xml.in.h:337 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:338 msgid "Complex Exponential (Cis)" msgstr "Exponentielle Complexe" #: ../data/functions.xml.in.h:339 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:340 msgid "2 raised to the power X" msgstr "2 élevé à la puissance X" #: ../data/functions.xml.in.h:341 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:342 msgid "10 raised to the power X" msgstr "10 élevé à la puissance X" #: ../data/functions.xml.in.h:343 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:344 msgid "X raised to the power Y" msgstr "X élevé à la puissance Y" #: ../data/functions.xml.in.h:345 msgid "r:pow" msgstr "" #: ../data/functions.xml.in.h:346 msgid "Square root (x * pi)" msgstr "Racine carrée (x * pi)" #: ../data/functions.xml.in.h:347 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:348 msgid "Returns the non-negative square root of x * pi" msgstr "Retourne la racine carrée de x * pi" #: ../data/functions.xml.in.h:349 msgid "Non-negative value" msgstr "Valeur strictement positive" #: ../data/functions.xml.in.h:350 msgid "Trigonometry" msgstr "Trigonométrie" #: ../data/functions.xml.in.h:351 msgid "Sine" msgstr "Sinus" #: ../data/functions.xml.in.h:352 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:353 msgid "Angle" msgstr "" #: ../data/functions.xml.in.h:354 msgid "Cosine" msgstr "Cosinus" #: ../data/functions.xml.in.h:355 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:356 msgid "Tangent" msgstr "Tangente" #: ../data/functions.xml.in.h:357 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:358 msgid "Inverse Sine" msgstr "Arcsinus" #: ../data/functions.xml.in.h:359 msgid "r:asin" msgstr "arcsin" #: ../data/functions.xml.in.h:360 msgid "Inverse Cosine" msgstr "Arccosinus" #: ../data/functions.xml.in.h:361 msgid "r:acos" msgstr "arccos" #: ../data/functions.xml.in.h:362 msgid "Inverse Tangent" msgstr "Arctangente" #: ../data/functions.xml.in.h:363 msgid "r:atan" msgstr "arctan" #: ../data/functions.xml.in.h:364 msgid "Hyperbolic Sine" msgstr "Sinus Hyperbolique" #: ../data/functions.xml.in.h:365 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:366 msgid "Hyperbolic Cosine" msgstr "Cosinus Hyperbolique" #: ../data/functions.xml.in.h:367 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:368 msgid "Hyperbolic Tangent" msgstr "Tangente Hyperbolique" #: ../data/functions.xml.in.h:369 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:370 msgid "Inverse Hyperbolic Sine" msgstr "Argsinus Hyperbolique" #: ../data/functions.xml.in.h:371 msgid "r:asinh" msgstr "argsh" #: ../data/functions.xml.in.h:372 msgid "Inverse Hyperbolic Cosine" msgstr "Argcosinus Hyperbolique" #: ../data/functions.xml.in.h:373 msgid "r:acosh" msgstr "argcosh" #: ../data/functions.xml.in.h:374 msgid "Inverse Hyperbolic Tangent" msgstr "Argtangente Hyperbolique" #: ../data/functions.xml.in.h:375 msgid "r:atanh" msgstr "argth" #: ../data/functions.xml.in.h:376 #, fuzzy msgid "Four-quadrant Inverse Tangent" msgstr "Arctangente" #: ../data/functions.xml.in.h:377 #, fuzzy msgid "r:atan2" msgstr "arctan" #: ../data/functions.xml.in.h:378 msgid "" "Computes the principal value of the argument function applied to the complex " "number x+iy." msgstr "" #: ../data/functions.xml.in.h:379 msgid "Y" msgstr "" #: ../data/functions.xml.in.h:380 msgid "X" msgstr "" #: ../data/functions.xml.in.h:381 #, fuzzy msgid "Cardinal Sine (Sinc Function)" msgstr "Trouver une fonction affine" #: ../data/functions.xml.in.h:382 msgid "r:sinc" msgstr "" #: ../data/functions.xml.in.h:383 msgid "Radians to Default Angle Unit" msgstr "Radians en Unité d'Angle par Défaut" #: ../data/functions.xml.in.h:384 msgid "r:radtodef" msgstr "" #: ../data/functions.xml.in.h:385 msgid "Radians" msgstr "" #: ../data/functions.xml.in.h:386 msgid "Secant" msgstr "" #: ../data/functions.xml.in.h:387 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:388 msgid "Cosecant" msgstr "Cosécante" #: ../data/functions.xml.in.h:389 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:390 msgid "Cotangent" msgstr "Cotangente" #: ../data/functions.xml.in.h:391 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:392 msgid "Hyperbolic Secant" msgstr "Sécante hyperbolique" #: ../data/functions.xml.in.h:393 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:394 msgid "Hyperbolic Cosecant" msgstr "Cosécante hyperbolique" #: ../data/functions.xml.in.h:395 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:396 msgid "Hyperbolic Cotangent" msgstr "Cotangente Hyperbolique" #: ../data/functions.xml.in.h:397 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:398 msgid "Inverse Secant" msgstr "Arcsécante" #: ../data/functions.xml.in.h:399 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:400 msgid "Inverse Cosecant" msgstr "Arccosécante" #: ../data/functions.xml.in.h:401 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:402 msgid "Inverse Cotangent" msgstr "Arccotangente" #: ../data/functions.xml.in.h:403 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:404 msgid "Inverse Hyperbolic Secant" msgstr "Argsécante Hyperbolique" #: ../data/functions.xml.in.h:405 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:406 msgid "Inverse Hyperbolic Cosecant" msgstr "Argcosécante Hyperbolique" #: ../data/functions.xml.in.h:407 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:408 msgid "Inverse Hyperbolic Cotangent" msgstr "Argcotangente Hyperbolique" #: ../data/functions.xml.in.h:409 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:410 msgid "Miscellaneous" msgstr "Divers" #: ../data/functions.xml.in.h:411 msgid "Body Mass Index (BMI)" msgstr "Indice de masse corporelle (IMC)" #: ../data/functions.xml.in.h:412 msgid "-r:bmi" msgstr "imc" #: ../data/functions.xml.in.h:413 msgid "" "Calculates the Body Mass Index. The resulting BMI-value is sometimes " "interpreted as follows (although varies with age, sex, etc.): " "Underweight < 18.5 Normal weight 18.5-25 Overweight 25-30 " "Obesity > 30 Note that you must use units for weight (ex. 59kg) " "and length (ex. 174cm)." msgstr "" "Calcule l'Indice de Masse Corporelle. L'IMC est parfois interprété de la " "façon suivante (bien qu'il varie selon l'âge, le sexe, etc.) : " "Maigreur < 18.5 Corpulence normale 18.5-25 Surpoids 25-30 " "Obésité > 30 Notez que vous devez utiliser des unités pour la " "masse (p. ex. 59kg) et la taille (p. ex. 174cm)." #: ../data/functions.xml.in.h:415 msgid "Length" msgstr "Longueur" #: ../data/functions.xml.in.h:416 msgid "Roman Number" msgstr "Nombre Romain" #: ../data/functions.xml.in.h:417 msgid "r:roman" msgstr "" #: ../data/functions.xml.in.h:418 msgid "Returns the value of a roman number." msgstr "" #: ../data/functions.xml.in.h:419 msgid "Roman number" msgstr "Nombre romain" #: ../data/functions.xml.in.h:420 msgid "Statistics" msgstr "Statistique" #: ../data/functions.xml.in.h:421 msgid "Descriptive Statistics" msgstr "Statistiques Descriptives" #: ../data/functions.xml.in.h:422 msgid "Sum (total)" msgstr "Somme (total)" #: ../data/functions.xml.in.h:423 msgid "r:total" msgstr "" #: ../data/functions.xml.in.h:424 msgid "Data" msgstr "Donnée" #: ../data/functions.xml.in.h:425 msgid "Percentile" msgstr "" #: ../data/functions.xml.in.h:426 msgid "r:percentile" msgstr "" #: ../data/functions.xml.in.h:428 #, no-c-format msgid "Percentile (%)" msgstr "" #: ../data/functions.xml.in.h:429 msgid "Quantile Algorithm (as in R)" msgstr "" #: ../data/functions.xml.in.h:430 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:431 msgid "Returns the lowest value." msgstr "Retourne la valeur la plus petite." #: ../data/functions.xml.in.h:432 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:433 msgid "Returns the highest value." msgstr "Retourne la plus grande valeur." #: ../data/functions.xml.in.h:434 msgid "Mode" msgstr "" #: ../data/functions.xml.in.h:435 msgid "r:mode" msgstr "" #: ../data/functions.xml.in.h:436 msgid "Returns the most frequently occurring value." msgstr "Retourne la valeur qui apparaît le plus souvent." #: ../data/functions.xml.in.h:437 msgid "Range" msgstr "" #: ../data/functions.xml.in.h:438 msgid "r:range" msgstr "" #: ../data/functions.xml.in.h:439 msgid "Calculates the difference between the min and max value." msgstr "Calcule la différence entre la valeur minimale et maximale." #: ../data/functions.xml.in.h:440 msgid "Median" msgstr "Médianne" #: ../data/functions.xml.in.h:441 msgid "r:median" msgstr "médiane" #: ../data/functions.xml.in.h:442 msgid "Quartile" msgstr "Quartile" #: ../data/functions.xml.in.h:443 msgid "r:quartile" msgstr "" #: ../data/functions.xml.in.h:444 msgid "Decile" msgstr "Décile" #: ../data/functions.xml.in.h:445 msgid "r:decile" msgstr "" #: ../data/functions.xml.in.h:446 msgid "Interquartile Range" msgstr "Écart interquartile" #: ../data/functions.xml.in.h:447 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:448 msgid "Calculates the difference between the first and third quartile." msgstr "Calcule la différence entre le premier et le troisième quartile." #: ../data/functions.xml.in.h:449 msgid "Number of Samples" msgstr "Nombre d'Échantillons" #. Number of samples #: ../data/functions.xml.in.h:451 msgid "r:number" msgstr "nombre" #: ../data/functions.xml.in.h:452 msgid "Returns the number of samples." msgstr "Retourne le nombre d'échantillons." #: ../data/functions.xml.in.h:453 msgid "Random Number" msgstr "Nombre Aléatoire" #: ../data/functions.xml.in.h:454 msgid "r:rand" msgstr "" #: ../data/functions.xml.in.h:455 msgid "" "Generates a pseudo-random number. Returns a real number between 0 and 1, if " "ceil is zero (default), or an integer between 1 and (including) ceil." msgstr "" "Génère un nombre pseudo-aléatoire. Retourne un nombre réel entre 0 et 1, si " "le plafond est zéro (valeur par défaut), ou un entier entre 1 et le plafond " "(inclusivement)." #: ../data/functions.xml.in.h:456 msgid "Ceil" msgstr "Plafond" #: ../data/functions.xml.in.h:457 msgid "Random Number Between Limits" msgstr "Nombre Aléatoire entre les limites" #: ../data/functions.xml.in.h:458 msgid "r:randbetween" msgstr "" #: ../data/functions.xml.in.h:459 msgid "Returns an integer between (including) bottom and top." msgstr "Retourne un entier entre le bas et le haut (inclusivement)." #: ../data/functions.xml.in.h:460 msgid "Bottom" msgstr "Bas" #: ../data/functions.xml.in.h:461 msgid "Top" msgstr "Haut" #: ../data/functions.xml.in.h:462 msgid "Means" msgstr "Moyenne" #: ../data/functions.xml.in.h:463 msgid "Mean" msgstr "Moyenne" #: ../data/functions.xml.in.h:464 #, fuzzy msgid "r:mean,average,au:x̄" msgstr "moyenne" #: ../data/functions.xml.in.h:465 msgid "Harmonic Mean" msgstr "Moyenne Harmonique" #: ../data/functions.xml.in.h:466 msgid "r:harmmean" msgstr "" #: ../data/functions.xml.in.h:467 msgid "Geometric Mean" msgstr "Moyenne géométrique" #: ../data/functions.xml.in.h:468 msgid "r:geomean" msgstr "moyenne_géométrique" #: ../data/functions.xml.in.h:469 msgid "Trimmed Mean" msgstr "" #: ../data/functions.xml.in.h:470 msgid "r:trimmean" msgstr "" #: ../data/functions.xml.in.h:471 msgid "Trimmed percentage (at each end)" msgstr "" #: ../data/functions.xml.in.h:472 msgid "Winsorized Mean" msgstr "" #: ../data/functions.xml.in.h:473 msgid "r:winsormean" msgstr "" #: ../data/functions.xml.in.h:474 msgid "Winsorized percentage (at each end)" msgstr "" #: ../data/functions.xml.in.h:475 msgid "Weighted Mean" msgstr "Moyenne Pondérée" #: ../data/functions.xml.in.h:476 msgid "r:weighmean" msgstr "" #: ../data/functions.xml.in.h:477 msgid "Weights" msgstr "Poids" #: ../data/functions.xml.in.h:478 msgid "Quadratic Mean (RMS)" msgstr "Moyenne Quadratique (RMS)" #: ../data/functions.xml.in.h:479 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:480 msgid "Moments" msgstr "" #: ../data/functions.xml.in.h:481 msgid "Standard Deviation (entire population)" msgstr "" #: ../data/functions.xml.in.h:482 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:483 msgid "Standard Deviation (random sampling)" msgstr "" #: ../data/functions.xml.in.h:484 msgid "r:stdev" msgstr "" #: ../data/functions.xml.in.h:485 msgid "Variance (entire population)" msgstr "Variance (population entière)" #: ../data/functions.xml.in.h:486 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:487 msgid "Variance (random sampling)" msgstr "Variance (échantillon aléatoire)" #: ../data/functions.xml.in.h:488 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:489 msgid "Standard Error" msgstr "" #: ../data/functions.xml.in.h:490 msgid "r:stderr" msgstr "" #: ../data/functions.xml.in.h:491 msgid "Mean Deviation" msgstr "Déviation Moyenne" #: ../data/functions.xml.in.h:492 msgid "r:meandev" msgstr "" #: ../data/functions.xml.in.h:493 msgid "Covariance" msgstr "" #: ../data/functions.xml.in.h:494 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:495 msgid "Data 1" msgstr "Donnée 1" #: ../data/functions.xml.in.h:496 msgid "Data 2" msgstr "Donnée 2" #: ../data/functions.xml.in.h:497 msgid "Pooled Variance" msgstr "" #: ../data/functions.xml.in.h:498 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:499 msgid "Regression" msgstr "Régression" #: ../data/functions.xml.in.h:500 msgid "Statistical Correlation" msgstr "Corrélation Statistique" #: ../data/functions.xml.in.h:501 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:502 msgid "Pearson's Correlation Coefficient" msgstr "Coefficient de Corrélation de Pearson" #: ../data/functions.xml.in.h:503 msgid "r:pearson,r:correl" msgstr "" #: ../data/functions.xml.in.h:504 msgid "Spearman's Rho" msgstr "" #: ../data/functions.xml.in.h:505 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:506 msgid "Statistical Tests" msgstr "" #: ../data/functions.xml.in.h:507 msgid "Unpaired T-Test" msgstr "" #: ../data/functions.xml.in.h:508 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:509 msgid "Paired T-Test" msgstr "Test du T" #: ../data/functions.xml.in.h:510 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:511 msgid "Distribution" msgstr "" #: ../data/functions.xml.in.h:512 msgid "Rayleigh Distribution" msgstr "Distribution de Rayleigh" #: ../data/functions.xml.in.h:513 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:514 msgid "" "Returns the probability density p(x) at x for a Rayleigh distribution with " "scale parameter sigma. (from Gnumeric)" msgstr "" "Retourne la densité de probabilité p(x) au x choisi pour une distribution de " "Rayleigh avec le paramètre d'échelle sigma. (utilise Gnumeric)" #: ../data/functions.xml.in.h:515 msgid "Sigma" msgstr "" #: ../data/functions.xml.in.h:516 msgid "Rayleigh Tail Distribution" msgstr "Distribution de Queue de Rayleigh" #: ../data/functions.xml.in.h:517 msgid "r:rayleightail" msgstr "" #: ../data/functions.xml.in.h:518 msgid "" "Returns the probability density p(x) at x for a Rayleigh tail distribution " "with scale parameter sigma and a lower limit. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:519 msgid "Pareto Distribution" msgstr "Distribution de Pareto" #: ../data/functions.xml.in.h:520 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:521 msgid "" "Returns the probability density p(x) at x for a Pareto distribution with " "exponent and scale. (from Gnumeric)" msgstr "" "Retourne la densité de probabilité p(x) au x choisi pour une distribution de " "Pareto avec l'exposant et l'échelle. (utilise Gnumeric)" #: ../data/functions.xml.in.h:522 msgid "Scale" msgstr "Échelle" #: ../data/functions.xml.in.h:523 msgid "Logistic Distribution" msgstr "Distribution logistique" #: ../data/functions.xml.in.h:524 msgid "r:logistic" msgstr "logistique" #: ../data/functions.xml.in.h:525 msgid "" "Returns the probability density p(x) at x for a logistic distribution with " "scale parameter. (from Gnumeric)" msgstr "" #: ../data/functions.xml.in.h:526 ../data/variables.xml.in.h:173 msgid "Date & Time" msgstr "Date & Heure" #: ../data/functions.xml.in.h:527 #, fuzzy msgid "Construct Date" msgstr "Construire une Matrice" #: ../data/functions.xml.in.h:528 #, fuzzy msgid "r:date" msgstr "jour" #: ../data/functions.xml.in.h:529 msgid "" "Returns a date. Available calendars gregorian (1), hebrew (2), islamic (3), " "persian (4), indian (5), chinese (6), julian (7), milankovic (8), coptic " "(9), ethiopian (10), egyptian (11). The Chinese year uses an epoch of 2697 " "BEC and chinese leap months are indicated by adding 12 to the month number " "(e.g. leap month 4 = 16)." msgstr "" #: ../data/functions.xml.in.h:530 msgid "Year" msgstr "Année" #: ../data/functions.xml.in.h:531 ../data/units.xml.in.h:145 msgid "Month" msgstr "Mois" #: ../data/functions.xml.in.h:532 ../data/units.xml.in.h:137 msgid "Day" msgstr "Jour" #: ../data/functions.xml.in.h:533 msgid "Calendar" msgstr "" #: ../data/functions.xml.in.h:534 #, fuzzy msgid "Construct Date and Time" msgstr "Construire une Matrice" #: ../data/functions.xml.in.h:535 #, fuzzy msgid "r:datetime" msgstr "jour" #: ../data/functions.xml.in.h:536 ../data/units.xml.in.h:135 msgid "Hour" msgstr "Heure" #: ../data/functions.xml.in.h:537 ../data/units.xml.in.h:133 msgid "Minute" msgstr "" #: ../data/functions.xml.in.h:538 ../data/units.xml.in.h:131 msgid "Second" msgstr "Seconde" #: ../data/functions.xml.in.h:539 msgid "Days between two dates" msgstr "Jours entre deux dates" #: ../data/functions.xml.in.h:540 msgid "r:days" msgstr "jours" #: ../data/functions.xml.in.h:541 msgid "" "Returns the number of days between two dates. Basis is the type of " "day counting you want to use: 0: US 30/360, 1: real days (default), 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Retourne le nombre de jours entre deux dates. La base est la " "manière de compter les jours que vous souhaitez utiliser : 0 : US 30/360, " "1 : jours réels (par défaut), 2 : jours réels/360, 3 : jours réels/365 ou " "4 : Européenne 30/360." #: ../data/functions.xml.in.h:542 msgid "First date" msgstr "Première date" #: ../data/functions.xml.in.h:543 msgid "Second date" msgstr "" #: ../data/functions.xml.in.h:544 msgid "Day counting basis" msgstr "Base de comptage des jours" #: ../data/functions.xml.in.h:545 msgid "Financial function mode" msgstr "Mode de fonctions financières" #: ../data/functions.xml.in.h:546 msgid "Years between two dates" msgstr "Années entre deux dates" #: ../data/functions.xml.in.h:547 msgid "r:yearfrac" msgstr "" #: ../data/functions.xml.in.h:548 msgid "" "Returns the number of years (fractional) between two dates. Basis " "is the type of day counting you want to use: 0: US 30/360, 1: real days " "(default), 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Retourne le nombre d'années (sous forme de fraction) entre deux dates. " " La base est la manière de compter les jours que vous souhaitez " "utiliser : 0 : US 30/360, 1 : jours réels (par défaut), 2 : jours réels/360, " "3 : jours réels/365 ou 4 : Européenne 30/360." #: ../data/functions.xml.in.h:549 msgid "Week of Year" msgstr "Semaine de l'Année" #: ../data/functions.xml.in.h:550 msgid "r:week" msgstr "" #: ../data/functions.xml.in.h:551 msgid "Date" msgstr "" #: ../data/functions.xml.in.h:552 msgid "Week begins on Sunday" msgstr "La semaine commence le dimanche" #: ../data/functions.xml.in.h:553 msgid "Day of Week" msgstr "Jour de la semaine" #: ../data/functions.xml.in.h:554 msgid "r:weekday" msgstr "" #: ../data/functions.xml.in.h:555 msgid "r:month" msgstr "mois" #: ../data/functions.xml.in.h:556 msgid "Day of Month" msgstr "Jour du mois" #: ../data/functions.xml.in.h:557 msgid "r:day" msgstr "jour" #: ../data/functions.xml.in.h:558 msgid "r:year" msgstr "" #: ../data/functions.xml.in.h:559 msgid "Day of Year" msgstr "Jour de l'année" #: ../data/functions.xml.in.h:560 msgid "r:yearday" msgstr "" #: ../data/functions.xml.in.h:561 msgid "Current Time" msgstr "Heure actuelle" #: ../data/functions.xml.in.h:562 msgid "r:time" msgstr "" #: ../data/functions.xml.in.h:563 #, fuzzy msgid "Time Value" msgstr "Valeurs extrêmes" #: ../data/functions.xml.in.h:564 #, fuzzy msgid "r:timevalue" msgstr "Valeur future" #: ../data/functions.xml.in.h:565 msgid "Returns the time part, in fractional hours, of a date and time value." msgstr "" #: ../data/functions.xml.in.h:566 msgid "Date to Unix Timestamp" msgstr "Date selon l'Horodatage Unix" #: ../data/functions.xml.in.h:567 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:568 msgid "Unix Timestamp to Date" msgstr "" #: ../data/functions.xml.in.h:569 msgid "r:stamptodate,unix2date" msgstr "" #: ../data/functions.xml.in.h:570 msgid "" "Returns the local date and time represented by the specified Unix timestamp " "(seconds, excluding leap seconds, since 1970-01-01). Supports time units." msgstr "" #: ../data/functions.xml.in.h:571 msgid "Timestamp" msgstr "" #: ../data/functions.xml.in.h:572 msgid "Add Days" msgstr "" #: ../data/functions.xml.in.h:573 msgid "r:addDays" msgstr "" #: ../data/functions.xml.in.h:574 msgid "Days" msgstr "" #: ../data/functions.xml.in.h:575 msgid "Add Months" msgstr "" #: ../data/functions.xml.in.h:576 msgid "r:addMonths" msgstr "" #: ../data/functions.xml.in.h:577 #, fuzzy msgid "Months" msgstr "Mois" #: ../data/functions.xml.in.h:578 msgid "Add Years" msgstr "" #: ../data/functions.xml.in.h:579 msgid "r:addYears" msgstr "" #: ../data/functions.xml.in.h:580 msgid "Years" msgstr "Années" #: ../data/functions.xml.in.h:581 msgid "Add Time" msgstr "" #: ../data/functions.xml.in.h:582 msgid "r:addTime" msgstr "" #: ../data/functions.xml.in.h:583 msgid "" "Adds a time value to a date. The value can be positive or negative, but must " "use a unit based on seconds (such as day and year). Fractions of days are " "truncated." msgstr "" #: ../data/functions.xml.in.h:584 ../data/units.xml.in.h:130 msgid "Time" msgstr "Temps" #: ../data/functions.xml.in.h:585 msgid "Lunar Phase" msgstr "" #: ../data/functions.xml.in.h:586 msgid "r:lunarphase" msgstr "" #: ../data/functions.xml.in.h:587 msgid "" "Returns the lunar phase, as a number between 0 and 1, for the specified " "date. 0 represents new moon, 0.5 full moon, and 0.25 and 0.75 quarter moons." msgstr "" #: ../data/functions.xml.in.h:588 msgid "Find Lunar Phase" msgstr "" #: ../data/functions.xml.in.h:589 msgid "r:nextlunarphase" msgstr "" #: ../data/functions.xml.in.h:590 msgid "" "Returns the date when the specified lunar phase occurs. The function " "searches forward beginning at the specified date. The lunar phase are " "specified as a number between 0 and 1, where 0 represents new moon, 0.5 full " "moon, and 0.25 and 0.75 quarter moons." msgstr "" #: ../data/functions.xml.in.h:591 #, fuzzy msgid "Start Date" msgstr "Construire une Matrice" #: ../data/functions.xml.in.h:592 msgid "Utilities" msgstr "Utilitaires" #: ../data/functions.xml.in.h:593 msgid "Plot Functions and Vectors" msgstr "" #: ../data/functions.xml.in.h:594 #, fuzzy msgid "r:plot" msgstr "r:planète" #: ../data/functions.xml.in.h:595 #, fuzzy msgid "Expression or vector" msgstr "Matrice ou vecteur" #: ../data/functions.xml.in.h:596 msgid "Minimum x value" msgstr "" #: ../data/functions.xml.in.h:597 #, fuzzy msgid "Maximum x value" msgstr "Variable matricielle" #: ../data/functions.xml.in.h:598 msgid "Number of samples / Step size" msgstr "Nombre d'Échantillons / Taille du pas" #: ../data/functions.xml.in.h:599 #, fuzzy msgid "X variable" msgstr "Variable de Ligne" #: ../data/functions.xml.in.h:600 msgid "" "Plots one or more expressions or vectors. Use a vector for the first " "argument to plot multiple series. Only the first argument is used for vector " "series. It is also possible to plot a matrix where each row is a pair of x " "and y values." msgstr "" #: ../data/functions.xml.in.h:601 msgid "ASCII Value" msgstr "Valeur ASCII" #: ../data/functions.xml.in.h:602 msgid "r:code" msgstr "" #: ../data/functions.xml.in.h:603 msgid "Character" msgstr "Caractère" #: ../data/functions.xml.in.h:604 msgid "ASCII Char" msgstr "Caractère ASCII" #: ../data/functions.xml.in.h:605 msgid "r:char" msgstr "" #: ../data/functions.xml.in.h:606 msgid "Length of string" msgstr "Longueur de la chaîne" #: ../data/functions.xml.in.h:607 msgid "r:len" msgstr "" #: ../data/functions.xml.in.h:608 msgid "Text" msgstr "Texte" #: ../data/functions.xml.in.h:609 msgid "Concatenate Strings" msgstr "Concaténer les chaînes" #: ../data/functions.xml.in.h:610 msgid "r:concatenate" msgstr "" #: ../data/functions.xml.in.h:611 msgid "Text string 1" msgstr "Chaîne de texte 1" #: ../data/functions.xml.in.h:612 msgid "Text string 2" msgstr "Chaîne de texte 2" #: ../data/functions.xml.in.h:613 msgid "Replace" msgstr "Remplacer" #: ../data/functions.xml.in.h:614 msgid "r:replace" msgstr "" #: ../data/functions.xml.in.h:615 msgid "" "Replaces a certain value in an expression with a new value. The expression " "is calculated before the replacement if the fourth argument is true." msgstr "" "Remplace une certaine valeur dans une expression par une nouvelle valeur. " "L'expression est calculée avant le remplacement si le quatrième argument est " "vrai." #: ../data/functions.xml.in.h:616 msgid "Expression" msgstr "" #: ../data/functions.xml.in.h:617 msgid "Original value" msgstr "Valeur originale" #: ../data/functions.xml.in.h:618 msgid "New value" msgstr "Nouvelle valeur" #: ../data/functions.xml.in.h:619 msgid "Precalculate expression" msgstr "Expression précalculée" #: ../data/functions.xml.in.h:620 msgid "Strip Units" msgstr "" #: ../data/functions.xml.in.h:621 msgid "r:nounit,strip_units" msgstr "" #: ../data/functions.xml.in.h:622 msgid "" "Removes all units from an expression. The expression is calculated before " "the removal." msgstr "" "Enlève toutes les unités de l'expression. L'expression est calculée avant la " "suppression." #: ../data/functions.xml.in.h:623 msgid "Process Vector Elements" msgstr "Calculer les Éléments de Vecteur" #: ../data/functions.xml.in.h:624 msgid "r:process" msgstr "" #: ../data/functions.xml.in.h:625 msgid "Element variable" msgstr "Variable Élément" #: ../data/functions.xml.in.h:626 msgid "Index variable" msgstr "Variable d'index" #: ../data/functions.xml.in.h:627 msgid "Vector variable" msgstr "Variable vecteur" #: ../data/functions.xml.in.h:628 msgid "Process Matrix Elements" msgstr "Calculer les Éléments de Matrice" #: ../data/functions.xml.in.h:629 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:630 msgid "Row variable" msgstr "Variable de Ligne" #: ../data/functions.xml.in.h:631 msgid "Column variable" msgstr "Variable de colonne" #: ../data/functions.xml.in.h:632 msgid "Matrix variable" msgstr "Variable matricielle" #: ../data/functions.xml.in.h:633 msgid "Custom Sum of Elements" msgstr "Somme d'éléments personnalisée" #: ../data/functions.xml.in.h:634 msgid "r:csum" msgstr "" #: ../data/functions.xml.in.h:635 msgid "First element" msgstr "Premier élément" #: ../data/functions.xml.in.h:636 msgid "Last element" msgstr "Dernier élément" #: ../data/functions.xml.in.h:637 msgid "Initial value" msgstr "Valeur initiale" #: ../data/functions.xml.in.h:638 msgid "Value variable" msgstr "Variable valeur" #: ../data/functions.xml.in.h:639 msgid "Select Vector Elements" msgstr "Sélectionner les Éléments de Vecteur" #: ../data/functions.xml.in.h:640 msgid "r:select" msgstr "" #: ../data/functions.xml.in.h:641 msgid "Condition" msgstr "" #: ../data/functions.xml.in.h:642 msgid "Select first match" msgstr "Sélectionner la première occurrence" #: ../data/functions.xml.in.h:643 msgid "r:function" msgstr "fonction" #: ../data/functions.xml.in.h:644 msgid "Arguments" msgstr "Arguments" #: ../data/functions.xml.in.h:645 msgid "Title" msgstr "Titre" #: ../data/functions.xml.in.h:646 msgid "r:title" msgstr "" #: ../data/functions.xml.in.h:648 msgid "Display Error" msgstr "Afficher l'erreur" #: ../data/functions.xml.in.h:649 msgid "r:error" msgstr "erreur" #: ../data/functions.xml.in.h:650 msgid "Message" msgstr "" #: ../data/functions.xml.in.h:651 msgid "Display Warning" msgstr "Afficher l'avertissement" #: ../data/functions.xml.in.h:652 msgid "r:warning" msgstr "" #: ../data/functions.xml.in.h:653 msgid "Display Message" msgstr "Afficher le message" #: ../data/functions.xml.in.h:654 msgid "r:message" msgstr "" #: ../data/functions.xml.in.h:655 msgid "Save as Variable" msgstr "Enregistrer comme variable" #: ../data/functions.xml.in.h:656 msgid "r:save" msgstr "" #: ../data/functions.xml.in.h:657 msgid "Category" msgstr "Catégorie" #: ../data/functions.xml.in.h:658 msgid "RPN Stack Register" msgstr "Registre de Pile NPI" #: ../data/functions.xml.in.h:659 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:660 msgid "Returns the value of a RPN stack register." msgstr "Retourne la valeur d'un registre de pile NPI." #: ../data/functions.xml.in.h:661 msgid "RPN Stack Vector" msgstr "Vecteur de Pile NPI" #: ../data/functions.xml.in.h:662 msgid "r:stack" msgstr "" #: ../data/functions.xml.in.h:663 msgid "Returns the RPN stack as a vector." msgstr "Retourne la pile NPI sous forme de vecteur." #: ../data/functions.xml.in.h:664 msgid "Is Number" msgstr "" #: ../data/functions.xml.in.h:665 msgid "r:isNumber" msgstr "" #: ../data/functions.xml.in.h:666 msgid "Is Real" msgstr "" #: ../data/functions.xml.in.h:667 msgid "r:isReal" msgstr "" #: ../data/functions.xml.in.h:668 msgid "Is Rational" msgstr "" #: ../data/functions.xml.in.h:669 msgid "r:isRational" msgstr "" #: ../data/functions.xml.in.h:670 msgid "Is Integer" msgstr "" #: ../data/functions.xml.in.h:671 msgid "r:isInteger" msgstr "" #: ../data/functions.xml.in.h:672 msgid "Represents Number" msgstr "" #: ../data/functions.xml.in.h:673 msgid "r:representsNumber" msgstr "" #: ../data/functions.xml.in.h:674 msgid "Represents Real" msgstr "" #: ../data/functions.xml.in.h:675 msgid "r:representsReal" msgstr "" #: ../data/functions.xml.in.h:676 msgid "Represents Rational" msgstr "" #: ../data/functions.xml.in.h:677 msgid "r:representsRational" msgstr "" #: ../data/functions.xml.in.h:678 msgid "Represents Integer" msgstr "" #: ../data/functions.xml.in.h:679 msgid "r:representsInteger" msgstr "" #: ../data/functions.xml.in.h:680 #, fuzzy msgid "Interval" msgstr "Intégrale" #: ../data/functions.xml.in.h:681 #, fuzzy msgid "r:interval" msgstr "intégrer" #: ../data/functions.xml.in.h:682 #, fuzzy msgid "Lower endpoint" msgstr "Limite inférieure" #: ../data/functions.xml.in.h:683 #, fuzzy msgid "Upper endpoint" msgstr "Limite Supérieure" #: ../data/functions.xml.in.h:684 msgid "Logical" msgstr "Logique" #: ../data/functions.xml.in.h:685 msgid "For...Do" msgstr "For...Do (Pour...Faire)" #: ../data/functions.xml.in.h:686 msgid "r:for" msgstr "pour" #: ../data/functions.xml.in.h:687 msgid "Initial value of counter" msgstr "Valeur initiale du compteur" #: ../data/functions.xml.in.h:688 msgid "Counter variable" msgstr "Variable de compteur" #: ../data/functions.xml.in.h:689 msgid "For condition" msgstr "Condition de boucle for" #: ../data/functions.xml.in.h:690 msgid "Counter update function" msgstr "Fonction d'incrémentation du compteur" #: ../data/functions.xml.in.h:691 msgid "Do function" msgstr "Fonction 'faire'" #: ../data/functions.xml.in.h:692 msgid "If...Then...Else" msgstr "Si...Sinon..Alors" #: ../data/functions.xml.in.h:693 msgid "r:if" msgstr "si" #: ../data/functions.xml.in.h:694 msgid "Tests a condition and returns a value depending on the result." msgstr "Teste une condition et retourne une valeur en fonction du résultat." #: ../data/functions.xml.in.h:695 msgid "Expression if condition is met" msgstr "Expression si la condition est remplie" #: ../data/functions.xml.in.h:696 msgid "Expression if condition is NOT met" msgstr "Expression si la condition N'EST PAS remplie" #: ../data/functions.xml.in.h:697 msgid "Logical Exclusive OR" msgstr "OU Exclusif Logique" #: ../data/functions.xml.in.h:698 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:699 msgid "Value 1" msgstr "Valeur 1" #: ../data/functions.xml.in.h:700 msgid "Value 2" msgstr "Valeur 2" #: ../data/functions.xml.in.h:701 msgid "Bitwise Exclusive OR" msgstr "OU exclusif bit à bit" #: ../data/functions.xml.in.h:702 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:703 msgid "Bitwise Shift" msgstr "Décalage de bits" #: ../data/functions.xml.in.h:704 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:705 msgid "Bits" msgstr "" #: ../data/functions.xml.in.h:706 msgid "Bitwise Complement (Not)" msgstr "" #: ../data/functions.xml.in.h:707 msgid "r:bitcmp" msgstr "" #: ../data/functions.xml.in.h:708 msgid "Algebra" msgstr "Algèbre" #: ../data/functions.xml.in.h:709 #, fuzzy msgid "Summation" msgstr "Équation" #: ../data/functions.xml.in.h:710 msgid "au:Σ,r:sum" msgstr "" #: ../data/functions.xml.in.h:711 #, fuzzy msgid "" "Corresponds to the summation symbol. Adds terms for each x ranging from the " "lower to the upper limit." msgstr "" "Correspond au symbole de la somme. Ajoute les termes pour chaque x allant de " "la borne inférieure à la borne supérieure." #: ../data/functions.xml.in.h:712 msgid "Term expression" msgstr "" #: ../data/functions.xml.in.h:713 msgid "Lower limit (i)" msgstr "Limite inférieure (i)" #: ../data/functions.xml.in.h:714 msgid "Upper limit (n)" msgstr "Limite Supérieure (n)" #: ../data/functions.xml.in.h:715 msgid "Product of a sequence" msgstr "" #: ../data/functions.xml.in.h:716 msgid "au:Π,r:product" msgstr "" #: ../data/functions.xml.in.h:717 msgid "" "Corresponds to the product symbol. Multiplies factors for each x ranging " "from the lower to the upper limit." msgstr "" "Correspond au symbole du produit. Multiplie les facteurs pour chaque x " "allant de la la limite inférieure à la limite supérieure." #: ../data/functions.xml.in.h:718 msgid "Factor expression" msgstr "Factoriser l'expression" #: ../data/functions.xml.in.h:719 msgid "Solve for multiple variables" msgstr "Résoudre pour des variables multiples" #: ../data/functions.xml.in.h:720 msgid "r:multisolve" msgstr "" #: ../data/functions.xml.in.h:721 msgid "Equation vector" msgstr "Vecteur d'équation" #: ../data/functions.xml.in.h:722 msgid "Variable vector" msgstr "Variable vecteur" #: ../data/functions.xml.in.h:723 msgid "Solve equation" msgstr "Résoudre l'équation" #: ../data/functions.xml.in.h:724 msgid "r:solve" msgstr "" #: ../data/functions.xml.in.h:725 msgid "Equation" msgstr "Équation" #: ../data/functions.xml.in.h:726 msgid "With respect to" msgstr "" #: ../data/functions.xml.in.h:727 #, fuzzy msgid "Solve differential equation" msgstr "Résoudre l'équation" #: ../data/functions.xml.in.h:728 msgid "r:dsolve" msgstr "" #: ../data/functions.xml.in.h:729 msgid "Initial condition: function value (y)" msgstr "" #: ../data/functions.xml.in.h:730 msgid "Initial condition: argument value (x)" msgstr "" #: ../data/functions.xml.in.h:731 msgid "" "Solves a differential equation and returns the value of y(x). The derivative " "in the equation should be in the format diff(y, x). Only first-order " "differential equations are currently supported." msgstr "" #: ../data/functions.xml.in.h:732 msgid "Solve for two variables" msgstr "Résoudre pour deux variables" #: ../data/functions.xml.in.h:733 msgid "r:solve2" msgstr "" #: ../data/functions.xml.in.h:734 msgid "" "Solves two equations with two unknown variables. Returns the value of the " "first variable." msgstr "" "Résout deux équations à deux inconnues. Retourne la valeur de la première " "variable." #: ../data/functions.xml.in.h:735 msgid "Equation 1" msgstr "Équation 2" #: ../data/functions.xml.in.h:736 msgid "Equation 2" msgstr "Équation 2" #: ../data/functions.xml.in.h:737 msgid "Variable 1" msgstr "" #: ../data/functions.xml.in.h:738 msgid "Variable 2" msgstr "" #: ../data/functions.xml.in.h:739 msgid "Find Linear Function" msgstr "Trouver une fonction affine" #: ../data/functions.xml.in.h:740 msgid "r:linearfunction" msgstr "" #: ../data/functions.xml.in.h:741 msgid "" "Finds the linear function for the straight line between two distinct points." msgstr "" "Trouve la fonction affine pour la ligne droite passant entre deux points " "distincts." #: ../data/functions.xml.in.h:742 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:743 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:744 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:745 msgid "y2" msgstr "" #: ../data/functions.xml.in.h:746 msgid "Calculus" msgstr "Calcul" #: ../data/functions.xml.in.h:747 msgid "Differentiate" msgstr "" #: ../data/functions.xml.in.h:748 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:749 msgid "Integrate" msgstr "Intégrale" #: ../data/functions.xml.in.h:750 msgid "r:integrate" msgstr "intégrer" #: ../data/functions.xml.in.h:751 msgid "Variable of integration" msgstr "Variable d'intégration" #: ../data/functions.xml.in.h:752 #, fuzzy msgid "Limit" msgstr "Limite inférieure" #: ../data/functions.xml.in.h:753 msgid "" "Returns the two-sided limit of the function if direction is zero, limit from " "left (below) if direction is -1, or limit from right (above) if direction is " "+1." msgstr "" #: ../data/functions.xml.in.h:754 #, fuzzy msgid "r:limit" msgstr "limites" #: ../data/functions.xml.in.h:755 msgid "Value to approach" msgstr "" #: ../data/functions.xml.in.h:756 #, fuzzy msgid "Direction" msgstr "Durée" #: ../data/functions.xml.in.h:757 msgid "Extreme Values" msgstr "Valeurs extrêmes" #: ../data/functions.xml.in.h:758 msgid "r:extremum" msgstr "" #: ../data/functions.xml.in.h:759 #, fuzzy msgid "Named Integrals" msgstr "Entiers" #: ../data/functions.xml.in.h:760 msgid "Logarithmic Integral" msgstr "" #: ../data/functions.xml.in.h:761 #, fuzzy msgid "rc:li,logint" msgstr "logistique" #: ../data/functions.xml.in.h:762 msgid "The integral of 1/ln(x)." msgstr "" #: ../data/functions.xml.in.h:763 #, fuzzy msgid "Exponential Integral" msgstr "Exponentielle (e^x)" #: ../data/functions.xml.in.h:764 msgid "rc:Ei,expint" msgstr "" #: ../data/functions.xml.in.h:765 msgid "The integral of e^x/x." msgstr "" #: ../data/functions.xml.in.h:766 #, fuzzy msgid "Sine Integral" msgstr "Intégrale" #: ../data/functions.xml.in.h:767 msgid "rc:Si,sinint" msgstr "" #: ../data/functions.xml.in.h:768 msgid "The integral of sin(x)/x." msgstr "" #: ../data/functions.xml.in.h:769 #, fuzzy msgid "Cosine Integral" msgstr "Intégrale" #: ../data/functions.xml.in.h:770 msgid "rc:Ci,cosint" msgstr "" #: ../data/functions.xml.in.h:771 msgid "The integral of cos(x)/x." msgstr "" #: ../data/functions.xml.in.h:772 #, fuzzy msgid "Hyperbolic Sine Integral" msgstr "Sinus Hyperbolique" #: ../data/functions.xml.in.h:773 msgid "rc:Shi,sinhint" msgstr "" #: ../data/functions.xml.in.h:774 msgid "The integral of sinh(x)/x." msgstr "" #: ../data/functions.xml.in.h:775 #, fuzzy msgid "Hyperbolic Cosine Integral" msgstr "Cosinus Hyperbolique" #: ../data/functions.xml.in.h:776 msgid "rc:Chi,coshint" msgstr "" #: ../data/functions.xml.in.h:777 msgid "The integral of cosh(x)/x." msgstr "" #: ../data/functions.xml.in.h:778 #, fuzzy msgid "Upper Incomplete Gamma Function" msgstr "Fonction Gamma" #: ../data/functions.xml.in.h:779 msgid "r:igamma" msgstr "" #: ../data/functions.xml.in.h:780 #, fuzzy msgid "Lower Incomplete Gamma Function" msgstr "Fonction Gamma" #: ../data/functions.xml.in.h:781 msgid "r:gammainc" msgstr "" #: ../data/functions.xml.in.h:782 msgid "Geometry" msgstr "Géométrie" #: ../data/functions.xml.in.h:783 msgid "Triangle" msgstr "" #: ../data/functions.xml.in.h:784 msgid "Hypotenuse" msgstr "Hypoténuse" #: ../data/functions.xml.in.h:785 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:786 msgid "Side A" msgstr "Côté A" #: ../data/functions.xml.in.h:787 msgid "Side B" msgstr "Côté B" #: ../data/functions.xml.in.h:788 msgid "Triangle Area" msgstr "Aire de Triangle" #: ../data/functions.xml.in.h:789 msgid "r:triangle" msgstr "" #: ../data/functions.xml.in.h:790 msgid "Height" msgstr "Hauteur" #: ../data/functions.xml.in.h:791 msgid "Triangle Perimeter" msgstr "Périmètre de Triangle" #: ../data/functions.xml.in.h:792 msgid "r:triangle_perimeter" msgstr "" #: ../data/functions.xml.in.h:793 msgid "Side C" msgstr "Côté C" #: ../data/functions.xml.in.h:794 msgid "Circle" msgstr "Cercle" #: ../data/functions.xml.in.h:795 msgid "Circle Area" msgstr "Aire d'un cercle" #: ../data/functions.xml.in.h:796 msgid "r:circle" msgstr "cercle" #: ../data/functions.xml.in.h:797 msgid "Calculates the area of a circle using the radius" msgstr "Calcule l'aire d'un cercle d'après son rayon" #: ../data/functions.xml.in.h:798 msgid "Radius" msgstr "Rayon" #: ../data/functions.xml.in.h:799 msgid "Circle Circumference" msgstr "Circonférence d'un cercle" #: ../data/functions.xml.in.h:800 msgid "r:circumference" msgstr "circonférence" #: ../data/functions.xml.in.h:801 msgid "Cylinder" msgstr "Cylindre" #: ../data/functions.xml.in.h:802 msgid "Cylinder Volume" msgstr "Volume d'un cylindre" #: ../data/functions.xml.in.h:803 msgid "r:cylinder" msgstr "cylindre" #: ../data/functions.xml.in.h:804 msgid "Surface Area of Cylinder" msgstr "Aire de la Surface d'un Cylindre" #: ../data/functions.xml.in.h:805 msgid "r:cylinder_sa" msgstr "" #: ../data/functions.xml.in.h:806 msgid "Cone" msgstr "Cône" #: ../data/functions.xml.in.h:807 msgid "Cone Volume" msgstr "Volume d'un cône" #: ../data/functions.xml.in.h:808 msgid "r:cone" msgstr "cône" #: ../data/functions.xml.in.h:809 msgid "Surface Area of Cone" msgstr "Aire de la Surface d'un Cône" #: ../data/functions.xml.in.h:810 msgid "r:cone_sa" msgstr "" #: ../data/functions.xml.in.h:811 msgid "Sphere" msgstr "Sphère" #: ../data/functions.xml.in.h:812 msgid "Sphere Volume" msgstr "Volume de Sphère" #: ../data/functions.xml.in.h:813 msgid "r:sphere" msgstr "" #: ../data/functions.xml.in.h:814 msgid "Surface Area of Sphere" msgstr "Aire de la Surface d'une Sphère" #: ../data/functions.xml.in.h:815 msgid "r:sphere_sa" msgstr "" #: ../data/functions.xml.in.h:816 msgid "Square Area" msgstr "Aire d'un Carré" #: ../data/functions.xml.in.h:817 msgid "r:square" msgstr "" #: ../data/functions.xml.in.h:818 msgid "Length of side" msgstr "Longueur du côté" #: ../data/functions.xml.in.h:819 msgid "Square Perimeter" msgstr "Périmètre d'un Carré" #: ../data/functions.xml.in.h:820 msgid "r:square_perimeter" msgstr "" #: ../data/functions.xml.in.h:821 msgid "Cube" msgstr "" #: ../data/functions.xml.in.h:822 msgid "Cube Volume" msgstr "Volume d'un cube" #: ../data/functions.xml.in.h:823 msgid "r:cube" msgstr "" #: ../data/functions.xml.in.h:824 msgid "Surface Area of Cube" msgstr "Aire de la Surface d'un Cube" #: ../data/functions.xml.in.h:825 msgid "r:cube_sa" msgstr "" #: ../data/functions.xml.in.h:826 msgid "Rectangle" msgstr "" #: ../data/functions.xml.in.h:827 msgid "Rectangle Area" msgstr "Aire de Rectangle" #: ../data/functions.xml.in.h:828 msgid "r:rect" msgstr "" #: ../data/functions.xml.in.h:829 msgid "Width" msgstr "Largeur" #: ../data/functions.xml.in.h:830 msgid "Rectangle Perimeter" msgstr "Périmètre de Rectangle" #: ../data/functions.xml.in.h:831 msgid "r:rect_perimeter" msgstr "" #: ../data/functions.xml.in.h:832 msgid "Prism" msgstr "Prisme" #: ../data/functions.xml.in.h:833 msgid "Volume of Rectangular Prism" msgstr "Volume de Prisme Rectangulaire" #: ../data/functions.xml.in.h:834 msgid "r:rectprism" msgstr "" #: ../data/functions.xml.in.h:835 msgid "Calculates the volume of a prism with rectangular base." msgstr "Calcule le volume d'un prisme à base rectangulaire." #: ../data/functions.xml.in.h:836 msgid "Surface Area of Rectangular Prism" msgstr "Aire de la Surface d'un Prisme Rectangulaire" #: ../data/functions.xml.in.h:837 msgid "r:rectprism_sa" msgstr "" #: ../data/functions.xml.in.h:838 msgid "Calculates the surface area of a prism with rectangular base." msgstr "Calcule l'aire de la surface d'un prisme à base rectangulaire." #: ../data/functions.xml.in.h:839 msgid "Volume of Triangular Prism" msgstr "Volume de Prisme Rectangulaire" #: ../data/functions.xml.in.h:840 msgid "r:triangleprism" msgstr "" #: ../data/functions.xml.in.h:841 msgid "Calculates the volume of a prism with triangular base." msgstr "Calcule le volume d'un prisme à base triangulaire." #: ../data/functions.xml.in.h:842 msgid "Pyramid" msgstr "Pyramide" #: ../data/functions.xml.in.h:843 msgid "Pyramid Volume" msgstr "Volume de Pyramide" #: ../data/functions.xml.in.h:844 msgid "r:pyramid" msgstr "" #: ../data/functions.xml.in.h:845 msgid "" "Calculates the volume of a 3-dimensional shape standing on a rectangular " "base and terminating in a point at the top." msgstr "" "Calcule le volume d'une forme à trois dimensions basée sur un rectangle et " "se finissant en un point au sommet." #: ../data/functions.xml.in.h:846 msgid "Length of base" msgstr "Longueur de la taille" #: ../data/functions.xml.in.h:847 msgid "Width of base" msgstr "Largeur de la base" #: ../data/functions.xml.in.h:848 msgid "Volume of Regular Tetrahedron" msgstr "Volume de Tétraèdre Régulier" #: ../data/functions.xml.in.h:849 msgid "r:tetrahedron" msgstr "" #: ../data/functions.xml.in.h:850 msgid "Surface Area of Regular Tetrahedron" msgstr "Aire de la Surface d'un Tétraèdre Régulier" #: ../data/functions.xml.in.h:851 msgid "r:tetrahedron_sa" msgstr "" #: ../data/functions.xml.in.h:852 msgid "Height of Regular Tetrahedron" msgstr "Hauteur d'un Tétraèdre Régulier" #: ../data/functions.xml.in.h:853 msgid "r:tetrahedron_height" msgstr "" #: ../data/functions.xml.in.h:854 msgid "Volume of Square Pyramid" msgstr "Volume de Pyramide à Base Carrée" #: ../data/functions.xml.in.h:855 msgid "r:sqpyramid" msgstr "" #: ../data/functions.xml.in.h:856 msgid "Surface Area of Square Pyramid" msgstr "Aire de la Surface d'une Pyramide" #: ../data/functions.xml.in.h:857 msgid "r:sqpyramid_sa" msgstr "" #: ../data/functions.xml.in.h:858 msgid "Height of Square Pyramid" msgstr "Hauteur d'une Pyramide à Base Carrée" #: ../data/functions.xml.in.h:859 msgid "r:sqpyramid_height" msgstr "" #: ../data/functions.xml.in.h:860 msgid "Parallelogram" msgstr "Parallélogramme" #: ../data/functions.xml.in.h:861 msgid "Parallelogram Area" msgstr "Aire d'un Parallélogramme" #: ../data/functions.xml.in.h:862 msgid "r:parallelogram" msgstr "parallélogramme" #: ../data/functions.xml.in.h:863 #, fuzzy msgid "" "Calculates the area of a four-sided figure whose opposite sides are both " "parallel and equal in length." msgstr "" "Calcule l'aire d'un parallélogramme (quadrilatère dont les côtés opposés " "sont parallèles et de même longueur)." #: ../data/functions.xml.in.h:864 msgid "Parallelogram Perimeter" msgstr "Périmètre d'un Parallélogramme" #: ../data/functions.xml.in.h:865 msgid "r:parallelogram_perimeter" msgstr "périmètre_de_parallélogramme" #: ../data/functions.xml.in.h:866 #, fuzzy msgid "" "Calculates the perimeter of a four-sided figure whose opposite sides are " "both parallel and equal in length." msgstr "" "Calcule le périmètre d'un parallélogramme (quadrilatère dont les côtés " "opposés sont parallèles et de même longueur)." #: ../data/functions.xml.in.h:867 msgid "Trapezoid" msgstr "" #: ../data/functions.xml.in.h:868 msgid "Trapezoid Area" msgstr "" #: ../data/functions.xml.in.h:869 msgid "r:trapezoid" msgstr "" #: ../data/functions.xml.in.h:870 #, fuzzy msgid "Calculates the area of a four-sided figure with two parallel sides." msgstr "" "Calcule l'aire d'un trapèze (quadrilatère dont deux côtés sont parallèles)." #: ../data/functions.xml.in.h:871 msgid "Economics" msgstr "Économie" #: ../data/functions.xml.in.h:872 msgid "Microeconomics" msgstr "Micro-économie" #: ../data/functions.xml.in.h:873 msgid "Elasticity" msgstr "Élasticité" #: ../data/functions.xml.in.h:874 msgid "r:elasticity" msgstr "élasticité" #: ../data/functions.xml.in.h:875 msgid "" "Calculates the demand elasticity. Also works for supply elasticity, income " "elasticity, cross-price elasticity, etc. Just replace demand with supply, or " "price with income... eg. elasticity(100-x^2, 3) calculates the " "demand elasticity when the price is 3 for the function \"Q = 100 - x^2\" " "where x is the default price variable." msgstr "" "Calcule l'élasticité de la demande. Fonctionne également pour l'élasticité " "de l'offre, de revenu, de prix croisés, etc. Remplacez simplement demande " "par offre, ou prix par revenu... Ex. elasticity(100-x^2, 3) calcule " "l'élasticité de la demande quand le prix est 3 pour la fonction \"Q = 100 - " "x^2\" où x est la variable de prix par défaut." #: ../data/functions.xml.in.h:876 msgid "Demand function" msgstr "Fonction de la demande" #: ../data/functions.xml.in.h:877 msgid "Price" msgstr "Prix" #: ../data/functions.xml.in.h:878 msgid "Price variable" msgstr "Variable de prix" #: ../data/functions.xml.in.h:879 msgid "Sum-of-Years Digits Depreciation" msgstr "" #: ../data/functions.xml.in.h:880 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:881 msgid "" "Calculates the sum-of-years digits depreciation for an asset based on its " "cost, salvage value, anticipated life, and a particular period. This method " "accelerates the rate of the depreciation, so that more depreciation expense " "occurs in earlier periods than in later ones. The depreciable cost is the " "actual cost minus the salvage value. The useful life is the number of " "periods (typically years) over which the asset is depreciated." msgstr "" "Calcule la dépréciation d'un actif d'après son coût, sa valeur résiduelle, " "sa durée prévue et une période particulière. Cette méthode accélère le taux " "de dépréciation, ainsi les frais de dépréciation sont plus importants dans " "les premières périodes que dans les dernières. Le coût amortissable est la " "valeur réelle moins la valeur résiduelle. La vie utile est le nombre de " "périodes (typiquement années) pendant lesquelles les actifs sont dépréciés." #: ../data/functions.xml.in.h:882 msgid "Cost" msgstr "Coût" #: ../data/functions.xml.in.h:883 msgid "Salvage value" msgstr "" #: ../data/functions.xml.in.h:884 msgid "Life" msgstr "Vie" #: ../data/functions.xml.in.h:885 msgid "Period" msgstr "Période" #: ../data/functions.xml.in.h:886 msgid "Straight Line Depreciation" msgstr "" #: ../data/functions.xml.in.h:887 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:888 msgid "" "Determines the straight line depreciation of an asset for a single period." " Cost is the amount you paid for the asset. Salvage is the value of " "the asset at the end of the period. Life is the number of periods over which " "the asset is depreciated. SLN divides the cost evenly over the life of an " "asset." msgstr "" "Calcule la dépréciation linéaire d'un actif pour une période. Le " "coût est le montant pour lequel vous avez payé pour l'actif. La valeur " "résiduelle est la valeur de l'actif à la fin de la période. La vie est le " "nombre de périodes pendant lesquelles l'actif est déprécié." #: ../data/functions.xml.in.h:889 msgid "Present Value" msgstr "Valeur Actuelle" #: ../data/functions.xml.in.h:890 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:891 msgid "" "Returns the present value of an investment. If type = 1 then the " "payment is made at the beginning of the period, If type = 0 (or omitted) it " "is made at the end of each period." msgstr "" "Retourne la valeur actuelle d'un investissement. Si type = 1 alors " "le paiement est fait au début de la période, si type = 0 (ou omis) il est " "fait à la fin de chaque période." #: ../data/functions.xml.in.h:892 msgid "Interest rate" msgstr "Taux d'intérêt" #: ../data/functions.xml.in.h:893 msgid "Number of periods" msgstr "Nombre de périodes" #: ../data/functions.xml.in.h:894 msgid "Payment made each period" msgstr "Versement effectué à chaque période" #: ../data/functions.xml.in.h:895 msgid "Future value" msgstr "Valeur future" #: ../data/functions.xml.in.h:896 msgid "Type" msgstr "" #: ../data/functions.xml.in.h:897 msgid "Nominal Interest Rate" msgstr "Taux d'Intérêt Nominal" #: ../data/functions.xml.in.h:898 msgid "r:nominal" msgstr "" #: ../data/functions.xml.in.h:899 msgid "" "Calculates the nominal interest rate from a given effective interest rate " "compounded at given intervals." msgstr "" "Calcule le taux d'intérêt nominal pour un taux d'intérêt effectif donné " "composé à des intervalles donnés." #: ../data/functions.xml.in.h:900 msgid "Effective interest rate" msgstr "Taux d'intérêt effectif" #: ../data/functions.xml.in.h:901 msgid "Periods" msgstr "Périodes" #: ../data/functions.xml.in.h:902 msgid "Zero Coupon" msgstr "" #: ../data/functions.xml.in.h:903 msgid "r:zero_coupon" msgstr "" #: ../data/functions.xml.in.h:904 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "" #: ../data/functions.xml.in.h:905 msgid "Face value" msgstr "Valeur nominale" #: ../data/functions.xml.in.h:906 msgid "Treasury Bill Yield" msgstr "" #: ../data/functions.xml.in.h:907 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:908 msgid "Returns the yield for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:909 msgid "Settlement date" msgstr "" #: ../data/functions.xml.in.h:910 msgid "Maturity date" msgstr "Échéance" #: ../data/functions.xml.in.h:911 msgid "Price per $100 face value" msgstr "Prix pour 100 $ de valeur faciale" #: ../data/functions.xml.in.h:912 msgid "Treasury Bill Price" msgstr "" #: ../data/functions.xml.in.h:913 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:914 msgid "Returns the price per $100 value for a treasury bill." msgstr "Retourne le prix pour 100 $ de valeur de bons du trésor." #: ../data/functions.xml.in.h:915 msgid "Discount rate" msgstr "Taux d'actualisation" #: ../data/functions.xml.in.h:916 msgid "Treasury Bill Equivalent" msgstr "" #: ../data/functions.xml.in.h:917 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:918 msgid "Returns the bond equivalent for a treasury bill." msgstr "" #: ../data/functions.xml.in.h:919 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "Intérêt payé pour une période donnée d'un investissement" #: ../data/functions.xml.in.h:920 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:921 msgid "Calculates the interest paid on a given period of an investment." msgstr "Calcule l'intérêt d'un investissement payé sur une période donnée." #: ../data/functions.xml.in.h:922 msgid "Periodic interest rate" msgstr "" #: ../data/functions.xml.in.h:923 msgid "Amortizement period" msgstr "Période d'amortissement" #: ../data/functions.xml.in.h:924 msgid "Present value" msgstr "Valeur actuelle" #: ../data/functions.xml.in.h:925 msgid "Payment for a loan" msgstr "Versement pour un emprunt" #: ../data/functions.xml.in.h:926 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:927 #, fuzzy msgid "" "Returns the amount of payment (negative) each period for a loan based on a " "constant interest rate and constant payments (each payment is equal amount)." " If type = 1 then the payment is made at the beginning of the " "period, If type = 0 (or omitted) it is made at the end of each period. " " Note that the interest rate here refers to the rate for each period and " "if you calculate with an annual rate, each period will be interpreted as a " "whole year. To get monthly payments divide the annual interest rate by 12 " "and enter the total number of months (12 times number of year) in the " "periods field." msgstr "" "Retourne le montant des versements d'un emprunt basé sur un taux d'intérêt " "constant (tous les versements sont égaux). Si type = 1 alors le " "paiement est réalisé en début de période, si type = 0 (ou omis) il est fait " "en fin de chaque période." #: ../data/functions.xml.in.h:928 msgid "Rate" msgstr "" #: ../data/functions.xml.in.h:929 msgid "Periods of an investment" msgstr "" #: ../data/functions.xml.in.h:930 msgid "r:nper" msgstr "" #: ../data/functions.xml.in.h:931 msgid "" "Calculates number of periods of an investment based on periodic constant " "payments and a constant interest rate. Type defines the due date. 1 " "for payment at the beginning of a period and 0 (default) for payment at the " "end of a period." msgstr "" "Calcule le nombre de périodes d'un investissement reposant sur des paiements " "périodiques constants et un taux d'intérêt constant.. Le type " "définit l'échéance. 1 pour paiement en début de période et 0 (par défaut) " "pour paiement en fin de période." #: ../data/functions.xml.in.h:932 msgid "Periods for investment to attain desired value" msgstr "" #: ../data/functions.xml.in.h:933 msgid "r:g_duration" msgstr "" #: ../data/functions.xml.in.h:934 msgid "" "Returns the number of periods needed for an investment to attain a desired " "value." msgstr "" "Retourne le nombre de périodes nécessaires à un investissement pour " "atteindre un valeur désirée." #: ../data/functions.xml.in.h:935 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "Versements d'une rente orientée vers le capital" #: ../data/functions.xml.in.h:936 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:937 msgid "" "Calculates the amount of a payment of an annuity going towards principal." " Type defines the due date. 1 for payment at the beginning of a " "period and 0 (default) for payment at the end of a period." msgstr "" "Calcule le montant des versements d'une rente orientée vers le capital. " " Le type définit la date de paiement. 1 pour des paiements en début de " "période et 0 (par défaut) pour des paiements en fin de période." #: ../data/functions.xml.in.h:938 msgid "Desired future value" msgstr "Valeur future souhaitée" #: ../data/functions.xml.in.h:939 msgid "Effective Interest Rate" msgstr "Taux d'intérêt effectif" #: ../data/functions.xml.in.h:940 msgid "r:effect" msgstr "effet" #: ../data/functions.xml.in.h:941 msgid "Calculates the effective interest for a given nominal rate." msgstr "Calcule l'intérêt effectif pour un taux nominal donné." #: ../data/functions.xml.in.h:942 msgid "Nominal interest rate" msgstr "Taux d'intérêt nominal" #: ../data/functions.xml.in.h:943 msgid "Future Value" msgstr "Valeur Future" #: ../data/functions.xml.in.h:944 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:945 msgid "" "Computes the future value of an investment. This is based on periodic, " "constant payments and a constant interest rate. If type = 1 then " "the payment is made at the beginning of the period, If type = 0 (or omitted) " "it is made at the end of each period." msgstr "" "Calcule la valeur future d'un investissement. Cela est basé sur des " "paiements constants périodiques et un taux d'intérêt constant. Si " "le type = 1 alors le paiement est effectué au début de chaque période; si le " "type = 0 (ou omis), il a lieu à la fin de chaque période." #: ../data/functions.xml.in.h:946 msgid "Return on continuously compounded interest" msgstr "Retour sur intérêt continûment composé" #: ../data/functions.xml.in.h:947 msgid "r:continuous" msgstr "" #: ../data/functions.xml.in.h:948 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "" "Calcule le retour sur intérêt composé continument, étant donnés le taux " "nominal principal et la durée en années." #: ../data/functions.xml.in.h:949 msgid "Principal" msgstr "Capital" #: ../data/functions.xml.in.h:950 msgid "Compound" msgstr "Composé" #: ../data/functions.xml.in.h:951 msgid "r:compound" msgstr "" #: ../data/functions.xml.in.h:952 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "" #: ../data/functions.xml.in.h:953 msgid "Periods per year" msgstr "" #: ../data/functions.xml.in.h:954 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "Versements d'une rente orientée vers les intérêts" #: ../data/functions.xml.in.h:955 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:956 msgid "" "Calculates the amount of a payment of an annuity going towards interest. " " Type defines the due date. 1 for payment at the beginning of a period " "and 0 (default) for payment at the end of a period." msgstr "" "Calcule le montant des versements d'une rente orientée vers les intérêts." " Le type définit la date de paiement. 1 pour des paiements en début " "de période et 0 (par défaut) pour des paiements en fin de période." #: ../data/functions.xml.in.h:957 msgid "Interest rate for a fully invested security" msgstr "Taux d'intérêt d'une obligation entièrement investie" #: ../data/functions.xml.in.h:958 msgid "r:intrate" msgstr "" #: ../data/functions.xml.in.h:959 msgid "" "Returns the interest rate for a fully invested security. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Retourne le taux d'intérêt pour une obligation entièrement investie. La base " "est les manière de compter les jours que vous souhaitez utiliser : 0 : US " "30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours réels/365 " "or 4: Européenne 30/360.La date de contrat doit être antérieure à l'échéance." #: ../data/functions.xml.in.h:960 msgid "Investment" msgstr "Investissement" #: ../data/functions.xml.in.h:961 msgid "Redemption" msgstr "Amortissement" #: ../data/functions.xml.in.h:962 msgid "Dollar Fraction" msgstr "Fraction en dollars" #: ../data/functions.xml.in.h:963 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:964 msgid "" "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "" "Convertit un prix en dollars décimaux en un prix en dollars sous forme de " "fraction." #: ../data/functions.xml.in.h:965 msgid "Decimal dollar" msgstr "Dollar décimal" #: ../data/functions.xml.in.h:966 msgid "Denominator of fraction" msgstr "Dénominateur d'une fraction" #: ../data/functions.xml.in.h:967 msgid "Dollar Decimal" msgstr "Dollar décimal" #: ../data/functions.xml.in.h:968 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:969 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "" "Convertit en prix en dollars sous forme de fraction en un prix en dollars " "décimaux." #: ../data/functions.xml.in.h:970 msgid "Fractional dollar" msgstr "Dollar fractionnaire" #: ../data/functions.xml.in.h:971 msgid "Amount received at maturity for a security bond" msgstr "Montant reçu à maturité par un bon de sécurité" #: ../data/functions.xml.in.h:972 msgid "r:received" msgstr "" #: ../data/functions.xml.in.h:973 msgid "" "Returns the amount received at the maturity date for an invested security." " Basis is the type of day counting you want to use: 0: US 30/360 " "(default), 1: real days, 2: real days/360, 3: real days/365 or 4: European " "30/360. The settlement date must be before maturity date." msgstr "" "Retourne le montant reçu à échéance pour un investissement en obligation. La " "base est les manière de compter les jours que vous souhaitez utiliser : 0 : " "US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, 3: jours " "réels/365 or 4: Européenne 30/360.La date de contrat doit être antérieure à " "l'échéance." #: ../data/functions.xml.in.h:974 msgid "Discount rate for a security" msgstr "Taux d'actualisation d'une obligation" #: ../data/functions.xml.in.h:975 msgid "r:disc" msgstr "" #: ../data/functions.xml.in.h:976 msgid "" "Returns the discount rate for a security. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" #: ../data/functions.xml.in.h:977 #, fuzzy msgid "Accrued interest of security paying at maturity" msgstr "Intérêt de sécurité cumulé payé à maturité" #: ../data/functions.xml.in.h:978 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:979 msgid "" "Returns the accrued interest for a security which pays interest at maturity " "date. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "Retourne les intérêts cumulés d'une obligation dont le versement à lieu à " "échéance. La base est les manière de compter les jours que vous souhaitez " "utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, " "3: jours réels/365 or 4: Européenne 30/360." #: ../data/functions.xml.in.h:980 msgid "Issue date" msgstr "Date de fin" #: ../data/functions.xml.in.h:981 msgid "Annual rate of security" msgstr "Taux de sécurité annuel" #: ../data/functions.xml.in.h:982 msgid "Par value" msgstr "Montant nominal" #: ../data/functions.xml.in.h:983 #, fuzzy msgid "Accrued interest of security with periodic interest payments" msgstr "Intérêt de sécurité cumulé avec paiements périodiques" #: ../data/functions.xml.in.h:984 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:985 msgid "" "Returns accrued interest for a security which pays periodic interest. " " Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. " "Basis is the type of day counting you want to use: 0: US 30/360 (default), " "1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Retourne les intérêts cumulés pour une obligation dont les versements sont " "périodiques. Les fréquences autorisées sont 1 - annuelle, 2 - " "semestrielle ou 4 - trimestrielle. La base est les manière de compter les " "jours que vous souhaitez utiliser : 0 : US 30/360 (par défaut), 1 : jours " "réels, 2: jours réels/360, 3: jours réels/365 or 4: Européenne 30/360." #: ../data/functions.xml.in.h:986 msgid "First interest" msgstr "Premier intérêt" #: ../data/functions.xml.in.h:987 msgid "Frequency" msgstr "Fréquence" #: ../data/functions.xml.in.h:988 msgid "Number of coupons to be paid" msgstr "Nombre de coupons à payer" #: ../data/functions.xml.in.h:989 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:990 msgid "" "Returns the number of coupons to be paid between the settlement and the " "maturity. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "Retourne le nombre de coupons à payer entre la date de transaction et " "l'échéance. La base est les manière de compter les jours que vous souhaitez " "utiliser : 0 : US 30/360 (par défaut), 1 : jours réels, 2: jours réels/360, " "3: jours réels/365 or 4: Européenne 30/360.La date de contrat doit être " "antérieure à l'échéance." #: ../data/functions.xml.in.h:991 #, fuzzy msgid "Price per $100 face value of a discounted security" msgstr "Prix pour 100 $ de valeur faciale d'une obligation" #: ../data/functions.xml.in.h:992 msgid "r:pricedisc" msgstr "" #: ../data/functions.xml.in.h:993 #, fuzzy msgid "" "Calculates and returns the price per $100 face value of a discounted " "security. The security does not pay interest at maturity. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Calcule et retourne le prix par bon d'obligation de 100$ de valeur faciale. " "L'obligation ne paie pas d'intérêt à maturité. La base est la " "manière de compter les jours que vous souhaitez utiliser : 0: US 30/360 " "(par défaut), 1: jours réels, 2: jours réels/360, 3: jours réels/365 or 4: " "Européenne 30/360." #: ../data/functions.xml.in.h:994 msgid "Discount" msgstr "Escompte" #: ../data/functions.xml.in.h:995 msgid "Price per $100 face value of a security" msgstr "Prix pour 100 $ de valeur faciale d'une obligation" #: ../data/functions.xml.in.h:996 msgid "r:pricemat" msgstr "" #: ../data/functions.xml.in.h:997 msgid "" "Calculates and returns the price per $100 face value of a security. The " "security pays interest at maturity. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "Calcule et retourne le prix par obligation de 100$ de valeur faciale. " "L'obligation paie des intérêts à maturité. La base est la manière " "de compter les jours que vous souhaitez utiliser : 0: US 30/360 (par " "défaut), 1: jours réels, 2: jours réels/360, 3: jours réels/365 or 4: " "Européenne 30/360." #: ../data/functions.xml.in.h:998 msgid "Annual yield" msgstr "Revenu annuel" #: ../data/functions.xml.in.h:999 msgid "Level-Coupon Bond" msgstr "" #: ../data/functions.xml.in.h:1000 msgid "r:level_coupon" msgstr "" #: ../data/functions.xml.in.h:1001 msgid "Calculates the value of a level-coupon bond." msgstr "" #: ../data/functions.xml.in.h:1002 msgid "Coupon rate" msgstr "Taux du coupon" #: ../data/functions.xml.in.h:1003 msgid "Coupons per year" msgstr "Coupons par an" #: ../data/functions.xml.in.h:1004 msgid "Market interest rate" msgstr "Taux d'intérêt du marché" #: ../data/planets.xml.in.h:1 msgid "Earth" msgstr "Terre" #: ../data/planets.xml.in.h:2 msgid "Mars" msgstr "" #. Planet #: ../data/planets.xml.in.h:4 msgid "!planets!Mercury" msgstr "Mercure" #: ../data/planets.xml.in.h:5 msgid "Venus" msgstr "Vénus" #: ../data/planets.xml.in.h:6 msgid "Jupiter" msgstr "" #: ../data/planets.xml.in.h:7 msgid "Saturn" msgstr "Saturne" #: ../data/planets.xml.in.h:8 msgid "Neptune" msgstr "" #: ../data/planets.xml.in.h:9 msgid "Pluto" msgstr "Pluton" #: ../data/planets.xml.in.h:10 msgid "Uranus" msgstr "" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Length" msgstr "Longueur" #: ../data/units.xml.in.h:3 msgid "Meter" msgstr "Mètre" #: ../data/units.xml.in.h:4 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "" #: ../data/units.xml.in.h:5 msgid "Kilometer" msgstr "Kilomètre" #: ../data/units.xml.in.h:6 msgid "Decimeter" msgstr "Décimètre" #: ../data/units.xml.in.h:7 msgid "Centimeter" msgstr "Centimètre" #: ../data/units.xml.in.h:8 msgid "Millimeter" msgstr "Millimètre" #: ../data/units.xml.in.h:9 msgid "Nautical Mile" msgstr "" #: ../data/units.xml.in.h:10 msgid "r:nautical_mile,p:nautical_miles" msgstr "" #: ../data/units.xml.in.h:11 msgid "Ångström" msgstr "" #: ../data/units.xml.in.h:12 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:13 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:14 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:15 msgid "Inch" msgstr "Pouce" #: ../data/units.xml.in.h:16 msgid "ar:in,inch,p:inches" msgstr "" #: ../data/units.xml.in.h:17 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:18 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:19 msgid "Foot" msgstr "Pied" #: ../data/units.xml.in.h:20 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:21 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:22 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:23 msgid "Link" msgstr "" #: ../data/units.xml.in.h:24 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:25 msgid "Yard" msgstr "" #: ../data/units.xml.in.h:26 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:27 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:28 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:29 msgid "Fathom" msgstr "" #: ../data/units.xml.in.h:30 msgid "r:fathom,p:fathoms" msgstr "" #: ../data/units.xml.in.h:31 msgid "Chain" msgstr "" #: ../data/units.xml.in.h:32 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:33 msgid "Furlong" msgstr "" #: ../data/units.xml.in.h:34 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:35 msgid "Mile" msgstr "Mile" #: ../data/units.xml.in.h:36 msgid "ar:mi,mile,p:miles" msgstr "" #: ../data/units.xml.in.h:37 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:38 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:39 msgid "Mil (1/1000 in)" msgstr "" #: ../data/units.xml.in.h:40 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:41 msgid "Astronomical Unit" msgstr "Unité Astronomique" #: ../data/units.xml.in.h:42 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "unité_astronomique,p:unités_astronomiques" #: ../data/units.xml.in.h:43 msgid "Light Year" msgstr "Année Lumière" #: ../data/units.xml.in.h:44 msgid "ar:ly,lightyear,p:lightyears" msgstr "" #: ../data/units.xml.in.h:45 msgid "Parsec" msgstr "" #: ../data/units.xml.in.h:46 msgid "ar:pc,parsec,p:parsecs" msgstr "" #: ../data/units.xml.in.h:47 msgid "Pied du roi (French Royal Foot)" msgstr "" #: ../data/units.xml.in.h:48 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:49 msgid "Pouce (French Royal Inch)" msgstr "" #: ../data/units.xml.in.h:50 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:51 msgid "Ligne" msgstr "" #: ../data/units.xml.in.h:52 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:53 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:54 msgid "r:toise" msgstr "" #. Unit category #: ../data/units.xml.in.h:56 msgid "!units!Angle" msgstr "Angle" #: ../data/units.xml.in.h:57 msgid "Plane Angle" msgstr "Angle Plan" #: ../data/units.xml.in.h:58 msgid "Meter per Meter" msgstr "Mètre par Mètre" #: ../data/units.xml.in.h:59 msgid "Radian" msgstr "" #: ../data/units.xml.in.h:60 msgid "ar:rad,radian,p:radians" msgstr "" #: ../data/units.xml.in.h:62 msgid "ar:deg,au:°,degree,p:degrees" msgstr "" #: ../data/units.xml.in.h:63 msgid "Gradian (Gon)" msgstr "" #: ../data/units.xml.in.h:64 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "" #: ../data/units.xml.in.h:65 msgid "Arcminute" msgstr "" #: ../data/units.xml.in.h:66 msgid "ar:arcmin,arcminute,p:arcminutes" msgstr "" #: ../data/units.xml.in.h:67 msgid "Arcsecond" msgstr "" #: ../data/units.xml.in.h:68 msgid "ar:arcsec,arcsecond,p:arcseconds" msgstr "" #: ../data/units.xml.in.h:69 msgid "Turn" msgstr "" #: ../data/units.xml.in.h:70 msgid "r:turn,p:turns" msgstr "" #: ../data/units.xml.in.h:71 msgid "Solid Angle" msgstr "Angle Solide" #: ../data/units.xml.in.h:72 msgid "Square Meter per Square Meter" msgstr "Mètre Carré par Mètre Carré" #: ../data/units.xml.in.h:73 msgid "Steradian" msgstr "" #: ../data/units.xml.in.h:74 msgid "ar:sr,steradian,p:steradians" msgstr "" #: ../data/units.xml.in.h:75 msgid "Angular Acceleration" msgstr "Accélération Angulaire" #: ../data/units.xml.in.h:76 msgid "Radians per Second Squared" msgstr "Radians par Seconde Carrée" #: ../data/units.xml.in.h:77 msgid "Angular Velocity" msgstr "" #: ../data/units.xml.in.h:78 msgid "Radians per Second" msgstr "Radians par Seconde" #. Unit category #: ../data/units.xml.in.h:80 msgid "!units!Mass" msgstr "Masse" #: ../data/units.xml.in.h:81 msgid "Gram" msgstr "Gramme" #: ../data/units.xml.in.h:82 msgid "ar:g,gram,p:grams" msgstr "" #: ../data/units.xml.in.h:83 msgid "Kilogram" msgstr "Kilogramme" #: ../data/units.xml.in.h:84 msgid "Hectogram" msgstr "Hectogramme" #: ../data/units.xml.in.h:85 msgid "Metric Ton (Tonne)" msgstr "Tonne Métrique (Tonne)" #: ../data/units.xml.in.h:86 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "" #: ../data/units.xml.in.h:87 msgid "Grain" msgstr "" #: ../data/units.xml.in.h:88 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:89 msgid "Pennyweight" msgstr "" #: ../data/units.xml.in.h:90 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:91 msgid "Ounce (troy)" msgstr "" #: ../data/units.xml.in.h:92 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:93 msgid "Pound (troy)" msgstr "" #: ../data/units.xml.in.h:94 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:95 msgid "Dram" msgstr "" #: ../data/units.xml.in.h:96 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:97 msgid "Ounce" msgstr "" #: ../data/units.xml.in.h:98 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:99 msgid "Pound" msgstr "" #: ../data/units.xml.in.h:100 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:101 msgid "Short Hundredweight (Cental)" msgstr "" #: ../data/units.xml.in.h:102 msgid "ar:cwt,hundredweight,cental,p:hundredweights,centals" msgstr "" #: ../data/units.xml.in.h:103 msgid "Long Hundredweight" msgstr "" #: ../data/units.xml.in.h:104 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:105 msgid "Short Ton" msgstr "" #: ../data/units.xml.in.h:106 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:107 msgid "Long Ton" msgstr "" #: ../data/units.xml.in.h:108 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:109 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:110 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:111 msgid "Carat" msgstr "" #: ../data/units.xml.in.h:112 msgid "r:carat,p:carats" msgstr "" #: ../data/units.xml.in.h:113 msgid "Pfund" msgstr "" #: ../data/units.xml.in.h:114 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:115 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:116 msgid "r:zentner" msgstr "" #: ../data/units.xml.in.h:118 msgid "Kilogram per Cubic Meter" msgstr "Kilogramme par Mètre Cube" #: ../data/units.xml.in.h:119 msgid "Gram per Cubic Decimeter" msgstr "Gramme par Décimètre Cube" #: ../data/units.xml.in.h:120 msgid "Gram per Cubic Centimeter" msgstr "Gramme par Centimètre Cube" #: ../data/units.xml.in.h:121 msgid "Atomic Mass" msgstr "Masse Atomique" #: ../data/units.xml.in.h:122 msgid "Gram per Mole" msgstr "Gramme par Mole" #: ../data/units.xml.in.h:123 msgid "Atomic Mass Unit" msgstr "Unité de Masse Atomique" #: ../data/units.xml.in.h:124 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "" #: ../data/units.xml.in.h:125 msgid "Dalton" msgstr "" #: ../data/units.xml.in.h:126 msgid "ar:Da,dalton,p:daltons" msgstr "" #: ../data/units.xml.in.h:127 msgid "Kilodalton" msgstr "" #: ../data/units.xml.in.h:128 msgid "Mass Fraction" msgstr "" #: ../data/units.xml.in.h:129 msgid "Kilogram per Kilogram" msgstr "Kilogramme par Kilogramme" #: ../data/units.xml.in.h:132 msgid "ar:s,second,p:seconds" msgstr "" #: ../data/units.xml.in.h:134 msgid "ar:min,minute,p:minutes" msgstr "" #: ../data/units.xml.in.h:136 msgid "ar:h,hour,p:hours" msgstr "" #: ../data/units.xml.in.h:138 msgid "ar:d,day,p:days" msgstr "jour,p:jours" #: ../data/units.xml.in.h:139 msgid "Week" msgstr "Semaine" #: ../data/units.xml.in.h:140 msgid "r:week,p:weeks" msgstr "" #: ../data/units.xml.in.h:141 msgid "Fortnight" msgstr "" #: ../data/units.xml.in.h:142 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:143 msgid "Julian Year" msgstr "" #: ../data/units.xml.in.h:144 msgid "r:year,p:years" msgstr "" #: ../data/units.xml.in.h:146 #, fuzzy msgid "r:month,p:months" msgstr "mois" #. Unit category #: ../data/units.xml.in.h:148 msgid "!units!Frequency" msgstr "Fréquence" #: ../data/units.xml.in.h:149 msgid "Hertz" msgstr "" #: ../data/units.xml.in.h:150 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:151 msgid "Electricity" msgstr "Électricité" #: ../data/units.xml.in.h:152 msgid "Electric Current" msgstr "Courant Électrique" #: ../data/units.xml.in.h:153 msgid "Ampere" msgstr "Ampère" #: ../data/units.xml.in.h:154 msgid "ar:A,ampere,p:amperes" msgstr "ampère,p:ampères" #: ../data/units.xml.in.h:155 msgid "Abampere" msgstr "" #: ../data/units.xml.in.h:156 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:157 msgid "Current Density" msgstr "Densité de Courant" #: ../data/units.xml.in.h:158 msgid "Ampere per Meter Squared" msgstr "Ampère par mètre Carré" #: ../data/units.xml.in.h:159 msgid "Electric Charge" msgstr "Charge Électrique" #: ../data/units.xml.in.h:160 msgid "Second Ampere" msgstr "Ampère Seconde" #: ../data/units.xml.in.h:161 msgid "Coulomb" msgstr "" #: ../data/units.xml.in.h:162 msgid "ar:C,coulomb,p:coulombs" msgstr "" #: ../data/units.xml.in.h:163 msgid "Abcoulomb" msgstr "" #: ../data/units.xml.in.h:164 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:165 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:166 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:167 msgid "Electric Charge Density" msgstr "Densité de Charge Électrique" #: ../data/units.xml.in.h:168 msgid "Coulomb per Cubic Meter" msgstr "Coulomb par Mètre Cube" #: ../data/units.xml.in.h:169 msgid "Electric Flux Density" msgstr "" #: ../data/units.xml.in.h:170 msgid "Coulomb per Meter Squared" msgstr "Coulomb par Mètre Carré" #: ../data/units.xml.in.h:171 msgid "Electric Potential" msgstr "Potentiel Électrique" #: ../data/units.xml.in.h:172 msgid "Watt per Ampere" msgstr "Watt par Ampère" #: ../data/units.xml.in.h:173 msgid "Volt" msgstr "" #: ../data/units.xml.in.h:174 msgid "ar:V,volt,p:volts" msgstr "" #: ../data/units.xml.in.h:175 msgid "Statvolt" msgstr "" #: ../data/units.xml.in.h:176 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:177 msgid "Abvolt" msgstr "" #: ../data/units.xml.in.h:178 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:179 msgid "Capacitance" msgstr "" #: ../data/units.xml.in.h:180 msgid "Coulomb per Volt" msgstr "Coulomb par Volt" #: ../data/units.xml.in.h:181 msgid "Farad" msgstr "" #: ../data/units.xml.in.h:182 msgid "ar:F,farad,p:farads" msgstr "" #: ../data/units.xml.in.h:183 msgid "Electric Resistance" msgstr "Résistance Électrique" #: ../data/units.xml.in.h:184 msgid "Volt per Ampere" msgstr "Volt par Ampère" #: ../data/units.xml.in.h:185 msgid "Ohm" msgstr "" #: ../data/units.xml.in.h:186 msgid "au:Ω,r:ohm,p:ohms" msgstr "" #: ../data/units.xml.in.h:187 msgid "Abohm" msgstr "" #: ../data/units.xml.in.h:188 msgid "r:abohm,p:abohms,au:abΩ" msgstr "" #: ../data/units.xml.in.h:189 msgid "Statohm" msgstr "" #: ../data/units.xml.in.h:190 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:191 msgid "Electric Conductance" msgstr "Conductance Électrique" #: ../data/units.xml.in.h:192 msgid "Ampere per Volt" msgstr "Ampère par Volt" #: ../data/units.xml.in.h:193 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:194 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:195 msgid "Electric Field Strength" msgstr "" #: ../data/units.xml.in.h:196 msgid "Volt per Meter" msgstr "Volt par Mètre" #: ../data/units.xml.in.h:197 msgid "Permittivity" msgstr "Permittivité" #: ../data/units.xml.in.h:198 msgid "Farad per Meter" msgstr "Farad par mètre" #: ../data/units.xml.in.h:199 msgid "Inductance" msgstr "" #: ../data/units.xml.in.h:200 msgid "Weber per Ampere" msgstr "" #: ../data/units.xml.in.h:201 msgid "Henry" msgstr "" #: ../data/units.xml.in.h:202 msgid "ar:H,henry,p:henrys" msgstr "" #: ../data/units.xml.in.h:203 msgid "Permeability" msgstr "" #: ../data/units.xml.in.h:204 msgid "Henry per Meter" msgstr "Henry par Mètre" #: ../data/units.xml.in.h:205 msgid "Temperature" msgstr "Température" #: ../data/units.xml.in.h:206 msgid "Kelvin" msgstr "" #: ../data/units.xml.in.h:207 msgid "ar:K,kelvin,p:kelvins" msgstr "" #: ../data/units.xml.in.h:208 msgid "Degree Celsius" msgstr "Degré Celsius" #: ../data/units.xml.in.h:209 msgid "" "ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades" msgstr "" #: ../data/units.xml.in.h:210 msgid "Degree Rankine" msgstr "Degrés Rankine" #: ../data/units.xml.in.h:211 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:212 msgid "Degree Fahrenheit" msgstr "Degrés Fahrenheit" #: ../data/units.xml.in.h:213 msgid "ar:oF,au:°F,au:℉,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:214 msgid "Substance" msgstr "" #: ../data/units.xml.in.h:215 msgid "Mole" msgstr "Mole" #: ../data/units.xml.in.h:216 msgid "ar:mol,mole,p:moles" msgstr "" #: ../data/units.xml.in.h:217 msgid "Einstein" msgstr "" #: ../data/units.xml.in.h:218 msgid "r:einstein,p:einsteins" msgstr "" #: ../data/units.xml.in.h:219 msgid "Substance Concentration" msgstr "" #: ../data/units.xml.in.h:220 msgid "Mole per Cubic Meter" msgstr "Mole par Mètre Cube" #: ../data/units.xml.in.h:221 msgid "Catalytic Activity" msgstr "Activité Catalytique" #: ../data/units.xml.in.h:222 msgid "Reciprocal Seconds Mole" msgstr "" #: ../data/units.xml.in.h:223 msgid "Katal" msgstr "" #: ../data/units.xml.in.h:224 msgid "ar:kat,katal,p:katals" msgstr "" #: ../data/units.xml.in.h:225 msgid "Catalytic Concentration" msgstr "Concentration Catalytique" #: ../data/units.xml.in.h:226 msgid "Katal per Cubic Meter" msgstr "" #: ../data/units.xml.in.h:227 msgid "Light" msgstr "Lumière" #: ../data/units.xml.in.h:228 msgid "Luminous Intensity" msgstr "Intensité Lumineuse" #: ../data/units.xml.in.h:229 msgid "Candela" msgstr "" #: ../data/units.xml.in.h:230 msgid "ar:cd,candela,p:candelas" msgstr "" #: ../data/units.xml.in.h:231 msgid "Luminance" msgstr "" #: ../data/units.xml.in.h:232 msgid "Candela per Meter Squared" msgstr "Candela par mètre carré" #: ../data/units.xml.in.h:233 msgid "Stilb" msgstr "" #: ../data/units.xml.in.h:234 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:235 msgid "Luminous Flux" msgstr "Flux Lumineux" #: ../data/units.xml.in.h:236 msgid "Candela Steradian" msgstr "" #: ../data/units.xml.in.h:237 msgid "Lumen" msgstr "" #: ../data/units.xml.in.h:238 msgid "ar:lm,lumen,p:lumens" msgstr "" #: ../data/units.xml.in.h:239 msgid "Illuminance" msgstr "" #: ../data/units.xml.in.h:240 msgid "Lumen per Meter Squared" msgstr "" #: ../data/units.xml.in.h:241 msgid "Lumen per Foot Squared" msgstr "" #: ../data/units.xml.in.h:242 msgid "Lux" msgstr "" #: ../data/units.xml.in.h:243 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:244 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:245 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:246 msgid "Phot" msgstr "" #: ../data/units.xml.in.h:247 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:248 msgid "Radiant Intensity" msgstr "" #: ../data/units.xml.in.h:249 msgid "Watt per Steradian" msgstr "Watt par Stéradian" #: ../data/units.xml.in.h:250 msgid "Irradiance" msgstr "" #: ../data/units.xml.in.h:251 msgid "Watt per Meter Squared" msgstr "Watt par Mètre Carré" #: ../data/units.xml.in.h:252 msgid "Einstein per Meter Squared per Second" msgstr "Einstein par Mètre Carré par Seconde" #: ../data/units.xml.in.h:253 msgid "Microeinstein per Meter Squared per Second" msgstr "Microeinstein par Mètre Carré par Seconde" #: ../data/units.xml.in.h:254 msgid "Radiance" msgstr "" #: ../data/units.xml.in.h:255 msgid "Watt per Square Meter Steradian" msgstr "Watt par Mètre Carré Stéradian" #: ../data/units.xml.in.h:256 msgid "Area" msgstr "Aire" #: ../data/units.xml.in.h:257 msgid "Square Meter" msgstr "Mètre Carré" #: ../data/units.xml.in.h:258 msgid "Square Kilometer" msgstr "Kilomètre Carré" #: ../data/units.xml.in.h:259 msgid "Are" msgstr "" #: ../data/units.xml.in.h:260 msgid "ar:a,are,p:ares" msgstr "" #: ../data/units.xml.in.h:261 msgid "Hectare" msgstr "" #: ../data/units.xml.in.h:262 msgid "Barn" msgstr "" #: ../data/units.xml.in.h:263 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:264 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:265 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:266 msgid "Acre" msgstr "" #: ../data/units.xml.in.h:267 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:268 msgid "Section" msgstr "" #: ../data/units.xml.in.h:269 msgid "r:section,p:sections" msgstr "" #: ../data/units.xml.in.h:270 msgid "Township" msgstr "" #: ../data/units.xml.in.h:271 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:272 msgid "Square Foot" msgstr "Pied Carré" #: ../data/units.xml.in.h:273 msgid "Square Inch" msgstr "Pouce Carré" #: ../data/units.xml.in.h:274 msgid "Square Mile" msgstr "Mile Carrée" #: ../data/units.xml.in.h:275 msgid "Volume" msgstr "" #: ../data/units.xml.in.h:276 msgid "Cubic Meter" msgstr "Mètre Cube" #: ../data/units.xml.in.h:277 msgid "Liter" msgstr "Litre" #: ../data/units.xml.in.h:278 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "litre,p:litres" #: ../data/units.xml.in.h:279 msgid "Milliliter" msgstr "Millilitre" #: ../data/units.xml.in.h:280 msgid "Centiliter" msgstr "Centilitre" #: ../data/units.xml.in.h:281 msgid "Deciliter" msgstr "Décilitre" #: ../data/units.xml.in.h:282 msgid "Cubic Inch" msgstr "Pouce Cube" #: ../data/units.xml.in.h:283 msgid "Fuel Economy" msgstr "" #: ../data/units.xml.in.h:284 msgid "Liter per Kilometer" msgstr "Litre par Kilomètre" #: ../data/units.xml.in.h:285 msgid "Kilometer per Liter" msgstr "Kilomètre par Litre" #: ../data/units.xml.in.h:286 msgid "Miles per Gallon" msgstr "Miles par Gallon" #: ../data/units.xml.in.h:287 msgid "a-cr:mpg" msgstr "" #: ../data/units.xml.in.h:288 msgid "Cooking" msgstr "Cuisine" #: ../data/units.xml.in.h:289 msgid "Teaspoon" msgstr "" #: ../data/units.xml.in.h:290 msgid "r:teaspoon,p:teaspoons" msgstr "" #: ../data/units.xml.in.h:291 msgid "Dessertspoon" msgstr "Cuillère à Dessert" #: ../data/units.xml.in.h:292 msgid "r:dessertspoon,p:dessertspoons" msgstr "" #: ../data/units.xml.in.h:293 msgid "Tablespoon" msgstr "" #: ../data/units.xml.in.h:294 msgid "r:tablespoon,p:tablespoons" msgstr "" #: ../data/units.xml.in.h:295 msgid "Cup (U.S.)" msgstr "" #: ../data/units.xml.in.h:296 msgid "r:cup,p:cups" msgstr "" #: ../data/units.xml.in.h:297 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:298 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:299 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:300 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:301 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:302 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:303 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:304 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:305 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:306 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:307 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:308 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:309 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:310 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:311 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:312 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:313 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:314 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:315 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:316 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:317 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:318 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:319 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:320 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:321 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:322 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:323 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:324 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:325 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:326 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:327 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:328 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:329 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:330 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:331 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:332 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:333 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:334 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:335 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:336 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:337 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:338 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:339 msgid "U.S. Barrel (oil)" msgstr "" #: ../data/units.xml.in.h:340 msgid "ar:bbl,barrel,p:barrels" msgstr "" #: ../data/units.xml.in.h:341 msgid "Specific Volume" msgstr "" #: ../data/units.xml.in.h:342 msgid "Cubic Meter per Kilogram" msgstr "Mètre Cube par Kilogramme" #: ../data/units.xml.in.h:343 msgid "Speed" msgstr "Vitesse" #: ../data/units.xml.in.h:344 msgid "Meter per Second" msgstr "Mètre par Seconde" #: ../data/units.xml.in.h:345 msgid "Kilometer per Hour" msgstr "Kilomètre par Heure" #: ../data/units.xml.in.h:346 msgid "Nautical Mile per Hour" msgstr "" #: ../data/units.xml.in.h:347 msgid "Knot" msgstr "Noeud" #: ../data/units.xml.in.h:348 msgid "r:knot,p:knots" msgstr "" #: ../data/units.xml.in.h:349 msgid "Miles per Hour" msgstr "Miles par Heure" #: ../data/units.xml.in.h:350 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:351 msgid "Acceleration" msgstr "Accélération" #: ../data/units.xml.in.h:352 msgid "Meter per Second Squared" msgstr "Mètre par Seconde Carrée" #: ../data/units.xml.in.h:353 msgid "Galileo" msgstr "" #: ../data/units.xml.in.h:354 msgid "ar:Gal,galileo,p:galileos" msgstr "" #: ../data/units.xml.in.h:355 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:356 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:357 msgid "Magnetism" msgstr "Magnétisme" #: ../data/units.xml.in.h:358 msgid "Wave Number" msgstr "" #: ../data/units.xml.in.h:359 msgid "Reciprocal Meter" msgstr "" #: ../data/units.xml.in.h:360 msgid "Magnetic Field Strength" msgstr "" #: ../data/units.xml.in.h:361 msgid "Ampere per Meter" msgstr "Ampère par mètre" #: ../data/units.xml.in.h:362 msgid "Oersted" msgstr "" #: ../data/units.xml.in.h:363 msgid "ar:Oe,oersted,p:oersteds" msgstr "" #: ../data/units.xml.in.h:364 msgid "Magnetic Flux" msgstr "Flux Magnétique" #: ../data/units.xml.in.h:365 msgid "Volt Seconds" msgstr "Volt Seconde" #: ../data/units.xml.in.h:366 msgid "Weber" msgstr "" #: ../data/units.xml.in.h:367 msgid "ar:Wb,weber,p:webers" msgstr "" #: ../data/units.xml.in.h:368 msgid "Maxwell" msgstr "" #: ../data/units.xml.in.h:369 msgid "ar:Mx,maxwell,p:maxwells" msgstr "" #: ../data/units.xml.in.h:370 msgid "Magnetic Flux Density" msgstr "Densité de Flux Magnétique" #: ../data/units.xml.in.h:371 msgid "Weber per Meter Squared" msgstr "" #: ../data/units.xml.in.h:372 msgid "Tesla" msgstr "" #: ../data/units.xml.in.h:373 msgid "ar:T,tesla,p:teslas" msgstr "" #: ../data/units.xml.in.h:374 msgid "Gauss" msgstr "" #: ../data/units.xml.in.h:375 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:376 msgid "Force" msgstr "" #: ../data/units.xml.in.h:377 msgid "Meter Kilogram per Second Squared" msgstr "Mètre Kilogramme par Seconde Carrée" #: ../data/units.xml.in.h:378 msgid "Newton" msgstr "" #: ../data/units.xml.in.h:379 msgid "ar:N,newton,p:newtons" msgstr "" #: ../data/units.xml.in.h:380 msgid "Dyne" msgstr "" #: ../data/units.xml.in.h:381 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:382 msgid "Pound-force" msgstr "" #: ../data/units.xml.in.h:383 msgid "ar:lbf,pound_force" msgstr "" #: ../data/units.xml.in.h:384 msgid "Pound Foot per Second Squared" msgstr "" #: ../data/units.xml.in.h:385 msgid "Poundal" msgstr "" #: ../data/units.xml.in.h:386 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:387 msgid "Pond (Gram-Force)" msgstr "" #: ../data/units.xml.in.h:388 msgid "r:pond,p:ponds,a:gf" msgstr "" #: ../data/units.xml.in.h:389 msgid "Kilopond (Kilogram-Force)" msgstr "" #: ../data/units.xml.in.h:390 msgid "Moment of Force" msgstr "Moment de Force" #: ../data/units.xml.in.h:391 msgid "Newton Meter" msgstr "Newton Mètre" #: ../data/units.xml.in.h:392 msgid "Pressure" msgstr "Pression" #: ../data/units.xml.in.h:393 msgid "Newton per Meter Squared" msgstr "Newton par Mètre Carré" #: ../data/units.xml.in.h:394 msgid "Pound-force per Square Inch" msgstr "" #: ../data/units.xml.in.h:395 msgid "Pascal" msgstr "" #: ../data/units.xml.in.h:396 msgid "ar:Pa,pascal,p:pascals" msgstr "" #: ../data/units.xml.in.h:397 msgid "Pound-force per Square Inch (psi)" msgstr "" #: ../data/units.xml.in.h:398 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:399 msgid "Bar" msgstr "" #: ../data/units.xml.in.h:400 msgid "r:bar,p:bars" msgstr "" #: ../data/units.xml.in.h:401 msgid "Atmosphere" msgstr "Atmosphère" #: ../data/units.xml.in.h:402 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "atmosphère,p:atmosphères" #: ../data/units.xml.in.h:403 msgid "Torr" msgstr "" #: ../data/units.xml.in.h:404 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:405 msgid "Millimeter of Mercury" msgstr "Millimètre de Mercure" #: ../data/units.xml.in.h:406 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:407 #, fuzzy msgid "Inch of Mercury" msgstr "Millimètre de Mercure" #: ../data/units.xml.in.h:408 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:409 msgid "Dynamic Viscosity" msgstr "Viscosité Dynamique" #: ../data/units.xml.in.h:410 msgid "Pascal Second" msgstr "Pascal Seconde" #: ../data/units.xml.in.h:411 msgid "Poise" msgstr "" #: ../data/units.xml.in.h:412 msgid "ar:P,poise,p:poises" msgstr "" #: ../data/units.xml.in.h:413 msgid "Kinematic Viscosity" msgstr "" #: ../data/units.xml.in.h:414 msgid "Square Meter per Second" msgstr "Mètre Carré par Seconde" #: ../data/units.xml.in.h:415 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:416 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:417 msgid "Surface Tension" msgstr "" #: ../data/units.xml.in.h:418 msgid "Newton per Meter" msgstr "Newton par Mètre" #: ../data/units.xml.in.h:419 msgid "Energy" msgstr "Énergie" #: ../data/units.xml.in.h:420 msgid "Joule" msgstr "" #: ../data/units.xml.in.h:421 msgid "ar:J,joule,p:joules" msgstr "" #: ../data/units.xml.in.h:422 msgid "Watt Hour" msgstr "Watt Heure" #: ../data/units.xml.in.h:423 msgid "Kilowatt Hour" msgstr "Kilowatt Heure" #: ../data/units.xml.in.h:424 msgid "Calorie (international table)" msgstr "" #: ../data/units.xml.in.h:425 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "" #: ../data/units.xml.in.h:426 msgid "Calorie (capital C)" msgstr "" #: ../data/units.xml.in.h:427 msgid "cr:Calorie,cp:Calories" msgstr "" #: ../data/units.xml.in.h:428 msgid "Calorie (thermochemical)" msgstr "" #: ../data/units.xml.in.h:429 msgid "ars:cal_th" msgstr "" #: ../data/units.xml.in.h:430 msgid "Gram of TNT" msgstr "" #: ../data/units.xml.in.h:431 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:432 msgid "Ton of TNT" msgstr "" #: ../data/units.xml.in.h:433 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:434 msgid "Calorie (15 degrees Celsius)" msgstr "Calorie (15°C)" #: ../data/units.xml.in.h:435 msgid "ars:cal_fifteen" msgstr "" #: ../data/units.xml.in.h:436 msgid "Calorie (mean)" msgstr "Calorie (moyenne)" #: ../data/units.xml.in.h:437 msgid "ars:cal_mean" msgstr "" #: ../data/units.xml.in.h:438 msgid "British Thermal Unit (IT)" msgstr "" #: ../data/units.xml.in.h:439 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:440 msgid "Electron Volt" msgstr "Électron Volt" #: ../data/units.xml.in.h:441 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "" #: ../data/units.xml.in.h:442 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:443 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:444 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:445 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:446 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:447 msgid "Hartree" msgstr "" #: ../data/units.xml.in.h:448 msgid "ar:Ha,as:E_h,hartree" msgstr "" #: ../data/units.xml.in.h:449 msgid "Rydberg" msgstr "" #: ../data/units.xml.in.h:450 msgid "ar:Ry,s:rydberg_unit" msgstr "" #: ../data/units.xml.in.h:451 msgid "Specific Energy" msgstr "" #: ../data/units.xml.in.h:452 msgid "Joule per Kilogram" msgstr "Joule par Kilogramme" #: ../data/units.xml.in.h:453 msgid "Power" msgstr "Puissance" #: ../data/units.xml.in.h:454 msgid "Joule per Second" msgstr "Joule par Seconde" #: ../data/units.xml.in.h:455 msgid "Watt" msgstr "" #: ../data/units.xml.in.h:456 msgid "ar:W,watt,p:watts" msgstr "" #: ../data/units.xml.in.h:457 msgid "Horse Power" msgstr "" #: ../data/units.xml.in.h:458 msgid "ar:hp,horsepower,p:horsepowers" msgstr "" #: ../data/units.xml.in.h:459 msgid "Pferdestärke" msgstr "" #: ../data/units.xml.in.h:460 msgid "ar:PS,u:pferdestärke" msgstr "" #: ../data/units.xml.in.h:461 msgid "Entropy" msgstr "Entropie" #: ../data/units.xml.in.h:462 msgid "Joule per Kelvin" msgstr "Joule par Kelvin" #: ../data/units.xml.in.h:463 msgid "Specific Entropy" msgstr "" #: ../data/units.xml.in.h:464 msgid "Joule per Kilogram Kelvin" msgstr "Joule par Kilogramme Kelvin" #: ../data/units.xml.in.h:465 msgid "Thermal Conductivity" msgstr "Conductivité Thermique" #: ../data/units.xml.in.h:466 msgid "Watt per Meter Kelvin" msgstr "Watt par Mètre Kelvin" #: ../data/units.xml.in.h:467 msgid "Energy Density" msgstr "Densité d'Énergie" #: ../data/units.xml.in.h:468 msgid "Joule per Cubic Meter" msgstr "Joule par Mètre Cube" #: ../data/units.xml.in.h:469 msgid "Molar Energy" msgstr "Énergie Molaire" #: ../data/units.xml.in.h:470 msgid "Joule per Mole" msgstr "Joule par Mole" #: ../data/units.xml.in.h:471 msgid "Molar Entropy" msgstr "Entropie Molaire" #: ../data/units.xml.in.h:472 msgid "Joule per Mole Kelvin" msgstr "Joule par Mole Kelvin" #: ../data/units.xml.in.h:473 msgid "Radioactivity" msgstr "Radioactivité" #: ../data/units.xml.in.h:474 msgid "Becquerel" msgstr "" #: ../data/units.xml.in.h:475 msgid "ar:Bq,becquerel,p:becquerels" msgstr "" #: ../data/units.xml.in.h:476 msgid "Curie" msgstr "" #: ../data/units.xml.in.h:477 msgid "ar:Ci,curie,p:curies" msgstr "" #: ../data/units.xml.in.h:478 msgid "Absorbed Dose" msgstr "Dose Absorbée" #: ../data/units.xml.in.h:479 msgid "Gray" msgstr "" #: ../data/units.xml.in.h:480 msgid "ar:Gy,gray,p:grays" msgstr "" #: ../data/units.xml.in.h:481 msgid "Rad" msgstr "" #: ../data/units.xml.in.h:482 msgid "r:rad_radioactivity" msgstr "" #: ../data/units.xml.in.h:483 msgid "Dose Equivalent" msgstr "" #: ../data/units.xml.in.h:484 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:485 msgid "ar:Sv,sievert,p:sieverts" msgstr "" #: ../data/units.xml.in.h:486 msgid "Rem" msgstr "" #: ../data/units.xml.in.h:487 msgid "r:rem_radioactivity" msgstr "" #: ../data/units.xml.in.h:488 msgid "Exposure" msgstr "" #: ../data/units.xml.in.h:489 msgid "Coulomb per Kilogram" msgstr "Coulomb par Kilogramme" #: ../data/units.xml.in.h:490 msgid "Roentgen" msgstr "" #: ../data/units.xml.in.h:491 msgid "ar:R,roentgen,p:roentgens" msgstr "" #: ../data/units.xml.in.h:492 msgid "Absorbed Dose Rate" msgstr "" #: ../data/units.xml.in.h:493 msgid "Gray per Second" msgstr "Gray par Seconde" #: ../data/units.xml.in.h:494 msgid "Ratio" msgstr "" #: ../data/units.xml.in.h:495 msgid "Neper" msgstr "" #: ../data/units.xml.in.h:496 msgid "ar:Np,neper,p:nepers" msgstr "" #: ../data/units.xml.in.h:497 msgid "Bel" msgstr "" #: ../data/units.xml.in.h:498 msgid "ar:B,bel,p:bels" msgstr "" #: ../data/units.xml.in.h:499 msgid "Decibel" msgstr "Décibel" #: ../data/units.xml.in.h:500 msgid "Information" msgstr "" #: ../data/units.xml.in.h:501 msgid "Bit" msgstr "" #: ../data/units.xml.in.h:502 msgid "r:bit,p:bits" msgstr "" #: ../data/units.xml.in.h:503 msgid "Byte (8-bit)" msgstr "Octet (8 bits)" #: ../data/units.xml.in.h:504 msgid "r:byte,p:bytes,octet,p:octets" msgstr "" #: ../data/units.xml.in.h:505 msgid "Nibble" msgstr "" #: ../data/units.xml.in.h:506 msgid "r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets" msgstr "" #: ../data/units.xml.in.h:507 msgid "Tribble" msgstr "" #: ../data/units.xml.in.h:508 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:509 msgid "Word (16-bit)" msgstr "Mot (16 bits)" #: ../data/units.xml.in.h:510 msgid "r:word,p:words" msgstr "" #: ../data/units.xml.in.h:511 msgid "Kilobyte" msgstr "Kiloctet" #: ../data/units.xml.in.h:512 msgid "Kibibyte" msgstr "Kibioctet" #: ../data/units.xml.in.h:513 msgid "Mebibyte" msgstr "Mébioctet" #: ../data/units.xml.in.h:514 msgid "Gibibyte" msgstr "Gibioctet" #: ../data/units.xml.in.h:515 msgid "Megabyte" msgstr "Mégaoctet" #: ../data/units.xml.in.h:516 msgid "Gigabyte" msgstr "Gigaoctet" #: ../data/units.xml.in.h:517 msgid "Terabyte" msgstr "Téraoctet" #: ../data/units.xml.in.h:518 msgid "Kilobit" msgstr "" #: ../data/units.xml.in.h:519 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:520 msgid "Mebibit" msgstr "Mébibit" #: ../data/units.xml.in.h:521 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:522 msgid "Megabit" msgstr "Mégabit" #: ../data/units.xml.in.h:523 msgid "Gigabit" msgstr "" #: ../data/units.xml.in.h:524 msgid "Terabit" msgstr "Térabit" #: ../data/units.xml.in.h:525 msgid "Typography" msgstr "" #: ../data/units.xml.in.h:526 msgid "PostScript Point" msgstr "" #: ../data/units.xml.in.h:527 msgid "ar:pt,a:pts,point,p:points" msgstr "" #: ../data/units.xml.in.h:528 msgid "PostScript Pica" msgstr "" #: ../data/units.xml.in.h:529 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:530 msgid "ATA Pica" msgstr "" #: ../data/units.xml.in.h:531 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:532 msgid "ATA Point" msgstr "" #: ../data/units.xml.in.h:533 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:534 msgid "New Didot Point" msgstr "" #: ../data/units.xml.in.h:535 msgid "r:new_didot" msgstr "" #: ../data/units.xml.in.h:536 msgid "Didot Point" msgstr "" #: ../data/units.xml.in.h:537 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:538 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:539 #, fuzzy msgid "r:cicero" msgstr "cercle" #: ../data/variables.xml.in.h:1 msgid "Small Numbers" msgstr "" #: ../data/variables.xml.in.h:2 msgid "Per Mille" msgstr "" #: ../data/variables.xml.in.h:3 msgid "r:permille,au:‰" msgstr "pourmille,au:‰" #: ../data/variables.xml.in.h:4 msgid "Per Myriad" msgstr "" #: ../data/variables.xml.in.h:5 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:6 msgid "Percent" msgstr "" #: ../data/variables.xml.in.h:8 #, no-c-format msgid "a:%,r:percent" msgstr "a:%,pourcent" #: ../data/variables.xml.in.h:9 msgid "Large Numbers" msgstr "Grands Nombres" #: ../data/variables.xml.in.h:10 msgid "Googolplex" msgstr "" #: ../data/variables.xml.in.h:11 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:12 msgid "Googol" msgstr "" #: ../data/variables.xml.in.h:13 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:14 msgid "Centillion" msgstr "" #: ../data/variables.xml.in.h:15 msgid "-r:centillion" msgstr "" #: ../data/variables.xml.in.h:16 msgid "Vigintillion" msgstr "" #: ../data/variables.xml.in.h:17 msgid "-r:vigintillion" msgstr "" #: ../data/variables.xml.in.h:18 msgid "Novemdecillion" msgstr "" #: ../data/variables.xml.in.h:19 msgid "-r:novemdecillion" msgstr "" #: ../data/variables.xml.in.h:20 msgid "Octodecillion" msgstr "" #: ../data/variables.xml.in.h:21 msgid "-r:octodecillion" msgstr "" #: ../data/variables.xml.in.h:22 msgid "Septendecillion" msgstr "" #: ../data/variables.xml.in.h:23 msgid "-r:septendecillion" msgstr "" #: ../data/variables.xml.in.h:24 msgid "Sexdecillion" msgstr "" #: ../data/variables.xml.in.h:25 msgid "-r:sexdecillion" msgstr "" #: ../data/variables.xml.in.h:26 msgid "Quindecillion" msgstr "" #: ../data/variables.xml.in.h:27 msgid "-r:quindecillion" msgstr "" #: ../data/variables.xml.in.h:28 msgid "Quattuordecillion" msgstr "" #: ../data/variables.xml.in.h:29 msgid "-r:quattuordecillion" msgstr "" #: ../data/variables.xml.in.h:30 msgid "Tredecillion" msgstr "" #: ../data/variables.xml.in.h:31 msgid "-r:tredecillion" msgstr "" #: ../data/variables.xml.in.h:32 msgid "Duodecillion" msgstr "" #: ../data/variables.xml.in.h:33 msgid "-r:duodecillion" msgstr "" #: ../data/variables.xml.in.h:34 msgid "Undecillion" msgstr "" #: ../data/variables.xml.in.h:35 msgid "-r:undecillion" msgstr "" #: ../data/variables.xml.in.h:36 msgid "Decillion" msgstr "" #: ../data/variables.xml.in.h:37 msgid "-r:decillion" msgstr "" #: ../data/variables.xml.in.h:38 msgid "Nonillion" msgstr "" #: ../data/variables.xml.in.h:39 msgid "-r:nonillion" msgstr "" #: ../data/variables.xml.in.h:40 msgid "Octillion" msgstr "" #: ../data/variables.xml.in.h:41 msgid "-r:octillion" msgstr "" #: ../data/variables.xml.in.h:42 msgid "Septillion" msgstr "" #: ../data/variables.xml.in.h:43 msgid "-r:septillion" msgstr "" #: ../data/variables.xml.in.h:44 msgid "Sextillion" msgstr "" #: ../data/variables.xml.in.h:45 msgid "-r:sextillion" msgstr "" #: ../data/variables.xml.in.h:46 msgid "Quintillion" msgstr "" #: ../data/variables.xml.in.h:47 msgid "-r:quintillion" msgstr "" #: ../data/variables.xml.in.h:48 msgid "Quadrillion" msgstr "" #: ../data/variables.xml.in.h:49 msgid "-r:quadrillion" msgstr "" #: ../data/variables.xml.in.h:50 msgid "Trillion" msgstr "" #: ../data/variables.xml.in.h:51 msgid "-r:trillion" msgstr "" #: ../data/variables.xml.in.h:52 msgid "Billion" msgstr "Milliard" #: ../data/variables.xml.in.h:53 msgid "-r:billion" msgstr "" #: ../data/variables.xml.in.h:54 msgid "Million" msgstr "Million" #: ../data/variables.xml.in.h:55 msgid "-r:million" msgstr "" #: ../data/variables.xml.in.h:56 msgid "Thousand" msgstr "" #: ../data/variables.xml.in.h:57 msgid "-r:thousand" msgstr "" #: ../data/variables.xml.in.h:58 msgid "Hundred" msgstr "" #: ../data/variables.xml.in.h:59 msgid "-r:hundred" msgstr "" #: ../data/variables.xml.in.h:60 msgid "Physical Constants" msgstr "Constantes Physiques" #: ../data/variables.xml.in.h:61 msgid "Universal Constants" msgstr "Constantes Universelles" #: ../data/variables.xml.in.h:62 msgid "Speed of Light in Vacuum" msgstr "Vitesse de la Lumière dans le Vide" #: ../data/variables.xml.in.h:63 msgid "ar:c,speed_of_light" msgstr "a:c,vitesse_de_la_lumière" #: ../data/variables.xml.in.h:64 msgid "Planck Time" msgstr "Temps de Planck" #: ../data/variables.xml.in.h:65 msgid "r:planck_time,ais:t_P" msgstr "" #: ../data/variables.xml.in.h:66 msgid "Planck Temperature" msgstr "Température de Planck" #: ../data/variables.xml.in.h:67 msgid "r:planck_temperature,ais:T_P" msgstr "température_de_planck,ais:T_P" #: ../data/variables.xml.in.h:68 msgid "Planck Mass" msgstr "Masse de Planck" #: ../data/variables.xml.in.h:69 msgid "r:planck_mass,ais:m_P" msgstr "masse_de_planck,ais:m_P" #: ../data/variables.xml.in.h:70 msgid "Planck Length" msgstr "Longueur de Planck" #: ../data/variables.xml.in.h:71 msgid "r:planck_length,ais:l_P" msgstr "longueur_de_planck,ais:l_P" #: ../data/variables.xml.in.h:72 msgid "Planck Constant" msgstr "Constantes de Planck" #: ../data/variables.xml.in.h:73 #, fuzzy msgid "r:planck,au:ℎ" msgstr "pourmille,au:‰" #: ../data/variables.xml.in.h:74 msgid "Planck Constant over 2 pi" msgstr "Constante de Planck sur 2 pi" #: ../data/variables.xml.in.h:75 #, fuzzy msgid "r:planck2pi,au:ℏ" msgstr "pourmille,au:‰" #: ../data/variables.xml.in.h:76 msgid "Newtonian Constant of Gravitation" msgstr "Constante de la Gravitation de Newton" #: ../data/variables.xml.in.h:77 msgid "r:newtonian_constant,a:G" msgstr "constante_de_newton,a:G" #: ../data/variables.xml.in.h:78 msgid "Electric Constant (Permittivity of Free Space)" msgstr "Constante Électrique (Permittivité du Vide)" #: ../data/variables.xml.in.h:79 msgid "r:electric_constant,asu:ε_0,vacuum_permittivity,aos:epsilon_0" msgstr "" #: ../data/variables.xml.in.h:80 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "Constante Magnétique (Perméabilité du Vide)" #: ../data/variables.xml.in.h:81 msgid "r:magnetic_constant,asu:μ_0,vacuum_permeability,aos:mu_0" msgstr "" #: ../data/variables.xml.in.h:82 msgid "Characteristic Impedance of Vacuum" msgstr "" #: ../data/variables.xml.in.h:83 msgid "r:characteristic_impedance,ais:Z_0" msgstr "impédance_caractéristique,ais:Z_0" #: ../data/variables.xml.in.h:84 msgid "Electromagnetic Constants" msgstr "Constantes Électromagnétiques" #: ../data/variables.xml.in.h:85 msgid "Bohr Magneton" msgstr "" #: ../data/variables.xml.in.h:86 #, fuzzy msgid "r:bohr_magneton,asu:μ_B,aos:mu_B" msgstr "magnéton_de_bohr,aisu:μ_B" #: ../data/variables.xml.in.h:87 msgid "Conductance Quantum" msgstr "" #: ../data/variables.xml.in.h:88 msgid "r:conductance_quantum,ais:G_0" msgstr "" #: ../data/variables.xml.in.h:89 msgid "Elementary Charge" msgstr "Charge Élémentaire" #: ../data/variables.xml.in.h:90 msgid "r:elementary_charge,ais:e_charge" msgstr "charge_élémentaire,ais:e_charge" #: ../data/variables.xml.in.h:91 msgid "Josephson Constant" msgstr "" #: ../data/variables.xml.in.h:92 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:93 msgid "Magnetic Flux Quantum" msgstr "" #: ../data/variables.xml.in.h:94 msgid "r:magnetic_flux_quantum,asu:Φ_0,aos:phi_0" msgstr "" #: ../data/variables.xml.in.h:95 msgid "Nuclear Magneton" msgstr "" #: ../data/variables.xml.in.h:96 #, fuzzy msgid "r:nuclear_magneton,asu:μ_N,aos:mu_N" msgstr "magnéton_de_bohr,aisu:μ_B" #: ../data/variables.xml.in.h:97 msgid "von Klitzing Constant" msgstr "Constante de von Klitzing" #: ../data/variables.xml.in.h:98 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:99 msgid "Atomic and Nuclear Constants" msgstr "Constantes Atomiques et Nucléaires" #: ../data/variables.xml.in.h:100 msgid "Alpha Particle Mass" msgstr "" #: ../data/variables.xml.in.h:101 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "masse_de_particule_alpha,aisu:m_α" #: ../data/variables.xml.in.h:102 msgid "Bohr Radius" msgstr "Rayon de Bohr" #: ../data/variables.xml.in.h:103 #, fuzzy msgid "r:bohr_radius,ais:a_0" msgstr "rayon_de_bohr,ais:a_o" #: ../data/variables.xml.in.h:104 msgid "Classical Electron Radius" msgstr "" #: ../data/variables.xml.in.h:105 msgid "r:classical_electron_radius,ais:r_e" msgstr "" #: ../data/variables.xml.in.h:106 msgid "Compton Wavelength" msgstr "" #: ../data/variables.xml.in.h:107 msgid "r:compton_wavelength,asu:λ_C,aos:lambda_C" msgstr "" #: ../data/variables.xml.in.h:108 msgid "Electron Mass" msgstr "Masse de l'Électron" #: ../data/variables.xml.in.h:109 msgid "r:electron_mass,ais:m_e" msgstr "masse_de_l'électron,ais:m_e" #: ../data/variables.xml.in.h:110 msgid "Helion Mass" msgstr "" #: ../data/variables.xml.in.h:111 msgid "r:helion_mass,ais:m_h" msgstr "" #: ../data/variables.xml.in.h:112 msgid "Neutron Mass" msgstr "Masse du Neutron" #: ../data/variables.xml.in.h:113 msgid "r:neutron_mass,ais:m_n" msgstr "masse_du_neutron,ais:m_n" #: ../data/variables.xml.in.h:114 msgid "Proton Mass" msgstr "Masse du Proton" #: ../data/variables.xml.in.h:115 msgid "r:proton_mass,ais:m_p" msgstr "masse_du_proton,ais:m_p" #: ../data/variables.xml.in.h:116 msgid "Rydberg Constant" msgstr "" #: ../data/variables.xml.in.h:117 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:118 msgid "Tau Mass" msgstr "" #: ../data/variables.xml.in.h:119 msgid "r:tau_mass,aisu:m_τ" msgstr "" #: ../data/variables.xml.in.h:120 msgid "Physico-Chemical Constants" msgstr "Constantes Physico-Chimiques" #: ../data/variables.xml.in.h:121 msgid "Atomic Mass Constant" msgstr "Constante de Masse Atomique" #: ../data/variables.xml.in.h:122 msgid "r:atomic_mass,ais:m_u" msgstr "masse_atomique,ais:m_u" #: ../data/variables.xml.in.h:123 msgid "Avogadro Constant" msgstr "Constante d'Avogadro" #: ../data/variables.xml.in.h:124 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:125 msgid "Boltzmann Constant" msgstr "Constante de Boltzmann" #: ../data/variables.xml.in.h:126 #, fuzzy msgid "r:boltzmann,ais:k_B" msgstr "magnéton_de_bohr,aisu:μ_B" #: ../data/variables.xml.in.h:127 msgid "Faraday Constant" msgstr "Constante de Faraday" #: ../data/variables.xml.in.h:128 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:129 msgid "First Radiation Constant" msgstr "" #: ../data/variables.xml.in.h:130 msgid "r:first_radiation,ais:c_1" msgstr "" #: ../data/variables.xml.in.h:131 msgid "Ideal Gas Constant" msgstr "Constante des Gaz Parfaits" #: ../data/variables.xml.in.h:132 msgid "r:ideal_gas" msgstr "" #: ../data/variables.xml.in.h:133 msgid "Second Radiation Constant" msgstr "" #: ../data/variables.xml.in.h:134 msgid "r:second_radiation,ais:c_2" msgstr "" #: ../data/variables.xml.in.h:135 msgid "Basic Constants" msgstr "Constantes Basiques" #: ../data/variables.xml.in.h:136 msgid "Golden Ratio" msgstr "Le Nombre d'Or" #: ../data/variables.xml.in.h:137 msgid "r:golden,au:φ" msgstr "" #: ../data/variables.xml.in.h:138 msgid "Omega Constant" msgstr "" #: ../data/variables.xml.in.h:139 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:140 msgid "Pythagoras' Constant (sqrt 2)" msgstr "Constante de Pythagore (sqrt 2)" #: ../data/variables.xml.in.h:141 msgid "r:pythagoras" msgstr "pythagore" #: ../data/variables.xml.in.h:142 msgid "Apery's Constant" msgstr "" #: ../data/variables.xml.in.h:143 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:144 msgid "Base of Natural Logarithms (e)" msgstr "La Base des Logarithmes Naturels (e)" #: ../data/variables.xml.in.h:145 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:146 msgid "Archimedes' Constant (pi)" msgstr "" #: ../data/variables.xml.in.h:147 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:148 msgid "Euler's Constant" msgstr "Constante d'Euler" #: ../data/variables.xml.in.h:149 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:150 msgid "Catalan's Constant" msgstr "" #: ../data/variables.xml.in.h:151 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:152 msgid "Special Numbers" msgstr "" #: ../data/variables.xml.in.h:153 msgid "Imaginary i (sqrt -1)" msgstr "Nombre Imaginaire i (tel que i^2 = -1)" #: ../data/variables.xml.in.h:154 msgid "r:i" msgstr "" #: ../data/variables.xml.in.h:155 msgid "Positive Infinity" msgstr "Infini Positif" #: ../data/variables.xml.in.h:156 #, fuzzy msgid "a:∞,r:plus_infinity,r:infinity" msgstr "a:∞,infini" #: ../data/variables.xml.in.h:157 msgid "Negative Infinity" msgstr "Infini Négatif" #: ../data/variables.xml.in.h:158 msgid "r:minus_infinity" msgstr "infini_négatif" #: ../data/variables.xml.in.h:159 msgid "Undefined" msgstr "Indéfini" #: ../data/variables.xml.in.h:160 msgid "r:undefined" msgstr "indéfini" #: ../data/variables.xml.in.h:161 #, fuzzy msgid "Precision" msgstr "Régression" #: ../data/variables.xml.in.h:162 msgid "r:precision" msgstr "" #: ../data/variables.xml.in.h:163 msgid "False" msgstr "Faux" #: ../data/variables.xml.in.h:164 msgid "r:false,r:no" msgstr "faux,non" #: ../data/variables.xml.in.h:165 msgid "True" msgstr "Vrai" #: ../data/variables.xml.in.h:166 msgid "r:true,r:yes" msgstr "vrai,oui" #: ../data/variables.xml.in.h:167 msgid "Unknowns" msgstr "Inconnues" #: ../data/variables.xml.in.h:168 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:170 msgid "r:z" msgstr "" #: ../data/variables.xml.in.h:171 #, fuzzy msgid "n (integer)" msgstr "Entiers" #: ../data/variables.xml.in.h:172 #, fuzzy msgid "r:n" msgstr "r:nom" #: ../data/variables.xml.in.h:174 msgid "Today" msgstr "" #: ../data/variables.xml.in.h:175 msgid "r:today" msgstr "" #: ../data/variables.xml.in.h:176 msgid "Tomorrow" msgstr "" #: ../data/variables.xml.in.h:177 msgid "r:tomorrow" msgstr "" #: ../data/variables.xml.in.h:178 msgid "Yesterday" msgstr "" #: ../data/variables.xml.in.h:179 msgid "r:yesterday" msgstr "" #: ../data/variables.xml.in.h:180 msgid "Now (date and time)" msgstr "" #: ../data/variables.xml.in.h:181 msgid "r:now" msgstr "" #~ msgid "Returns an integer from a binary number" #~ msgstr "Retourne un entier à partir d'un nombre binaire" #~ msgid "Returns an integer from an octal number" #~ msgstr "Retourne un entier à partir d'un nombre octal" #~ msgid "Standard Date Format" #~ msgstr "Format de Date Standard" #~ msgid "Local Date Format" #~ msgstr "Format de Date Local" #~ msgid "Infinity" #~ msgstr "Infini" #~ msgid "r:plus_infinity" #~ msgstr "infini_positif" #~ msgid "Analysis" #~ msgstr "Analyse" #~ msgid "Sum" #~ msgstr "Somme" #~ msgid "Consumer Surplus" #~ msgstr "Plus-value du Consommateur" #~ msgid "Quantity variabel" #~ msgstr "Variable de quantité" #~ msgid "Producer Surplus" #~ msgstr "Surplus du Producteur" #~ msgid "Demand function or price" #~ msgstr "Fonction de la demande ou prix" #~ msgid "r:duration" #~ msgstr "durée" #~ msgid "Calculates the duration of a security." #~ msgstr "Calcule la durée d'une obligation." #~ msgid "Annual coupon rate (%)" #~ msgstr "Taux de coupon annuel (%)" #~ msgid "Annualized yield (%)" #~ msgstr "Revenu annualisé" #~ msgid "Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6]" #~ msgstr "Retourne un vecteur trié ex. sort([6, 1, 4])=[1, 4, 6]" #~ msgid "Cup" #~ msgstr "Tasse" #, fuzzy #~ msgid "Ionization Potential" #~ msgstr "Potentiel Électrique" #, fuzzy #~ msgid "r:ionization" #~ msgstr "r:inclinaison" #, fuzzy #~ msgid "Covalent Radius" #~ msgstr "Rayon de Bohr" #, fuzzy #~ msgid "r:covalent" #~ msgstr "colonne" #, fuzzy #~ msgid "Value 1 (n)" #~ msgstr "Valeur 1" #~ msgid "Derive" #~ msgstr "Dérivée" #~ msgid "Calculates the area of a circle using the diameter" #~ msgstr "Calcule l'aire d'un cercle d'après son diamètre" #~ msgid "Diameter" #~ msgstr "Diamètre" libqalculate-2.8.2/po-defs/zh_CN.po0000644000175000017500000061374713365262313014032 00000000000000# translation of zh_CN.po to Simplified Chinese # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # # Roy Qu , 2007. msgid "" msgstr "" "Project-Id-Version: zh_CN\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-10-28 08:27+0100\n" "PO-Revision-Date: 2007-08-04 23:40+0800\n" "Last-Translator: Roy Qu \n" "Language-Team: Simplified Chinese\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" #: ../data/currencies.xml.in.h:1 msgid "Currency" msgstr "è´§å¸" #: ../data/currencies.xml.in.h:2 msgid "European Euros" msgstr "欧元" #: ../data/currencies.xml.in.h:3 msgid "ar:EUR,au:€,euro,p:euros" msgstr "ar:EUR,au:€,欧元" #: ../data/currencies.xml.in.h:4 msgid "" "Andorra, Austria, Belgium, Cyprus, Estonia, Finland, France, Germany, " "Greece, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, " "Portugal, San Marino, Slovakia, Slovenia, Spain, Vatican City" msgstr "" #: ../data/currencies.xml.in.h:5 msgid "U.S. Dollars" msgstr "美元" #: ../data/currencies.xml.in.h:6 msgid "a:$,ar:USD,dollar,p:dollars" msgstr "a:$,ar:USD,美元" #: ../data/currencies.xml.in.h:7 msgid "" "United States, East Timor, Ecuador, El Salvador, Micronesia, Marshall " "Islands, Palau, Zimbabwe" msgstr "" #: ../data/currencies.xml.in.h:8 msgid "Japanese Yen" msgstr "日元" #: ../data/currencies.xml.in.h:9 msgid "ar:JPY,au:¥,yen" msgstr "ar:JPY,au:¥,日元" #: ../data/currencies.xml.in.h:10 msgid "Japan" msgstr "" #: ../data/currencies.xml.in.h:11 msgid "Danish Kroner" msgstr "丹麦Kroner" #: ../data/currencies.xml.in.h:12 msgid "ar:DKK" msgstr "" #: ../data/currencies.xml.in.h:13 msgid "Denmark" msgstr "" #: ../data/currencies.xml.in.h:14 msgid "British Pounds" msgstr "英镑" #: ../data/currencies.xml.in.h:15 msgid "ar:GBP,au:£" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:16 msgid "United Kingdom" msgstr "" #: ../data/currencies.xml.in.h:17 msgid "Thai Baht" msgstr "泰国Bat" #: ../data/currencies.xml.in.h:18 msgid "ar:THB" msgstr "" #: ../data/currencies.xml.in.h:19 msgid "Thailand" msgstr "" #: ../data/currencies.xml.in.h:20 msgid "Swedish Krona" msgstr "瑞典克郎" #: ../data/currencies.xml.in.h:21 msgid "ar:SEK" msgstr "" #: ../data/currencies.xml.in.h:22 msgid "Sweden" msgstr "" #: ../data/currencies.xml.in.h:23 msgid "Swiss Francs" msgstr "瑞士法郎" #: ../data/currencies.xml.in.h:24 msgid "ar:CHF" msgstr "" #: ../data/currencies.xml.in.h:25 msgid "Switzerland" msgstr "" #: ../data/currencies.xml.in.h:26 msgid "Norwegian Kroner" msgstr "挪å¨Kroner" #: ../data/currencies.xml.in.h:27 msgid "ar:NOK" msgstr "" #: ../data/currencies.xml.in.h:28 msgid "Norway" msgstr "" #: ../data/currencies.xml.in.h:29 msgid "Bulgarian Lev" msgstr "ä¿åŠ åˆ©äºšåˆ—å¼—" #: ../data/currencies.xml.in.h:30 msgid "lev,ar:BGN" msgstr "" #: ../data/currencies.xml.in.h:31 #, fuzzy msgid "Bulgaria" msgstr "ä¿åŠ åˆ©äºšåˆ—å¼—" #: ../data/currencies.xml.in.h:32 msgid "Russian Ruble" msgstr "ä¿„ç½—æ–¯å¢å¸ƒ" #: ../data/currencies.xml.in.h:33 msgid "ar:RUB,au:₽,ruble" msgstr "ar:RUB,au:₽,å¢å¸ƒ" #: ../data/currencies.xml.in.h:34 #, fuzzy msgid "Russia" msgstr "ä¿„ç½—æ–¯å¢å¸ƒ" #: ../data/currencies.xml.in.h:35 msgid "Philippine Peso" msgstr "" #: ../data/currencies.xml.in.h:36 msgid "ar:PHP,au:₱" msgstr "" #: ../data/currencies.xml.in.h:37 msgid "Philippines" msgstr "" #: ../data/currencies.xml.in.h:38 msgid "Malaysian Ringgit" msgstr "马æ¥è¥¿äºšæž—å‰ç‰¹" #: ../data/currencies.xml.in.h:39 msgid "ar:MYR" msgstr "" #: ../data/currencies.xml.in.h:40 #, fuzzy msgid "Malaysia" msgstr "马æ¥è¥¿äºšæž—å‰ç‰¹" #: ../data/currencies.xml.in.h:41 msgid "Croatian Kuna" msgstr "克罗地亚" #: ../data/currencies.xml.in.h:42 msgid "ar:HRK" msgstr "" #: ../data/currencies.xml.in.h:43 #, fuzzy msgid "Croatia" msgstr "克罗地亚" #: ../data/currencies.xml.in.h:44 msgid "Yuan Renminbi (PR China)" msgstr "人民å¸å…ƒ" #: ../data/currencies.xml.in.h:45 msgid "ar:CNY" msgstr "" #: ../data/currencies.xml.in.h:46 msgid "China" msgstr "" #: ../data/currencies.xml.in.h:47 msgid "Indonesian Rupiah" msgstr "å°å°¼å¢æ¯”" #: ../data/currencies.xml.in.h:48 msgid "ar:IDR,rupiah" msgstr "a:IDR" #: ../data/currencies.xml.in.h:49 #, fuzzy msgid "Indonesia" msgstr "å°å°¼å¢æ¯”" #: ../data/currencies.xml.in.h:50 msgid "Czech Koruna" msgstr "æ·å…‹å…‹æœ—" #: ../data/currencies.xml.in.h:51 msgid "ar:CZK,au-c:Kč" msgstr "" #: ../data/currencies.xml.in.h:52 msgid "Czech Republic" msgstr "" #: ../data/currencies.xml.in.h:53 msgid "Hungarian Forint" msgstr "åŒˆç‰™åˆ©ç¦æž—" #: ../data/currencies.xml.in.h:54 msgid "forint,ar:HUF" msgstr "" #: ../data/currencies.xml.in.h:55 msgid "Hungary" msgstr "" #: ../data/currencies.xml.in.h:56 msgid "Polish Zloty" msgstr "波兰兹罗æ" #: ../data/currencies.xml.in.h:57 #, fuzzy msgid "ar:PLN,au:zł,zloty" msgstr "ar:ITL,au:₤,里拉" #: ../data/currencies.xml.in.h:58 msgid "Poland" msgstr "" #: ../data/currencies.xml.in.h:59 #, fuzzy msgid "Romanian Leu" msgstr "罗马尼亚新Leu" #: ../data/currencies.xml.in.h:60 msgid "ar:RON" msgstr "" #: ../data/currencies.xml.in.h:61 #, fuzzy msgid "Romania" msgstr "罗马尼亚新Leu" #: ../data/currencies.xml.in.h:62 msgid "Turkish New Lira" msgstr "土耳其新里拉" #: ../data/currencies.xml.in.h:63 msgid "ar:TRY,au:₺" msgstr "" #: ../data/currencies.xml.in.h:64 msgid "Turkey" msgstr "" #: ../data/currencies.xml.in.h:65 msgid "Australian Dollars" msgstr "澳大利亚元" #: ../data/currencies.xml.in.h:66 msgid "ar:AUD" msgstr "" #: ../data/currencies.xml.in.h:67 #, fuzzy msgid "Australia" msgstr "澳大利亚元" #: ../data/currencies.xml.in.h:68 msgid "Canadian Dollars" msgstr "加拿大元" #: ../data/currencies.xml.in.h:69 msgid "ar:CAD" msgstr "" #: ../data/currencies.xml.in.h:70 msgid "Canada" msgstr "" #: ../data/currencies.xml.in.h:71 msgid "Hong Kong Dollars" msgstr "港å¸" #: ../data/currencies.xml.in.h:72 msgid "ar:HKD" msgstr "" #: ../data/currencies.xml.in.h:73 msgid "New Zealand Dollars" msgstr "新西兰元" #: ../data/currencies.xml.in.h:74 msgid "ar:NZD" msgstr "" #: ../data/currencies.xml.in.h:75 #, fuzzy msgid "New Zealand" msgstr "新西兰元" #: ../data/currencies.xml.in.h:76 msgid "Singapore Dollars" msgstr "新加å¡å…ƒ" #: ../data/currencies.xml.in.h:77 msgid "ar:SGD" msgstr "" #: ../data/currencies.xml.in.h:78 #, fuzzy msgid "Singapore" msgstr "新加å¡å…ƒ" #: ../data/currencies.xml.in.h:79 msgid "South Korean Won" msgstr "韩元" #: ../data/currencies.xml.in.h:80 msgid "ar:KRW,au:₩,won" msgstr "" #: ../data/currencies.xml.in.h:81 #, fuzzy msgid "South Korea" msgstr "韩元" #: ../data/currencies.xml.in.h:82 msgid "South African Rand" msgstr "å—éžå…°ç‰¹" #: ../data/currencies.xml.in.h:83 msgid "ar:ZAR" msgstr "" #: ../data/currencies.xml.in.h:84 #, fuzzy msgid "South Africa" msgstr "å—éžå…°ç‰¹" #: ../data/currencies.xml.in.h:85 msgid "Indian Rupee" msgstr "" #: ../data/currencies.xml.in.h:86 msgid "ar:INR,au:₹,rupee" msgstr "" #: ../data/currencies.xml.in.h:87 #, fuzzy msgid "India" msgstr "铟" #: ../data/currencies.xml.in.h:88 msgid "Israeli New Sheqel" msgstr "" #: ../data/currencies.xml.in.h:89 msgid "ar:ILS,au:₪,sheqel" msgstr "" #: ../data/currencies.xml.in.h:90 msgid "Israel" msgstr "" #: ../data/currencies.xml.in.h:91 msgid "Mexican Peso" msgstr "" #: ../data/currencies.xml.in.h:92 msgid "ar:MXN" msgstr "" #: ../data/currencies.xml.in.h:93 msgid "Mexico" msgstr "" #: ../data/currencies.xml.in.h:94 msgid "Brazilian Real" msgstr "" #: ../data/currencies.xml.in.h:95 msgid "ar:BRL" msgstr "" #: ../data/currencies.xml.in.h:96 msgid "Brazil" msgstr "" #: ../data/currencies.xml.in.h:97 #, fuzzy msgid "Icelandic Krónur" msgstr "冰岛克朗" #: ../data/currencies.xml.in.h:98 msgid "ar:ISK" msgstr "" #: ../data/currencies.xml.in.h:99 msgid "Iceland" msgstr "" #: ../data/currencies.xml.in.h:100 msgid "Bitcoins" msgstr "" #: ../data/currencies.xml.in.h:101 msgid "ar:BTC,au:₿,a:XBT,bitcoin,p:bitcoins" msgstr "" #: ../data/currencies.xml.in.h:102 #, fuzzy msgid "Kenya Shilling" msgstr "奥地利先令" #: ../data/currencies.xml.in.h:103 #, fuzzy msgid "ar:KES" msgstr "ar:KRW" #: ../data/currencies.xml.in.h:104 msgid "Kenya" msgstr "" #: ../data/currencies.xml.in.h:105 msgid "Afghan Afghani" msgstr "" #: ../data/currencies.xml.in.h:106 #, fuzzy msgid "ar:AFN,aiu:؋" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:107 msgid "Afghanistan" msgstr "" #: ../data/currencies.xml.in.h:108 #, fuzzy msgid "Albanian Lek" msgstr "罗马尼亚新Leu" #: ../data/currencies.xml.in.h:109 msgid "ar:ALL" msgstr "" #: ../data/currencies.xml.in.h:110 msgid "Albania" msgstr "" #: ../data/currencies.xml.in.h:111 msgid "Algerian Dinar" msgstr "" #: ../data/currencies.xml.in.h:112 #, fuzzy msgid "ar:DZD" msgstr "a:DEM,马克" #: ../data/currencies.xml.in.h:113 #, fuzzy msgid "Algeria" msgstr "代数" #: ../data/currencies.xml.in.h:114 msgid "Angolan Kwanza" msgstr "" #: ../data/currencies.xml.in.h:115 msgid "ar:AOA" msgstr "" #: ../data/currencies.xml.in.h:116 msgid "Angola" msgstr "" #: ../data/currencies.xml.in.h:117 #, fuzzy msgid "Eastern Caribbean Dollar" msgstr "澳大利亚元" #: ../data/currencies.xml.in.h:118 msgid "ar:XCD" msgstr "" #: ../data/currencies.xml.in.h:119 msgid "" "Antigua and Barbuda, Dominica, Grenada, Montserrat, Saint Kitts and Nevis, " "Saint Lucia, Saint Vincent and the Grenadines, Anguilla" msgstr "" #: ../data/currencies.xml.in.h:120 msgid "Argentine Peso" msgstr "" #: ../data/currencies.xml.in.h:121 msgid "ar:ARS" msgstr "" #: ../data/currencies.xml.in.h:122 msgid "Argentina" msgstr "" #: ../data/currencies.xml.in.h:123 msgid "Armenian Dram" msgstr "" #: ../data/currencies.xml.in.h:124 #, fuzzy msgid "ar:AMD,au:֏" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:125 msgid "Armenia" msgstr "" #: ../data/currencies.xml.in.h:126 #, fuzzy msgid "Aruban Florin" msgstr "åŒˆç‰™åˆ©ç¦æž—" #: ../data/currencies.xml.in.h:127 msgid "ar:AWG" msgstr "" #: ../data/currencies.xml.in.h:128 msgid "Aruba" msgstr "" #: ../data/currencies.xml.in.h:129 msgid "Netherlands Antillean Guilder" msgstr "" #: ../data/currencies.xml.in.h:130 msgid "ar:ANG" msgstr "" #: ../data/currencies.xml.in.h:131 msgid "Curaçao, Sint Maarten" msgstr "" #: ../data/currencies.xml.in.h:132 msgid "Azerbaijani Manat" msgstr "" #: ../data/currencies.xml.in.h:133 #, fuzzy msgid "ar:AZN,au:₼" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:134 msgid "Azerbaijan" msgstr "" #: ../data/currencies.xml.in.h:135 #, fuzzy msgid "Bahamian Dollar" msgstr "加拿大元" #: ../data/currencies.xml.in.h:136 msgid "ar:BSD" msgstr "" #: ../data/currencies.xml.in.h:137 msgid "Bahamas" msgstr "" #: ../data/currencies.xml.in.h:138 msgid "Bahraini Dinar" msgstr "" #: ../data/currencies.xml.in.h:139 msgid "ar:BHD" msgstr "" #: ../data/currencies.xml.in.h:140 #, fuzzy msgid "Bahrain" msgstr "格令" #: ../data/currencies.xml.in.h:141 msgid "Bangladeshi Taka" msgstr "" #: ../data/currencies.xml.in.h:142 #, fuzzy msgid "ar:BDT,au:৳" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:143 msgid "Bangladesh" msgstr "" #: ../data/currencies.xml.in.h:144 #, fuzzy msgid "Barbadian Dollar" msgstr "加拿大元" #: ../data/currencies.xml.in.h:145 msgid "ar:BBD" msgstr "" #: ../data/currencies.xml.in.h:146 msgid "Barbados" msgstr "" #: ../data/currencies.xml.in.h:147 msgid "Belarusian Ruble p. (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:148 msgid "ar:BYR" msgstr "" #: ../data/currencies.xml.in.h:149 #, fuzzy msgid "Belize Dollar" msgstr "新加å¡å…ƒ" #: ../data/currencies.xml.in.h:150 msgid "ar:BZD" msgstr "" #: ../data/currencies.xml.in.h:151 msgid "Belize" msgstr "" #: ../data/currencies.xml.in.h:152 #, fuzzy msgid "West African CFA Franc" msgstr "å—éžå…°ç‰¹" #: ../data/currencies.xml.in.h:153 msgid "ar:XOF,a:CFA" msgstr "" #: ../data/currencies.xml.in.h:154 msgid "" "Benin, Burkina Faso, Guinea-Bissau, Ivory Coast, Mali, Niger, Senegal, Togo" msgstr "" #: ../data/currencies.xml.in.h:155 #, fuzzy msgid "Bermudian Dollar" msgstr "加拿大元" #: ../data/currencies.xml.in.h:156 msgid "ar:BMD" msgstr "" #: ../data/currencies.xml.in.h:157 msgid "Bermuda" msgstr "" #: ../data/currencies.xml.in.h:158 msgid "Bolivian Boliviano Bs" msgstr "" #: ../data/currencies.xml.in.h:159 msgid "ar:BOB" msgstr "" #: ../data/currencies.xml.in.h:160 msgid "Bolivia" msgstr "" #: ../data/currencies.xml.in.h:161 msgid "Bosnia and Herzegovina Convertible Mark" msgstr "" #: ../data/currencies.xml.in.h:162 msgid "ar:BAM" msgstr "" #: ../data/currencies.xml.in.h:163 msgid "Bosnia and Herzegovina" msgstr "" #: ../data/currencies.xml.in.h:164 msgid "Botswana Pula" msgstr "" #: ../data/currencies.xml.in.h:165 msgid "ar:BWP" msgstr "" #: ../data/currencies.xml.in.h:166 msgid "Botswana" msgstr "" #: ../data/currencies.xml.in.h:167 #, fuzzy msgid "Brunei Dollar" msgstr "加拿大元" #: ../data/currencies.xml.in.h:168 msgid "ar:BND" msgstr "" #: ../data/currencies.xml.in.h:169 msgid "Brunei" msgstr "" #: ../data/currencies.xml.in.h:170 #, fuzzy msgid "Burundian Franc" msgstr "比利时法郎" #: ../data/currencies.xml.in.h:171 msgid "ar:BIF" msgstr "" #: ../data/currencies.xml.in.h:172 msgid "Burundi" msgstr "" #: ../data/currencies.xml.in.h:173 msgid "Cambodian Riel" msgstr "" #: ../data/currencies.xml.in.h:174 #, fuzzy msgid "ar:KHR,aiu:៛" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:175 msgid "Cambodia" msgstr "" #: ../data/currencies.xml.in.h:176 msgid "Central African CFA Franc" msgstr "" #: ../data/currencies.xml.in.h:177 msgid "ar:XAF,a:FCFA" msgstr "" #: ../data/currencies.xml.in.h:178 msgid "" "Cameroon, Central African Republic, Chad, Republic of the Congo, Equatorial " "Guinea, Gabon" msgstr "" #: ../data/currencies.xml.in.h:179 msgid "Cape Verdean Escudo" msgstr "" #: ../data/currencies.xml.in.h:180 msgid "ar:CVE" msgstr "" #: ../data/currencies.xml.in.h:181 msgid "Cape Verde" msgstr "" #: ../data/currencies.xml.in.h:182 #, fuzzy msgid "Cayman Islands Dollar" msgstr "加拿大元" #: ../data/currencies.xml.in.h:183 #, fuzzy msgid "ar:KYD" msgstr "ar:KRW" #: ../data/currencies.xml.in.h:184 msgid "Cayman Islands" msgstr "" #: ../data/currencies.xml.in.h:185 msgid "Chilean Peso" msgstr "" #: ../data/currencies.xml.in.h:186 msgid "ar:CLP" msgstr "" #: ../data/currencies.xml.in.h:187 msgid "Chile" msgstr "" #: ../data/currencies.xml.in.h:188 #, fuzzy msgid "Colombian Peso" msgstr "组åˆ" #: ../data/currencies.xml.in.h:189 msgid "ar:COP" msgstr "" #: ../data/currencies.xml.in.h:190 #, fuzzy msgid "Colombia" msgstr "库仑" #: ../data/currencies.xml.in.h:191 #, fuzzy msgid "Comorian Franc" msgstr "比利时法郎" #: ../data/currencies.xml.in.h:192 #, fuzzy msgid "ar:KMF" msgstr "ar:KRW" #: ../data/currencies.xml.in.h:193 msgid "Comoros" msgstr "" #: ../data/currencies.xml.in.h:194 msgid "Democratic Republic of the Congo (Congolese Franc)" msgstr "" #: ../data/currencies.xml.in.h:195 msgid "ar:CDF" msgstr "" #: ../data/currencies.xml.in.h:196 msgid "Democratic Republic of the Congo" msgstr "" #: ../data/currencies.xml.in.h:197 msgid "Costa Rican colón" msgstr "" #: ../data/currencies.xml.in.h:198 msgid "ar:CRC" msgstr "" #: ../data/currencies.xml.in.h:199 msgid "Costa Rica" msgstr "" #: ../data/currencies.xml.in.h:200 msgid "Cuban Peso" msgstr "" #: ../data/currencies.xml.in.h:201 msgid "ar:CUP" msgstr "" #: ../data/currencies.xml.in.h:202 msgid "Cuba" msgstr "" #: ../data/currencies.xml.in.h:203 #, fuzzy msgid "Djiboutian Franc" msgstr "比利时法郎" #: ../data/currencies.xml.in.h:204 #, fuzzy msgid "ar:DJF" msgstr "a:DEM,马克" #: ../data/currencies.xml.in.h:205 msgid "Djibouti" msgstr "" #: ../data/currencies.xml.in.h:206 msgid "Dominican Peso" msgstr "" #: ../data/currencies.xml.in.h:207 #, fuzzy msgid "ar:DOP" msgstr "a:DEM,马克" #: ../data/currencies.xml.in.h:208 msgid "Dominican Republic" msgstr "" #: ../data/currencies.xml.in.h:209 #, fuzzy msgid "Egyptian Pound" msgstr "塞浦路斯镑" #: ../data/currencies.xml.in.h:210 #, fuzzy msgid "ar:EGP" msgstr "ar:EEK" #: ../data/currencies.xml.in.h:211 msgid "Egypt" msgstr "" #: ../data/currencies.xml.in.h:212 msgid "El Salvadoran Colon (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:213 #, fuzzy msgid "ar:SVC" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:214 msgid "Eritrean Nafka" msgstr "" #: ../data/currencies.xml.in.h:215 #, fuzzy msgid "ar:ERN" msgstr "ar:EEK" #: ../data/currencies.xml.in.h:216 msgid "Eritrea" msgstr "" #: ../data/currencies.xml.in.h:217 msgid "Ethiopian Birr" msgstr "" #: ../data/currencies.xml.in.h:218 #, fuzzy msgid "ar:ETB" msgstr "ar:EEK" #: ../data/currencies.xml.in.h:219 msgid "Ethiopia" msgstr "" #: ../data/currencies.xml.in.h:220 msgid "Falkland Islands Pound" msgstr "" #: ../data/currencies.xml.in.h:221 msgid "ar:FKP" msgstr "" #: ../data/currencies.xml.in.h:222 msgid "Falkland Islands" msgstr "" #: ../data/currencies.xml.in.h:223 #, fuzzy msgid "Fijian Dollar" msgstr "加拿大元" #: ../data/currencies.xml.in.h:224 msgid "ar:FJD" msgstr "" #: ../data/currencies.xml.in.h:225 msgid "Fiji" msgstr "" #: ../data/currencies.xml.in.h:226 msgid "CFP franc" msgstr "" #: ../data/currencies.xml.in.h:227 msgid "ar:XPF" msgstr "" #: ../data/currencies.xml.in.h:228 msgid "French Polynesia, New Caledonia, Wallis and Futuna" msgstr "" #: ../data/currencies.xml.in.h:229 #, fuzzy msgid "Gambian Dalasi" msgstr "加拿大元" #: ../data/currencies.xml.in.h:230 #, fuzzy msgid "ar:GMD" msgstr "ar:GRD" #: ../data/currencies.xml.in.h:231 msgid "Gambia" msgstr "" #: ../data/currencies.xml.in.h:232 msgid "Georgian Lari" msgstr "" #: ../data/currencies.xml.in.h:233 #, fuzzy msgid "ar:GEL,au:₾" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:234 msgid "Georgia" msgstr "" #: ../data/currencies.xml.in.h:235 msgid "Ghanaian Cedi" msgstr "" #: ../data/currencies.xml.in.h:236 #, fuzzy msgid "ar:GHS,au:₵" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:237 msgid "Ghana" msgstr "" #: ../data/currencies.xml.in.h:238 msgid "Gibraltar Pound" msgstr "" #: ../data/currencies.xml.in.h:239 #, fuzzy msgid "ar:GIP" msgstr "ar:GRD" #: ../data/currencies.xml.in.h:240 msgid "Gibraltar" msgstr "" #: ../data/currencies.xml.in.h:241 msgid "Guatemalan Quetzal" msgstr "" #: ../data/currencies.xml.in.h:242 #, fuzzy msgid "ar:GTQ" msgstr "ar:GRD" #: ../data/currencies.xml.in.h:243 msgid "Guatemala" msgstr "" #: ../data/currencies.xml.in.h:244 #, fuzzy msgid "Guernsey Pound" msgstr "爱尔兰镑" #: ../data/currencies.xml.in.h:245 #, fuzzy msgid "ar:GGP" msgstr "ar:GRD" #: ../data/currencies.xml.in.h:246 msgid "Guernsey" msgstr "" #: ../data/currencies.xml.in.h:247 #, fuzzy msgid "Guinean Franc" msgstr "比利时法郎" #: ../data/currencies.xml.in.h:248 #, fuzzy msgid "ar:GNF" msgstr "ar:GRD" #: ../data/currencies.xml.in.h:249 msgid "Guinea" msgstr "" #: ../data/currencies.xml.in.h:250 #, fuzzy msgid "Guyanese Dollar" msgstr "澳大利亚元" #: ../data/currencies.xml.in.h:251 #, fuzzy msgid "ar:GYD" msgstr "ar:GRD" #: ../data/currencies.xml.in.h:252 msgid "Guyana" msgstr "" #: ../data/currencies.xml.in.h:253 msgid "Haitian Gourde" msgstr "" #: ../data/currencies.xml.in.h:254 msgid "ar:HTG" msgstr "" #: ../data/currencies.xml.in.h:255 msgid "Haiti" msgstr "" #: ../data/currencies.xml.in.h:256 msgid "Honduran Lempira" msgstr "" #: ../data/currencies.xml.in.h:257 msgid "ar:HNL" msgstr "" #: ../data/currencies.xml.in.h:258 msgid "Honduras" msgstr "" #: ../data/currencies.xml.in.h:259 #, fuzzy msgid "Iranian Rial" msgstr "æ„大利里拉" #: ../data/currencies.xml.in.h:260 #, fuzzy msgid "ar:IRR,aiu:﷼" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:261 msgid "Iran" msgstr "" #: ../data/currencies.xml.in.h:262 msgid "Iraqi Dinar" msgstr "" #: ../data/currencies.xml.in.h:263 msgid "ar:IQD" msgstr "" #: ../data/currencies.xml.in.h:264 msgid "Iraq" msgstr "" #: ../data/currencies.xml.in.h:265 #, fuzzy msgid "Jamaican Dollar" msgstr "加拿大元" #: ../data/currencies.xml.in.h:266 msgid "ar:JMD" msgstr "" #: ../data/currencies.xml.in.h:267 msgid "Jamaica" msgstr "" #: ../data/currencies.xml.in.h:268 msgid "Jordanian Dinar" msgstr "" #: ../data/currencies.xml.in.h:269 msgid "ar:JOD" msgstr "" #: ../data/currencies.xml.in.h:270 msgid "Jordan" msgstr "" #: ../data/currencies.xml.in.h:271 msgid "Kazakhstani Tenge" msgstr "" #: ../data/currencies.xml.in.h:272 #, fuzzy msgid "ar:KZT,au:₸" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:273 msgid "Kazakhstan" msgstr "" #: ../data/currencies.xml.in.h:274 #, fuzzy msgid "North Korean Won" msgstr "韩元" #: ../data/currencies.xml.in.h:275 #, fuzzy msgid "ar:KPW" msgstr "ar:KRW" #: ../data/currencies.xml.in.h:276 #, fuzzy msgid "North Korea" msgstr "韩元" #: ../data/currencies.xml.in.h:277 msgid "Kuwaiti Dinar" msgstr "" #: ../data/currencies.xml.in.h:278 #, fuzzy msgid "ar:KWD" msgstr "ar:KRW" #: ../data/currencies.xml.in.h:279 msgid "Kuwait" msgstr "" #: ../data/currencies.xml.in.h:280 msgid "Kyrgyzstani Som" msgstr "" #: ../data/currencies.xml.in.h:281 #, fuzzy msgid "ar:KGS,au:с" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:282 msgid "Kyrgyzstan" msgstr "" #: ../data/currencies.xml.in.h:283 msgid "Lao Kip" msgstr "" #: ../data/currencies.xml.in.h:284 #, fuzzy msgid "ar:LAK,au:₭" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:285 msgid "Laos" msgstr "" #: ../data/currencies.xml.in.h:286 msgid "Lebanese Pound" msgstr "" #: ../data/currencies.xml.in.h:287 msgid "ar:LBP" msgstr "" #: ../data/currencies.xml.in.h:288 msgid "Lebanon" msgstr "" #: ../data/currencies.xml.in.h:289 msgid "Lesotho Loti" msgstr "" #: ../data/currencies.xml.in.h:290 msgid "ar:LSL" msgstr "" #: ../data/currencies.xml.in.h:291 msgid "Lesotho" msgstr "" #: ../data/currencies.xml.in.h:292 #, fuzzy msgid "Liberian Dollar" msgstr "澳大利亚元" #: ../data/currencies.xml.in.h:293 msgid "ar:LRD" msgstr "" #: ../data/currencies.xml.in.h:294 msgid "Liberia" msgstr "" #: ../data/currencies.xml.in.h:295 msgid "Libyan Dinar" msgstr "" #: ../data/currencies.xml.in.h:296 msgid "ar:LYD" msgstr "" #: ../data/currencies.xml.in.h:297 msgid "Libya" msgstr "" #: ../data/currencies.xml.in.h:298 msgid "Macanese Pataca" msgstr "" #: ../data/currencies.xml.in.h:299 msgid "ar:MOP" msgstr "" #: ../data/currencies.xml.in.h:300 msgid "Macedonian Denar" msgstr "" #: ../data/currencies.xml.in.h:301 msgid "ar:MKD" msgstr "" #: ../data/currencies.xml.in.h:302 msgid "Macedonia" msgstr "" #: ../data/currencies.xml.in.h:303 msgid "Malagasy Ariary" msgstr "" #: ../data/currencies.xml.in.h:304 msgid "ar:MGA" msgstr "" #: ../data/currencies.xml.in.h:305 msgid "Madagascar" msgstr "" #: ../data/currencies.xml.in.h:306 msgid "Malawian Kwacha" msgstr "" #: ../data/currencies.xml.in.h:307 msgid "ar:MWK" msgstr "" #: ../data/currencies.xml.in.h:308 msgid "Malawi" msgstr "" #: ../data/currencies.xml.in.h:309 msgid "Maldivian Rufiyaa" msgstr "" #: ../data/currencies.xml.in.h:310 msgid "ar:MVR" msgstr "" #: ../data/currencies.xml.in.h:311 msgid "Maldives" msgstr "" #: ../data/currencies.xml.in.h:312 msgid "Mauritanian Ouguiya (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:313 msgid "ar:MRO" msgstr "" #: ../data/currencies.xml.in.h:314 msgid "Mauritian Rupee" msgstr "" #: ../data/currencies.xml.in.h:315 msgid "ar:MUR" msgstr "" #: ../data/currencies.xml.in.h:316 msgid "Mauritius" msgstr "" #: ../data/currencies.xml.in.h:317 msgid "Moldovan Leu" msgstr "" #: ../data/currencies.xml.in.h:318 msgid "ar:MDL" msgstr "" #: ../data/currencies.xml.in.h:319 msgid "Moldova" msgstr "" #: ../data/currencies.xml.in.h:320 msgid "Mongolian Tögrög" msgstr "" #: ../data/currencies.xml.in.h:321 #, fuzzy msgid "ar:MNT,au:₮" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:322 msgid "Mongolia" msgstr "" #: ../data/currencies.xml.in.h:323 msgid "Moroccan Dirham" msgstr "" #: ../data/currencies.xml.in.h:324 msgid "ar:MAD" msgstr "" #: ../data/currencies.xml.in.h:325 msgid "Morocco" msgstr "" #: ../data/currencies.xml.in.h:326 msgid "Mozambican Metical" msgstr "" #: ../data/currencies.xml.in.h:327 msgid "ar:MZN" msgstr "" #: ../data/currencies.xml.in.h:328 msgid "Mozambique" msgstr "" #: ../data/currencies.xml.in.h:329 msgid "Myanmar (Burmese Kyat)" msgstr "" #: ../data/currencies.xml.in.h:330 msgid "ar:MMK" msgstr "" #: ../data/currencies.xml.in.h:331 msgid "Myanmar" msgstr "" #: ../data/currencies.xml.in.h:332 #, fuzzy msgid "Namibian Dollar" msgstr "加拿大元" #: ../data/currencies.xml.in.h:333 msgid "ar:NAD" msgstr "" #: ../data/currencies.xml.in.h:334 msgid "Namibia" msgstr "" #: ../data/currencies.xml.in.h:335 msgid "Nepalese Rupee" msgstr "" #: ../data/currencies.xml.in.h:336 msgid "ar:NPR" msgstr "" #: ../data/currencies.xml.in.h:337 msgid "Nepal" msgstr "" #: ../data/currencies.xml.in.h:338 msgid "Nicaraguan Córdoba" msgstr "" #: ../data/currencies.xml.in.h:339 msgid "ar:NIO" msgstr "" #: ../data/currencies.xml.in.h:340 msgid "Nicaragua" msgstr "" #: ../data/currencies.xml.in.h:341 msgid "Nigerian Naira" msgstr "" #: ../data/currencies.xml.in.h:342 #, fuzzy msgid "ar:NGN,au:₦" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:343 msgid "Nigeria" msgstr "" #: ../data/currencies.xml.in.h:344 msgid "Omani Rial" msgstr "" #: ../data/currencies.xml.in.h:345 msgid "ar:OMR" msgstr "" #: ../data/currencies.xml.in.h:346 msgid "Oman" msgstr "" #: ../data/currencies.xml.in.h:347 msgid "Pakistani Rupee" msgstr "" #: ../data/currencies.xml.in.h:348 #, fuzzy msgid "ar:PKR" msgstr "ar:PHP" #: ../data/currencies.xml.in.h:349 #, fuzzy msgid "Pakistan" msgstr "普朗克常数" #: ../data/currencies.xml.in.h:350 msgid "Panamaian Balboa" msgstr "" #: ../data/currencies.xml.in.h:351 #, fuzzy msgid "ar:PAB" msgstr "ar:PHP" #: ../data/currencies.xml.in.h:352 msgid "Panama" msgstr "" #: ../data/currencies.xml.in.h:353 msgid "Papua New Guinean Kina" msgstr "" #: ../data/currencies.xml.in.h:354 #, fuzzy msgid "ar:PGK" msgstr "ar:PHP" #: ../data/currencies.xml.in.h:355 msgid "Papua New Guinea" msgstr "" #: ../data/currencies.xml.in.h:356 msgid "Paraguayan Guaraní" msgstr "" #: ../data/currencies.xml.in.h:357 #, fuzzy msgid "ar:PYG,au:₲" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:358 msgid "Paraguay" msgstr "" #: ../data/currencies.xml.in.h:359 msgid "Peruvian Sol" msgstr "" #: ../data/currencies.xml.in.h:360 #, fuzzy msgid "ar:PEN" msgstr "ar:PHP" #: ../data/currencies.xml.in.h:361 msgid "Peru" msgstr "" #: ../data/currencies.xml.in.h:362 msgid "Qatari Riyal" msgstr "" #: ../data/currencies.xml.in.h:363 msgid "ar:QAR" msgstr "" #: ../data/currencies.xml.in.h:364 msgid "Qatar" msgstr "" #: ../data/currencies.xml.in.h:365 #, fuzzy msgid "Rwandan Franc" msgstr "比利时法郎" #: ../data/currencies.xml.in.h:366 msgid "ar:RWF" msgstr "" #: ../data/currencies.xml.in.h:367 msgid "Rwanda" msgstr "" #: ../data/currencies.xml.in.h:368 msgid "São Tomé and Príncipe Dobra" msgstr "" #: ../data/currencies.xml.in.h:369 #, fuzzy msgid "ar:STD" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:370 msgid "Sao Tome and Principe" msgstr "" #: ../data/currencies.xml.in.h:371 msgid "Saudi Riyal" msgstr "" #: ../data/currencies.xml.in.h:372 #, fuzzy msgid "ar:SAR" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:373 msgid "Saudi Arabia" msgstr "" #: ../data/currencies.xml.in.h:374 msgid "Serbian Dinar" msgstr "" #: ../data/currencies.xml.in.h:375 msgid "ar:RSD" msgstr "" #: ../data/currencies.xml.in.h:376 #, fuzzy msgid "Serbia" msgstr "铽" #: ../data/currencies.xml.in.h:377 msgid "Seychellois Rupee" msgstr "" #: ../data/currencies.xml.in.h:378 #, fuzzy msgid "ar:SCR" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:379 msgid "Seychelles" msgstr "" #: ../data/currencies.xml.in.h:380 msgid "Sierra Leonean Leone" msgstr "" #: ../data/currencies.xml.in.h:381 #, fuzzy msgid "ar:SLL" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:382 msgid "Sierra Leone" msgstr "" #: ../data/currencies.xml.in.h:383 msgid "Solomon Islands Dollar" msgstr "" #: ../data/currencies.xml.in.h:384 #, fuzzy msgid "ar:SBD" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:385 msgid "Solomon Islands" msgstr "" #: ../data/currencies.xml.in.h:386 #, fuzzy msgid "Somali Shilling" msgstr "奥地利先令" #: ../data/currencies.xml.in.h:387 #, fuzzy msgid "ar:SOS" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:388 msgid "Somalia" msgstr "" #: ../data/currencies.xml.in.h:389 msgid "Sri Lankan Rupee;" msgstr "" #: ../data/currencies.xml.in.h:390 #, fuzzy msgid "ar:LKR,au:௹" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:391 msgid "Sri Lanka" msgstr "" #: ../data/currencies.xml.in.h:392 msgid "Sudanese Pound" msgstr "" #: ../data/currencies.xml.in.h:393 #, fuzzy msgid "ar:SDG" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:394 msgid "Sudan" msgstr "" #: ../data/currencies.xml.in.h:395 #, fuzzy msgid "Surinamese Dollar" msgstr "新加å¡å…ƒ" #: ../data/currencies.xml.in.h:396 #, fuzzy msgid "ar:SRD" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:397 #, fuzzy msgid "Suriname" msgstr "文件å" #: ../data/currencies.xml.in.h:398 msgid "Swazi Lilangeni" msgstr "" #: ../data/currencies.xml.in.h:399 #, fuzzy msgid "ar:SZL" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:400 msgid "Swaziland" msgstr "" #: ../data/currencies.xml.in.h:401 #, fuzzy msgid "Syrian Pound" msgstr "塞浦路斯镑" #: ../data/currencies.xml.in.h:402 #, fuzzy msgid "ar:SYP" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:403 msgid "Syria" msgstr "" #: ../data/currencies.xml.in.h:404 #, fuzzy msgid "New Taiwan Dollar" msgstr "新西兰元" #: ../data/currencies.xml.in.h:405 #, fuzzy msgid "ar:TWD" msgstr "ar:TRY" #: ../data/currencies.xml.in.h:406 msgid "Taiwan" msgstr "" #: ../data/currencies.xml.in.h:407 msgid "Tajikistani Somoni" msgstr "" #: ../data/currencies.xml.in.h:408 #, fuzzy msgid "ar:TJS" msgstr "ar:TRY" #: ../data/currencies.xml.in.h:409 msgid "Tajikistan" msgstr "" #: ../data/currencies.xml.in.h:410 #, fuzzy msgid "Tanzanian Shilling" msgstr "奥地利先令" #: ../data/currencies.xml.in.h:411 #, fuzzy msgid "ar:TZS" msgstr "ar:TRY" #: ../data/currencies.xml.in.h:412 msgid "Tanzania" msgstr "" #: ../data/currencies.xml.in.h:413 msgid "Tongan PaÊ»anga" msgstr "" #: ../data/currencies.xml.in.h:414 #, fuzzy msgid "ar:TOP" msgstr "ar:TRY" #: ../data/currencies.xml.in.h:415 msgid "Tonga" msgstr "" #: ../data/currencies.xml.in.h:416 msgid "Trinidad and Tobago dollar" msgstr "" #: ../data/currencies.xml.in.h:417 #, fuzzy msgid "ar:TTD" msgstr "ar:TRY" #: ../data/currencies.xml.in.h:418 msgid "Trinidad and Tobago" msgstr "" #: ../data/currencies.xml.in.h:419 msgid "Tunisian Dinar" msgstr "" #: ../data/currencies.xml.in.h:420 #, fuzzy msgid "ar:TND" msgstr "ar:TRY" #: ../data/currencies.xml.in.h:421 msgid "Tunisia" msgstr "" #: ../data/currencies.xml.in.h:422 msgid "Turkmenistan Manat" msgstr "" #: ../data/currencies.xml.in.h:423 #, fuzzy msgid "ar:TMT" msgstr "ar:TRY" #: ../data/currencies.xml.in.h:424 msgid "Turkmenistan" msgstr "" #: ../data/currencies.xml.in.h:425 #, fuzzy msgid "Ugandan Shilling" msgstr "奥地利先令" #: ../data/currencies.xml.in.h:426 msgid "ar:UGX" msgstr "" #: ../data/currencies.xml.in.h:427 msgid "Uganda" msgstr "" #: ../data/currencies.xml.in.h:428 msgid "Ukrainian Hryvnia" msgstr "" #: ../data/currencies.xml.in.h:429 #, fuzzy msgid "ar:UAH,au:₴" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:430 #, fuzzy msgid "Ukraine" msgstr "格令" #: ../data/currencies.xml.in.h:431 msgid "United Arab Emirates Dirham" msgstr "" #: ../data/currencies.xml.in.h:432 msgid "ar:AED" msgstr "" #: ../data/currencies.xml.in.h:433 msgid "United Arab Emirates" msgstr "" #: ../data/currencies.xml.in.h:434 msgid "Uruguayan Peso" msgstr "" #: ../data/currencies.xml.in.h:435 msgid "ar:UYU" msgstr "" #: ../data/currencies.xml.in.h:436 msgid "Uruguay" msgstr "" #: ../data/currencies.xml.in.h:437 msgid "Uzbekistan SoÊ»m" msgstr "" #: ../data/currencies.xml.in.h:438 msgid "ar:UZS" msgstr "" #: ../data/currencies.xml.in.h:439 msgid "Uzbekistan" msgstr "" #: ../data/currencies.xml.in.h:440 msgid "Vanuatu Vatu" msgstr "" #: ../data/currencies.xml.in.h:441 msgid "ar:VUV" msgstr "" #: ../data/currencies.xml.in.h:442 msgid "Vanuatu" msgstr "" #: ../data/currencies.xml.in.h:443 msgid "Venezuelan Bolívar" msgstr "" #: ../data/currencies.xml.in.h:444 msgid "ar:VEF" msgstr "" #: ../data/currencies.xml.in.h:445 msgid "Venezuela" msgstr "" #: ../data/currencies.xml.in.h:446 msgid "Vietnamese Dồng" msgstr "" #: ../data/currencies.xml.in.h:447 #, fuzzy msgid "ar:VND,au:₫" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:448 msgid "Vietnam" msgstr "" #: ../data/currencies.xml.in.h:449 msgid "Yemeni Rial" msgstr "" #: ../data/currencies.xml.in.h:450 msgid "ar:YER" msgstr "" #: ../data/currencies.xml.in.h:451 #, fuzzy msgid "Yemen" msgstr "一个元素" #: ../data/currencies.xml.in.h:452 msgid "Zambian Kwacha (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:453 msgid "ar:ZMK" msgstr "" #: ../data/currencies.xml.in.h:454 msgid "Euro Cent" msgstr "欧元分" #: ../data/currencies.xml.in.h:455 msgid "r:eurocent,p:eurocents" msgstr "r:欧元分" #: ../data/currencies.xml.in.h:456 msgid "Cent (USD)" msgstr "美分" #: ../data/currencies.xml.in.h:457 msgid "au:¢,r:cent,p:cents" msgstr "au:¢,r:美分" #: ../data/currencies.xml.in.h:458 #, fuzzy msgid "Belgian Franc (obsolete)" msgstr "比利时法郎" #: ../data/currencies.xml.in.h:459 msgid "ar:BEF" msgstr "" #: ../data/currencies.xml.in.h:460 #, fuzzy msgid "Greek Drachma (obsolete)" msgstr "希腊德拉马克" #: ../data/currencies.xml.in.h:461 #, fuzzy msgid "ar:GRD,au:₯" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:462 #, fuzzy msgid "French Franc (obsolete)" msgstr "法国法郎" #: ../data/currencies.xml.in.h:463 #, fuzzy msgid "ar:FRF,au:₣" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:464 #, fuzzy msgid "Italian Lira (obsolete)" msgstr "æ„大利里拉" #: ../data/currencies.xml.in.h:465 msgid "ar:ITL" msgstr "" #: ../data/currencies.xml.in.h:466 #, fuzzy msgid "Dutch Guilder (obsolete)" msgstr "è·å…°ç›¾" #: ../data/currencies.xml.in.h:467 msgid "ar:NLG" msgstr "" #: ../data/currencies.xml.in.h:468 #, fuzzy msgid "Portuguese Escudo (obsolete)" msgstr "è‘¡è„牙埃斯库多" #: ../data/currencies.xml.in.h:469 #, fuzzy msgid "ar:PTE" msgstr "ar:PHP" #: ../data/currencies.xml.in.h:470 msgid "Deutsche Mark (obsolete)" msgstr "" #: ../data/currencies.xml.in.h:471 #, fuzzy msgid "ar:DEM" msgstr "a:DEM,马克" #: ../data/currencies.xml.in.h:472 #, fuzzy msgid "Spanish Peseta (obsolete)" msgstr "西ç­ç‰™æ¯”塞塔" #: ../data/currencies.xml.in.h:473 #, fuzzy msgid "ar:ESP,au:₧" msgstr "ar:GBP,au:£" #: ../data/currencies.xml.in.h:474 #, fuzzy msgid "Irish Pound (obsolete)" msgstr "爱尔兰镑" #: ../data/currencies.xml.in.h:475 msgid "ar:IEP" msgstr "" #: ../data/currencies.xml.in.h:476 #, fuzzy msgid "Luxembourg Franc (obsolete)" msgstr "墿£®å ¡æ³•郎" #: ../data/currencies.xml.in.h:477 msgid "ar:LUF" msgstr "" #: ../data/currencies.xml.in.h:478 #, fuzzy msgid "Austrian Schilling (obsolete)" msgstr "奥地利先令" #: ../data/currencies.xml.in.h:479 msgid "ar:ATS" msgstr "" #: ../data/currencies.xml.in.h:480 #, fuzzy msgid "Finnish Markka (obsolete)" msgstr "芬兰马克" #: ../data/currencies.xml.in.h:481 msgid "ar:FIM" msgstr "" #: ../data/currencies.xml.in.h:482 #, fuzzy msgid "Slovenian Tolar (obsolete)" msgstr "斯洛文尼亚Tolar" #: ../data/currencies.xml.in.h:483 #, fuzzy msgid "ar:SIT" msgstr "tolar,ar:SIT" #: ../data/currencies.xml.in.h:484 #, fuzzy msgid "Cypriot Pound (obsolete)" msgstr "塞浦路斯镑" #: ../data/currencies.xml.in.h:485 msgid "ar:CYP" msgstr "" #: ../data/currencies.xml.in.h:486 #, fuzzy msgid "Estonian Kroon (obsolete)" msgstr "çˆ±æ²™å°¼äºšå…‹é²æ©" #: ../data/currencies.xml.in.h:487 msgid "ar:EEK" msgstr "ar:EEK" #: ../data/currencies.xml.in.h:488 #, fuzzy msgid "Slovak Koruna (obsolete)" msgstr "斯洛ä¼å…‹Koruna" #: ../data/currencies.xml.in.h:489 msgid "ar:SKK" msgstr "" #: ../data/currencies.xml.in.h:490 #, fuzzy msgid "Maltese Lira (obsolete)" msgstr "马耳他里拉" #: ../data/currencies.xml.in.h:491 msgid "ar:MTL" msgstr "" #: ../data/currencies.xml.in.h:492 #, fuzzy msgid "Latvian Lats (obsolete)" msgstr "拉脱维亚 Lats" #: ../data/currencies.xml.in.h:493 msgid "ar:LVL" msgstr "" #: ../data/currencies.xml.in.h:494 #, fuzzy msgid "Lithuanian Litas (obsolete)" msgstr "ç«‹é™¶å®›Litas" #: ../data/currencies.xml.in.h:495 msgid "ar:LTL" msgstr "" #: ../data/currencies.xml.in.h:496 #, fuzzy msgid "Belarusian Ruble" msgstr "ä¿„ç½—æ–¯å¢å¸ƒ" #: ../data/currencies.xml.in.h:497 msgid "ar:BYN" msgstr "" #: ../data/currencies.xml.in.h:498 msgid "Belarus" msgstr "" #: ../data/currencies.xml.in.h:499 msgid "Zambian Kwacha" msgstr "" #: ../data/currencies.xml.in.h:500 msgid "ar:ZMW" msgstr "" #: ../data/currencies.xml.in.h:501 msgid "Zambia" msgstr "" #: ../data/currencies.xml.in.h:502 msgid "Mauritanian Ouguiya" msgstr "" #: ../data/currencies.xml.in.h:503 msgid "ar:MRU" msgstr "" #: ../data/currencies.xml.in.h:504 #, fuzzy msgid "Mauritania" msgstr "到期日期" #: ../data/datasets.xml.in.h:1 msgid "Data Sets" msgstr "æ•°æ®é›†" #. Data set for chemical elements #: ../data/datasets.xml.in.h:3 msgid "!datasets!Elements" msgstr "元素" #: ../data/datasets.xml.in.h:4 msgid "r:atom" msgstr "" #. Object argument for chemical elements data set #: ../data/datasets.xml.in.h:6 msgid "!datasets!Element" msgstr "元素" #: ../data/datasets.xml.in.h:7 msgid "Symbol" msgstr "符å·" #: ../data/datasets.xml.in.h:8 msgid "r:symbol" msgstr "" #. Chemical elements number #: ../data/datasets.xml.in.h:10 msgid "!datasets!Number" msgstr "ç¼–å·" #. Chemical elements number #: ../data/datasets.xml.in.h:12 msgid "!datasets!r:number" msgstr "ç¼–å·" #: ../data/datasets.xml.in.h:13 ../data/functions.xml.in.h:647 msgid "Name" msgstr "åç§°" #: ../data/datasets.xml.in.h:14 msgid "r:name" msgstr "" #: ../data/datasets.xml.in.h:15 msgid "Classification" msgstr "分类" #: ../data/datasets.xml.in.h:16 #, fuzzy msgid "" "A number representing an element group: 1 Alkali Metal 2 Alkaline-" "Earth Metal 3 Lanthanide 4 Actinide 5 Transition Metal 6 " "Metal 7 Metalloid 8 Polyatomic Non-Metal 9 Diatomic Non-" "Metal 10 Noble Gas 11 Unknown chemical properties" msgstr "" "一个代表元素æ—的数字: 1 碱金属 2 硷土金属 3 镧系元素 4 锕系" "元素 5 过渡金属元素 6 金属 7 åŠé‡‘属元素 8 éžé‡‘属 9 å¤" "ç´  10 惰性气体 11 锕系åŽå…ƒç´ " #: ../data/datasets.xml.in.h:17 msgid "r:class" msgstr "" #: ../data/datasets.xml.in.h:18 ../data/functions.xml.in.h:414 msgid "Weight" msgstr "é‡é‡" #: ../data/datasets.xml.in.h:19 msgid "r:weight,mass" msgstr "" #: ../data/datasets.xml.in.h:20 msgid "Boiling Point" msgstr "沸点" #: ../data/datasets.xml.in.h:21 msgid "r:boiling" msgstr "" #: ../data/datasets.xml.in.h:22 msgid "Melting Point" msgstr "熔点" #: ../data/datasets.xml.in.h:23 msgid "r:melting" msgstr "" #: ../data/datasets.xml.in.h:24 ../data/units.xml.in.h:117 msgid "Density" msgstr "密度" #: ../data/datasets.xml.in.h:25 msgid "Density at 295K" msgstr "295K时的密度" #: ../data/datasets.xml.in.h:26 msgid "r:density" msgstr "" #: ../data/datasets.xml.in.h:27 msgid "X Position" msgstr "Xåæ ‡" #: ../data/datasets.xml.in.h:28 msgid "r:x_pos" msgstr "" #: ../data/datasets.xml.in.h:29 msgid "Y Position" msgstr "Yåæ ‡" #: ../data/datasets.xml.in.h:30 msgid "r:y_pos" msgstr "" #: ../data/datasets.xml.in.h:31 msgid "Planets" msgstr "行星" #: ../data/datasets.xml.in.h:32 msgid "r:planet" msgstr "" #: ../data/datasets.xml.in.h:33 msgid "Planet" msgstr "行星" #: ../data/datasets.xml.in.h:34 msgid "Orbital Period (Year)" msgstr "轨é“周期(å¹´)" #. Orbital period for planet #: ../data/datasets.xml.in.h:36 msgid "!datasets!r:year" msgstr "å¹´" #: ../data/datasets.xml.in.h:37 msgid "Average Orbital Speed" msgstr "å¹³å‡å½’到速度" #: ../data/datasets.xml.in.h:38 msgid "r:speed" msgstr "" #: ../data/datasets.xml.in.h:39 msgid "Eccentricity" msgstr "å心率" #: ../data/datasets.xml.in.h:40 msgid "r:eccentricity" msgstr "" #: ../data/datasets.xml.in.h:41 msgid "Inclination" msgstr "倾角" #: ../data/datasets.xml.in.h:42 msgid "r:inclination" msgstr "" #: ../data/datasets.xml.in.h:43 msgid "Number of Satellites" msgstr "嫿˜Ÿä¸ªæ•°" #: ../data/datasets.xml.in.h:44 msgid "r:satellites" msgstr "" #. Planet mass #: ../data/datasets.xml.in.h:46 msgid "!datasets!Mass" msgstr "è´¨é‡" #: ../data/datasets.xml.in.h:47 msgid "r:mass" msgstr "" #: ../data/datasets.xml.in.h:48 msgid "Mean Density" msgstr "å¹³å‡å¯†åº¦" #: ../data/datasets.xml.in.h:49 msgid "Surface Area" msgstr "表é¢ç§¯" #. Surface area of planet #: ../data/datasets.xml.in.h:51 msgid "!datasets!r:area" msgstr "é¢ç§¯" #: ../data/datasets.xml.in.h:52 msgid "Equatorial Gravity" msgstr "赤é“é‡åŠ›" #: ../data/datasets.xml.in.h:53 msgid "r:gravity" msgstr "" #: ../data/datasets.xml.in.h:54 msgid "Mean Surface Temperature" msgstr "å¹³å‡è¡¨é¢æ¸©åº¦" #: ../data/datasets.xml.in.h:55 msgid "r:temperature" msgstr "" #: ../data/elements.xml.in.h:1 msgid "Hydrogen" msgstr "æ°¢" #: ../data/elements.xml.in.h:2 msgid "Helium" msgstr "æ°¦" #: ../data/elements.xml.in.h:3 msgid "Lithium" msgstr "锂" #: ../data/elements.xml.in.h:4 msgid "Beryllium" msgstr "é“" #: ../data/elements.xml.in.h:5 msgid "Boron" msgstr "硼" #: ../data/elements.xml.in.h:6 msgid "Carbon" msgstr "碳" #: ../data/elements.xml.in.h:7 msgid "Nitrogen" msgstr "æ°®" #: ../data/elements.xml.in.h:8 msgid "Oxygen" msgstr "æ°§" #: ../data/elements.xml.in.h:9 msgid "Fluorine" msgstr "æ°Ÿ" #: ../data/elements.xml.in.h:10 msgid "Neon" msgstr "æ°–" #: ../data/elements.xml.in.h:11 msgid "Sodium" msgstr "é’ " #: ../data/elements.xml.in.h:12 msgid "Magnesium" msgstr "é•" #: ../data/elements.xml.in.h:13 msgid "Aluminum" msgstr "é“" #: ../data/elements.xml.in.h:14 msgid "Silicon" msgstr "ç¡…" #: ../data/elements.xml.in.h:15 msgid "Phosphorus" msgstr "磷" #: ../data/elements.xml.in.h:16 msgid "Sulfur" msgstr "ç¡«" #: ../data/elements.xml.in.h:17 msgid "Chlorine" msgstr "æ°¯" #: ../data/elements.xml.in.h:18 msgid "Argon" msgstr "æ°©" #: ../data/elements.xml.in.h:19 msgid "Potassium" msgstr "é’¾" #: ../data/elements.xml.in.h:20 msgid "Calcium" msgstr "é’™" #: ../data/elements.xml.in.h:21 msgid "Scandium" msgstr "é’ª" #: ../data/elements.xml.in.h:22 msgid "Titanium" msgstr "é’›" #: ../data/elements.xml.in.h:23 msgid "Vanadium" msgstr "é’’" #: ../data/elements.xml.in.h:24 msgid "Chromium" msgstr "铬" #: ../data/elements.xml.in.h:25 msgid "Manganese" msgstr "é”°" #: ../data/elements.xml.in.h:26 msgid "Iron" msgstr "é“" #: ../data/elements.xml.in.h:27 msgid "Cobalt" msgstr "é’´" #: ../data/elements.xml.in.h:28 msgid "Nickel" msgstr "é•" #: ../data/elements.xml.in.h:29 msgid "Copper" msgstr "铜" #: ../data/elements.xml.in.h:30 msgid "Zinc" msgstr "锌" #: ../data/elements.xml.in.h:31 msgid "Gallium" msgstr "é•“" #: ../data/elements.xml.in.h:32 msgid "Germanium" msgstr "é”—" #: ../data/elements.xml.in.h:33 msgid "Arsenic" msgstr "ç ·" #: ../data/elements.xml.in.h:34 msgid "Selenium" msgstr "ç¡’" #: ../data/elements.xml.in.h:35 msgid "Bromine" msgstr "溴" #: ../data/elements.xml.in.h:36 msgid "Krypton" msgstr "æ°ª" #: ../data/elements.xml.in.h:37 msgid "Rubidium" msgstr "é“·" #: ../data/elements.xml.in.h:38 msgid "Strontium" msgstr "é”¶" #: ../data/elements.xml.in.h:39 msgid "Yttrium" msgstr "é’‡" #: ../data/elements.xml.in.h:40 msgid "Zirconium" msgstr "锆" #: ../data/elements.xml.in.h:41 msgid "Niobium" msgstr "铌" #: ../data/elements.xml.in.h:42 msgid "Molybdenum" msgstr "é’¼" #: ../data/elements.xml.in.h:43 msgid "Technetium" msgstr "é”" #: ../data/elements.xml.in.h:44 msgid "Ruthenium" msgstr "é’Œ" #: ../data/elements.xml.in.h:45 msgid "Rhodium" msgstr "é“‘" #: ../data/elements.xml.in.h:46 msgid "Palladium" msgstr "é’¯" #: ../data/elements.xml.in.h:47 msgid "Silver" msgstr "é“¶" #: ../data/elements.xml.in.h:48 msgid "Cadmium" msgstr "镉" #: ../data/elements.xml.in.h:49 msgid "Indium" msgstr "铟" #: ../data/elements.xml.in.h:50 msgid "Tin" msgstr "锡" #: ../data/elements.xml.in.h:51 msgid "Antimony" msgstr "锑" #: ../data/elements.xml.in.h:52 msgid "Tellurium" msgstr "碲" #: ../data/elements.xml.in.h:53 msgid "Iodine" msgstr "碘" #: ../data/elements.xml.in.h:54 msgid "Xenon" msgstr "æ°™" #: ../data/elements.xml.in.h:55 msgid "Cesium" msgstr "铯" #: ../data/elements.xml.in.h:56 msgid "Barium" msgstr "é’¡" #: ../data/elements.xml.in.h:57 msgid "Lanthanum" msgstr "é•§" #: ../data/elements.xml.in.h:58 msgid "Cerium" msgstr "铈" #: ../data/elements.xml.in.h:59 msgid "Praseodymium" msgstr "镨" #: ../data/elements.xml.in.h:60 msgid "Neodymium" msgstr "é’•" #: ../data/elements.xml.in.h:61 msgid "Promethium" msgstr "é’·" #: ../data/elements.xml.in.h:62 msgid "Samarium" msgstr "é’" #: ../data/elements.xml.in.h:63 msgid "Europium" msgstr "é“•" #: ../data/elements.xml.in.h:64 msgid "Gadolinium" msgstr "é’†" #: ../data/elements.xml.in.h:65 msgid "Terbium" msgstr "铽" #: ../data/elements.xml.in.h:66 msgid "Dysprosium" msgstr "é•" #: ../data/elements.xml.in.h:67 msgid "Holmium" msgstr "é’¬" #: ../data/elements.xml.in.h:68 msgid "Erbium" msgstr "é“’" #: ../data/elements.xml.in.h:69 msgid "Thulium" msgstr "é“¥" #: ../data/elements.xml.in.h:70 msgid "Ytterbium" msgstr "镱" #: ../data/elements.xml.in.h:71 msgid "Lutetium" msgstr "é•¥" #: ../data/elements.xml.in.h:72 msgid "Hafnium" msgstr "铪" #: ../data/elements.xml.in.h:73 msgid "Tantalum" msgstr "é’½" #: ../data/elements.xml.in.h:74 msgid "Tungsten" msgstr "é’¨" #: ../data/elements.xml.in.h:75 msgid "Rhenium" msgstr "铼" #: ../data/elements.xml.in.h:76 msgid "Osmium" msgstr "锇" #: ../data/elements.xml.in.h:77 msgid "Iridium" msgstr "铱" #: ../data/elements.xml.in.h:78 msgid "Platinum" msgstr "é“‚" #: ../data/elements.xml.in.h:79 msgid "Gold" msgstr "金" #. Chemical element #: ../data/elements.xml.in.h:81 msgid "!elements!Mercury" msgstr "汞" #: ../data/elements.xml.in.h:82 msgid "Thallium" msgstr "铊" #: ../data/elements.xml.in.h:83 msgid "Lead" msgstr "é“…" #: ../data/elements.xml.in.h:84 msgid "Bismuth" msgstr "é“‹" #: ../data/elements.xml.in.h:85 msgid "Polonium" msgstr "é’‹" #: ../data/elements.xml.in.h:86 msgid "Astatine" msgstr "ç ¹" #: ../data/elements.xml.in.h:87 msgid "Radon" msgstr "æ°¡" #: ../data/elements.xml.in.h:88 msgid "Francium" msgstr "é’«" #: ../data/elements.xml.in.h:89 msgid "Radium" msgstr "é•­" #: ../data/elements.xml.in.h:90 msgid "Actinium" msgstr "锕" #: ../data/elements.xml.in.h:91 msgid "Thorium" msgstr "é’" #: ../data/elements.xml.in.h:92 msgid "Protactinium" msgstr "镤" #: ../data/elements.xml.in.h:93 msgid "Uranium" msgstr "é“€" #: ../data/elements.xml.in.h:94 msgid "Neptunium" msgstr "镎" #: ../data/elements.xml.in.h:95 msgid "Plutonium" msgstr "é’š" #: ../data/elements.xml.in.h:96 msgid "Americium" msgstr "é•…" #: ../data/elements.xml.in.h:97 msgid "Curium" msgstr "é””" #: ../data/elements.xml.in.h:98 msgid "Berkelium" msgstr "锫" #: ../data/elements.xml.in.h:99 msgid "Californium" msgstr "锎" #: ../data/elements.xml.in.h:100 msgid "Einsteinium" msgstr "锿" #: ../data/elements.xml.in.h:101 msgid "Fermium" msgstr "é•„" #: ../data/elements.xml.in.h:102 msgid "Mendelevium" msgstr "é’”" #: ../data/elements.xml.in.h:103 msgid "Nobelium" msgstr "锘" #: ../data/elements.xml.in.h:104 msgid "Lawrencium" msgstr "铹" #: ../data/elements.xml.in.h:105 msgid "Rutherfordium" msgstr "" #: ../data/elements.xml.in.h:106 msgid "Dubnium" msgstr "" #: ../data/elements.xml.in.h:107 msgid "Seaborgium" msgstr "" #: ../data/elements.xml.in.h:108 msgid "Bohrium" msgstr "" #: ../data/elements.xml.in.h:109 msgid "Hassium" msgstr "" #: ../data/elements.xml.in.h:110 msgid "Meitnerium" msgstr "" #: ../data/elements.xml.in.h:111 msgid "Darmstadtium" msgstr "" #: ../data/elements.xml.in.h:112 msgid "Roentgenium" msgstr "" #: ../data/elements.xml.in.h:113 msgid "Copernicium" msgstr "" #: ../data/elements.xml.in.h:114 #, fuzzy msgid "Nihonium" msgstr "锆" #: ../data/elements.xml.in.h:115 msgid "Flerovium" msgstr "" #: ../data/elements.xml.in.h:116 msgid "Moscovium" msgstr "" #: ../data/elements.xml.in.h:117 msgid "Livermorium" msgstr "" #: ../data/elements.xml.in.h:118 #, fuzzy msgid "Tennessine" msgstr "回归分æž" #: ../data/elements.xml.in.h:119 msgid "Oganesson" msgstr "" #: ../data/functions.xml.in.h:1 msgid "Matrices & Vectors" msgstr "矩阵与å‘é‡" #: ../data/functions.xml.in.h:2 msgid "Construct Vector" msgstr "构造å‘é‡" #: ../data/functions.xml.in.h:3 msgid "r:vector" msgstr "" #: ../data/functions.xml.in.h:4 msgid "Returns a vector with listed elements." msgstr "使用列出的元素生æˆä¸€ä¸ªå‘é‡å¹¶è¿”回。" #. Vector/matrix elements #: ../data/functions.xml.in.h:6 msgid "Elements" msgstr "多个元素" #: ../data/functions.xml.in.h:7 msgid "Generate Vector" msgstr "生æˆå‘é‡" #: ../data/functions.xml.in.h:8 msgid "r:genvector" msgstr "" #: ../data/functions.xml.in.h:9 msgid "" "Returns a vector generated from a function with a variable (default x) " "running from min to max. The fourth argument is either the requested number " "of elements if the sixth argument is false (default) or the step between " "each value of the variable." msgstr "" "æ ¹æ®æŒ‡å®šçš„自å˜é‡(缺çœä¸ºx)和数æ®èŒƒå›´ï¼Œç”¨æŒ‡å®šå‡½æ•°çš„值生æˆä¸€ä¸ªå‘é‡å¹¶è¿”回。如果第" "å…­ä¸ªå‚æ•°æ˜¯å‡(缺çœå€¼)ï¼Œåˆ™ç¬¬å››ä¸ªå‚æ•°è¡¨ç¤ºéœ€è¦çš„元素个数;å¦åˆ™ï¼Œç¬¬å››ä¸ª 傿•°è¡¨ç¤ºå˜" "釿¯ä¸ªå€¼ä¹‹é—´çš„æ­¥é•¿ã€‚" #: ../data/functions.xml.in.h:10 msgid "Function" msgstr "函数" #: ../data/functions.xml.in.h:11 msgid "Min" msgstr "最å°å€¼" #: ../data/functions.xml.in.h:12 msgid "Max" msgstr "最大值" #: ../data/functions.xml.in.h:13 msgid "Dimension / Step size" msgstr "ç»´æ•°/步长" #: ../data/functions.xml.in.h:14 msgid "Variable" msgstr "å˜é‡" #: ../data/functions.xml.in.h:15 msgid "Use step size" msgstr "使用步长" #: ../data/functions.xml.in.h:16 msgid "Sort" msgstr "排åº" #: ../data/functions.xml.in.h:17 msgid "r:sort" msgstr "" #: ../data/functions.xml.in.h:18 #, fuzzy msgid "Returns a sorted vector." msgstr "å°†RPN栈作为å‘é‡è¿”回。" #: ../data/functions.xml.in.h:19 msgid "Vector" msgstr "å‘é‡" #: ../data/functions.xml.in.h:20 msgid "Ascending" msgstr "å‡åº" #: ../data/functions.xml.in.h:21 msgid "Rank" msgstr "" #: ../data/functions.xml.in.h:22 msgid "r:rank" msgstr "" #: ../data/functions.xml.in.h:23 #, fuzzy msgid "" "Returns a vector with values of elements replaced with their mutual ranks." msgstr "将两个å‘é‡åˆæˆä¸€ä¸ªå¹¶è¿”回。" #: ../data/functions.xml.in.h:24 msgid "Vector Limits" msgstr "å‘é‡é™" #: ../data/functions.xml.in.h:25 msgid "r:limits" msgstr "" #: ../data/functions.xml.in.h:26 msgid "Returns a part of a vector between two positions." msgstr "返回一个å‘é‡ä¸¤ä¸ªä½ç½®ä¹‹é—´çš„一部分。" #: ../data/functions.xml.in.h:27 msgid "Lower limit" msgstr "下é™" #: ../data/functions.xml.in.h:28 msgid "Upper limit" msgstr "上é™" #: ../data/functions.xml.in.h:29 msgid "Dimension" msgstr "ç»´æ•°" #: ../data/functions.xml.in.h:30 msgid "r:dimension" msgstr "" #: ../data/functions.xml.in.h:31 msgid "Returns the number of elements in a vector." msgstr "返回一个å‘é‡å†…的元素数é‡ã€‚" #: ../data/functions.xml.in.h:32 msgid "Merge Vectors" msgstr "åˆå¹¶å‘é‡" #: ../data/functions.xml.in.h:33 msgid "r:mergevectors" msgstr "" #: ../data/functions.xml.in.h:34 msgid "Returns a vector with the elements from two vectors." msgstr "将两个å‘é‡åˆæˆä¸€ä¸ªå¹¶è¿”回。" #: ../data/functions.xml.in.h:35 msgid "Vector 1" msgstr "å‘é‡1" #: ../data/functions.xml.in.h:36 msgid "Vector 2" msgstr "å‘é‡2" #: ../data/functions.xml.in.h:37 msgid "Construct Matrix" msgstr "构造矩阵" #: ../data/functions.xml.in.h:38 msgid "r:matrix" msgstr "" #: ../data/functions.xml.in.h:39 msgid "" "Returns a matrix with specified dimensions and listed elements. Omitted " "elements are set to zero." msgstr "æ ¹æ®æŒ‡å®šçš„维数和列出的元素返回一个矩阵。çœç•¥è¢«è®¾ä¸ºé›¶çš„元素。" #: ../data/functions.xml.in.h:40 msgid "Rows" msgstr "行" #: ../data/functions.xml.in.h:41 msgid "Columns" msgstr "列" #: ../data/functions.xml.in.h:42 msgid "Convert Matrix to Vector" msgstr "将矩阵转æ¢ä¸ºå‘é‡" #: ../data/functions.xml.in.h:43 msgid "r:matrix2vector" msgstr "" #: ../data/functions.xml.in.h:44 msgid "Puts each element of a matrix in vertical order in a vector." msgstr "将按照垂直顺åºå°†çŸ©é˜µä¸­çš„æ¯ä¸ªå…ƒç´ æ”¾åˆ°å‘é‡ä¸­ã€‚" #: ../data/functions.xml.in.h:45 msgid "Matrix" msgstr "矩阵" #: ../data/functions.xml.in.h:46 msgid "Matrix Area" msgstr "å­çŸ©é˜µ" #. Matrix area #: ../data/functions.xml.in.h:48 msgid "r:area" msgstr "" #: ../data/functions.xml.in.h:49 msgid "Returns a part of a matrix." msgstr "返回矩阵的一部分。" #: ../data/functions.xml.in.h:50 msgid "Start row" msgstr "起始行" #: ../data/functions.xml.in.h:51 msgid "Start column" msgstr "起始列" #: ../data/functions.xml.in.h:52 msgid "End row" msgstr "结æŸè¡Œ" #: ../data/functions.xml.in.h:53 msgid "End column" msgstr "结æŸåˆ—" #: ../data/functions.xml.in.h:54 msgid "r:rows" msgstr "" #: ../data/functions.xml.in.h:55 msgid "Returns the number of rows in a matrix." msgstr "返回矩阵中的行数。" #: ../data/functions.xml.in.h:56 msgid "r:columns" msgstr "" #: ../data/functions.xml.in.h:57 msgid "Returns the number of columns in a matrix." msgstr "返回矩阵的列数。" #: ../data/functions.xml.in.h:58 msgid "Extract row as vector" msgstr "将行æå–为å‘é‡" #: ../data/functions.xml.in.h:59 msgid "r:row" msgstr "" #: ../data/functions.xml.in.h:60 msgid "Returns a row in a matrix as a vector." msgstr "将矩阵的一行作为å‘é‡è¿”回。" #: ../data/functions.xml.in.h:61 msgid "Row" msgstr "行" #: ../data/functions.xml.in.h:62 msgid "Extract Column as Vector" msgstr "将列æå–为å‘é‡" #: ../data/functions.xml.in.h:63 msgid "r:column" msgstr "" #: ../data/functions.xml.in.h:64 msgid "Returns a column in a matrix as a vector." msgstr "将矩阵的一列作为å‘é‡è¿”回。" #: ../data/functions.xml.in.h:65 msgid "Column" msgstr "列" #: ../data/functions.xml.in.h:66 msgid "r:elements" msgstr "" #: ../data/functions.xml.in.h:67 msgid "Returns the number of elements in a matrix or vector." msgstr "返回一个矩阵或å‘é‡å†…的元素数目。" #: ../data/functions.xml.in.h:68 msgid "Matrix or vector" msgstr "矩阵或å‘é‡" #. Vector/matrix element #: ../data/functions.xml.in.h:70 msgid "Element" msgstr "一个元素" #: ../data/functions.xml.in.h:71 msgid "r:element" msgstr "" #: ../data/functions.xml.in.h:72 msgid "" "Returns the element at specified position in a matrix (row and column) or " "vector (index)." msgstr "返回矩阵(行和列)或å‘é‡(下标)指定ä½ç½®ä¸Šçš„元素。" #: ../data/functions.xml.in.h:73 msgid "Matrix/vector" msgstr "矩阵/å‘é‡" #: ../data/functions.xml.in.h:74 msgid "Row/index" msgstr "行/下标" #: ../data/functions.xml.in.h:75 msgid "Transpose" msgstr "转置" #: ../data/functions.xml.in.h:76 msgid "r:transpose" msgstr "" #: ../data/functions.xml.in.h:77 msgid "Returns the transpose of a matrix." msgstr "返回矩阵的转置。" #: ../data/functions.xml.in.h:78 msgid "Identity" msgstr "å•ä½çŸ©é˜µ" #: ../data/functions.xml.in.h:79 msgid "r:identity" msgstr "" #: ../data/functions.xml.in.h:80 msgid "" "Returns the identity matrix of a matrix or with specified number of rows/" "columns." msgstr "返回指定行/列数或与指定矩阵åŒé˜¶çš„å•ä½çŸ©é˜µã€‚" #: ../data/functions.xml.in.h:81 msgid "Matrix or rows/columns" msgstr "矩阵或行/列" #: ../data/functions.xml.in.h:82 msgid "Determinant" msgstr "行列å¼" #: ../data/functions.xml.in.h:83 msgid "r:det" msgstr "" #: ../data/functions.xml.in.h:84 msgid "Calculates the determinant of a matrix." msgstr "计算矩阵的行列å¼ã€‚" #: ../data/functions.xml.in.h:85 msgid "Permanent" msgstr "积和å¼" #: ../data/functions.xml.in.h:86 msgid "r:permanent" msgstr "" #: ../data/functions.xml.in.h:87 msgid "" "Calculates the permanent of a matrix. The permanent differs from a " "determinant in that all signs in the expansion by minors are taken as " "positive." msgstr "" "计算矩阵的积和å¼ã€‚积和å¼ä¸Žè¡Œåˆ—å¼çš„ä¸åŒä¹‹å¤„在于,在展开时,所有展开å¼å‰é¢çš„符" "å·éƒ½ä¸ºæ­£ã€‚" #: ../data/functions.xml.in.h:88 msgid "Adjugate (Adjoint)" msgstr "ä¼´éšçŸ©é˜µ" #: ../data/functions.xml.in.h:89 msgid "r:adj" msgstr "" #: ../data/functions.xml.in.h:90 msgid "Calculates the adjugate or adjoint of a matrix." msgstr "计算矩阵的伴éšçŸ©é˜µ" #: ../data/functions.xml.in.h:91 msgid "Cofactor" msgstr "余因å­" #: ../data/functions.xml.in.h:92 msgid "r:cofactor" msgstr "" #: ../data/functions.xml.in.h:93 msgid "Calculates the cofactor of the element at specified position." msgstr "计算指定ä½ç½®å…ƒç´ çš„余因å­ã€‚" #: ../data/functions.xml.in.h:94 msgid "Matrix Inverse" msgstr "求逆矩阵" #: ../data/functions.xml.in.h:95 msgid "r:inverse" msgstr "" #: ../data/functions.xml.in.h:96 msgid "" "Calculates the inverse of a matrix. The inverse is the matrix that " "multiplied by the original matrix equals the identity matrix (AB = BA = I)." msgstr "" "计算矩阵的逆。矩阵的逆是一个与原矩阵相乘等于å•ä½çŸ©é˜µçš„矩阵。(AB = BA = I)。" #: ../data/functions.xml.in.h:97 msgid "Load CSV File" msgstr "载入CSV文件" #: ../data/functions.xml.in.h:98 msgid "r:load" msgstr "" #: ../data/functions.xml.in.h:99 msgid "Returns a matrix imported from a CSV data file." msgstr "返回从CSVæ•°æ®æ–‡ä»¶å¯¼å…¥çš„矩阵" #: ../data/functions.xml.in.h:100 msgid "Filename" msgstr "文件å" #: ../data/functions.xml.in.h:101 msgid "First data row" msgstr "第一行数æ®" #: ../data/functions.xml.in.h:102 msgid "Separator" msgstr "分隔符" #: ../data/functions.xml.in.h:103 msgid "Export To CSV File" msgstr "导出到CSV文件" #: ../data/functions.xml.in.h:104 msgid "r:export" msgstr "" #: ../data/functions.xml.in.h:105 msgid "Exports a matrix to a CSV data file." msgstr "将矩阵导出到CSVæ•°æ®æ–‡ä»¶" #: ../data/functions.xml.in.h:106 #, fuzzy msgid "Magnitude" msgstr "é•" #: ../data/functions.xml.in.h:107 msgid "r:magnitude" msgstr "" #: ../data/functions.xml.in.h:108 msgid "" "Calculates the magnitude of a value. This function returns the same value as " "abs() for all values except vectors." msgstr "" #: ../data/functions.xml.in.h:109 msgid "Value" msgstr "值" #: ../data/functions.xml.in.h:110 #, fuzzy msgid "Hadamard Product" msgstr "å‘é‡ç§¯" #: ../data/functions.xml.in.h:111 msgid "r:hadamard" msgstr "" #: ../data/functions.xml.in.h:112 msgid "" "Mulitplies each separate element in matrix 1 with the corresponding element " "in matrix 2." msgstr "" #: ../data/functions.xml.in.h:113 #, fuzzy msgid "Matrix 1" msgstr "矩阵" #: ../data/functions.xml.in.h:114 #, fuzzy msgid "Matrix 2" msgstr "矩阵" #: ../data/functions.xml.in.h:115 #, fuzzy msgid "Entrywise Function" msgstr "函数" #: ../data/functions.xml.in.h:116 msgid "r:entrywise" msgstr "" #: ../data/functions.xml.in.h:117 msgid "" "Calculates a new matrix or vector using each separate element in matrix/" "vector 1 and the corresponding (in the same row and column) elements in " "matrix/vector 2. An unlimited number of matrices/vectors can be specified, " "with each matrix/vector argument followed by the corresponding variable used " "in the function argument." msgstr "" #: ../data/functions.xml.in.h:118 #, fuzzy msgid "Matrices/vectors and variables" msgstr "å‘é‡å˜é‡" #: ../data/functions.xml.in.h:119 msgid "Norm (length)" msgstr "范数(长度)" #: ../data/functions.xml.in.h:120 msgid "r:norm" msgstr "" #: ../data/functions.xml.in.h:121 msgid "Calculates the norm/length of a vector." msgstr "计算å‘é‡çš„范数/长度。" #: ../data/functions.xml.in.h:122 msgid "Cross Product" msgstr "å‘é‡ç§¯" #: ../data/functions.xml.in.h:123 msgid "r:cross" msgstr "" #: ../data/functions.xml.in.h:124 msgid "Calculates the cross product of two 3-dimensional vectors." msgstr "计算两个三维å‘é‡çš„å‘é‡ç§¯" #: ../data/functions.xml.in.h:125 msgid "Combinatorics" msgstr "组åˆå­¦" #: ../data/functions.xml.in.h:126 msgid "Factorial" msgstr "阶乘" #: ../data/functions.xml.in.h:127 msgid "" "Calculates the factorial of an integer. Multiplies the argument with every " "lesser positive integer (n(n-1)(n-2)...2*1). Can also be entered as a number " "followed by one exclamation mark." msgstr "" "计算整数的阶乘,å³n(n-1)(n-2)...2*1。也å¯ä»¥ç”¨æ•´æ•°åŽé¢è·Ÿä¸€ä¸ª\"!\"æ¥ è¡¨ç¤ºã€‚" #: ../data/functions.xml.in.h:128 msgid "r:factorial" msgstr "" #: ../data/functions.xml.in.h:129 msgid "Double Factorial" msgstr "åŒé˜¶ä¹˜" #: ../data/functions.xml.in.h:130 msgid "r:factorial2" msgstr "" #: ../data/functions.xml.in.h:131 msgid "" "Calculates the double factorial of an integer. Multiplies the argument with " "every second lesser positive integer (n(n-2)(n-4)...). Can also be entered " "as a number followed by two exclamation marks." msgstr "" "计算整数的åŒé˜¶ä¹˜ã€‚å³n(n-2)(n-4)....。也å¯ä»¥ç”¨æ•´æ•°åŽé¢è¿žè¾“两个\"!\"æ¥ è¡¨ç¤ºã€‚" #: ../data/functions.xml.in.h:132 msgid "Multifactorial" msgstr "多阶乘" #: ../data/functions.xml.in.h:133 msgid "r:multifactorial" msgstr "" #: ../data/functions.xml.in.h:134 msgid "" "Calculates the multifactorial of an integer. Multiplies the argument with " "every x lesser positive integer (n(n-x)(n-2x)...). Can also be entered as a " "number followed by three or more exclamation marks." msgstr "" "计算整数的多阶乘,å³n(n-x)(n-2x)...。也å¯ä»¥ç”¨åœ¨æ•´æ•°åŽé¢è·Ÿä¸‰ä¸ªæˆ–多个\"!\"æ¥è¡¨" "示。" #: ../data/functions.xml.in.h:135 msgid "Binomial Coefficient" msgstr "二项å¼ç³»æ•°" #: ../data/functions.xml.in.h:136 msgid "r:binomial" msgstr "" #: ../data/functions.xml.in.h:137 msgid "Exponent" msgstr "指数" #: ../data/functions.xml.in.h:138 msgid "Index" msgstr "下标" #: ../data/functions.xml.in.h:139 msgid "Hyperfactorial" msgstr "hyper阶乘" #: ../data/functions.xml.in.h:140 msgid "r:hyperfactorial" msgstr "" #: ../data/functions.xml.in.h:141 msgid "" "Calculates the hyperfactorial of an integer. Multiplies the argument raised " "by itself with every lesser positive integer raised by themselves (1^1 * " "2^2 ... n^n)." msgstr "计算整数的hyper阶乘,å³(1^1 * 2^2 ... n^n)。" #: ../data/functions.xml.in.h:142 msgid "Superfactorial" msgstr "超级阶乘" #: ../data/functions.xml.in.h:143 msgid "r:superfactorial" msgstr "" #: ../data/functions.xml.in.h:144 msgid "" "Calculates the superfactorial of an integer. Multiplies the factorial of the " "argument with the factorial of every lesser positive integer (1! * 2! ... " "n!)." msgstr "计算整数的超级阶乘,å³1! * 2! ... n!。" #: ../data/functions.xml.in.h:145 msgid "Permutations (Variations)" msgstr "排列" #: ../data/functions.xml.in.h:146 msgid "r:perm,variations" msgstr "" #: ../data/functions.xml.in.h:147 msgid "" "Returns the number of possible arrangements of an ordered list with a number " "of objects to choose from and a list size. If there are three objects (1, 2 " "and 3) that is put in a list with two positions, the alternatives are [1, " "2], [2, 1], [1, 3], [3, 1], [2, 3] and [3, 2], and thus the number of " "permutations is 6." msgstr "" "返回排列数,å³ä»ŽåŒ…嫿Œ‡å®šæ•°é‡å¯¹è±¡çš„集åˆä¸­é€‰æ‹©æŒ‡å®šæ•°é‡ä¸ªå…ƒç´ ç”Ÿæˆæœ‰åºåˆ—表,所能" "ç”Ÿæˆ çš„æ‰€æœ‰ä¸åŒæœ‰åºåˆ—表的个数。例如,如果集åˆä¸­æœ‰ä¸‰ä¸ªå…ƒç´ (1,2å’Œ3),从中任选两" "ä¸ªå…ƒç´ ç”Ÿæˆ æœ‰åºåˆ—表,å¯èƒ½çš„列表为[1, 2], [2, 1], [1, 3], [3, 1], [2, 3] and " "[3, 2],因此排列数为6。" #: ../data/functions.xml.in.h:148 msgid "Objects" msgstr "对象个数" #: ../data/functions.xml.in.h:149 msgid "Size" msgstr "大å°" #: ../data/functions.xml.in.h:150 msgid "Combinations" msgstr "组åˆ" #: ../data/functions.xml.in.h:151 msgid "r:comb" msgstr "" #: ../data/functions.xml.in.h:152 msgid "" "Returns the number of possible arrangements of an unordered list with a " "number of objects to choose from and a list size. If there are three objects " "(1, 2 and 3) that is put in a list with place for two, the alternatives are " "[1, 2], [1, 3], and [2, 3], and thus the number of combinations is 3." msgstr "" "è¿”å›žç»„åˆæ•°ï¼Œå³ä»ŽåŒ…嫿Œ‡å®šæ•°é‡å¯¹è±¡çš„集åˆä¸­é€‰æ‹©æŒ‡å®šæ•°é‡ä¸ªå…ƒç´ ç”Ÿæˆæ— åºåˆ—表,所能" "ç”Ÿæˆ çš„æ‰€æœ‰ä¸åŒæ— åºåˆ—表的个数。例如,如果集åˆä¸­æœ‰ä¸‰ä¸ªå…ƒç´ (1,2å’Œ3),从中任选两" "ä¸ªå…ƒç´ ç”Ÿæˆ æœ‰åºåˆ—表,å¯èƒ½çš„列表为[1, 2], [1, 3], and [2, 3]ï¼Œå› æ­¤ç»„åˆæ•°ä¸º3。" #: ../data/functions.xml.in.h:153 msgid "Derangements" msgstr "é‡æŽ’æ•°" #: ../data/functions.xml.in.h:154 msgid "r:derangements" msgstr "" #: ../data/functions.xml.in.h:155 msgid "" "Returns the number of possible rearrangements of an ordered list, of a " "certain size, where none of the objects are on their original position. If " "the original list is [1, 2, 3], the possible derangements are [2, 3, 1] and " "[3, 1, 2], and thus the number of derangements is 2." msgstr "" "è¿”å›žé‡æŽ’æ•°ï¼Œå³å¯¹ç»™å®šåˆ—è¡¨ä¸­çš„å…ƒç´ é‡æ–°æŽ’列,并且é™å®šæ¯ä¸ªå…ƒç´ éƒ½ä¸èƒ½åœ¨åŽŸæ¥çš„ä½ç½® " "上,所得的列表数é‡ã€‚例如,如果原始列表为[1,2,3],则å¯èƒ½çš„é‡æŽ’åˆ—è¡¨ä¸º[2, 3, 1]" "å’Œ[3, 1, 2]ã€‚å› æ­¤é‡æŽ’æ•°ä¸º2。" #: ../data/functions.xml.in.h:156 msgid "Number of elements" msgstr "元素个数" #: ../data/functions.xml.in.h:157 msgid "Number Theory" msgstr "数论" #: ../data/functions.xml.in.h:158 msgid "Absolute Value" msgstr "ç»å¯¹å€¼" #: ../data/functions.xml.in.h:159 msgid "r:abs" msgstr "" #: ../data/functions.xml.in.h:160 msgid "Arithmetic" msgstr "算术" #: ../data/functions.xml.in.h:161 msgid "Signum" msgstr "符å·å‡½æ•°" #: ../data/functions.xml.in.h:162 msgid "r:sgn" msgstr "" #. A numerical value #: ../data/functions.xml.in.h:164 msgid "Number" msgstr "æ•°å­—" #: ../data/functions.xml.in.h:165 msgid "Value for zero" msgstr "" #: ../data/functions.xml.in.h:166 msgid "Numerator" msgstr "分å­" #: ../data/functions.xml.in.h:167 msgid "r:numerator" msgstr "" #: ../data/functions.xml.in.h:168 msgid "Denominator" msgstr "分æ¯" #: ../data/functions.xml.in.h:169 msgid "r:denominator" msgstr "" #: ../data/functions.xml.in.h:170 msgid "Remainder" msgstr "余数" #: ../data/functions.xml.in.h:171 msgid "r:rem" msgstr "" #: ../data/functions.xml.in.h:172 msgid "Modulus" msgstr "模" #: ../data/functions.xml.in.h:173 msgid "r:mod" msgstr "" #: ../data/functions.xml.in.h:174 msgid "Negate" msgstr "éž" #: ../data/functions.xml.in.h:175 msgid "r:neg" msgstr "" #: ../data/functions.xml.in.h:176 msgid "Reciprocal" msgstr "倒数" #: ../data/functions.xml.in.h:177 msgid "r:inv" msgstr "" #: ../data/functions.xml.in.h:178 msgid "Multiply" msgstr "乘" #: ../data/functions.xml.in.h:179 msgid "r:multiply" msgstr "" #: ../data/functions.xml.in.h:180 msgid "Factors" msgstr "å› å­" #: ../data/functions.xml.in.h:181 msgid "Add" msgstr "加" #: ../data/functions.xml.in.h:182 msgid "r:add" msgstr "" #: ../data/functions.xml.in.h:183 msgid "Terms" msgstr "项" #: ../data/functions.xml.in.h:184 msgid "Subtract" msgstr "å‡" #: ../data/functions.xml.in.h:185 msgid "r:subtract" msgstr "" #: ../data/functions.xml.in.h:186 msgid "Divide" msgstr "除" #: ../data/functions.xml.in.h:187 msgid "r:divide" msgstr "" #: ../data/functions.xml.in.h:188 msgid "Raise" msgstr "乘方" #: ../data/functions.xml.in.h:189 msgid "r:raise" msgstr "" #: ../data/functions.xml.in.h:190 msgid "Base" msgstr "基/底" #: ../data/functions.xml.in.h:191 msgid "Polynomials" msgstr "多项å¼" #: ../data/functions.xml.in.h:192 msgid "Coefficient" msgstr "系数" #: ../data/functions.xml.in.h:193 msgid "r:coeff" msgstr "" #: ../data/functions.xml.in.h:194 msgid "Polynomial" msgstr "多项å¼" #: ../data/functions.xml.in.h:195 msgid "Leading Coefficient" msgstr "首项系数" #: ../data/functions.xml.in.h:196 msgid "r:lcoeff" msgstr "" #: ../data/functions.xml.in.h:197 msgid "Trailing Coefficient" msgstr "末项系数" #: ../data/functions.xml.in.h:198 msgid "r:tcoeff" msgstr "" #: ../data/functions.xml.in.h:199 msgid "Polynomial Degree" msgstr "å¤šé¡¹å¼æ¬¡æ•°" #: ../data/functions.xml.in.h:200 msgid "r:degree" msgstr "" #: ../data/functions.xml.in.h:201 msgid "Lowest Degree (Valuation)" msgstr "末项次数(估计)" #: ../data/functions.xml.in.h:202 msgid "r:ldegree" msgstr "" #: ../data/functions.xml.in.h:203 msgid "Content Part" msgstr "常数公因å­" #: ../data/functions.xml.in.h:204 msgid "r:pcontent" msgstr "" #: ../data/functions.xml.in.h:205 msgid "Primitive Part" msgstr "原始部分" #: ../data/functions.xml.in.h:206 msgid "r:primpart" msgstr "" #: ../data/functions.xml.in.h:207 msgid "Unit Part" msgstr "å•ä½éƒ¨åˆ†" #: ../data/functions.xml.in.h:208 msgid "r:punit" msgstr "" #: ../data/functions.xml.in.h:209 msgid "Greatest Common Divisor" msgstr "最大公约数" #: ../data/functions.xml.in.h:210 msgid "r:gcd" msgstr "" #: ../data/functions.xml.in.h:211 msgid "1st value" msgstr "值1" #: ../data/functions.xml.in.h:212 msgid "2nd value" msgstr "值2" #: ../data/functions.xml.in.h:213 msgid "Least Common Multiple" msgstr "最å°å…¬å€æ•°" #: ../data/functions.xml.in.h:214 msgid "r:lcm" msgstr "" #: ../data/functions.xml.in.h:215 msgid "Fibonacci Number" msgstr "" #: ../data/functions.xml.in.h:216 msgid "r:fibonacci" msgstr "" #: ../data/functions.xml.in.h:217 msgid "Returns the n-th term of the Fibonacci sequence." msgstr "" #: ../data/functions.xml.in.h:218 #, fuzzy msgid "Index (n)" msgstr "下标" #: ../data/functions.xml.in.h:219 msgid "Rounding" msgstr "å–æ•´" #: ../data/functions.xml.in.h:220 msgid "Round" msgstr "å–æ•´" #: ../data/functions.xml.in.h:221 msgid "r:round" msgstr "" #: ../data/functions.xml.in.h:222 msgid "Round Downwards" msgstr "å‘䏋喿•´" #: ../data/functions.xml.in.h:223 msgid "r:floor" msgstr "" #: ../data/functions.xml.in.h:224 msgid "Round Upwards" msgstr "å‘ä¸Šå–æ•´" #: ../data/functions.xml.in.h:225 msgid "r:ceil" msgstr "" #: ../data/functions.xml.in.h:226 msgid "Round Towards Zero" msgstr "å‘é›¶å–æ•´" #: ../data/functions.xml.in.h:227 msgid "r:trunc" msgstr "" #: ../data/functions.xml.in.h:228 msgid "Extract Integer Part" msgstr "æå–整数部分" #: ../data/functions.xml.in.h:229 msgid "r:int" msgstr "" #: ../data/functions.xml.in.h:230 msgid "Extract Fractional Part" msgstr "æå–分数部分" #: ../data/functions.xml.in.h:231 msgid "r:frac" msgstr "" #: ../data/functions.xml.in.h:232 msgid "Number Bases" msgstr "数字进制" #: ../data/functions.xml.in.h:233 msgid "Number Base" msgstr "数字进制" #: ../data/functions.xml.in.h:234 msgid "r:base" msgstr "" #: ../data/functions.xml.in.h:235 #, fuzzy msgid "" "Returns an value from an expression using a specified base between 2 and 36" msgstr "返回一个指定进制(2-36之间)数字的值" #: ../data/functions.xml.in.h:236 msgid "Binary" msgstr "二进制" #: ../data/functions.xml.in.h:237 msgid "r:bin" msgstr "" #: ../data/functions.xml.in.h:238 msgid "" "Returns a value from a binary expression. If two's complement is true, " "numbers beginning with '1' is interpreted as negative binary numbers using " "two's complement." msgstr "" #: ../data/functions.xml.in.h:239 msgid "Binary number" msgstr "二进制数" #: ../data/functions.xml.in.h:240 msgid "Two's complement" msgstr "" #: ../data/functions.xml.in.h:241 msgid "Octal" msgstr "八进制" #: ../data/functions.xml.in.h:242 msgid "r:oct" msgstr "" #: ../data/functions.xml.in.h:243 #, fuzzy msgid "Returns a value from an octal expression." msgstr "返回一个å六进制数字表示的数值" #: ../data/functions.xml.in.h:244 msgid "Octal number" msgstr "八进制数" #: ../data/functions.xml.in.h:245 msgid "Hexadecimal" msgstr "å六进制" #: ../data/functions.xml.in.h:246 msgid "r:hex" msgstr "" #: ../data/functions.xml.in.h:247 #, fuzzy msgid "Returns a value from a hexadecimal expression." msgstr "返回一个å六进制数字表示的数值" #: ../data/functions.xml.in.h:248 msgid "Hexadecimal number" msgstr "å六进制数" #: ../data/functions.xml.in.h:249 msgid "Integers" msgstr "æ•´æ•°" #: ../data/functions.xml.in.h:250 msgid "Even" msgstr "å¶" #: ../data/functions.xml.in.h:251 msgid "r:even" msgstr "" #: ../data/functions.xml.in.h:252 msgid "Odd" msgstr "奇" #: ../data/functions.xml.in.h:253 msgid "r:odd" msgstr "" #: ../data/functions.xml.in.h:254 msgid "Step Functions" msgstr "阶梯函数" #: ../data/functions.xml.in.h:255 msgid "Heaviside Step Function" msgstr "Heaviside阶梯函数" #: ../data/functions.xml.in.h:256 msgid "r:heaviside,au:θ" msgstr "" #: ../data/functions.xml.in.h:257 msgid "" "Discontinuous function also known as \"unit step function\". Returns 0 if x " "< 0, 1 if x > 0, and 1/2 if x = 0." msgstr "" "间断函数也被称作是\" å•ä½é˜¶è·ƒå‡½æ•°\"。当 x < 0时值为0, x > 0时值为1, x " "= 0时则为1/2。" #: ../data/functions.xml.in.h:258 #, fuzzy msgid "Dirac Delta Function" msgstr "β函数" #: ../data/functions.xml.in.h:259 #, fuzzy msgid "r:dirac,au:δ" msgstr "ar:GBP,au:£" #: ../data/functions.xml.in.h:260 #, fuzzy msgid "Returns 0 if x is non-zero, and infinity if x is zero." msgstr "如果iä¸ç­‰äºŽj,返回0;如果i等于j,返回1。" #: ../data/functions.xml.in.h:261 msgid "Ramp Function" msgstr " æ–œå¡å‡½æ•°" #: ../data/functions.xml.in.h:262 msgid "r:ramp" msgstr "" #: ../data/functions.xml.in.h:263 msgid "Rectangular Function" msgstr "矩阵函数" #: ../data/functions.xml.in.h:264 msgid "r:rectangular" msgstr "" #: ../data/functions.xml.in.h:265 msgid "Sigmoid Function" msgstr "sigmoid函数" #: ../data/functions.xml.in.h:266 msgid "r:sigmoid" msgstr "" #: ../data/functions.xml.in.h:267 msgid "Logit Transformation" msgstr "Logitå˜æ¢" #: ../data/functions.xml.in.h:268 msgid "r:logit" msgstr "" #: ../data/functions.xml.in.h:269 msgid "Triangular Function" msgstr "三角函数" #: ../data/functions.xml.in.h:270 msgid "r:triangular" msgstr "" #: ../data/functions.xml.in.h:271 #, fuzzy msgid "Special Functions" msgstr "阶梯函数" #: ../data/functions.xml.in.h:272 msgid "Gamma Function" msgstr "γ函数" #: ../data/functions.xml.in.h:273 msgid "r:gamma" msgstr "" #: ../data/functions.xml.in.h:274 #, fuzzy msgid "Digamma Function" msgstr "γ函数" #: ../data/functions.xml.in.h:275 msgid "r:digamma,psi" msgstr "" #: ../data/functions.xml.in.h:276 msgid "Beta Function" msgstr "β函数" #: ../data/functions.xml.in.h:277 msgid "r:beta" msgstr "" #: ../data/functions.xml.in.h:278 #, fuzzy msgid "Error Function" msgstr "函数" #: ../data/functions.xml.in.h:279 msgid "r:erf" msgstr "" #: ../data/functions.xml.in.h:280 msgid "Complementary Error Function" msgstr "" #: ../data/functions.xml.in.h:281 msgid "r:erfc" msgstr "" #: ../data/functions.xml.in.h:282 #, fuzzy msgid "Polylogarithm" msgstr "自然对数" #: ../data/functions.xml.in.h:283 msgid "rc:Li,polylog" msgstr "" #: ../data/functions.xml.in.h:284 msgid "Order" msgstr "次数" #: ../data/functions.xml.in.h:285 #, fuzzy msgid "Argument" msgstr "自å˜é‡" #: ../data/functions.xml.in.h:286 #, fuzzy msgid "Airy Function" msgstr "函数" #: ../data/functions.xml.in.h:287 msgid "r:airy" msgstr "" #: ../data/functions.xml.in.h:288 msgid "Bessel Function of the First Kind" msgstr "" #: ../data/functions.xml.in.h:289 msgid "r:besselj" msgstr "" #: ../data/functions.xml.in.h:290 msgid "Bessel Function of the Second Kind" msgstr "" #: ../data/functions.xml.in.h:291 msgid "r:bessely" msgstr "" #: ../data/functions.xml.in.h:292 msgid "Riemann Zeta" msgstr "Riemann Zeta" #: ../data/functions.xml.in.h:293 msgid "r:zeta" msgstr "" #: ../data/functions.xml.in.h:294 msgid "Integral point" msgstr "积分点" #: ../data/functions.xml.in.h:295 msgid "Kronecker Delta" msgstr "Kronecker Delta" #: ../data/functions.xml.in.h:296 msgid "r:kronecker" msgstr "" #: ../data/functions.xml.in.h:297 msgid "Returns 0 if i != j and 1 if i = j." msgstr "如果iä¸ç­‰äºŽj,返回0;如果i等于j,返回1。" #: ../data/functions.xml.in.h:298 msgid "Value 1 (i)" msgstr "值1(i)" #: ../data/functions.xml.in.h:299 msgid "Value 2 (j)" msgstr "值2(i)" #: ../data/functions.xml.in.h:300 #, fuzzy msgid "Complex Numbers" msgstr "夿•°" #: ../data/functions.xml.in.h:301 msgid "Real Part" msgstr "实部" #: ../data/functions.xml.in.h:302 msgid "r:re" msgstr "" #: ../data/functions.xml.in.h:303 msgid "Complex number" msgstr "夿•°" #: ../data/functions.xml.in.h:304 msgid "Imaginary Part" msgstr "虚部" #: ../data/functions.xml.in.h:305 msgid "r:im" msgstr "" #: ../data/functions.xml.in.h:306 #, fuzzy msgid "Principal Argument" msgstr "本金" #: ../data/functions.xml.in.h:307 msgid "r:arg" msgstr "" #: ../data/functions.xml.in.h:308 #, fuzzy msgid "Complex Conjugate" msgstr "夿•°" #: ../data/functions.xml.in.h:309 #, fuzzy msgid "r:conj" msgstr "r:covalent" #: ../data/functions.xml.in.h:310 msgid "Exponents & Logarithms" msgstr "指数与对数" #: ../data/functions.xml.in.h:311 msgid "Square Root" msgstr "平方根" #: ../data/functions.xml.in.h:312 msgid "au:√,r:sqrt" msgstr "" #: ../data/functions.xml.in.h:313 msgid "" "Returns the principal square root (for positive values the positive root is " "returned)." msgstr "" #: ../data/functions.xml.in.h:314 msgid "Cube Root" msgstr "立方根" #: ../data/functions.xml.in.h:315 msgid "au:∛,r:cbrt" msgstr "" #: ../data/functions.xml.in.h:316 #, fuzzy msgid "Returns the third real root." msgstr "返回最大值。" #: ../data/functions.xml.in.h:317 msgid "Nth root" msgstr "N次方根" #: ../data/functions.xml.in.h:318 msgid "r:root" msgstr "" #: ../data/functions.xml.in.h:319 msgid "" "Returns the real root. For negative values the degree must be odd. Complex " "values are not allowed." msgstr "" #: ../data/functions.xml.in.h:320 ../data/units.xml.in.h:61 msgid "Degree" msgstr "度" #: ../data/functions.xml.in.h:321 msgid "Square" msgstr "正方形" #: ../data/functions.xml.in.h:322 msgid "r:sq" msgstr "" #: ../data/functions.xml.in.h:323 msgid "Exponential (e^x)" msgstr "e的乘方" #: ../data/functions.xml.in.h:324 msgid "r:exp" msgstr "" #: ../data/functions.xml.in.h:325 msgid "Natural Logarithm" msgstr "自然对数" #: ../data/functions.xml.in.h:326 msgid "r:ln" msgstr "" #: ../data/functions.xml.in.h:327 msgid "Base-N Logarithm" msgstr "以n为底的对数" #: ../data/functions.xml.in.h:328 msgid "r:log" msgstr "" #: ../data/functions.xml.in.h:329 msgid "Lambert W Function (Omega Function, Product Log)" msgstr "Lambert W函数(ω函数, Product Log)" #: ../data/functions.xml.in.h:330 msgid "r:lambertw,productlog" msgstr "r:lambertw,productlog" #: ../data/functions.xml.in.h:331 #, fuzzy msgid "" "Returns the inverse function for mx*e^x as ln() does for e^x. Only the " "principal branch and real valued results are currently supported." msgstr "返回函数mx*e^x的逆函数。" #: ../data/functions.xml.in.h:332 msgid "Branch" msgstr "" #: ../data/functions.xml.in.h:333 msgid "Base-2 Logarithm" msgstr "以2为底的对数" #: ../data/functions.xml.in.h:334 msgid "rs:log2" msgstr "" #: ../data/functions.xml.in.h:335 msgid "Returns the base n logarithm." msgstr "返回以n为底的对数。" #: ../data/functions.xml.in.h:336 msgid "Base-10 Logarithm" msgstr "以10为底的对数" #: ../data/functions.xml.in.h:337 msgid "rs:log10" msgstr "" #: ../data/functions.xml.in.h:338 msgid "Complex Exponential (Cis)" msgstr "夿Œ‡æ•°(Cis)" #: ../data/functions.xml.in.h:339 msgid "r:cis" msgstr "" #: ../data/functions.xml.in.h:340 msgid "2 raised to the power X" msgstr "2的乘方" #: ../data/functions.xml.in.h:341 msgid "rs:exp2" msgstr "" #: ../data/functions.xml.in.h:342 msgid "10 raised to the power X" msgstr "10的乘方" #: ../data/functions.xml.in.h:343 msgid "rs:exp10" msgstr "" #: ../data/functions.xml.in.h:344 msgid "X raised to the power Y" msgstr "Xçš„Y次方" #: ../data/functions.xml.in.h:345 msgid "r:pow" msgstr "" #: ../data/functions.xml.in.h:346 msgid "Square root (x * pi)" msgstr "平方根(x*π)" #: ../data/functions.xml.in.h:347 msgid "r:sqrtpi" msgstr "" #: ../data/functions.xml.in.h:348 msgid "Returns the non-negative square root of x * pi" msgstr "返回xπçš„éžè´Ÿå¹³æ–¹æ ¹" #: ../data/functions.xml.in.h:349 msgid "Non-negative value" msgstr "éžè´Ÿå€¼" #: ../data/functions.xml.in.h:350 msgid "Trigonometry" msgstr "三角学" #: ../data/functions.xml.in.h:351 msgid "Sine" msgstr "正弦" #: ../data/functions.xml.in.h:352 msgid "r:sin" msgstr "" #: ../data/functions.xml.in.h:353 msgid "Angle" msgstr "角度" #: ../data/functions.xml.in.h:354 msgid "Cosine" msgstr "余弦" #: ../data/functions.xml.in.h:355 msgid "r:cos" msgstr "" #: ../data/functions.xml.in.h:356 msgid "Tangent" msgstr "正切" #: ../data/functions.xml.in.h:357 msgid "r:tan" msgstr "" #: ../data/functions.xml.in.h:358 msgid "Inverse Sine" msgstr "åæ­£å¼¦" #: ../data/functions.xml.in.h:359 msgid "r:asin" msgstr "" #: ../data/functions.xml.in.h:360 msgid "Inverse Cosine" msgstr "å余弦" #: ../data/functions.xml.in.h:361 msgid "r:acos" msgstr "" #: ../data/functions.xml.in.h:362 msgid "Inverse Tangent" msgstr "åæ­£åˆ‡" #: ../data/functions.xml.in.h:363 msgid "r:atan" msgstr "" #: ../data/functions.xml.in.h:364 msgid "Hyperbolic Sine" msgstr "åŒæ›²æ­£å¼¦" #: ../data/functions.xml.in.h:365 msgid "r:sinh" msgstr "" #: ../data/functions.xml.in.h:366 msgid "Hyperbolic Cosine" msgstr "åŒæ›²ä½™å¼¦" #: ../data/functions.xml.in.h:367 msgid "r:cosh" msgstr "" #: ../data/functions.xml.in.h:368 msgid "Hyperbolic Tangent" msgstr "åŒæ›²æ­£å‰²" #: ../data/functions.xml.in.h:369 msgid "r:tanh" msgstr "" #: ../data/functions.xml.in.h:370 msgid "Inverse Hyperbolic Sine" msgstr "ååŒæ›²æ­£å¼¦" #: ../data/functions.xml.in.h:371 msgid "r:asinh" msgstr "" #: ../data/functions.xml.in.h:372 msgid "Inverse Hyperbolic Cosine" msgstr "ååŒæ›²ä½™å¼¦" #: ../data/functions.xml.in.h:373 msgid "r:acosh" msgstr "" #: ../data/functions.xml.in.h:374 msgid "Inverse Hyperbolic Tangent" msgstr "ååŒæ›²æ­£åˆ‡" #: ../data/functions.xml.in.h:375 msgid "r:atanh" msgstr "" #: ../data/functions.xml.in.h:376 #, fuzzy msgid "Four-quadrant Inverse Tangent" msgstr "åæ­£åˆ‡" #: ../data/functions.xml.in.h:377 msgid "r:atan2" msgstr "" #: ../data/functions.xml.in.h:378 msgid "" "Computes the principal value of the argument function applied to the complex " "number x+iy." msgstr "" #: ../data/functions.xml.in.h:379 msgid "Y" msgstr "" #: ../data/functions.xml.in.h:380 msgid "X" msgstr "X" #: ../data/functions.xml.in.h:381 #, fuzzy msgid "Cardinal Sine (Sinc Function)" msgstr "寻找线性函数" #: ../data/functions.xml.in.h:382 msgid "r:sinc" msgstr "" #: ../data/functions.xml.in.h:383 msgid "Radians to Default Angle Unit" msgstr "将弧度转æ¢åˆ°ç¼ºçœè§’度å•ä½" #: ../data/functions.xml.in.h:384 msgid "r:radtodef" msgstr "" #: ../data/functions.xml.in.h:385 msgid "Radians" msgstr "弧度" #: ../data/functions.xml.in.h:386 msgid "Secant" msgstr "正割" #: ../data/functions.xml.in.h:387 msgid "r:sec" msgstr "" #: ../data/functions.xml.in.h:388 msgid "Cosecant" msgstr "余割" #: ../data/functions.xml.in.h:389 msgid "r:csc" msgstr "" #: ../data/functions.xml.in.h:390 msgid "Cotangent" msgstr "余切" #: ../data/functions.xml.in.h:391 msgid "r:cot" msgstr "" #: ../data/functions.xml.in.h:392 msgid "Hyperbolic Secant" msgstr "åŒæ›²æ­£åˆ‡" #: ../data/functions.xml.in.h:393 msgid "r:sech" msgstr "" #: ../data/functions.xml.in.h:394 msgid "Hyperbolic Cosecant" msgstr "åŒæ›²ä½™å‰²" #: ../data/functions.xml.in.h:395 msgid "r:csch" msgstr "" #: ../data/functions.xml.in.h:396 msgid "Hyperbolic Cotangent" msgstr "åŒæ›²ä½™åˆ‡" #: ../data/functions.xml.in.h:397 msgid "r:coth" msgstr "" #: ../data/functions.xml.in.h:398 msgid "Inverse Secant" msgstr "åæ­£å‰²" #: ../data/functions.xml.in.h:399 msgid "r:asec" msgstr "" #: ../data/functions.xml.in.h:400 msgid "Inverse Cosecant" msgstr "å余割" #: ../data/functions.xml.in.h:401 msgid "r:acsc" msgstr "" #: ../data/functions.xml.in.h:402 msgid "Inverse Cotangent" msgstr "å余切" #: ../data/functions.xml.in.h:403 msgid "r:acot" msgstr "" #: ../data/functions.xml.in.h:404 msgid "Inverse Hyperbolic Secant" msgstr "ååŒæ›²æ­£å‰²" #: ../data/functions.xml.in.h:405 msgid "r:asech" msgstr "" #: ../data/functions.xml.in.h:406 msgid "Inverse Hyperbolic Cosecant" msgstr "ååŒæ›²ä½™å‰²" #: ../data/functions.xml.in.h:407 msgid "r:acsch" msgstr "" #: ../data/functions.xml.in.h:408 msgid "Inverse Hyperbolic Cotangent" msgstr "ååŒæ›²ä½™åˆ‡" #: ../data/functions.xml.in.h:409 msgid "r:acoth" msgstr "" #: ../data/functions.xml.in.h:410 msgid "Miscellaneous" msgstr "æ‚项" #: ../data/functions.xml.in.h:411 msgid "Body Mass Index (BMI)" msgstr "体质指数(BMI)" #: ../data/functions.xml.in.h:412 msgid "-r:bmi" msgstr "" #: ../data/functions.xml.in.h:413 msgid "" "Calculates the Body Mass Index. The resulting BMI-value is sometimes " "interpreted as follows (although varies with age, sex, etc.): " "Underweight < 18.5 Normal weight 18.5-25 Overweight 25-30 " "Obesity > 30 Note that you must use units for weight (ex. 59kg) " "and length (ex. 174cm)." msgstr "" "计算体质指数(Body Mass Index, 简称BMI)。所得BMI结果的å‚考æ„义如下: " " 体é‡è¿‡è½» < 18.5 体釿­£å¸¸ 18.5-25 体é‡è¿‡é‡ 25-30 肥胖 " "> 30 æ³¨æ„æ‚¨å¿…须使用 é‡é‡å’Œé•¿åº¦å•ä½ï¼ˆå¦‚,59kgå’Œ174cm)。" #: ../data/functions.xml.in.h:415 msgid "Length" msgstr "长度" #: ../data/functions.xml.in.h:416 msgid "Roman Number" msgstr "罗马数字" #: ../data/functions.xml.in.h:417 msgid "r:roman" msgstr "" #: ../data/functions.xml.in.h:418 msgid "Returns the value of a roman number." msgstr "返回罗马数字表示的值。" #: ../data/functions.xml.in.h:419 msgid "Roman number" msgstr "罗马数字" #: ../data/functions.xml.in.h:420 msgid "Statistics" msgstr "统计" #: ../data/functions.xml.in.h:421 msgid "Descriptive Statistics" msgstr "æè¿°æ€§ç»Ÿè®¡" #: ../data/functions.xml.in.h:422 msgid "Sum (total)" msgstr "总和" #: ../data/functions.xml.in.h:423 msgid "r:total" msgstr "" #: ../data/functions.xml.in.h:424 msgid "Data" msgstr "æ•°æ®" #: ../data/functions.xml.in.h:425 msgid "Percentile" msgstr "ç™¾åˆ†ä½æ•°" #: ../data/functions.xml.in.h:426 msgid "r:percentile" msgstr "" #: ../data/functions.xml.in.h:428 #, no-c-format msgid "Percentile (%)" msgstr "ç™¾åˆ†ä½æ•°(%)" #: ../data/functions.xml.in.h:429 msgid "Quantile Algorithm (as in R)" msgstr "" #: ../data/functions.xml.in.h:430 msgid "r:min" msgstr "" #: ../data/functions.xml.in.h:431 msgid "Returns the lowest value." msgstr "返回最å°å€¼ã€‚" #: ../data/functions.xml.in.h:432 msgid "r:max" msgstr "" #: ../data/functions.xml.in.h:433 msgid "Returns the highest value." msgstr "返回最大值。" #: ../data/functions.xml.in.h:434 msgid "Mode" msgstr "模å¼" #: ../data/functions.xml.in.h:435 msgid "r:mode" msgstr "" #: ../data/functions.xml.in.h:436 msgid "Returns the most frequently occurring value." msgstr "返回最常出现的值。" #: ../data/functions.xml.in.h:437 msgid "Range" msgstr "范围" #: ../data/functions.xml.in.h:438 msgid "r:range" msgstr "" #: ../data/functions.xml.in.h:439 msgid "Calculates the difference between the min and max value." msgstr "计算最大和最å°å€¼ä¹‹é—´çš„差。" #: ../data/functions.xml.in.h:440 msgid "Median" msgstr "䏭使•°" #: ../data/functions.xml.in.h:441 msgid "r:median" msgstr "" #: ../data/functions.xml.in.h:442 msgid "Quartile" msgstr "å››åˆ†ä½æ•°" #: ../data/functions.xml.in.h:443 msgid "r:quartile" msgstr "" #: ../data/functions.xml.in.h:444 msgid "Decile" msgstr "ååˆ†ä½æ•°" #: ../data/functions.xml.in.h:445 msgid "r:decile" msgstr "" #: ../data/functions.xml.in.h:446 msgid "Interquartile Range" msgstr "四分ä½è·" #: ../data/functions.xml.in.h:447 msgid "r:iqr" msgstr "" #: ../data/functions.xml.in.h:448 msgid "Calculates the difference between the first and third quartile." msgstr "è®¡ç®—ç¬¬ä¸€å’Œç¬¬ä¸‰å››åˆ†ä½æ•°ä¹‹é—´çš„差。" #: ../data/functions.xml.in.h:449 msgid "Number of Samples" msgstr "样本数é‡" #. Number of samples #: ../data/functions.xml.in.h:451 msgid "r:number" msgstr "" #: ../data/functions.xml.in.h:452 msgid "Returns the number of samples." msgstr "返回样本数é‡ã€‚" #: ../data/functions.xml.in.h:453 msgid "Random Number" msgstr "éšæœºæ•°" #: ../data/functions.xml.in.h:454 msgid "r:rand" msgstr "" #: ../data/functions.xml.in.h:455 msgid "" "Generates a pseudo-random number. Returns a real number between 0 and 1, if " "ceil is zero (default), or an integer between 1 and (including) ceil." msgstr "" "äº§ç”Ÿä¸€ä¸ªä¼ªéšæœºæ•°ã€‚如果顶部值为0(缺çœå€¼),返回一个在0与1之间的实数;å¦åˆ™è¿”回一" "个 在1与顶部值之间(包å«é¡¶éƒ¨å€¼)的整数。" #: ../data/functions.xml.in.h:456 msgid "Ceil" msgstr "顶部值" #: ../data/functions.xml.in.h:457 msgid "Random Number Between Limits" msgstr "在æŸä¸€èŒƒå›´å†…çš„éšæœºæ•°" #: ../data/functions.xml.in.h:458 msgid "r:randbetween" msgstr "" #: ../data/functions.xml.in.h:459 msgid "Returns an integer between (including) bottom and top." msgstr "返回在顶部和底部之间(å«åº•部)的一个整数。" #: ../data/functions.xml.in.h:460 msgid "Bottom" msgstr "底部" #: ../data/functions.xml.in.h:461 msgid "Top" msgstr "顶部" #: ../data/functions.xml.in.h:462 msgid "Means" msgstr "å¹³å‡" #: ../data/functions.xml.in.h:463 msgid "Mean" msgstr "å¹³å‡" #: ../data/functions.xml.in.h:464 msgid "r:mean,average,au:x̄" msgstr "" #: ../data/functions.xml.in.h:465 msgid "Harmonic Mean" msgstr "调和平å‡" #: ../data/functions.xml.in.h:466 msgid "r:harmmean" msgstr "" #: ../data/functions.xml.in.h:467 msgid "Geometric Mean" msgstr "几何平å‡" #: ../data/functions.xml.in.h:468 msgid "r:geomean" msgstr "" #: ../data/functions.xml.in.h:469 msgid "Trimmed Mean" msgstr "截尾å‡å€¼" #: ../data/functions.xml.in.h:470 msgid "r:trimmean" msgstr "" #: ../data/functions.xml.in.h:471 msgid "Trimmed percentage (at each end)" msgstr "截尾百分比(在æ¯ä¸€ç«¯)" #: ../data/functions.xml.in.h:472 msgid "Winsorized Mean" msgstr "Winsorizedå¹³å‡" #: ../data/functions.xml.in.h:473 msgid "r:winsormean" msgstr "" #: ../data/functions.xml.in.h:474 msgid "Winsorized percentage (at each end)" msgstr "Winsorized百分比(在æ¯ä¸€ç«¯)" #: ../data/functions.xml.in.h:475 msgid "Weighted Mean" msgstr "加æƒå¹³å‡" #: ../data/functions.xml.in.h:476 msgid "r:weighmean" msgstr "" #: ../data/functions.xml.in.h:477 msgid "Weights" msgstr "æƒé‡" #: ../data/functions.xml.in.h:478 msgid "Quadratic Mean (RMS)" msgstr "凿–¹(RMS)" #: ../data/functions.xml.in.h:479 msgid "r:rms" msgstr "" #: ../data/functions.xml.in.h:480 msgid "Moments" msgstr "统计矩" #: ../data/functions.xml.in.h:481 msgid "Standard Deviation (entire population)" msgstr "标准差(总体)" #: ../data/functions.xml.in.h:482 msgid "r:stdevp" msgstr "" #: ../data/functions.xml.in.h:483 msgid "Standard Deviation (random sampling)" msgstr "标准差(éšæœºé‡‡æ ·)" #: ../data/functions.xml.in.h:484 msgid "r:stdev" msgstr "" #: ../data/functions.xml.in.h:485 msgid "Variance (entire population)" msgstr "方差(总体)" #: ../data/functions.xml.in.h:486 msgid "r:varp" msgstr "" #: ../data/functions.xml.in.h:487 msgid "Variance (random sampling)" msgstr "方差(éšæœºæ ·æœ¬)" #: ../data/functions.xml.in.h:488 msgid "r:var" msgstr "" #: ../data/functions.xml.in.h:489 msgid "Standard Error" msgstr "标准误差" #: ../data/functions.xml.in.h:490 msgid "r:stderr" msgstr "" #: ../data/functions.xml.in.h:491 msgid "Mean Deviation" msgstr "å‡å·®" #: ../data/functions.xml.in.h:492 msgid "r:meandev" msgstr "" #: ../data/functions.xml.in.h:493 msgid "Covariance" msgstr "åæ–¹å·®" #: ../data/functions.xml.in.h:494 msgid "r:cov,r:covar" msgstr "" #: ../data/functions.xml.in.h:495 msgid "Data 1" msgstr "æ•°æ®1" #: ../data/functions.xml.in.h:496 msgid "Data 2" msgstr "æ•°æ®2" #: ../data/functions.xml.in.h:497 msgid "Pooled Variance" msgstr "åˆå¹¶æ–¹å·®" #: ../data/functions.xml.in.h:498 msgid "r:poolvar" msgstr "" #: ../data/functions.xml.in.h:499 msgid "Regression" msgstr "回归分æž" #: ../data/functions.xml.in.h:500 msgid "Statistical Correlation" msgstr "统计相关" #: ../data/functions.xml.in.h:501 msgid "r:cor" msgstr "" #: ../data/functions.xml.in.h:502 msgid "Pearson's Correlation Coefficient" msgstr "个人相关系数" #: ../data/functions.xml.in.h:503 msgid "r:pearson,r:correl" msgstr "" #: ../data/functions.xml.in.h:504 msgid "Spearman's Rho" msgstr "" #: ../data/functions.xml.in.h:505 msgid "r:spearman" msgstr "" #: ../data/functions.xml.in.h:506 msgid "Statistical Tests" msgstr "统计测试" #: ../data/functions.xml.in.h:507 msgid "Unpaired T-Test" msgstr "éžé…对T测试" #: ../data/functions.xml.in.h:508 msgid "r:ttest" msgstr "" #: ../data/functions.xml.in.h:509 msgid "Paired T-Test" msgstr "é…对t检验" #: ../data/functions.xml.in.h:510 msgid "r:pttest" msgstr "" #: ../data/functions.xml.in.h:511 msgid "Distribution" msgstr "分布" #: ../data/functions.xml.in.h:512 msgid "Rayleigh Distribution" msgstr "Rayleigh分布" #: ../data/functions.xml.in.h:513 msgid "r:rayleigh" msgstr "" #: ../data/functions.xml.in.h:514 msgid "" "Returns the probability density p(x) at x for a Rayleigh distribution with " "scale parameter sigma. (from Gnumeric)" msgstr "" "æ ¹æ®æŒ‡å®šçš„è§„æ¨¡å‚æ•°Sigma返回Rayleigh分布在x点的密度概率p(x)。(用Gnumeric)" #: ../data/functions.xml.in.h:515 msgid "Sigma" msgstr "Sigma" #: ../data/functions.xml.in.h:516 msgid "Rayleigh Tail Distribution" msgstr "Rayleigh尾分布" #: ../data/functions.xml.in.h:517 msgid "r:rayleightail" msgstr "" #: ../data/functions.xml.in.h:518 msgid "" "Returns the probability density p(x) at x for a Rayleigh tail distribution " "with scale parameter sigma and a lower limit. (from Gnumeric)" msgstr "" "æ ¹æ®æŒ‡å®šçš„è§„æ¨¡å‚æ•°Sigma和下é™è¿”回Rayleigh尾分布在x点的密度概率p(x)。(用" "Gnumeric)" #: ../data/functions.xml.in.h:519 msgid "Pareto Distribution" msgstr "Pareto分布" #: ../data/functions.xml.in.h:520 msgid "r:pareto" msgstr "" #: ../data/functions.xml.in.h:521 msgid "" "Returns the probability density p(x) at x for a Pareto distribution with " "exponent and scale. (from Gnumeric)" msgstr "æ ¹æ®æŒ‡å®šçš„æŒ‡æ•°å’Œè§„模返回Pareto分布在x点的密度概率p(x)。(用Gnumeric)" #: ../data/functions.xml.in.h:522 msgid "Scale" msgstr "规模" #: ../data/functions.xml.in.h:523 msgid "Logistic Distribution" msgstr "Logistic分布" #: ../data/functions.xml.in.h:524 msgid "r:logistic" msgstr "" #: ../data/functions.xml.in.h:525 msgid "" "Returns the probability density p(x) at x for a logistic distribution with " "scale parameter. (from Gnumeric)" msgstr "æ ¹æ®æŒ‡å®šçš„规模返回logistic分布在x点的密度概率p(x)。(用Gnumeric)" #: ../data/functions.xml.in.h:526 ../data/variables.xml.in.h:173 msgid "Date & Time" msgstr "日期与时间" #: ../data/functions.xml.in.h:527 #, fuzzy msgid "Construct Date" msgstr "构造矩阵" #: ../data/functions.xml.in.h:528 #, fuzzy msgid "r:date" msgstr "第一个日期" #: ../data/functions.xml.in.h:529 msgid "" "Returns a date. Available calendars gregorian (1), hebrew (2), islamic (3), " "persian (4), indian (5), chinese (6), julian (7), milankovic (8), coptic " "(9), ethiopian (10), egyptian (11). The Chinese year uses an epoch of 2697 " "BEC and chinese leap months are indicated by adding 12 to the month number " "(e.g. leap month 4 = 16)." msgstr "" #: ../data/functions.xml.in.h:530 msgid "Year" msgstr "å¹´" #: ../data/functions.xml.in.h:531 ../data/units.xml.in.h:145 msgid "Month" msgstr "月份" #: ../data/functions.xml.in.h:532 ../data/units.xml.in.h:137 msgid "Day" msgstr "æ—¥" #: ../data/functions.xml.in.h:533 msgid "Calendar" msgstr "" #: ../data/functions.xml.in.h:534 #, fuzzy msgid "Construct Date and Time" msgstr "构造矩阵" #: ../data/functions.xml.in.h:535 #, fuzzy msgid "r:datetime" msgstr "第一个日期" #: ../data/functions.xml.in.h:536 ../data/units.xml.in.h:135 msgid "Hour" msgstr "å°æ—¶" #: ../data/functions.xml.in.h:537 ../data/units.xml.in.h:133 msgid "Minute" msgstr "分" #: ../data/functions.xml.in.h:538 ../data/units.xml.in.h:131 msgid "Second" msgstr "ç§’" #: ../data/functions.xml.in.h:539 msgid "Days between two dates" msgstr "两个日期之间的天数" #: ../data/functions.xml.in.h:540 msgid "r:days" msgstr "" #: ../data/functions.xml.in.h:541 msgid "" "Returns the number of days between two dates. Basis is the type of " "day counting you want to use: 0: US 30/360, 1: real days (default), 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回两个日期之间的天数。 \"基准\"是您想使用的天数计算类型:0: ç¾Žå¼ " "30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ " "30/360。" #: ../data/functions.xml.in.h:542 msgid "First date" msgstr "第一个日期" #: ../data/functions.xml.in.h:543 msgid "Second date" msgstr "第二个日期" #: ../data/functions.xml.in.h:544 msgid "Day counting basis" msgstr "天数计算基准" #: ../data/functions.xml.in.h:545 msgid "Financial function mode" msgstr "金èžå‡½æ•°æ¨¡å¼" #: ../data/functions.xml.in.h:546 msgid "Years between two dates" msgstr "两个日期之间相隔的年数" #: ../data/functions.xml.in.h:547 msgid "r:yearfrac" msgstr "" #: ../data/functions.xml.in.h:548 msgid "" "Returns the number of years (fractional) between two dates. Basis " "is the type of day counting you want to use: 0: US 30/360, 1: real days " "(default), 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回两个日期之间的年数(分数值)。 \"基准\"是您想使用的天数计算类型:" "0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or " "4: æ¬§å¼ 30/360。" #: ../data/functions.xml.in.h:549 msgid "Week of Year" msgstr "一年中的第几周" #: ../data/functions.xml.in.h:550 msgid "r:week" msgstr "" #: ../data/functions.xml.in.h:551 msgid "Date" msgstr "日期" #: ../data/functions.xml.in.h:552 msgid "Week begins on Sunday" msgstr "æ¯å‘¨ä»Žæ˜ŸæœŸå¤©å¼€å§‹" #: ../data/functions.xml.in.h:553 msgid "Day of Week" msgstr "星期中的第几天" #: ../data/functions.xml.in.h:554 msgid "r:weekday" msgstr "" #: ../data/functions.xml.in.h:555 msgid "r:month" msgstr "" #: ../data/functions.xml.in.h:556 msgid "Day of Month" msgstr "月份中的第几天" #: ../data/functions.xml.in.h:557 msgid "r:day" msgstr "" #: ../data/functions.xml.in.h:558 msgid "r:year" msgstr "" #: ../data/functions.xml.in.h:559 msgid "Day of Year" msgstr "一年中的第几天" #: ../data/functions.xml.in.h:560 msgid "r:yearday" msgstr "" #: ../data/functions.xml.in.h:561 msgid "Current Time" msgstr "当剿—¶é—´" #: ../data/functions.xml.in.h:562 msgid "r:time" msgstr "" #: ../data/functions.xml.in.h:563 #, fuzzy msgid "Time Value" msgstr "æžé™å€¼" #: ../data/functions.xml.in.h:564 #, fuzzy msgid "r:timevalue" msgstr "未æ¥å€¼" #: ../data/functions.xml.in.h:565 msgid "Returns the time part, in fractional hours, of a date and time value." msgstr "" #: ../data/functions.xml.in.h:566 msgid "Date to Unix Timestamp" msgstr "将时间转æ¢ä¸ºUnix时间戳" #: ../data/functions.xml.in.h:567 msgid "r:timestamp" msgstr "" #: ../data/functions.xml.in.h:568 msgid "Unix Timestamp to Date" msgstr "Unix时间戳转æ¢ä¸ºæ—¥æœŸ" #: ../data/functions.xml.in.h:569 msgid "r:stamptodate,unix2date" msgstr "" #: ../data/functions.xml.in.h:570 msgid "" "Returns the local date and time represented by the specified Unix timestamp " "(seconds, excluding leap seconds, since 1970-01-01). Supports time units." msgstr "" #: ../data/functions.xml.in.h:571 msgid "Timestamp" msgstr "时间戳" #: ../data/functions.xml.in.h:572 msgid "Add Days" msgstr "加日" #: ../data/functions.xml.in.h:573 msgid "r:addDays" msgstr "" #: ../data/functions.xml.in.h:574 msgid "Days" msgstr "æ—¥" #: ../data/functions.xml.in.h:575 msgid "Add Months" msgstr "加月份" #: ../data/functions.xml.in.h:576 msgid "r:addMonths" msgstr "" #: ../data/functions.xml.in.h:577 msgid "Months" msgstr "月份" #: ../data/functions.xml.in.h:578 msgid "Add Years" msgstr "加年" #: ../data/functions.xml.in.h:579 msgid "r:addYears" msgstr "" #: ../data/functions.xml.in.h:580 msgid "Years" msgstr "å¹´" #: ../data/functions.xml.in.h:581 msgid "Add Time" msgstr "加时间" #: ../data/functions.xml.in.h:582 msgid "r:addTime" msgstr "" #: ../data/functions.xml.in.h:583 msgid "" "Adds a time value to a date. The value can be positive or negative, but must " "use a unit based on seconds (such as day and year). Fractions of days are " "truncated." msgstr "" "å°†ä¸€ä¸ªæ—¶é—´é—´éš”å€¼åŠ åˆ°æ—¥æœŸä¸­ã€‚è¯¥å€¼å¯æ­£å¯è´Ÿï¼Œä½†å…¶å•ä½å¿…须基于秒(如日或者年)。日" "æœŸçš„åˆ†æ•°éƒ¨åˆ†ä¼šè¢«æˆªå–æŽ‰ã€‚" #: ../data/functions.xml.in.h:584 ../data/units.xml.in.h:130 msgid "Time" msgstr "æ—¶é—´" #: ../data/functions.xml.in.h:585 msgid "Lunar Phase" msgstr "" #: ../data/functions.xml.in.h:586 msgid "r:lunarphase" msgstr "" #: ../data/functions.xml.in.h:587 msgid "" "Returns the lunar phase, as a number between 0 and 1, for the specified " "date. 0 represents new moon, 0.5 full moon, and 0.25 and 0.75 quarter moons." msgstr "" #: ../data/functions.xml.in.h:588 msgid "Find Lunar Phase" msgstr "" #: ../data/functions.xml.in.h:589 msgid "r:nextlunarphase" msgstr "" #: ../data/functions.xml.in.h:590 msgid "" "Returns the date when the specified lunar phase occurs. The function " "searches forward beginning at the specified date. The lunar phase are " "specified as a number between 0 and 1, where 0 represents new moon, 0.5 full " "moon, and 0.25 and 0.75 quarter moons." msgstr "" #: ../data/functions.xml.in.h:591 #, fuzzy msgid "Start Date" msgstr "构造矩阵" #: ../data/functions.xml.in.h:592 msgid "Utilities" msgstr "工具" #: ../data/functions.xml.in.h:593 msgid "Plot Functions and Vectors" msgstr "" #: ../data/functions.xml.in.h:594 msgid "r:plot" msgstr "" #: ../data/functions.xml.in.h:595 #, fuzzy msgid "Expression or vector" msgstr "矩阵或å‘é‡" #: ../data/functions.xml.in.h:596 msgid "Minimum x value" msgstr "" #: ../data/functions.xml.in.h:597 #, fuzzy msgid "Maximum x value" msgstr "矩阵å˜é‡" #: ../data/functions.xml.in.h:598 msgid "Number of samples / Step size" msgstr "样本数é‡/步长" #: ../data/functions.xml.in.h:599 #, fuzzy msgid "X variable" msgstr "行å˜é‡" #: ../data/functions.xml.in.h:600 msgid "" "Plots one or more expressions or vectors. Use a vector for the first " "argument to plot multiple series. Only the first argument is used for vector " "series. It is also possible to plot a matrix where each row is a pair of x " "and y values." msgstr "" #: ../data/functions.xml.in.h:601 msgid "ASCII Value" msgstr "ASCII值" #: ../data/functions.xml.in.h:602 msgid "r:code" msgstr "" #: ../data/functions.xml.in.h:603 msgid "Character" msgstr "字符" #: ../data/functions.xml.in.h:604 msgid "ASCII Char" msgstr "ASCII字符" #: ../data/functions.xml.in.h:605 msgid "r:char" msgstr "" #: ../data/functions.xml.in.h:606 msgid "Length of string" msgstr "字符串长度" #: ../data/functions.xml.in.h:607 msgid "r:len" msgstr "" #: ../data/functions.xml.in.h:608 msgid "Text" msgstr "文字" #: ../data/functions.xml.in.h:609 msgid "Concatenate Strings" msgstr "连接字符串" #: ../data/functions.xml.in.h:610 msgid "r:concatenate" msgstr "" #: ../data/functions.xml.in.h:611 msgid "Text string 1" msgstr "文字1" #: ../data/functions.xml.in.h:612 msgid "Text string 2" msgstr "文字2" #: ../data/functions.xml.in.h:613 msgid "Replace" msgstr "替æ¢" #: ../data/functions.xml.in.h:614 msgid "r:replace" msgstr "" #: ../data/functions.xml.in.h:615 msgid "" "Replaces a certain value in an expression with a new value. The expression " "is calculated before the replacement if the fourth argument is true." msgstr "" "使用新值替æ¢è¡¨è¾¾å¼ä¸­çš„ç‰¹å®šå€¼ã€‚å¦‚æžœç¬¬å››ä¸ªå‚æ•°æ˜¯çœŸï¼Œåˆ™åœ¨æ›¿æ¢å‰é¦–å…ˆå¯¹è¡¨è¾¾å¼ è¿›è¡Œ" "计算。" #: ../data/functions.xml.in.h:616 msgid "Expression" msgstr "表达å¼" #: ../data/functions.xml.in.h:617 msgid "Original value" msgstr "原始值" #: ../data/functions.xml.in.h:618 msgid "New value" msgstr "新值" #: ../data/functions.xml.in.h:619 msgid "Precalculate expression" msgstr "预先计算表达å¼" #: ../data/functions.xml.in.h:620 msgid "Strip Units" msgstr "剥离å•ä½" #: ../data/functions.xml.in.h:621 msgid "r:nounit,strip_units" msgstr "" #: ../data/functions.xml.in.h:622 msgid "" "Removes all units from an expression. The expression is calculated before " "the removal." msgstr "从表达å¼ä¸­åˆ é™¤å…¨éƒ¨å•ä½ã€‚在删除之å‰ä¼šå…ˆå¯¹è¡¨è¾¾å¼è¿›è¡Œè®¡ç®—。" #: ../data/functions.xml.in.h:623 msgid "Process Vector Elements" msgstr "处ç†å‘é‡å…ƒç´ " #: ../data/functions.xml.in.h:624 msgid "r:process" msgstr "" #: ../data/functions.xml.in.h:625 msgid "Element variable" msgstr "元素å˜é‡" #: ../data/functions.xml.in.h:626 msgid "Index variable" msgstr "下标å˜é‡" #: ../data/functions.xml.in.h:627 msgid "Vector variable" msgstr "å‘é‡å˜é‡" #: ../data/functions.xml.in.h:628 msgid "Process Matrix Elements" msgstr "处ç†çŸ©é˜µå…ƒç´ " #: ../data/functions.xml.in.h:629 msgid "r:processm" msgstr "" #: ../data/functions.xml.in.h:630 msgid "Row variable" msgstr "行å˜é‡" #: ../data/functions.xml.in.h:631 msgid "Column variable" msgstr "列标é‡" #: ../data/functions.xml.in.h:632 msgid "Matrix variable" msgstr "矩阵å˜é‡" #: ../data/functions.xml.in.h:633 msgid "Custom Sum of Elements" msgstr "元素的自定义和" #: ../data/functions.xml.in.h:634 msgid "r:csum" msgstr "" #: ../data/functions.xml.in.h:635 msgid "First element" msgstr "最åŽä¸€ä¸ªå…ƒç´ " #: ../data/functions.xml.in.h:636 msgid "Last element" msgstr "最åŽä¸€ä¸ªå…ƒç´ " #: ../data/functions.xml.in.h:637 msgid "Initial value" msgstr "åˆå§‹å€¼" #: ../data/functions.xml.in.h:638 msgid "Value variable" msgstr "值å˜é‡" #: ../data/functions.xml.in.h:639 msgid "Select Vector Elements" msgstr "选择矩阵元素" #: ../data/functions.xml.in.h:640 msgid "r:select" msgstr "" #: ../data/functions.xml.in.h:641 msgid "Condition" msgstr "æ¡ä»¶" #: ../data/functions.xml.in.h:642 msgid "Select first match" msgstr "选择第一个匹é…项" #: ../data/functions.xml.in.h:643 msgid "r:function" msgstr "" #: ../data/functions.xml.in.h:644 msgid "Arguments" msgstr "自å˜é‡" #: ../data/functions.xml.in.h:645 msgid "Title" msgstr "标题" #: ../data/functions.xml.in.h:646 msgid "r:title" msgstr "" #: ../data/functions.xml.in.h:648 msgid "Display Error" msgstr "显示错误" #: ../data/functions.xml.in.h:649 msgid "r:error" msgstr "" #: ../data/functions.xml.in.h:650 msgid "Message" msgstr "ä¿¡æ¯" #: ../data/functions.xml.in.h:651 msgid "Display Warning" msgstr "显示警告" #: ../data/functions.xml.in.h:652 msgid "r:warning" msgstr "" #: ../data/functions.xml.in.h:653 msgid "Display Message" msgstr "显示信æ¯" #: ../data/functions.xml.in.h:654 msgid "r:message" msgstr "" #: ../data/functions.xml.in.h:655 msgid "Save as Variable" msgstr "作为å˜é‡ä¿å­˜" #: ../data/functions.xml.in.h:656 msgid "r:save" msgstr "" #: ../data/functions.xml.in.h:657 msgid "Category" msgstr "类别" #: ../data/functions.xml.in.h:658 msgid "RPN Stack Register" msgstr "RPN栈寄存器" #: ../data/functions.xml.in.h:659 msgid "r:register" msgstr "" #: ../data/functions.xml.in.h:660 msgid "Returns the value of a RPN stack register." msgstr "返回RPN栈寄存器的值。" #: ../data/functions.xml.in.h:661 msgid "RPN Stack Vector" msgstr "RPNæ ˆå‘é‡" #: ../data/functions.xml.in.h:662 msgid "r:stack" msgstr "" #: ../data/functions.xml.in.h:663 msgid "Returns the RPN stack as a vector." msgstr "å°†RPN栈作为å‘é‡è¿”回。" #: ../data/functions.xml.in.h:664 msgid "Is Number" msgstr "是数字" #: ../data/functions.xml.in.h:665 msgid "r:isNumber" msgstr "" #: ../data/functions.xml.in.h:666 msgid "Is Real" msgstr "是实数" #: ../data/functions.xml.in.h:667 msgid "r:isReal" msgstr "" #: ../data/functions.xml.in.h:668 msgid "Is Rational" msgstr "æ˜¯æœ‰ç†æ•°" #: ../data/functions.xml.in.h:669 msgid "r:isRational" msgstr "" #: ../data/functions.xml.in.h:670 msgid "Is Integer" msgstr "是整数" #: ../data/functions.xml.in.h:671 msgid "r:isInteger" msgstr "" #: ../data/functions.xml.in.h:672 msgid "Represents Number" msgstr "代表数字" #: ../data/functions.xml.in.h:673 msgid "r:representsNumber" msgstr "" #: ../data/functions.xml.in.h:674 msgid "Represents Real" msgstr "代表实数" #: ../data/functions.xml.in.h:675 msgid "r:representsReal" msgstr "" #: ../data/functions.xml.in.h:676 msgid "Represents Rational" msgstr "ä»£è¡¨æœ‰ç†æ•°" #: ../data/functions.xml.in.h:677 msgid "r:representsRational" msgstr "" #: ../data/functions.xml.in.h:678 msgid "Represents Integer" msgstr "代表整数" #: ../data/functions.xml.in.h:679 msgid "r:representsInteger" msgstr "" #: ../data/functions.xml.in.h:680 #, fuzzy msgid "Interval" msgstr "积分" #: ../data/functions.xml.in.h:681 #, fuzzy msgid "r:interval" msgstr "积分" #: ../data/functions.xml.in.h:682 #, fuzzy msgid "Lower endpoint" msgstr "下é™" #: ../data/functions.xml.in.h:683 #, fuzzy msgid "Upper endpoint" msgstr "上é™" #: ../data/functions.xml.in.h:684 msgid "Logical" msgstr "逻辑" #: ../data/functions.xml.in.h:685 msgid "For...Do" msgstr "For...Do" #: ../data/functions.xml.in.h:686 msgid "r:for" msgstr "" #: ../data/functions.xml.in.h:687 msgid "Initial value of counter" msgstr "计数器åˆå§‹å€¼" #: ../data/functions.xml.in.h:688 msgid "Counter variable" msgstr "计数器å˜é‡" #: ../data/functions.xml.in.h:689 msgid "For condition" msgstr "Foræ¡ä»¶" #: ../data/functions.xml.in.h:690 msgid "Counter update function" msgstr "计数器更新函数" #: ../data/functions.xml.in.h:691 msgid "Do function" msgstr "Do函数" #: ../data/functions.xml.in.h:692 msgid "If...Then...Else" msgstr "If...Then...Else" #: ../data/functions.xml.in.h:693 msgid "r:if" msgstr "" #: ../data/functions.xml.in.h:694 msgid "Tests a condition and returns a value depending on the result." msgstr "对一个æ¡ä»¶è¿›è¡Œæµ‹è¯•ï¼Œå¹¶æ ¹æ®æµ‹è¯•结果返回一个值。" #: ../data/functions.xml.in.h:695 msgid "Expression if condition is met" msgstr "æ¡ä»¶æ»¡è¶³æ—¶çš„表达å¼" #: ../data/functions.xml.in.h:696 msgid "Expression if condition is NOT met" msgstr "æ¡ä»¶ä¸æ»¡è¶³æ—¶çš„表达å¼" #: ../data/functions.xml.in.h:697 msgid "Logical Exclusive OR" msgstr "逻辑排斥OR" #: ../data/functions.xml.in.h:698 msgid "r:xor" msgstr "" #: ../data/functions.xml.in.h:699 msgid "Value 1" msgstr "值1" #: ../data/functions.xml.in.h:700 msgid "Value 2" msgstr "值2" #: ../data/functions.xml.in.h:701 msgid "Bitwise Exclusive OR" msgstr "æŒ‰ä½æŽ’æ–¥OR" #: ../data/functions.xml.in.h:702 msgid "r:bitxor" msgstr "" #: ../data/functions.xml.in.h:703 msgid "Bitwise Shift" msgstr "按ä½ç§»ä½" #: ../data/functions.xml.in.h:704 msgid "r:shift" msgstr "" #: ../data/functions.xml.in.h:705 msgid "Bits" msgstr "比特" #: ../data/functions.xml.in.h:706 msgid "Bitwise Complement (Not)" msgstr "" #: ../data/functions.xml.in.h:707 msgid "r:bitcmp" msgstr "" #: ../data/functions.xml.in.h:708 msgid "Algebra" msgstr "代数" #: ../data/functions.xml.in.h:709 #, fuzzy msgid "Summation" msgstr "方程" #: ../data/functions.xml.in.h:710 msgid "au:Σ,r:sum" msgstr "" #: ../data/functions.xml.in.h:711 #, fuzzy msgid "" "Corresponds to the summation symbol. Adds terms for each x ranging from the " "lower to the upper limit." msgstr "相当于求和符å·Σ。将从上é™åˆ°ä¸‹é™çš„æ¯é¡¹x相加。" #: ../data/functions.xml.in.h:712 msgid "Term expression" msgstr "项表达å¼" #: ../data/functions.xml.in.h:713 msgid "Lower limit (i)" msgstr "下é™(i)" #: ../data/functions.xml.in.h:714 msgid "Upper limit (n)" msgstr "上é™(n)" #: ../data/functions.xml.in.h:715 msgid "Product of a sequence" msgstr "" #: ../data/functions.xml.in.h:716 msgid "au:Π,r:product" msgstr "" #: ../data/functions.xml.in.h:717 msgid "" "Corresponds to the product symbol. Multiplies factors for each x ranging " "from the lower to the upper limit." msgstr "相当于连乘符å·Π。将从上é™åˆ°ä¸‹é™çš„æ¯é¡¹x相乘。" #: ../data/functions.xml.in.h:718 msgid "Factor expression" msgstr "å› å­è¡¨è¾¾å¼" #: ../data/functions.xml.in.h:719 msgid "Solve for multiple variables" msgstr "多å˜é‡æ±‚è§£" #: ../data/functions.xml.in.h:720 msgid "r:multisolve" msgstr "r:multisolve" #: ../data/functions.xml.in.h:721 msgid "Equation vector" msgstr "方程å‘é‡" #: ../data/functions.xml.in.h:722 msgid "Variable vector" msgstr "å˜é‡å‘é‡" #: ../data/functions.xml.in.h:723 msgid "Solve equation" msgstr "方程求解" #: ../data/functions.xml.in.h:724 msgid "r:solve" msgstr "" #: ../data/functions.xml.in.h:725 msgid "Equation" msgstr "方程" #: ../data/functions.xml.in.h:726 msgid "With respect to" msgstr "关于" #: ../data/functions.xml.in.h:727 #, fuzzy msgid "Solve differential equation" msgstr "方程求解" #: ../data/functions.xml.in.h:728 #, fuzzy msgid "r:dsolve" msgstr "r:multisolve" #: ../data/functions.xml.in.h:729 msgid "Initial condition: function value (y)" msgstr "" #: ../data/functions.xml.in.h:730 msgid "Initial condition: argument value (x)" msgstr "" #: ../data/functions.xml.in.h:731 msgid "" "Solves a differential equation and returns the value of y(x). The derivative " "in the equation should be in the format diff(y, x). Only first-order " "differential equations are currently supported." msgstr "" #: ../data/functions.xml.in.h:732 msgid "Solve for two variables" msgstr "åŒå˜é‡æ±‚è§£" #: ../data/functions.xml.in.h:733 msgid "r:solve2" msgstr "" #: ../data/functions.xml.in.h:734 msgid "" "Solves two equations with two unknown variables. Returns the value of the " "first variable." msgstr "è§£ç”±ä¸¤ä¸ªæœªçŸ¥æ•°å’Œä¸¤ä¸ªæ–¹ç¨‹ç»„æˆæ–¹ç¨‹ç»„。返回第一个å˜é‡çš„值。" #: ../data/functions.xml.in.h:735 msgid "Equation 1" msgstr "方程1" #: ../data/functions.xml.in.h:736 msgid "Equation 2" msgstr "方程" #: ../data/functions.xml.in.h:737 msgid "Variable 1" msgstr "å˜é‡1" #: ../data/functions.xml.in.h:738 msgid "Variable 2" msgstr "å˜é‡2" #: ../data/functions.xml.in.h:739 msgid "Find Linear Function" msgstr "寻找线性函数" #: ../data/functions.xml.in.h:740 msgid "r:linearfunction" msgstr "" #: ../data/functions.xml.in.h:741 msgid "" "Finds the linear function for the straight line between two distinct points." msgstr "寻找过两点直线段的线性函数" #: ../data/functions.xml.in.h:742 msgid "x1" msgstr "" #: ../data/functions.xml.in.h:743 msgid "y1" msgstr "" #: ../data/functions.xml.in.h:744 msgid "x2" msgstr "" #: ../data/functions.xml.in.h:745 msgid "y2" msgstr "" #: ../data/functions.xml.in.h:746 msgid "Calculus" msgstr "微积分" #: ../data/functions.xml.in.h:747 msgid "Differentiate" msgstr "ç™¾åˆ†ä½æ•°" #: ../data/functions.xml.in.h:748 msgid "r:diff" msgstr "" #: ../data/functions.xml.in.h:749 msgid "Integrate" msgstr "积分" #: ../data/functions.xml.in.h:750 #, fuzzy msgid "r:integrate" msgstr "积分" #: ../data/functions.xml.in.h:751 msgid "Variable of integration" msgstr "积分å˜é‡" #: ../data/functions.xml.in.h:752 #, fuzzy msgid "Limit" msgstr "下é™" #: ../data/functions.xml.in.h:753 msgid "" "Returns the two-sided limit of the function if direction is zero, limit from " "left (below) if direction is -1, or limit from right (above) if direction is " "+1." msgstr "" #: ../data/functions.xml.in.h:754 #, fuzzy msgid "r:limit" msgstr "下é™" #: ../data/functions.xml.in.h:755 msgid "Value to approach" msgstr "" #: ../data/functions.xml.in.h:756 #, fuzzy msgid "Direction" msgstr "æŒç»­æ—¶é—´" #: ../data/functions.xml.in.h:757 msgid "Extreme Values" msgstr "æžé™å€¼" #: ../data/functions.xml.in.h:758 msgid "r:extremum" msgstr "" #: ../data/functions.xml.in.h:759 #, fuzzy msgid "Named Integrals" msgstr "æ•´æ•°" #: ../data/functions.xml.in.h:760 msgid "Logarithmic Integral" msgstr "" #: ../data/functions.xml.in.h:761 msgid "rc:li,logint" msgstr "" #: ../data/functions.xml.in.h:762 msgid "The integral of 1/ln(x)." msgstr "" #: ../data/functions.xml.in.h:763 #, fuzzy msgid "Exponential Integral" msgstr "e的乘方" #: ../data/functions.xml.in.h:764 msgid "rc:Ei,expint" msgstr "" #: ../data/functions.xml.in.h:765 msgid "The integral of e^x/x." msgstr "" #: ../data/functions.xml.in.h:766 #, fuzzy msgid "Sine Integral" msgstr "积分" #: ../data/functions.xml.in.h:767 msgid "rc:Si,sinint" msgstr "" #: ../data/functions.xml.in.h:768 msgid "The integral of sin(x)/x." msgstr "" #: ../data/functions.xml.in.h:769 #, fuzzy msgid "Cosine Integral" msgstr "是整数" #: ../data/functions.xml.in.h:770 msgid "rc:Ci,cosint" msgstr "" #: ../data/functions.xml.in.h:771 msgid "The integral of cos(x)/x." msgstr "" #: ../data/functions.xml.in.h:772 #, fuzzy msgid "Hyperbolic Sine Integral" msgstr "åŒæ›²æ­£å¼¦" #: ../data/functions.xml.in.h:773 msgid "rc:Shi,sinhint" msgstr "" #: ../data/functions.xml.in.h:774 msgid "The integral of sinh(x)/x." msgstr "" #: ../data/functions.xml.in.h:775 #, fuzzy msgid "Hyperbolic Cosine Integral" msgstr "åŒæ›²ä½™å¼¦" #: ../data/functions.xml.in.h:776 msgid "rc:Chi,coshint" msgstr "" #: ../data/functions.xml.in.h:777 msgid "The integral of cosh(x)/x." msgstr "" #: ../data/functions.xml.in.h:778 #, fuzzy msgid "Upper Incomplete Gamma Function" msgstr "γ函数" #: ../data/functions.xml.in.h:779 msgid "r:igamma" msgstr "" #: ../data/functions.xml.in.h:780 #, fuzzy msgid "Lower Incomplete Gamma Function" msgstr "γ函数" #: ../data/functions.xml.in.h:781 msgid "r:gammainc" msgstr "" #: ../data/functions.xml.in.h:782 msgid "Geometry" msgstr "几何" #: ../data/functions.xml.in.h:783 msgid "Triangle" msgstr "三角形" #: ../data/functions.xml.in.h:784 msgid "Hypotenuse" msgstr "斜边" #: ../data/functions.xml.in.h:785 msgid "r:hypot" msgstr "" #: ../data/functions.xml.in.h:786 msgid "Side A" msgstr "è¾¹A" #: ../data/functions.xml.in.h:787 msgid "Side B" msgstr "è¾¹B" #: ../data/functions.xml.in.h:788 msgid "Triangle Area" msgstr "三角形é¢ç§¯" #: ../data/functions.xml.in.h:789 msgid "r:triangle" msgstr "" #: ../data/functions.xml.in.h:790 msgid "Height" msgstr "高度" #: ../data/functions.xml.in.h:791 msgid "Triangle Perimeter" msgstr "(ç›´è§’)三角形周长" #: ../data/functions.xml.in.h:792 msgid "r:triangle_perimeter" msgstr "" #: ../data/functions.xml.in.h:793 msgid "Side C" msgstr "è¾¹C" #: ../data/functions.xml.in.h:794 msgid "Circle" msgstr "圆形" #: ../data/functions.xml.in.h:795 msgid "Circle Area" msgstr "圆é¢ç§¯" #: ../data/functions.xml.in.h:796 msgid "r:circle" msgstr "" #: ../data/functions.xml.in.h:797 msgid "Calculates the area of a circle using the radius" msgstr "使用åŠå¾„计算圆é¢ç§¯" #: ../data/functions.xml.in.h:798 msgid "Radius" msgstr "åŠå¾„" #: ../data/functions.xml.in.h:799 msgid "Circle Circumference" msgstr "圆周长" #: ../data/functions.xml.in.h:800 msgid "r:circumference" msgstr "" #: ../data/functions.xml.in.h:801 msgid "Cylinder" msgstr "圆柱" #: ../data/functions.xml.in.h:802 msgid "Cylinder Volume" msgstr "圆柱体积" #: ../data/functions.xml.in.h:803 msgid "r:cylinder" msgstr "" #: ../data/functions.xml.in.h:804 msgid "Surface Area of Cylinder" msgstr "圆柱体表é¢ç§¯" #: ../data/functions.xml.in.h:805 msgid "r:cylinder_sa" msgstr "" #: ../data/functions.xml.in.h:806 msgid "Cone" msgstr "圆锥" #: ../data/functions.xml.in.h:807 msgid "Cone Volume" msgstr "圆锥体积" #: ../data/functions.xml.in.h:808 msgid "r:cone" msgstr "" #: ../data/functions.xml.in.h:809 msgid "Surface Area of Cone" msgstr "圆锥表é¢ç§¯" #: ../data/functions.xml.in.h:810 msgid "r:cone_sa" msgstr "" #: ../data/functions.xml.in.h:811 msgid "Sphere" msgstr "çƒä½“" #: ../data/functions.xml.in.h:812 msgid "Sphere Volume" msgstr "çƒä½“积" #: ../data/functions.xml.in.h:813 msgid "r:sphere" msgstr "" #: ../data/functions.xml.in.h:814 msgid "Surface Area of Sphere" msgstr "çƒä½“表é¢ç§¯" #: ../data/functions.xml.in.h:815 msgid "r:sphere_sa" msgstr "" #: ../data/functions.xml.in.h:816 msgid "Square Area" msgstr "正方形é¢ç§¯" #: ../data/functions.xml.in.h:817 msgid "r:square" msgstr "" #: ../data/functions.xml.in.h:818 msgid "Length of side" msgstr "边长" #: ../data/functions.xml.in.h:819 msgid "Square Perimeter" msgstr "正方形周长" #: ../data/functions.xml.in.h:820 msgid "r:square_perimeter" msgstr "" #: ../data/functions.xml.in.h:821 msgid "Cube" msgstr "立方体" #: ../data/functions.xml.in.h:822 msgid "Cube Volume" msgstr "立方体体积" #: ../data/functions.xml.in.h:823 msgid "r:cube" msgstr "" #: ../data/functions.xml.in.h:824 msgid "Surface Area of Cube" msgstr "立方体表é¢ç§¯" #: ../data/functions.xml.in.h:825 msgid "r:cube_sa" msgstr "" #: ../data/functions.xml.in.h:826 msgid "Rectangle" msgstr "矩形" #: ../data/functions.xml.in.h:827 msgid "Rectangle Area" msgstr "矩形é¢ç§¯" #: ../data/functions.xml.in.h:828 msgid "r:rect" msgstr "" #: ../data/functions.xml.in.h:829 msgid "Width" msgstr "宽度" #: ../data/functions.xml.in.h:830 msgid "Rectangle Perimeter" msgstr "矩形周长" #: ../data/functions.xml.in.h:831 msgid "r:rect_perimeter" msgstr "" #: ../data/functions.xml.in.h:832 msgid "Prism" msgstr "棱柱" #: ../data/functions.xml.in.h:833 msgid "Volume of Rectangular Prism" msgstr "矩形棱柱体积" #: ../data/functions.xml.in.h:834 msgid "r:rectprism" msgstr "" #: ../data/functions.xml.in.h:835 msgid "Calculates the volume of a prism with rectangular base." msgstr "计算矩形棱柱的体积。" #: ../data/functions.xml.in.h:836 msgid "Surface Area of Rectangular Prism" msgstr " 矩形棱柱表é¢ç§¯" #: ../data/functions.xml.in.h:837 msgid "r:rectprism_sa" msgstr "" #: ../data/functions.xml.in.h:838 msgid "Calculates the surface area of a prism with rectangular base." msgstr "计算矩形棱柱的表é¢ç§¯" #: ../data/functions.xml.in.h:839 msgid "Volume of Triangular Prism" msgstr "三角棱柱体积" #: ../data/functions.xml.in.h:840 msgid "r:triangleprism" msgstr "" #: ../data/functions.xml.in.h:841 msgid "Calculates the volume of a prism with triangular base." msgstr "计算三角棱柱的体积。" #: ../data/functions.xml.in.h:842 msgid "Pyramid" msgstr "锥体" #: ../data/functions.xml.in.h:843 msgid "Pyramid Volume" msgstr "锥体体积" #: ../data/functions.xml.in.h:844 msgid "r:pyramid" msgstr "" #: ../data/functions.xml.in.h:845 msgid "" "Calculates the volume of a 3-dimensional shape standing on a rectangular " "base and terminating in a point at the top." msgstr "计算矩形锥体的体积。" #: ../data/functions.xml.in.h:846 msgid "Length of base" msgstr "底é¢é•¿åº¦" #: ../data/functions.xml.in.h:847 msgid "Width of base" msgstr "底é¢å®½åº¦" #: ../data/functions.xml.in.h:848 msgid "Volume of Regular Tetrahedron" msgstr "正四é¢ä½“体积" #: ../data/functions.xml.in.h:849 msgid "r:tetrahedron" msgstr "" #: ../data/functions.xml.in.h:850 msgid "Surface Area of Regular Tetrahedron" msgstr "正四é¢ä½“表é¢ç§¯" #: ../data/functions.xml.in.h:851 msgid "r:tetrahedron_sa" msgstr "" #: ../data/functions.xml.in.h:852 msgid "Height of Regular Tetrahedron" msgstr "正四é¢ä½“的高度" #: ../data/functions.xml.in.h:853 msgid "r:tetrahedron_height" msgstr "" #: ../data/functions.xml.in.h:854 msgid "Volume of Square Pyramid" msgstr "方锥体体积" #: ../data/functions.xml.in.h:855 msgid "r:sqpyramid" msgstr "" #: ../data/functions.xml.in.h:856 msgid "Surface Area of Square Pyramid" msgstr "方锥体表é¢ç§¯" #: ../data/functions.xml.in.h:857 msgid "r:sqpyramid_sa" msgstr "" #: ../data/functions.xml.in.h:858 msgid "Height of Square Pyramid" msgstr "方角锥的高度" #: ../data/functions.xml.in.h:859 msgid "r:sqpyramid_height" msgstr "" #: ../data/functions.xml.in.h:860 msgid "Parallelogram" msgstr "平行四边形" #: ../data/functions.xml.in.h:861 msgid "Parallelogram Area" msgstr "平行四边形é¢ç§¯" #: ../data/functions.xml.in.h:862 msgid "r:parallelogram" msgstr "" #: ../data/functions.xml.in.h:863 msgid "" "Calculates the area of a four-sided figure whose opposite sides are both " "parallel and equal in length." msgstr "计算平行四边形的é¢ç§¯ã€‚" #: ../data/functions.xml.in.h:864 msgid "Parallelogram Perimeter" msgstr "平行四边形周长" #: ../data/functions.xml.in.h:865 msgid "r:parallelogram_perimeter" msgstr "" #: ../data/functions.xml.in.h:866 msgid "" "Calculates the perimeter of a four-sided figure whose opposite sides are " "both parallel and equal in length." msgstr "计算平行四边形的周长。" #: ../data/functions.xml.in.h:867 msgid "Trapezoid" msgstr "梯形" #: ../data/functions.xml.in.h:868 msgid "Trapezoid Area" msgstr "梯形é¢ç§¯" #: ../data/functions.xml.in.h:869 msgid "r:trapezoid" msgstr "" #: ../data/functions.xml.in.h:870 msgid "Calculates the area of a four-sided figure with two parallel sides." msgstr "计算梯形的é¢ç§¯ã€‚" #: ../data/functions.xml.in.h:871 msgid "Economics" msgstr "ç»æµŽå­¦" #: ../data/functions.xml.in.h:872 msgid "Microeconomics" msgstr "å¾®è§‚ç»æµŽå­¦" #: ../data/functions.xml.in.h:873 msgid "Elasticity" msgstr "弹性" #: ../data/functions.xml.in.h:874 msgid "r:elasticity" msgstr "" #: ../data/functions.xml.in.h:875 msgid "" "Calculates the demand elasticity. Also works for supply elasticity, income " "elasticity, cross-price elasticity, etc. Just replace demand with supply, or " "price with income... eg. elasticity(100-x^2, 3) calculates the " "demand elasticity when the price is 3 for the function \"Q = 100 - x^2\" " "where x is the default price variable." msgstr "" "è®¡ç®—éœ€æ±‚å¼¹æ€§ã€‚å°†éœ€æ±‚æ›¿æ¢æˆä¾›ç»™ã€æ”¶å…¥â€¦â€¦ç­‰ï¼Œä¹Ÿå¯ä»¥ç”¨å®ƒæ¥è®¡ç®—ä¾›ç»™å¼¹æ€§ã€æ”¶å…¥å¼¹" "性ã€äº¤å‰ä»·æ ¼å¼¹æ€§ç­‰ã€‚ 例如,表达å¼elasticity(100-x^2, 3)计算x为价格" "å˜é‡çš„函数\"Q = 100 - x^2\",当价格为3æ—¶çš„ 需求弹性。" #: ../data/functions.xml.in.h:876 msgid "Demand function" msgstr "需求函数" #: ../data/functions.xml.in.h:877 msgid "Price" msgstr "ä»·æ ¼" #: ../data/functions.xml.in.h:878 msgid "Price variable" msgstr "ä»·æ ¼å˜é‡" #: ../data/functions.xml.in.h:879 msgid "Sum-of-Years Digits Depreciation" msgstr "年数总和折旧" #: ../data/functions.xml.in.h:880 msgid "r:syd" msgstr "" #: ../data/functions.xml.in.h:881 msgid "" "Calculates the sum-of-years digits depreciation for an asset based on its " "cost, salvage value, anticipated life, and a particular period. This method " "accelerates the rate of the depreciation, so that more depreciation expense " "occurs in earlier periods than in later ones. The depreciable cost is the " "actual cost minus the salvage value. The useful life is the number of " "periods (typically years) over which the asset is depreciated." msgstr "" "æ ¹æ®ä¸€é¡¹èµ„äº§çš„æˆæœ¬ã€æ®‹å€¼ã€é¢„期寿命和特定周期计算它的年数总和折旧(SOYD)。 è¿™ç§" "方法加速折旧率,因此在早期的折旧支出比晚期è¦å¤šã€‚\"æŠ˜æ—§æˆæœ¬\"æ˜¯å®žé™…çš„æˆæœ¬ å‡åŽ»" "残值。\"寿命\"是指该资产折旧的周期数目(通常å•ä½ä¸ºå¹´)。" #: ../data/functions.xml.in.h:882 msgid "Cost" msgstr "æˆæœ¬" #: ../data/functions.xml.in.h:883 msgid "Salvage value" msgstr "残值" #: ../data/functions.xml.in.h:884 msgid "Life" msgstr "" #: ../data/functions.xml.in.h:885 msgid "Period" msgstr "周期" #: ../data/functions.xml.in.h:886 msgid "Straight Line Depreciation" msgstr "直线折旧" #: ../data/functions.xml.in.h:887 msgid "r:sln" msgstr "" #: ../data/functions.xml.in.h:888 msgid "" "Determines the straight line depreciation of an asset for a single period." " Cost is the amount you paid for the asset. Salvage is the value of " "the asset at the end of the period. Life is the number of periods over which " "the asset is depreciated. SLN divides the cost evenly over the life of an " "asset." msgstr "" "定义一项资产在å•一周期内的直线折旧(SLN方法)。 \"æˆæœ¬\"是您购买此资" "产的花销。\"残值\"是此资产在周期 ç»“æŸæ—¶çš„价值。\"寿命\"是指该资产折旧的周期数" "目。SLN将资产的价值 凿‘Šåˆ°å®ƒçš„寿命上。" #: ../data/functions.xml.in.h:889 msgid "Present Value" msgstr "现值" #: ../data/functions.xml.in.h:890 msgid "r:pv" msgstr "" #: ../data/functions.xml.in.h:891 msgid "" "Returns the present value of an investment. If type = 1 then the " "payment is made at the beginning of the period, If type = 0 (or omitted) it " "is made at the end of each period." msgstr "" "返回一项投资的现值。 \"类型\" 定义了到期日期。\"1\"代表在æ¯ä¸ªå‘¨æœŸçš„" "开头支付; \"0\"(缺çœå€¼)代表在æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚" #: ../data/functions.xml.in.h:892 msgid "Interest rate" msgstr "利率" #: ../data/functions.xml.in.h:893 msgid "Number of periods" msgstr "期数" #: ../data/functions.xml.in.h:894 msgid "Payment made each period" msgstr "æ¯æœŸæ”¯ä»˜" #: ../data/functions.xml.in.h:895 msgid "Future value" msgstr "未æ¥å€¼" #: ../data/functions.xml.in.h:896 msgid "Type" msgstr "类型" #: ../data/functions.xml.in.h:897 msgid "Nominal Interest Rate" msgstr "å义利率" #: ../data/functions.xml.in.h:898 msgid "r:nominal" msgstr "" #: ../data/functions.xml.in.h:899 msgid "" "Calculates the nominal interest rate from a given effective interest rate " "compounded at given intervals." msgstr "æ ¹æ®åœ¨ç»™å®šæ—¶é—´æ®µå†…å¤åˆçš„给定有效利率计算å义利率。" #: ../data/functions.xml.in.h:900 msgid "Effective interest rate" msgstr "有效利率" #: ../data/functions.xml.in.h:901 msgid "Periods" msgstr "周期" #: ../data/functions.xml.in.h:902 msgid "Zero Coupon" msgstr "é›¶æ¯" #: ../data/functions.xml.in.h:903 msgid "r:zero_coupon" msgstr "" #: ../data/functions.xml.in.h:904 msgid "Calculates the value of a zero-coupon (pure discount) bond." msgstr "计算零æ¯å€ºåˆ¸(纯贴现债券)的值。" #: ../data/functions.xml.in.h:905 msgid "Face value" msgstr "票é¢ä»·å€¼" #: ../data/functions.xml.in.h:906 msgid "Treasury Bill Yield" msgstr "短期债券收益" #: ../data/functions.xml.in.h:907 msgid "r:tbillyield" msgstr "" #: ../data/functions.xml.in.h:908 msgid "Returns the yield for a treasury bill." msgstr "返回短期债券的收益。" #: ../data/functions.xml.in.h:909 msgid "Settlement date" msgstr "结算日期" #: ../data/functions.xml.in.h:910 msgid "Maturity date" msgstr "到期日期" #: ../data/functions.xml.in.h:911 msgid "Price per $100 face value" msgstr "æ¯$100票é¢ä»·å€¼çš„ä»·æ ¼" #: ../data/functions.xml.in.h:912 msgid "Treasury Bill Price" msgstr "短期债券价格" #: ../data/functions.xml.in.h:913 msgid "r:tbillprice" msgstr "" #: ../data/functions.xml.in.h:914 msgid "Returns the price per $100 value for a treasury bill." msgstr "返回一支短期债券æ¯100美元é¢å€¼çš„价格。" #: ../data/functions.xml.in.h:915 msgid "Discount rate" msgstr "贴现率" #: ../data/functions.xml.in.h:916 msgid "Treasury Bill Equivalent" msgstr "短期债券等价物" #: ../data/functions.xml.in.h:917 msgid "r:tbilleq" msgstr "" #: ../data/functions.xml.in.h:918 msgid "Returns the bond equivalent for a treasury bill." msgstr "返回与一支短期债券等值的债券。" #: ../data/functions.xml.in.h:919 msgid "Interest paid on a given period of an investment (ISPMT)" msgstr "ç»™å®šæŠ•èµ„æœŸå†…è¦æ”¯ä»˜çš„利æ¯(ISPMT)" #: ../data/functions.xml.in.h:920 msgid "r:ispmt" msgstr "" #: ../data/functions.xml.in.h:921 msgid "Calculates the interest paid on a given period of an investment." msgstr "计算一项投资在给定周期内支付的利æ¯ã€‚" #: ../data/functions.xml.in.h:922 msgid "Periodic interest rate" msgstr "周期利率" #: ../data/functions.xml.in.h:923 msgid "Amortizement period" msgstr "å¿è¿˜æœŸ" #: ../data/functions.xml.in.h:924 msgid "Present value" msgstr "现值" #: ../data/functions.xml.in.h:925 msgid "Payment for a loan" msgstr "贷款å¿è¿˜" #: ../data/functions.xml.in.h:926 msgid "r:pmt" msgstr "" #: ../data/functions.xml.in.h:927 #, fuzzy msgid "" "Returns the amount of payment (negative) each period for a loan based on a " "constant interest rate and constant payments (each payment is equal amount)." " If type = 1 then the payment is made at the beginning of the " "period, If type = 0 (or omitted) it is made at the end of each period. " " Note that the interest rate here refers to the rate for each period and " "if you calculate with an annual rate, each period will be interpreted as a " "whole year. To get monthly payments divide the annual interest rate by 12 " "and enter the total number of months (12 times number of year) in the " "periods field." msgstr "" "返回一项利率固定并且定期å¿è¿˜çš„贷款的å¿è¿˜é¢ã€‚(æ¯æ¬¡å¿è¿˜é‡‘é¢ç›¸åŒ) \"ç±»" "åž‹\" 定义了到期日期。\"1\"代表在æ¯ä¸ªå‘¨æœŸçš„开头支付; \"0\"(缺çœå€¼)代表在æ¯ä¸ªå‘¨" "期末尾支付。" #: ../data/functions.xml.in.h:928 msgid "Rate" msgstr "利率" #: ../data/functions.xml.in.h:929 msgid "Periods of an investment" msgstr "投资的期数" #: ../data/functions.xml.in.h:930 msgid "r:nper" msgstr "" #: ../data/functions.xml.in.h:931 msgid "" "Calculates number of periods of an investment based on periodic constant " "payments and a constant interest rate. Type defines the due date. 1 " "for payment at the beginning of a period and 0 (default) for payment at the " "end of a period." msgstr "" "计算基于周期性固定支付和固定利率的投资的周期数目。 \"类型\" 定义了到" "期日期。\"1\"代表在æ¯ä¸ªå‘¨æœŸçš„开头支付;\"0\"(缺çœå€¼)代表在 æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚" #: ../data/functions.xml.in.h:932 msgid "Periods for investment to attain desired value" msgstr "è¦èŽ·å¾—æƒ³è¦çš„值,需è¦çš„æŠ•资期数" #: ../data/functions.xml.in.h:933 msgid "r:g_duration" msgstr "" #: ../data/functions.xml.in.h:934 msgid "" "Returns the number of periods needed for an investment to attain a desired " "value." msgstr "返回一项投资è¦å¾—到想è¦çš„金é¢ï¼Œæ‰€éœ€è¦çš„æœŸæ•°ã€‚" #: ../data/functions.xml.in.h:935 msgid "Payment of an annuity going towards principal (PPMT)" msgstr "本金的年金支付é¢(PPMT)" #: ../data/functions.xml.in.h:936 msgid "r:ppmt" msgstr "" #: ../data/functions.xml.in.h:937 msgid "" "Calculates the amount of a payment of an annuity going towards principal." " Type defines the due date. 1 for payment at the beginning of a " "period and 0 (default) for payment at the end of a period." msgstr "" "计算关于本金的年金支付é¢ã€‚ \"类型\" 定义了到期日期。\"1\"代表在æ¯ä¸ª" "周期的开头支付; \"0\"(缺çœå€¼)代表在æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚" #: ../data/functions.xml.in.h:938 msgid "Desired future value" msgstr "期望的未æ¥ä»·å€¼" #: ../data/functions.xml.in.h:939 msgid "Effective Interest Rate" msgstr "有效利率" #: ../data/functions.xml.in.h:940 msgid "r:effect" msgstr "" #: ../data/functions.xml.in.h:941 msgid "Calculates the effective interest for a given nominal rate." msgstr "æ ¹æ®ç»™å®šçš„å义利率计算有效利æ¯ã€‚" #: ../data/functions.xml.in.h:942 msgid "Nominal interest rate" msgstr "å义利率" #: ../data/functions.xml.in.h:943 msgid "Future Value" msgstr "未æ¥å€¼" #: ../data/functions.xml.in.h:944 msgid "r:fv" msgstr "" #: ../data/functions.xml.in.h:945 msgid "" "Computes the future value of an investment. This is based on periodic, " "constant payments and a constant interest rate. If type = 1 then " "the payment is made at the beginning of the period, If type = 0 (or omitted) " "it is made at the end of each period." msgstr "" "计算一项价值的未æ¥ä»·å€¼ã€‚这是根æ®å‘¨æœŸã€å›ºå®šæ”¯ä»˜å’Œå›ºå®šåˆ©çŽ‡è®¡ç®—å‡ºæ¥çš„。 " " \"type\"说明了到期日期。\"1\"代表在æ¯ä¸ªå‘¨æœŸçš„开头支付; \"0\"(缺çœå€¼)代" "表在æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚" #: ../data/functions.xml.in.h:946 msgid "Return on continuously compounded interest" msgstr "æ ¹æ®è¿žç»­å¤åˆåˆ©çŽ‡çš„å›žæŠ¥" #: ../data/functions.xml.in.h:947 msgid "r:continuous" msgstr "" #: ../data/functions.xml.in.h:948 msgid "" "Calculates the return on continuously compounded interest, given the " "principal, nominal rate and time in years." msgstr "æ ¹æ®ç»™å®šçš„æœ¬é‡‘ã€å义利率和以年为å•ä½çš„æ—¶é—´ï¼Œè®¡ç®—连续å¤åˆåˆ©çŽ‡çš„å›žæŠ¥ã€‚" #: ../data/functions.xml.in.h:949 msgid "Principal" msgstr "本金" #: ../data/functions.xml.in.h:950 msgid "Compound" msgstr "å¤åˆå€¼" #: ../data/functions.xml.in.h:951 msgid "r:compound" msgstr "" #: ../data/functions.xml.in.h:952 msgid "" "Returns the value of an investment, given the principal, nominal interest " "rate, compounding frequency and time." msgstr "æ ¹æ®ç»™å®šçš„æœ¬é‡‘ã€å义利率ã€å¤åˆé¢‘率和时间计算并返回投资的值。" #: ../data/functions.xml.in.h:953 msgid "Periods per year" msgstr "æ¯å¹´çš„æœŸæ•°" #: ../data/functions.xml.in.h:954 msgid "Payment of an annuity going towards interest (IPMT)" msgstr "利æ¯çš„年金支付é¢(IPMT)" #: ../data/functions.xml.in.h:955 msgid "r:ipmt" msgstr "" #: ../data/functions.xml.in.h:956 msgid "" "Calculates the amount of a payment of an annuity going towards interest. " " Type defines the due date. 1 for payment at the beginning of a period " "and 0 (default) for payment at the end of a period." msgstr "" "è®¡ç®—å…³äºŽæœ¬é‡‘çš„å¹´é‡‘åˆ©æ¯æ”¯ä»˜é¢. \"类型\" 定义了到期日期。\"1\"代表在" "æ¯ä¸ªå‘¨æœŸçš„开头支付; \"0\"(缺çœå€¼)代表在æ¯ä¸ªå‘¨æœŸæœ«å°¾æ”¯ä»˜ã€‚" #: ../data/functions.xml.in.h:957 msgid "Interest rate for a fully invested security" msgstr "一项已充分投资è¯åˆ¸çš„利率" #: ../data/functions.xml.in.h:958 msgid "r:intrate" msgstr "" #: ../data/functions.xml.in.h:959 msgid "" "Returns the interest rate for a fully invested security. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回一支已充分投资的è¯åˆ¸çš„利率。 \"基准\"是您想使用的天数计算类型:" "0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or " "4: æ¬§å¼ 30/360。" #: ../data/functions.xml.in.h:960 msgid "Investment" msgstr "投资" #: ../data/functions.xml.in.h:961 msgid "Redemption" msgstr "å¿è¿˜" #: ../data/functions.xml.in.h:962 msgid "Dollar Fraction" msgstr "美元分数" #: ../data/functions.xml.in.h:963 msgid "r:dollarfr" msgstr "" #: ../data/functions.xml.in.h:964 msgid "" "Converts a decimal dollar price into a dollar price expressed as a fraction." msgstr "å°†ç”¨å°æ•°è¡¨ç¤ºçš„美元价格转化为用分数表示的价格。" #: ../data/functions.xml.in.h:965 msgid "Decimal dollar" msgstr "å°æ•°è¡¨ç¤ºçš„美元" #: ../data/functions.xml.in.h:966 msgid "Denominator of fraction" msgstr "分数的分æ¯" #: ../data/functions.xml.in.h:967 msgid "Dollar Decimal" msgstr "ç¾Žå…ƒå°æ•°" #: ../data/functions.xml.in.h:968 msgid "r:dollarde" msgstr "" #: ../data/functions.xml.in.h:969 msgid "" "Converts a dollar price expressed as a fraction into a dollar price " "expressed as a decimal number." msgstr "å°†ç”¨åˆ†æ•°è¡¨ç¤ºçš„ç¾Žå…ƒä»·æ ¼è½¬åŒ–ä¸ºç”¨å°æ•°è¡¨ç¤ºçš„价格。" #: ../data/functions.xml.in.h:970 msgid "Fractional dollar" msgstr "分数表示的美元" #: ../data/functions.xml.in.h:971 msgid "Amount received at maturity for a security bond" msgstr "债券到期时获得的金é¢" #: ../data/functions.xml.in.h:972 msgid "r:received" msgstr "" #: ../data/functions.xml.in.h:973 msgid "" "Returns the amount received at the maturity date for an invested security." " Basis is the type of day counting you want to use: 0: US 30/360 " "(default), 1: real days, 2: real days/360, 3: real days/365 or 4: European " "30/360. The settlement date must be before maturity date." msgstr "" "返回一支è¯åˆ¸åˆ°æœŸæ—¶å¯å¾—到的金é¢ã€‚ \"基准\"是您想使用的天数计算类型:" "0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or " "4: æ¬§å¼ 30/360。" #: ../data/functions.xml.in.h:974 msgid "Discount rate for a security" msgstr "è¯åˆ¸çš„贴现率" #: ../data/functions.xml.in.h:975 msgid "r:disc" msgstr "" #: ../data/functions.xml.in.h:976 msgid "" "Returns the discount rate for a security. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回一支è¯åˆ¸çš„贴现率。 \"基准\"是您想使用的天数计算类型:0: ç¾Žå¼ " "30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ " "30/360。" #: ../data/functions.xml.in.h:977 msgid "Accrued interest of security paying at maturity" msgstr "到期时支付的è¯åˆ¸åº”计利æ¯" #: ../data/functions.xml.in.h:978 msgid "r:accrintm" msgstr "" #: ../data/functions.xml.in.h:979 msgid "" "Returns the accrued interest for a security which pays interest at maturity " "date. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "返回一个在到期时支付利æ¯çš„è¯åˆ¸çš„应计利æ¯ã€‚ \"基准\"是您想使用的天" "数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实" "天数/365 or 4: æ¬§å¼ 30/360。" #: ../data/functions.xml.in.h:980 msgid "Issue date" msgstr "å‘表日期" #: ../data/functions.xml.in.h:981 msgid "Annual rate of security" msgstr "è¯åˆ¸å¹´åˆ©çއ" #: ../data/functions.xml.in.h:982 msgid "Par value" msgstr "é¢å€¼" #: ../data/functions.xml.in.h:983 msgid "Accrued interest of security with periodic interest payments" msgstr "分期支付的è¯åˆ¸åº”计利æ¯" #: ../data/functions.xml.in.h:984 msgid "r:accrint" msgstr "" #: ../data/functions.xml.in.h:985 msgid "" "Returns accrued interest for a security which pays periodic interest. " " Allowed frequencies are 1 - annual, 2 - semi-annual or 4 - quarterly. " "Basis is the type of day counting you want to use: 0: US 30/360 (default), " "1: real days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "返回一个定期支付利æ¯çš„è¯åˆ¸çš„应计利æ¯ã€‚ å…许的支付频率为:1 - 年付, " "2 - åŠå¹´ä»˜ 或 4 - 季付。 \"基准\"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺" "çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。" #: ../data/functions.xml.in.h:986 msgid "First interest" msgstr "第一笔利æ¯" #: ../data/functions.xml.in.h:987 msgid "Frequency" msgstr "频率" #: ../data/functions.xml.in.h:988 msgid "Number of coupons to be paid" msgstr "è¦æ”¯ä»˜çš„æ¯ç¥¨æ•°é‡" #: ../data/functions.xml.in.h:989 msgid "r:coupnum" msgstr "" #: ../data/functions.xml.in.h:990 msgid "" "Returns the number of coupons to be paid between the settlement and the " "maturity. Basis is the type of day counting you want to use: 0: US " "30/360 (default), 1: real days, 2: real days/360, 3: real days/365 or 4: " "European 30/360." msgstr "" "è¿”å›žåœ¨ç»“ç®—æ—¥å’Œåˆ°æœŸæ—¥æœŸä¹‹é—´è¦æ”¯ä»˜çš„æœŸç¥¨æ•°é‡ã€‚ \"基准\"是您想使用的天" "数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天数, 2: 真实天数/360, 3: 真实" "天数/365 or 4: æ¬§å¼ 30/360。" #: ../data/functions.xml.in.h:991 #, fuzzy msgid "Price per $100 face value of a discounted security" msgstr "一支è¯åˆ¸æ¯$100票é¢ä»·å€¼çš„ä»·æ ¼" #: ../data/functions.xml.in.h:992 msgid "r:pricedisc" msgstr "" #: ../data/functions.xml.in.h:993 #, fuzzy msgid "" "Calculates and returns the price per $100 face value of a discounted " "security. The security does not pay interest at maturity. Basis is " "the type of day counting you want to use: 0: US 30/360 (default), 1: real " "days, 2: real days/360, 3: real days/365 or 4: European 30/360." msgstr "" "计算并返回一个债券æ¯100美元票é¢ä»·å€¼çš„ä»·æ ¼ã€‚æ­¤å€ºåˆ¸åœ¨åˆ°æœŸæ—¶ä¸æ”¯ä»˜åˆ©æ¯ã€‚ " " \"基准\"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天" "æ•°, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。" #: ../data/functions.xml.in.h:994 msgid "Discount" msgstr "贴现" #: ../data/functions.xml.in.h:995 msgid "Price per $100 face value of a security" msgstr "一支è¯åˆ¸æ¯$100票é¢ä»·å€¼çš„ä»·æ ¼" #: ../data/functions.xml.in.h:996 msgid "r:pricemat" msgstr "" #: ../data/functions.xml.in.h:997 msgid "" "Calculates and returns the price per $100 face value of a security. The " "security pays interest at maturity. Basis is the type of day " "counting you want to use: 0: US 30/360 (default), 1: real days, 2: real " "days/360, 3: real days/365 or 4: European 30/360." msgstr "" "计算并返回一个债券æ¯100美元票é¢ä»·å€¼çš„价格。此债券在到期时支付利æ¯ã€‚ " " \"基准\"是您想使用的天数计算类型:0: ç¾Žå¼ 30/360 (缺çœå€¼), 1: 真实天" "æ•°, 2: 真实天数/360, 3: 真实天数/365 or 4: æ¬§å¼ 30/360。" #: ../data/functions.xml.in.h:998 msgid "Annual yield" msgstr "年收益" #: ../data/functions.xml.in.h:999 msgid "Level-Coupon Bond" msgstr "æ¯ç¥¨å€ºåˆ¸" #: ../data/functions.xml.in.h:1000 msgid "r:level_coupon" msgstr "r:level_coupon" #: ../data/functions.xml.in.h:1001 msgid "Calculates the value of a level-coupon bond." msgstr "计算æ¯ç¥¨å€ºåˆ¸çš„值。" #: ../data/functions.xml.in.h:1002 msgid "Coupon rate" msgstr "æ¯ç¥¨åˆ©çއ" #: ../data/functions.xml.in.h:1003 msgid "Coupons per year" msgstr "æ¯ç¥¨æ•°æ¯å¹´" #: ../data/functions.xml.in.h:1004 msgid "Market interest rate" msgstr "市场利率" #: ../data/planets.xml.in.h:1 msgid "Earth" msgstr "地çƒ" #: ../data/planets.xml.in.h:2 msgid "Mars" msgstr "ç«æ˜Ÿ" #. Planet #: ../data/planets.xml.in.h:4 msgid "!planets!Mercury" msgstr "水星" #: ../data/planets.xml.in.h:5 msgid "Venus" msgstr "金星" #: ../data/planets.xml.in.h:6 msgid "Jupiter" msgstr "木星" #: ../data/planets.xml.in.h:7 msgid "Saturn" msgstr "土星" #: ../data/planets.xml.in.h:8 msgid "Neptune" msgstr "海王星" #: ../data/planets.xml.in.h:9 msgid "Pluto" msgstr "冥王星" #: ../data/planets.xml.in.h:10 msgid "Uranus" msgstr "天王星" #. Unit category #: ../data/units.xml.in.h:2 msgid "!units!Length" msgstr "长度" #: ../data/units.xml.in.h:3 msgid "Meter" msgstr "ç±³" #: ../data/units.xml.in.h:4 msgid "ar:m,meter,p:meters,metre,p:metres" msgstr "" #: ../data/units.xml.in.h:5 msgid "Kilometer" msgstr "åƒç±³" #: ../data/units.xml.in.h:6 msgid "Decimeter" msgstr "分米" #: ../data/units.xml.in.h:7 msgid "Centimeter" msgstr "厘米" #: ../data/units.xml.in.h:8 msgid "Millimeter" msgstr "毫米" #: ../data/units.xml.in.h:9 msgid "Nautical Mile" msgstr "海里" #: ../data/units.xml.in.h:10 msgid "r:nautical_mile,p:nautical_miles" msgstr "" #: ../data/units.xml.in.h:11 msgid "Ångström" msgstr "" #: ../data/units.xml.in.h:12 msgid "aru:Å,u:ångström,angstrom" msgstr "" #: ../data/units.xml.in.h:13 msgid "U.S. Survey Inch" msgstr "" #: ../data/units.xml.in.h:14 msgid "ar:US_in,US_inch,p:US_inches" msgstr "" #: ../data/units.xml.in.h:15 msgid "Inch" msgstr "英寸" #: ../data/units.xml.in.h:16 msgid "ar:in,inch,p:inches" msgstr "" #: ../data/units.xml.in.h:17 msgid "Hand" msgstr "" #: ../data/units.xml.in.h:18 msgid "r:hand,p:hands" msgstr "" #: ../data/units.xml.in.h:19 msgid "Foot" msgstr "英尺" #: ../data/units.xml.in.h:20 msgid "ar:ft,foot,p:feet" msgstr "" #: ../data/units.xml.in.h:21 msgid "U.S. Survey Foot" msgstr "" #: ../data/units.xml.in.h:22 msgid "ar:US_ft,US_foot,p:US_feet" msgstr "" #: ../data/units.xml.in.h:23 msgid "Link" msgstr "" #: ../data/units.xml.in.h:24 msgid "ar:li,link,p:links" msgstr "" #: ../data/units.xml.in.h:25 msgid "Yard" msgstr "ç " #: ../data/units.xml.in.h:26 msgid "ar:yd,yard,p:yards" msgstr "" #: ../data/units.xml.in.h:27 msgid "Rod (pole/perch)" msgstr "" #: ../data/units.xml.in.h:28 msgid "ar:rd,rod,p:rods" msgstr "" #: ../data/units.xml.in.h:29 msgid "Fathom" msgstr "英寻" #: ../data/units.xml.in.h:30 msgid "r:fathom,p:fathoms" msgstr "" #: ../data/units.xml.in.h:31 msgid "Chain" msgstr "链" #: ../data/units.xml.in.h:32 msgid "ar:ch,chain,p:chains" msgstr "" #: ../data/units.xml.in.h:33 msgid "Furlong" msgstr "弗隆" #: ../data/units.xml.in.h:34 msgid "ar:fur,furlong,p:furlongs" msgstr "" #: ../data/units.xml.in.h:35 msgid "Mile" msgstr "英里" #: ../data/units.xml.in.h:36 msgid "ar:mi,mile,p:miles" msgstr "" #: ../data/units.xml.in.h:37 msgid "U.S. Survey Mile" msgstr "" #: ../data/units.xml.in.h:38 msgid "ar:US_mi,US_mile,p:US_miles" msgstr "" #: ../data/units.xml.in.h:39 msgid "Mil (1/1000 in)" msgstr "毫英寸(1/1000英寸)" #: ../data/units.xml.in.h:40 msgid "r:mil,p:mils" msgstr "" #: ../data/units.xml.in.h:41 msgid "Astronomical Unit" msgstr "天文å•ä½" #: ../data/units.xml.in.h:42 msgid "ar:AU,astronomical_unit,p:astronomical_units" msgstr "" #: ../data/units.xml.in.h:43 msgid "Light Year" msgstr "光年" #: ../data/units.xml.in.h:44 msgid "ar:ly,lightyear,p:lightyears" msgstr "" #: ../data/units.xml.in.h:45 msgid "Parsec" msgstr "ç§’å·®è·" #: ../data/units.xml.in.h:46 msgid "ar:pc,parsec,p:parsecs" msgstr "" #: ../data/units.xml.in.h:47 msgid "Pied du roi (French Royal Foot)" msgstr "" #: ../data/units.xml.in.h:48 msgid "r:pied_du_roi" msgstr "" #: ../data/units.xml.in.h:49 msgid "Pouce (French Royal Inch)" msgstr "" #: ../data/units.xml.in.h:50 msgid "r:pouce" msgstr "" #: ../data/units.xml.in.h:51 msgid "Ligne" msgstr "" #: ../data/units.xml.in.h:52 msgid "r:ligne" msgstr "" #: ../data/units.xml.in.h:53 msgid "Toise" msgstr "" #: ../data/units.xml.in.h:54 msgid "r:toise" msgstr "" #. Unit category #: ../data/units.xml.in.h:56 msgid "!units!Angle" msgstr "角度" #: ../data/units.xml.in.h:57 msgid "Plane Angle" msgstr "å¹³é¢è§’" #: ../data/units.xml.in.h:58 msgid "Meter per Meter" msgstr "ç±³æ¯ç±³" #: ../data/units.xml.in.h:59 msgid "Radian" msgstr "弧度" #: ../data/units.xml.in.h:60 msgid "ar:rad,radian,p:radians" msgstr "" #: ../data/units.xml.in.h:62 msgid "ar:deg,au:°,degree,p:degrees" msgstr "" #: ../data/units.xml.in.h:63 msgid "Gradian (Gon)" msgstr "" #: ../data/units.xml.in.h:64 msgid "ar:gra,gradian,p:gradians,gon,p:gons" msgstr "" #: ../data/units.xml.in.h:65 msgid "Arcminute" msgstr "弧分" #: ../data/units.xml.in.h:66 msgid "ar:arcmin,arcminute,p:arcminutes" msgstr "" #: ../data/units.xml.in.h:67 msgid "Arcsecond" msgstr "å¼§ç§’" #: ../data/units.xml.in.h:68 msgid "ar:arcsec,arcsecond,p:arcseconds" msgstr "" #: ../data/units.xml.in.h:69 msgid "Turn" msgstr "" #: ../data/units.xml.in.h:70 msgid "r:turn,p:turns" msgstr "r:turn,p:turns" #: ../data/units.xml.in.h:71 msgid "Solid Angle" msgstr "立体角" #: ../data/units.xml.in.h:72 msgid "Square Meter per Square Meter" msgstr "平方米æ¯å¹³æ–¹ç±³" #: ../data/units.xml.in.h:73 msgid "Steradian" msgstr "çƒé¢åº¦" #: ../data/units.xml.in.h:74 msgid "ar:sr,steradian,p:steradians" msgstr "" #: ../data/units.xml.in.h:75 msgid "Angular Acceleration" msgstr "角加速度" #: ../data/units.xml.in.h:76 msgid "Radians per Second Squared" msgstr "弧度æ¯å¹³æ–¹ç§’" #: ../data/units.xml.in.h:77 msgid "Angular Velocity" msgstr "角速度" #: ../data/units.xml.in.h:78 msgid "Radians per Second" msgstr "弧度æ¯ç§’" #. Unit category #: ../data/units.xml.in.h:80 msgid "!units!Mass" msgstr "è´¨é‡" #: ../data/units.xml.in.h:81 msgid "Gram" msgstr "å…‹" #: ../data/units.xml.in.h:82 msgid "ar:g,gram,p:grams" msgstr "" #: ../data/units.xml.in.h:83 msgid "Kilogram" msgstr "åƒå…‹" #: ../data/units.xml.in.h:84 #, fuzzy msgid "Hectogram" msgstr "å‘é‡" #: ../data/units.xml.in.h:85 msgid "Metric Ton (Tonne)" msgstr "å…¬å¨" #: ../data/units.xml.in.h:86 msgid "ar:t,tonne,p:tonnes,ton,p:tons" msgstr "" #: ../data/units.xml.in.h:87 msgid "Grain" msgstr "格令" #: ../data/units.xml.in.h:88 msgid "ar:gr,grain,p:grains" msgstr "" #: ../data/units.xml.in.h:89 msgid "Pennyweight" msgstr "本尼å¨ç‰¹" #: ../data/units.xml.in.h:90 msgid "ar:pwt,pennyweight,p:pennyweights" msgstr "" #: ../data/units.xml.in.h:91 msgid "Ounce (troy)" msgstr "金衡制盎å¸" #: ../data/units.xml.in.h:92 msgid "ar:oz_t,troy_ounce,p:troy_ounces" msgstr "" #: ../data/units.xml.in.h:93 msgid "Pound (troy)" msgstr "金衡制磅" #: ../data/units.xml.in.h:94 msgid "ar:lb_t,troy_pound,p:troy_pounds" msgstr "" #: ../data/units.xml.in.h:95 msgid "Dram" msgstr "英钱" #: ../data/units.xml.in.h:96 msgid "ar:dr,dram,p:drams" msgstr "" #: ../data/units.xml.in.h:97 msgid "Ounce" msgstr "盎å¸" #: ../data/units.xml.in.h:98 msgid "ar:oz,ounce,p:ounces" msgstr "" #: ../data/units.xml.in.h:99 msgid "Pound" msgstr "磅" #: ../data/units.xml.in.h:100 msgid "ar:lb,pound,p:pounds" msgstr "" #: ../data/units.xml.in.h:101 #, fuzzy msgid "Short Hundredweight (Cental)" msgstr "短英担" #: ../data/units.xml.in.h:102 msgid "ar:cwt,hundredweight,cental,p:hundredweights,centals" msgstr "" #: ../data/units.xml.in.h:103 msgid "Long Hundredweight" msgstr "é•¿æ‹…" #: ../data/units.xml.in.h:104 msgid "ar:l_cwt,long_hundredweight,p:long_hundredweights" msgstr "" #: ../data/units.xml.in.h:105 msgid "Short Ton" msgstr "短å¨" #: ../data/units.xml.in.h:106 msgid "ar:s_ton,short_ton,p:short_tons" msgstr "" #: ../data/units.xml.in.h:107 msgid "Long Ton" msgstr "é•¿å¨" #: ../data/units.xml.in.h:108 msgid "ar:l_ton,long_ton,p:long_tons" msgstr "" #: ../data/units.xml.in.h:109 msgid "Stone" msgstr "" #: ../data/units.xml.in.h:110 msgid "r:stone,p:stones" msgstr "" #: ../data/units.xml.in.h:111 msgid "Carat" msgstr "克拉" #: ../data/units.xml.in.h:112 msgid "r:carat,p:carats" msgstr "" #: ../data/units.xml.in.h:113 msgid "Pfund" msgstr "" #: ../data/units.xml.in.h:114 msgid "r:pfund" msgstr "" #: ../data/units.xml.in.h:115 msgid "Zentner" msgstr "" #: ../data/units.xml.in.h:116 msgid "r:zentner" msgstr "r:zentner" #: ../data/units.xml.in.h:118 msgid "Kilogram per Cubic Meter" msgstr "åƒå…‹æ¯ç«‹æ–¹ç±³" #: ../data/units.xml.in.h:119 msgid "Gram per Cubic Decimeter" msgstr "å…‹æ¯ç«‹æ–¹åˆ†ç±³" #: ../data/units.xml.in.h:120 msgid "Gram per Cubic Centimeter" msgstr "å…‹æ¯ç«‹æ–¹åŽ˜ç±³" #: ../data/units.xml.in.h:121 #, fuzzy msgid "Atomic Mass" msgstr "原å­è´¨é‡å•ä½" #: ../data/units.xml.in.h:122 msgid "Gram per Mole" msgstr "å…‹æ¯æ‘©å°”" #: ../data/units.xml.in.h:123 msgid "Atomic Mass Unit" msgstr "原å­è´¨é‡å•ä½" #: ../data/units.xml.in.h:124 msgid "ar:u,a:AMU,atomic_mass_unit,p:atomic_mass_units" msgstr "" #: ../data/units.xml.in.h:125 msgid "Dalton" msgstr "" #: ../data/units.xml.in.h:126 msgid "ar:Da,dalton,p:daltons" msgstr "" #: ../data/units.xml.in.h:127 msgid "Kilodalton" msgstr "" #: ../data/units.xml.in.h:128 msgid "Mass Fraction" msgstr "è´¨é‡åˆ†æ•°" #: ../data/units.xml.in.h:129 msgid "Kilogram per Kilogram" msgstr "åƒå…‹æ¯åƒå…‹" #: ../data/units.xml.in.h:132 msgid "ar:s,second,p:seconds" msgstr "" #: ../data/units.xml.in.h:134 msgid "ar:min,minute,p:minutes" msgstr "" #: ../data/units.xml.in.h:136 msgid "ar:h,hour,p:hours" msgstr "" #: ../data/units.xml.in.h:138 msgid "ar:d,day,p:days" msgstr "" #: ../data/units.xml.in.h:139 msgid "Week" msgstr "周" #: ../data/units.xml.in.h:140 msgid "r:week,p:weeks" msgstr "" #: ../data/units.xml.in.h:141 msgid "Fortnight" msgstr "两星期" #: ../data/units.xml.in.h:142 msgid "r:fortnight,p:fortnights" msgstr "" #: ../data/units.xml.in.h:143 msgid "Julian Year" msgstr "儒略年" #: ../data/units.xml.in.h:144 msgid "r:year,p:years" msgstr "" #: ../data/units.xml.in.h:146 msgid "r:month,p:months" msgstr "" #. Unit category #: ../data/units.xml.in.h:148 msgid "!units!Frequency" msgstr "频率" #: ../data/units.xml.in.h:149 msgid "Hertz" msgstr "赫兹" #: ../data/units.xml.in.h:150 msgid "ar:Hz,hertz" msgstr "" #: ../data/units.xml.in.h:151 msgid "Electricity" msgstr "电学" #: ../data/units.xml.in.h:152 msgid "Electric Current" msgstr "电æµ" #: ../data/units.xml.in.h:153 msgid "Ampere" msgstr "安培" #: ../data/units.xml.in.h:154 msgid "ar:A,ampere,p:amperes" msgstr "" #: ../data/units.xml.in.h:155 msgid "Abampere" msgstr "ç»å¯¹å®‰åŸ¹" #: ../data/units.xml.in.h:156 msgid "r:abampere,a:abA,a:aA,p:abamperes" msgstr "" #: ../data/units.xml.in.h:157 msgid "Current Density" msgstr "电æµå¯†åº¦" #: ../data/units.xml.in.h:158 msgid "Ampere per Meter Squared" msgstr "安培æ¯å¹³æ–¹ç±³" #: ../data/units.xml.in.h:159 msgid "Electric Charge" msgstr "电è·" #: ../data/units.xml.in.h:160 msgid "Second Ampere" msgstr "秒安培" #: ../data/units.xml.in.h:161 msgid "Coulomb" msgstr "库仑" #: ../data/units.xml.in.h:162 msgid "ar:C,coulomb,p:coulombs" msgstr "" #: ../data/units.xml.in.h:163 msgid "Abcoulomb" msgstr "ç»å¯¹åº“伦" #: ../data/units.xml.in.h:164 msgid "r:abcoulomb,p:abcoulombs,a:abC,a:aC" msgstr "" #: ../data/units.xml.in.h:165 msgid "Statcoloumb (Franklin)" msgstr "" #: ../data/units.xml.in.h:166 msgid "r:statcoulomb,p:statcoulombs,a:statC,franklin,a:Fr,p:franklins" msgstr "" #: ../data/units.xml.in.h:167 msgid "Electric Charge Density" msgstr "电è·å¯†åº¦" #: ../data/units.xml.in.h:168 msgid "Coulomb per Cubic Meter" msgstr "库仑æ¯ç«‹æ–¹ç±³" #: ../data/units.xml.in.h:169 msgid "Electric Flux Density" msgstr "电通密度" #: ../data/units.xml.in.h:170 msgid "Coulomb per Meter Squared" msgstr "库仑æ¯å¹³ç±³" #: ../data/units.xml.in.h:171 msgid "Electric Potential" msgstr "电势" #: ../data/units.xml.in.h:172 msgid "Watt per Ampere" msgstr "瓦æ¯å®‰åŸ¹" #: ../data/units.xml.in.h:173 msgid "Volt" msgstr "ä¼ç‰¹" #: ../data/units.xml.in.h:174 msgid "ar:V,volt,p:volts" msgstr "" #: ../data/units.xml.in.h:175 msgid "Statvolt" msgstr "é™ä¼ç‰¹" #: ../data/units.xml.in.h:176 msgid "r:statvolt,p:statvolts,a:statV" msgstr "" #: ../data/units.xml.in.h:177 msgid "Abvolt" msgstr "ç»å¯¹ä¼ç‰¹" #: ../data/units.xml.in.h:178 msgid "r:abvolt,p:abvolts,a:abV" msgstr "" #: ../data/units.xml.in.h:179 msgid "Capacitance" msgstr "电容" #: ../data/units.xml.in.h:180 msgid "Coulomb per Volt" msgstr "库仑æ¯ä¼ç‰¹" #: ../data/units.xml.in.h:181 msgid "Farad" msgstr "法拉" #: ../data/units.xml.in.h:182 msgid "ar:F,farad,p:farads" msgstr "" #: ../data/units.xml.in.h:183 msgid "Electric Resistance" msgstr "电阻" #: ../data/units.xml.in.h:184 msgid "Volt per Ampere" msgstr "ä¼ç‰¹æ¯å®‰åŸ¹" #: ../data/units.xml.in.h:185 msgid "Ohm" msgstr "欧姆" #: ../data/units.xml.in.h:186 msgid "au:Ω,r:ohm,p:ohms" msgstr "" #: ../data/units.xml.in.h:187 msgid "Abohm" msgstr "ç»å¯¹å•使¬§å§†" #: ../data/units.xml.in.h:188 msgid "r:abohm,p:abohms,au:abΩ" msgstr "" #: ../data/units.xml.in.h:189 msgid "Statohm" msgstr "陿¬§å§†" #: ../data/units.xml.in.h:190 msgid "r:statohm,p:statohms,au:statΩ" msgstr "" #: ../data/units.xml.in.h:191 msgid "Electric Conductance" msgstr "电导" #: ../data/units.xml.in.h:192 msgid "Ampere per Volt" msgstr "安培æ¯ä¼ç‰¹" #: ../data/units.xml.in.h:193 msgid "Siemens" msgstr "" #: ../data/units.xml.in.h:194 msgid "ar:S,siemens" msgstr "" #: ../data/units.xml.in.h:195 msgid "Electric Field Strength" msgstr "电场强度" #: ../data/units.xml.in.h:196 msgid "Volt per Meter" msgstr "ä¼ç‰¹æ¯ç±³" #: ../data/units.xml.in.h:197 msgid "Permittivity" msgstr "电容率" #: ../data/units.xml.in.h:198 msgid "Farad per Meter" msgstr "法拉æ¯ç±³" #: ../data/units.xml.in.h:199 msgid "Inductance" msgstr "电感" #: ../data/units.xml.in.h:200 msgid "Weber per Ampere" msgstr "韦伯æ¯å®‰åŸ¹" #: ../data/units.xml.in.h:201 msgid "Henry" msgstr "亨利" #: ../data/units.xml.in.h:202 msgid "ar:H,henry,p:henrys" msgstr "" #: ../data/units.xml.in.h:203 msgid "Permeability" msgstr "ç£å¯¼çއ" #: ../data/units.xml.in.h:204 msgid "Henry per Meter" msgstr "亨利æ¯ç±³" #: ../data/units.xml.in.h:205 msgid "Temperature" msgstr "温度" #: ../data/units.xml.in.h:206 msgid "Kelvin" msgstr "开尔文" #: ../data/units.xml.in.h:207 msgid "ar:K,kelvin,p:kelvins" msgstr "" #: ../data/units.xml.in.h:208 msgid "Degree Celsius" msgstr "æ‘„æ°åº¦" #: ../data/units.xml.in.h:209 msgid "" "ar:oC,au:°C,au:℃,r:celsius,p:celsius,centigrade,p:centigrades" msgstr "" #: ../data/units.xml.in.h:210 msgid "Degree Rankine" msgstr "åŽæ°åº¦" #: ../data/units.xml.in.h:211 msgid "ar:oR,au:°R,r:rankine" msgstr "" #: ../data/units.xml.in.h:212 msgid "Degree Fahrenheit" msgstr "åŽæ°åº¦" #: ../data/units.xml.in.h:213 msgid "ar:oF,au:°F,au:℉,r:fahrenheit" msgstr "" #: ../data/units.xml.in.h:214 msgid "Substance" msgstr "物质" #: ../data/units.xml.in.h:215 msgid "Mole" msgstr "æ‘©å°”" #: ../data/units.xml.in.h:216 msgid "ar:mol,mole,p:moles" msgstr "" #: ../data/units.xml.in.h:217 msgid "Einstein" msgstr "爱因斯å¦" #: ../data/units.xml.in.h:218 msgid "r:einstein,p:einsteins" msgstr "" #: ../data/units.xml.in.h:219 msgid "Substance Concentration" msgstr "物质浓度" #: ../data/units.xml.in.h:220 msgid "Mole per Cubic Meter" msgstr "æ‘©å°”æ¯å¹³ç±³" #: ../data/units.xml.in.h:221 msgid "Catalytic Activity" msgstr "催化活性" #: ../data/units.xml.in.h:222 msgid "Reciprocal Seconds Mole" msgstr "" #: ../data/units.xml.in.h:223 msgid "Katal" msgstr "å¡å¡”å°”" #: ../data/units.xml.in.h:224 msgid "ar:kat,katal,p:katals" msgstr "" #: ../data/units.xml.in.h:225 msgid "Catalytic Concentration" msgstr "催化浓度" #: ../data/units.xml.in.h:226 msgid "Katal per Cubic Meter" msgstr "å¡å¡”å°”æ¯ç«‹æ–¹ç±³" #: ../data/units.xml.in.h:227 msgid "Light" msgstr "光学" #: ../data/units.xml.in.h:228 msgid "Luminous Intensity" msgstr "å‘光强度" #: ../data/units.xml.in.h:229 msgid "Candela" msgstr "" #: ../data/units.xml.in.h:230 msgid "ar:cd,candela,p:candelas" msgstr "" #: ../data/units.xml.in.h:231 msgid "Luminance" msgstr "亮度" #: ../data/units.xml.in.h:232 msgid "Candela per Meter Squared" msgstr "" #: ../data/units.xml.in.h:233 msgid "Stilb" msgstr "熙æ" #: ../data/units.xml.in.h:234 msgid "ar:sb,stilb,p:stilbs" msgstr "" #: ../data/units.xml.in.h:235 msgid "Luminous Flux" msgstr "光通é‡" #: ../data/units.xml.in.h:236 msgid "Candela Steradian" msgstr "" #: ../data/units.xml.in.h:237 msgid "Lumen" msgstr "æµæ˜Ž" #: ../data/units.xml.in.h:238 msgid "ar:lm,lumen,p:lumens" msgstr "" #: ../data/units.xml.in.h:239 msgid "Illuminance" msgstr "照度" #: ../data/units.xml.in.h:240 msgid "Lumen per Meter Squared" msgstr "æµæ˜Žæ¯å¹³ç±³" #: ../data/units.xml.in.h:241 msgid "Lumen per Foot Squared" msgstr "æµæ˜Žæ¯å¹³æ–¹è‹±å°º" #: ../data/units.xml.in.h:242 msgid "Lux" msgstr "å‹’å…‹æ–¯" #: ../data/units.xml.in.h:243 msgid "ar:lx,lux" msgstr "" #: ../data/units.xml.in.h:244 msgid "Foot-Candle" msgstr "" #: ../data/units.xml.in.h:245 msgid "ar:fc,footcandle,p:footcandles" msgstr "" #: ../data/units.xml.in.h:246 msgid "Phot" msgstr "å¹…é€" #: ../data/units.xml.in.h:247 msgid "ar:ph,phot,p:phots" msgstr "" #: ../data/units.xml.in.h:248 msgid "Radiant Intensity" msgstr "è¾å°„强度" #: ../data/units.xml.in.h:249 msgid "Watt per Steradian" msgstr "瓦æ¯çƒé¢åº¦" #: ../data/units.xml.in.h:250 msgid "Irradiance" msgstr "è¾ç…§åº¦" #: ../data/units.xml.in.h:251 msgid "Watt per Meter Squared" msgstr "瓦æ¯å¹³ç±³" #: ../data/units.xml.in.h:252 msgid "Einstein per Meter Squared per Second" msgstr "çˆ±å› æ–¯å¦æ¯å¹³æ–¹ç±³æ¯ç§’" #: ../data/units.xml.in.h:253 msgid "Microeinstein per Meter Squared per Second" msgstr "" #: ../data/units.xml.in.h:254 msgid "Radiance" msgstr "è¾å°„率" #: ../data/units.xml.in.h:255 msgid "Watt per Square Meter Steradian" msgstr "瓦æ¯å¹³ç±³çƒé¢åº¦" #: ../data/units.xml.in.h:256 msgid "Area" msgstr "é¢ç§¯" #: ../data/units.xml.in.h:257 msgid "Square Meter" msgstr "平方米" #: ../data/units.xml.in.h:258 msgid "Square Kilometer" msgstr "平方åƒç±³" #: ../data/units.xml.in.h:259 msgid "Are" msgstr "" #: ../data/units.xml.in.h:260 msgid "ar:a,are,p:ares" msgstr "" #: ../data/units.xml.in.h:261 msgid "Hectare" msgstr "公顷" #: ../data/units.xml.in.h:262 msgid "Barn" msgstr "é¶" #: ../data/units.xml.in.h:263 msgid "ar:b,barn,p:barns" msgstr "" #: ../data/units.xml.in.h:264 msgid "Rood" msgstr "" #: ../data/units.xml.in.h:265 msgid "r:rood,p:roods" msgstr "" #: ../data/units.xml.in.h:266 msgid "Acre" msgstr "英亩" #: ../data/units.xml.in.h:267 msgid "r:acre,p:acres" msgstr "" #: ../data/units.xml.in.h:268 msgid "Section" msgstr "" #: ../data/units.xml.in.h:269 msgid "r:section,p:sections" msgstr "" #: ../data/units.xml.in.h:270 msgid "Township" msgstr "" #: ../data/units.xml.in.h:271 msgid "r:township,p:townships" msgstr "" #: ../data/units.xml.in.h:272 msgid "Square Foot" msgstr "平方英尺" #: ../data/units.xml.in.h:273 msgid "Square Inch" msgstr "平方英寸" #: ../data/units.xml.in.h:274 msgid "Square Mile" msgstr "平方英里" #: ../data/units.xml.in.h:275 msgid "Volume" msgstr "体积" #: ../data/units.xml.in.h:276 msgid "Cubic Meter" msgstr "立方米" #: ../data/units.xml.in.h:277 msgid "Liter" msgstr "å‡" #: ../data/units.xml.in.h:278 msgid "ar:L,a:l,liter,p:liters,litre,p:litres" msgstr "" #: ../data/units.xml.in.h:279 msgid "Milliliter" msgstr "毫å‡" #: ../data/units.xml.in.h:280 msgid "Centiliter" msgstr "厘å‡" #: ../data/units.xml.in.h:281 msgid "Deciliter" msgstr "分å‡" #: ../data/units.xml.in.h:282 msgid "Cubic Inch" msgstr "立方英寸" #: ../data/units.xml.in.h:283 msgid "Fuel Economy" msgstr "ç‡ƒæ–™ç»æµŽ" #: ../data/units.xml.in.h:284 msgid "Liter per Kilometer" msgstr "凿¯åƒç±³" #: ../data/units.xml.in.h:285 msgid "Kilometer per Liter" msgstr "åƒç±³æ¯å‡" #: ../data/units.xml.in.h:286 msgid "Miles per Gallon" msgstr "英里æ¯åР仑" #: ../data/units.xml.in.h:287 msgid "a-cr:mpg" msgstr "a-cr:mpg" #: ../data/units.xml.in.h:288 msgid "Cooking" msgstr "烹饪" #: ../data/units.xml.in.h:289 msgid "Teaspoon" msgstr "茶匙" #: ../data/units.xml.in.h:290 msgid "r:teaspoon,p:teaspoons" msgstr "" #: ../data/units.xml.in.h:291 msgid "Dessertspoon" msgstr "点心匙" #: ../data/units.xml.in.h:292 msgid "r:dessertspoon,p:dessertspoons" msgstr "" #: ../data/units.xml.in.h:293 msgid "Tablespoon" msgstr "汤匙" #: ../data/units.xml.in.h:294 msgid "r:tablespoon,p:tablespoons" msgstr "" #: ../data/units.xml.in.h:295 msgid "Cup (U.S.)" msgstr "" #: ../data/units.xml.in.h:296 msgid "r:cup,p:cups" msgstr "" #: ../data/units.xml.in.h:297 msgid "Imperial Capacity" msgstr "" #: ../data/units.xml.in.h:298 msgid "Imperial Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:299 msgid "ar:UK_fl_oz,imperial_fluid_ounce,p:imperial_fluid_ounces" msgstr "" #: ../data/units.xml.in.h:300 msgid "Imperial Gill" msgstr "" #: ../data/units.xml.in.h:301 msgid "ar:UK_gi,imperial_gill,p:imperial_gills" msgstr "" #: ../data/units.xml.in.h:302 msgid "Imperial Pint" msgstr "" #: ../data/units.xml.in.h:303 msgid "ar:UK_pt,imperial_pint,p:imperial_pints" msgstr "" #: ../data/units.xml.in.h:304 msgid "Imperial Quart" msgstr "" #: ../data/units.xml.in.h:305 msgid "ar:UK_qt,imperial_quart,p:imperial_quarts" msgstr "" #: ../data/units.xml.in.h:306 msgid "Imperial Gallon" msgstr "" #: ../data/units.xml.in.h:307 msgid "ar:UK_gal,imperial_gallon,p:imperial_gallons" msgstr "" #: ../data/units.xml.in.h:308 msgid "Imperial Minim" msgstr "" #: ../data/units.xml.in.h:309 msgid "r:imperial_minim,p:imperial_minims" msgstr "" #: ../data/units.xml.in.h:310 msgid "Imperial Fluid Scuple" msgstr "" #: ../data/units.xml.in.h:311 msgid "r:imperial_fluid_scuple,p:imperial_fluid_scuples" msgstr "" #: ../data/units.xml.in.h:312 msgid "Imperial Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:313 msgid "ar:UK_fl_dr,imperial_fluid_drachm,p:imperial_fluid_drachms" msgstr "" #: ../data/units.xml.in.h:314 msgid "Imperial Bushel" msgstr "" #: ../data/units.xml.in.h:315 msgid "ar:UK_bu,imperial_bushel,p:imperial_bushels" msgstr "" #: ../data/units.xml.in.h:316 msgid "U.S. Capacity" msgstr "" #: ../data/units.xml.in.h:317 msgid "U.S. Fluid Ounce" msgstr "" #: ../data/units.xml.in.h:318 msgid "ar:fl_oz,fluid_ounce,p:fluid_ounces" msgstr "" #: ../data/units.xml.in.h:319 msgid "U.S. Gill" msgstr "" #: ../data/units.xml.in.h:320 msgid "ar:gi,gill,p:gills" msgstr "" #: ../data/units.xml.in.h:321 msgid "U.S. Liquid Pints" msgstr "" #: ../data/units.xml.in.h:322 msgid "ar:liq_pt,liquid_pint,p:liquid_pints" msgstr "" #: ../data/units.xml.in.h:323 msgid "U.S. Liquid Quarts" msgstr "" #: ../data/units.xml.in.h:324 msgid "ar:liq_qt,liquid_quart,p:liquid_quarts" msgstr "" #: ../data/units.xml.in.h:325 msgid "U.S. Minim" msgstr "" #: ../data/units.xml.in.h:326 msgid "r:minim,p:minims" msgstr "" #: ../data/units.xml.in.h:327 msgid "U.S. Fluid Drachm" msgstr "" #: ../data/units.xml.in.h:328 msgid "ar:fl_dr,fluid_drachm,p:fluid_drachms" msgstr "" #: ../data/units.xml.in.h:329 msgid "U.S. Dry Pint" msgstr "" #: ../data/units.xml.in.h:330 msgid "ar:dry_pt,dry_pint,p:dry_pints" msgstr "" #: ../data/units.xml.in.h:331 msgid "U.S. Dry Quart" msgstr "" #: ../data/units.xml.in.h:332 msgid "ar:dry_qt,dry_quart,p:dry_quarts" msgstr "" #: ../data/units.xml.in.h:333 msgid "U.S. Peck" msgstr "" #: ../data/units.xml.in.h:334 msgid "ar:pk,peck,p:pecks" msgstr "" #: ../data/units.xml.in.h:335 msgid "U.S. Bushel" msgstr "" #: ../data/units.xml.in.h:336 msgid "ar:bu,bushel,p:bushels" msgstr "" #: ../data/units.xml.in.h:337 msgid "U.S. Gallon" msgstr "" #: ../data/units.xml.in.h:338 msgid "ar:gal,gallon,p:gallons" msgstr "" #: ../data/units.xml.in.h:339 msgid "U.S. Barrel (oil)" msgstr "" #: ../data/units.xml.in.h:340 msgid "ar:bbl,barrel,p:barrels" msgstr "" #: ../data/units.xml.in.h:341 msgid "Specific Volume" msgstr "" #: ../data/units.xml.in.h:342 msgid "Cubic Meter per Kilogram" msgstr "立方米æ¯å…¬æ–¤" #: ../data/units.xml.in.h:343 msgid "Speed" msgstr "速度" #: ../data/units.xml.in.h:344 msgid "Meter per Second" msgstr "ç±³æ¯ç§’" #: ../data/units.xml.in.h:345 msgid "Kilometer per Hour" msgstr "åƒç±³æ¯å°æ—¶" #: ../data/units.xml.in.h:346 msgid "Nautical Mile per Hour" msgstr "海里æ¯å°æ—¶" #: ../data/units.xml.in.h:347 msgid "Knot" msgstr "节" #: ../data/units.xml.in.h:348 msgid "r:knot,p:knots" msgstr "" #: ../data/units.xml.in.h:349 msgid "Miles per Hour" msgstr "英里æ¯å°æ—¶" #: ../data/units.xml.in.h:350 msgid "a-cr:mph" msgstr "" #: ../data/units.xml.in.h:351 msgid "Acceleration" msgstr "加速度" #: ../data/units.xml.in.h:352 msgid "Meter per Second Squared" msgstr "ç±³æ¯å¹³æ–¹ç§’" #: ../data/units.xml.in.h:353 msgid "Galileo" msgstr "伽利略" #: ../data/units.xml.in.h:354 msgid "ar:Gal,galileo,p:galileos" msgstr "" #: ../data/units.xml.in.h:355 msgid "Gee" msgstr "" #: ../data/units.xml.in.h:356 msgid "r:gee,p:gees" msgstr "" #: ../data/units.xml.in.h:357 msgid "Magnetism" msgstr "ç£å­¦" #: ../data/units.xml.in.h:358 msgid "Wave Number" msgstr "波数" #: ../data/units.xml.in.h:359 msgid "Reciprocal Meter" msgstr "" #: ../data/units.xml.in.h:360 msgid "Magnetic Field Strength" msgstr "ç£åœºå¼ºåº¦" #: ../data/units.xml.in.h:361 msgid "Ampere per Meter" msgstr "安培æ¯ç±³" #: ../data/units.xml.in.h:362 msgid "Oersted" msgstr "奥斯特" #: ../data/units.xml.in.h:363 msgid "ar:Oe,oersted,p:oersteds" msgstr "" #: ../data/units.xml.in.h:364 msgid "Magnetic Flux" msgstr "ç£é€šé‡" #: ../data/units.xml.in.h:365 msgid "Volt Seconds" msgstr "ä¼ç‰¹ç§’" #: ../data/units.xml.in.h:366 msgid "Weber" msgstr "韦伯" #: ../data/units.xml.in.h:367 msgid "ar:Wb,weber,p:webers" msgstr "" #: ../data/units.xml.in.h:368 msgid "Maxwell" msgstr "麦克斯韦" #: ../data/units.xml.in.h:369 msgid "ar:Mx,maxwell,p:maxwells" msgstr "" #: ../data/units.xml.in.h:370 msgid "Magnetic Flux Density" msgstr "ç£é€šå¯†åº¦" #: ../data/units.xml.in.h:371 msgid "Weber per Meter Squared" msgstr "韦伯æ¯å¹³ç±³" #: ../data/units.xml.in.h:372 msgid "Tesla" msgstr "特斯拉" #: ../data/units.xml.in.h:373 msgid "ar:T,tesla,p:teslas" msgstr "" #: ../data/units.xml.in.h:374 msgid "Gauss" msgstr "高斯" #: ../data/units.xml.in.h:375 msgid "r:gauss" msgstr "" #: ../data/units.xml.in.h:376 msgid "Force" msgstr "力学" #: ../data/units.xml.in.h:377 msgid "Meter Kilogram per Second Squared" msgstr "ç±³åƒå…‹æ¯å¹³æ–¹ç§’" #: ../data/units.xml.in.h:378 msgid "Newton" msgstr "牛顿" #: ../data/units.xml.in.h:379 msgid "ar:N,newton,p:newtons" msgstr "" #: ../data/units.xml.in.h:380 msgid "Dyne" msgstr "达因" #: ../data/units.xml.in.h:381 msgid "ar:dyn,dyne,p:dynes" msgstr "" #: ../data/units.xml.in.h:382 msgid "Pound-force" msgstr "磅力" #: ../data/units.xml.in.h:383 msgid "ar:lbf,pound_force" msgstr "ar:lbf,pound_force" #: ../data/units.xml.in.h:384 msgid "Pound Foot per Second Squared" msgstr "磅英尺æ¯å¹³æ–¹ç§’" #: ../data/units.xml.in.h:385 msgid "Poundal" msgstr "磅达" #: ../data/units.xml.in.h:386 msgid "r:poundal,p:poundals,a:pdl" msgstr "" #: ../data/units.xml.in.h:387 msgid "Pond (Gram-Force)" msgstr "克力" #: ../data/units.xml.in.h:388 msgid "r:pond,p:ponds,a:gf" msgstr "" #: ../data/units.xml.in.h:389 msgid "Kilopond (Kilogram-Force)" msgstr "åƒå…‹åŠ›" #: ../data/units.xml.in.h:390 msgid "Moment of Force" msgstr "力矩" #: ../data/units.xml.in.h:391 msgid "Newton Meter" msgstr "牛顿米" #: ../data/units.xml.in.h:392 msgid "Pressure" msgstr "压强" #: ../data/units.xml.in.h:393 msgid "Newton per Meter Squared" msgstr "牛顿æ¯å¹³ç±³" #: ../data/units.xml.in.h:394 msgid "Pound-force per Square Inch" msgstr "磅力æ¯å¹³æ–¹è‹±å¯¸" #: ../data/units.xml.in.h:395 msgid "Pascal" msgstr "帕斯å¡" #: ../data/units.xml.in.h:396 msgid "ar:Pa,pascal,p:pascals" msgstr "" #: ../data/units.xml.in.h:397 msgid "Pound-force per Square Inch (psi)" msgstr "磅力æ¯å¹³æ–¹è‹±å¯¸(psi)" #: ../data/units.xml.in.h:398 msgid "a-cr:psi" msgstr "" #: ../data/units.xml.in.h:399 msgid "Bar" msgstr "å·´" #: ../data/units.xml.in.h:400 msgid "r:bar,p:bars" msgstr "" #: ../data/units.xml.in.h:401 msgid "Atmosphere" msgstr "大气压" #: ../data/units.xml.in.h:402 msgid "ar:atm,atmosphere,p:atmospheres" msgstr "" #: ../data/units.xml.in.h:403 msgid "Torr" msgstr "托" #: ../data/units.xml.in.h:404 msgid "r:torr,p:torrs" msgstr "" #: ../data/units.xml.in.h:405 msgid "Millimeter of Mercury" msgstr "毫米汞柱" #: ../data/units.xml.in.h:406 msgid "ar:mmHg" msgstr "" #: ../data/units.xml.in.h:407 msgid "Inch of Mercury" msgstr "英寸汞柱" #: ../data/units.xml.in.h:408 msgid "ar:inHg" msgstr "" #: ../data/units.xml.in.h:409 msgid "Dynamic Viscosity" msgstr "动æ€ç²˜åº¦" #: ../data/units.xml.in.h:410 msgid "Pascal Second" msgstr "帕斯å¡ç§’" #: ../data/units.xml.in.h:411 msgid "Poise" msgstr "泊" #: ../data/units.xml.in.h:412 msgid "ar:P,poise,p:poises" msgstr "" #: ../data/units.xml.in.h:413 msgid "Kinematic Viscosity" msgstr "è¿åŠ¨ç²˜åº¦" #: ../data/units.xml.in.h:414 msgid "Square Meter per Second" msgstr "平方米æ¯ç§’" #: ../data/units.xml.in.h:415 msgid "Stokes" msgstr "" #: ../data/units.xml.in.h:416 msgid "ar:St,stokes" msgstr "" #: ../data/units.xml.in.h:417 msgid "Surface Tension" msgstr "表é¢å¼ åŠ›" #: ../data/units.xml.in.h:418 msgid "Newton per Meter" msgstr "牛顿æ¯ç±³" #: ../data/units.xml.in.h:419 msgid "Energy" msgstr "能é‡" #: ../data/units.xml.in.h:420 msgid "Joule" msgstr "焦耳" #: ../data/units.xml.in.h:421 msgid "ar:J,joule,p:joules" msgstr "" #: ../data/units.xml.in.h:422 msgid "Watt Hour" msgstr "ç“¦å°æ—¶" #: ../data/units.xml.in.h:423 msgid "Kilowatt Hour" msgstr "度(åƒç“¦æ—¶)" #: ../data/units.xml.in.h:424 msgid "Calorie (international table)" msgstr "" #: ../data/units.xml.in.h:425 msgid "ais:cal_IT,ar:cal,c:calorie,cp:calories" msgstr "" #: ../data/units.xml.in.h:426 msgid "Calorie (capital C)" msgstr "" #: ../data/units.xml.in.h:427 msgid "cr:Calorie,cp:Calories" msgstr "" #: ../data/units.xml.in.h:428 msgid "Calorie (thermochemical)" msgstr "" #: ../data/units.xml.in.h:429 msgid "ars:cal_th" msgstr "" #: ../data/units.xml.in.h:430 msgid "Gram of TNT" msgstr "å…‹TNT当é‡" #: ../data/units.xml.in.h:431 msgid "a-cr:gTNT,gramTNT" msgstr "" #: ../data/units.xml.in.h:432 msgid "Ton of TNT" msgstr "å¨TNT当é‡" #: ../data/units.xml.in.h:433 msgid "a-cr:tTNT,tonTNT" msgstr "" #: ../data/units.xml.in.h:434 msgid "Calorie (15 degrees Celsius)" msgstr "Calorie(15æ‘„æ°åº¦)" #: ../data/units.xml.in.h:435 msgid "ars:cal_fifteen" msgstr "" #: ../data/units.xml.in.h:436 msgid "Calorie (mean)" msgstr "" #: ../data/units.xml.in.h:437 msgid "ars:cal_mean" msgstr "" #: ../data/units.xml.in.h:438 msgid "British Thermal Unit (IT)" msgstr "英制热é‡å•ä½(IT)" #: ../data/units.xml.in.h:439 msgid "ar:Btu" msgstr "" #: ../data/units.xml.in.h:440 msgid "Electron Volt" msgstr "电å­ä¼ç‰¹" #: ../data/units.xml.in.h:441 msgid "ar:eV,electron_volt,p:electron_volts" msgstr "" #: ../data/units.xml.in.h:442 msgid "Erg" msgstr "" #: ../data/units.xml.in.h:443 msgid "r:erg,p:ergs" msgstr "" #: ../data/units.xml.in.h:444 msgid "Foe" msgstr "" #: ../data/units.xml.in.h:445 msgid "r:foe,p:foes" msgstr "" #: ../data/units.xml.in.h:446 msgid "Foot-Pound Force" msgstr "" #: ../data/units.xml.in.h:447 msgid "Hartree" msgstr "" #: ../data/units.xml.in.h:448 msgid "ar:Ha,as:E_h,hartree" msgstr "" #: ../data/units.xml.in.h:449 #, fuzzy msgid "Rydberg" msgstr "里德伯常数" #: ../data/units.xml.in.h:450 msgid "ar:Ry,s:rydberg_unit" msgstr "" #: ../data/units.xml.in.h:451 msgid "Specific Energy" msgstr "" #: ../data/units.xml.in.h:452 msgid "Joule per Kilogram" msgstr "焦耳æ¯åƒå…‹" #: ../data/units.xml.in.h:453 msgid "Power" msgstr "功率" #: ../data/units.xml.in.h:454 msgid "Joule per Second" msgstr "焦耳æ¯ç§’" #: ../data/units.xml.in.h:455 msgid "Watt" msgstr "瓦" #: ../data/units.xml.in.h:456 msgid "ar:W,watt,p:watts" msgstr "" #: ../data/units.xml.in.h:457 msgid "Horse Power" msgstr "匹" #: ../data/units.xml.in.h:458 msgid "ar:hp,horsepower,p:horsepowers" msgstr "" #: ../data/units.xml.in.h:459 msgid "Pferdestärke" msgstr "" #: ../data/units.xml.in.h:460 msgid "ar:PS,u:pferdestärke" msgstr "" #: ../data/units.xml.in.h:461 msgid "Entropy" msgstr "熵" #: ../data/units.xml.in.h:462 msgid "Joule per Kelvin" msgstr "焦耳æ¯å¼€å°”æ–‡" #: ../data/units.xml.in.h:463 msgid "Specific Entropy" msgstr "" #: ../data/units.xml.in.h:464 msgid "Joule per Kilogram Kelvin" msgstr "焦耳æ¯åƒå…‹å¼€å°”æ–‡" #: ../data/units.xml.in.h:465 msgid "Thermal Conductivity" msgstr "导热系数" #: ../data/units.xml.in.h:466 msgid "Watt per Meter Kelvin" msgstr "瓦æ¯ç±³å¼€å°”æ–‡" #: ../data/units.xml.in.h:467 msgid "Energy Density" msgstr "能é‡å¯†åº¦" #: ../data/units.xml.in.h:468 msgid "Joule per Cubic Meter" msgstr "焦耳æ¯ç«‹æ–¹ç±³" #: ../data/units.xml.in.h:469 msgid "Molar Energy" msgstr "" #: ../data/units.xml.in.h:470 msgid "Joule per Mole" msgstr "ç„¦è€³æ¯æ‘©å°”" #: ../data/units.xml.in.h:471 msgid "Molar Entropy" msgstr "摩尔熵" #: ../data/units.xml.in.h:472 msgid "Joule per Mole Kelvin" msgstr "ç„¦è€³æ¯æ‘©å°”开尔文" #: ../data/units.xml.in.h:473 msgid "Radioactivity" msgstr "放射性" #: ../data/units.xml.in.h:474 msgid "Becquerel" msgstr "è´å¯" #: ../data/units.xml.in.h:475 msgid "ar:Bq,becquerel,p:becquerels" msgstr "" #: ../data/units.xml.in.h:476 msgid "Curie" msgstr "居里" #: ../data/units.xml.in.h:477 msgid "ar:Ci,curie,p:curies" msgstr "" #: ../data/units.xml.in.h:478 msgid "Absorbed Dose" msgstr "叿”¶å‰‚é‡" #: ../data/units.xml.in.h:479 msgid "Gray" msgstr "戈瑞" #: ../data/units.xml.in.h:480 msgid "ar:Gy,gray,p:grays" msgstr "" #: ../data/units.xml.in.h:481 msgid "Rad" msgstr "" #: ../data/units.xml.in.h:482 msgid "r:rad_radioactivity" msgstr "" #: ../data/units.xml.in.h:483 msgid "Dose Equivalent" msgstr "剂é‡å½“é‡" #: ../data/units.xml.in.h:484 msgid "Sievert" msgstr "" #: ../data/units.xml.in.h:485 msgid "ar:Sv,sievert,p:sieverts" msgstr "" #: ../data/units.xml.in.h:486 msgid "Rem" msgstr "人体伦ç´å½“é‡" #: ../data/units.xml.in.h:487 msgid "r:rem_radioactivity" msgstr "" #: ../data/units.xml.in.h:488 msgid "Exposure" msgstr "ç…§å°„é‡" #: ../data/units.xml.in.h:489 msgid "Coulomb per Kilogram" msgstr "库仑æ¯åƒå…‹" #: ../data/units.xml.in.h:490 msgid "Roentgen" msgstr "伦ç´" #: ../data/units.xml.in.h:491 msgid "ar:R,roentgen,p:roentgens" msgstr "" #: ../data/units.xml.in.h:492 msgid "Absorbed Dose Rate" msgstr "剂é‡å¸æ”¶çއ" #: ../data/units.xml.in.h:493 msgid "Gray per Second" msgstr "戈瑞æ¯ç§’" #: ../data/units.xml.in.h:494 msgid "Ratio" msgstr "比值" #: ../data/units.xml.in.h:495 msgid "Neper" msgstr "奈培" #: ../data/units.xml.in.h:496 msgid "ar:Np,neper,p:nepers" msgstr "" #: ../data/units.xml.in.h:497 msgid "Bel" msgstr "è´" #: ../data/units.xml.in.h:498 msgid "ar:B,bel,p:bels" msgstr "" #: ../data/units.xml.in.h:499 msgid "Decibel" msgstr "分è´" #: ../data/units.xml.in.h:500 msgid "Information" msgstr "ä¿¡æ¯" #: ../data/units.xml.in.h:501 msgid "Bit" msgstr "比特" #: ../data/units.xml.in.h:502 msgid "r:bit,p:bits" msgstr "" #: ../data/units.xml.in.h:503 msgid "Byte (8-bit)" msgstr "字节(8比特)" #: ../data/units.xml.in.h:504 msgid "r:byte,p:bytes,octet,p:octets" msgstr "" #: ../data/units.xml.in.h:505 msgid "Nibble" msgstr "åŠå­—节" #: ../data/units.xml.in.h:506 msgid "r:nibble,p:nibbles,nybble,p:nybbles,semioctet,p:semioctets" msgstr "" #: ../data/units.xml.in.h:507 msgid "Tribble" msgstr "" #: ../data/units.xml.in.h:508 msgid "r:tribble,p:tribbles" msgstr "" #: ../data/units.xml.in.h:509 msgid "Word (16-bit)" msgstr "å­—(16比特)" #: ../data/units.xml.in.h:510 msgid "r:word,p:words" msgstr "" #: ../data/units.xml.in.h:511 msgid "Kilobyte" msgstr "åƒå­—节" #: ../data/units.xml.in.h:512 msgid "Kibibyte" msgstr "" #: ../data/units.xml.in.h:513 msgid "Mebibyte" msgstr "" #: ../data/units.xml.in.h:514 msgid "Gibibyte" msgstr "" #: ../data/units.xml.in.h:515 msgid "Megabyte" msgstr "兆字节" #: ../data/units.xml.in.h:516 msgid "Gigabyte" msgstr "åƒå…†æ¯”特" #: ../data/units.xml.in.h:517 msgid "Terabyte" msgstr "万亿字节" #: ../data/units.xml.in.h:518 msgid "Kilobit" msgstr "åƒæ¯”特" #: ../data/units.xml.in.h:519 msgid "Kibibit" msgstr "" #: ../data/units.xml.in.h:520 msgid "Mebibit" msgstr "" #: ../data/units.xml.in.h:521 msgid "Gibibit" msgstr "" #: ../data/units.xml.in.h:522 msgid "Megabit" msgstr "兆比特" #: ../data/units.xml.in.h:523 msgid "Gigabit" msgstr "åƒå…†æ¯”特" #: ../data/units.xml.in.h:524 msgid "Terabit" msgstr "万亿比特" #: ../data/units.xml.in.h:525 msgid "Typography" msgstr "å°åˆ·" #: ../data/units.xml.in.h:526 msgid "PostScript Point" msgstr "" #: ../data/units.xml.in.h:527 msgid "ar:pt,a:pts,point,p:points" msgstr "" #: ../data/units.xml.in.h:528 msgid "PostScript Pica" msgstr "" #: ../data/units.xml.in.h:529 msgid "r:pica,p:picas" msgstr "" #: ../data/units.xml.in.h:530 msgid "ATA Pica" msgstr "" #: ../data/units.xml.in.h:531 msgid "r:ata_pica,p:ata_picas" msgstr "" #: ../data/units.xml.in.h:532 msgid "ATA Point" msgstr "" #: ../data/units.xml.in.h:533 msgid "r:ata_point,a:ata_pt,p:ata_points" msgstr "" #: ../data/units.xml.in.h:534 msgid "New Didot Point" msgstr "" #: ../data/units.xml.in.h:535 msgid "r:new_didot" msgstr "" #: ../data/units.xml.in.h:536 msgid "Didot Point" msgstr "" #: ../data/units.xml.in.h:537 msgid "r:didot,a:dd" msgstr "" #: ../data/units.xml.in.h:538 msgid "Cicero" msgstr "" #: ../data/units.xml.in.h:539 msgid "r:cicero" msgstr "" #: ../data/variables.xml.in.h:1 msgid "Small Numbers" msgstr "å°æ•°å­—" #: ../data/variables.xml.in.h:2 msgid "Per Mille" msgstr "åƒåˆ†ä¹‹ä¸€" #: ../data/variables.xml.in.h:3 msgid "r:permille,au:‰" msgstr "" #: ../data/variables.xml.in.h:4 msgid "Per Myriad" msgstr "万分之一" #: ../data/variables.xml.in.h:5 msgid "r:permyriad,au:‱" msgstr "" #: ../data/variables.xml.in.h:6 msgid "Percent" msgstr "ç™¾åˆ†ä½æ•°" #: ../data/variables.xml.in.h:8 #, no-c-format msgid "a:%,r:percent" msgstr "" #: ../data/variables.xml.in.h:9 msgid "Large Numbers" msgstr "大数" #: ../data/variables.xml.in.h:10 msgid "Googolplex" msgstr "" #: ../data/variables.xml.in.h:11 msgid "r:googolplex" msgstr "" #: ../data/variables.xml.in.h:12 msgid "Googol" msgstr "大数" #: ../data/variables.xml.in.h:13 msgid "r:googol" msgstr "" #: ../data/variables.xml.in.h:14 msgid "Centillion" msgstr "百万的一百次方" #: ../data/variables.xml.in.h:15 msgid "-r:centillion" msgstr "" #: ../data/variables.xml.in.h:16 msgid "Vigintillion" msgstr "" #: ../data/variables.xml.in.h:17 msgid "-r:vigintillion" msgstr "" #: ../data/variables.xml.in.h:18 msgid "Novemdecillion" msgstr "" #: ../data/variables.xml.in.h:19 msgid "-r:novemdecillion" msgstr "" #: ../data/variables.xml.in.h:20 msgid "Octodecillion" msgstr "" #: ../data/variables.xml.in.h:21 msgid "-r:octodecillion" msgstr "" #: ../data/variables.xml.in.h:22 msgid "Septendecillion" msgstr "" #: ../data/variables.xml.in.h:23 msgid "-r:septendecillion" msgstr "" #: ../data/variables.xml.in.h:24 msgid "Sexdecillion" msgstr "" #: ../data/variables.xml.in.h:25 msgid "-r:sexdecillion" msgstr "" #: ../data/variables.xml.in.h:26 msgid "Quindecillion" msgstr "" #: ../data/variables.xml.in.h:27 msgid "-r:quindecillion" msgstr "" #: ../data/variables.xml.in.h:28 msgid "Quattuordecillion" msgstr "" #: ../data/variables.xml.in.h:29 msgid "-r:quattuordecillion" msgstr "" #: ../data/variables.xml.in.h:30 msgid "Tredecillion" msgstr "" #: ../data/variables.xml.in.h:31 msgid "-r:tredecillion" msgstr "" #: ../data/variables.xml.in.h:32 msgid "Duodecillion" msgstr "" #: ../data/variables.xml.in.h:33 msgid "-r:duodecillion" msgstr "" #: ../data/variables.xml.in.h:34 msgid "Undecillion" msgstr "" #: ../data/variables.xml.in.h:35 msgid "-r:undecillion" msgstr "" #: ../data/variables.xml.in.h:36 msgid "Decillion" msgstr "" #: ../data/variables.xml.in.h:37 msgid "-r:decillion" msgstr "" #: ../data/variables.xml.in.h:38 msgid "Nonillion" msgstr "" #: ../data/variables.xml.in.h:39 msgid "-r:nonillion" msgstr "" #: ../data/variables.xml.in.h:40 msgid "Octillion" msgstr "" #: ../data/variables.xml.in.h:41 msgid "-r:octillion" msgstr "" #: ../data/variables.xml.in.h:42 msgid "Septillion" msgstr "" #: ../data/variables.xml.in.h:43 msgid "-r:septillion" msgstr "" #: ../data/variables.xml.in.h:44 msgid "Sextillion" msgstr "" #: ../data/variables.xml.in.h:45 msgid "-r:sextillion" msgstr "" #: ../data/variables.xml.in.h:46 msgid "Quintillion" msgstr "" #: ../data/variables.xml.in.h:47 msgid "-r:quintillion" msgstr "" #: ../data/variables.xml.in.h:48 msgid "Quadrillion" msgstr "" #: ../data/variables.xml.in.h:49 msgid "-r:quadrillion" msgstr "" #: ../data/variables.xml.in.h:50 msgid "Trillion" msgstr "å…†" #: ../data/variables.xml.in.h:51 msgid "-r:trillion" msgstr "" #: ../data/variables.xml.in.h:52 msgid "Billion" msgstr "å亿" #: ../data/variables.xml.in.h:53 msgid "-r:billion" msgstr "" #: ../data/variables.xml.in.h:54 msgid "Million" msgstr "百万" #: ../data/variables.xml.in.h:55 msgid "-r:million" msgstr "" #: ../data/variables.xml.in.h:56 msgid "Thousand" msgstr "åƒ" #: ../data/variables.xml.in.h:57 msgid "-r:thousand" msgstr "" #: ../data/variables.xml.in.h:58 msgid "Hundred" msgstr "百" #: ../data/variables.xml.in.h:59 msgid "-r:hundred" msgstr "" #: ../data/variables.xml.in.h:60 msgid "Physical Constants" msgstr "物ç†å¸¸æ•°" #: ../data/variables.xml.in.h:61 msgid "Universal Constants" msgstr "普适常数" #: ../data/variables.xml.in.h:62 msgid "Speed of Light in Vacuum" msgstr "真空中光速" #: ../data/variables.xml.in.h:63 msgid "ar:c,speed_of_light" msgstr "" #: ../data/variables.xml.in.h:64 msgid "Planck Time" msgstr "普朗克时间" #: ../data/variables.xml.in.h:65 msgid "r:planck_time,ais:t_P" msgstr "" #: ../data/variables.xml.in.h:66 msgid "Planck Temperature" msgstr "普朗克温度" #: ../data/variables.xml.in.h:67 msgid "r:planck_temperature,ais:T_P" msgstr "" #: ../data/variables.xml.in.h:68 msgid "Planck Mass" msgstr "普朗克质é‡" #: ../data/variables.xml.in.h:69 msgid "r:planck_mass,ais:m_P" msgstr "" #: ../data/variables.xml.in.h:70 msgid "Planck Length" msgstr "普朗克长度" #: ../data/variables.xml.in.h:71 msgid "r:planck_length,ais:l_P" msgstr "" #: ../data/variables.xml.in.h:72 msgid "Planck Constant" msgstr "普朗克常数" #: ../data/variables.xml.in.h:73 msgid "r:planck,au:ℎ" msgstr "" #: ../data/variables.xml.in.h:74 msgid "Planck Constant over 2 pi" msgstr "普朗克常数æ¯2π" #: ../data/variables.xml.in.h:75 msgid "r:planck2pi,au:ℏ" msgstr "" #: ../data/variables.xml.in.h:76 msgid "Newtonian Constant of Gravitation" msgstr "牛顿引力常数" #: ../data/variables.xml.in.h:77 msgid "r:newtonian_constant,a:G" msgstr "" #: ../data/variables.xml.in.h:78 msgid "Electric Constant (Permittivity of Free Space)" msgstr "介电常数(自由空间介电常数)" #: ../data/variables.xml.in.h:79 msgid "r:electric_constant,asu:ε_0,vacuum_permittivity,aos:epsilon_0" msgstr "" #: ../data/variables.xml.in.h:80 msgid "Magnetic Constant (Permeability of Free Space)" msgstr "ç£å¸¸æ•°(自由空间ç£å¯¼çŽ‡ï¼‰" #: ../data/variables.xml.in.h:81 msgid "r:magnetic_constant,asu:μ_0,vacuum_permeability,aos:mu_0" msgstr "" #: ../data/variables.xml.in.h:82 msgid "Characteristic Impedance of Vacuum" msgstr "真空特性阻抗" #: ../data/variables.xml.in.h:83 msgid "r:characteristic_impedance,ais:Z_0" msgstr "" #: ../data/variables.xml.in.h:84 msgid "Electromagnetic Constants" msgstr "电ç£å¸¸æ•°" #: ../data/variables.xml.in.h:85 msgid "Bohr Magneton" msgstr "玻尔ç£å­" #: ../data/variables.xml.in.h:86 msgid "r:bohr_magneton,asu:μ_B,aos:mu_B" msgstr "" #: ../data/variables.xml.in.h:87 msgid "Conductance Quantum" msgstr "é‡å­ç”µå¯¼" #: ../data/variables.xml.in.h:88 msgid "r:conductance_quantum,ais:G_0" msgstr "" #: ../data/variables.xml.in.h:89 msgid "Elementary Charge" msgstr "基本电è·" #: ../data/variables.xml.in.h:90 msgid "r:elementary_charge,ais:e_charge" msgstr "" #: ../data/variables.xml.in.h:91 msgid "Josephson Constant" msgstr "约瑟夫森常数" #: ../data/variables.xml.in.h:92 msgid "r:josephson,ais:K_J" msgstr "" #: ../data/variables.xml.in.h:93 msgid "Magnetic Flux Quantum" msgstr "ç£é€šé‡é‡å­" #: ../data/variables.xml.in.h:94 msgid "r:magnetic_flux_quantum,asu:Φ_0,aos:phi_0" msgstr "" #: ../data/variables.xml.in.h:95 msgid "Nuclear Magneton" msgstr "æ ¸ç£å­" #: ../data/variables.xml.in.h:96 msgid "r:nuclear_magneton,asu:μ_N,aos:mu_N" msgstr "" #: ../data/variables.xml.in.h:97 msgid "von Klitzing Constant" msgstr "冯·克里é’常数" #: ../data/variables.xml.in.h:98 msgid "r:klitzing,ais:R_K" msgstr "" #: ../data/variables.xml.in.h:99 msgid "Atomic and Nuclear Constants" msgstr "原å­ä¸Žæ ¸ç‰©ç†å¸¸æ•°" #: ../data/variables.xml.in.h:100 msgid "Alpha Particle Mass" msgstr "αç²’å­è´¨é‡" #: ../data/variables.xml.in.h:101 msgid "r:alpha_particle_mass,aisu:m_α" msgstr "" #: ../data/variables.xml.in.h:102 msgid "Bohr Radius" msgstr "玻尔åŠå¾„" #: ../data/variables.xml.in.h:103 msgid "r:bohr_radius,ais:a_0" msgstr "" #: ../data/variables.xml.in.h:104 msgid "Classical Electron Radius" msgstr "ç»å…¸ç”µå­åŠå¾„" #: ../data/variables.xml.in.h:105 msgid "r:classical_electron_radius,ais:r_e" msgstr "" #: ../data/variables.xml.in.h:106 msgid "Compton Wavelength" msgstr "康普顿波长" #: ../data/variables.xml.in.h:107 msgid "r:compton_wavelength,asu:λ_C,aos:lambda_C" msgstr "" #: ../data/variables.xml.in.h:108 msgid "Electron Mass" msgstr "电å­è´¨é‡" #: ../data/variables.xml.in.h:109 msgid "r:electron_mass,ais:m_e" msgstr "" #: ../data/variables.xml.in.h:110 msgid "Helion Mass" msgstr "Helionè´¨é‡" #: ../data/variables.xml.in.h:111 msgid "r:helion_mass,ais:m_h" msgstr "" #: ../data/variables.xml.in.h:112 msgid "Neutron Mass" msgstr "中å­è´¨é‡" #: ../data/variables.xml.in.h:113 msgid "r:neutron_mass,ais:m_n" msgstr "" #: ../data/variables.xml.in.h:114 msgid "Proton Mass" msgstr "è´¨å­è´¨é‡" #: ../data/variables.xml.in.h:115 msgid "r:proton_mass,ais:m_p" msgstr "" #: ../data/variables.xml.in.h:116 msgid "Rydberg Constant" msgstr "里德伯常数" #: ../data/variables.xml.in.h:117 msgid "r:rydberg,aisu:R_∞" msgstr "" #: ../data/variables.xml.in.h:118 msgid "Tau Mass" msgstr "γè´¨é‡" #: ../data/variables.xml.in.h:119 msgid "r:tau_mass,aisu:m_τ" msgstr "" #: ../data/variables.xml.in.h:120 msgid "Physico-Chemical Constants" msgstr "物ç†åŒ–学常数" #: ../data/variables.xml.in.h:121 msgid "Atomic Mass Constant" msgstr "原å­è´¨é‡å¸¸æ•°" #: ../data/variables.xml.in.h:122 msgid "r:atomic_mass,ais:m_u" msgstr "" #: ../data/variables.xml.in.h:123 msgid "Avogadro Constant" msgstr "阿佛加德罗常数" #: ../data/variables.xml.in.h:124 msgid "r:avogadro,ais:N_A" msgstr "" #: ../data/variables.xml.in.h:125 msgid "Boltzmann Constant" msgstr "玻耳兹曼常数" #: ../data/variables.xml.in.h:126 msgid "r:boltzmann,ais:k_B" msgstr "" #: ../data/variables.xml.in.h:127 msgid "Faraday Constant" msgstr "法拉第常数" #: ../data/variables.xml.in.h:128 msgid "r:faraday" msgstr "" #: ../data/variables.xml.in.h:129 msgid "First Radiation Constant" msgstr "第一è¾å°„常数" #: ../data/variables.xml.in.h:130 msgid "r:first_radiation,ais:c_1" msgstr "" #: ../data/variables.xml.in.h:131 msgid "Ideal Gas Constant" msgstr "ç†æƒ³æ°”体常数" #: ../data/variables.xml.in.h:132 msgid "r:ideal_gas" msgstr "" #: ../data/variables.xml.in.h:133 msgid "Second Radiation Constant" msgstr "第二è¾å°„常数" #: ../data/variables.xml.in.h:134 msgid "r:second_radiation,ais:c_2" msgstr "" #: ../data/variables.xml.in.h:135 msgid "Basic Constants" msgstr "基本常数" #: ../data/variables.xml.in.h:136 msgid "Golden Ratio" msgstr "黄金比例" #: ../data/variables.xml.in.h:137 msgid "r:golden,au:φ" msgstr "" #: ../data/variables.xml.in.h:138 msgid "Omega Constant" msgstr "Ω常数" #: ../data/variables.xml.in.h:139 msgid "r:omega" msgstr "" #: ../data/variables.xml.in.h:140 msgid "Pythagoras' Constant (sqrt 2)" msgstr "毕达哥拉斯常数(æ ¹å·2)" #: ../data/variables.xml.in.h:141 msgid "r:pythagoras" msgstr "" #: ../data/variables.xml.in.h:142 msgid "Apery's Constant" msgstr "Apery常数" #: ../data/variables.xml.in.h:143 msgid "r:apery" msgstr "" #: ../data/variables.xml.in.h:144 msgid "Base of Natural Logarithms (e)" msgstr "自然对数的底e" #: ../data/variables.xml.in.h:145 msgid "r:e" msgstr "" #: ../data/variables.xml.in.h:146 msgid "Archimedes' Constant (pi)" msgstr "圆周率(π)" #: ../data/variables.xml.in.h:147 msgid "au:π,r:pi" msgstr "" #: ../data/variables.xml.in.h:148 msgid "Euler's Constant" msgstr "欧拉常数" #: ../data/variables.xml.in.h:149 msgid "au:γ,r:euler" msgstr "" #: ../data/variables.xml.in.h:150 msgid "Catalan's Constant" msgstr "Catalan常数" #: ../data/variables.xml.in.h:151 msgid "r:catalan" msgstr "" #: ../data/variables.xml.in.h:152 msgid "Special Numbers" msgstr "特殊数字" #: ../data/variables.xml.in.h:153 msgid "Imaginary i (sqrt -1)" msgstr "虚数i(sqrt -1)" #: ../data/variables.xml.in.h:154 msgid "r:i" msgstr "" #: ../data/variables.xml.in.h:155 msgid "Positive Infinity" msgstr "正无穷" #: ../data/variables.xml.in.h:156 msgid "a:∞,r:plus_infinity,r:infinity" msgstr "" #: ../data/variables.xml.in.h:157 msgid "Negative Infinity" msgstr "è´Ÿæ— ç©·" #: ../data/variables.xml.in.h:158 msgid "r:minus_infinity" msgstr "" #: ../data/variables.xml.in.h:159 msgid "Undefined" msgstr "未定义的" #: ../data/variables.xml.in.h:160 msgid "r:undefined" msgstr "" #: ../data/variables.xml.in.h:161 #, fuzzy msgid "Precision" msgstr "回归分æž" #: ../data/variables.xml.in.h:162 #, fuzzy msgid "r:precision" msgstr "表达å¼" #: ../data/variables.xml.in.h:163 msgid "False" msgstr "å‡" #: ../data/variables.xml.in.h:164 msgid "r:false,r:no" msgstr "" #: ../data/variables.xml.in.h:165 msgid "True" msgstr "真" #: ../data/variables.xml.in.h:166 msgid "r:true,r:yes" msgstr "" #: ../data/variables.xml.in.h:167 msgid "Unknowns" msgstr "未知数" #: ../data/variables.xml.in.h:168 msgid "r:x" msgstr "" #: ../data/variables.xml.in.h:169 msgid "r:y" msgstr "" #: ../data/variables.xml.in.h:170 msgid "r:z" msgstr "" #: ../data/variables.xml.in.h:171 #, fuzzy msgid "n (integer)" msgstr "是整数" #: ../data/variables.xml.in.h:172 #, fuzzy msgid "r:n" msgstr "r:covalent" #: ../data/variables.xml.in.h:174 msgid "Today" msgstr "" #: ../data/variables.xml.in.h:175 msgid "r:today" msgstr "" #: ../data/variables.xml.in.h:176 msgid "Tomorrow" msgstr "" #: ../data/variables.xml.in.h:177 msgid "r:tomorrow" msgstr "" #: ../data/variables.xml.in.h:178 msgid "Yesterday" msgstr "" #: ../data/variables.xml.in.h:179 msgid "r:yesterday" msgstr "" #: ../data/variables.xml.in.h:180 msgid "Now (date and time)" msgstr "" #: ../data/variables.xml.in.h:181 msgid "r:now" msgstr "" #~ msgid "Returns an integer from a binary number" #~ msgstr "返回一个二进制数字表示的整数值。" #~ msgid "Returns an integer from an octal number" #~ msgstr "返回一个八进制数字表示的整数值。" #~ msgid "Standard Date Format" #~ msgstr "标准日期格å¼" #~ msgid "Local Date Format" #~ msgstr "本地日期格å¼" #~ msgid "ar:ITL,au:₤,lira" #~ msgstr "ar:ITL,au:₤,里拉" #~ msgid "ar:ATS,schilling" #~ msgstr "a:ATS,先令" #~ msgid "Infinity" #~ msgstr "æ— ç©·" #, fuzzy #~ msgid "au:∫,r:integrate" #~ msgstr "au:¢,r:美分" #~ msgid "Analysis" #~ msgstr "分æž" #~ msgid "Durbin-Watson" #~ msgstr "Durbin-Watson" #~ msgid "Sum" #~ msgstr "求和" #~ msgid "Product" #~ msgstr "连乘" #~ msgid "Consumer Surplus" #~ msgstr "消费者剩余" #~ msgid "Supply function or price" #~ msgstr "供给函数或价格" #~ msgid "Quantity variabel" #~ msgstr "æ•°é‡å˜é‡" #~ msgid "Supply function" #~ msgstr "供给函数" #~ msgid "Demand function or price" #~ msgstr "需求函数或价格" #~ msgid "Finance" #~ msgstr "金èž" #~ msgid "Calculates the duration of a security." #~ msgstr "计算债券的æŒç»­æ—¶é—´ã€‚" #~ msgid "Annual coupon rate (%)" #~ msgstr "å¹´æ¯ç¥¨åˆ©çއ(%)" #~ msgid "Annualized yield (%)" #~ msgstr "年度基础æ¢ç®—åŽçš„æ”¶ç›Šçއ(%)" #~ msgid "Cental" #~ msgstr "百磅" #~ msgid "Returns a sorted vector. ex. sort([6, 1, 4])=[1, 4, 6]" #~ msgstr "对å‘釿ޒåºåŽè¿”回。 例如, sort([6, 1, 4])=[1, 4, 6]" #~ msgid "Cup" #~ msgstr "æ¯" #~ msgid "r:cbrt" #~ msgstr "r:cbrt" #~ msgid "ar:FRF,franc" #~ msgstr "ar:FRF,法郎" #~ msgid "Ionization Potential" #~ msgstr "电离电ä½" #~ msgid "r:ionization" #~ msgstr "r:ionization" #~ msgid "Covalent Radius" #~ msgstr "共价åŠå¾„" #, fuzzy #~ msgid "Value 1 (n)" #~ msgstr "值1(i)" #~ msgid "Price per $100 face value of a security bond" #~ msgstr "一支债券æ¯$100票é¢ä»·å€¼çš„ä»·æ ¼" #~ msgid "r:infinity" #~ msgstr "r:infinity" #~ msgid "Derive" #~ msgstr "求导" libqalculate-2.8.2/po-defs/Makefile.am0000644000175000017500000000011212705146643014501 00000000000000# # po-defs/Makefile.am for qalculate # EXTRA_DIST = \ POTFILES.in *.po libqalculate-2.8.2/po-defs/POTFILES.in0000644000175000017500000000036212705146643014231 00000000000000# List of source files containing translatable strings. [encoding: UTF-8] data/currencies.xml.in data/datasets.xml.in data/elements.xml.in data/functions.xml.in data/planets.xml.in data/prefixes.xml.in data/units.xml.in data/variables.xml.in libqalculate-2.8.2/COPYING0000644000175000017500000004311012705146643012150 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 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 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libqalculate-2.8.2/config.guess0000755000175000017500000012620613350174156013442 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-03-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # 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 General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: